summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Aarnio <Lauri.Aarnio@iki.fi>2008-06-07 08:07:23 +0300
committerLauri Leukkunen <lle@rahina.org>2008-06-17 10:07:51 +0300
commite0b3e9cc7d938534bf0c62f232ae80dad15e0c2d (patch)
tree7de87a44a5bd4952549cbec569b02bca36d3f368
parent7153cf31589dcc30b508e84db1dda7baa0d3a034 (diff)
Use mode-specific "specs" files for the cross-gcc + a "specs" file for "maemo"
- Chages the way how the cross compiler is started: if a "specs" file exists, uses that, otherwise adds "-I/usr/include" to gcc's arguments (which was the "old way", used until this change) - Added a "specs" file for the "maemo" mode; this file comes directly from the old scratchbox ("SB1") configuration.
-rw-r--r--lua_scripts/argvenvp_gcc.lua4
-rw-r--r--modeconf/gcc-specs.maemo9
-rwxr-xr-xutils/sb2-init13
3 files changed, 24 insertions, 2 deletions
diff --git a/lua_scripts/argvenvp_gcc.lua b/lua_scripts/argvenvp_gcc.lua
index 48249a0..0f4fb34 100644
--- a/lua_scripts/argvenvp_gcc.lua
+++ b/lua_scripts/argvenvp_gcc.lua
@@ -38,6 +38,7 @@ gcc_tools = {
gcc_bindir = os.getenv("SBOX_CROSS_GCC_DIR")
gcc_subst_prefix = os.getenv("SBOX_CROSS_GCC_SUBST_PREFIX")
gcc_extra_args = os.getenv("SBOX_EXTRA_CROSS_COMPILER_ARGS")
+gcc_specs = os.getenv("SBOX_CROSS_GCC_SPECS_FILE")
gcc_extra_stdinc = os.getenv("SBOX_EXTRA_CROSS_COMPILER_STDINC")
gcc_block_args = os.getenv("SBOX_BLOCK_CROSS_COMPILER_ARGS")
ld_extra_args = os.getenv("SBOX_EXTRA_CROSS_LD_ARGS")
@@ -55,6 +56,9 @@ for prefix in string.gmatch(":" .. os.getenv("SBOX_CROSS_GCC_PREFIX_LIST"), "[^:
tmp.new_filename = gcc_bindir .. "/" .. gcc_subst_prefix .. gcc_compilers[i]
tmp.add_tail = {}
tmp.remove = {}
+ if (gcc_specs) then
+ table.insert(tmp.add_tail, "-specs="..gcc_specs)
+ end
if (gcc_extra_args) then
for gcc_extra in string.gmatch(gcc_extra_args, "[^ ]+") do
table.insert(tmp.add_tail, gcc_extra)
diff --git a/modeconf/gcc-specs.maemo b/modeconf/gcc-specs.maemo
new file mode 100644
index 0000000..43e9997
--- /dev/null
+++ b/modeconf/gcc-specs.maemo
@@ -0,0 +1,9 @@
+
+*cross_compile:
+0
+
+%rename cpp old_cpp
+
+*cpp:
+-isystem /usr/local/include -isystem /usr/include %(old_cpp)
+
diff --git a/utils/sb2-init b/utils/sb2-init
index 5e9ddbb..73dfdcd 100755
--- a/utils/sb2-init
+++ b/utils/sb2-init
@@ -104,7 +104,7 @@ export SBOX_DEFAULT_GCC_PREFIX=$GCC_PREFIX
export SBOX_CROSS_GCC_NAME=cross-gcc
export SBOX_CROSS_GCC_PREFIX_LIST=$GCC_TARGET-:$ARCH-linux-:$GCC_PREFIX
export SBOX_CROSS_GCC_SUBST_PREFIX=$GCC_PREFIX
-export SBOX_CROSS_GCC_SPECS_FILE=
+export SBOX_CROSS_GCC_SPECS_FILE="$SBOX_CROSS_GCC_SPECS_FILE"
export SBOX_CROSS_GCC_DIR=$GCC_PATH
export SBOX_CROSS_GCC_LD_ARGS=
export SBOX_EXTRA_CROSS_COMPILER_ARGS="$SBOX_EXTRA_CROSS_COMPILER_ARGS"
@@ -363,7 +363,16 @@ if [ -n "$TOOLS_ROOT" ]; then
fi
fi
-SBOX_EXTRA_CROSS_COMPILER_STDINC="-I/usr/include"
+# Use "specs" file for gcc if it exists, otherwise add -I/usr/include to params
+SBOX_CROSS_GCC_SPECS_FILE=""
+SBOX_EXTRA_CROSS_COMPILER_STDINC=""
+if [ -f $SBOX_DIR/share/scratchbox2/modeconf/gcc-specs.$MAPPING_MODE ]
+then
+ SBOX_CROSS_GCC_SPECS_FILE="$SBOX_DIR/share/scratchbox2/modeconf/gcc-specs.$MAPPING_MODE"
+else
+ SBOX_EXTRA_CROSS_COMPILER_STDINC="-I/usr/include"
+fi
+
SBOX_EXTRA_CROSS_COMPILER_ARGS="$SBOX_EXTRA_CROSS_COMPILER_ARGS -L$SBOX_TARGET_ROOT/usr/lib -L$SBOX_TARGET_ROOT/lib"
# test if the cross compiler needs to be silenced about /usr/include