diff options
-rw-r--r-- | configure.ac | 39 | ||||
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/gnutls/init.c | 73 | ||||
-rw-r--r-- | src/gnutls/init.h | 6 | ||||
-rw-r--r-- | src/lib/Makefile.am | 74 | ||||
-rw-r--r-- | src/microhttpd/Makefile.am | 8 |
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]) | |||
1818 | AM_CONDITIONAL([HAVE_GNUTLS], [[test "x$have_gnutls" = "xyes"]]) | 1818 | AM_CONDITIONAL([HAVE_GNUTLS], [[test "x$have_gnutls" = "xyes"]]) |
1819 | AM_CONDITIONAL([HAVE_GNUTLS_SNI], [[test "x$have_gnutls_sni" = "xyes"]]) | 1819 | AM_CONDITIONAL([HAVE_GNUTLS_SNI], [[test "x$have_gnutls_sni" = "xyes"]]) |
1820 | AM_CONDITIONAL([ENABLE_HTTPS], [test "x$enable_https" = "xyes"]) | 1820 | AM_CONDITIONAL([ENABLE_HTTPS], [test "x$enable_https" = "xyes"]) |
1821 | AM_CONDITIONAL([HTTPS_REQUIRE_GRYPT], [[test "x$enable_https" = "xyes" && test "x$mhd_cv_grypt_required" = "xyes"]]) | 1821 | AM_CONDITIONAL([HTTPS_REQUIRE_GCRYPT], [[test "x$enable_https" = "xyes" && test "x$mhd_cv_gcrypt_required" = "xyes"]]) |
1822 | AC_SUBST([GNUTLS_CPPFLAGS]) | 1822 | AC_SUBST([GNUTLS_CPPFLAGS]) |
1823 | AC_SUBST([GNUTLS_CFLAGS]) | 1823 | AC_SUBST([GNUTLS_CFLAGS]) |
1824 | AC_SUBST([GNUTLS_LDFLAGS]) | 1824 | AC_SUBST([GNUTLS_LDFLAGS]) |
@@ -1990,6 +1990,10 @@ AC_SUBST(MHD_LIB_CPPFLAGS) | |||
1990 | AC_SUBST(MHD_LIB_CFLAGS) | 1990 | AC_SUBST(MHD_LIB_CFLAGS) |
1991 | AC_SUBST(MHD_LIB_LDFLAGS) | 1991 | AC_SUBST(MHD_LIB_LDFLAGS) |
1992 | AC_SUBST(MHD_LIBDEPS) | 1992 | AC_SUBST(MHD_LIBDEPS) |
1993 | AC_SUBST(MHD_TLS_LIB_CPPFLAGS) | ||
1994 | AC_SUBST(MHD_TLS_LIB_CFLAGS) | ||
1995 | AC_SUBST(MHD_TLS_LIB_LDFLAGS) | ||
1996 | AC_SUBST(MHD_TLS_LIBDEPS) | ||
1993 | 1997 | ||
1994 | # for pkg-config | 1998 | # for pkg-config |
1995 | AC_SUBST([MHD_REQ_PRIVATE]) | 1999 | AC_SUBST([MHD_REQ_PRIVATE]) |
@@ -2022,6 +2026,7 @@ doc/examples/Makefile | |||
2022 | m4/Makefile | 2026 | m4/Makefile |
2023 | src/Makefile | 2027 | src/Makefile |
2024 | src/include/Makefile | 2028 | src/include/Makefile |
2029 | src/lib/Makefile | ||
2025 | src/microhttpd/Makefile | 2030 | src/microhttpd/Makefile |
2026 | src/examples/Makefile | 2031 | src/examples/Makefile |
2027 | src/testcurl/Makefile | 2032 | src/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 | |||
14 | SUBDIRS += examples | 14 | SUBDIRS += examples |
15 | endif | 15 | endif |
16 | 16 | ||
17 | # Finally (last!) also build experimental lib... | ||
18 | SUBDIRS += lib | ||
19 | |||
17 | EXTRA_DIST = \ | 20 | EXTRA_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 @@ | |||
35 | GCRY_THREAD_OPTION_PTHREAD_IMPL; | 32 | GCRY_THREAD_OPTION_PTHREAD_IMPL; |
36 | #elif defined(MHD_W32_MUTEX_) | 33 | #elif defined(MHD_W32_MUTEX_) |
37 | 34 | ||
35 | |||
38 | static int | 36 | static int |
39 | gcry_w32_mutex_init (void **ppmtx) | 37 | gcry_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 | */ |
110 | void | 107 | void |
111 | MHD_check_global_init_ (void) | 108 | MHD_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 | */ | ||
133 | static void | ||
134 | mhd_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 | */ |
158 | void | 124 | void |
159 | MHD_init(void) | 125 | MHD_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 | ||
202 | void | 152 | void |
203 | MHD_fini(void) | 153 | MHD_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 | */ |
40 | void | 40 | void |
41 | MHD_check_global_init_ (void); | 41 | MHD_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 | ||
6 | AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) | 6 | AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) |
7 | 7 | ||
8 | lib_LTLIBRARIES = \ | 8 | # Call "libmicrohttpd2" for now, but only while under |
9 | libmicrohttpd.la | 9 | # development. Once we have 'compat' working, this should be changed! |
10 | noinst_LTLIBRARIES = \ | ||
11 | libmicrohttpd2.la | ||
10 | 12 | ||
11 | noinst_DATA = | 13 | noinst_DATA = |
12 | MOSTLYCLEANFILES = | 14 | MOSTLYCLEANFILES = |
13 | 15 | ||
14 | if W32_SHARED_LIB_EXP | 16 | if W32_SHARED_LIB_EXP |
15 | W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd.def -XCClinker -static-libgcc | 17 | W32_MHD_LIB_LDFLAGS = -Wl,--output-def,$(lt_cv_objdir)/libmicrohttpd2.def -XCClinker -static-libgcc |
16 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp | 18 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd2.lib $(lt_cv_objdir)/libmicrohttpd2.def $(lt_cv_objdir)/libmicrohttpd2.exp |
17 | MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd.lib $(lt_cv_objdir)/libmicrohttpd.def $(lt_cv_objdir)/libmicrohttpd.exp | 19 | MOSTLYCLEANFILES += $(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) |
24 | if USE_MS_LIB_TOOL | 26 | if 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 .. |
30 | else | 32 | else |
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. |
37 | endif | 39 | endif |
38 | else | 40 | else |
39 | W32_MHD_LIB_LDFLAGS = | 41 | W32_MHD_LIB_LDFLAGS = |
40 | endif | 42 | endif |
41 | 43 | ||
42 | if W32_STATIC_LIB | 44 | if W32_STATIC_LIB |
43 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd-static.lib | 45 | noinst_DATA += $(lt_cv_objdir)/libmicrohttpd2-static.lib |
44 | MOSTLYCLEANFILES += $(lt_cv_objdir)/libmicrohttpd-static.lib | 46 | MOSTLYCLEANFILES += $(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) |
47 | if USE_MS_LIB_TOOL | 49 | if USE_MS_LIB_TOOL |
48 | $(MS_LIB_TOOL) -out:$@ $(libmicrohttpd_la_OBJECTS:.lo=.o) | 50 | $(MS_LIB_TOOL) -out:$@ $(libmicrohttpd2_la_OBJECTS:.lo=.o) |
49 | else | 51 | else |
50 | cp $(lt_cv_objdir)/libmicrohttpd.a $@ | 52 | cp $(lt_cv_objdir)/libmicrohttpd2.a $@ |
51 | endif | 53 | endif |
52 | endif | 54 | endif |
53 | 55 | ||
54 | 56 | ||
55 | libmicrohttpd_la_SOURCES = \ | 57 | libmicrohttpd2_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 | 112 | libmicrohttpd2_la_CPPFLAGS = \ | |
111 | |||
112 | libmicrohttpd_la_CPPFLAGS = \ | ||
113 | $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \ | 113 | $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \ |
114 | -DBUILDING_MHD_LIB=1 | 114 | -DBUILDING_MHD_LIB=1 |
115 | libmicrohttpd_la_CFLAGS = \ | 115 | libmicrohttpd2_la_CFLAGS = \ |
116 | $(AM_CFLAGS) $(MHD_LIB_CFLAGS) | 116 | $(AM_CFLAGS) $(MHD_LIB_CFLAGS) |
117 | libmicrohttpd_la_LDFLAGS = \ | 117 | libmicrohttpd2_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... |
121 | libmicrohttpd_la_LIBADD = \ | 121 | libmicrohttpd2_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 | ||
124 | if HAVE_W32 | 124 | if HAVE_W32 |
125 | MHD_DLL_RES_SRC = microhttpd_dll_res.rc | 125 | MHD_DLL_RES_SRC = microhttpd_dll_res.rc |
126 | MHD_DLL_RES_LO = libmicrohttpd_la-$(MHD_DLL_RES_SRC:.rc=.lo) | 126 | MHD_DLL_RES_LO = libmicrohttpd2_la-$(MHD_DLL_RES_SRC:.rc=.lo) |
127 | 127 | ||
128 | EXTRA_libmicrohttpd_la_DEPENDENCIES = $(MHD_DLL_RES_LO) | 128 | EXTRA_libmicrohttpd2_la_DEPENDENCIES = $(MHD_DLL_RES_LO) |
129 | libmicrohttpd_la_LIBADD += $(MHD_DLL_RES_LO) | 129 | libmicrohttpd2_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 |
147 | endif | 147 | endif |
@@ -151,26 +151,26 @@ if USE_COVERAGE | |||
151 | endif | 151 | endif |
152 | 152 | ||
153 | if !MHD_HAVE_TSEARCH | 153 | if !MHD_HAVE_TSEARCH |
154 | libmicrohttpd_la_SOURCES += \ | 154 | libmicrohttpd2_la_SOURCES += \ |
155 | tsearch.c tsearch.h | 155 | tsearch.c tsearch.h |
156 | endif | 156 | endif |
157 | 157 | ||
158 | # TBD! | 158 | # TBD! |
159 | if HAVE_POSTPROCESSOR | 159 | if HAVE_POSTPROCESSOR |
160 | #libmicrohttpd_la_SOURCES += \ | 160 | #libmicrohttpd2_la_SOURCES += \ |
161 | # postprocessor.c | 161 | # postprocessor.c |
162 | endif | 162 | endif |
163 | 163 | ||
164 | # TBD! | 164 | # TBD! |
165 | if ENABLE_DAUTH | 165 | if 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 |
169 | endif | 169 | endif |
170 | 170 | ||
171 | # TBD! | 171 | # TBD! |
172 | if ENABLE_BAUTH | 172 | if 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 |
176 | endif | 176 | endif |
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 | ||
72 | libmicrohttpd_la_CPPFLAGS = \ | 72 | libmicrohttpd_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 |
75 | libmicrohttpd_la_CFLAGS = \ | 75 | libmicrohttpd_la_CFLAGS = \ |
76 | $(AM_CFLAGS) $(MHD_LIB_CFLAGS) | 76 | $(AM_CFLAGS) $(MHD_LIB_CFLAGS) $(MHD_TLS_LIB_CFLAGS) |
77 | libmicrohttpd_la_LDFLAGS = \ | 77 | libmicrohttpd_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@ |
81 | libmicrohttpd_la_LIBADD = \ | 81 | libmicrohttpd_la_LIBADD = \ |
82 | $(MHD_LIBDEPS) | 82 | $(MHD_LIBDEPS) $(MHD_TLS_LIBDEPS) |
83 | 83 | ||
84 | if HAVE_W32 | 84 | if HAVE_W32 |
85 | MHD_DLL_RES_SRC = microhttpd_dll_res.rc | 85 | MHD_DLL_RES_SRC = microhttpd_dll_res.rc |