aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorGuillermo A. Amaral <g@maral.me>2015-08-30 15:22:58 -0700
committerdequis <dx@dxzone.com.ar>2015-08-31 10:58:41 -0300
commitf5bbaba3b2015f039221945431f98027cb3d2d49 (patch)
tree5c273d76296320305e7250848ee2142a0078137a /configure
parentaa3b61e178fbdb7069e171cc70c631ee63f72c8d (diff)
Improved cross compiler support.
* Added a configure option for sysroot. * Prevent pkgconfig environment variables to be clobbered. * Prevent PATH environment variable pollution. * Backward compatible. Signed-off-by: Guillermo A. Amaral <g@maral.me>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure31
1 files changed, 27 insertions, 4 deletions
diff --git a/configure b/configure
index 921c9b49..5a0527df 100755
--- a/configure
+++ b/configure
@@ -22,6 +22,7 @@ pidfile='/var/run/bitlbee.pid'
ipcsocket=''
pcdir='$prefix/lib/pkgconfig'
systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib"
+sysroot=''
# Set these to default-on to let it be overriden by either the user or purple
#
@@ -148,6 +149,7 @@ Option Description Default
--target=... Cross compilation target same as host
+--sysroot=... Cross compilation sysroot $sysroot
EOF
exit;
fi
@@ -239,12 +241,33 @@ EOF
if [ -n "$target" ]; then
- PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
- export PKG_CONFIG_LIBDIR
- PATH=/usr/$target/bin:$PATH
+ # prepend sysroot to system lib dirs
+
+ systemlibdirs_cross=''
+ for i in $systemlibdirs; do
+ systemlibdirs_cross="$systemlibdirs_cross $sysroot$i"
+ done
+ systemlibdirs=$systemlibdirs_cross
+ unset systemlibdirs_cross
+
+ # backward compatibility
+
+ if [ -z "$PKG_CONFIG_LIBDIR" ]; then
+ PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
+ export PKG_CONFIG_LIBDIR
+ fi
+
+ if [ -d /usr/$target/bin ]; then
+ PATH=/usr/$target/bin:$PATH
+ fi
+
+ if [ -d /usr/$target/lib ]; then
+ systemlibdirs="$systemlibdirs /usr/$target/lib"
+ fi
+
CC=$target-cc
LD=$target-ld
- systemlibdirs="/usr/$target/lib"
+ STRIP=$target-strip
fi
if [ "$asan" = "1" ]; then