curl-config: don't output static libs when they are disabled
authorWouter Van Rooy <wouter.van.rooy@vasco.com>
Tue, 16 Apr 2013 13:40:00 +0000 (15:40 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 16 Apr 2013 14:07:41 +0000 (16:07 +0200)
Curl-config outputs static libraries even when they are disabled in
configure.

This causes problems with the build of pycurl.

configure.ac
curl-config.in

index 1a46fd9..49309e6 100644 (file)
@@ -3350,6 +3350,11 @@ dnl yes or no
 ENABLE_SHARED="$enable_shared"
 AC_SUBST(ENABLE_SHARED)
 
+dnl to let curl-config output the static libraries correctly
+ENABLE_STATIC="$enable_static"
+AC_SUBST(ENABLE_STATIC)
+
+
 dnl
 dnl For keeping supported features and protocols also in pkg-config file
 dnl since it is more cross-compile friendly than curl-config
index c95518d..e0fa03c 100644 (file)
@@ -155,7 +155,12 @@ while test $# -gt 0; do
         ;;
 
     --static-libs)
-        echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@
+       if test "X@ENABLE_STATIC@" != "Xno" ; then
+               echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@
+       else
+               echo "curl was built with static libraries disabled" >&2
+               exit 1
+       fi
         ;;
 
     --configure)