aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac23
-rw-r--r--lib/Makefile.am3
-rw-r--r--src/Makefile.am2
-rw-r--r--tests/server/Makefile.am8
4 files changed, 33 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 5e6e15ed3..67feec7e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,11 @@ curl_verbose_msg="enabled (--disable-verbose)"
curl_sspi_msg="no (--enable-sspi)"
dnl
+dnl Save anything in $LIBS for later
+dnl
+ALL_LIBS=$LIBS
+
+dnl
dnl Detect the canonical host and target build environment
dnl
@@ -435,7 +440,7 @@ AC_ARG_ENABLE(libgcc,
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
[ case "$enableval" in
yes)
- LIBS="$LIBS -lgcc"
+ ALL_LIBS="$ALL_LIBS -lgcc"
AC_MSG_RESULT(yes)
;;
*) AC_MSG_RESULT(no)
@@ -1401,6 +1406,7 @@ else
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
+ CURL_LIBS="$CURL_LIBS -lz"
LIBS="$LIBS -lz"
dnl replace 'HAVE_LIBZ' in the automake makefile.ams
@@ -2187,6 +2193,21 @@ if test "x$ws2" = "xyes"; then
fi
+dnl
+dnl All the library dependencies put into $LIB apply to libcurl only.
+dnl Those in $CURL_LIBS apply to the curl command-line client only.
+dnl Those in $TEST_SERVER_LIBS apply to test servers (for simplicity, this
+dnl is currently the same as libcurl's libraries).
+dnl Those in $ALL_LIBS apply to all targets, including test targets.
+dnl
+LIBCURL_LIBS=$LIBS
+TEST_SERVER_LIBS=$LIBCURL_LIBS
+
+AC_SUBST(LIBCURL_LIBS)
+AC_SUBST(CURL_LIBS)
+AC_SUBST(TEST_SERVER_LIBS)
+LIBS=$ALL_LIBS dnl LIBS is a magic variable
+
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
AC_CONFIG_FILES([Makefile \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1a0f5fa63..edefb0e01 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -39,6 +39,7 @@ EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 Makefile.riscos \
CLEANFILES = $(DSP) $(VCPROJ)
lib_LTLIBRARIES = libcurl.la
+LIBCURL_LIBS = @LIBCURL_LIBS@
# we use srcdir/include for the static global include files
# we use builddir/lib for the generated lib/config.h file to get found
@@ -89,7 +90,7 @@ if MIMPURE
MIMPURE = -mimpure-text
endif
-libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE)
+libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE) $(LIBCURL_LIBS)
# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
diff --git a/src/Makefile.am b/src/Makefile.am
index 77f0abfd4..13fad213e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,7 +37,7 @@ bin_PROGRAMS = curl
include Makefile.inc
-curl_LDADD = ../lib/libcurl.la
+curl_LDADD = ../lib/libcurl.la @CURL_LIBS@
curl_DEPENDENCIES = ../lib/libcurl.la
BUILT_SOURCES = hugehelp.c
CLEANFILES = hugehelp.c
diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am
index 9b20d5c99..21edfd3ef 100644
--- a/tests/server/Makefile.am
+++ b/tests/server/Makefile.am
@@ -36,11 +36,19 @@ useful = getpart.c getpart.h $(top_srcdir)/lib/strequal.c \
$(top_srcdir)/lib/memdebug.c $(top_srcdir)/lib/timeval.c
resolve_SOURCES= resolve.c util.c util.h $(useful)
+resolve_LDADD = @TEST_SERVER_LIBS@
+
sws_SOURCES= sws.c util.c util.h $(useful)
+sws_LDADD = @TEST_SERVER_LIBS@
+
sockfilt_SOURCES = sockfilt.c util.c util.h $(useful) \
$(top_srcdir)/lib/inet_pton.c
+sockfilt_LDADD = @TEST_SERVER_LIBS@
+
getpart_SOURCES= testpart.c $(useful)
+
tftpd_SOURCES = tftpd.c util.c util.h $(useful) tftp.h
+tftpd_LDADD = @TEST_SERVER_LIBS@
extra_DIST = base64.pl