diff options
author | Guillermo A. Amaral <g@maral.me> | 2015-08-30 15:22:58 -0700 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-08-31 10:58:41 -0300 |
commit | f5bbaba3b2015f039221945431f98027cb3d2d49 (patch) | |
tree | 5c273d76296320305e7250848ee2142a0078137a /configure | |
parent | aa3b61e178fbdb7069e171cc70c631ee63f72c8d (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-x | configure | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -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 |