Advertisement
gamaral

0001-Improved-cross-compiler-support.patch

Aug 30th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.90 KB | None | 0 0
  1. From a59fc9c4715970a1c21d055e1143957179b17ead Mon Sep 17 00:00:00 2001
  2. From: "Guillermo A. Amaral" <g@maral.me>
  3. Date: Sun, 30 Aug 2015 15:22:58 -0700
  4. Subject: [PATCH] Improved cross compiler support.
  5.  
  6. * Added a configure option for sysroot.
  7. * Prevent pkgconfig environment variables to be clobbered.
  8. * Prevent PATH environment variable pollution.
  9. * Backward compatible.
  10.  
  11. Signed-off-by: Guillermo A. Amaral <g@maral.me>
  12. ---
  13. configure | 31 +++++++++++++++++++++++++++----
  14.  1 file changed, 27 insertions(+), 4 deletions(-)
  15.  
  16. diff --git a/configure b/configure
  17. index 921c9b4..dadfd8a 100755
  18. --- a/configure
  19. +++ b/configure
  20. @@ -22,6 +22,7 @@ pidfile='/var/run/bitlbee.pid'
  21.  ipcsocket=''
  22.  pcdir='$prefix/lib/pkgconfig'
  23.  systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib"
  24. +sysroot=''
  25.  
  26.  # Set these to default-on to let it be overriden by either the user or purple
  27.  #
  28. @@ -148,6 +149,7 @@ Option      Description             Default
  29.  
  30.  
  31.  --target=...   Cross compilation target        same as host
  32. +--sysroot=...  Cross compilation sysroot       $sysroot
  33.  EOF
  34.         exit;
  35.     fi
  36. @@ -239,12 +241,33 @@ EOF
  37.  
  38.  
  39.  if [ -n "$target" ]; then
  40. -   PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
  41. -   export PKG_CONFIG_LIBDIR
  42. -   PATH=/usr/$target/bin:$PATH
  43. +   # prepend sysroot to system lib dirs
  44. +
  45. +   systemlibdirs_cross=''
  46. +   for i in $systemlibdirs; do
  47. +       systemlibdirs_cross+="$sysroot$i "
  48. +   done
  49. +   systemlibdirs=$systemlibdirs_cross
  50. +   unset systemlibdirs_cross
  51. +
  52. +   # backward compatibility
  53. +
  54. +   if [ -z "$PKG_CONFIG_LIBDIR" ]; then
  55. +       PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
  56. +       export PKG_CONFIG_LIBDIR
  57. +   fi
  58. +
  59. +   if [ -d /usr/$target/bin ]; then
  60. +       PATH=/usr/$target/bin:$PATH
  61. +   fi
  62. +
  63. +   if [ -d /usr/$target/lib ]; then
  64. +       systemlibdirs+="/usr/$target/lib"
  65. +   fi
  66. +
  67.     CC=$target-cc
  68.     LD=$target-ld
  69. -   systemlibdirs="/usr/$target/lib"
  70. +   STRIP=$target-strip
  71.  fi
  72.  
  73.  if [ "$asan" = "1" ]; then
  74. --
  75. 2.4.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement