Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From a59fc9c4715970a1c21d055e1143957179b17ead Mon Sep 17 00:00:00 2001
- From: "Guillermo A. Amaral" <g@maral.me>
- Date: Sun, 30 Aug 2015 15:22:58 -0700
- Subject: [PATCH] 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>
- ---
- configure | 31 +++++++++++++++++++++++++++----
- 1 file changed, 27 insertions(+), 4 deletions(-)
- diff --git a/configure b/configure
- index 921c9b4..dadfd8a 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+="$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+="/usr/$target/lib"
- + fi
- +
- CC=$target-cc
- LD=$target-ld
- - systemlibdirs="/usr/$target/lib"
- + STRIP=$target-strip
- fi
- if [ "$asan" = "1" ]; then
- --
- 2.4.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement