From 8286ac511144e4f17d34eac9affb97e50646344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:25:44 +0200 Subject: Imported Upstream version 4.0.0 --- build-0.3/cxx/gnu/configure | 55 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'build-0.3/cxx/gnu/configure') diff --git a/build-0.3/cxx/gnu/configure b/build-0.3/cxx/gnu/configure index b9c6ef6..c551713 100755 --- a/build-0.3/cxx/gnu/configure +++ b/build-0.3/cxx/gnu/configure @@ -1,12 +1,13 @@ #! /usr/bin/env bash # file : build/cxx/gnu/configure -# author : Boris Kolpackov -# copyright : Copyright (c) 2004-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file # $2 optimize (y/n) +# $3 cxx_extra_options +# $4 cxx_ld_extra_options # # bld_root - build root # project_name - project name @@ -27,8 +28,44 @@ $echo "'/usr/local/bin/g++' or 'distcc g++'." $echo cxx_gnu=`read_path --command g++` -cxx_gnu_libraries=`$cxx_gnu -print-search-dirs | sed -e 's/libraries: =//p' -e d` +# Determine the C++ standard. +# +cxx_gnu_standard=`echo "$3" | sed -e 's/.*-std=\([^ ]*\).*/\1/' -e t -e d` + +if [ -z "$cxx_gnu_standard" ]; then + cxx_gnu_standard="gnu++98" +elif [ "$cxx_gnu_standard" = "c++0x" ]; then + cxx_gnu_standard="c++11" +elif [ "$cxx_gnu_standard" = "gnu++0x" ]; then + cxx_gnu_standard="gnu++11" +fi + +# Pass cxx_extra_options and cxx_ld_extra_options since those +# 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= @@ -50,6 +87,12 @@ 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_standard := $cxx_gnu_standard" >> $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 -- cgit v1.2.3