diff options
Diffstat (limited to 'build-0.3/cxx/gnu')
-rw-r--r-- | build-0.3/cxx/gnu/configuration-rules.make | 8 | ||||
-rw-r--r-- | build-0.3/cxx/gnu/configuration-static.make | 3 | ||||
-rw-r--r-- | build-0.3/cxx/gnu/configuration.make | 3 | ||||
-rwxr-xr-x | build-0.3/cxx/gnu/configure | 55 | ||||
-rw-r--r-- | build-0.3/cxx/gnu/cxx-d.make | 3 | ||||
-rw-r--r-- | build-0.3/cxx/gnu/cxx-o.make | 3 | ||||
-rw-r--r-- | build-0.3/cxx/gnu/o-e.make | 3 | ||||
-rw-r--r-- | build-0.3/cxx/gnu/o-l.make | 25 |
8 files changed, 81 insertions, 22 deletions
diff --git a/build-0.3/cxx/gnu/configuration-rules.make b/build-0.3/cxx/gnu/configuration-rules.make index 7598be9..6d79582 100644 --- a/build-0.3/cxx/gnu/configuration-rules.make +++ b/build-0.3/cxx/gnu/configuration-rules.make @@ -1,14 +1,14 @@ # file : build/cxx/gnu/configuration-rules.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 $(dcf_root)/cxx/gnu/configuration-dynamic.make: | $(dcf_root)/cxx/gnu/. - $(call message,,$(bld_root)/cxx/gnu/configure $@ $(cxx_optimize)) + $(call message,,$(bld_root)/cxx/gnu/configure $@ $(cxx_optimize) \ +"$(cxx_extra_options)" "$(cxx_ld_extra_options)") ifndef %foreign% -disfigure:: +$(dcf_root)/.disfigure:: $(call message,rm $(dcf_root)/cxx/gnu/configuration-dynamic.make,\ rm -f $(dcf_root)/cxx/gnu/configuration-dynamic.make) diff --git a/build-0.3/cxx/gnu/configuration-static.make b/build-0.3/cxx/gnu/configuration-static.make index 9a2521a..d0aee7d 100644 --- a/build-0.3/cxx/gnu/configuration-static.make +++ b/build-0.3/cxx/gnu/configuration-static.make @@ -1,4 +1,3 @@ # file : build/cxx/gnu/configuration-static.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 diff --git a/build-0.3/cxx/gnu/configuration.make b/build-0.3/cxx/gnu/configuration.make index 57e00e9..2e55f8b 100644 --- a/build-0.3/cxx/gnu/configuration.make +++ b/build-0.3/cxx/gnu/configuration.make @@ -1,6 +1,5 @@ # file : build/cxx/gnu/configuration.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 $(call include-once,$(bld_root)/cxx/gnu/configuration-rules.make,$(dcf_root)) 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 <boris@codesynthesis.com> -# 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 diff --git a/build-0.3/cxx/gnu/cxx-d.make b/build-0.3/cxx/gnu/cxx-d.make index 642a846..6611e67 100644 --- a/build-0.3/cxx/gnu/cxx-d.make +++ b/build-0.3/cxx/gnu/cxx-d.make @@ -1,6 +1,5 @@ # file : build/cxx/gnu/cxx-o.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 $(call include-once,$(bld_root)/c/cpp-options.make,$(out_base)) diff --git a/build-0.3/cxx/gnu/cxx-o.make b/build-0.3/cxx/gnu/cxx-o.make index 0320177..0b751ad 100644 --- a/build-0.3/cxx/gnu/cxx-o.make +++ b/build-0.3/cxx/gnu/cxx-o.make @@ -1,6 +1,5 @@ # file : build/cxx/gnu/cxx-o.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 $(call include-once,$(bld_root)/c/cpp-options.make,$(out_base)) diff --git a/build-0.3/cxx/gnu/o-e.make b/build-0.3/cxx/gnu/o-e.make index 8c233bd..c19e177 100644 --- a/build-0.3/cxx/gnu/o-e.make +++ b/build-0.3/cxx/gnu/o-e.make @@ -1,6 +1,5 @@ # file : build/cxx/gnu/o-e.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 $(call include,$(bld_root)/cxx/gnu/configuration.make) diff --git a/build-0.3/cxx/gnu/o-l.make b/build-0.3/cxx/gnu/o-l.make index e378a4d..ea3e1d1 100644 --- a/build-0.3/cxx/gnu/o-l.make +++ b/build-0.3/cxx/gnu/o-l.make @@ -1,6 +1,5 @@ # file : build/cxx/gnu/o-l.make -# author : Boris Kolpackov <boris@codesynthesis.com> -# 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 $(call include,$(bld_root)/cxx/gnu/configuration.make) @@ -42,10 +41,14 @@ $(out_base)/%.l.o.clean: else +mingw := $(if $(filter $(cxx_gnu_target_os),mingw32 mingw64),y,n) + $(out_base)/%.l: ld := $(cxx_gnu) $(out_base)/%.l: ld_options := $(cxx_gnu_optimization_options) $(cxx_gnu_debugging_options) +ifeq ($(mingw),n) $(out_base)/%.l: c_pic_options := -fPIC $(out_base)/%.l: cxx_pic_options := -fPIC +endif $(out_base)/%.l: comma_ := , $(out_base)/%.l: expand-l = $(if $(subst n,,$(cxx_rpath)),\ @@ -57,6 +60,9 @@ $(out_base)/%.l: else $(out_base)/%.l: | $$(dir $$@). endif +ifeq ($(mingw),n) +# Standard version. +# $(call message,ld $@,$(ld) -shared \ $(cxx_extra_options) $(ld_options) $(cxx_ld_extra_options) \ -o $(@D)/lib$(basename $(@F)).so -Wl$(comma_)-soname=lib$(basename $(@F)).so \ @@ -64,9 +70,24 @@ $(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_extra_lib $(call message,,echo "$(@D)/lib$(basename $(@F)).so" >$@) $(call message,,echo "rpath:$(@D)" >>$@) $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) +else +# MinGW version. +# + $(call message,ld $@,$(ld) -shared \ +$(cxx_extra_options) $(ld_options) $(cxx_ld_extra_options) \ +-o $(@D)/$(basename $(@F)).dll -Wl$(comma_)--out-implib$(comma_)$(@D)/lib$(basename $(@F)).a \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_extra_libs)) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "rpath:$(@D)" >>$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.l,$^))" | xargs -n 1 echo >>$@) +endif $(out_base)/%.l.o.clean: +ifeq ($(mingw),n) $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.so,$(@F)),$(basename $(basename $@))) +else + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,%.dll,$(@F)) $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) +endif endif endif |