From ffc4ef33c77eb7d6ce989dcf87f66b1c18c1d632 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 19 Sep 2002 05:43:16 +0000 Subject: [PATCH] Rework the apxs -cp command to work when the source dir isn't available by querying apr-config and apu-config at link-time instead. (Note that the $apr_config value in configure.in isn't sufficient as we need to know where apr-config will be when we execute apxs later on - hence the --bindir option to apr-config and apu-config.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96905 13f79535-47bb-0310-9956-ffa450edef68 --- acinclude.m4 | 2 ++ configure.in | 2 ++ support/apxs.in | 21 +++++++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index ed3964886f..2342fabff1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -85,6 +85,8 @@ AC_DEFUN(APACHE_GEN_CONFIG_VARS,[ APACHE_SUBST(MK_IMPLIB) APACHE_SUBST(INSTALL_PROG_FLAGS) APACHE_SUBST(DSO_MODULES) + APACHE_SUBST(APR_BINDIR) + APACHE_SUBST(APU_BINDIR) abs_srcdir="`(cd $srcdir && pwd)`" diff --git a/configure.in b/configure.in index 68e7485712..9a40f9d49f 100644 --- a/configure.in +++ b/configure.in @@ -81,6 +81,7 @@ APR_ADDTO(CPPFLAGS, `$apr_config --cppflags`) APR_ADDTO(LDFLAGS, `$apr_config --ldflags`) APR_ADDTO(INCLUDES, `$apr_config --includes`) SHLIBPATH_VAR=`$apr_config --shlib-path-var` +APR_BINDIR=`$apr_config --bindir` echo $ac_n "${nl}Configuring Apache Portable Runtime Utility library...${nl}" @@ -99,6 +100,7 @@ fi APR_ADDTO(LDFLAGS, `$apu_config --ldflags`) APR_ADDTO(INCLUDES, `$apu_config --includes`) +APU_BINDIR=`$apu_config --bindir` echo $ac_n "${nl}Configuring PCRE regular expression library ...${nl}" diff --git a/support/apxs.in b/support/apxs.in index 9782c89f45..ed3de518ce 100644 --- a/support/apxs.in +++ b/support/apxs.in @@ -450,10 +450,27 @@ if ($opt_c) { } if ($opt_p == 1) { - $opt .= " ".get_vars("EXTRA_LDFLAGS")." ".get_vars("AP_LIBS"); + my $apr_bindir = get_vars("APR_BINDIR"); + my $apu_bindir = get_vars("APU_BINDIR"); + + if (! -x "$apr_bindir/apr-config") { + error("$apr_bindir/apr-config not found!"); + exit(1); + } + if (! -x "$apu_bindir/apu-config") { + error("$apu_bindir/apu-config not found!"); + exit(1); + } + + my $apr_libs=`$apr_bindir/apr-config --ldflags --link-libtool --libs`; + chomp($apr_libs); + my $apu_libs=`$apu_bindir/apu-config --ldflags --link-libtool --libs`; + chomp($apu_libs); + + $opt .= " ".$apu_libs." ".$apr_libs; } else { - $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version"; + $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version"; } push(@cmds, "$installbuilddir/libtool $ltflags --mode=link $CFG_CC -o $dso_file $opt $lo"); -- 2.50.1