Permalink
Browse files

Improve pkg-config usage for mod_ssl/ab:

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
  • Loading branch information...
1 parent 15c31e2 commit 22d2b604b19192b5b584bc0e2ba8703b65705b97 Kaspar Brand committed Jan 3, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 acinclude.m4
View
@@ -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])

0 comments on commit 22d2b60

Please sign in to comment.