summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2019-12-31 21:27:00 +0000
committerminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2019-12-31 21:27:00 +0000
commit279718fd10cc987ecd7b708b41aca27ba128e078 (patch)
treeec5558136b73f9c804b525c09248bc725c13d8c3
parent7310420441b6402f2fce0ad9ac8509be1a7f6be8 (diff)
downloadlibapr-util-279718fd10cc987ecd7b708b41aca27ba128e078.tar.gz
Add the ability to cross compile APR-Util.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1872148 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES2
-rw-r--r--apu-config.in18
2 files changed, 20 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index d835d4f4..2af497e1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
-*- coding: utf-8 -*-
Changes with APR-util 1.7.0
+ *) Add the ability to cross compile APR-Util. [Graham Leggett]
+
*) Teach configure how to find and build against MariaDB 10.2. PR 61517
[Kris Karas <bugs-a17 moonlit-rail.com>]
diff --git a/apu-config.in b/apu-config.in
index 82109e52..14c3d291 100644
--- a/apu-config.in
+++ b/apu-config.in
@@ -43,6 +43,14 @@ APU_DB_VERSION="@apu_db_version@"
# NOTE: the following line is modified during 'make install': alter with care!
location=@APU_CONFIG_LOCATION@
+# absolute path, but not installed path - we're cross compiling
+case "$0" in
+ "${bindir}/"*) ;;
+ "/"*) location=crosscompile;
+ APU_TARGET_DIR=${0%${bindir}/apu-${APU_MAJOR_VERSION}-config} ;;
+ *) ;;
+esac
+
show_usage()
{
cat << EOF
@@ -85,6 +93,8 @@ fi
if test "$location" = "installed"; then
LA_FILE="$libdir/lib${APRUTIL_LIBNAME}.la"
+elif test "$location" = "crosscompile"; then
+ LA_FILE="$APU_TARGET_DIR/$libdir/lib${APRUTIL_LIBNAME}.la"
else
LA_FILE="$APU_BUILD_DIR/lib${APRUTIL_LIBNAME}.la"
fi
@@ -129,6 +139,8 @@ while test $# -gt 0; do
--includedir)
if test "$location" = "installed"; then
flags="$includedir"
+ elif test "$location" = "crosscompile"; then
+ flags="$APU_TARGET_DIR/$includedir"
elif test "$location" = "source"; then
flags="$APU_SOURCE_DIR/include"
else
@@ -141,6 +153,8 @@ while test $# -gt 0; do
--includes)
if test "$location" = "installed"; then
flags="$flags -I$includedir $INCLUDES"
+ elif test "$location" = "crosscompile"; then
+ flags="$flags -I$APU_TARGET_DIR/$includedir $EXTRA_INCLUDES"
elif test "$location" = "source"; then
flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
else
@@ -163,6 +177,8 @@ while test $# -gt 0; do
if test "$location" = "installed"; then
### avoid using -L if libdir is a "standard" location like /usr/lib
flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
+ elif test "$location" = "crosscompile"; then
+ flags="$flags -L$APU_TARGET_DIR/$libdir -l$APRUTIL_LIBNAME"
else
flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
fi
@@ -179,6 +195,8 @@ while test $# -gt 0; do
# Since the user is specifying they are linking with libtool, we
# *know* that -R will be recognized by libtool.
flags="$flags -L$libdir -R$libdir -l$APRUTIL_LIBNAME"
+ elif test "$location" = "crosscompile"; then
+ flags="$flags -L${APU_TARGET_DIR}/$libdir -l$APRUTIL_LIBNAME"
else
flags="$flags $LA_FILE"
fi