Changeset f5bbaba


Ignore:
Timestamp:
2015-08-31T13:58:41Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
34d16d5, f85cb0b
Parents:
aa3b61e
git-author:
Guillermo A. Amaral <g@…> (30-08-15 22:22:58)
git-committer:
dequis <dx@…> (31-08-15 13:58:41)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    raa3b61e rf5bbaba  
    2323pcdir='$prefix/lib/pkgconfig'
    2424systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib"
     25sysroot=''
    2526
    2627# Set these to default-on to let it be overriden by either the user or purple
     
    149150
    150151--target=...    Cross compilation target                same as host
     152--sysroot=...   Cross compilation sysroot               $sysroot
    151153EOF
    152154                exit;
     
    240242
    241243if [ -n "$target" ]; then
    242         PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
    243         export PKG_CONFIG_LIBDIR
    244         PATH=/usr/$target/bin:$PATH
     244        # prepend sysroot to system lib dirs
     245
     246        systemlibdirs_cross=''
     247        for i in $systemlibdirs; do
     248                systemlibdirs_cross="$systemlibdirs_cross $sysroot$i"
     249        done
     250        systemlibdirs=$systemlibdirs_cross
     251        unset systemlibdirs_cross
     252
     253        # backward compatibility
     254
     255        if [ -z "$PKG_CONFIG_LIBDIR" ]; then
     256                PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
     257                export PKG_CONFIG_LIBDIR
     258        fi
     259
     260        if [ -d /usr/$target/bin ]; then
     261                PATH=/usr/$target/bin:$PATH
     262        fi
     263
     264        if [ -d /usr/$target/lib ]; then
     265                systemlibdirs="$systemlibdirs /usr/$target/lib"
     266        fi
     267
    245268        CC=$target-cc
    246269        LD=$target-ld
    247         systemlibdirs="/usr/$target/lib"
     270        STRIP=$target-strip
    248271fi
    249272
Note: See TracChangeset for help on using the changeset viewer.