? compile
? libtool.m4
? ltoptions.m4
? ltsugar.m4
? ltversion.m4
? lib/ssl-gnutls.c
? lib/ssl-nossl.c
? lib/ssl-openssl.c
? src/config.h.in
Index: configure.ac
===================================================================
RCS file: /cvsroot/curl/curl/configure.ac,v
retrieving revision 1.161
diff -u -r1.161 configure.ac
--- configure.ac	2 Sep 2005 15:11:08 -0000	1.161
+++ configure.ac	4 Sep 2005 11:49:17 -0000
@@ -140,6 +140,13 @@
 dnl AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 
+dnl In this variable, we will accumulate a list of space-separated
+dnl words. The presence of word $x in the list means that libcurl-$x.la _can_
+dnl be built as a separate lib. The actual list of code modules that
+dnl _will_ be built is determined before the AC_SUBST(SEPARATE_LIBS) at the
+dnl end of this file
+curl_possible_separate_libs="nossl"
+
 dnl ************************************************************
 dnl switch off particular protocols
 dnl
@@ -791,49 +798,47 @@
 dnl **********************************************************************
 
 dnl Default to compiler & linker defaults for SSL files & libraries.
-OPT_SSL=off
+OPENSSL_LDFLAGS=""
+OPENSSL_CFLAGS=""
+OPENSSL_LIBS=""
 dnl Default to no CA bundle
 ca="no"
 AC_ARG_WITH(ssl,dnl
 AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
 AC_HELP_STRING([--without-ssl], [disable SSL]),
-  OPT_SSL=$withval)
+  OPT_SSL=$withval, OPT_SSL=off)
 
 if test X"$OPT_SSL" != Xno; then
-  dnl backup the pre-ssl variables
-  CLEANLDFLAGS="$LDFLAGS"
-  CLEANCPPFLAGS="$CPPFLAGS"
-  CLEANLIBS="$LIBS"
 
   case "$OPT_SSL" in
   yes)
     dnl --with-ssl (without path) used
     if test x$cross_compiling != xyes; then
       dnl only do pkg-config magic when not cross-compiling
-      PKGTEST="yes"
+      openssl_pkgtest="yes"
     fi
-    PREFIX_OPENSSL=/usr/local/ssl
-    LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
+    openssl_prefix=/usr/local/ssl
+    openssl_libdir="$openssl_prefix/lib$libsuff"
     ;;
   off)
     dnl no --with-ssl option given, just check default places
     if test x$cross_compiling != xyes; then
       dnl only do pkg-config magic when not cross-compiling
-      PKGTEST="yes"
+      openssl_pkgtest="yes"
     fi
-    PREFIX_OPENSSL=
+    openssl_prefix=
     ;;
   *)
     dnl check the given --with-ssl spot
-    PKGTEST="no"
-    PREFIX_OPENSSL=$OPT_SSL
-    LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
-    LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
-    CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
+    openssl_pkgtest="no"
+    openssl_prefix=$OPT_SSL
+    openssl_libdir="$openssl_prefix/lib$libsuff"
+    OPENSSL_LDFLAGS="-L$openssl_libdir"
+    OPENSSL_CFLAGS="-I$openssl_prefix/include/openssl -I$openssl_prefix/include"
     ;;
   esac
 
-  if test "$PKGTEST" = "yes"; then
+  if test "$openssl_pkgtest" = "yes"; then
 
     dnl Detect the pkg-config tool, as it may have extra info about the
     dnl openssl installation we can use. I *believe* this is what we are
@@ -844,19 +849,14 @@
       AC_MSG_CHECKING([OpenSSL options with pkg-config])
 
       $PKGCONFIG --exists openssl
-      SSL_EXISTS=$?
+      openssl_exists=$?
+
+      if test "$openssl_exists" -eq "0"; then
+        OPENSSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
+        OPENSSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
+        OPENSSL_CFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
 
-      if test "$SSL_EXISTS" -eq "0"; then
-        SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
-        SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
-        SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
-
-	LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
-
-        dnl use the values pkg-config reported
-        LIBS="$LIBS $SSL_LIBS"
-        CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
-        LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
+	openssl_libdir=`echo $OPENSSL_LDFLAGS | sed -e 's/-L//g'`
         AC_MSG_RESULT([found])
       else
         AC_MSG_RESULT([no])
@@ -866,56 +866,53 @@
 
   dnl This is for Msys/Mingw
   AC_MSG_CHECKING([for gdi32])
