aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac39
-rw-r--r--src/Makefile.am3
-rw-r--r--src/gnutls/init.c73
-rw-r--r--src/gnutls/init.h6
-rw-r--r--src/lib/Makefile.am74
-rw-r--r--src/microhttpd/Makefile.am8
6 files changed, 77 insertions, 126 deletions
diff --git a/configure.ac b/configure.ac
index 03aba82b..4628de86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1692,7 +1692,7 @@ AS_IF([test "x$have_gnutls" != "xyes" && test "x$with_gnutls" = "xyes"], [AC_MSG
1692 gnutls_free(data.data); 1692 gnutls_free(data.data);
1693 ]])], [[have_gnutls_sni=yes]], [[have_gnutls_sni=no]]) 1693 ]])], [[have_gnutls_sni=yes]], [[have_gnutls_sni=no]])
1694 AC_MSG_RESULT([[$have_gnutls_sni]]) 1694 AC_MSG_RESULT([[$have_gnutls_sni]])
1695 AC_CACHE_CHECK([[whether GnuTLS require libgcrypt initialisaion]], [mhd_cv_grypt_required], 1695 AC_CACHE_CHECK([[whether GnuTLS require libgcrypt initialisaion]], [mhd_cv_gcrypt_required],
1696 [ 1696 [
1697 AC_COMPILE_IFELSE( 1697 AC_COMPILE_IFELSE(
1698 [ 1698 [
@@ -1708,7 +1708,7 @@ choke me now
1708 ] 1708 ]
1709 ) 1709 )
1710 ], 1710 ],
1711 [[mhd_cv_grypt_required='no']], [[mhd_cv_grypt_required='yes']] 1711 [[mhd_cv_gcrypt_required='no']], [[mhd_cv_gcrypt_required='yes']]
1712 ) 1712 )
1713 ] 1713 ]
1714 ) 1714 )
@@ -1723,7 +1723,7 @@ choke me now
1723 ] 1723 ]
1724 ) 1724 )
1725 1725
1726 AS_IF([[test "x$mhd_cv_grypt_required" = "xyes" && test "x$have_gcrypt" = "xunknown"]], 1726 AS_IF([[test "x$mhd_cv_gcrypt_required" = "xyes" && test "x$have_gcrypt" = "xunknown"]],
1727 [ 1727 [
1728 AM_PATH_LIBGCRYPT([1.2.2], [have_gcrypt=yes], [have_gcrypt=no]) 1728 AM_PATH_LIBGCRYPT([1.2.2], [have_gcrypt=yes], [have_gcrypt=no])
1729 AS_IF([[test "x$have_gcrypt" = "xyes"]], 1729 AS_IF([[test "x$have_gcrypt" = "xyes"]],
@@ -1744,7 +1744,7 @@ choke me now
1744 AS_UNSET([[crypt_missing]]) 1744 AS_UNSET([[crypt_missing]])
1745 AS_IF([[test "x$have_gnutls" = "xyes"]], 1745 AS_IF([[test "x$have_gnutls" = "xyes"]],
1746 [ 1746 [
1747 AS_IF([[test "x$mhd_cv_grypt_required" = "xyes" && test "x$have_gcrypt" != "xyes"]], 1747 AS_IF([[test "x$mhd_cv_gcrypt_required" = "xyes" && test "x$have_gcrypt" != "xyes"]],
1748 [ 1748 [
1749 crypt_missing="required libgcrypt" 1749 crypt_missing="required libgcrypt"
1750 AS_IF([[test "x$enable_https" = "xyes" ]], [AC_MSG_ERROR([[HTTPS support cannot be enabled without $crypt_missing.]])]) 1750 AS_IF([[test "x$enable_https" = "xyes" ]], [AC_MSG_ERROR([[HTTPS support cannot be enabled without $crypt_missing.]])])
@@ -1760,35 +1760,35 @@ choke me now
1760 [ 1760 [
1761 AC_DEFINE([[HTTPS_SUPPORT]],[[1]],[Define to 1 if libmicrohttpd is compiled with HTTPS support.]) 1761 AC_DEFINE([[HTTPS_SUPPORT]],[[1]],[Define to 1 if libmicrohttpd is compiled with HTTPS support.])
1762 enable_https=yes 1762 enable_https=yes
1763 AS_IF([[test "x$mhd_cv_grypt_required" = "xyes"]], 1763 AS_IF([[test "x$mhd_cv_gcrypt_required" = "xyes"]],
1764 [ 1764 [
1765 MSG_HTTPS="yes (using libgnutls and libgcrypt)" 1765 MSG_HTTPS="yes (using libgnutls and libgcrypt)"
1766 MHD_LIB_CPPFLAGS="$MHD_LIB_CPPFLAGS $LIBGCRYPT_CFLAGS $GNUTLS_CPPFLAGS" 1766 MHD_TLS_LIB_CPPFLAGS="$LIBGCRYPT_CFLAGS $GNUTLS_CPPFLAGS"
1767 MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS" 1767 MHD_TLS_LIB_CFLAGS="$LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS"
1768 MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS $GNUTLS_LDFLAGS" 1768 MHD_TLS_LIB_LDFLAGS="$GNUTLS_LDFLAGS"
1769 MHD_LIBDEPS="$GNUTLS_LIBS $LIBGCRYPT_LIBS $MHD_LIBDEPS" 1769 MHD_TLS_LIBDEPS="$GNUTLS_LIBS $LIBGCRYPT_LIBS"
1770 AC_DEFINE([[MHD_HTTPS_REQUIRE_GRYPT]], [[1]], [Define to `1' if HTTPS require initialisation of libgcrypt]) 1770 AC_DEFINE([[MHD_HTTPS_REQUIRE_GCRYPT]], [[1]], [Define to `1' if HTTPS require initialisation of libgcrypt])
1771 ], 1771 ],
1772 [ 1772 [
1773 MSG_HTTPS="yes (using libgnutls)" 1773 MSG_HTTPS="yes (using libgnutls)"
1774 AS_UNSET([LIBGCRYPT_CFLAGS]) 1774 AS_UNSET([LIBGCRYPT_CFLAGS])
1775 AS_UNSET([LIBGCRYPT_LIBS]) 1775 AS_UNSET([LIBGCRYPT_LIBS])
1776 MHD_LIB_CPPFLAGS="$MHD_LIB_CPPFLAGS $GNUTLS_CPPFLAGS" 1776 MHD_TLS_LIB_CPPFLAGS="$GNUTLS_CPPFLAGS"
1777 MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $GNUTLS_CFLAGS" 1777 MHD_TLS_LIB_CFLAGS="$GNUTLS_CFLAGS"
1778 MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS $GNUTLS_LDFLAGS" 1778 MHD_TLS_LIB_LDFLAGS="$GNUTLS_LDFLAGS"
1779 MHD_LIBDEPS="$GNUTLS_LIBS $MHD_LIBDEPS" 1779 MHD_TLS_LIBDEPS="$GNUTLS_LIBS"
1780 ] 1780 ]
1781 ) 1781 )
1782 AS_IF([[ test "x$have_gnutls_pkgcfg" = "xyes" ]], 1782 AS_IF([[ test "x$have_gnutls_pkgcfg" = "xyes" ]],
1783 [ # remove GnuTLS from private libs in .pc file as it defined in Requires.private 1783 [ # remove GnuTLS from private libs in .pc file as it defined in Requires.private
1784 MHD_REQ_PRIVATE='gnutls' 1784 MHD_REQ_PRIVATE='gnutls'
1785 AS_IF([[test "x$mhd_cv_grypt_required" = "xyes"]], 1785 AS_IF([[test "x$mhd_cv_gcrypt_required" = "xyes"]],
1786 [[MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"]] 1786 [[MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"]]
1787 ) 1787 )
1788 ], 1788 ],
1789 [ 1789 [
1790 MHD_REQ_PRIVATE='' 1790 MHD_REQ_PRIVATE=''
1791 AS_IF([[test "x$mhd_cv_grypt_required" = "xyes"]], 1791 AS_IF([[test "x$mhd_cv_gcrypt_required" = "xyes"]],
1792 [[MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"]] 1792 [[MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"]]
1793 ) 1793 )
1794 MHD_LIBDEPS_PKGCFG="$GNUTLS_LIBS $MHD_LIBDEPS_PKGCFG" 1794 MHD_LIBDEPS_PKGCFG="$GNUTLS_LIBS $MHD_LIBDEPS_PKGCFG"
@@ -1818,7 +1818,7 @@ AC_MSG_RESULT([$MSG_HTTPS])
1818AM_CONDITIONAL([HAVE_GNUTLS], [[test "x$have_gnutls" = "xyes"]]) 1818AM_CONDITIONAL([HAVE_GNUTLS], [[test "x$have_gnutls" = "xyes"]])
1819AM_CONDITIONAL([HAVE_GNUTLS_SNI], [[test "x$have_gnutls_sni" = "xyes"]]) 1819AM_CONDITIONAL([HAVE_GNUTLS_SNI], [[test "x$have_gnutls_sni" = "xyes"]])
1820AM_CONDITIONAL([ENABLE_HTTPS], [test "x$enable_https" = "xyes"]) 1820AM_CONDITIONAL([ENABLE_HTTPS], [test "x$enable_https" = "xyes"])
1821AM_CONDITIONAL([HTTPS_REQUIRE_GRYPT], [[test "x$enable_https" = "xyes" && test "x$mhd_cv_grypt_required" = "xyes"]]) 1821AM_CONDITIONAL([HTTPS_REQUIRE_GCRYPT], [[test "x$enable_https" = "xyes" && test "x$mhd_cv_gcrypt_required" = "xyes"]])
1822AC_SUBST([GNUTLS_CPPFLAGS]) 1822AC_SUBST([GNUTLS_CPPFLAGS])
1823AC_SUBST([GNUTLS_CFLAGS]) 1823AC_SUBST([GNUTLS_CFLAGS])
1824AC_SUBST([GNUTLS_LDFLAGS]) 1824AC_SUBST([GNUTLS_LDFLAGS])
@@ -1990,6 +1990,10 @@ AC_SUBST(MHD_LIB_CPPFLAGS)
1990AC_SUBST(MHD_LIB_CFLAGS) 1990AC_SUBST(MHD_LIB_CFLAGS)
1991AC_SUBST(MHD_LIB_LDFLAGS) 1991AC_SUBST(MHD_LIB_LDFLAGS)
1992AC_SUBST(MHD_LIBDEPS) 1992AC_SUBST(MHD_LIBDEPS)
1993AC_SUBST(MHD_TLS_LIB_CPPFLAGS)
1994AC_SUBST(MHD_TLS_LIB_CFLAGS)
1995AC_SUBST(MHD_TLS_LIB_LDFLAGS)
1996AC_SUBST(MHD_TLS_LIBDEPS)
1993 1997
1994# for pkg-config 1998# for pkg-config
1995AC_SUBST([MHD_REQ_PRIVATE]) 1999AC_SUBST([MHD_REQ_PRIVATE])
@@ -2022,6 +2026,7 @@ doc/examples/Makefile
2022m4/Makefile 2026m4/Makefile
2023src/Makefile 2027src/Makefile
2024src/include/Makefile 2028src/include/Makefile
2029src/lib/Makefile
2025src/microhttpd/Makefile 2030src/microhttpd/Makefile
2026src/examples/Makefile 2031src/examples/Makefile
2027src/testcurl/Makefile 2032src/testcurl/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 09af041d..7cdcace0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,6 +14,9 @@ if BUILD_EXAMPLES
14SUBDIRS += examples 14SUBDIRS += examples
15endif 15endif
16 16
17# Finally (last!) also build experimental lib...
18SUBDIRS += lib
19
17EXTRA_DIST = \ 20EXTRA_DIST = \
18 datadir/cert-and-key.pem \ 21 datadir/cert-and-key.pem \
19 datadir/cert-and-key-for-wireshark.pem 22 datadir/cert-and-key-for-wireshark.pem
diff --git a/src/gnutls/init.c b/src/gnutls/init.c
index 8ca5cd28..3dd656b1 100644
--- a/src/gnutls/init.c
+++ b/src/gnutls/init.c
@@ -18,12 +18,9 @@
18*/ 18*/
19 19
20/** 20/**
21 * @file lib/init.c 21 * @file gnutls/init.c
22 * @brief initialization routines 22 * @brief gnutls-specific initialization routines
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 *
25 * TODO: most of this is only required for gcrypt/GNUtls,
26 * should probably be moved to TLS plugin!
27 */ 24 */
28#include "internal.h" 25#include "internal.h"
29#include "init.h" 26#include "init.h"
@@ -35,6 +32,7 @@
35GCRY_THREAD_OPTION_PTHREAD_IMPL; 32GCRY_THREAD_OPTION_PTHREAD_IMPL;
36#elif defined(MHD_W32_MUTEX_) 33#elif defined(MHD_W32_MUTEX_)
37 34
35
38static int 36static int
39gcry_w32_mutex_init (void **ppmtx) 37gcry_w32_mutex_init (void **ppmtx)
40{ 38{
@@ -42,13 +40,12 @@ gcry_w32_mutex_init (void **ppmtx)
42 40
43 if (NULL == *ppmtx) 41 if (NULL == *ppmtx)
44 return ENOMEM; 42 return ENOMEM;
45 if (!MHD_mutex_init_ ((MHD_mutex_*)*ppmtx)) 43 if (! MHD_mutex_init_ ((MHD_mutex_*)*ppmtx))
46 { 44 {
47 free (*ppmtx); 45 free (*ppmtx);
48 *ppmtx = NULL; 46 *ppmtx = NULL;
49 return EPERM; 47 return EPERM;
50 } 48 }
51
52 return 0; 49 return 0;
53} 50}
54 51
@@ -108,7 +105,7 @@ MHD_MUTEX_STATIC_DEFN_INIT_(global_init_mutex_);
108 * and call initialiser if necessary. 105 * and call initialiser if necessary.
109 */ 106 */
110void 107void
111MHD_check_global_init_ (void) 108MHD_TLS_check_global_init_ (void)
112{ 109{
113#ifdef MHD_MUTEX_STATIC_DEFN_INIT_ 110#ifdef MHD_MUTEX_STATIC_DEFN_INIT_
114 MHD_mutex_lock_chk_(&global_init_mutex_); 111 MHD_mutex_lock_chk_(&global_init_mutex_);
@@ -122,57 +119,15 @@ MHD_check_global_init_ (void)
122 119
123 120
124/** 121/**
125 * Default implementation of the panic function,
126 * prints an error message and aborts.
127 *
128 * @param cls unused
129 * @param file name of the file with the problem
130 * @param line line number with the problem
131 * @param reason error message with details
132 */
133static void
134mhd_panic_std (void *cls,
135 const char *file,
136 unsigned int line,
137 const char *reason)
138{
139 (void)cls; /* Mute compiler warning. */
140#ifdef HAVE_MESSAGES
141 fprintf (stderr,
142 _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
143 file,
144 line,
145 reason);
146#else /* ! HAVE_MESSAGES */
147 (void)file; /* Mute compiler warning. */
148 (void)line; /* Mute compiler warning. */
149 (void)reason; /* Mute compiler warning. */
150#endif
151 abort ();
152}
153
154
155/**
156 * Initialize do setup work. 122 * Initialize do setup work.
157 */ 123 */
158void 124void
159MHD_init(void) 125MHD_TLS_init (void)
160{ 126{
161#if defined(_WIN32) && ! defined(__CYGWIN__) 127#if defined(_WIN32) && ! defined(__CYGWIN__)
162 WSADATA wsd; 128 WSADATA wsd;
163#endif /* _WIN32 && ! __CYGWIN__ */ 129#endif /* _WIN32 && ! __CYGWIN__ */
164 130
165 if (NULL == mhd_panic)
166 mhd_panic = &mhd_panic_std;
167
168#if defined(_WIN32) && ! defined(__CYGWIN__)
169 if (0 != WSAStartup(MAKEWORD(2, 2), &wsd))
170 MHD_PANIC (_("Failed to initialize winsock\n"));
171 mhd_winsock_inited_ = 1;
172 if (2 != LOBYTE(wsd.wVersion) && 2 != HIBYTE(wsd.wVersion))
173 MHD_PANIC (_("Winsock version 2.2 is not available\n"));
174#endif
175#ifdef HTTPS_SUPPORT
176#ifdef MHD_HTTPS_REQUIRE_GRYPT 131#ifdef MHD_HTTPS_REQUIRE_GRYPT
177#if GCRYPT_VERSION_NUMBER < 0x010600 132#if GCRYPT_VERSION_NUMBER < 0x010600
178#if defined(MHD_USE_POSIX_THREADS) 133#if defined(MHD_USE_POSIX_THREADS)
@@ -191,27 +146,15 @@ MHD_init(void)
191#endif 146#endif
192#endif /* MHD_HTTPS_REQUIRE_GRYPT */ 147#endif /* MHD_HTTPS_REQUIRE_GRYPT */
193 gnutls_global_init (); 148 gnutls_global_init ();
194#endif /* HTTPS_SUPPORT */
195 MHD_monotonic_sec_counter_init();
196#ifdef HAVE_FREEBSD_SENDFILE
197 MHD_conn_init_static_ ();
198#endif /* HAVE_FREEBSD_SENDFILE */
199} 149}
200 150
201 151
202void 152void
203MHD_fini(void) 153MHD_TLS_fini(void)
204{ 154{
205#ifdef HTTPS_SUPPORT
206 gnutls_global_deinit (); 155 gnutls_global_deinit ();
207#endif /* HTTPS_SUPPORT */
208#if defined(_WIN32) && ! defined(__CYGWIN__)
209 if (mhd_winsock_inited_)
210 WSACleanup();
211#endif
212 MHD_monotonic_sec_counter_finish();
213} 156}
214 157
215#ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED 158#ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED
216_SET_INIT_AND_DEINIT_FUNCS(MHD_init, MHD_fini); 159_SET_INIT_AND_DEINIT_FUNCS(MHD_TLS_init, MHD_TLS_fini);
217#endif /* _AUTOINIT_FUNCS_ARE_SUPPORTED */ 160#endif /* _AUTOINIT_FUNCS_ARE_SUPPORTED */
diff --git a/src/gnutls/init.h b/src/gnutls/init.h
index fae96159..03d19412 100644
--- a/src/gnutls/init.h
+++ b/src/gnutls/init.h
@@ -17,7 +17,7 @@
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/ 18*/
19/** 19/**
20 * @file lib/init.h 20 * @file gnutls/init.h
21 * @brief functions to initialize library 21 * @brief functions to initialize library
22 * @author Christian Grothoff 22 * @author Christian Grothoff
23 */ 23 */
@@ -31,14 +31,14 @@
31 * Do nothing - global initialisation is 31 * Do nothing - global initialisation is
32 * performed by library constructor. 32 * performed by library constructor.
33 */ 33 */
34#define MHD_check_global_init_() (void)0 34#define MHD_TLS_check_global_init_() (void)0
35#else /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */ 35#else /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */
36/** 36/**
37 * Check whether global initialisation was performed 37 * Check whether global initialisation was performed
38 * and call initialiser if necessary. 38 * and call initialiser if necessary.
39 */ 39 */
40void 40void
41MHD_check_global_init_ (void); 41MHD_TLS_check_global_init_ (void);
42#endif /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */ 42#endif /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */
43 43
44 44
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 320287d3..ce4dd8d4 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -5,54 +5,56 @@ AM_CPPFLAGS = \
5 5
6AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) 6AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS)
7 7
8lib_LTLIBRARIES = \ 8# Call "libmicrohttpd2" for now, but only while under
9 libmicrohttpd.la 9# development. Once we have 'compat' working, this should be changed!
10noinst_LTLIBRARIES = \
11 libmicrohttpd2.la
10 12
11noinst_DATA = 13noinst_DATA =
12MOSTLYCLEANFILES = 14MOSTLYCLEANFILES =
13 15
14if W32_SHARED_LIB_EXP 16if W32_SHARED_LIB_EXP
15W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd.def -XCClinker -static-libgcc 17W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd2.def -XCClinker -static-libgcc
16noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp 18noinst_DATA += $(lt_cv_objdir)/libmicrohttpd2.lib $(lt_cv_objdir)/libmicrohttpd2.def $(lt_cv_objdir)/libmicrohttpd2.exp
17MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp 19MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd2.lib $(lt_cv_objdir)/libmicrohttpd2.def $(lt_cv_objdir)/libmicrohttpd2.exp
18 20
19$(lt_cv_objdir)/libmicrohttpd.def: libmicrohttpd.la 21$(lt_cv_objdir)/libmicrohttpd2.def: libmicrohttpd2.la
20 22
21$(lt_cv_objdir)/libmicrohttpd.exp: $(lt_cv_objdir)/libmicrohttpd.lib 23$(lt_cv_objdir)/libmicrohttpd2.exp: $(lt_cv_objdir)/libmicrohttpd2.lib
22 24
23$(lt_cv_objdir)/libmicrohttpd.lib: $(lt_cv_objdir)/libmicrohttpd.def libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) 25$(lt_cv_objdir)/libmicrohttpd2.lib: $(lt_cv_objdir)/libmicrohttpd2.def libmicrohttpd2.la $(libmicrohttpd2_la_OBJECTS)
24if USE_MS_LIB_TOOL 26if USE_MS_LIB_TOOL
25 @echo Creating $@ and libmicrohttpd.exp by $(MS_LIB_TOOL)... && \ 27 @echo Creating $@ and libmicrohttpd2.exp by $(MS_LIB_TOOL)... && \
26 dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd.la` && \ 28 dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd2.la` && \
27 dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \ 29 dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \
28 echo Creating $$dll_name by $(MS_LIB_TOOL).. && cd "$(lt_cv_objdir)" && \ 30 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 .. 31 $(MS_LIB_TOOL) -def:libmicrohttpd2.def -name:$$dll_name -out:libmicrohttpd2.lib $(libmicrohttpd2_la_OBJECTS:.lo=.o) && cd ..
30else 32else
31 @echo Creating $@ and libmicrohttpd.exp by $(DLLTOOL)... && \ 33 @echo Creating $@ and libmicrohttpd2.exp by $(DLLTOOL)... && \
32 dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd.la` && \ 34 dll_name=`$(EGREP) -o dlname=\'.+\' libmicrohttpd2.la` && \
33 dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \ 35 dll_name=$${dll_name#*\'} && dll_name=$${dll_name%\'} && test -n "$$dll_name" && \
34 echo Creating $$dll_name by $(DLLTOOL).. && cd "$(lt_cv_objdir)" && \ 36 echo Creating $$dll_name by $(DLLTOOL).. && cd "$(lt_cv_objdir)" && \
35 $(DLLTOOL) -d ./libmicrohttpd.def -D $$dll_name -l libmicrohttpd.lib $(libmicrohttpd_la_OBJECTS:.lo=.o) -e ./libmicrohttpd.exp && cd .. &&\ 37 $(DLLTOOL) -d ./libmicrohttpd2.def -D $$dll_name -l libmicrohttpd2.lib $(libmicrohttpd2_la_OBJECTS:.lo=.o) -e ./libmicrohttpd2.exp && cd .. &&\
36 echo Created libmicrohttpd.exp and libmicrohttpd.lib. 38 echo Created libmicrohttpd2.exp and libmicrohttpd2.lib.
37endif 39endif
38else 40else
39 W32_MHD_LIB_LDFLAGS = 41 W32_MHD_LIB_LDFLAGS =
40endif 42endif
41 43
42if W32_STATIC_LIB 44if W32_STATIC_LIB
43noinst_DATA += $(lt_cv_objdir)/libmicrohttpd-static.lib 45noinst_DATA += $(lt_cv_objdir)/libmicrohttpd2-static.lib
44MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd-static.lib 46MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd2-static.lib
45 47
46$(lt_cv_objdir)/libmicrohttpd-static.lib: libmicrohttpd.la $(libmicrohttpd_la_OBJECTS) 48$(lt_cv_objdir)/libmicrohttpd2-static.lib: libmicrohttpd2.la $(libmicrohttpd2_la_OBJECTS)
47if USE_MS_LIB_TOOL 49if USE_MS_LIB_TOOL
48 $(MS_LIB_TOOL) -out:$@ $(libmicrohttpd_la_OBJECTS:.lo=.o) 50 $(MS_LIB_TOOL) -out:$@ $(libmicrohttpd2_la_OBJECTS:.lo=.o)
49else 51else
50 cp $(lt_cv_objdir)/libmicrohttpd.a $@ 52 cp $(lt_cv_objdir)/libmicrohttpd2.a $@
51endif 53endif
52endif 54endif
53 55
54 56
55libmicrohttpd_la_SOURCES = \ 57libmicrohttpd2_la_SOURCES = \
56 action_continue.c \ 58 action_continue.c \
57 action_from_response.c \ 59 action_from_response.c \
58 action_parse_post.c \ 60 action_parse_post.c \
@@ -107,26 +109,24 @@ libmicrohttpd_la_SOURCES = \
107 panic.c \ 109 panic.c \
108 version.c 110 version.c
109 111
110 112libmicrohttpd2_la_CPPFLAGS = \
111
112libmicrohttpd_la_CPPFLAGS = \
113 $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \ 113 $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \
114 -DBUILDING_MHD_LIB=1 114 -DBUILDING_MHD_LIB=1
115libmicrohttpd_la_CFLAGS = \ 115libmicrohttpd2_la_CFLAGS = \
116 $(AM_CFLAGS) $(MHD_LIB_CFLAGS) 116 $(AM_CFLAGS) $(MHD_LIB_CFLAGS)
117libmicrohttpd_la_LDFLAGS = \ 117libmicrohttpd2_la_LDFLAGS = \
118 $(MHD_LIB_LDFLAGS) \ 118 $(MHD_LIB_LDFLAGS) -ldl \
119 $(W32_MHD_LIB_LDFLAGS) \ 119 $(W32_MHD_LIB_LDFLAGS) \
120 -version-info 666:0:0 # FIXME: fix once closer to release... 120 -version-info 0:0:0 # FIXME: fix once closer to release...
121libmicrohttpd_la_LIBADD = \ 121libmicrohttpd2_la_LIBADD = \
122 $(MHD_LIBDEPS) # FIXME: should separate out GNUTLS_LIBS/GCRYPT here! 122 $(MHD_LIBDEPS) # FIXME: should separate out GNUTLS_LIBS/GCRYPT here!
123 123
124if HAVE_W32 124if HAVE_W32
125MHD_DLL_RES_SRC = microhttpd_dll_res.rc 125MHD_DLL_RES_SRC = microhttpd_dll_res.rc
126MHD_DLL_RES_LO = libmicrohttpd_la-$(MHD_DLL_RES_SRC:.rc=.lo) 126MHD_DLL_RES_LO = libmicrohttpd2_la-$(MHD_DLL_RES_SRC:.rc=.lo)
127 127
128EXTRA_libmicrohttpd_la_DEPENDENCIES = $(MHD_DLL_RES_LO) 128EXTRA_libmicrohttpd2_la_DEPENDENCIES = $(MHD_DLL_RES_LO)
129libmicrohttpd_la_LIBADD += $(MHD_DLL_RES_LO) 129libmicrohttpd2_la_LIBADD += $(MHD_DLL_RES_LO)
130 130
131# General rule is not required, but keep it just in case 131# General rule is not required, but keep it just in case
132.rc.lo: 132.rc.lo:
@@ -141,7 +141,7 @@ libmicrohttpd_la_LIBADD += $(MHD_DLL_RES_LO)
141# Note: windres does not understand '-isystem' flag, so all 141# Note: windres does not understand '-isystem' flag, so all
142# possible '-isystem' flags are replaced by simple '-I' flags. 142# possible '-isystem' flags are replaced by simple '-I' flags.
143$(MHD_DLL_RES_LO): $(MHD_DLL_RES_SRC) 143$(MHD_DLL_RES_LO): $(MHD_DLL_RES_SRC)
144 RC_CPP_FLAGS=" $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrohttpd_la_CPPFLAGS) $(CPPFLAGS) " && \ 144 RC_CPP_FLAGS=" $(DEFAULT_INCLUDES) $(INCLUDES) $(libmicrohttpd2_la_CPPFLAGS) $(CPPFLAGS) " && \
145 $(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $(RCFLAGS) $(DEFS) $${RC_CPP_FLAGS// -isystem / -I } $< -o $@ && \ 145 $(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $(RCFLAGS) $(DEFS) $${RC_CPP_FLAGS// -isystem / -I } $< -o $@ && \
146 echo > $@-empty.c && $(CC) $(AM_CFLAGS) $(CFLAGS) -c $@-empty.c -o $(@:.lo=.o) && rm -f $@-empty.c 146 echo > $@-empty.c && $(CC) $(AM_CFLAGS) $(CFLAGS) -c $@-empty.c -o $(@:.lo=.o) && rm -f $@-empty.c
147endif 147endif
@@ -151,26 +151,26 @@ if USE_COVERAGE
151endif 151endif
152 152
153if !MHD_HAVE_TSEARCH 153if !MHD_HAVE_TSEARCH
154libmicrohttpd_la_SOURCES += \ 154libmicrohttpd2_la_SOURCES += \
155 tsearch.c tsearch.h 155 tsearch.c tsearch.h
156endif 156endif
157 157
158# TBD! 158# TBD!
159if HAVE_POSTPROCESSOR 159if HAVE_POSTPROCESSOR
160#libmicrohttpd_la_SOURCES += \ 160#libmicrohttpd2_la_SOURCES += \
161# postprocessor.c 161# postprocessor.c
162endif 162endif
163 163
164# TBD! 164# TBD!
165if ENABLE_DAUTH 165if ENABLE_DAUTH
166#libmicrohttpd_la_SOURCES += \ 166#libmicrohttpd2_la_SOURCES += \
167# digestauth.c \ 167# digestauth.c \
168# md5.c md5.h 168# md5.c md5.h
169endif 169endif
170 170
171# TBD! 171# TBD!
172if ENABLE_BAUTH 172if ENABLE_BAUTH
173#libmicrohttpd_la_SOURCES += \ 173#libmicrohttpd2_la_SOURCES += \
174# basicauth.c \ 174# basicauth.c \
175# base64.c base64.h 175# base64.c base64.h
176endif 176endif
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
index d89f3c19..f03c4ed6 100644
--- a/src/microhttpd/Makefile.am
+++ b/src/microhttpd/Makefile.am
@@ -70,16 +70,16 @@ libmicrohttpd_la_SOURCES = \
70 response.c response.h 70 response.c response.h
71 71
72libmicrohttpd_la_CPPFLAGS = \ 72libmicrohttpd_la_CPPFLAGS = \
73 $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \ 73 $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) $(MHD_TLS_LIB_CPPFLAGS) \
74 -DBUILDING_MHD_LIB=1 74 -DBUILDING_MHD_LIB=1
75libmicrohttpd_la_CFLAGS = \ 75libmicrohttpd_la_CFLAGS = \
76 $(AM_CFLAGS) $(MHD_LIB_CFLAGS) 76 $(AM_CFLAGS) $(MHD_LIB_CFLAGS) $(MHD_TLS_LIB_CFLAGS)
77libmicrohttpd_la_LDFLAGS = \ 77libmicrohttpd_la_LDFLAGS = \
78 $(MHD_LIB_LDFLAGS) \ 78 $(MHD_LIB_LDFLAGS) $(MHD_TLS_LIB_LDFLAGS) \
79 $(W32_MHD_LIB_LDFLAGS) \ 79 $(W32_MHD_LIB_LDFLAGS) \
80 -version-info @LIB_VERSION_CURRENT@:@LIB_VERSION_REVISION@:@LIB_VERSION_AGE@ 80 -version-info @LIB_VERSION_CURRENT@:@LIB_VERSION_REVISION@:@LIB_VERSION_AGE@
81libmicrohttpd_la_LIBADD = \ 81libmicrohttpd_la_LIBADD = \
82 $(MHD_LIBDEPS) 82 $(MHD_LIBDEPS) $(MHD_TLS_LIBDEPS)
83 83
84if HAVE_W32 84if HAVE_W32
85MHD_DLL_RES_SRC = microhttpd_dll_res.rc 85MHD_DLL_RES_SRC = microhttpd_dll_res.rc