]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Better separate the library dependencies into those required by libcurl
authorDan Fandrich <dan@coneharvesters.com>
Sat, 17 Feb 2007 01:29:01 +0000 (01:29 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 17 Feb 2007 01:29:01 +0000 (01:29 +0000)
and those required by other components to avoid forcing unneeded
dependencies into the target objects.

configure.ac
lib/Makefile.am
src/Makefile.am
tests/server/Makefile.am

index 5e6e15ed3c06ac268ff03cd8b3557a8435344f60..67feec7e86a0997d766ab21f90fa8f331aff1036 100644 (file)
@@ -90,6 +90,11 @@ dnl initialize all the info variables
 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 \
index 1a0f5fa637112b39c32e22d1ef4b17ec2171aedc..edefb0e01e6c664758489a03e235c115ec808edd 100644 (file)
@@ -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
index 77f0abfd4a64abb272b92e3bf03c24e3733aed2a..13fad213e87db1823459bd9266da85caea2894d8 100644 (file)
@@ -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
index 9b20d5c997e192b94abaa090e9a5c9acd55c93a9..21edfd3ef1bf2b115eb842974f0e139520f79522 100644 (file)
@@ -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