-  my_ac_save_LIBS=$LIBS
-  LIBS="-lgdi32 $LIBS"
+  orig_LIBS=$LIBS; LIBS="-lgdi32 $LIBS $OPENSSL_LIBS"
+  orig_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
   AC_TRY_LINK([#include <windef.h>
                #include <wingdi.h>],
                [GdiFlush();],
                [ dnl worked!
+               OPENSSL_LIBS="-lgdi32 $OPENSSL_LIBS"
                AC_MSG_RESULT([yes])],
-               [ dnl failed, restore LIBS
-               LIBS=$my_ac_save_LIBS
+               [ dnl failed
                AC_MSG_RESULT(no)]
               )
+  LIBS="$orig_LIBS"
 
-  AC_CHECK_LIB(crypto, CRYPTO_lock,[
-     HAVECRYPTO="yes"
-     LIBS="-lcrypto $LIBS"
-     ],[
-     LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
-     CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
-     AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
-       HAVECRYPTO="yes"
-       LIBS="-lcrypto $LIBS"], [
-       LDFLAGS="$CLEANLDFLAGS"
-       CPPFLAGS="$CLEANCPPFLAGS"
-       LIBS="$CLEANLIBS"
-       ])
-    ])
+  AC_CHECK_LIB(crypto, CRYPTO_add_lock,
+    [HAVECRYPTO="yes"; OPENSSL_LIBS="-lcrypto $OPENSSL_LIBS"],
+    [HAVECRYPTO="no"],
+    [$OPENSSL_LDFLAGS $OPENSSL_LIBS])
+  AC_CHECK_LIB(crypto, CRYPTO_lock,
+    [HAVECRYPTO="yes"; OPENSSL_LIBS="-lcrypto $OPENSSL_LIBS"],
+    ,
+    [$OPENSSL_LDFLAGS $OPENSSL_LIBS])
+  LIBS="$orig_LIBS"
+  CPPFLAGS="$orig_CPPFLAGS"
 
 
   if test X"$HAVECRYPTO" = X"yes"; then
     dnl This is only reasonable to do if crypto actually is there: check for
     dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
 
-    AC_CHECK_LIB(ssl, SSL_connect)
+    AC_CHECK_LIB(ssl, SSL_connect,
+      [OPENSSL_LIBS="$OPENSSL_LIBS -lssl"; LIBS="$orig_LIBS"],
+      ,
+      [$OPENSSL_LDFLAGS $OPENSSL_LIBS])
 
     if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
-        dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
-        AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
-        OLIBS=$LIBS
-        LIBS="$LIBS -lRSAglue -lrsaref"
-        AC_CHECK_LIB(ssl, SSL_connect)
-        if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
-            dnl still no SSL_connect
-            AC_MSG_RESULT(no)
-            LIBS=$OLIBS
-        else
-            AC_MSG_RESULT(yes)
-        fi
-
-    else
+      dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
+      AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
+      AC_CHECK_LIB(ssl, SSL_connect,
+        [AC_MSG_RESULT(yes)
+         OPENSSL_LIBS="$OPENSSL_LIBS -lssl -lRSAglue -lrsaref"
+         LIBS="$orig_LIBS"],
+        [AC_MSG_RESULT(no)],
+        [$OPENSSL_LDFLAGS $OPENSSL_LIBS -lRSAglue -lrsaref])
+    fi
 
+    if test "$ac_cv_lib_ssl_SSL_connect" = yes; then
+      orig_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
       dnl Have the libraries--check for SSLeay/OpenSSL headers
       AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
                        openssl/pem.h openssl/ssl.h openssl/err.h,
@@ -928,15 +925,17 @@
           curl_ssl_msg="enabled (OpenSSL)"
           OPENSSL_ENABLED=1)
       fi
+      CPPFLAGS="$orig_CPPFLAGS"
     fi
 
     if test X"$OPENSSL_ENABLED" = X"1"; then
+       curl_possible_separate_libs="$curl_possible_separate_libs openssl"
        AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
 
        dnl is there a pkcs12.h header present?
+       orig_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
        AC_CHECK_HEADERS(openssl/pkcs12.h)
-    else
-       LIBS="$CLEANLIBS"
+       CPPFLAGS="$orig_CPPFLAGS"
     fi
     dnl USE_SSLEAY is the historical name for what configure calls
     dnl OPENSSL_ENABLED; the names should really be unified
