diff options
Diffstat (limited to 'build-0.3/c/gnu')
| -rw-r--r-- | build-0.3/c/gnu/c-d.make | 3 | ||||
| -rw-r--r-- | build-0.3/c/gnu/c-o.make | 3 | ||||
| -rw-r--r-- | build-0.3/c/gnu/configuration-rules.make | 8 | ||||
| -rw-r--r-- | build-0.3/c/gnu/configuration-static.make | 3 | ||||
| -rw-r--r-- | build-0.3/c/gnu/configuration.make | 3 | ||||
| -rwxr-xr-x | build-0.3/c/gnu/configure | 40 | ||||
| -rwxr-xr-x | build-0.3/c/gnu/dep | 3 | ||||
| -rw-r--r-- | build-0.3/c/gnu/o-e.make | 3 | ||||
| -rw-r--r-- | build-0.3/c/gnu/o-l.make | 25 | 
9 files changed, 68 insertions, 23 deletions
| diff --git a/build-0.3/c/gnu/c-d.make b/build-0.3/c/gnu/c-d.make index d7e6c57..bc7411f 100644 --- a/build-0.3/c/gnu/c-d.make +++ b/build-0.3/c/gnu/c-d.make @@ -1,6 +1,5 @@  # file      : build/c/gnu/c-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/c/gnu/c-o.make b/build-0.3/c/gnu/c-o.make index 9f5ecdd..46eb1da 100644 --- a/build-0.3/c/gnu/c-o.make +++ b/build-0.3/c/gnu/c-o.make @@ -1,6 +1,5 @@  # file      : build/c/gnu/c-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/c/gnu/configuration-rules.make b/build-0.3/c/gnu/configuration-rules.make index 478db2d..cb25dfe 100644 --- a/build-0.3/c/gnu/configuration-rules.make +++ b/build-0.3/c/gnu/configuration-rules.make @@ -1,14 +1,14 @@  # file      : build/c/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)/c/gnu/configuration-dynamic.make: | $(dcf_root)/c/gnu/. -	$(call message,,$(bld_root)/c/gnu/configure $@ $(c_optimize)) +	$(call message,,$(bld_root)/c/gnu/configure $@ $(c_optimize) \ +"$(c_extra_options)" "$(c_ld_extra_options)")  ifndef %foreign% -disfigure:: +$(dcf_root)/.disfigure::  	$(call message,rm $(dcf_root)/c/gnu/configuration-dynamic.make,\  rm -f $(dcf_root)/c/gnu/configuration-dynamic.make) diff --git a/build-0.3/c/gnu/configuration-static.make b/build-0.3/c/gnu/configuration-static.make index eb00863..e9be2b9 100644 --- a/build-0.3/c/gnu/configuration-static.make +++ b/build-0.3/c/gnu/configuration-static.make @@ -1,4 +1,3 @@  # file      : build/c/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/c/gnu/configuration.make b/build-0.3/c/gnu/configuration.make index c2e4a32..32aaf97 100644 --- a/build-0.3/c/gnu/configuration.make +++ b/build-0.3/c/gnu/configuration.make @@ -1,6 +1,5 @@  # file      : build/c/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)/c/gnu/configuration-rules.make,$(dcf_root)) diff --git a/build-0.3/c/gnu/configure b/build-0.3/c/gnu/configure index 5695ba4..713f091 100755 --- a/build-0.3/c/gnu/configure +++ b/build-0.3/c/gnu/configure @@ -1,12 +1,13 @@  #! /usr/bin/env bash  # file      : build/c/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  c_extra_options +# $4  c_ld_extra_options  #  # bld_root     - build root  # project_name - project name @@ -27,8 +28,32 @@ $echo "'/usr/local/bin/gcc' or 'distcc gcc'."  $echo  c_gnu=`read_path --command gcc` -c_gnu_libraries=`$c_gnu -print-search-dirs | sed -e 's/libraries: =//p' -e d` +# Pass c_extra_options and c_ld_extra_options since those can affect the +# search paths (e.g., -m32) and target. +# +c_gnu_libraries=`$c_gnu $3 $4 -print-search-dirs | sed -e 's/libraries: =//p' -e d` + +c_gnu_target=`$c_gnu $3 $4 -dumpmachine` +c_gnu_target=`$bld_root/system/config.sub "$c_gnu_target"` + +if [ $? != 0 ]; then +  $echo "unable to canonicalize target system '$c_gnu_target'" +  exit 1 +fi + +c_gnu_target_cpu=`echo $c_gnu_target | cut -f 1 -d -` +c_gnu_target_mf=`echo $c_gnu_target | cut -f 2 -d -` +c_gnu_target_kernel=`echo $c_gnu_target | cut -f 3 -d -` +c_gnu_target_os=`echo $c_gnu_target | cut -f 4 -d -` + +if [ -z "$c_gnu_target_os" ]; then + +  # Old format: cpu-mf-os +  # +  c_gnu_target_os=$c_gnu_target_kernel +  c_gnu_target_kernel= +fi  optimization= @@ -50,6 +75,11 @@ if [ "$2" == "y" ]; then  fi -echo "c_gnu := $c_gnu"                            > $1 -echo "c_gnu_libraries := $c_gnu_libraries"       >> $1 +echo "c_gnu := $c_gnu"                              > $1 +echo "c_gnu_libraries := $c_gnu_libraries"         >> $1  echo "c_gnu_optimization_options := $optimization" >> $1 +echo "c_gnu_target := $c_gnu_target"               >> $1 +echo "c_gnu_target_cpu := $c_gnu_target_cpu"       >> $1 +echo "c_gnu_target_mf := $c_gnu_target_mf"         >> $1 +echo "c_gnu_target_kernel := $c_gnu_target_kernel" >> $1 +echo "c_gnu_target_os := $c_gnu_target_os"         >> $1 diff --git a/build-0.3/c/gnu/dep b/build-0.3/c/gnu/dep index 1286ce2..ecafcb1 100755 --- a/build-0.3/c/gnu/dep +++ b/build-0.3/c/gnu/dep @@ -1,8 +1,7 @@  #! /usr/bin/env bash  # file      : build/c/gnu/dep -# 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  # Post-process generated dependency information. diff --git a/build-0.3/c/gnu/o-e.make b/build-0.3/c/gnu/o-e.make index a1da582..a54a9f3 100644 --- a/build-0.3/c/gnu/o-e.make +++ b/build-0.3/c/gnu/o-e.make @@ -1,6 +1,5 @@  # file      : build/c/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)/c/gnu/configuration.make) diff --git a/build-0.3/c/gnu/o-l.make b/build-0.3/c/gnu/o-l.make index 5e66650..5c93f0a 100644 --- a/build-0.3/c/gnu/o-l.make +++ b/build-0.3/c/gnu/o-l.make @@ -1,6 +1,5 @@  # file      : build/c/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)/c/gnu/configuration.make) @@ -42,9 +41,13 @@ $(out_base)/%.l.o.clean:  else +mingw := $(if $(filter $(c_gnu_target_os),mingw32 mingw64),y,n) +  $(out_base)/%.l: ld := $(c_gnu)  $(out_base)/%.l: ld_options := $(c_gnu_optimization_options) $(c_gnu_debugging_options) +ifeq ($(mingw),n)  $(out_base)/%.l: c_pic_options := -fPIC +endif  $(out_base)/%.l: comma_ := ,  $(out_base)/%.l: expand-l = $(if $(subst n,,$(c_rpath)),\ @@ -56,6 +59,9 @@ $(out_base)/%.l:  else  $(out_base)/%.l: | $$(dir $$@).  endif +ifeq ($(mingw),n) +# Standard version. +#  	$(call message,ld  $@,$(ld) -shared \  $(c_extra_options) $(ld_options) $(c_ld_extra_options) \  -o $(@D)/lib$(basename $(@F)).so -Wl$(comma_)-soname=lib$(basename $(@F)).so \ @@ -63,9 +69,24 @@ $(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(c_extra_libs)  	$(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 \ +$(c_extra_options) $(ld_options) $(c_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))) $(c_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 | 
