aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-02 17:38:34 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-02 17:38:34 +0200
commitf1e74072b7a69c8ac9dd80c0ca53af72b893b08a (patch)
treedbfb4ab3ebb59821f17beff6bcdb75b83690f952
parentfa75134008bd9206ca02380927c27581feb65c3e (diff)
Add --target argument to configure to allow cross-compilation.
-rwxr-xr-xconfigure29
1 files changed, 22 insertions, 7 deletions
diff --git a/configure b/configure
index 22989f60..20a39520 100755
--- a/configure
+++ b/configure
@@ -73,6 +73,8 @@ Option Description Default
--events=... Event handler (glib, libevent) $events
--ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto)
$ssl
+
+--target=... Cross compilation target same as host
EOF
exit;
fi
@@ -131,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
@@ -157,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
@@ -488,6 +499,10 @@ CYGWIN* )
;;
esac
+if [ -n "$target" ]; then
+ echo "Cross-compiling for: $target"
+fi
+
echo
echo 'Configuration done:'