@@ -947,9 +946,12 @@
        test "$OPENSSL_ENABLED" != "1"; then
       AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
     fi
-  fi
+  fi dnl if HAVECRYPTO=yes
 
   if test X"$OPENSSL_ENABLED" = X"1"; then
+    orig_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
+    orig_LDFLAGS="$LDFLAGS"; LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+    orig_LIBS="$LIBS"; LIBS="$LIBS $OPENSSL_LIBS"
     dnl If the ENGINE library seems to be around, check for the OpenSSL engine
     dnl stuff, it is kind of "separated" from the main SSL check
     AC_CHECK_FUNC(ENGINE_init,
@@ -965,21 +967,15 @@
                     RAND_egd \
                     CRYPTO_cleanup_all_ex_data )
 
-  fi
-
-  if test "$OPENSSL_ENABLED" = "1"; then
-    if test -n "$LIB_OPENSSL"; then
-       dnl when the ssl shared libs were found in a path that the run-time
-       dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
-       dnl to prevent further configure tests to fail due to this
-
-       LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
-       export LD_LIBRARY_PATH
-       AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
-    fi
+    CPPFLAGS="$orig_CPPFLAGS"
+    LDFLAGS="$orig_LDFLAGS"
+    LIBS="$orig_LIBS"
   fi
 
 fi
+AC_SUBST(OPENSSL_LDFLAGS)
+AC_SUBST(OPENSSL_CFLAGS)
+AC_SUBST(OPENSSL_LIBS)
 
 dnl **********************************************************************
 dnl Check for the random seed preferences 
@@ -1013,46 +1009,41 @@
   fi
 fi
 
-dnl ----------------------------------------------------
-dnl FIX: only check for GnuTLS if OpenSSL is not enabled
-dnl ----------------------------------------------------
-
-dnl Default to compiler & linker defaults for GnuTLS files & libraries.
-OPT_GNUTLS=no
+dnl **********************************************************************
+dnl Check for GnuTLS
+dnl **********************************************************************
 
+GNUTLS_LDFLAGS=""
+GNUTLS_CFLAGS=""
 AC_ARG_WITH(gnutls,dnl
 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
-  OPT_GNUTLS=$withval)
+  OPT_GNUTLS=$withval, OPT_GNUTLS=yes)
 
-if test "$OPENSSL_ENABLED" != "1"; then
+#if test "$OPENSSL_ENABLED" != "1"; then
 
   if test X"$OPT_GNUTLS" != Xno; then
     if test "x$OPT_GNUTLS" = "xyes"; then
      check=`libgnutls-config --version 2>/dev/null`
      if test -n "$check"; then
-       addlib=`libgnutls-config --libs`
-       addcflags=`libgnutls-config --cflags`
-       version=`libgnutls-config --version`
-       gtlsprefix=`libgnutls-config --prefix`
+       GNUTLS_LDFLAGS=`libgnutls-config --libs`
+       GNUTLS_CFLAGS=`libgnutls-config --cflags`
+       gnutls_version=`libgnutls-config --version`
+       gnutls_prefix=`libgnutls-config --prefix`
      fi
     else
-      addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
-      addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
-      version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
-      gtlsprefix=$OPT_GNUTLS
-      if test -z "$version"; then
-        version="unknown"
+      GNUTLS_LDFLAGS=`$OPT_GNUTLS/bin/libgnutls-config --libs`
+      GNUTLS_CFLAGS=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
+      gnutls_version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
+      gnutls_prefix=$OPT_GNUTLS
+      if test -z "$gnutls_version"; then
+        gnutls_version="unknown"
       fi
     fi
-    if test -n "$addlib"; then
+    if test -n "$GNUTLS_LDFLAGS"; then
 
