[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apr-cvs
Subject:    svn commit: r1872146 - /apr/apr/trunk/apr-config.in
From:       minfrin () apache ! org
Date:       2019-12-31 21:24:55
Message-ID: 20191231212455.BDE6417A010 () svn01-us-east ! apache ! org
[Download RAW message or body]

Author: minfrin
Date: Tue Dec 31 21:24:55 2019
New Revision: 1872146

URL: http://svn.apache.org/viewvc?rev=1872146&view=rev
Log:
Add the ability to cross compile APR.

Modified:
    apr/apr/trunk/apr-config.in

Modified: apr/apr/trunk/apr-config.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/apr-config.in?rev=1872146&r1=1872145&r2=1872146&view=diff
==============================================================================
--- apr/apr/trunk/apr-config.in (original)
+++ apr/apr/trunk/apr-config.in Tue Dec 31 21:24:55 2019
@@ -48,6 +48,14 @@ 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
+
 show_usage()
 {
     cat << EOF
@@ -93,6 +101,8 @@ fi
 
 if test "$location" = "installed"; then
     LA_FILE="$libdir/lib${APR_LIBNAME}.la"
+elif test "$location" = "crosscompile"; then
+    LA_FILE="$APR_TARGET_DIR/$libdir/lib${APR_LIBNAME}.la"
 else
     LA_FILE="$APR_BUILD_DIR/lib${APR_LIBNAME}.la"
 fi
@@ -122,6 +132,8 @@ while test $# -gt 0; do
     --includedir)
     if test "$location" = "installed"; then
         flags="$includedir"
+    elif test "$location" = "crosscompile"; then
+        flags="$APR_TARGET_DIR/$includedir"
     elif test "$location" = "source"; then
         flags="$APR_SOURCE_DIR/include"
     else
@@ -154,6 +166,8 @@ while test $# -gt 0; do
     --includes)
     if test "$location" = "installed"; then
         flags="$flags -I$includedir $EXTRA_INCLUDES"
+    elif test "$location" = "crosscompile"; then
+        flags="$flags -I$APR_TARGET_DIR/$includedir $EXTRA_INCLUDES"
     elif test "$location" = "source"; then
         flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
     else
@@ -168,6 +182,8 @@ while test $# -gt 0; do
     --installbuilddir)
     if test "$location" = "installed"; then
         echo "${installbuilddir}"
+    elif test "$location" = "crosscompile"; then
+        echo "$APR_TARGET_DIR/${installbuilddir}"
     elif test "$location" = "source"; then
         echo "$APR_SOURCE_DIR/build"
     else
@@ -184,6 +200,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${APR_LIBNAME}"
+    elif test "$location" = "crosscompile"; then
+        flags="$flags -L$APR_TARGET_DIR/$libdir -l${APR_LIBNAME}"
     else
         ### this surely can't work since the library is in .libs?
         flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
@@ -201,6 +219,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${APR_LIBNAME}"
+    elif test "$location" = "crosscompile"; then
+        flags="$flags  -L${APR_TARGET_DIR}/$libdir  -l${APR_LIBNAME}"
     else
         flags="$flags $LA_FILE"
     fi
@@ -225,6 +245,8 @@ while test $# -gt 0; do
     --apr-libtool)
     if test "$location" = "installed"; then
         echo "${installbuilddir}/libtool"
+    elif test "$location" = "crosscompile"; then
+        echo "$APR_TARGET_DIR/${installbuilddir}/build"
     else
         echo "$APR_BUILD_DIR/libtool"
     fi


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic