]> granicus.if.org Git - apache/commitdiff
Fix use of mod_ssl as a DSO linked against static SSL libraries; also
authorJoe Orton <jorton@apache.org>
Sat, 6 Mar 2004 16:47:41 +0000 (16:47 +0000)
committerJoe Orton <jorton@apache.org>
Sat, 6 Mar 2004 16:47:41 +0000 (16:47 +0000)
stop linking all of support/* against the SSL libraries:

* acinclude.m4 (APACHE_MODULE): Define MOD_FOO_LDADD which each
module .la library will be linked against.
(APACHE_MODPATH_ADD): Link static modules against the provided libraries.
(APACHE_CHECK_SSL_TOOLKIT): Put SSL libraries in SSL_LIBS and export
that to config_vars.mk.

* support/Makefile.in: Link ab against SSL_LIBS.

* modules/ssl/config.m4: Add SSL_LIBS and distcache libraries to
MOD_SSL_LDADD.

PR: 17217

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102870 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
modules/ssl/config.m4
support/Makefile.in

index 8c620e83093499c5728368a4e8bd7aa90da12489..b77199d6be657b3c3291d20273ad754ab64d20c9 100644 (file)
@@ -176,7 +176,7 @@ AC_DEFUN(APACHE_MODPATH_ADD,[
       modpath_static="$modpath_static $libname"
       cat >>$modpath_current/modules.mk<<EOF
 $libname: $objects
-       \$(MOD_LINK) $objects
+       \$(MOD_LINK) $objects $5
 EOF
     else
       apache_need_shared=yes
@@ -268,7 +268,10 @@ AC_DEFUN(APACHE_MODULE,[
       fi
       shared="";;
     esac
-    APACHE_MODPATH_ADD($1, $shared, $3)
+    define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
+    APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
+    APACHE_SUBST(modprefix[_LDADD])
+    undefine([modprefix])
   fi
 ])dnl
 
@@ -462,13 +465,13 @@ if test "x$ap_ssltk_configured" = "x"; then
       APR_ADDTO(LDFLAGS, ["$ap_platform_runtime_link_flag$ap_ssltk_lib"])
     fi
   fi
-  dnl (d) add "-lssl -lcrypto" OR "-lsslc" to LIBS because restoring LIBS
-  dnl after AC_CHECK_LIB() obliterates any flags AC_CHECK_LIB() added.
+  # Put SSL libraries in SSL_LIBS.
   if test "$ap_ssltk_type" = "openssl"; then
-    APR_ADDTO(LIBS, [-lssl -lcrypto])
+    APR_SETVAR(SSL_LIBS, [-lssl -lcrypto])
   else
-    APR_ADDTO(LIBS, [-lsslc])
+    APR_SETVAR(SSL_LIBS, [-lsslc])
   fi
+  APACHE_SUBST(SSL_LIBS)
 fi
 ])
 
index 9795f1c5dde38a30b2726d555ac98598499baa7a..4c115761cb12924542ba41a5f784f57d7c50a771 100644 (file)
@@ -78,7 +78,7 @@ ap_ssltk_dc="no"])
     if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
       AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
     else
-      APR_ADDTO(LIBS,[-ldistcache -lnal])
+      APR_ADDTO(MOD_SSL_LDADD, [-ldistcache -lnal])
       AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
     fi
   fi
@@ -114,6 +114,7 @@ ssl_util_ssl.lo dnl
 dnl #  hook module into the Autoconf mechanism (--enable-ssl option)
 APACHE_MODULE(ssl, [SSL/TLS support (mod_ssl)], $ssl_objs, , no, [
     APACHE_CHECK_SSL_TOOLKIT
+    APR_SETVAR(MOD_SSL_LDADD, [\$(SSL_LIBS)])
     CHECK_DISTCACHE
 ])
 
index 9c0ba751bbd868dcd93849efd43be46b23148804..8fca31c52b3fa493049a80dec4784a1f6c42a0a2 100644 (file)
@@ -50,8 +50,9 @@ htdbm: $(htdbm_OBJECTS)
        $(LINK) $(htdbm_LTFLAGS) $(htdbm_OBJECTS) $(PROGRAM_LDADD)
 
 ab_OBJECTS = ab.lo
+ab_LDADD = $(PROGRAM_LDADD) $(SSL_LIBS)
 ab: $(ab_OBJECTS)
-       $(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(PROGRAM_LDADD)
+       $(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(ab_LDADD)
 
 checkgid_OBJECTS = checkgid.lo
 checkgid: $(checkgid_OBJECTS)