-      CLEANLDFLAGS="$LDFLAGS"
-      CLEANCPPFLAGS="$CPPFLAGS"
-  
-      LDFLAGS="$LDFLAGS $addlib"
-      if test "$addcflags" != "-I/usr/include"; then
-         CPPFLAGS="$CPPFLAGS $addcflags"
+      if test "$GNUTLS_CFLAGS" = "-I/usr/include"; then
+        GNUTLS_CFLAGS=""
       fi
   
       AC_CHECK_LIB(gnutls, gnutls_check_version,
@@ -1060,36 +1051,35 @@
        AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
        AC_SUBST(USE_GNUTLS, [1])
        USE_GNUTLS="yes"
-       curl_ssl_msg="enabled (GnuTLS)"
+       curl_possible_separate_libs="$curl_possible_separate_libs gnutls"
+       if test "x$OPENSSL_ENABLED" = x1; then
+         curl_ssl_msg="enabled (OpenSSL+GnuTLS)"
+       else
+         curl_ssl_msg="enabled (GnuTLS)"
+       fi
        ],
        [
          LDFLAGS="$CLEANLDFLAGS"
          CPPFLAGS="$CLEANCPPFLAGS"
-       ])
+       ],
+       [$GNUTLS_LDFLAGS])
   
       if test "x$USE_GNUTLS" = "xyes"; then
-        AC_MSG_NOTICE([detected GnuTLS version $version])
-
-        dnl when shared libs were found in a path that the run-time
-        dnl linker doesn't search through, we need to add it to
-        dnl LD_LIBRARY_PATH to prevent further configure tests to fail
-        dnl due to this
-
-        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
-        export LD_LIBRARY_PATH
-        AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
+        AC_MSG_NOTICE([detected GnuTLS version $gnutls_version])
       fi
 
     fi
 
   fi dnl GNUTLS not disabled
 
-  if test X"$USE_GNUTLS" != "Xyes"; then
+  if test x"$USE_GNUTLS" != xyes && test x"$OPENSSL_ENABLED" != x1; then
     AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
-    AC_MSG_WARN([Use --with-ssl or --with-gnutls to address this.])
+    AC_MSG_WARN([Use --with-ssl and/or --with-gnutls to address this.])
   fi
 
-fi dnl OPENSSL != 1
+#fi dnl OPENSSL != 1
+AC_SUBST(GNUTLS_CFLAGS)
+AC_SUBST(GNUTLS_LDFLAGS)
 
 dnl **********************************************************************
 dnl Check for the CA bundle
@@ -1866,6 +1856,42 @@
 
 fi
 
+dnl Create list of names of libraries which need to be built in addition to
+dnl the main "libcurl.la" library.
+dnl --with-separate-libs actually takes a space-separated list of libraries
+dnl to compile separately. ATM, this is not documented because with the
+dnl SSL-related libs, either all of them or none of them must be compiled
+dnl as separate libs.
+AC_ARG_WITH(separate-libs,
+AC_HELP_STRING([--with-separate-libs],[Build SSL-related code as separate libs, not as part of libcurl itself (default: yes)])
+AC_HELP_STRING([--without-separate-libs], [Build just one big libcurl library]),
+OPT_SEPARATE_LIBS="$withval", OPT_SEPARATE_LIBS=all)
+SEPARATE_LIBS=""
+if test "x$OPT_SEPARATE_LIBS" = xall || test "x$OPT_SEPARATE_LIBS" = xyes; then
+  OPT_SEPARATE_LIBS="$curl_possible_separate_libs"
+fi
+SEPARATE_LIBS="" # Value is e.g. "libcurl-nossl.la"
+NONSEPARATE_OBJECTS="" # Value is e.g. "$(libcurl_nossl_OBJECTS)"
+dnl Put library names into SEPARATE_LIBS if they are present in both
+dnl $OPT_SEPARATE_LIBS and $curl_possible_separate_libs.
+for possible_lib in $curl_possible_separate_libs; do
+  case " $OPT_SEPARATE_LIBS " in
+    *" $possible_lib "*)
+      SEPARATE_LIBS="$SEPARATE_LIBS libcurl-$possible_lib.la";;
+    *)
+      NONSEPARATE_OBJECTS="$NONSEPARATE_OBJECTS \$(libcurl_${possible_lib}_OBJECTS)";;
+  esac
+done
+dnl Some correctness checks should be here for the value of SEPARATE_LIBS:
+dnl 1) If both GnuTLS and OpenSSL are enabled, *must* compile as separate libs
+dnl 2) If GnuTLS or OpenSSL to be built as sep. lib, then so must be nossl.la
+dnl 3) If _not_ building GnuTLS/OpenSSL support as separate libs, must only
+dnl    build one of them, and must not build "nossl".
+AC_SUBST(SEPARATE_LIBS)
+AC_SUBST(NONSEPARATE_OBJECTS)
+dnl AC_MSG_NOTICE(SEPARATE_LIBS: $SEPARATE_LIBS)
+dnl AC_MSG_NOTICE(NONSEPARATE_OBJECTS: $NONSEPARATE_OBJECTS)
+
 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
 
 AC_CONFIG_FILES([Makefile \
@@ -1916,4 +1942,5 @@
   Verbose errors:  ${curl_verbose_msg}
   SSPI support:    ${curl_sspi_msg}
   ca cert path:    ${ca}
+  separate libs:  ${SEPARATE_LIBS}
 ])
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/curl/curl/lib/Makefile.am,v
retrieving revision 1.108
diff -u -r1.108 Makefile.am
--- lib/Makefile.am	31 Mar 2005 07:02:03 -0000	1.108
+++ lib/Makefile.am	4 Sep 2005 11:49:17 -0000
@@ -34,7 +34,8 @@
 
 CLEANFILES = $(DSP)
 
