diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-12-14 18:23:06 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-12-14 18:23:06 +0300 |
commit | de383203d4d7921bf331510bc898ab88c5844731 (patch) | |
tree | b98bba15684bc005be0fd7aacbfc87aa890161e8 | |
parent | 21be8eccb987b6d5fe05d3827ff97c23b8e630cc (diff) | |
download | libmicrohttpd-de383203d4d7921bf331510bc898ab88c5844731.tar.gz libmicrohttpd-de383203d4d7921bf331510bc898ab88c5844731.zip |
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
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | src/microhttpd/Makefile.am | 45 |
2 files changed, 54 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index 998cc385..68f8f0d3 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1024,7 +1024,25 @@ w32_shared_lib_exp=no | |||
1024 | AS_IF([test "x$enable_shared" = "xyes" && test "x$os_is_native_w32" = "xyes"], | 1024 | AS_IF([test "x$enable_shared" = "xyes" && test "x$os_is_native_w32" = "xyes"], |
1025 | [ | 1025 | [ |
1026 | AS_IF([test "x$ac_cv_use_ms_lib_tool" = "xyes" || test -n "$DLLTOOL"], | 1026 | AS_IF([test "x$ac_cv_use_ms_lib_tool" = "xyes" || test -n "$DLLTOOL"], |
1027 | [w32_shared_lib_exp=yes], | 1027 | [ |
1028 | w32_shared_lib_exp=yes | ||
1029 | use_expfile="no" | ||
1030 | AS_VAR_IF([ac_cv_use_ms_lib_tool], ["yes"], [use_expfile="yes"], | ||
1031 | [ | ||
1032 | AC_CACHE_CHECK([whether $DLLTOOL supports export file generation], [mhd_cv_dlltool_expfile], | ||
1033 | [ | ||
1034 | AS_IF([AC_RUN_LOG([$DLLTOOL -e conftest.exp >&2 ])], | ||
1035 | [ | ||
1036 | AS_IF([test -f conftest.exp], [mhd_cv_dlltool_expfile="yes"], [mhd_cv_dlltool_expfile="no"]) | ||
1037 | ], [mhd_cv_dlltool_expfile="no"] | ||
1038 | ) | ||
1039 | rm -f conftest.exp | ||
1040 | ] | ||
1041 | ) | ||
1042 | use_expfile="${mhd_cv_dlltool_expfile}" | ||
1043 | ] | ||
1044 | ) | ||
1045 | ], | ||
1028 | [ | 1046 | [ |
1029 | AC_MSG_WARN([[GNU dlltool or MS lib.exe is required for creating shared library export on W32]]) | 1047 | AC_MSG_WARN([[GNU dlltool or MS lib.exe is required for creating shared library export on W32]]) |
1030 | AC_MSG_WARN([[Export library libmicrohttpd.lib will not be created]]) | 1048 | 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"], | |||
1032 | ) | 1050 | ) |
1033 | ] | 1051 | ] |
1034 | ) | 1052 | ) |
1035 | AM_CONDITIONAL(W32_SHARED_LIB_EXP, [test "x$w32_shared_lib_exp" = "xyes"]) | 1053 | AM_CONDITIONAL([W32_SHARED_LIB_EXP], [test "x$w32_shared_lib_exp" = "xyes"]) |
1036 | AM_CONDITIONAL(USE_MS_LIB_TOOL, [test "x$ac_cv_use_ms_lib_tool" = "xyes"]) | 1054 | AM_CONDITIONAL([USE_MS_LIB_TOOL], [test "x$ac_cv_use_ms_lib_tool" = "xyes"]) |
1055 | AM_CONDITIONAL([USE_EXPORT_FILE], [test "x$use_expfile" = "xyes"]) | ||
1037 | 1056 | ||
1038 | MHD_CHECK_SOCKET_SHUTDOWN_TRIGGER([AC_DEFINE([HAVE_LISTEN_SHUTDOWN],[1],[can use shutdown on listen sockets])]) | 1057 | MHD_CHECK_SOCKET_SHUTDOWN_TRIGGER([AC_DEFINE([HAVE_LISTEN_SHUTDOWN],[1],[can use shutdown on listen sockets])]) |
1039 | AM_CONDITIONAL([HAVE_LISTEN_SHUTDOWN], [test "x$mhd_cv_host_shtdwn_trgr_select" = "xyes"]) | 1058 | 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 index a98fbd9e..cbb6c8c8 100644 --- a/src/microhttpd/Makefile.am +++ b/src/microhttpd/Makefile.am | |||
@@ -1,4 +1,5 @@ | |||
1 | # This Makefile.am is in the public domain | 1 | # This Makefile.am is in the public domain |
2 | |||
2 | AM_CPPFLAGS = \ | 3 | AM_CPPFLAGS = \ |
3 | -I$(top_srcdir)/src/include \ | 4 | -I$(top_srcdir)/src/include \ |
4 | -I$(top_srcdir)/src/microhttpd | 5 | -I$(top_srcdir)/src/microhttpd |
@@ -12,28 +13,46 @@ noinst_DATA = | |||
12 | MOSTLYCLEANFILES = | 13 | MOSTLYCLEANFILES = |
13 | 14 | ||
14 | if W32_SHARED_LIB_EXP | 15 | if W32_SHARED_LIB_EXP |
16 | AM_V_DLLTOOL = $(am__v_DLLTOOL_$(V)) | ||
17 | am__v_DLLTOOL_ = $(am__v_DLLTOOL_$(AM_DEFAULT_VERBOSITY)) | ||
18 | am__v_DLLTOOL_0 = @echo " DLLTOOL " $@; | ||
19 | am__v_DLLTOOL_1 = | ||
20 | |||
21 | AM_V_LIB = $(am__v_LIB_$(V)) | ||
22 | am__v_LIB_ = $(am__v_LIB_$(AM_DEFAULT_VERBOSITY)) | ||
23 | am__v_LIB_0 = @echo " LIB " $@; | ||
24 | am__v_LIB_1 = | ||
25 | |||
15 | W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd.def -XCClinker -static-libgcc | 26 | W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd.def -XCClinker -static-libgcc |
16 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp | 27 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def |
17 | MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp | 28 | MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp |
18 | 29 | ||
19 | $(lt_cv_objdir)/libmicrohttpd.def: libmicrohttpd.la | 30 | $(lt_cv_objdir)/libmicrohttpd.def: libmicrohttpd.la |
31 | $(AM_V_at)test -f $@ && touch $@ || \ | ||
32 | ( rm -f libmicrohttpd.la ; $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.la && touch $@ ) | ||
33 | |||
34 | if USE_EXPORT_FILE | ||
35 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.exp | ||
20 | 36 | ||
21 | $(lt_cv_objdir)/libmicrohttpd.exp: $(lt_cv_objdir)/libmicrohttpd.lib | 37 | $(lt_cv_objdir)/libmicrohttpd.exp: $(lt_cv_objdir)/libmicrohttpd.lib |
38 | $(AM_V_at)test -f $@ && touch $@ || \ | ||
39 | ( rm -f $(lt_cv_objdir)/libmicrohttpd.lib ; $(MAKE) $(AM_MAKEFLAGS) $(lt_cv_objdir)/libmicrohttpd.lib && touch $@ ) | ||
40 | endif | ||
22 | 41 | ||
23 | $(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) | ||
24 | if USE_MS_LIB_TOOL | 42 | if USE_MS_LIB_TOOL |
25 | @echo Creating $@ and libmicrohttpd.exp by $(MS_LIB_TOOL)... && \ | 43 | $(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) |
26 | dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd.la` && \ | 44 | $(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" && \ |
27 | dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \ | 45 | $(MS_LIB_TOOL) -nologo -def:libmicrohttpd.def -name:$$dll_name -out:libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -ignore:4221 |
28 | echo Creating $$dll_name by $(MS_LIB_TOOL).. && cd "$(lt_cv_objdir)" && \ | ||
29 | $(MS_LIB_TOOL) -def:libmicrohttpd.def -name:$$dll_name -out:libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) && cd .. | ||
30 | else | 46 | else |
31 | @echo Creating $@ and libmicrohttpd.exp by $(DLLTOOL)... && \ | 47 | if USE_EXPORT_FILE |
32 | dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd.la` && \ | 48 | $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.exp: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) |
33 | dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \ | 49 | $(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" && \ |
34 | echo Creating $$dll_name by $(DLLTOOL).. && cd "$(lt_cv_objdir)" && \ | 50 | $(DLLTOOL) -d libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -e ./libmicrohttpd.exp |
35 | $(DLLTOOL) -d ./libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -e ./libmicrohttpd.exp && cd .. &&\ | 51 | else |
36 | echo Created libmicrohttpd.exp and libmicrohttpd.lib. | 52 | $(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la |
53 | $(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" && \ | ||
54 | $(DLLTOOL) -d libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib | ||
55 | endif | ||
37 | endif | 56 | endif |
38 | else | 57 | else |
39 | W32_MHD_LIB_LDFLAGS = | 58 | W32_MHD_LIB_LDFLAGS = |