You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rp...@apache.org on 2023/03/13 10:29:04 UTC
svn commit: r1908342 - in /apr/apr/branches/1.7.x: ./ CHANGES apr-config.in configure.in
Author: rpluem
Date: Mon Mar 13 10:29:04 2023
New Revision: 1908342
URL: http://svn.apache.org/viewvc?rev=1908342&view=rev
Log:
Merge r1908248, r1908336 from trunk:
Fix crosscompiling detection in apr-1-config
Since r1872148 apr-1-config tries to detect if it runs in a crosscompile
scenario. Fix the detection to correctly distinguish between crosscompiling
and DESTDIR installations for packaging.
* configure.in: Set APR_CROSS_COMPILING to 'no', 'yes' or 'maybe' based on
possible --host and --build parameters given to configure to determine
if configure was called for a crosscompiling scenario. This was inspired
by how autoconf itself detects crosscompiling scenarios.
* apr-config.in: Use the value from APR_CROSS_COMPILING to determine if
we are in a crosscompiling scenario. Furthermore normalize the pathes
we use for suffix matches by collapsing multiple consecutive '/' to one.
PR: 66510
* Add CHANGES entry for r1908248 [skip ci]
Modified:
apr/apr/branches/1.7.x/ (props changed)
apr/apr/branches/1.7.x/CHANGES
apr/apr/branches/1.7.x/apr-config.in
apr/apr/branches/1.7.x/configure.in
Propchange: apr/apr/branches/1.7.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1908248,1908336
Modified: apr/apr/branches/1.7.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/CHANGES?rev=1908342&r1=1908341&r2=1908342&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.7.x/CHANGES [utf-8] Mon Mar 13 10:29:04 2023
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 1.7.3
+ *) apr-1-config: Fix crosscompiling detection in apr-1-config. PR 66510
+ [Ruediger Pluem]
+
*) configure: Add --enable-sysv-shm to use SysV shared memory (shmget) if
available. [Ruediger Pluem]
Modified: apr/apr/branches/1.7.x/apr-config.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/apr-config.in?rev=1908342&r1=1908341&r2=1908342&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/apr-config.in (original)
+++ apr/apr/branches/1.7.x/apr-config.in Mon Mar 13 10:29:04 2023
@@ -48,13 +48,28 @@ APR_LIBNAME="@APR_LIBNAME@"
# NOTE: the following line is modified during 'make install': alter with care!
location=@APR_CONFIG_LOCATION@
-# absolute path, but not installed path - we're cross compiling
-case "$0" in
- "${bindir}/"*) ;;
- "/"*) location=crosscompile;
- APR_TARGET_DIR=${0%${bindir}/apr-${APR_MAJOR_VERSION}-config} ;;
- *) ;;
-esac
+cross_compiling=@APR_CROSS_COMPILING@
+
+if test "$cross_compiling" != "no"; then
+
+ # Normalize $0 and bindir by removing consecutive '/' as the comparison
+ # and the suffix removal below might fail for semantic equal pathes.
+ # XXX: This is not perfect. On Linux we could use realpath for this purpose
+ # but realpath is not portable.
+ normalized_command=`echo $0 | tr -s /`
+ normalized_bindir=`echo ${bindir} | tr -s /`
+ # Remove trailing '/'
+ normalized_bindir=${normalized_bindir%/}
+
+ # absolute path, but not installed path - we're cross compiling
+ case "$normalized_command" in
+ "${normalized_bindir}/"*) ;;
+ "/"*) location=crosscompile;
+ APR_TARGET_DIR=${normalized_command%${normalized_bindir}/apr-${APR_MAJOR_VERSION}-config};
+ ;;
+ *) ;;
+ esac
+fi
show_usage()
{
Modified: apr/apr/branches/1.7.x/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/configure.in?rev=1908342&r1=1908341&r2=1908342&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/configure.in (original)
+++ apr/apr/branches/1.7.x/configure.in Mon Mar 13 10:29:04 2023
@@ -140,6 +140,18 @@ fi
AC_SUBST(APR_CONFIG_LOCATION)
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ APR_CROSS_COMPILING=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ APR_CROSS_COMPILING=yes
+ fi
+else
+ APR_CROSS_COMPILING=no
+fi
+
+AC_SUBST(APR_CROSS_COMPILING)
+
# Libtool might need this symbol -- it must point to the location of
# the generated libtool script (not necessarily the "top" build dir).
#