libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit de383203d4d7921bf331510bc898ab88c5844731
parent 21be8eccb987b6d5fe05d3827ff97c23b8e630cc
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 14 Dec 2021 18:23:06 +0300

Reworked dlltool supported.

* Added support for weakened oversimplified half-broken llvm-dlltool
* Streamlined makefile receipts for W32 .dll and related files
* Added support for verbose/silent makefile rules
* Removed redundant printing from makefile
* Added makefile receipts for proper generation of all required files
* Silenced MS lib warning
* Silenced MS lib invocation

Diffstat:
Mconfigure.ac | 25++++++++++++++++++++++---
Msrc/microhttpd/Makefile.am | 45++++++++++++++++++++++++++++++++-------------
2 files changed, 54 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -1024,7 +1024,25 @@ w32_shared_lib_exp=no AS_IF([test "x$enable_shared" = "xyes" && test "x$os_is_native_w32" = "xyes"], [ AS_IF([test "x$ac_cv_use_ms_lib_tool" = "xyes" || test -n "$DLLTOOL"], - [w32_shared_lib_exp=yes], + [ + w32_shared_lib_exp=yes + use_expfile="no" + AS_VAR_IF([ac_cv_use_ms_lib_tool], ["yes"], [use_expfile="yes"], + [ + AC_CACHE_CHECK([whether $DLLTOOL supports export file generation], [mhd_cv_dlltool_expfile], + [ + AS_IF([AC_RUN_LOG([$DLLTOOL -e conftest.exp >&2 ])], + [ + AS_IF([test -f conftest.exp], [mhd_cv_dlltool_expfile="yes"], [mhd_cv_dlltool_expfile="no"]) + ], [mhd_cv_dlltool_expfile="no"] + ) + rm -f conftest.exp + ] + ) + use_expfile="${mhd_cv_dlltool_expfile}" + ] + ) + ], [ AC_MSG_WARN([[GNU dlltool or MS lib.exe is required for creating shared library export on W32]]) AC_MSG_WARN([[Export library libmicrohttpd.lib will not be created]]) @@ -1032,8 +1050,9 @@ AS_IF([test "x$enable_shared" = "xyes" && test "x$os_is_native_w32" = "xyes"], ) ] ) -AM_CONDITIONAL(W32_SHARED_LIB_EXP, [test "x$w32_shared_lib_exp" = "xyes"]) -AM_CONDITIONAL(USE_MS_LIB_TOOL, [test "x$ac_cv_use_ms_lib_tool" = "xyes"]) +AM_CONDITIONAL([W32_SHARED_LIB_EXP], [test "x$w32_shared_lib_exp" = "xyes"]) +AM_CONDITIONAL([USE_MS_LIB_TOOL], [test "x$ac_cv_use_ms_lib_tool" = "xyes"]) +AM_CONDITIONAL([USE_EXPORT_FILE], [test "x$use_expfile" = "xyes"]) MHD_CHECK_SOCKET_SHUTDOWN_TRIGGER([AC_DEFINE([HAVE_LISTEN_SHUTDOWN],[1],[can use shutdown on listen sockets])]) AM_CONDITIONAL([HAVE_LISTEN_SHUTDOWN], [test "x$mhd_cv_host_shtdwn_trgr_select" = "xyes"]) diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am @@ -1,4 +1,5 @@ # This Makefile.am is in the public domain + AM_CPPFLAGS = \ -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/microhttpd @@ -12,28 +13,46 @@ noinst_DATA = MOSTLYCLEANFILES = if W32_SHARED_LIB_EXP +AM_V_DLLTOOL = $(am__v_DLLTOOL_$(V)) +am__v_DLLTOOL_ = $(am__v_DLLTOOL_$(AM_DEFAULT_VERBOSITY)) +am__v_DLLTOOL_0 = @echo " DLLTOOL " $@; +am__v_DLLTOOL_1 = + +AM_V_LIB = $(am__v_LIB_$(V)) +am__v_LIB_ = $(am__v_LIB_$(AM_DEFAULT_VERBOSITY)) +am__v_LIB_0 = @echo " LIB " $@; +am__v_LIB_1 = + W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd.def -XCClinker -static-libgcc -noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp +noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp $(lt_cv_objdir)/libmicrohttpd.def: libmicrohttpd.la + $(AM_V_at)test -f $@ && touch $@ || \ + ( rm -f libmicrohttpd.la ; $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.la && touch $@ ) + +if USE_EXPORT_FILE +noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.exp $(lt_cv_objdir)/libmicrohttpd.exp: $(lt_cv_objdir)/libmicrohttpd.lib + $(AM_V_at)test -f $@ && touch $@ || \ + ( rm -f $(lt_cv_objdir)/libmicrohttpd.lib ; $(MAKE) $(AM_MAKEFLAGS) $(lt_cv_objdir)/libmicrohttpd.lib && touch $@ ) +endif -$(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) if USE_MS_LIB_TOOL - @echo Creating $@ and libmicrohttpd.exp by $(MS_LIB_TOOL)... && \ - dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd.la` && \ - dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \ - echo Creating $$dll_name by $(MS_LIB_TOOL).. && cd "$(lt_cv_objdir)" && \ - $(MS_LIB_TOOL) -def:libmicrohttpd.def -name:$$dll_name -out:libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) && cd .. +$(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) + $(AM_V_at)$(AM_V_LIB) cd "$(lt_cv_objdir)" && dll_name=`$(SED) -n -e "s/^dlname='\(.*\)'/\1/p" libmicrohttpd.la` && test -n "$$dll_name" && \ + $(MS_LIB_TOOL) -nologo -def:libmicrohttpd.def -name:$$dll_name -out:libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -ignore:4221 else - @echo Creating $@ and libmicrohttpd.exp by $(DLLTOOL)... && \ - dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd.la` && \ - dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \ - echo Creating $$dll_name by $(DLLTOOL).. && cd "$(lt_cv_objdir)" && \ - $(DLLTOOL) -d ./libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -e ./libmicrohttpd.exp && cd .. &&\ - echo Created libmicrohttpd.exp and libmicrohttpd.lib. +if USE_EXPORT_FILE +$(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.exp: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) + $(AM_V_at)$(AM_V_DLLTOOL) cd "$(lt_cv_objdir)" && dll_name=`$(SED) -n -e "s/^dlname='\(.*\)'/\1/p" libmicrohttpd.la` && test -n "$$dll_name" && \ + $(DLLTOOL) -d libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -e ./libmicrohttpd.exp +else +$(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la + $(AM_V_at)$(AM_V_DLLTOOL) cd "$(lt_cv_objdir)" && dll_name=`$(SED) -n -e "s/^dlname='\(.*\)'/\1/p" libmicrohttpd.la` && test -n "$$dll_name" && \ + $(DLLTOOL) -d libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib +endif endif else W32_MHD_LIB_LDFLAGS =