commit b630c46912a5cae5b6133e50d6c2276fa1deea1f
parent 980a8ac8448b552ebc5f2407b0172ad55c125e9c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 6 Mar 2014 10:50:52 +0000
Update usage of libcurl and libgnutls compiler flags, allow correct compilation with "--with-gnutls=prefix"
Diffstat:
8 files changed, 33 insertions(+), 21 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -522,6 +522,10 @@ AC_ARG_WITH(gnutls,
[AC_MSG_RESULT([$with_gnutls])
case $with_gnutls in
no)
+ GNUTLS_CPPFLAGS=""
+ GNUTLS_CFLAGS=""
+ GNUTLS_LDFLAGS=""
+ GNUTLS_LIBS=""
;;
yes)
GNUTLS_CPPFLAGS=""
@@ -556,6 +560,9 @@ AC_ARG_WITH(gnutls,
have_gnutls=yes))])
AM_CONDITIONAL(HAVE_GNUTLS, test "x$have_gnutls" = "xyes")
+AC_SUBST([GNUTLS_CPPFLAGS])
+AC_SUBST([GNUTLS_LDFLAGS])
+AC_SUBST([GNUTLS_LIBS])
# optional: HTTPS support. Enabled by default
AC_MSG_CHECKING(whether to support HTTPS)
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
@@ -147,6 +147,8 @@ fileserver_example_external_select_LDADD = \
https_fileserver_example_SOURCES = \
https_fileserver_example.c
+https_fileserver_example_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(GNUTLS_CPPFLAGS)
https_fileserver_example_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
@@ -129,7 +129,9 @@ endif
if ENABLE_HTTPS
libmicrohttpd_la_SOURCES += \
connection_https.c connection_https.h
-libmicrohttpd_la_LIBADD += -lgnutls @LIBGCRYPT_LIBS@
+libmicrohttpd_la_CPPFLAGS += $(GNUTLS_CPPFLAGS)
+libmicrohttpd_la_LDFLAGS += $(GNUTLS_LDFLAGS)
+libmicrohttpd_la_LIBADD += $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@
endif
diff --git a/src/spdy2http/Makefile.am b/src/spdy2http/Makefile.am
@@ -11,7 +11,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/applicationlayer \
-DDATA_DIR=\"$(top_srcdir)/src/datadir/\" \
-$(LIBCURL_CPPFLAGS)
+ $(LIBCURL_CPPFLAGS)
if !HAVE_W32
PERF_GET_CONCURRENT=perf_get_concurrent
@@ -25,4 +25,4 @@ microspdy2http_SOURCES = \
microspdy2http_LDADD = \
$(top_builddir)/src/microspdy/libmicrospdy.la \
-lz \
- -lcurl
+ $(LIBCURL)
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
@@ -123,13 +123,13 @@ test_digestauth_SOURCES = \
test_digestauth.c
test_digestauth_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ @LIBGCRYPT_LIBS@
+ @LIBGCRYPT_LIBS@ @LIBCURL@
test_digestauth_with_arguments_SOURCES = \
test_digestauth_with_arguments.c
test_digestauth_with_arguments_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ @LIBGCRYPT_LIBS@
+ @LIBGCRYPT_LIBS@ @LIBCURL@
test_get_sendfile_SOURCES = \
test_get_sendfile.c
@@ -186,7 +186,7 @@ test_postform_SOURCES = \
test_postform.c
test_postform_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ @LIBGCRYPT_LIBS@
+ @LIBGCRYPT_LIBS@ @LIBCURL@
test_post_loop_SOURCES = \
test_post_loop.c
@@ -232,7 +232,7 @@ test_postform11_SOURCES = \
test_postform.c
test_postform11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ @LIBGCRYPT_LIBS@
+ @LIBGCRYPT_LIBS@ @LIBCURL@
test_post_loop11_SOURCES = \
test_post_loop.c
diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/microhttpd \
-I$(top_srcdir)/src/platform \
- $(LIBCURL_CPPFLAGS)
+ $(LIBCURL_CPPFLAGS) $(GNUTLS_CPPFLAGS)
check_PROGRAMS = \
test_tls_options \
@@ -46,7 +46,7 @@ test_https_time_out_SOURCES = \
test_https_time_out_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_tls_options_SOURCES = \
test_tls_options.c \
@@ -54,7 +54,7 @@ test_tls_options_SOURCES = \
test_tls_options_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_get_parallel_SOURCES = \
test_https_get_parallel.c \
@@ -64,7 +64,7 @@ test_https_get_parallel_CFLAGS = \
test_https_get_parallel_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- $(PTHREAD_LIBS) @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(PTHREAD_LIBS) $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_empty_response_SOURCES = \
test_empty_response.c \
@@ -72,7 +72,7 @@ test_empty_response_SOURCES = \
test_empty_response_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_get_parallel_threads_SOURCES = \
test_https_get_parallel_threads.c \
@@ -82,7 +82,7 @@ test_https_get_parallel_threads_CFLAGS = \
test_https_get_parallel_threads_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- $(PTHREAD_LIBS) @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(PTHREAD_LIBS) $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_tls_authentication_SOURCES = \
test_tls_authentication.c \
@@ -90,7 +90,7 @@ test_tls_authentication_SOURCES = \
test_tls_authentication_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_session_info_SOURCES = \
test_https_session_info.c \
@@ -98,7 +98,7 @@ test_https_session_info_SOURCES = \
test_https_session_info_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_multi_daemon_SOURCES = \
test_https_multi_daemon.c \
@@ -106,7 +106,7 @@ test_https_multi_daemon_SOURCES = \
test_https_multi_daemon_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_get_SOURCES = \
test_https_get.c \
@@ -114,7 +114,7 @@ test_https_get_SOURCES = \
test_https_get_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_sni_SOURCES = \
test_https_sni.c \
@@ -125,7 +125,7 @@ test_https_sni_CPPFLAGS = \
test_https_sni_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
test_https_get_select_SOURCES = \
test_https_get_select.c \
@@ -133,5 +133,5 @@ test_https_get_select_SOURCES = \
test_https_get_select_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@ -lgnutls @LIBGCRYPT_LIBS@
+ $(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
diff --git a/src/testspdy/Makefile.am b/src/testspdy/Makefile.am
@@ -10,7 +10,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/applicationlayer \
-$(LIBCURL_CPPFLAGS)
+ $(LIBCURL_CPPFLAGS)
if !HAVE_W32
PERF_GET_CONCURRENT=perf_get_concurrent
diff --git a/src/testzzuf/Makefile.am b/src/testzzuf/Makefile.am
@@ -5,7 +5,8 @@ if USE_COVERAGE
endif
-AM_CPPFLAGS = -I$(top_srcdir)/src/include
+AM_CPPFLAGS = -I$(top_srcdir)/src/include \
+ $(LIBCURL_CPPFLAGS)
EXTRA_DIST = README socat.c