]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add support for cross compiling to apxs. If apxs is being executed from somewhere
authorGraham Leggett <minfrin@apache.org>
Fri, 27 Dec 2019 23:00:53 +0000 (23:00 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 27 Dec 2019 23:00:53 +0000 (23:00 +0000)
other than its target location, add that prefix to includes and library directories.
Without this, apxs would fail to find config_vars.mk and exit.

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

CHANGES
support/apxs.in

diff --git a/CHANGES b/CHANGES
index e86ae23a235ebbd93ecd5a5f33a9b503bf95a360..292f93e0458d1db8cfc91190dc267d486c9596ec 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) Add support for cross compiling to apxs. If apxs is being executed from somewhere
+     other than its target location, add that prefix to includes and library directories.
+     Without this, apxs would fail to find config_vars.mk and exit. [Graham Leggett]
+
   *) Add a config layout for OpenWRT. [Graham Leggett]
 
   *) mod_http2: Fixed rare cases where a h2 worker could deadlock the main connection. 
index ad1287ffb1369ee277e650c9295ab75a1a2b2101..e159418b625e5bf2bc59a8c7687615255bc2d7af 100644 (file)
@@ -23,10 +23,15 @@ package apxs;
 ##  Configuration
 ##
 
+#   are we building in a cross compile environment? If so, destdir contains
+#   the base directory of the cross compiled environment, otherwise destdir
+#   is the empty string.
+my $destdir = substr($0, 0, rindex($0, "@exp_bindir@"));
+
 my %config_vars = ();
 
 my $installbuilddir = "@exp_installbuilddir@";
-get_config_vars("$installbuilddir/config_vars.mk",\%config_vars);
+get_config_vars($destdir . "$installbuilddir/config_vars.mk",\%config_vars);
 
 # read the configuration variables once
 
@@ -41,10 +46,10 @@ my $CFG_CFLAGS     = join ' ', map { get_vars($_) }
   qw(SHLTCFLAGS CFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);
 my $CFG_LDFLAGS    = join ' ', map { get_vars($_) }
   qw(LDFLAGS NOTEST_LDFLAGS SH_LDFLAGS);
-my $includedir     = get_vars("includedir");
+my $includedir     = $destdir . get_vars("includedir");
 my $CFG_INCLUDEDIR = eval qq("$includedir");
 my $CFG_CC         = get_vars("CC");
-my $libexecdir     = get_vars("libexecdir");
+my $libexecdir     = $destdir . get_vars("libexecdir");
 my $CFG_LIBEXECDIR = eval qq("$libexecdir");
 my $sbindir        = get_vars("sbindir");
 my $CFG_SBINDIR    = eval qq("$sbindir");
@@ -335,7 +340,7 @@ if ($opt_q) {
     }
 }
 
-my $apr_config = get_vars("APR_CONFIG");
+my $apr_config = $destdir . get_vars("APR_CONFIG");
 
 if (! -x "$apr_config") {
     error("$apr_config not found!");
@@ -346,7 +351,7 @@ my $apr_major_version = (split /\./, `$apr_config --version`)[0];
 
 my $apu_config = "";
 if ($apr_major_version < 2) {
-    $apu_config = get_vars("APU_CONFIG");
+    $apu_config = $destdir . get_vars("APU_CONFIG");
 
     if (! -x "$apu_config") {
         error("$apu_config not found!");