-lib_LTLIBRARIES = libcurl.la
+lib_LTLIBRARIES = libcurl.la @SEPARATE_LIBS@
+EXTRA_LTLIBRARIES = libcurl-nossl.la libcurl-openssl.la libcurl-gnutls.la
 
 # we use srcdir/include for the static global include files
 # we use builddir/lib for the generated lib/config.h file to get found
@@ -82,12 +83,25 @@
 MIMPURE = -mimpure-text
 endif
 
-libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE)
+### FIXME: Only add the stuff after $(MIMPURE) if resp. code is *not* external
+libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE) @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@ @GNUTLS_LDFLAGS@
+libcurl_nossl_la_LDFLAGS = -rpath '$(libdir)' $(libcurl_la_LDFLAGS)
+libcurl_openssl_la_LDFLAGS = -rpath '$(libdir)' $(libcurl_la_LDFLAGS) @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@
+libcurl_gnutls_la_LDFLAGS = -rpath '$(libdir)' $(libcurl_la_LDFLAGS) @GNUTLS_LDFLAGS@
+
+### FIXME: Only add the stuff after = if resp. code is *not* external
+libcurl_la_CFLAGS = @OPENSSL_CFLAGS@ @GNUTLS_CFLAGS@
+libcurl_openssl_la_CFLAGS = @OPENSSL_CFLAGS@
+libcurl_gnutls_la_CFLAGS = @GNUTLS_CFLAGS@
 
 # Makefile.inc provides the CSOURCES and HHEADERS defines
 include Makefile.inc
 
-libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
+libcurl_la_SOURCES = $(SOURCES_curl) $(HHEADERS)
+EXTRA_libcurl_la_SOURCES = $(libcurl_nossl_la_SOURCES) \
+	$(libcurl_openssl_la_SOURCES) $(libcurl_gnutls_la_SOURCES)
+libcurl_la_LIBADD = @NONSEPARATE_OBJECTS@
+libcurl_la_DEPENDENCIES = @NONSEPARATE_OBJECTS@
 
 WIN32SOURCES = $(CSOURCES)
 WIN32HEADERS = $(HHEADERS) config-win32.h
Index: lib/Makefile.inc
===================================================================
RCS file: /cvsroot/curl/curl/lib/Makefile.inc,v
retrieving revision 1.8
diff -u -r1.8 Makefile.inc
--- lib/Makefile.inc	2 Sep 2005 15:11:09 -0000	1.8
+++ lib/Makefile.inc	4 Sep 2005 11:49:17 -0000
@@ -1,6 +1,9 @@
 # ./lib/Makefile.inc
- 
-CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c	\
+
+CSOURCES = $(SOURCES_curl) $(libcurl_nossl_la_SOURCES) \
+  $(libcurl_openssl_la_SOURCES) $(libcurl_gnutls_la_SOURCES)
+
+SOURCES_curl = file.c timeval.c base64.c hostip.c progress.c formdata.c	\
   cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c	\
   ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c	\
   netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c	\
@@ -20,3 +23,11 @@
   setup.h transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h   \
   gtls.h tftp.h
 
+libcurl_nossl_la_SOURCES = ssl-nossl.c
+libcurl_nossl_OBJECTS = ssl-nossl.lo #$(OBJEXT)
+
+libcurl_openssl_la_SOURCES = ssl-openssl.c
+libcurl_openssl_OBJECTS = ssl-openssl.lo #$(OBJEXT)
+
+libcurl_gnutls_la_SOURCES = ssl-gnutls.c
+libcurl_gnutls_OBJECTS = ssl-gnutls.lo #$(OBJEXT)

