summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2007-02-11 23:29:29 +0200
committerLauri Leukkunen <lleukkun@leka.rahina.org>2007-02-11 23:29:29 +0200
commit3814e374307e0d9cdd3cf8a47fbbc7f117264734 (patch)
treeb44db49d876e882a1479f3705ab8cc1698942dae
parente3f05d5440e0a364dd3c1f5107e273026ad08f81 (diff)
Assorted autotools mappings fixes & linker argument passing
Create extra mapping chain and rules to get autotools and pkg-config work better. Still not sure if this is enough. Cross compiler argument passing in utils/sb2 is now done correctly and includes the -rpath-link flag which makes cross-compiler behave more like a non-cross-compiler.
-rw-r--r--etc/sb2.config.sample4
-rw-r--r--redir_scripts/main.lua3
-rw-r--r--redir_scripts/preload/00_default.lua9
-rw-r--r--redir_scripts/preload/10_basic_chains.lua43
-rwxr-xr-xutils/sb23
5 files changed, 39 insertions, 23 deletions
diff --git a/etc/sb2.config.sample b/etc/sb2.config.sample
index 74a49d0..f833ae8 100644
--- a/etc/sb2.config.sample
+++ b/etc/sb2.config.sample
@@ -7,7 +7,7 @@ SBOX_TARGET_NAME=arm
SBOX_CPU=arm
SBOX_OS=none-linux-gnueabi
SBOX_CLIB=glibc
-SBOX_CPUTRANSPARENCY_METHOD=$HOME/scratchbox/bin/qemu-arm
+SBOX_CPUTRANSPARENCY_METHOD=/home/lleukkun/scratchbox/bin/qemu-arm
SBOX_DEFAULT_GCC_PREFIX=arm-none-linux-gnueabi-
SBOX_TARGET_SETUP_SCRIPT=
@@ -16,7 +16,7 @@ SBOX_CROSS_GCC_NAME=arm-linux-2006q3-27
SBOX_CROSS_GCC_PREFIX_LIST=arm-linux-gnueabi-:arm-linux-:arm-none-linux-gnueabi-
SBOX_CROSS_GCC_SUBST_PREFIX=arm-none-linux-gnueabi-
SBOX_CROSS_GCC_SPECS_FILE=
-SBOX_CROSS_GCC_DIR=$HOME/compilers/arm-2006q3/bin
+SBOX_CROSS_GCC_DIR=/home/lleukkun/compilers/arm-2006q3/bin
SBOX_CROSS_GCC_LD_ARGS=
SBOX_HOST_GCC_NAME=host-gcc
diff --git a/redir_scripts/main.lua b/redir_scripts/main.lua
index 12b68de..c6082d8 100644
--- a/redir_scripts/main.lua
+++ b/redir_scripts/main.lua
@@ -56,6 +56,9 @@ if (t ~= nil) then
if (not export_chains[i].binary) then
export_chains[i].binary = ".*"
end
+ if (not export_chains[i].rules) then
+ export_chains[i].rules = {}
+ end
-- loop through the rules
for r = 1, table.maxn(export_chains[i].rules) do
if (not export_chains[i].rules[r].func_name) then
diff --git a/redir_scripts/preload/00_default.lua b/redir_scripts/preload/00_default.lua
index 5715cba..e22587b 100644
--- a/redir_scripts/preload/00_default.lua
+++ b/redir_scripts/preload/00_default.lua
@@ -81,6 +81,14 @@ hostgcc = {
}
+-- pkgconfig
+
+pkgconfig = {
+ func_name = ".*",
+ path = "^/usr/lib/pkgconfig.*",
+ map_to = "="
+}
+
-- don't map anything else from TARGETDIR
targetdir = {
@@ -120,6 +128,7 @@ default_chain = {
default_tmp,
default_etc,
hostgcc,
+ pkgconfig,
targetdir,
default_rootdir
}
diff --git a/redir_scripts/preload/10_basic_chains.lua b/redir_scripts/preload/10_basic_chains.lua
index 8f71b80..0d02efb 100644
--- a/redir_scripts/preload/10_basic_chains.lua
+++ b/redir_scripts/preload/10_basic_chains.lua
@@ -1,40 +1,39 @@
-- Copyright (C) 2007 Lauri Leukkunen <lle@rahina.org>
-- Licensed under MIT License.
-install = {
+
+util_chain = {
next_chain = default_chain,
- binary = "^install$",
+ binary = nil,
+ noentry = 1,
rules = {
+ autoconf,
+ automake,
+ aclocal,
{path = "^" .. target_root ..".*", map_to = nil},
+ {path = "^/home.*", map_to = nil},
{path = ".*", map_to = "="}
}
}
+install = {
+ next_chain = util_chain,
+ binary = "^install$"
+}
+
ln = {
- next_chain = default_chain,
- binary = "^ln$",
- rules = {
- {path = "^" .. target_root ..".*", map_to = nil},
- {path = ".*", map_to = "="}
- }
+ next_chain = util_chain,
+ binary = "^ln$"
}
cp = {
- next_chain = default_chain,
- binary = "^cp$",
- rules = {
- {path = "^" .. target_root ..".*", map_to = nil},
- {path = ".*", map_to = "="}
- }
+ next_chain = util_chain,
+ binary = "^cp$"
}
rm = {
- next_chain = default_chain,
- binary = "^rm$",
- rules = {
- {path = "^" .. target_root ..".*", map_to = nil},
- {path = ".*", map_to = "="}
- }
+ next_chain = util_chain,
+ binary = "^rm$"
}
@@ -43,6 +42,7 @@ libtool = {
binary = ".*libtool.*",
rules = {
{path = "^" .. target_root ..".*", map_to = nil},
+ {path = "^/home.*", map_to = nil},
{path = "^/", map_to = "="}
}
}
@@ -52,6 +52,7 @@ qemu = {
binary = ".*qemu.*",
rules = {
{path = "^" .. target_root ..".*", map_to = nil},
+ {path = "^/home.*", map_to = nil},
{path = "^/", map_to = "="}
}
}
@@ -62,6 +63,7 @@ dpkg = {
binary = ".*dpkg.*",
rules = {
{path = "^" .. target_root ..".*", map_to = nil},
+ {path = "^/home.*", map_to = nil},
{path = "^/usr/lib/dpkg.*", map_to = nil},
{path = "^/usr/share/dpkg.*", map_to = nil}
}
@@ -86,6 +88,7 @@ sh = {
}
export_chains = {
+ util_chain,
install,
ln,
cp,
diff --git a/utils/sb2 b/utils/sb2
index d625359..a5db949 100755
--- a/utils/sb2
+++ b/utils/sb2
@@ -38,7 +38,8 @@ HOST_GCC_INC_DIR=$(echo "#include <stdio.h>" | gcc -M -E - | perl -e 'while(<STD
export PATH=$SBOX_TARGET_ROOT/bin:$SBOX_TARGET_ROOT/usr/bin:$SBOX_TARGET_ROOT/usr/local/bin:$PATH:$SBOX_DIR/bin
export LD_PRELOAD=$SBOX_LIBSB2
export SBOX_EXTRA_HOST_COMPILER_ARGS="$HOST_GCC_INC_DIR"
-export SBOX_EXTRA_TARGET_COMPILER_ARGS="-isystem /usr/local/include -isystem /usr/include"
+export SBOX_EXTRA_CROSS_COMPILER_ARGS="-isystem /usr/local/include -isystem /usr/include -I/usr/local/include -I/usr/include -L/usr/local/lib -L/usr/lib -L/lib"
+export SBOX_EXTRA_CROSS_LD_ARGS="-rpath-link /usr/local/lib:/usr/lib:/lib"
export SBOX_SCRATCHBOX_CONFIG=$SBOX_TARGET_ROOT/sb2.config
export PS1="[SB2] \u@\h \w \$ "