summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2007-04-22 23:08:31 +0300
committerLauri Leukkunen <lle@rahina.org>2007-04-22 23:08:31 +0300
commit07feac93193795cb6905eff4b8e2bd4c4b7ed59a (patch)
tree7223656fb1932e9051e4bd6b239a2355cc7103d7
parent4bb30383701d89b489cf37d93d1f49b5b9739918 (diff)
Add debian tools env var support to utils/sb2
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
-rwxr-xr-xutils/sb212
-rwxr-xr-xutils/sb2-init2
2 files changed, 12 insertions, 2 deletions
diff --git a/utils/sb2 b/utils/sb2
index 4299853..e9d5a42 100755
--- a/utils/sb2
+++ b/utils/sb2
@@ -35,7 +35,7 @@ cd $SBOX_TARGET_ROOT
HOST_GCC_INC_DIR=$(echo "#include <stdio.h>" | gcc -M -E - | perl -e 'while(<STDIN>) { $foo{$1} = 1 if m/\/usr([^[:space:]]*\/include)/;}; foreach my $k (keys %foo) {print " -isystem $ENV{SBOX_DIR}/share/scratchbox2/host_usr$k"};')
-export PATH=$SBOX_TARGET_ROOT/sb_tools/bin:$SBOX_DIR/bin:$PATH:$SBOX_TARGET_ROOT/bin:$SBOX_TARGET_ROOT/usr/bin:$SBOX_TARGET_ROOT/usr/local/bin
+export PATH=$SBOX_TARGET_ROOT/sb_tools/bin:$SBOX_DIR/bin:$PATH:$SBOX_TARGET_ROOT/bin:$SBOX_TARGET_ROOT/usr/bin:$SBOX_TARGET_ROOT/usr/local/bin:/sbin:/usr/sbin
export LD_PRELOAD=$SBOX_LIBSB2
export SBOX_EXTRA_HOST_COMPILER_ARGS="$HOST_GCC_INC_DIR"
export SBOX_EXTRA_CROSS_COMPILER_ARGS="--sysroot=$SBOX_TARGET_ROOT -isystem $SBOX_TARGET_ROOT/usr/local/include -isystem $SBOX_TARGET_ROOT/usr/include -I$SBOX_TARGET_ROOT/usr/local/include -I$SBOX_TARGET_ROOT/usr/include -L$SBOX_TARGET_ROOT/usr/local/lib -L$SBOX_TARGET_ROOT/usr/lib -L$SBOX_TARGET_ROOT/lib"
@@ -59,6 +59,16 @@ export SBOX_CROSS_GCC_PREFIX_LIST
export SBOX_HOST_GCC_PREFIX_LIST
export SBOX_UNAME_MACHINE=$SBOX_CPU
+# Debian exports
+if [ $SBOX_CPU = "arm" ]; then
+ export DEB_BUILD_ARCH=armel
+else
+ export DEB_BUILD_ARCH=$SBOX_CPU
+fi
+export DEB_BUILD_ARCH_CPU=$SBOX_CPU
+export DEB_BUILD_GNU_CPU=$SBOX_CPU
+export DEB_BUILD_GNU_TYPE=$SBOX_CPU-linux-gnu
+
sb_map_verbose=$1
sb_bash_args=$*
diff --git a/utils/sb2-init b/utils/sb2-init
index d4c0066..0bfd201 100755
--- a/utils/sb2-init
+++ b/utils/sb2-init
@@ -3,7 +3,7 @@
# Licensed under GPL version 2
-if [ $1 = "--help" ]; then
+if [[ "$1" = "" || "$1" = "--help" ]]; then
echo "Usage: sb2-init [compiler]"
echo "example: sb2-init arm-linux-gcc"
exit 0