aboutsummaryrefslogtreecommitdiff
path: root/build/cxx/gnu/configure
diff options
context:
space:
mode:
Diffstat (limited to 'build/cxx/gnu/configure')
-rwxr-xr-xbuild/cxx/gnu/configure33
1 files changed, 29 insertions, 4 deletions
diff --git a/build/cxx/gnu/configure b/build/cxx/gnu/configure
index bda4bdb..7e5820e 100755
--- a/build/cxx/gnu/configure
+++ b/build/cxx/gnu/configure
@@ -31,10 +31,30 @@ $echo
cxx_gnu=`read_path --command g++`
# Pass cxx_extra_options and cxx_ld_extra_options since those
-# can affect the search paths (e.g., -m32).
+# can affect the search paths (e.g., -m32) and target.
#
cxx_gnu_libraries=`$cxx_gnu $3 $4 -print-search-dirs | sed -e 's/libraries: =//p' -e d`
+cxx_gnu_target=`$cxx_gnu $3 $4 -dumpmachine`
+cxx_gnu_target=`$bld_root/system/config.sub "$cxx_gnu_target"`
+
+if [ $? != 0 ]; then
+ $echo "unable to canonicalize target system '$cxx_gnu_target'"
+ exit 1
+fi
+
+cxx_gnu_target_cpu=`echo $cxx_gnu_target | cut -f 1 -d -`
+cxx_gnu_target_mf=`echo $cxx_gnu_target | cut -f 2 -d -`
+cxx_gnu_target_kernel=`echo $cxx_gnu_target | cut -f 3 -d -`
+cxx_gnu_target_os=`echo $cxx_gnu_target | cut -f 4 -d -`
+
+if [ -z "$cxx_gnu_target_os" ]; then
+
+ # Old format: cpu-mf-os
+ #
+ cxx_gnu_target_os=$cxx_gnu_target_kernel
+ cxx_gnu_target_kernel=
+fi
optimization=
@@ -56,6 +76,11 @@ if [ "$2" == "y" ]; then
fi
-echo "cxx_gnu := $cxx_gnu" > $1
-echo "cxx_gnu_libraries := $cxx_gnu_libraries" >> $1
-echo "cxx_gnu_optimization_options := $optimization" >> $1
+echo "cxx_gnu := $cxx_gnu" > $1
+echo "cxx_gnu_libraries := $cxx_gnu_libraries" >> $1
+echo "cxx_gnu_optimization_options := $optimization" >> $1
+echo "cxx_gnu_target := $cxx_gnu_target" >> $1
+echo "cxx_gnu_target_cpu := $cxx_gnu_target_cpu" >> $1
+echo "cxx_gnu_target_mf := $cxx_gnu_target_mf" >> $1
+echo "cxx_gnu_target_kernel := $cxx_gnu_target_kernel" >> $1
+echo "cxx_gnu_target_os := $cxx_gnu_target_os" >> $1