diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-02 17:39:40 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-04-02 17:39:40 +0200 |
commit | e46e077ccbe5e3e13637618934a0f7979db6bc69 (patch) | |
tree | f38549ae4abd3cb2a56ae4ba357630d5a5476ce8 | |
parent | 1a57b893378c31bd94182b161921a38bdacf8300 (diff) | |
parent | f1e74072b7a69c8ac9dd80c0ca53af72b893b08a (diff) |
Merge cross compilation patch.
-rwxr-xr-x | configure | 29 |
1 files changed, 21 insertions, 8 deletions
@@ -73,8 +73,8 @@ Option Description Default --events=... Event handler (glib, libevent) $events --ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) $ssl ---arch=... Override target architecture $arch +--target=... Cross compilation target same as host EOF exit; fi @@ -133,6 +133,13 @@ cat<<EOF>config.h #define CPU "$cpu" EOF +if [ -n "$target" ]; then + PKG_CONFIG_PATH=/usr/$target/lib/pkgconfig + PATH=/usr/$target/bin:$PATH + CC=$target-cc + LD=$target-ld +fi + if [ "$debug" = "1" ]; then [ -z "$CFLAGS" ] && CFLAGS=-g echo 'DEBUG=1' >> Makefile.settings @@ -159,15 +166,17 @@ fi echo "CC=$CC" >> Makefile.settings; -if [ -n "$LD" ]; then - echo "LD=$LD" >> Makefile.settings; -elif type ld > /dev/null 2> /dev/null; then - echo "LD=ld" >> Makefile.settings; -else - echo 'Cannot find ld, aborting.' - exit 1; +if [ -z "$LD" ]; then + if type ld > /dev/null 2> /dev/null; then + LD=ld + else + echo 'Cannot find ld, aborting.' + exit 1; + fi fi +echo "LD=$LD" >> Makefile.settings + if [ -z "$PKG_CONFIG" ]; then PKG_CONFIG=pkg-config fi @@ -504,6 +513,10 @@ Windows ) ;; esac +if [ -n "$target" ]; then + echo "Cross-compiling for: $target" +fi + echo echo 'Configuration done:' |