]> granicus.if.org Git - apache/commitdiff
Improve pkg-config usage for mod_ssl/ab:
authorKaspar Brand <kbrand@apache.org>
Thu, 3 Jan 2013 07:23:27 +0000 (07:23 +0000)
committerKaspar Brand <kbrand@apache.org>
Thu, 3 Jan 2013 07:23:27 +0000 (07:23 +0000)
also use pkg-config for determining the -l flags (and fall back
to a hardcoded default of "-lssl -lcrypto")

add --static to pkg-config invocations, so that libraries for
static linking are also taken into account (PR 54252 - note that
the additional flags will only appear in modules/ssl/modules.mk
and ab_LDFLAGS, so potential side effects are limited)

separate --libs-only-L and --libs-only-other into two invocations
(can't be used concurrently, only the first takes effect)

use --silence-errors where applicable

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

acinclude.m4

index 91f54f16ff3a39578ac3dd44f19307968df67d88..de2aa3d1578cc1e9d135c247c13f3ca4f3adc077 100644 (file)
@@ -535,14 +535,17 @@ AC_DEFUN(APACHE_CHECK_OPENSSL,[
         PKG_CONFIG_PATH="${ap_openssl_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
         export PKG_CONFIG_PATH
       fi
-      ap_openssl_libs="`$PKGCONFIG --libs-only-l openssl 2>&1`"
+      ap_openssl_libs="`$PKGCONFIG --libs-only-l --static --silence-errors openssl`"
       if test $? -eq 0; then
         ap_openssl_found="yes"
         pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
         APR_ADDTO(CPPFLAGS, [$pkglookup])
         APR_ADDTO(MOD_CFLAGS, [$pkglookup])
         APR_ADDTO(ab_CFLAGS, [$pkglookup])
-        pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
+        pkglookup="`$PKGCONFIG --libs-only-L --static openssl`"
+        APR_ADDTO(LDFLAGS, [$pkglookup])
+        APR_ADDTO(MOD_LDFLAGS, [$pkglookup])
+        pkglookup="`$PKGCONFIG --libs-only-other --static openssl`"
         APR_ADDTO(LDFLAGS, [$pkglookup])
         APR_ADDTO(MOD_LDFLAGS, [$pkglookup])
       fi
@@ -575,7 +578,7 @@ AC_DEFUN(APACHE_CHECK_OPENSSL,[
       [AC_MSG_RESULT(FAILED)])
 
     if test "x$ac_cv_openssl" = "xyes"; then
-      ap_openssl_libs="-lssl -lcrypto `$apr_config --libs`"
+      ap_openssl_libs="${ap_openssl_libs:--lssl -lcrypto} `$apr_config --libs`"
       APR_ADDTO(MOD_LDFLAGS, [$ap_openssl_libs])
       APR_ADDTO(LIBS, [$ap_openssl_libs])
       APR_SETVAR(ab_LDFLAGS, [$MOD_LDFLAGS])