From cbcc528db81a7bb3c79d194c7d89abb487be4272 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 30 Jan 2013 16:25:31 +0000 Subject: [PATCH] Merge r1428184, r1429228 from trunk: 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 mod_ssl/ab: only use "--static" for pkg-config when explicity requested (by adding an "--enable-ssl-staticlib-deps" option to configure) Submitted by: kbrand Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1440507 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 8 -------- acinclude.m4 | 14 +++++++++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/STATUS b/STATUS index eb4cd8a769..6b627a21de 100644 --- a/STATUS +++ b/STATUS @@ -187,14 +187,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK: 2.4.x patch: trunk patch works. +1: humbedooh, covener - * mod_ssl/ab: improve pkg-config usage in configure (addresses PR 54252) - trunk patch: https://svn.apache.org/viewvc/httpd/httpd/trunk/acinclude.m4?r1=1396440&r2=1429228 - 2.4.x patch: trunk patch works - +1: kbrand, jorton, jerenkrantz - -1: jim: patch doesn't apply (2 out of 2 hunks FAILED -- saving rejects to file acinclude.m4.rej) - kbrand: applying svn diff -r 1396440:1429228 https://svn.apache.org/repos/asf/httpd/httpd/trunk/acinclude.m4 - works for me - what patch did you apply? (note that it's the - combination of two commits, namely r1428184 and r1429228) A list of further possible backports can be found at: http://people.apache.org/~rjung/patches/possible-backports-httpd-trunk-2_4.txt diff --git a/acinclude.m4 b/acinclude.m4 index fc05390308..26b001df7b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -517,14 +517,22 @@ 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`" + AC_ARG_ENABLE(ssl-staticlib-deps,APACHE_HELP_STRING(--enable-ssl-staticlib-deps,[link mod_ssl with dependencies of OpenSSL's static libraries (as indicated by "pkg-config --static"). Must be specified in addition to --enable-ssl.]), [ + if test "$enableval" = "yes"; then + PKGCONFIG_LIBOPTS="--static" + fi + ]) + ap_openssl_libs="`$PKGCONFIG $PKGCONFIG_LIBOPTS --libs-only-l --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 $PKGCONFIG_LIBOPTS --libs-only-L openssl`" + APR_ADDTO(LDFLAGS, [$pkglookup]) + APR_ADDTO(MOD_LDFLAGS, [$pkglookup]) + pkglookup="`$PKGCONFIG $PKGCONFIG_LIBOPTS --libs-only-other openssl`" APR_ADDTO(LDFLAGS, [$pkglookup]) APR_ADDTO(MOD_LDFLAGS, [$pkglookup]) fi @@ -557,7 +565,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]) -- 2.40.0