diff options
Diffstat (limited to 'build-0.3')
143 files changed, 9537 insertions, 0 deletions
diff --git a/build-0.3/abspath.make b/build-0.3/abspath.make new file mode 100644 index 0000000..e1ef881 --- /dev/null +++ b/build-0.3/abspath.make @@ -0,0 +1,18 @@ +# file : build/abspath.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +.PHONY: FORCE + +%:: FORCE + @echo $(abspath $@) + +$(MAKEFILE_LIST):: ;@: + +# Remove all default rules. +# +.SUFFIXES: + +ifeq ($(filter -r,$(MAKEFLAGS)),) +MAKEFLAGS += -r +endif diff --git a/build-0.3/bootstrap.make b/build-0.3/bootstrap.make new file mode 100644 index 0000000..44eb57e --- /dev/null +++ b/build-0.3/bootstrap.make @@ -0,0 +1,385 @@ +# file : build/bootstrap.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# First time bootstrap.make is read +# +ifndef %makefile% + +# Configure make. +# + +# Forces make to delete targets whos rebuild commands failed but +# updated the target. +# +.DELETE_ON_ERROR: + +# Remove all built-in rules. +# +.SUFFIXES: + +ifeq ($(filter -r,$(MAKEFLAGS)),) +MAKEFLAGS += -r +endif + + +# Disable implicit phony misfeature. +# +#ifeq ($(filter --no-implicit-phony,$(MAKEFLAGS)),) +#MAKEFLAGS += --no-implicit-phony +#endif + +# Enable second expansion. +# +.SECONDEXPANSION: + +# Force target. Used to force rule executions. +# +.PHONY: FORCE + + +# Export variables that could be useful for configuration scripts. +# +export bld_root +export MAKE + +%replica% := +%foreign% := +%interactive% := t + +# List of realpath'ed include-once files. +# +%included_files% := + +#$(warning init %included_files%: $(%included_files%)) + +# @@ maybe I should set makefile to bootstrap and restore it at the end. +# This way I will be able to use %makefile% below (instead of _self) and +# also it will be consistent. +# + +# By convention, the makefile name is the second or third last word from +# the end. If it is the third, then the second one should be end with +# bootstrap.make +# +%makefile% := $(subst $(lastword $(MAKEFILE_LIST)),,$(MAKEFILE_LIST)) +ifneq ($(filter %bootstrap.make,$(lastword $(%makefile%))),) +%makefile% := $(subst $(lastword $(%makefile%)),,$(%makefile%)) +endif +%makefile% := $(abspath $(lastword $(%makefile%))) + +%makefile_realpath% := $(realpath $(%makefile%)) + + +# +# include facility +# + +# Execute makefile search algorithm. Return abspath of the makefile if found +# and empty string otherwise. +# +%frame_exclude% += include-find-makefile +define include-find-makefile +$(if $(wildcard $1),\ +$(abspath $1),\ +$(if $(filter-out /%,$1),\ +$(call include-search-dirs,$1,$(.INCLUDE_DIRS)))) +endef + +# Search for $1 in the list of directoris $2 +# +%frame_exclude% += include-search-dirs +define include-search-dirs +$(if $(strip $2),\ +$(if $(wildcard $(firstword $2)/$1),\ +$(abspath $(firstword $2)/$1),\ +$(call include-search-dirs,$1,$(wordlist 2,$(words $2),$2)))) +endef + +# Test if $1 is a 'foreign' makefile, i.e., does not reside in +# src_root, out_root, or bld_root. Use shadows for src and out +# roots to catch cases where these were reset before inclusion. +# This happens in import stubs. +# +%frame_exclude% += include-test-foreign +define include-test-foreign +$(if $(%foreign%),t,$(if $(filter $(bld_root)/% $(src_root_shadow)/% $(out_root_shadow)/%,$1),,t)) +endef + +%frame_exclude% += include-body +define include-body +%interactive% := +%makefile% := $(call include-find-makefile,$2) +%makefile_realpath% := $$(realpath $$(%makefile%)) +%foreign% := $$(call include-test-foreign,$$(%makefile%)) + +$1 $$(if $$(%makefile%),$$(%makefile%),$2) + +%makefile_realpath% := $3 +%makefile% := $4 +%interactive% := $5 +%foreign% := $6 +endef + +%frame_exclude% += include +define include +$(eval $(foreach f,$1,\ + $(call include-body,\ + include,$f,$(%makefile_realpath%),$(%makefile%),$(%interactive%),$(%foreign%)))) +endef + +%frame_exclude% += -include +define -include +$(eval $(foreach f,$1,\ + $(call include-body,\ + -include,$f,$(%makefile_realpath%),$(%makefile%),$(%interactive%),$(%foreign%)))) +endef + + +# +# include-once +# + +# This one simply delegates to the include directive to get the +# error message. +# +# $1 : include/-include +# $2 : file +# +%frame_exclude% += include-once-failed-body +define include-once-failed-body +$1 $2 +endef + +# +# $1 : include/-include +# $2 : file +# +%frame_exclude% += include-once-file-body +define include-once-file-body +%interactive% := +%makefile% := $2 +%makefile_realpath% := $(realpath $2) +%foreign% := $$(call include-test-foreign,$$(%makefile%)) + +%included_files% += $$(%makefile_realpath%) + +$1 $2 + +%makefile_realpath% := $3 +%makefile% := $4 +%interactive% := $5 +%foreign% := $6 +endef + + +%frame_exclude% += include-once-file-filter +define include-once-file-filter +$(if $(filter $(realpath $2),$(%included_files%)),,\ + $(call include-once-file-body,\ + $1,$2,$(%makefile_realpath%),$(%makefile%),$(%interactive%),$(%foreign%))) +endef + +# +# $1 : include/-include +# $2 : file +# $6 : value +# + +%frame_exclude% += include-once-value-body +define include-once-value-body +%interactive% := +%makefile% := $2 +%makefile_realpath% := $(realpath $2) +%foreign% := $$(call include-test-foreign,$$(%makefile%)) + +%include_once_$$(%makefile_realpath%)% += $7 + +$1 $2 + +%makefile_realpath% := $3 +%makefile% := $4 +%interactive% := $5 +%foreign% := $6 +endef + + +%frame_exclude% += include-once-value-filter +define include-once-value-filter +$(if $(filter $3,$(value %include_once_$(realpath $2)%)),,\ + $(call include-once-value-body,\ + $1,$2,$(%makefile_realpath%),$(%makefile%),$(%interactive%),$(%foreign%),$3)) +endef + + +# $1 - include/-include +# $2 - abspath or empty if not found +# $3 - orginal path +# $4 - value [optional] +# +%frame_exclude% += include-once-filter +define include-once-filter +$(if $2,\ +$(if $4,\ +$(call include-once-value-filter,$1,$2,$4),\ +$(call include-once-file-filter,$1,$2)),\ +$(call include-once-failed-body,$1,$3)) +endef + +%frame_exclude% += include-once +define include-once +$(eval $(call include-once-filter,\ +include,$(call include-find-makefile,$1),$1,$(strip $2))) +endef + +%frame_exclude% += -include-once +define -include-once +$(eval $(call include-once-filter,\ +-include,$(call include-find-makefile,$1),$1,$(strip $2))) +endef + + +#$(warning include facility is up) + +endif # %makefile% + +# +# +bld_root := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) + + +# initialize {src,out}_{root,base} +# +%frame_exclude% += find-bootstrap-base +define find-bootstrap-base +$(if $(findstring $(abspath $(lastword $1)),$(%makefile%)),$2,\ +$(call find-bootstrap-base,\ +$(wordlist 1,$(words $(wordlist 2,$(words $1),$1)),$1),\ +$(lastword $1))) +endef + +src_root := $(abspath $(dir $(call find-bootstrap-base,$(MAKEFILE_LIST)))..) +src_base := $(abspath $(dir $(%makefile%))) + +ifneq ($(src_root),$(src_base)) + +# In recursive make invocation, out_root may come from the environment +# in which case we need to override it. +# +ifneq ($(origin out_root),file) + out_root := $(abspath $(patsubst \ + %$(subst $(src_root)/,,$(src_base)),%,$(CURDIR))) +endif + +out_base := $(out_root)/$(subst $(src_root)/,,$(src_base)) + +else + +# In recursive make invocation, out_root may come from the environment +# in which case we need to override it. +# +ifneq ($(origin out_root),file) + out_root := $(abspath $(CURDIR)) +endif + +out_base := $(out_root) + +endif + +scf_root := $(src_root)/build +dcf_root := $(out_root)/build + +src_root_shadow := $(src_root) +out_root_shadow := $(out_root) + +$(out_root)/%: export out_root := $(out_root) +$(out_root)/%: export src_root := $(src_root) +$(out_root)/%: export scf_root := $(scf_root) +$(out_root)/%: export dcf_root := $(dcf_root) +$(out_root)/%: export project_name := $(project_name) + +# @@ Why do I need out_root here? +# +$(out_base)/%: out_root := $(out_root) +$(out_base)/%: export out_base := $(out_base) +$(out_base)/%: export src_base := $(src_base) + +ifdef build_debug + +$(warning "bld root: $(bld_root)") +$(warning "scf root: $(scf_root)") +$(warning "dcf root: $(dcf_root)") +$(warning "src root: $(src_root)") +$(warning "src base: $(src_base)") +$(warning "out root: $(out_root)") +$(warning "out base: $(out_base)") + +endif + +#$(warning paths are set) + +# frame facility +# +$(call include-once,$(bld_root)/frame.make) + +# import facility +# +$(call include-once,$(bld_root)/import.make) + +# Load some common facilities. +# +$(call include-once,$(bld_root)/literals.make) +$(call include-once,$(bld_root)/message.make) +$(call include-once,$(bld_root)/dir.make) + + +# Static configuration. +# +$(call include,$(bld_root)/configuration-static.make) + +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/configuration-static.make) +endif + +# `disfigure' target. +# +.PHONY: disfigure +.PHONY: $(dcf_root)/.disfigure $(out_root)/.disfigure + +disfigure:: $(build_absolute_clean_target) +disfigure:: $(dcf_root)/.disfigure +disfigure:: $(out_root)/.disfigure + +ifneq ($(out_root),$(out_base)) +.PHONY: $(out_base)/.disfigure +$(out_root)/.disfigure:: $(out_base)/.disfigure +endif + +# Clean up generated makefiles. +# +ifndef %foreign% +ifneq ($(out_root),$(src_root)) +$(out_base)/.disfigure:: + $(call message, rm $$1,rm -f $$1,$(out_base)/makefile) +endif +endif + +# Dynamic configuration (interactive check is to make sure we only do +# this once). +# +ifdef %interactive% +ifneq ($(out_root),$(src_root)) + +$(call -include,$(dcf_root)/bootstrap-dynamic.make) + +$(dcf_root)/bootstrap-dynamic.make: | $(dcf_root)/. + $(call message,,echo "src_root := $(src_root)" >$@) + +$(dcf_root)/.disfigure:: + $(call message, rm $$1,rm -f $$1,$(dcf_root)/bootstrap-dynamic.make) +endif +endif + +ifeq ($(.DEFAULT_GOAL),disfigure) +.DEFAULT_GOAL := +endif diff --git a/build-0.3/c/c-d.make b/build-0.3/c/c-d.make new file mode 100644 index 0000000..fdba684 --- /dev/null +++ b/build-0.3/c/c-d.make @@ -0,0 +1,9 @@ +# file : build/c/c-d.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/configuration.make) + +ifdef c_id +$(call include-once,$(bld_root)/c/$(c_id)/c-d.make,$(out_base)) +endif diff --git a/build-0.3/c/c-o.make b/build-0.3/c/c-o.make new file mode 100644 index 0000000..d389fdd --- /dev/null +++ b/build-0.3/c/c-o.make @@ -0,0 +1,10 @@ +# file : build/c/c-o.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/configuration.make) + + +ifdef c_id +$(call include-once,$(bld_root)/c/$(c_id)/c-o.make,$(out_base)) +endif diff --git a/build-0.3/c/configuration-rules.make b/build-0.3/c/configuration-rules.make new file mode 100644 index 0000000..5663065 --- /dev/null +++ b/build-0.3/c/configuration-rules.make @@ -0,0 +1,18 @@ +# file : build/c/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/c/configuration-dynamic.make: | $(dcf_root)/c/. + $(call message,,$(bld_root)/c/configure $@ \ +"$(origin c_pp_options)" \ +"$(origin c_options)" \ +"$(origin c_ld_options)" \ +"$(origin c_libs)") + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/c/configuration-dynamic.make,\ +rm -f $(dcf_root)/c/configuration-dynamic.make) + +endif diff --git a/build-0.3/c/configuration-static.make b/build-0.3/c/configuration-static.make new file mode 100644 index 0000000..c226a36 --- /dev/null +++ b/build-0.3/c/configuration-static.make @@ -0,0 +1,12 @@ +# file : build/c/configuration-static.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +c_h_suffix := h +c_s_suffix := c + +# Get user-supplied static configuration if any. +# +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/c/configuration-static.make) +endif diff --git a/build-0.3/c/configuration.make b/build-0.3/c/configuration.make new file mode 100644 index 0000000..e47731c --- /dev/null +++ b/build-0.3/c/configuration.make @@ -0,0 +1,43 @@ +# file : build/c/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/c/configuration-rules.make,$(dcf_root)) + +# Static configuration. +# +$(call include,$(bld_root)/c/configuration-static.make) + +# Dynamic configuration. +# +c_id := +c_optimize := +c_debug := +c_rpath := + +c_pp_extra_options := +c_extra_options := +c_ld_extra_options := +c_extra_libs := +c_extra_lib_paths := + +$(call -include,$(dcf_root)/c/configuration-dynamic.make) + +ifdef c_id + +$(out_root)/%: c_id := $(c_id) +$(out_root)/%: c_optimize := $(c_optimize) +$(out_root)/%: c_debug := $(c_debug) +$(out_root)/%: c_rpath := $(c_rpath) + +$(out_root)/%: c_pp_extra_options := $(c_pp_extra_options) $(c_pp_cmd_options) +$(out_root)/%: c_extra_options := $(c_extra_options) $(c_cmd_options) +$(out_root)/%: c_ld_extra_options := $(c_ld_extra_options) $(c_ld_cmd_options) +$(out_root)/%: c_extra_libs := $(c_extra_libs) $(c_cmd_libs) +$(out_root)/%: c_extra_lib_paths := $(c_extra_lib_paths) $(c_cmd_lib_paths) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/c/configure b/build-0.3/c/configure new file mode 100755 index 0000000..a294a0c --- /dev/null +++ b/build-0.3/c/configure @@ -0,0 +1,165 @@ +#! /usr/bin/env bash + +# file : build/c/configure +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# $2 origin of the c_pp_options make variable +# $3 origin of the c_options make variable +# $4 origin of the c_ld_options make variable +# $5 origin of the c_libs make variable +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please select the C compiler you would like to use:" +$echo +$echo "(1) GNU C (gcc)" +$echo "(2) Intel C (icc)" +$echo "(3) Other C compiler" +$echo + +id=`read_option "gnu intel generic" "gnu"` + +if [ "$id" != "generic" ]; then + + $echo + $echo "Would you like the C compiler to optimize generated code?" + $echo + + optimize=`read_y_n y` + + + $echo + $echo "Would you like the C compiler to generate debug information?" + $echo + + debug=`read_y_n y` + + $echo + $echo "Embed dynamic library paths into executables (rpath)?" + $echo + + rpath=`read_y_n y` + +fi + +# pp_options +# +if [ "$2" != "undefined" ]; then + + pp_options=$c_pp_options + + if [ "$pp_options" ]; then + $echo + $echo "Extra C preprocessor options: $pp_options" + $echo + fi +else + + $echo + $echo "Please enter any extra C preprocessor options." + $echo + + read -e -p "[]: " pp_options +fi + + +# options +# +if [ "$3" != "undefined" ]; then + + options=$c_options + + if [ "$options" ]; then + $echo + $echo "Extra C compiler options: $options" + $echo + fi +else + + $echo + $echo "Please enter any extra C compiler options." + $echo + + read -p "[]: " options +fi + + +# ld_options +# +if [ "$4" != "undefined" ]; then + + ld_options=$c_ld_options + + if [ "$ld_options" ]; then + $echo + $echo "Extra C linker options: $ld_options" + $echo + fi +else + + $echo + $echo "Please enter any extra C linker options." + $echo + + read -e -p "[]: " ld_options +fi + + +# libs +# +if [ "$5" != "undefined" ]; then + + libs=$c_libs + + if [ "$libs" ]; then + $echo + $echo "Extra C libraries: $libs" + $echo + fi +else + + $echo + $echo "Please enter any extra C libraries." + $echo + + read -e -p "[]: " libs +fi + + +# Extract -L paths from the ld options. +# +paths= + +if [ "$ld_options" ]; then + paths=`echo "$ld_options" | sed -e 's/-L *\([^ ]*\)/\\ +-L\1\\ +/g' | sed -e 's/^-L\([^ ]*\)$/\1/' -e t -e d` + paths=`echo $paths | sed -e 's/ /:/g'` +fi + +echo "c_id := $id" >$1 + +if [ "$id" != "generic" ]; then + echo "c_optimize := $optimize" >>$1 + echo "c_debug := $debug" >>$1 + echo "c_rpath := $rpath" >>$1 +fi + +echo "c_pp_extra_options := $pp_options" >>$1 +echo "c_extra_options := $options" >>$1 +echo "c_ld_extra_options := $ld_options" >>$1 +echo "c_extra_libs := $libs" >>$1 +echo "c_extra_lib_paths := $paths" >>$1 diff --git a/build-0.3/c/cpp-options.make b/build-0.3/c/cpp-options.make new file mode 100644 index 0000000..d6246a3 --- /dev/null +++ b/build-0.3/c/cpp-options.make @@ -0,0 +1,35 @@ +# file : build/c/cpp-options.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(out_base)/%.cpp-options: c-cpp-options-expand-impl = $(if $1,cat $1 >>$2) +$(out_base)/%.cpp-options: c-cpp-options-expand = \ +$(call c-cpp-options-expand-impl,$(filter %.cpp-options,$1),$2) + + +#@@ Asymmetry: I hide creation commands but show removals. +# +$(out_base)/%.cpp-options: c-cpp-options-force-impl = \ +$(if $(subst $1,,$2)$(subst $2,,$1),FORCE) + +$(out_base)/%.cpp-options: c-cpp-options-force = \ +$(call c-cpp-options-force-impl,$(shell if test -f $1; then exec head -n 1 $1; fi),include: $2) + + +# @@ Need to incroporate prefix: into force-check. Then it will probably +# have to be non-optional. +# + +ifeq ($(src_base),$(out_base)) +$(out_base)/%.cpp-options: $$(call c-cpp-options-force,$$@,$$(value)) +else +$(out_base)/%.cpp-options: $$(call c-cpp-options-force,$$@,$$(value)) | $$(dir $$@). +endif + @echo "include: $(value)" >$@ + $(if $(strip $(prefix)),@echo "prefix: $(prefix)" >>$@) + @$(call c-cpp-options-expand,$^,$@) + +# Clean. +# +$(out_base)/%.cpp-options.clean: + $(call message,rm $(basename $@),rm -f $(basename $@)) diff --git a/build-0.3/c/generic/c-d.make b/build-0.3/c/generic/c-d.make new file mode 100644 index 0000000..8933d7d --- /dev/null +++ b/build-0.3/c/generic/c-d.make @@ -0,0 +1,18 @@ +# file : build/c/generic/c-o.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/generic/configuration.make) + +# Make will try to build dependecies (since they are ultimately included +# files) during configuartion phase without c_generic being discovered +# yet. This is also why dependecies should be included with -include. +# +ifdef c_generic + +.PHONY: $(out_base)/%.o.d.$(c_s_suffix).clean + +$(out_base)/%.o.d.$(c_s_suffix).clean: + @: + +endif diff --git a/build-0.3/c/generic/c-o.make b/build-0.3/c/generic/c-o.make new file mode 100644 index 0000000..d340837 --- /dev/null +++ b/build-0.3/c/generic/c-o.make @@ -0,0 +1,39 @@ +# file : build/c/generic/c-o.make +# 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)) +$(call include,$(bld_root)/c/generic/configuration.make) + +$(out_base)/%.o: c := $(c_generic) + +#@@ wrong prefix +# +$(out_base)/%.o: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o: $(src_base)/%.$(c_s_suffix) +else +$(out_base)/%.o: $(src_base)/%.$(c_s_suffix) | $$(dir $$@). +endif + $(call message,c $<,$(c) \ +$(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) \ +$(c_options) $(c_pic_options) $(c_extra_options) -o $@ -c $<) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o: $(out_base)/%.$(c_s_suffix) | $$(dir $$@). + $(call message,c $<,$(c) \ +$(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) \ +$(c_options) $(c_pic_options) $(c_extra_options) -o $@ -c $<) + +endif + +.PHONY: $(out_base)/%.o.$(c_s_suffix).clean + +$(out_base)/%.o.$(c_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) diff --git a/build-0.3/c/generic/configuration-rules.make b/build-0.3/c/generic/configuration-rules.make new file mode 100644 index 0000000..05e7a42 --- /dev/null +++ b/build-0.3/c/generic/configuration-rules.make @@ -0,0 +1,14 @@ +# file : build/c/generic/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/c/generic/configuration-dynamic.make: | $(dcf_root)/c/generic/. + $(call message,,$(bld_root)/c/generic/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/c/generic/configuration-dynamic.make,\ +rm -f $(dcf_root)/c/generic/configuration-dynamic.make) + +endif diff --git a/build-0.3/c/generic/configuration-sl-rules.make b/build-0.3/c/generic/configuration-sl-rules.make new file mode 100644 index 0000000..147cb1d --- /dev/null +++ b/build-0.3/c/generic/configuration-sl-rules.make @@ -0,0 +1,14 @@ +# file : build/c/generic/configuration-sl-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/c/generic/configuration-sl-dynamic.make: | $(dcf_root)/c/generic/. + $(call message,,$(bld_root)/c/generic/configure-sl $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/c/generic/configuration-sl-dynamic.make,\ +rm -f $(dcf_root)/c/generic/configuration-sl-dynamic.make) + +endif diff --git a/build-0.3/c/generic/configuration-sl.make b/build-0.3/c/generic/configuration-sl.make new file mode 100644 index 0000000..136186f --- /dev/null +++ b/build-0.3/c/generic/configuration-sl.make @@ -0,0 +1,20 @@ +# file : build/c/generic/configuration-sl.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/c/generic/configuration-sl-rules.make,$(dcf_root)) + +# Dynamic configuration. +# +c_generic_pic_option := + +$(call -include,$(dcf_root)/c/generic/configuration-sl-dynamic.make) + +ifdef c_generic_pic_option + +$(out_root)/%: c_generic_pic_option := $(c_generic_pic_option) +$(out_root)/%: c_generic_shared_option := $(c_generic_shared_option) + +else +.NOTPARALLEL: +endif diff --git a/build-0.3/c/generic/configuration.make b/build-0.3/c/generic/configuration.make new file mode 100644 index 0000000..1881c5c --- /dev/null +++ b/build-0.3/c/generic/configuration.make @@ -0,0 +1,21 @@ +# file : build/c/generic/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/c/generic/configuration-rules.make,$(dcf_root)) + +# Static configuration. +# +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/c/generic/configuration-static.make) +endif + +# Dynamic configuration. +# +c_generic := + +$(call -include,$(dcf_root)/c/generic/configuration-dynamic.make) + +ifndef c_generic +.NOTPARALLEL: +endif diff --git a/build-0.3/c/generic/configure b/build-0.3/c/generic/configure new file mode 100755 index 0000000..dae8d72 --- /dev/null +++ b/build-0.3/c/generic/configure @@ -0,0 +1,27 @@ +#! /usr/bin/env bash + +# file : build/c/generic/configure +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter the C compiler executable you would like to use." +$echo + +c_generic=`read_path --command` + +echo "c_generic := $c_generic" > $1 diff --git a/build-0.3/c/generic/configure-sl b/build-0.3/c/generic/configure-sl new file mode 100755 index 0000000..10064cb --- /dev/null +++ b/build-0.3/c/generic/configure-sl @@ -0,0 +1,36 @@ +#! /usr/bin/env bash + +# file : build/c/generic/configure-sl +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter C compiler option(s) used to build position-" +$echo "independent code (e.g., -fPIC, -Kpic, etc)." +$echo + +read -e -p "[]: " pic_option + +$echo +$echo "Please enter C compiler option(s) used to build shared" +$echo "libraries (e.g., -shared, -G, etc)." +$echo + +read -e -p "[]: " shared_option + +echo "c_generic_pic_option := $pic_option" > $1 +echo "c_generic_shared_option := $shared_option" >> $1 diff --git a/build-0.3/c/generic/o-e.make b/build-0.3/c/generic/o-e.make new file mode 100644 index 0000000..a607239 --- /dev/null +++ b/build-0.3/c/generic/o-e.make @@ -0,0 +1,27 @@ +# file : build/c/generic/o-e.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/generic/configuration.make) + +ifneq ($(c_extra_lib_paths),) +vpath %.so $(c_extra_lib_paths) +vpath %.a $(c_extra_lib_paths) +endif + +$(out_base)/%: ld := $(c_generic) +$(out_base)/%: expand-l = $(shell sed -e 's%^rpath:\(.*\)%%' $1) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(out_base)/%.o +else +$(out_base)/%: $(out_base)/%.o | $$(dir $$@). +endif + $(call message,ld $@,$(ld) \ +$(c_extra_options) $(ld_options) $(c_ld_extra_options) -o $@ \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(c_extra_libs)) + +.PHONY: $(out_base)/%.o.clean + +$(out_base)/%.o.clean: + $(call message,rm $(basename $(basename $@)),rm -f $(basename $@) $(basename $(basename $@))) diff --git a/build-0.3/c/generic/o-l.make b/build-0.3/c/generic/o-l.make new file mode 100644 index 0000000..bdae9fc --- /dev/null +++ b/build-0.3/c/generic/o-l.make @@ -0,0 +1,63 @@ +# file : build/c/generic/o-l.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/generic/configuration.make) + +ifeq ($(ld_lib_type),shared) +$(call include,$(bld_root)/c/generic/configuration-sl.make) +endif + +ifneq ($(c_extra_lib_paths),) +vpath %.so $(c_extra_lib_paths) +vpath %.a $(c_extra_lib_paths) +endif + +ifdef ld_lib_type + +.PHONY: $(out_base)/%.l.o.clean + +ifeq ($(ld_lib_type),archive) + +$(out_base)/%.l: ar := $(ld_lib_ar) +$(out_base)/%.l: ar_options ?= -rc + +$(out_base)/%.l: ranlib := $(ld_lib_ranlib) +$(out_base)/%.l: ranlib_options ?= + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ar $@,$(ar) $(ar_options) $(@D)/lib$(basename $(@F)).a $(filter %.o,$^)) + $(call message,,$(ranlib) $(ranlib_options) $(@D)/lib$(basename $(@F)).a) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) + +else + +$(out_base)/%.l: ld := $(c_generic) +$(out_base)/%.l: c_pic_options := $(c_generic_pic_option) +$(out_base)/%.l: expand-l = $(shell sed -e 's%^rpath:\(.*\)%%' $1) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ld $@,$(ld) $(c_generic_shared_option) \ +$(c_extra_options) $(ld_options) $(c_ld_extra_options) -o $(@D)/lib$(basename $(@F)).so \ +$(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 >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.so,$(@F)),$(basename $(basename $@))) + +endif +endif diff --git a/build-0.3/c/gnu/c-d.make b/build-0.3/c/gnu/c-d.make new file mode 100644 index 0000000..bc7411f --- /dev/null +++ b/build-0.3/c/gnu/c-d.make @@ -0,0 +1,58 @@ +# file : build/c/gnu/c-o.make +# 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)) +$(call include,$(bld_root)/c/gnu/configuration.make) + +# Make will try to build dependecies (since they are ultimately included +# files) during configuartion phase without c_gnu being discovered yet. +# This is also why dependecies should be included with -include. +# +ifdef c_gnu + +$(out_base)/%.o.d: c := $(c_gnu) +$(out_base)/%.o.d: cpp_options ?= + +#@@ This needs to be shared with c-o. +# +#@@ wrong prefix +# +$(out_base)/%.o.d: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o.d: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +.PRECIOUS: $(out_base)/%.o.d + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o.d: $(src_base)/%.$(c_s_suffix) +else +$(out_base)/%.o.d: $(src_base)/%.$(c_s_suffix) | $$(dir $$@). +endif + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(c) $(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) \ +$(c_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/gnu/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o.d: $(out_base)/%.$(c_s_suffix) | $$(dir $$@). + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(c) $(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) \ +$(c_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/gnu/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +endif + +.PHONY: $(out_base)/%.o.d.$(c_s_suffix).clean + +$(out_base)/%.o.d.$(c_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) + +endif diff --git a/build-0.3/c/gnu/c-o.make b/build-0.3/c/gnu/c-o.make new file mode 100644 index 0000000..46eb1da --- /dev/null +++ b/build-0.3/c/gnu/c-o.make @@ -0,0 +1,41 @@ +# file : build/c/gnu/c-o.make +# 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)) +$(call include,$(bld_root)/c/gnu/configuration.make) + +$(out_base)/%.o: c := $(c_gnu) +$(out_base)/%.o: c_options := $(c_gnu_optimization_options) $(c_gnu_debugging_options) + +#@@ wrong prefix +# +$(out_base)/%.o: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o: $(src_base)/%.$(c_s_suffix) +else +$(out_base)/%.o: $(src_base)/%.$(c_s_suffix) | $$(dir $$@). +endif + $(call message,c $<,$(c) \ +$(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) $(c_options) \ +$(c_pic_options) $(subst y,-fexceptions,$(filter y,$(c_exceptions))) $(c_extra_options) -o $@ -c $<) + + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o: $(out_base)/%.$(c_s_suffix) | $$(dir $$@). + $(call message,c $<,$(c) \ +$(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) $(c_options) \ +$(c_pic_options) $(subst y,-fexceptions,$(filter y,$(c_exceptions))) $(c_extra_options) -o $@ -c $<) + +endif + +.PHONY: $(out_base)/%.o.$(c_s_suffix).clean + +$(out_base)/%.o.$(c_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) diff --git a/build-0.3/c/gnu/configuration-rules.make b/build-0.3/c/gnu/configuration-rules.make new file mode 100644 index 0000000..cb25dfe --- /dev/null +++ b/build-0.3/c/gnu/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/c/gnu/configuration-rules.make +# 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) \ +"$(c_extra_options)" "$(c_ld_extra_options)") + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/c/gnu/configuration-dynamic.make,\ +rm -f $(dcf_root)/c/gnu/configuration-dynamic.make) + +endif diff --git a/build-0.3/c/gnu/configuration-static.make b/build-0.3/c/gnu/configuration-static.make new file mode 100644 index 0000000..e9be2b9 --- /dev/null +++ b/build-0.3/c/gnu/configuration-static.make @@ -0,0 +1,3 @@ +# file : build/c/gnu/configuration-static.make +# 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 new file mode 100644 index 0000000..32aaf97 --- /dev/null +++ b/build-0.3/c/gnu/configuration.make @@ -0,0 +1,33 @@ +# file : build/c/gnu/configuration.make +# 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)) + +# Static configuration. +# +$(call include,$(bld_root)/c/gnu/configuration-static.make) + +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/c/gnu/configuration-static.make) +endif + +# Dynamic configuration. +# +c_gnu := +c_gnu_optimization_options := + +$(call -include,$(dcf_root)/c/gnu/configuration-dynamic.make) + +ifdef c_gnu + +c_gnu_debugging_options := $(if $(findstring y,$(c_debug)),-g) + +$(out_root)/%: c_gnu_debugging_options := $(c_gnu_debugging_options) +$(out_root)/%: c_gnu_optimization_options := $(c_gnu_optimization_options) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/c/gnu/configure b/build-0.3/c/gnu/configure new file mode 100755 index 0000000..713f091 --- /dev/null +++ b/build-0.3/c/gnu/configure @@ -0,0 +1,85 @@ +#! /usr/bin/env bash + +# file : build/c/gnu/configure +# 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 +# + + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter the gcc binary you would like to use, for example 'gcc-3.4'," +$echo "'/usr/local/bin/gcc' or 'distcc gcc'." +$echo + +c_gnu=`read_path --command gcc` + +# 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= + +if [ "$2" == "y" ]; then + + $echo + $echo "Please select the optimization level you would like to use:" + $echo + $echo "(1) -O1 [Tries to reduce code size and execution time, without" + $echo " performing any optimizations that take a great deal of" + $echo " compilation time.]" + $echo "(2) -O2 [Performs nearly all supported optimizations that do not" + $echo " involve a space-speed tradeoff.]" + $echo "(3) -O3 [Optimize even more.]" + $echo "(4) -Os [Optimize for size.]" + $echo + + optimization=`read_option "-O1 -O2 -O3 -Os" "-O2"` + +fi + +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 new file mode 100755 index 0000000..ecafcb1 --- /dev/null +++ b/build-0.3/c/gnu/dep @@ -0,0 +1,57 @@ +#! /usr/bin/env bash + +# file : build/c/gnu/dep +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Post-process generated dependency information. +# +# $1 current project's $(out_base) +# $2 - $N optional .cpp-options files + +out_base=$1 +shift + +files=$* + +#echo $out_base +#echo $files + +script= + +function gen_script () +{ + while [ "$1" ]; do + prefix=$1 + shift + + path=$1 + shift + + # Besides unresolved paths also replace default installation + # targets (/usr/include and /usr/local/include). + # + script="$script"\ +"s \\ $prefix \\ $path$prefix g;"\ +"s \\ /usr/include/$prefix \\ $path$prefix g;"\ +"s \\ /usr/local/include/$prefix \\ $path$prefix g;"\ +"s ^$prefix $path$prefix ;"\ +"s ^/usr/include/$prefix $path$prefix ;"\ +"s ^/usr/local/include/$prefix $path$prefix ;" + done +} + +if [ "$files" ]; then + prefixes=`sed -e 's%^prefix: \(.*\)$%\1%' -e t -e d $files` + gen_script $prefixes +fi + +# The last part of the script translates all file names that don't start +# with / or . (that is, local generated files) to files in $out_base. Note +# that it is assumed that such files are never installed and therefore there +# is no way to get around the situation where this file is picket up from +# some other place (e.g., /usr/include). +# +epilogue="s% \([^/. \\\\]\)% $out_base/\1%g;s%^\([^/. ].*:\)%$out_base/\1%" + +exec sed -e "$script$epilogue" diff --git a/build-0.3/c/gnu/o-e.make b/build-0.3/c/gnu/o-e.make new file mode 100644 index 0000000..a54a9f3 --- /dev/null +++ b/build-0.3/c/gnu/o-e.make @@ -0,0 +1,39 @@ +# file : build/c/gnu/o-e.make +# 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) + +#@@ should it be lib%.so? +# +ifneq ($(c_extra_lib_paths),) +vpath %.so $(c_extra_lib_paths) +vpath %.a $(c_extra_lib_paths) +endif + +ifneq ($(c_gnu_libraries),) +vpath %.so $(c_gnu_libraries) +vpath %.a $(c_gnu_libraries) +endif + +$(out_base)/%: ld := $(c_gnu) +$(out_base)/%: ld_options := $(c_gnu_optimization_options) $(c_gnu_debugging_options) $(c_ld_extra_options) + +$(out_base)/%: expand-l = $(if $(subst n,,$(c_rpath)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(out_base)/%.o +else +$(out_base)/%: $(out_base)/%.o | $$(dir $$@). +endif + $(call message,ld $@,$(ld) \ +$(c_extra_options) $(ld_options) $(c_ld_extra_options) -o $@ \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(c_extra_libs)) + + +.PHONY: $(out_base)/%.o.clean + +$(out_base)/%.o.clean: + $(call message,rm $(basename $(basename $@)),rm -f $(basename $@) $(basename $(basename $@))) diff --git a/build-0.3/c/gnu/o-l.make b/build-0.3/c/gnu/o-l.make new file mode 100644 index 0000000..5c93f0a --- /dev/null +++ b/build-0.3/c/gnu/o-l.make @@ -0,0 +1,92 @@ +# file : build/c/gnu/o-l.make +# 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) + +ifneq ($(c_extra_lib_paths),) +vpath %.so $(c_extra_lib_paths) +vpath %.a $(c_extra_lib_paths) +endif + +ifneq ($(c_gnu_libraries),) +vpath %.so $(c_gnu_libraries) +vpath %.a $(c_gnu_libraries) +endif + +ifdef ld_lib_type + +.PHONY: $(out_base)/%.l.o.clean + +ifeq ($(ld_lib_type),archive) + +$(out_base)/%.l: ar := $(ld_lib_ar) +$(out_base)/%.l: ar_options ?= -rc + +$(out_base)/%.l: ranlib := $(ld_lib_ranlib) +$(out_base)/%.l: ranlib_options ?= + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ar $@,$(ar) $(ar_options) $(@D)/lib$(basename $(@F)).a $(filter %.o,$^)) + $(call message,,$(ranlib) $(ranlib_options) $(@D)/lib$(basename $(@F)).a) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) + +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)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(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 \ +$(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 diff --git a/build-0.3/c/intel/c-d.make b/build-0.3/c/intel/c-d.make new file mode 100644 index 0000000..b4d6c80 --- /dev/null +++ b/build-0.3/c/intel/c-d.make @@ -0,0 +1,58 @@ +# file : build/c/intel/c-o.make +# 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)) +$(call include,$(bld_root)/c/intel/configuration.make) + +# Make will try to build dependecies (since they are ultimately included +# files) during configuartion phase without c_intel being discovered yet. +# This is also why dependecies should be included with -include. +# +ifdef c_intel + +$(out_base)/%.o.d: c := $(c_intel) +$(out_base)/%.o.d: cpp_options ?= + +#@@ This needs to be shared with c-o. +# +#@@ wrong prefix +# +$(out_base)/%.o.d: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o.d: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +.PRECIOUS: $(out_base)/%.o.d + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o.d: $(src_base)/%.$(c_s_suffix) +else +$(out_base)/%.o.d: $(src_base)/%.$(c_s_suffix) | $$(dir $$@). +endif + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(c) $(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) \ +$(c_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/intel/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o.d: $(out_base)/%.$(c_s_suffix) | $$(dir $$@). + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(c) $(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) \ +$(c_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/intel/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +endif + +.PHONY: $(out_base)/%.o.d.$(c_s_suffix).clean + +$(out_base)/%.o.d.$(c_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) + +endif diff --git a/build-0.3/c/intel/c-o.make b/build-0.3/c/intel/c-o.make new file mode 100644 index 0000000..e925b50 --- /dev/null +++ b/build-0.3/c/intel/c-o.make @@ -0,0 +1,40 @@ +# file : build/c/intel/c-o.make +# 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)) +$(call include,$(bld_root)/c/intel/configuration.make) + +$(out_base)/%.o: c := $(c_intel) +$(out_base)/%.o: c_options := $(c_intel_optimization_options) $(c_intel_debugging_options) + +#@@ wrong prefix +# +$(out_base)/%.o: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o: $(src_base)/%.$(c_s_suffix) +else +$(out_base)/%.o: $(src_base)/%.$(c_s_suffix) | $$(dir $$@). +endif + $(call message,c $<,$(c) \ +$(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) $(c_options) \ +$(c_pic_options) $(subst y,-fexceptions,$(filter y,$(c_exceptions))) $(c_extra_options) -o $@ -c $<) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o: $(out_base)/%.$(c_s_suffix) | $$(dir $$@). + $(call message,c $<,$(c) \ +$(cpp_options) $(call expand-cpp-options,$^) $(c_pp_extra_options) $(c_options) \ +$(c_pic_options) $(subst y,-fexceptions,$(filter y,$(c_exceptions))) $(c_extra_options) -o $@ -c $<) + +endif + +.PHONY: $(out_base)/%.o.$(c_s_suffix).clean + +$(out_base)/%.o.$(c_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) diff --git a/build-0.3/c/intel/configuration-rules.make b/build-0.3/c/intel/configuration-rules.make new file mode 100644 index 0000000..0132981 --- /dev/null +++ b/build-0.3/c/intel/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/c/intel/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/c/intel/configuration-dynamic.make: | $(dcf_root)/c/intel/. + $(call message,,$(bld_root)/c/intel/configure $@ $(c_optimize) \ +"$(c_extra_options)" "$(c_ld_extra_options)") + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/c/intel/configuration-dynamic.make,\ +rm -f $(dcf_root)/c/intel/configuration-dynamic.make) + +endif diff --git a/build-0.3/c/intel/configuration-static.make b/build-0.3/c/intel/configuration-static.make new file mode 100644 index 0000000..c3e2d05 --- /dev/null +++ b/build-0.3/c/intel/configuration-static.make @@ -0,0 +1,3 @@ +# file : build/c/intel/configuration-static.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file diff --git a/build-0.3/c/intel/configuration.make b/build-0.3/c/intel/configuration.make new file mode 100644 index 0000000..4e0ec1e --- /dev/null +++ b/build-0.3/c/intel/configuration.make @@ -0,0 +1,33 @@ +# file : build/c/intel/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/c/intel/configuration-rules.make,$(dcf_root)) + +# Static configuration. +# +$(call include,$(bld_root)/c/intel/configuration-static.make) + +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/c/intel/configuration-static.make) +endif + +# Dynamic configuration. +# +c_intel := +c_intel_optimization_options := + +$(call -include,$(dcf_root)/c/intel/configuration-dynamic.make) + +ifdef c_intel + +c_intel_debugging_options := $(if $(findstring y,$(c_debug)),-g) + +$(out_root)/%: c_intel_debugging_options := $(c_intel_debugging_options) +$(out_root)/%: c_intel_optimization_options := $(c_intel_optimization_options) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/c/intel/configure b/build-0.3/c/intel/configure new file mode 100755 index 0000000..e829cea --- /dev/null +++ b/build-0.3/c/intel/configure @@ -0,0 +1,57 @@ +#! /usr/bin/env bash + +# file : build/c/intel/configure +# 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 +# + + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter the icc binary you would like to use, for example " +$echo "'/opt/intel_cc_80/bin/icc'." +$echo + +c_intel=`read_path --command icc` + +# Pass c_extra_options and c_ld_extra_options since those can affect the +# search paths (e.g., -m32) and target. +# +c_intel_libraries=`$c_intel $3 $4 -print-search-dirs | sed -e 's/libraries: =//p' -e d` + +# Intel optimizes by default. +# +optimization=-O0 + +if [ "$2" == "y" ]; then + + $echo + $echo "Please select the optimization level you would like to use:" + $echo + $echo "(1) -O1 [Enable optimizations.]" + $echo "(2) -O2 [Same as -O1.]" + $echo "(3) -O3 [As -O2 plus more aggressive optimizations that may not" + $echo " improve performance for all programs.]" + $echo + + optimization=`read_option "-O1 -O2 -O3" "-O2"` +fi + +echo "c_intel := $c_intel" > $1 +echo "c_intel_libraries := $c_intel_libraries" >> $1 +echo "c_intel_optimization_options := $optimization" >> $1 diff --git a/build-0.3/c/intel/dep b/build-0.3/c/intel/dep new file mode 100755 index 0000000..ead761f --- /dev/null +++ b/build-0.3/c/intel/dep @@ -0,0 +1,57 @@ +#! /usr/bin/env bash + +# file : build/c/intel/dep +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Post-process generated dependency information. +# +# $1 current project's $(out_base) +# $2 - $N optional .cpp-options files + +out_base=$1 +shift + +files=$* + +#echo $out_base +#echo $files + +script= + +function gen_script () +{ + while [ "$1" ]; do + prefix=$1 + shift + + path=$1 + shift + + # Besides unresolved paths also replace default installation + # targets (/usr/include and /usr/local/include). + # + script="$script"\ +"s \\ $prefix \\ $path$prefix g;"\ +"s \\ /usr/include/$prefix \\ $path$prefix g;"\ +"s \\ /usr/local/include/$prefix \\ $path$prefix g;"\ +"s ^$prefix $path$prefix ;"\ +"s ^/usr/include/$prefix $path$prefix ;"\ +"s ^/usr/local/include/$prefix $path$prefix ;" + done +} + +if [ "$files" ]; then + prefixes=`sed -e 's%^prefix: \(.*\)$%\1%' -e t -e d $files` + gen_script $prefixes +fi + +# The last part of the script translates all file names that don't start +# with / or . (that is, local generated files) to files in $out_base. Note +# that it is assumed that such files are never installed and therefore there +# is no way to get around the situation where this file is picket up from +# some other place (e.g., /usr/include). +# +epilogue="s% \([^/. \\\\]\)% $out_base/\1%g;s%^\([^/. ].*:\)%$out_base/\1%" + +exec sed -e "$script$epilogue" diff --git a/build-0.3/c/intel/o-e.make b/build-0.3/c/intel/o-e.make new file mode 100644 index 0000000..0661ccc --- /dev/null +++ b/build-0.3/c/intel/o-e.make @@ -0,0 +1,38 @@ +# file : build/c/intel/o-e.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/intel/configuration.make) + +#@@ should it be lib%.so? +# +ifneq ($(c_extra_lib_paths),) +vpath %.so $(c_extra_lib_paths) +vpath %.a $(c_extra_lib_paths) +endif + +ifneq ($(c_intel_libraries),) +vpath %.so $(c_intel_libraries) +vpath %.a $(c_intel_libraries) +endif + +$(out_base)/%: ld := $(c_intel) +$(out_base)/%: ld_options := $(c_intel_optimization_options) $(c_intel_debugging_options) $(c_ld_extra_options) + +$(out_base)/%: expand-l = $(if $(subst n,,$(c_rpath)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(out_base)/%.o +else +$(out_base)/%: $(out_base)/%.o | $$(dir $$@). +endif + $(call message,ld $@,$(ld) \ +$(c_extra_options) $(ld_options) $(c_ld_extra_options) -o $@ \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(c_extra_libs)) + +.PHONY: $(out_base)/%.o.clean + +$(out_base)/%.o.clean: + $(call message,rm $(basename $(basename $@)),rm -f $(basename $@) $(basename $(basename $@))) diff --git a/build-0.3/c/intel/o-l.make b/build-0.3/c/intel/o-l.make new file mode 100644 index 0000000..0ad3085 --- /dev/null +++ b/build-0.3/c/intel/o-l.make @@ -0,0 +1,70 @@ +# file : build/c/intel/o-l.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/intel/configuration.make) + +ifneq ($(c_extra_lib_paths),) +vpath %.so $(c_extra_lib_paths) +vpath %.a $(c_extra_lib_paths) +endif + +ifneq ($(c_intel_libraries),) +vpath %.so $(c_intel_libraries) +vpath %.a $(c_intel_libraries) +endif + +ifdef ld_lib_type + +.PHONY: $(out_base)/%.l.o.clean + +ifeq ($(ld_lib_type),archive) + +$(out_base)/%.l: ar := $(ld_lib_ar) +$(out_base)/%.l: ar_options ?= -rc + +$(out_base)/%.l: ranlib := $(ld_lib_ranlib) +$(out_base)/%.l: ranlib_options ?= + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ar $@,$(ar) $(ar_options) $(@D)/lib$(basename $(@F)).a $(filter %.o,$^)) + $(call message,,$(ranlib) $(ranlib_options) $(@D)/lib$(basename $(@F)).a) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) + +else + +$(out_base)/%.l: ld := $(c_intel) +$(out_base)/%.l: ld_options := $(c_intel_optimization_options) $(c_intel_debugging_options) +$(out_base)/%.l: c_pic_options := -fPIC +$(out_base)/%.l: comma_ := , + +$(out_base)/%.l: expand-l = $(if $(subst n,,$(c_rpath)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(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 \ +$(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 >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.so,$(@F)),$(basename $(basename $@))) + +endif +endif diff --git a/build-0.3/c/o-e.make b/build-0.3/c/o-e.make new file mode 100644 index 0000000..95f0757 --- /dev/null +++ b/build-0.3/c/o-e.make @@ -0,0 +1,9 @@ +# file : build/c/o-e.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/c/configuration.make) + +ifdef c_id +$(call include-once,$(bld_root)/c/$(c_id)/o-e.make,$(out_base)) +endif diff --git a/build-0.3/c/o-l.make b/build-0.3/c/o-l.make new file mode 100644 index 0000000..7f64067 --- /dev/null +++ b/build-0.3/c/o-l.make @@ -0,0 +1,10 @@ +# file : build/c/o-l.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/ld/configuration-lib.make) +$(call include,$(bld_root)/c/configuration.make) + +ifdef c_id +$(call include-once,$(bld_root)/c/$(c_id)/o-l.make,$(out_base)) +endif diff --git a/build-0.3/clean.make b/build-0.3/clean.make new file mode 100644 index 0000000..c410853 --- /dev/null +++ b/build-0.3/clean.make @@ -0,0 +1,16 @@ +# file : build/clean.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +#@@ Maybe create file aliases.make for standard aliases +# plus check for interactivity? What if some targets +# are not defined? +# + +ifdef %interactive% + +.PHONY: clean + +clean: $(out_base)/.clean + +endif diff --git a/build-0.3/configuration-static.make b/build-0.3/configuration-static.make new file mode 100644 index 0000000..17d10f9 --- /dev/null +++ b/build-0.3/configuration-static.make @@ -0,0 +1,8 @@ +# file : build/configuration-static.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Name of the target that cleans absolutely everything. Used as +# a prerequisite of `disfigure' target. +# +build_absolute_clean_target := clean diff --git a/build-0.3/cxx/configuration-rules.make b/build-0.3/cxx/configuration-rules.make new file mode 100644 index 0000000..70fce9d --- /dev/null +++ b/build-0.3/cxx/configuration-rules.make @@ -0,0 +1,18 @@ +# file : build/cxx/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/cxx/configuration-dynamic.make: | $(dcf_root)/cxx/. + $(call message,,$(bld_root)/cxx/configure $@ \ +"$(origin cxx_pp_options)" \ +"$(origin cxx_options)" \ +"$(origin cxx_ld_options)" \ +"$(origin cxx_libs)") + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/cxx/configuration-dynamic.make,\ +rm -f $(dcf_root)/cxx/configuration-dynamic.make) + +endif diff --git a/build-0.3/cxx/configuration-static.make b/build-0.3/cxx/configuration-static.make new file mode 100644 index 0000000..d6c0731 --- /dev/null +++ b/build-0.3/cxx/configuration-static.make @@ -0,0 +1,14 @@ +# file : build/cxx/configuration-static.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +cxx_h_suffix := hxx +cxx_t_suffix := txx +cxx_i_suffix := ixx +cxx_s_suffix := cxx + +# Get user-supplied static configuration if any. +# +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/cxx/configuration-static.make) +endif
\ No newline at end of file diff --git a/build-0.3/cxx/configuration.make b/build-0.3/cxx/configuration.make new file mode 100644 index 0000000..4529f62 --- /dev/null +++ b/build-0.3/cxx/configuration.make @@ -0,0 +1,44 @@ +# file : build/cxx/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/cxx/configuration-rules.make,$(dcf_root)) + +# Static configuration. +# +$(call include,$(bld_root)/cxx/configuration-static.make) + + +# Dynamic configuration. +# +cxx_id := +cxx_optimize := +cxx_debug := +cxx_rpath := + +cxx_pp_extra_options := +cxx_extra_options := +cxx_ld_extra_options := +cxx_extra_libs := +cxx_extra_lib_paths := + +$(call -include,$(dcf_root)/cxx/configuration-dynamic.make) + +ifdef cxx_id + +$(out_root)/%: cxx_id := $(cxx_id) +$(out_root)/%: cxx_optimize := $(cxx_optimize) +$(out_root)/%: cxx_debug := $(cxx_debug) +$(out_root)/%: cxx_rpath := $(cxx_rpath) + +$(out_root)/%: cxx_pp_extra_options := $(cxx_pp_extra_options) $(cxx_pp_cmd_options) +$(out_root)/%: cxx_extra_options := $(cxx_extra_options) $(cxx_cmd_options) +$(out_root)/%: cxx_ld_extra_options := $(cxx_ld_extra_options) $(cxx_ld_cmd_options) +$(out_root)/%: cxx_extra_libs := $(cxx_extra_libs) $(cxx_cmd_libs) +$(out_root)/%: cxx_extra_lib_paths := $(cxx_extra_lib_paths) $(cxx_cmd_lib_paths) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/cxx/configure b/build-0.3/cxx/configure new file mode 100755 index 0000000..f4607ad --- /dev/null +++ b/build-0.3/cxx/configure @@ -0,0 +1,166 @@ +#! /usr/bin/env bash + +# file : build/cxx/configure +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# $2 origin of the cxx_pp_options make variable +# $3 origin of the cxx_options make variable +# $4 origin of the cxx_ld_options make variable +# $5 origin of the cxx_libs make variable +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please select the C++ compiler you would like to use:" +$echo +$echo "(1) GNU C++ (g++)" +$echo "(2) Intel C++ (icc)" +$echo "(3) Other C++ compiler" +$echo + +id=`read_option "gnu intel generic" "gnu"` + +if [ "$id" != "generic" ]; then + + $echo + $echo "Would you like the C++ compiler to optimize generated code?" + $echo + + optimize=`read_y_n y` + + + $echo + $echo "Would you like the C++ compiler to generate debug information?" + $echo + + debug=`read_y_n y` + + $echo + $echo "Embed dynamic library paths into executables (rpath)?" + $echo + + rpath=`read_y_n y` + +fi + +# pp_options +# +if [ "$2" != "undefined" ]; then + + pp_options=$cxx_pp_options + + if [ "$pp_options" ]; then + $echo + $echo "Extra C++ preprocessor options: $pp_options" + $echo + fi +else + + $echo + $echo "Please enter any extra C++ preprocessor options." + $echo + + read -e -p "[]: " pp_options +fi + + +# options +# +if [ "$3" != "undefined" ]; then + + options=$cxx_options + + if [ "$options" ]; then + $echo + $echo "Extra C++ compiler options: $options" + $echo + fi +else + + $echo + $echo "Please enter any extra C++ compiler options." + $echo + + read -p "[]: " options +fi + + +# ld_options +# +if [ "$4" != "undefined" ]; then + + ld_options=$cxx_ld_options + + if [ "$ld_options" ]; then + $echo + $echo "Extra C++ linker options: $ld_options" + $echo + fi +else + + $echo + $echo "Please enter any extra C++ linker options." + $echo + + read -e -p "[]: " ld_options +fi + + +# libs +# +if [ "$5" != "undefined" ]; then + + libs=$cxx_libs + + if [ "$libs" ]; then + $echo + $echo "Extra C++ libraries: $libs" + $echo + fi +else + + $echo + $echo "Please enter any extra C++ libraries." + $echo + + read -e -p "[]: " libs +fi + + +# Extract -L paths from the ld options. +# +paths= + +if [ "$ld_options" ]; then + paths=`echo "$ld_options" | sed -e 's/-L *\([^ ]*\)/\\ +-L\1\\ +/g' | sed -e 's/^-L\([^ ]*\)$/\1/' -e t -e d` + paths=`echo $paths | sed -e 's/ /:/g'` +fi + +echo "cxx_id := $id" >$1 + +if [ "$id" != "generic" ]; then + echo "cxx_optimize := $optimize" >>$1 + echo "cxx_debug := $debug" >>$1 + echo "cxx_rpath := $rpath" >>$1 +fi + +echo "cxx_pp_extra_options := $pp_options" >>$1 +echo "cxx_extra_options := $options" >>$1 +echo "cxx_ld_extra_options := $ld_options" >>$1 +echo "cxx_extra_libs := $libs" >>$1 +echo "cxx_extra_lib_paths := $paths" >>$1 diff --git a/build-0.3/cxx/cxx-d.make b/build-0.3/cxx/cxx-d.make new file mode 100644 index 0000000..673b2d1 --- /dev/null +++ b/build-0.3/cxx/cxx-d.make @@ -0,0 +1,9 @@ +# file : build/cxx/cxx-d.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/configuration.make) + +ifdef cxx_id +$(call include-once,$(bld_root)/cxx/$(cxx_id)/cxx-d.make,$(out_base)) +endif diff --git a/build-0.3/cxx/cxx-o.make b/build-0.3/cxx/cxx-o.make new file mode 100644 index 0000000..a08b371 --- /dev/null +++ b/build-0.3/cxx/cxx-o.make @@ -0,0 +1,9 @@ +# file : build/cxx/cxx-o.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/configuration.make) + +ifdef cxx_id +$(call include-once,$(bld_root)/cxx/$(cxx_id)/cxx-o.make,$(out_base)) +endif diff --git a/build-0.3/cxx/generic/configuration-rules.make b/build-0.3/cxx/generic/configuration-rules.make new file mode 100644 index 0000000..2025cfc --- /dev/null +++ b/build-0.3/cxx/generic/configuration-rules.make @@ -0,0 +1,14 @@ +# file : build/cxx/generic/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/cxx/generic/configuration-dynamic.make: | $(dcf_root)/cxx/generic/. + $(call message,,$(bld_root)/cxx/generic/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/cxx/generic/configuration-dynamic.make,\ +rm -f $(dcf_root)/cxx/generic/configuration-dynamic.make) + +endif diff --git a/build-0.3/cxx/generic/configuration-sl-rules.make b/build-0.3/cxx/generic/configuration-sl-rules.make new file mode 100644 index 0000000..3630d26 --- /dev/null +++ b/build-0.3/cxx/generic/configuration-sl-rules.make @@ -0,0 +1,14 @@ +# file : build/cxx/generic/configuration-sl-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/cxx/generic/configuration-sl-dynamic.make: | $(dcf_root)/cxx/generic/. + $(call message,,$(bld_root)/cxx/generic/configure-sl $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/cxx/generic/configuration-sl-dynamic.make,\ +rm -f $(dcf_root)/cxx/generic/configuration-sl-dynamic.make) + +endif diff --git a/build-0.3/cxx/generic/configuration-sl.make b/build-0.3/cxx/generic/configuration-sl.make new file mode 100644 index 0000000..f1b75be --- /dev/null +++ b/build-0.3/cxx/generic/configuration-sl.make @@ -0,0 +1,20 @@ +# file : build/cxx/generic/configuration-sl.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/cxx/generic/configuration-sl-rules.make,$(dcf_root)) + +# Dynamic configuration. +# +cxx_generic_pic_option := + +$(call -include,$(dcf_root)/cxx/generic/configuration-sl-dynamic.make) + +ifdef cxx_generic_pic_option + +$(out_root)/%: cxx_generic_pic_option := $(cxx_generic_pic_option) +$(out_root)/%: cxx_generic_shared_option := $(cxx_generic_shared_option) + +else +.NOTPARALLEL: +endif diff --git a/build-0.3/cxx/generic/configuration.make b/build-0.3/cxx/generic/configuration.make new file mode 100644 index 0000000..1816913 --- /dev/null +++ b/build-0.3/cxx/generic/configuration.make @@ -0,0 +1,21 @@ +# file : build/cxx/generic/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/cxx/generic/configuration-rules.make,$(dcf_root)) + +# Static configuration. +# +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/cxx/generic/configuration-static.make) +endif + +# Dynamic configuration. +# +cxx_generic := + +$(call -include,$(dcf_root)/cxx/generic/configuration-dynamic.make) + +ifndef cxx_generic +.NOTPARALLEL: +endif diff --git a/build-0.3/cxx/generic/configure b/build-0.3/cxx/generic/configure new file mode 100755 index 0000000..b590398 --- /dev/null +++ b/build-0.3/cxx/generic/configure @@ -0,0 +1,27 @@ +#! /usr/bin/env bash + +# file : build/cxx/generic/configure +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter the C++ compiler executable you would like to use." +$echo + +cxx_generic=`read_path --command` + +echo "cxx_generic := $cxx_generic" > $1 diff --git a/build-0.3/cxx/generic/configure-sl b/build-0.3/cxx/generic/configure-sl new file mode 100755 index 0000000..31df8ce --- /dev/null +++ b/build-0.3/cxx/generic/configure-sl @@ -0,0 +1,36 @@ +#! /usr/bin/env bash + +# file : build/cxx/generic/configure-sl +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter C++ compiler option(s) used to build position-" +$echo "independent code (e.g., -fPIC, -Kpic, etc)." +$echo + +read -e -p "[]: " pic_option + +$echo +$echo "Please enter C++ compiler option(s) used to build shared" +$echo "libraries (e.g., -shared, -G, etc)." +$echo + +read -e -p "[]: " shared_option + +echo "cxx_generic_pic_option := $pic_option" > $1 +echo "cxx_generic_shared_option := $shared_option" >> $1 diff --git a/build-0.3/cxx/generic/cxx-d.make b/build-0.3/cxx/generic/cxx-d.make new file mode 100644 index 0000000..4a88451 --- /dev/null +++ b/build-0.3/cxx/generic/cxx-d.make @@ -0,0 +1,18 @@ +# file : build/cxx/generic/cxx-o.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/generic/configuration.make) + +# Make will try to build dependecies (since they are ultimately included +# files) during configuartion phase without cxx_generic being discovered +# yet. This is also why dependecies should be included with -include. +# +ifdef cxx_generic + +.PHONY: $(out_base)/%.o.d.$(cxx_s_suffix).clean + +$(out_base)/%.o.d.$(cxx_s_suffix).clean: + @: + +endif diff --git a/build-0.3/cxx/generic/cxx-o.make b/build-0.3/cxx/generic/cxx-o.make new file mode 100644 index 0000000..3123dca --- /dev/null +++ b/build-0.3/cxx/generic/cxx-o.make @@ -0,0 +1,39 @@ +# file : build/cxx/generic/cxx-o.make +# 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)) +$(call include,$(bld_root)/cxx/generic/configuration.make) + +$(out_base)/%.o: cxx := $(cxx_generic) + +#@@ wrong prefix +# +$(out_base)/%.o: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) +else +$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) | $$(dir $$@). +endif + $(call message,c++ $<,$(cxx) \ +$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o: $(out_base)/%.$(cxx_s_suffix) | $$(dir $$@). + $(call message,c++ $<,$(cxx) \ +$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<) + +endif + +.PHONY: $(out_base)/%.o.$(cxx_s_suffix).clean + +$(out_base)/%.o.$(cxx_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) diff --git a/build-0.3/cxx/generic/o-e.make b/build-0.3/cxx/generic/o-e.make new file mode 100644 index 0000000..2f9f02e --- /dev/null +++ b/build-0.3/cxx/generic/o-e.make @@ -0,0 +1,27 @@ +# file : build/cxx/generic/o-e.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/generic/configuration.make) + +ifneq ($(cxx_extra_lib_paths),) +vpath %.so $(cxx_extra_lib_paths) +vpath %.a $(cxx_extra_lib_paths) +endif + +$(out_base)/%: ld := $(cxx_generic) +$(out_base)/%: expand-l = $(shell sed -e 's%^rpath:\(.*\)%%' $1) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(out_base)/%.o +else +$(out_base)/%: $(out_base)/%.o | $$(dir $$@). +endif + $(call message,ld $@,$(ld) \ +$(cxx_extra_options) $(ld_options) $(cxx_ld_extra_options) -o $@ \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_extra_libs)) + +.PHONY: $(out_base)/%.o.clean + +$(out_base)/%.o.clean: + $(call message,rm $(basename $(basename $@)),rm -f $(basename $@) $(basename $(basename $@))) diff --git a/build-0.3/cxx/generic/o-l.make b/build-0.3/cxx/generic/o-l.make new file mode 100644 index 0000000..1e7dcff --- /dev/null +++ b/build-0.3/cxx/generic/o-l.make @@ -0,0 +1,66 @@ +# file : build/cxx/generic/o-l.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/generic/configuration.make) + +ifeq ($(ld_lib_type),shared) +$(call include,$(bld_root)/cxx/generic/configuration-sl.make) +endif + +ifneq ($(cxx_extra_lib_paths),) +vpath %.so $(cxx_extra_lib_paths) +vpath %.a $(cxx_extra_lib_paths) +endif + +ifdef ld_lib_type + +.PHONY: $(out_base)/%.l.o.clean + +ifeq ($(ld_lib_type),archive) + +$(out_base)/%.l: ar := $(ld_lib_ar) +$(out_base)/%.l: ar_options ?= -rc + +$(out_base)/%.l: ranlib := $(ld_lib_ranlib) +$(out_base)/%.l: ranlib_options ?= + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ar $@,$(ar) $(ar_options) $(@D)/lib$(basename $(@F)).a $(filter %.o,$^)) + $(call message,,$(ranlib) $(ranlib_options) $(@D)/lib$(basename $(@F)).a) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) + +else + +$(out_base)/%.l: ld := $(cxx_generic) +$(out_base)/%.l: c_pic_options := $(cxx_generic_pic_option) +$(out_base)/%.l: cxx_pic_options := $(cxx_generic_pic_option) +$(out_base)/%.l: comma_ := , + +$(out_base)/%.l: expand-l = $(shell sed -e 's%^rpath:\(.*\)%%' $1) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ld $@,$(ld) $(cxx_generic_shared_option) \ +$(cxx_extra_options) $(ld_options) $(cxx_ld_extra_options) -o $(@D)/lib$(basename $(@F)).so \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_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 >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.so,$(@F)),$(basename $(basename $@))) + +endif +endif diff --git a/build-0.3/cxx/gnu/configuration-rules.make b/build-0.3/cxx/gnu/configuration-rules.make new file mode 100644 index 0000000..6d79582 --- /dev/null +++ b/build-0.3/cxx/gnu/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/cxx/gnu/configuration-rules.make +# 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) \ +"$(cxx_extra_options)" "$(cxx_ld_extra_options)") + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/cxx/gnu/configuration-dynamic.make,\ +rm -f $(dcf_root)/cxx/gnu/configuration-dynamic.make) + +endif diff --git a/build-0.3/cxx/gnu/configuration-static.make b/build-0.3/cxx/gnu/configuration-static.make new file mode 100644 index 0000000..d0aee7d --- /dev/null +++ b/build-0.3/cxx/gnu/configuration-static.make @@ -0,0 +1,3 @@ +# file : build/cxx/gnu/configuration-static.make +# 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 new file mode 100644 index 0000000..2e55f8b --- /dev/null +++ b/build-0.3/cxx/gnu/configuration.make @@ -0,0 +1,33 @@ +# file : build/cxx/gnu/configuration.make +# 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)) + +# Static configuration. +# +$(call include,$(bld_root)/cxx/gnu/configuration-static.make) + +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/cxx/gnu/configuration-static.make) +endif + +# Dynamic configuration. +# +cxx_gnu := +cxx_gnu_optimization_options := + +$(call -include,$(dcf_root)/cxx/gnu/configuration-dynamic.make) + +ifdef cxx_gnu + +cxx_gnu_debugging_options := $(if $(findstring y,$(cxx_debug)),-g) + +$(out_root)/%: cxx_gnu_debugging_options := $(cxx_gnu_debugging_options) +$(out_root)/%: cxx_gnu_optimization_options := $(cxx_gnu_optimization_options) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/cxx/gnu/configure b/build-0.3/cxx/gnu/configure new file mode 100755 index 0000000..c551713 --- /dev/null +++ b/build-0.3/cxx/gnu/configure @@ -0,0 +1,98 @@ +#! /usr/bin/env bash + +# file : build/cxx/gnu/configure +# 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 +# + + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter the g++ binary you would like to use, for example 'g++-3.4'," +$echo "'/usr/local/bin/g++' or 'distcc g++'." +$echo + +cxx_gnu=`read_path --command g++` + +# 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= + +if [ "$2" == "y" ]; then + + $echo + $echo "Please select the optimization level you would like to use:" + $echo + $echo "(1) -O1 [Tries to reduce code size and execution time, without" + $echo " performing any optimizations that take a great deal of" + $echo " compilation time.]" + $echo "(2) -O2 [Performs nearly all supported optimizations that do not" + $echo " involve a space-speed tradeoff.]" + $echo "(3) -O3 [Optimize even more.]" + $echo "(4) -Os [Optimize for size.]" + $echo + + optimization=`read_option "-O1 -O2 -O3 -Os" "-O2"` + +fi + +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 new file mode 100644 index 0000000..6611e67 --- /dev/null +++ b/build-0.3/cxx/gnu/cxx-d.make @@ -0,0 +1,58 @@ +# file : build/cxx/gnu/cxx-o.make +# 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)) +$(call include,$(bld_root)/cxx/gnu/configuration.make) + +# Make will try to build dependecies (since they are ultimately included +# files) during configuartion phase without cxx_gnu being discovered yet. +# This is also why dependecies should be included with -include. +# +ifdef cxx_gnu + +$(out_base)/%.o.d: cxx := $(cxx_gnu) +$(out_base)/%.o.d: cpp_options ?= + +#@@ This needs to be shared with cxx-o. +# +#@@ wrong prefix +# +$(out_base)/%.o.d: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o.d: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +.PRECIOUS: $(out_base)/%.o.d + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o.d: $(src_base)/%.$(cxx_s_suffix) +else +$(out_base)/%.o.d: $(src_base)/%.$(cxx_s_suffix) | $$(dir $$@). +endif + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(cxx) $(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/gnu/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o.d: $(out_base)/%.$(cxx_s_suffix) | $$(dir $$@). + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(cxx) $(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/gnu/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +endif + +.PHONY: $(out_base)/%.o.d.$(cxx_s_suffix).clean + +$(out_base)/%.o.d.$(cxx_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) + +endif diff --git a/build-0.3/cxx/gnu/cxx-o.make b/build-0.3/cxx/gnu/cxx-o.make new file mode 100644 index 0000000..0b751ad --- /dev/null +++ b/build-0.3/cxx/gnu/cxx-o.make @@ -0,0 +1,40 @@ +# file : build/cxx/gnu/cxx-o.make +# 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)) +$(call include,$(bld_root)/cxx/gnu/configuration.make) + +$(out_base)/%.o: cxx := $(cxx_gnu) +$(out_base)/%.o: cxx_options := $(cxx_gnu_optimization_options) $(cxx_gnu_debugging_options) + +#@@ wrong prefix +# +$(out_base)/%.o: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) +else +$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) | $$(dir $$@). +endif + $(call message,c++ $<,$(cxx) \ +$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o: $(out_base)/%.$(cxx_s_suffix) | $$(dir $$@). + $(call message,c++ $<,$(cxx) \ +$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<) + +endif + +.PHONY: $(out_base)/%.o.$(cxx_s_suffix).clean + +$(out_base)/%.o.$(cxx_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) diff --git a/build-0.3/cxx/gnu/o-e.make b/build-0.3/cxx/gnu/o-e.make new file mode 100644 index 0000000..c19e177 --- /dev/null +++ b/build-0.3/cxx/gnu/o-e.make @@ -0,0 +1,38 @@ +# file : build/cxx/gnu/o-e.make +# 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) + +#@@ should it be lib%.so? +# +ifneq ($(cxx_extra_lib_paths),) +vpath %.so $(cxx_extra_lib_paths) +vpath %.a $(cxx_extra_lib_paths) +endif + +ifneq ($(cxx_gnu_libraries),) +vpath %.so $(cxx_gnu_libraries) +vpath %.a $(cxx_gnu_libraries) +endif + +$(out_base)/%: ld := $(cxx_gnu) +$(out_base)/%: ld_options := $(cxx_gnu_optimization_options) $(cxx_gnu_debugging_options) $(cxx_ld_extra_options) + +$(out_base)/%: expand-l = $(if $(subst n,,$(cxx_rpath)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(out_base)/%.o +else +$(out_base)/%: $(out_base)/%.o | $$(dir $$@). +endif + $(call message,ld $@,$(ld) \ +$(cxx_extra_options) $(ld_options) $(cxx_ld_extra_options) -o $@ \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_extra_libs)) + +.PHONY: $(out_base)/%.o.clean + +$(out_base)/%.o.clean: + $(call message,rm $(basename $(basename $@)),rm -f $(basename $@) $(basename $(basename $@))) diff --git a/build-0.3/cxx/gnu/o-l.make b/build-0.3/cxx/gnu/o-l.make new file mode 100644 index 0000000..ea3e1d1 --- /dev/null +++ b/build-0.3/cxx/gnu/o-l.make @@ -0,0 +1,93 @@ +# file : build/cxx/gnu/o-l.make +# 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) + +ifneq ($(cxx_extra_lib_paths),) +vpath %.so $(cxx_extra_lib_paths) +vpath %.a $(cxx_extra_lib_paths) +endif + +ifneq ($(cxx_gnu_libraries),) +vpath %.so $(cxx_gnu_libraries) +vpath %.a $(cxx_gnu_libraries) +endif + +ifdef ld_lib_type + +.PHONY: $(out_base)/%.l.o.clean + +ifeq ($(ld_lib_type),archive) + +$(out_base)/%.l: ar := $(ld_lib_ar) +$(out_base)/%.l: ar_options ?= -rc + +$(out_base)/%.l: ranlib := $(ld_lib_ranlib) +$(out_base)/%.l: ranlib_options ?= + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ar $@,$(ar) $(ar_options) $(@D)/lib$(basename $(@F)).a $(filter %.o,$^)) + $(call message,,$(ranlib) $(ranlib_options) $(@D)/lib$(basename $(@F)).a) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) + +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)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(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 \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_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 \ +$(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 diff --git a/build-0.3/cxx/intel/configuration-rules.make b/build-0.3/cxx/intel/configuration-rules.make new file mode 100644 index 0000000..873e08e --- /dev/null +++ b/build-0.3/cxx/intel/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/cxx/intel/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/cxx/intel/configuration-dynamic.make: | $(dcf_root)/cxx/intel/. + $(call message,,$(bld_root)/cxx/intel/configure $@ $(cxx_optimize) \ +"$(cxx_extra_options)" "$(cxx_ld_extra_options)") + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/cxx/intel/configuration-dynamic.make,\ +rm -f $(dcf_root)/cxx/intel/configuration-dynamic.make) + +endif diff --git a/build-0.3/cxx/intel/configuration-static.make b/build-0.3/cxx/intel/configuration-static.make new file mode 100644 index 0000000..1db64f0 --- /dev/null +++ b/build-0.3/cxx/intel/configuration-static.make @@ -0,0 +1,3 @@ +# file : build/cxx/intel/configuration-static.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file diff --git a/build-0.3/cxx/intel/configuration.make b/build-0.3/cxx/intel/configuration.make new file mode 100644 index 0000000..c6e6867 --- /dev/null +++ b/build-0.3/cxx/intel/configuration.make @@ -0,0 +1,33 @@ +# file : build/cxx/intel/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/cxx/intel/configuration-rules.make,$(dcf_root)) + +# Static configuration. +# +$(call include,$(bld_root)/cxx/intel/configuration-static.make) + +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/cxx/intel/configuration-static.make) +endif + +# Dynamic configuration. +# +cxx_intel := +cxx_intel_optimization_options := + +$(call -include,$(dcf_root)/cxx/intel/configuration-dynamic.make) + +ifdef cxx_intel + +cxx_intel_debugging_options := $(if $(findstring y,$(cxx_debug)),-g) + +$(out_root)/%: cxx_intel_debugging_options := $(cxx_intel_debugging_options) +$(out_root)/%: cxx_intel_optimization_options := $(cxx_intel_optimization_options) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/cxx/intel/configure b/build-0.3/cxx/intel/configure new file mode 100755 index 0000000..7f79dd8 --- /dev/null +++ b/build-0.3/cxx/intel/configure @@ -0,0 +1,70 @@ +#! /usr/bin/env bash + +# file : build/cxx/intel/configure +# 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 +# + + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please enter the icc binary you would like to use, for example " +$echo "'/opt/intel_cc_80/bin/icpc'." +$echo + +cxx_intel=`read_path --command icpc` + +# Determine the C++ standard. Intel C++ on GNU/Linux appears to use the +# same option and values as GCC. +# +cxx_intel_standard=`echo "$3" | sed -e 's/.*-std=\([^ ]*\).*/\1/' -e t -e d` + +if [ -z "$cxx_intel_standard" ]; then + cxx_intel_standard="gnu++98" +elif [ "$cxx_intel_standard" = "c++0x" ]; then + cxx_intel_standard="c++11" +elif [ "$cxx_intel_standard" = "gnu++0x" ]; then + cxx_intel_standard="gnu++11" +fi + +# Pass cxx_extra_options and cxx_ld_extra_options since those +# can affect the search paths (e.g., -m32). +# +cxx_intel_libraries=`$cxx_intel $3 $4 -print-search-dirs | sed -e 's/libraries: =//p' -e d` + +# Intel optimizes by default. +# +optimization=-O0 + +if [ "$2" == "y" ]; then + + $echo + $echo "Please select the optimization level you would like to use:" + $echo + $echo "(1) -O1 [Enable optimizations.]" + $echo "(2) -O2 [Same as -O1.]" + $echo "(3) -O3 [As -O2 plus more aggressive optimizations that may not" + $echo " improve performance for all programs.]" + $echo + + optimization=`read_option "-O1 -O2 -O3" "-O2"` +fi + +echo "cxx_intel := $cxx_intel" > $1 +echo "cxx_intel_libraries := $cxx_intel_libraries" >> $1 +echo "cxx_intel_optimization_options := $optimization" >> $1 diff --git a/build-0.3/cxx/intel/cxx-d.make b/build-0.3/cxx/intel/cxx-d.make new file mode 100644 index 0000000..7c4bba2 --- /dev/null +++ b/build-0.3/cxx/intel/cxx-d.make @@ -0,0 +1,58 @@ +# file : build/cxx/intel/cxx-o.make +# 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)) +$(call include,$(bld_root)/cxx/intel/configuration.make) + +# Make will try to build dependecies (since they are ultimately included +# files) during configuartion phase without cxx_intel being discovered yet. +# This is also why dependecies should be included with -include. +# +ifdef cxx_intel + +$(out_base)/%.o.d: cxx := $(cxx_intel) +$(out_base)/%.o.d: cpp_options ?= + +#@@ This needs to be shared with cxx-o. +# +#@@ wrong prefix +# +$(out_base)/%.o.d: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o.d: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +.PRECIOUS: $(out_base)/%.o.d + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o.d: $(src_base)/%.$(cxx_s_suffix) +else +$(out_base)/%.o.d: $(src_base)/%.$(cxx_s_suffix) | $$(dir $$@). +endif + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(cxx) $(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/intel/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o.d: $(out_base)/%.$(cxx_s_suffix) | $$(dir $$@). + $(call message,,if test -f $@; then mv $@ $@.old; fi && \ +$(cxx) $(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_extra_options) -M -MG -MP -MQ $@ -MQ $(basename $@) $< | \ +$(bld_root)/c/intel/dep $(out_base) $(filter %.cpp-options,$^) >$@ && \ +if test -f $@.old; then if cmp -s $@ $@.old; then rm -f $@.old && false; \ +else rm -f $@.old && true; fi fi) + +endif + +.PHONY: $(out_base)/%.o.d.$(cxx_s_suffix).clean + +$(out_base)/%.o.d.$(cxx_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) + +endif diff --git a/build-0.3/cxx/intel/cxx-o.make b/build-0.3/cxx/intel/cxx-o.make new file mode 100644 index 0000000..db34a85 --- /dev/null +++ b/build-0.3/cxx/intel/cxx-o.make @@ -0,0 +1,40 @@ +# file : build/cxx/intel/cxx-o.make +# 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)) +$(call include,$(bld_root)/cxx/intel/configuration.make) + +$(out_base)/%.o: cxx := $(cxx_intel) +$(out_base)/%.o: cxx_options := $(cxx_intel_optimization_options) $(cxx_intel_debugging_options) + +#@@ wrong prefix +# +$(out_base)/%.o: expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(out_base)/%.o: expand-cpp-options = \ +$(call expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) +else +$(out_base)/%.o: $(src_base)/%.$(cxx_s_suffix) | $$(dir $$@). +endif + $(call message,c++ $<,$(cxx) \ +$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%.o: $(out_base)/%.$(cxx_s_suffix) | $$(dir $$@). + $(call message,c++ $<,$(cxx) \ +$(cpp_options) $(call expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(cxx_options) $(cxx_pic_options) $(cxx_extra_options) -o $@ -c $<) + +endif + +.PHONY: $(out_base)/%.o.$(cxx_s_suffix).clean + +$(out_base)/%.o.$(cxx_s_suffix).clean: + $(call message,rm $$1,rm -f $$1,$(basename $(basename $@))) diff --git a/build-0.3/cxx/intel/o-e.make b/build-0.3/cxx/intel/o-e.make new file mode 100644 index 0000000..5c11854 --- /dev/null +++ b/build-0.3/cxx/intel/o-e.make @@ -0,0 +1,38 @@ +# file : build/cxx/intel/o-e.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/intel/configuration.make) + +#@@ should it be lib%.so? +# +ifneq ($(cxx_extra_lib_paths),) +vpath %.so $(cxx_extra_lib_paths) +vpath %.a $(cxx_extra_lib_paths) +endif + +ifneq ($(cxx_intel_libraries),) +vpath %.so $(cxx_intel_libraries) +vpath %.a $(cxx_intel_libraries) +endif + +$(out_base)/%: ld := $(cxx_intel) +$(out_base)/%: ld_options := $(cxx_intel_optimization_options) $(cxx_intel_debugging_options) $(cxx_ld_extra_options) + +$(out_base)/%: expand-l = $(if $(subst n,,$(cxx_rpath)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(out_base)/%.o +else +$(out_base)/%: $(out_base)/%.o | $$(dir $$@). +endif + $(call message,ld $@,$(ld) \ +$(cxx_extra_options) $(ld_options) $(cxx_ld_extra_options) -o $@ \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_extra_libs)) + +.PHONY: $(out_base)/%.o.clean + +$(out_base)/%.o.clean: + $(call message,rm $(basename $(basename $@)),rm -f $(basename $@) $(basename $(basename $@))) diff --git a/build-0.3/cxx/intel/o-l.make b/build-0.3/cxx/intel/o-l.make new file mode 100644 index 0000000..0123687 --- /dev/null +++ b/build-0.3/cxx/intel/o-l.make @@ -0,0 +1,71 @@ +# file : build/cxx/intel/o-l.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/intel/configuration.make) + +ifneq ($(cxx_extra_lib_paths),) +vpath %.so $(cxx_extra_lib_paths) +vpath %.a $(cxx_extra_lib_paths) +endif + +ifneq ($(cxx_intel_libraries),) +vpath %.so $(cxx_intel_libraries) +vpath %.a $(cxx_intel_libraries) +endif + +ifdef ld_lib_type + +.PHONY: $(out_base)/%.l.o.clean + +ifeq ($(ld_lib_type),archive) + +$(out_base)/%.l: ar := $(ld_lib_ar) +$(out_base)/%.l: ar_options ?= -rc + +$(out_base)/%.l: ranlib := $(ld_lib_ranlib) +$(out_base)/%.l: ranlib_options ?= + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(call message,ar $@,$(ar) $(ar_options) $(@D)/lib$(basename $(@F)).a $(filter %.o,$^)) + $(call message,,$(ranlib) $(ranlib_options) $(@D)/lib$(basename $(@F)).a) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) + +else + +$(out_base)/%.l: ld := $(cxx_intel) +$(out_base)/%.l: ld_options := $(cxx_intel_optimization_options) $(cxx_intel_debugging_options) +$(out_base)/%.l: c_pic_options := -fPIC +$(out_base)/%.l: cxx_pic_options := -fPIC +$(out_base)/%.l: comma_ := , + +$(out_base)/%.l: expand-l = $(if $(subst n,,$(cxx_rpath)),\ +$(shell sed -e 's%^rpath:\(.*\)%-Wl,-rpath,\1%' $1),\ +$(shell sed -e 's%^rpath:\(.*\)%%' $1)) + +ifeq ($(out_base),$(src_base)) +$(out_base)/%.l: +else +$(out_base)/%.l: | $$(dir $$@). +endif + $(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 \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(cxx_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 >>$@) + +$(out_base)/%.l.o.clean: + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.so,$(@F)),$(basename $(basename $@))) + +endif +endif diff --git a/build-0.3/cxx/o-e.make b/build-0.3/cxx/o-e.make new file mode 100644 index 0000000..47a7048 --- /dev/null +++ b/build-0.3/cxx/o-e.make @@ -0,0 +1,9 @@ +# file : build/cxx/o-e.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/cxx/configuration.make) + +ifdef cxx_id +$(call include-once,$(bld_root)/cxx/$(cxx_id)/o-e.make,$(out_base)) +endif diff --git a/build-0.3/cxx/o-l.make b/build-0.3/cxx/o-l.make new file mode 100644 index 0000000..999833b --- /dev/null +++ b/build-0.3/cxx/o-l.make @@ -0,0 +1,10 @@ +# file : build/cxx/o-l.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/ld/configuration-lib.make) +$(call include,$(bld_root)/cxx/configuration.make) + +ifdef cxx_id +$(call include-once,$(bld_root)/cxx/$(cxx_id)/o-l.make,$(out_base)) +endif diff --git a/build-0.3/cxx/standard.make b/build-0.3/cxx/standard.make new file mode 100644 index 0000000..64343d2 --- /dev/null +++ b/build-0.3/cxx/standard.make @@ -0,0 +1,35 @@ +# file : build/cxx/standard.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Set the cxx_standard variable to either c++98 or c++11. +# +$(call include,$(bld_root)/cxx/configuration.make) # cxx_id + +cxx_standard := + +ifdef cxx_id + $(call include,$(bld_root)/cxx/$(cxx_id)/configuration.make) # cxx_*_standard + ifeq ($(cxx_id),gnu) + ifdef cxx_gnu + ifneq ($(filter $(cxx_gnu_standard),c++11 gnu++11),) + cxx_standard := c++11 + else + cxx_standard := c++98 + endif + endif + else ifeq ($(cxx_id),intel) + ifdef cxx_intel + ifneq ($(filter $(cxx_intel_standard),c++11 gnu++11),) + cxx_standard := c++11 + else + cxx_standard := c++98 + endif + endif + else ifeq ($(cxx_id),generic) + cxx_standard := c++98 + else + $(error unknown C++ compiler $(cxx_id)) + endif + $(out_root)/%: cxx_standard := $(cxx_standard) +endif diff --git a/build-0.3/dialog.bash b/build-0.3/dialog.bash new file mode 100644 index 0000000..b6f1ed4 --- /dev/null +++ b/build-0.3/dialog.bash @@ -0,0 +1,248 @@ +# file : build/dialog.bash +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# bld_root - build root +# MAKE - GNU make executable +# + +#@@ can't I do exec 1>&2 or something? +# +function echo_error () +{ + echo "$*" 1>&2 +} + +echo=echo_error + +function abspath_old () +{ + local r=`eval echo $1` # for tilde-expansion + + if [ "`echo $r | sed -e 's%^/.*$%%'`" ]; then + + r=`pwd`/$r + fi + + # remove trailing `/' + # + r=`echo $r | sed -e 's%^\(.\+\)/$%\1%'` + + echo $r +} + +# Get rid of jobserver info. See GNU make bug #12229. +# +MAKEFLAGS=`echo $MAKEFLAGS | sed -e 's/--jobserver-fds=[^ ]* *//g'` +MAKEFLAGS=`echo $MAKEFLAGS | sed -e 's/-j *//g'` + + +function abspath () +{ + local r=`eval echo $1` # for tilde-expansion + + $MAKE --no-print-directory -f $bld_root/abspath.make $r +} + +# $1 Default answer ('y' or 'n'). [optional] +# +function read_y_n () +{ + local r + + while [ -z "$r" ]; do + + read -p "[$1]: " r + + if [ -z "$r" ]; then + r=$1 + fi + + case "$r" in + y) ;; + n) ;; + *) r= ;; + esac + done + + echo $r +} + +# $1 Default answer. [optional] +# +function read_value () +{ + local r + + read -e -p "[$1]: " r + + if [ -z "$r" ]; then + r=$1 + fi + + echo $r +} + +# $1 Space-separated list of options. +# $2 Default answer from the list of options. [optional] +# +function read_option () +{ + local d o r i + + if [ "$2" ]; then + + d=1 + + for o in $1; do + + if [ "$o" = "$2" ]; then break; fi + + d=$(($d + 1)) + done + fi + + while [ -z "$r" ]; do + + read -p "[$d]: " r + + if [ -z "$r" ]; then + + r=$d + fi + + i=1 + + for o in $1; do + + if [ "$i" = "$r" ]; then + + echo $o + return 0 + fi + + i=$(($i + 1)) + done + + # User must have entered some junk so let's ask her again. + # + r= + done +} + + +# $1 Default answer. [optional] +# +# --command - path to be read is a command (implies --exist) +# +# --directory - path to be read is a directory +# +# --exist - path to be read should exist +# +# +function read_path () +{ + local command=0 + local directory=0 + local exist=0 + + # Parse options + # + while [ "$1" ]; do + case $1 in + + --command) + + command=1 + exist=1 + shift + ;; + + --directory) + + directory=1 + shift + ;; + + --exist) + + exist=1 + shift + ;; + + *) + + break + ;; + + esac + done + + local r tmp + + while [ -z "$r" ]; do + + read -e -p "[$1]: " r + + if [ -z "$r" ]; then + + r=$1 + fi + + if [ -z "$r" ]; then + + continue + fi + + + if [ $command == 1 ]; then + + # Do tilde expansion. + # + r=`eval echo $r` + + # Extract first word. + # + local cmd=`echo $r | cut -d " " -f 1` + + type -p $cmd 1>/dev/null 2>&1 + + if [ $? != 0 ]; then + + $echo "$r: command not found" + r= + + fi + + continue + fi + + # abspath & checks + # + r=`abspath $r` + + if [ $exist == 1 ]; then + + if [ $directory == 1 ]; then + + if [ ! -d "$r" ]; then + + $echo "$r: no such directory" + r= + continue + fi + + else # something else + + if [ ! -e "$r" ]; then + + $echo "$r: no such file or directory" + r= + continue + fi + fi + fi + done + + echo $r +} diff --git a/build-0.3/dir.make b/build-0.3/dir.make new file mode 100644 index 0000000..ca3eb4c --- /dev/null +++ b/build-0.3/dir.make @@ -0,0 +1,8 @@ +# file : build/dir.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +.PRECIOUS: %/. + +%/. : + $(call message,,mkdir -p $*) diff --git a/build-0.3/dist.make b/build-0.3/dist.make new file mode 100644 index 0000000..b6b745a --- /dev/null +++ b/build-0.3/dist.make @@ -0,0 +1,5 @@ +# file : build/dist.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/dist/functions.make,$(out_base)) diff --git a/build-0.3/dist/functions.make b/build-0.3/dist/functions.make new file mode 100644 index 0000000..009f020 --- /dev/null +++ b/build-0.3/dist/functions.make @@ -0,0 +1,75 @@ +# file : build/dist/functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +dist_cmd := $(bld_root)/install/install + +dist_dir := $(dist_cmd) -d -m 755 +dist_data := $(dist_cmd) -p -m 644 +dist_exec := $(dist_cmd) -p -m 755 + +$(out_root)/%: dist_dir := $(dist_dir) +$(out_root)/%: dist_data := $(dist_data) +$(out_root)/%: dist_exec := $(dist_exec) + +# Arguments: +# +# $1 - files; if not an absolute path, assume relative to src_base +# $2 - optional destination directory. If not specified, +# $(dist_prefix)/<path> is used where path is computed as +# difference between src_base and src_root. +# +$(out_base)/%: dist-data = \ +$(call dist-data-body,$1,$(if $2,$2,$(dist_prefix)$(subst \ +$(src_root),,$(src_base)))) + +$(out_base)/%: dist-exec = \ +$(call dist-exec-body,$1,$(if $2,$2,$(dist_prefix)$(subst \ +$(src_root),,$(src_base)))) + +# Arguments: +# +# $1 - directory +# $2 - optional find predicates +# $3 - optional destination directory. If not specified, +# $(dist_prefix)/<path> is used where path is computed as +# difference between src_base and src_root. +# +$(out_base)/%: dist-dir = \ +$(call dist-dir-body,$1,$2,$(if $3,$3,$(dist_prefix)$(subst \ +$(src_root),,$(src_base)))) + +$(out_base)/%: dist-data-body = \ +$(call message,,$(dist_dir) $2)\ +$(foreach d,$(sort $(dir $(addprefix $2/,$(foreach f,$1,$(if \ +$(filter /%,$f), $(notdir $f), $f))))),$(literal_newline)\ +$(literal_tab)$(call message,,$(dist_dir) $d))\ +$(foreach f,$1,$(literal_newline)\ +$(literal_tab)$(call message,dist $2/$(if $(filter /%,$f),$(notdir \ +$f),$f),$(dist_data) $(if $(filter /%,$f),$f,$(src_base)/$f) $2/$(if \ +$(filter /%,$f),$(notdir $f),$f))) + +$(out_base)/%: dist-exec-body = \ +$(call message,,$(dist_dir) $2)\ +$(foreach d,$(sort $(dir $(addprefix $2/,$(foreach f,$1,$(if \ +$(filter /%,$f), $(notdir $f), $f))))),$(literal_newline)\ +$(literal_tab)$(call message,,$(dist_dir) $d))\ +$(foreach f,$1,$(literal_newline)\ +$(literal_tab)$(call message,dist $2/$(if $(filter /%,$f),$(notdir \ +$f),$f),$(dist_exec) $(if $(filter /%,$f),$f,$(src_base)/$f) $2/$(if \ +$(filter /%,$f),$(notdir $f),$f))) + +$(out_base)/%: dist-dir-body = \ +$(call message,dist $3/$1,find -L $(src_base)/$1 $2 -type f -print \ +| xargs -n 1 $(bld_root)/run-if-arg dirname \ +| sort -u \ +| sed -e 's%$(src_base)/$1\(.*\)%$3/$1\1%' \ +| xargs -n 1 $(bld_root)/run-if-arg "$(dist_dir)")$(literal_newline)\ +$(literal_tab)$(call message,,\ +find -L $(src_base)/$1 $2 -type f ! -perm -100 -print \ +| sed -e 's%$(src_base)/$1\(.*\)%$(src_base)/$1\1 $3/$1\1%' \ +| xargs -n 2 $(bld_root)/run-if-arg "$(dist_data)")$(literal_newline)\ +$(literal_tab)$(call message,,\ +find -L $(src_base)/$1 $2 -type f -perm -100 -print \ +| sed -e 's%$(src_base)/$1\(.*\)%$(src_base)/$1\1 $3/$1\1%' \ +| xargs -n 2 $(bld_root)/run-if-arg "$(dist_exec)") diff --git a/build-0.3/frame.make b/build-0.3/frame.make new file mode 100644 index 0000000..2b16a0a --- /dev/null +++ b/build-0.3/frame.make @@ -0,0 +1,103 @@ +# file : build/frame.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +%frame_exclude% += CURDIR SHELL MAKEFILE_LIST MAKEFLAGS +%frame_include% := #.DEFAULT_GOAL - for some reason it is already in the list + + +# return only vars with 'file' origin +# +%frame_exclude% += frame-vars-stage +define frame-vars-stage +$(foreach v,$1,$(if $(findstring file,$(origin $v)),$v)) +endef + + +# $1 holds exclusion list +# +%frame_exclude% += frame-vars +define frame-vars +$(call frame-vars-stage,$(filter-out \%% $(%frame_exclude%) $1,$(.VARIABLES))) \ +$(filter-out $1,$(%frame_include%)) +endef + + +%frame% := frame% + + +%frame_exclude% += frame-set-recursive +define frame-set-recursive +define $1 +$2 +endef +endef + +%frame_exclude% += frame-undefine +ifneq ($(filter undefine,$(.FEATURES)),) +define frame-undefine +$(eval undefine $$1) +endef +define frame-undefine-imm +$(eval undefine $1) +endef +else +define frame-undefine +$(eval $$1 :=) +endef +define frame-undefine-imm +$(eval $1 :=) +endef +endif + +%frame_exclude% += frame-save +define frame-save +$(eval $(if $(filter simple,$(flavor $1)),\ +%$1/$(%frame%) := $(value $1),\ +$(call frame-set-recursive,%$1/$(%frame%),$(value $1)))) +endef + +%frame_exclude% += frame-restore +define frame-restore +$(eval $(if $(filter simple,$(flavor %$1/$(%frame%))),\ +$1 := $(value %$1/$(%frame%)),\ +$(call frame-set-recursive,$1,$(value %$1/$(%frame%)))))\ +$(call frame-undefine-imm,%$1/$(%frame%)) +endef + +# Use debug messages to check for garbage being framed. +# + +#$$(warning framing $$(value %vars_$(%frame%))) + +%frame_exclude% += frame-enter-body +define frame-enter-body +%vars_$(%frame%) := $(call frame-vars,$1) +%excl_$(%frame%) := $1 +$$(foreach v,$$(value %vars_$(%frame%)),$$(call frame-save,$$v)) +%frame% := frame/$(%frame%) +endef + +%frame_exclude% += frame-enter +define frame-enter +$(eval $(call frame-enter-body,$1)) +endef + + +#$$(warning restoring $$(value %vars_$$(%frame%))) + +%frame_exclude% += frame-leave-body +define frame-leave-body +%frame% := $(patsubst frame/%,%,$(%frame%)) +$$(foreach v,$$(value %vars_$$(%frame%)),$$(call frame-restore,$$v)) +$$(foreach v,\ +$$(filter-out $$(value %vars_$$(%frame%)),$$(call frame-vars,$$(value %excl_$$(%frame%)))),\ +$$(call frame-undefine,$$v)) +$$(call frame-undefine,%vars_$$(%frame%)) +$$(call frame-undefine,%excl_$$(%frame%)) +endef + +%frame_exclude% += frame-leave +define frame-leave +$(eval $(call frame-leave-body)) +endef diff --git a/build-0.3/generator b/build-0.3/generator new file mode 100644 index 0000000..6ab29f2 --- /dev/null +++ b/build-0.3/generator @@ -0,0 +1,90 @@ +# file : build/generator +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# This makefile is an optional, transparent generator of "thunk" makefiles +# for the build setups with separate src and out directories. Without the +# generator, the make invocation for this setup has the following general +# form: +# +# make -C out_root/subdir -f src_root/subdir/makefile +# +# With the generator enabled, the same can be achieved with the following +# shorter command: +# +# make -C out_root/subdir +# +# Or, if the subdir directory may not yet exist, with this variant: +# +# make -C out_root dir=subdir +# +# To enable the generator, you will need to instruct make to pre-load it +# for every invocation by adding it to the MAKEFILES environment variable: +# +# export MAKEFILES=build-X.Y/generator +# +# The thunk makefiles for individual sub-directories are generated as +# needed and are automatically removed by the disfigure target. +# + +ifdef dir + +.PHONY: _all +_all: + @mkdir -p $(dir) + @$(MAKE) -C $(dir) dir= $(MAKECMDGOALS) + +ifneq ($(MAKECMDGOALS),) +.PHONY: $(MAKECMDGOALS) +$(MAKECMDGOALS): _all +else +.DEFAULT_GOAL := _all +endif + +else +ifeq ($(wildcard makefile Makefile GNUmakefile),) + +define literal_newline + + +endef + +makefile: empty := +makefile: space := $(empty) # +makefile: tab := $(empty) $(empty) +makefile: newline := $(literal_newline) + + +# Find the src_root directory. +# +# $1 - current directory +# +makefile: find = \ +$(if $1,$(if $(wildcard $1/build/bootstrap-dynamic.make),$1,$(call \ +find,$(patsubst %/,%,$(dir $1))))) + +# Convert /foo/bar to ../../. +# +# $1 - relative path from $(CURDIR) +# +makefile: path = $(subst $(space),,$(foreach d,$(subst /, ,$1/),../)) + +# $1 - relative path from $(CURDIR) +# +makefile: command_body = \ +@echo '\# Automatically generated by build.' >$@$(newline)\ +$(tab)@echo 'ifndef dir' >>$@$(newline)\ +$(tab)@echo 'override dir :=' >>$@$(newline)\ +$(tab)@echo 'include $(if $1,$(call path,$1))build/bootstrap-dynamic.make' >>$@$(newline)\ +$(tab)@echo 'include $$(src_root)$1/makefile' >>$@$(newline)\ +$(tab)@echo 'endif' >>$@ + +# $1 - output root directory or empty if none were found +# +makefile: command = $(if $1,$(call command_body,$(subst $1,,$(CURDIR)))) + +makefile: + $(call command,$(call find,$(CURDIR))) + +endif # makefile +endif # dir diff --git a/build-0.3/git/gitignore b/build-0.3/git/gitignore new file mode 100755 index 0000000..6663e51 --- /dev/null +++ b/build-0.3/git/gitignore @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +# file : build/git/gitignore +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +echo '# Generated .gitignore file; do not edit or version control.' +echo '#' + +for f in "$@"; do +echo $f +done diff --git a/build-0.3/git/gitignore.make b/build-0.3/git/gitignore.make new file mode 100644 index 0000000..931d2cd --- /dev/null +++ b/build-0.3/git/gitignore.make @@ -0,0 +1,10 @@ +# file : build/git/gitignore.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(out_base)/.gitignore: + @$(bld_root)/git/gitignore $(files) >$@ + +.PHONY: $(out_base)/.gitignore.clean +$(out_base)/.gitignore.clean: + @rm -f $(basename $@) diff --git a/build-0.3/import.make b/build-0.3/import.make new file mode 100644 index 0000000..82a6763 --- /dev/null +++ b/build-0.3/import.make @@ -0,0 +1,74 @@ +# file : build/import.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + + +# This cannot be eliminated. +# +%frame_exclude% += import-set-value +define import-set-value +$(eval $$1 := $$2) +endef + +%frame_exclude% += exported-names +define exported-names +$(foreach i,1 2 3 4 5 6 7,$(if $(value $i),$(lastword $(value $i)))) +endef + +%frame_exclude% += import-names +define import-names +$(foreach i,1 2 3 4 5 6 7,$(if $(lastword $(value $i)),\ +$(call import-set-value,$(lastword $(value $i)),$(value $(firstword $(value $i)))))) +endef + +%frame_exclude% += import-body +define import-body +$(call frame-enter,$(call exported-names,$2,$3,$4,$5,$6,$7,$8)) + +$(call include,$1) + +$(call import-names,$2,$3,$4,$5,$6,$7,$8) + +$(call frame-leave) +endef + + +# Simple case where there are no names imported. Also note that we use +# include-once here since there is no reason to do it more than once. +# We key it onto out_root to make sure we don't process the same makefile +# more than once since that's what export stubs do. +# +%frame_exclude% += import-body-simple +define import-body-simple +$(call frame-enter) + +$(call include-once,$1,$(out_root)) + +$(call frame-leave) +endef + + +# +# +%frame_exclude% += import +define import +$(eval $(if $(strip $2),\ +$(call import-body,$1,$2,$3,$4,$5,$6,$7,$8),\ +$(call import-body-simple,$1))) +endef + + +# +# export +# +%frame_exclude% += export-names +define export-names +$(foreach i,1 2 3 4 5 6 7,$(if $(value $i),\ +$(call import-set-value,$(firstword $(value $i)),$(wordlist 2,$(words $(value $i)),$(value $i))))) +endef + + +%frame_exclude% += export +define export +$(call export-names,$1,$2,$3,$4,$5,$6,$7) +endef diff --git a/build-0.3/install.make b/build-0.3/install.make new file mode 100644 index 0000000..c774788 --- /dev/null +++ b/build-0.3/install.make @@ -0,0 +1,6 @@ +# file : build/install.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include,$(bld_root)/install/configuration.make) +$(call include-once,$(bld_root)/install/install-functions.make,$(out_base)) diff --git a/build-0.3/install/configuration.make b/build-0.3/install/configuration.make new file mode 100644 index 0000000..d7ece48 --- /dev/null +++ b/build-0.3/install/configuration.make @@ -0,0 +1,45 @@ +# file : build/install/configuration.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +install_prefix := /usr/local +install_data_prefix := $(install_prefix) +install_exec_prefix := $(install_prefix) + +install_bin_dir := $(install_exec_prefix)/bin +install_sbin_dir := $(install_exec_prefix)/sbin +install_lib_dir := $(install_exec_prefix)/lib + +install_data_dir := $(install_data_prefix)/share +install_inc_dir := $(install_data_prefix)/include + +install_doc_dir := $(install_data_dir)/doc +install_man_dir := $(install_data_dir)/man +install_info_dir := $(install_data_dir)/info + +$(out_root)/%: install_bin_dir := $(install_bin_dir) +$(out_root)/%: install_sbin_dir := $(install_sbin_dir) +$(out_root)/%: install_lib_dir := $(install_lib_dir) + +$(out_root)/%: install_inc_dir := $(install_inc_dir) +$(out_root)/%: install_data_dir := $(install_data_dir) + +$(out_root)/%: install_doc_dir := $(install_doc_dir) +$(out_root)/%: install_man_dir := $(install_man_dir) +$(out_root)/%: install_info_dir := $(install_info_dir) + +install_cmd := $(bld_root)/install/install + +install_dir := $(install_cmd) -d -m 755 +install_data := $(install_cmd) -p -m 644 +install_exec := $(install_cmd) -p -m 755 + +$(out_root)/%: install_dir := $(install_dir) +$(out_root)/%: install_data := $(install_data) +$(out_root)/%: install_exec := $(install_exec) + + +#@@ Installation process is very os-dependant. For example +# on BSD there is libexec but there is no such thing on +# GNU/Linux. +# diff --git a/build-0.3/install/install b/build-0.3/install/install new file mode 100755 index 0000000..40fe037 --- /dev/null +++ b/build-0.3/install/install @@ -0,0 +1,21 @@ +#! /usr/bin/env bash + +# file : build/install/install +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Run native install command if available and install-sh otherwise. +# Also strip the -p argument (should be first) if calling install-sh +# which doesn't support it. +# + +type install >/dev/null 2>&1 + +if [ $? -eq 0 ]; then + exec install $* +else + if [ "$1" = "-p" ]; then + shift + fi + exec `dirname $0`/install-sh $* +fi diff --git a/build-0.3/install/install-functions.make b/build-0.3/install/install-functions.make new file mode 100644 index 0000000..22f69a7 --- /dev/null +++ b/build-0.3/install/install-functions.make @@ -0,0 +1,37 @@ +# file : build/install/install-functions.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +#@@ could just call it functions.make +# + +$(out_base)/%: install-exec = \ +$(call message,,$(install_dir) $(dir $2))$(literal_newline)\ +$(literal_tab)$(call message,install $2,$(install_exec) $1 $2) + + +$(out_base)/%: install-lib = \ +$(call message,install $2,$(install_dir) $(dir $2))$(literal_newline)\ +$(literal_tab)$(call message,,$(value $(if $(patsubst %.so,,$(shell\ + sed -e '1q' <$1)),install_data,install_exec)) $(shell sed -e '1q' <$1) $2) + + +$(out_base)/%: install-data = \ +$(call message,install $2,$(install_dir) $(dir $2))$(literal_newline)\ +$(literal_tab)$(call message,,$(install_data) $1 $2) + + +$(out_base)/%: install-dir = \ +$(call message,install $2/,find -L $1 $3 -type f -print \ +| xargs -n 1 $(bld_root)/run-if-arg dirname \ +| sort -u \ +| sed -e 's%$1\(.*\)%$2/\1%' \ +| xargs -n 1 $(bld_root)/run-if-arg "$(install_dir)")$(literal_newline)\ +$(literal_tab)$(call message,,\ +find -L $1 $3 -type f ! -perm -100 -print \ +| sed -e 's%$1\(.*\)%$1/\1 $2/\1%' \ +| xargs -n 2 $(bld_root)/run-if-arg "$(install_data)")$(literal_newline)\ +$(literal_tab)$(call message,,\ +find -L $1 $3 -type f -perm -100 -print \ +| sed -e 's%$1\(.*\)%$1/\1 $2/\1%' \ +| xargs -n 2 $(bld_root)/run-if-arg "$(install_exec)") diff --git a/build-0.3/install/install-sh b/build-0.3/install/install-sh new file mode 100755 index 0000000..a5897de --- /dev/null +++ b/build-0.3/install/install-sh @@ -0,0 +1,519 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/build-0.3/ld/configuration-lib-rules.make b/build-0.3/ld/configuration-lib-rules.make new file mode 100644 index 0000000..0c1a8e9 --- /dev/null +++ b/build-0.3/ld/configuration-lib-rules.make @@ -0,0 +1,15 @@ +# file : build/ld/configuration-lib-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/ld/configuration-lib-dynamic.make: | $(dcf_root)/ld/. + $(call message,,$(bld_root)/ld/configure-lib $@) + + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/ld/configuration-lib-dynamic.make,\ +rm -f $(dcf_root)/ld/configuration-lib-dynamic.make) + +endif diff --git a/build-0.3/ld/configuration-lib-static.make b/build-0.3/ld/configuration-lib-static.make new file mode 100644 index 0000000..60eebd5 --- /dev/null +++ b/build-0.3/ld/configuration-lib-static.make @@ -0,0 +1,9 @@ +# file : build/ld/configuration-lib-static.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +#@@ Need to use these variables where I hardcoded those values. +# +ld_lib_prefix := lib +ld_lib_archive_suffix := .a +ld_lib_shared_suffix := .so diff --git a/build-0.3/ld/configuration-lib.make b/build-0.3/ld/configuration-lib.make new file mode 100644 index 0000000..5395d64 --- /dev/null +++ b/build-0.3/ld/configuration-lib.make @@ -0,0 +1,41 @@ +# file : build/ld/configuration-lib.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/ld/configuration-lib-rules.make,$(dcf_root)) + +# Static configuration. +# +$(call include,$(bld_root)/ld/configuration-lib-static.make) + +ifneq ($(bld_root),$(scf_root)) +$(call -include,$(scf_root)/ld/configuration-lib-static.make) +endif + +# Dynamic configuration. +# +ld_lib_type := + +$(call -include,$(dcf_root)/ld/configuration-lib-dynamic.make) + +ifdef ld_lib_type + +ifeq ($(ld_lib_type),archive) + +ld_lib_suffix := $(ld_lib_archive_suffix) + +else + +ld_lib_suffix := $(ld_lib_shared_suffix) + +endif + +$(out_root)/%: ld_lib_type := $(ld_lib_type) +$(out_root)/%: ld_lib_prefix := $(ld_lib_prefix) +$(out_root)/%: ld_lib_suffix := $(ld_lib_suffix) + +else + +.NOTPARALLEL: + +endif diff --git a/build-0.3/ld/configure-lib b/build-0.3/ld/configure-lib new file mode 100755 index 0000000..5243357 --- /dev/null +++ b/build-0.3/ld/configure-lib @@ -0,0 +1,50 @@ +#! /usr/bin/env bash + +# file : build/ld/configure-lib +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please select the default library type:" +$echo +$echo "(1) archive" +$echo "(2) shared object" +$echo + +type=`read_option "archive shared" "shared"` + +if [ "$type" == "archive" ]; then + + $echo + $echo "Please enter the archiver (ar) binary you would like to use." + $echo + + ar=`read_path --command ar` + + $echo + $echo "Please enter the indexer (ranlib) binary you would like to use." + $echo + + ranlib=`read_path --command ranlib` +fi + +echo "ld_lib_type := $type" > $1 + +if [ "$type" == "archive" ]; then + echo "ld_lib_ar := $ar" >> $1 + echo "ld_lib_ranlib := $ranlib" >> $1 +fi diff --git a/build-0.3/literals.make b/build-0.3/literals.make new file mode 100644 index 0000000..2ae8cf7 --- /dev/null +++ b/build-0.3/literals.make @@ -0,0 +1,13 @@ +# file : build/literals.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +literal_empty := + +define literal_newline + + +endef + +literal_tab := $(literal_empty) $(literal_empty) +literal_percent := % diff --git a/build-0.3/m4/m4.make b/build-0.3/m4/m4.make new file mode 100644 index 0000000..ef5726b --- /dev/null +++ b/build-0.3/m4/m4.make @@ -0,0 +1,50 @@ +# file : build/m4/m4.make +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(out_base)/%: m4 := m4 +$(out_base)/%: m4_options += + +ifeq ($(out_base),$(src_base)) +$(out_base)/%: $(src_base)/%.m4 +else +$(out_base)/%: $(src_base)/%.m4 | $$(dir $$@). +endif + $(call message,m4 $<,$(m4) $(m4_options) $< >$@) + +ifneq ($(out_base),$(src_base)) + +$(out_base)/%: $(out_base)/%.m4 | $$(dir $$@). + $(call message,m4 $<,$(m4) $(m4_options) $< >$@) + +endif + + +# @@ +# This is where things start breaking. Following standard logic I should +# make a $(out_base)/%.clean rule, i.e., "will clean anything" rule. If +# this rule happened to be before some other, more specialized rule, and +# that rule happened to rm some additional stuff (like %.o tries to rm +# .d file, which is also not quite correct...). In other word there +# doesn't seem to be a way to properly match "build" and "clean" rules. +# One idea is to make the "clean" rule depend on what "build" rule +# depends (%.m4 in our case) hoping that this way the rule won't match. +# +# There are two problems with this approach: +# +# 1. It is if not iff. However, since the rules come in pairs and make +# pick the first implicit rule that matches, it is certain that if +# make picked this "clean" rule it also picked corresponding "build" +# rule. +# +# 2. The prerequisite (%.m4) can be an intermidiate file which itself +# may not exist. We don't want make to build it just to clean it +# or, even worse, to leave it laying around. I guess the only way +# to work around this is to provide special do-nothing rules during +# cleanup. +# +# +.PHONY: $(out_base)/%.m4.clean + +$(out_base)/%.m4.clean: + $(call message,rm $(@:.m4.clean=),rm -f $(@:.m4.clean=)) diff --git a/build-0.3/message.make b/build-0.3/message.make new file mode 100644 index 0000000..d7d47c4 --- /dev/null +++ b/build-0.3/message.make @@ -0,0 +1,31 @@ +# file : build/message.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +%frame_exclude% += build-message-expand-body +define build-message-expand-body +$(eval _1 = $1)$(call _1,$2,$3,$4,$5,$6,$7,$8,$9) +endef + +%frame_exclude% += build-message-expand +define build-message-expand +$(call build-message-expand-body,$(subst #,\#,$1),$2,$3,$4,$5,$6,$7,$8,$9) +endef + +%frame_exclude% += message + +ifdef verbose + +define message +$(call build-message-expand,$2,$3,$4,$5,$6,$7,$8,$9) +endef + +else + +define message +$(if $1,@echo $(call build-message-expand,$1,$3,$4,$5,$6,$7,$8,$9) && \ + $(call build-message-expand,$2,$3,$4,$5,$6,$7,$8,$9),\ + @$(call build-message-expand,$2,$3,$4,$5,$6,$7,$8,$9)) +endef + +endif diff --git a/build-0.3/meta/autoconf b/build-0.3/meta/autoconf new file mode 100755 index 0000000..2eb542f --- /dev/null +++ b/build-0.3/meta/autoconf @@ -0,0 +1,84 @@ +#! /usr/bin/env bash + +# file : build/meta/autoconf +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process autconf configure.ac templates. +# +# Options: +# +# -b <base-dir> +# -o <output-file> +# +# Arguments: +# +# <template-file> +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +base= +output= + +while [ $# -gt 0 ]; do + case $1 in + -b) + base=$2 + shift 2 + ;; + -o) + output=$2 + shift 2 + ;; + *) + break + ;; + esac +done + +input=$1 + +if [ "$input" = "" ]; then + error "no input file" + exit 1 +fi + +if [ "$base" = "" ]; then + error "no base directory" + exit 1 +fi + +if [ "$output" = "" ]; then + error "no output file" + exit 1 +fi + +m4=m4 + +# Assume this script is never found via PATH. +# +meta=`dirname $0` + +build="$meta/.." +install=$build/install/install + +# Find all the configuration files. +# +files=`find $base -name 'Makefile.am' -o -name '*.in' -a ! -name '*.h.in' | \ +sed -e "s%^$base/%%" | \ +sed -e 's%\.\(am\|in\)$%%' | \ +sort -u` + +export config_files=$files + +# Make sure the output directory exist. +# +$install -d -m 755 `dirname $output` + +$m4 -P -D__meta_base__=$meta $meta/autoconf.m4 $input >$output +chmod 644 $output diff --git a/build-0.3/meta/autoconf-functions.make b/build-0.3/meta/autoconf-functions.make new file mode 100644 index 0000000..a2a1d76 --- /dev/null +++ b/build-0.3/meta/autoconf-functions.make @@ -0,0 +1,23 @@ +# file : build/meta/autoconf-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process autoconf template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - optional template path, if doesn't start with /, assume relative +# to src_base default is $(src_base)/configure.ac +# +$(out_base)/%: meta-autoconf = \ +$(call meta-autoconf-body,$(if $1,$(if $(filter \ +/%,$1),$1,$(src_base)/$1),$(src_base)/configure.ac),$(subst \ +$(src_root),,$(src_base))) + +# $1 - template +# $2 - difference between src_base and src_root with leading '\' +# +$(out_base)/%: meta-autoconf-body = \ +$(call message,meta $(dist_prefix)$2/$(notdir $1),$(bld_root)/meta/autoconf \ +-b $(dist_prefix)$2 -o $(dist_prefix)$2/$(notdir $1) $1) diff --git a/build-0.3/meta/autoconf.m4 b/build-0.3/meta/autoconf.m4 new file mode 100644 index 0000000..8ca5b93 --- /dev/null +++ b/build-0.3/meta/autoconf.m4 @@ -0,0 +1,21 @@ +m4_divert(-1) +# file : build/meta/autoconf.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_changequote([, ]) + +m4_include(__meta_base__[/common.m4]) + +m4_define([__path_impl__], [__env_impl__([$1])]) +m4_define([__path__], [m4_equote()__path_impl__([$1])[]m4_dquote()]) + +m4_define([__file_impl__], [__env_impl__([$1])]) +m4_define([__file__], [m4_equote()__file_impl__([$1])[]m4_dquote()]) + +# Disable comments and quoting. +# +m4_changecom([]) +m4_changequote([]) + +m4_divert(0)m4_dnl diff --git a/build-0.3/meta/autoconf.make b/build-0.3/meta/autoconf.make new file mode 100644 index 0000000..984ed35 --- /dev/null +++ b/build-0.3/meta/autoconf.make @@ -0,0 +1,5 @@ +# file : build/meta/autoconf.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/autoconf-functions.make,$(out_base)) diff --git a/build-0.3/meta/automake b/build-0.3/meta/automake new file mode 100755 index 0000000..ede1958 --- /dev/null +++ b/build-0.3/meta/automake @@ -0,0 +1,64 @@ +#! /usr/bin/env bash + +# file : build/meta/automake +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process automake Makefile.am templates. +# +# Options: +# +# -o <output-file> +# +# Arguments: +# +# <template-file> +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +output= + +while [ $# -gt 0 ]; do + case $1 in + -o) + output=$2 + shift 2 + ;; + *) + break + ;; + esac +done + +input=$1 + +if [ "$input" = "" ]; then + error "no input file" + exit 1 +fi + +if [ "$output" = "" ]; then + error "no output file" + exit 1 +fi + +m4=m4 + +# Assume this script is never found via PATH. +# +meta=`dirname $0` + +build="$meta/.." +install=$build/install/install + +# Make sure the output directory exist. +# +$install -d -m 755 `dirname $output` + +$m4 -P -D__meta_base__=$meta $meta/automake.m4 $input >$output +chmod 644 $output diff --git a/build-0.3/meta/automake-functions.make b/build-0.3/meta/automake-functions.make new file mode 100644 index 0000000..2f49237 --- /dev/null +++ b/build-0.3/meta/automake-functions.make @@ -0,0 +1,23 @@ +# file : build/meta/automake-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process automake template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - optional template path, if doesn't start with /, assume relative +# to src_base default is $(src_base)/Makefile.am +# +$(out_base)/%: meta-automake = \ +$(call meta-automake-body,$(if $1,$(if $(filter \ +/%,$1),$1,$(src_base)/$1),$(src_base)/Makefile.am),$(subst \ +$(src_root),,$(src_base))) + +# $1 - template +# $2 - difference between src_base and src_root with leading '\' +# +$(out_base)/%: meta-automake-body = \ +$(call message,meta $(dist_prefix)$2/$(notdir $1),$(bld_root)/meta/automake \ +-o $(dist_prefix)$2/$(notdir $1) $1) diff --git a/build-0.3/meta/automake.m4 b/build-0.3/meta/automake.m4 new file mode 100644 index 0000000..56aa319 --- /dev/null +++ b/build-0.3/meta/automake.m4 @@ -0,0 +1,21 @@ +m4_divert(-1) +# file : build/meta/automake.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_changequote([, ]) + +m4_include(__meta_base__[/common.m4]) + +m4_define([__path_impl__], [__env_impl__([$1])]) +m4_define([__path__], [m4_equote()__path_impl__([$1])[]m4_dquote()]) + +m4_define([__file_impl__], [__env_impl__([$1])]) +m4_define([__file__], [m4_equote()__file_impl__([$1])[]m4_dquote()]) + +# Disable comments and quoting. +# +m4_changecom([]) +m4_changequote([]) + +m4_divert(0)m4_dnl diff --git a/build-0.3/meta/automake.make b/build-0.3/meta/automake.make new file mode 100644 index 0000000..67ae4ac --- /dev/null +++ b/build-0.3/meta/automake.make @@ -0,0 +1,5 @@ +# file : build/meta/automake.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/automake-functions.make,$(out_base)) diff --git a/build-0.3/meta/common.m4 b/build-0.3/meta/common.m4 new file mode 100644 index 0000000..685a74a --- /dev/null +++ b/build-0.3/meta/common.m4 @@ -0,0 +1,113 @@ +# file : build/meta/common.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# m4_strip(STRING) +# ---------------- +# Expands into STRING with tabs and spaces singled out into a single +# space, and removing leading and trailing spaces. +# +m4_define([m4_strip], +[m4_patsubst(m4_patsubst([ $1 ], [[ ]+], [ ]), [^ \(.*\) $], [[[\1]]])]) + + +# m4_normalize(STRING) +# -------------------- +# Apply m4_strip to STRING. +# +m4_define([m4_normalize], [m4_strip([$1])]) + +# m4_split(STRING, [REGEXP]) +# -------------------------- +# Split STRING into an m4 list of quoted elements. The elements are +# quoted with ] and ]. Beginning spaces and end spaces *are kept*. +# Use m4_strip to remove them. +# +# REGEXP specifies where to split. Default is [\t ]+. +# +# If STRING is empty, the result is an empty list. +# + +m4_define([m4_split], +[m4_ifelse([$1], [], [], + [$2], [ ], [m4_ifelse(m4_index([$1], [ ]), [-1], [[$1]], + [_$0([$1], [$2], [, ])])], + [$2], [], [_$0([$1], [[ ]+], [, ])], + [_$0([$1], [$2], [, ])])]) + +m4_define([_m4_split], [m4_patsubst([$1], [$2], [$3])]) + + +# Simple foreach implementation. The list elements are expected to +# be fully expanded. +# +m4_define([m4_foreach], [m4_ifelse([$2], [], [], + [m4_pushdef([$1])_$0([$1], [$3], [], $2)m4_popdef([$1])])]) +m4_define([_m4_foreach], [m4_ifelse([$#], [3], [], + [m4_define([$1], [$4])$2[]$0([$1], [$2], + m4_shift(m4_shift(m4_shift($@))))])]) + +# m4_foreach_w(VARIABLE, LIST, EXPRESSION) +# ---------------------------------------- +# Like m4_foreach, but the list is whitespace separated. +# +m4_define([m4_foreach_w], +[m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])]) + +# m4_strip_nl(STRING) +# ---------------------------------------- +# Remove newlines +# +m4_define([m4_strip_nl], [m4_patsubst([$1], [ +], [])]) + +# Enable/disable quoting. +# +m4_define([m4_equote], [m4_changequote([,])]) +m4_define([m4_dquote], [m4_changequote([])]) + +# +# +m4_define([__ifelse__], + [m4_equote()m4_ifelse( + [$1], + [$2], + [m4_dquote()$3m4_equote()], + [m4_dquote()$4m4_equote()])[]m4_dquote()]) + +m4_define([__foreach__], + [m4_equote()m4_foreach( + [$1],[$2],[m4_dquote()$3m4_equote()])[]m4_dquote()]) + +m4_define([__foreach_w__], + [m4_equote()m4_foreach_w( + $1,$2,[m4_dquote()$3m4_equote()])[]m4_dquote()]) + +# +# +m4_define([__env_impl__], [m4_esyscmd([/bin/echo -n $$1])]) +m4_define([__env__], [m4_equote()__env_impl__([$1])[]m4_dquote()]) + +m4_define([__value_impl__], [__env_impl__([$1])]) +m4_define([__value__], [m4_equote()__value_impl__([$1])[]m4_dquote()]) + +m4_define([__uuid_impl__], + [m4_translit(m4_strip_nl(m4_esyscmd([uuidgen])), [a-z], [A-Z])]) +m4_define([__uuid__], [m4_equote()__uuid_impl__([$1])[]m4_dquote()]) + +m4_define([__upcase_impl__], [m4_translit([$1], [a-z], [A-Z])]) +m4_define([__upcase__], [m4_equote()__upcase_impl__([$1])[]m4_dquote()]) + +m4_define([__xml_impl__], +[m4_patsubst( + m4_patsubst( + m4_patsubst( + [$1], + [&], + [&]), + [<], + [<]), + ["], + ["])]) + +m4_define([__xml__], [m4_equote()__xml_impl__([$1])[]m4_dquote()]) diff --git a/build-0.3/meta/vc10proj b/build-0.3/meta/vc10proj new file mode 100755 index 0000000..cd6b5b3 --- /dev/null +++ b/build-0.3/meta/vc10proj @@ -0,0 +1,79 @@ +#! /usr/bin/env bash + +# file : build/meta/vc10proj +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ 10 project file templates. +# +# Options: +# +# -o <output-file> +# +# Arguments: +# +# <template-file> +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +output= + +while [ $# -gt 0 ]; do + case $1 in + -o) + output=$2 + shift 2 + ;; + *) + break + ;; + esac +done + +input=$1 + +if [ "$input" = "" ]; then + error "no input file" + exit 1 +fi + +if [ "$output" = "" ]; then + error "no output file" + exit 1 +fi + +m4=m4 +u2d=todos + +# Assume this script is never found via PATH. +# +meta=`dirname $0` + +build="$meta/.." +install=$build/install/install + + +# Determine available configurations. +# +conf=`sed -n -e \ +'s/^[ ]*<ProjectConfiguration Include="\([^"]*\)">$/"\1",/p;d' $input` +conf=`echo $conf | sed -e 's/,$//'` + +export configurations=$conf + +# Make sure the output directory exist. +# +$install -d -m 755 `dirname $output` + +$m4 -P -D__meta_base__=$meta $meta/vc10proj.m4 $input >$output +$u2d $output +chmod 644 $output + +$m4 -P -D__meta_base__=$meta $meta/vc10proj.m4 $input.filters >$output.filters +$u2d $output.filters +chmod 644 $output.filters diff --git a/build-0.3/meta/vc10proj-functions.make b/build-0.3/meta/vc10proj-functions.make new file mode 100644 index 0000000..8625182 --- /dev/null +++ b/build-0.3/meta/vc10proj-functions.make @@ -0,0 +1,27 @@ +# file : build/meta/vc10proj-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ project file template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3-8 - optional pairs of additional varibales and values $3=$4, $5=$6, etc +# +# +$(out_base)/%: meta-vc10proj = \ +$(call meta-vc10proj-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst $(src_root),,$(src_base)),$3,$4,$5,$6,$7,$8) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4-9 - additional varibales +# +$(out_base)/%: meta-vc10proj-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $4,$4='$5'; export $4; )$(if \ +$6,$6='$7'; export $6; )$(if $8,$8='$9'; export $8; )$(bld_root)/meta/vc10proj \ +-o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc10proj.m4 b/build-0.3/meta/vc10proj.m4 new file mode 100644 index 0000000..b151f78 --- /dev/null +++ b/build-0.3/meta/vc10proj.m4 @@ -0,0 +1,127 @@ +m4_divert(-1) +# file : build/meta/vc10proj.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_changequote([, ]) + +m4_include(__meta_base__[/common.m4]) +m4_include(__meta_base__[/windows-common.m4]) + +# header +# +m4_define([__header_entry_impl__], +[ <ClInclude Include="[$1]" />]) + +m4_define([__header_entry__], +[m4_equote()__header_entry_impl__([$1])[]m4_dquote()]) + + +m4_define([__header_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [ +__header_entry_impl__(__f)])]) + +m4_define([__header_entries__], +[m4_equote()__header_entries_impl__([$1])[]m4_dquote()]) + +# header_filter +# +m4_define([__header_filter_entry_impl__], +[ <ClInclude Include="[$1]"> + <Filter>Header Files</Filter> + </ClInclude>]) + +m4_define([__header_filter_entry__], +[m4_equote()__header_filter_entry_impl__([$1])[]m4_dquote()]) + + +m4_define([__header_filter_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [ +__header_filter_entry_impl__(__f)])]) + +m4_define([__header_filter_entries__], +[m4_equote()__header_filter_entries_impl__([$1])[]m4_dquote()]) + +# source +# + +# $1 - configuration +# $2 - directory +# +m4_define([__source_config_entry_impl__], +[ <ObjectFileName m4_dnl +Condition="'$(Configuration)|$(Platform)'==m4_dnl +'[]m4_patsubst([$1], ["], [])'">m4_dnl +$(IntDir)\[$2]\</ObjectFileName>]) + +m4_define([__source_entry_body__], +[m4_ifelse([$1], [$2], +[ <ClCompile Include="[$1]" />], +[ <ClCompile Include="[$1]">m4_dnl +m4_foreach([__c], +[__value_impl__([configurations])], +[ +__source_config_entry_impl__(__c, [$2])]) + </ClCompile>])]) + +m4_define([__source_entry_impl__], +[__source_entry_body__([$1], +m4_patsubst([$1], [^\(.*\)\\\(.*\)$], [\1]))]) + +m4_define([__source_entry__], +[m4_equote()__source_entry_impl__([$1])[]m4_dquote()]) + +m4_define([__source_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [ +__source_entry_impl__(__f)])]) + +m4_define([__source_entries__], +[m4_equote()__source_entries_impl__([$1])[]m4_dquote()]) + +# source_filter +# +m4_define([__source_filter_entry_impl__], +[ <ClCompile Include="[$1]"> + <Filter>Source Files</Filter> + </ClCompile>]) + +m4_define([__source_filter_entry__], +[m4_equote()__source_filter_entry_impl__([$1])[]m4_dquote()]) + + +m4_define([__source_filter_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [ +__source_filter_entry_impl__(__f)])]) + +m4_define([__source_filter_entries__], +[m4_equote()__source_filter_entries_impl__([$1])[]m4_dquote()]) + +# custom_build +# +m4_define([__custom_build_entry_tag_impl__], +[ <[$1] Condition="'$(Configuration)|$(Platform)'==m4_dnl +'[]m4_patsubst([$2], ["], [])'">[$3]</[$1]>]) + +m4_define([__custom_build_entry_impl__], +[ <CustomBuild Include="[$1]">m4_dnl +m4_foreach([__c], +[__value_impl__([configurations])], +[ +__custom_build_entry_tag_impl__([Message], __c, [$2]) +__custom_build_entry_tag_impl__([Command], __c, [$3]) +__custom_build_entry_tag_impl__([Outputs], __c, [$4];%(Outputs))m4_ifelse([$5], [], [], [ +__custom_build_entry_tag_impl__([AdditionalInputs], __c, [$5])])]) + </CustomBuild>]) + +# (file, cmd-description, cmd, output;output[, add-dep;add-dep]) +# +m4_define([__custom_build_entry__], +[m4_equote()__custom_build_entry_impl__([$1], +[$2], [$3], [$4], [$5])[]m4_dquote()]) + +# Disable comments and quoting. +# +m4_changecom([]) +m4_changequote([]) + +m4_divert(0)m4_dnl diff --git a/build-0.3/meta/vc10proj.make b/build-0.3/meta/vc10proj.make new file mode 100644 index 0000000..3532e6e --- /dev/null +++ b/build-0.3/meta/vc10proj.make @@ -0,0 +1,5 @@ +# file : build/meta/vc10proj.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc10proj-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc10sln-functions.make b/build-0.3/meta/vc10sln-functions.make new file mode 100644 index 0000000..cb68d82 --- /dev/null +++ b/build-0.3/meta/vc10sln-functions.make @@ -0,0 +1,29 @@ +# file : build/meta/vc10sln-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ solution template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3 - project suffix (-vc10.vcxproj by default) +# $4-9 - optional pairs of additional varibales and values $4=$5, $6=$7, etc +# +$(out_base)/%: meta-vc10sln = \ +$(call meta-vc10sln-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst \ +$(src_root),,$(src_base)),$(if $3,$3,-vc10.vcxproj),$4,$5,$6,$7,$8,$9) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4 - project suffix +# $4-10 - additional varibales +# +$(out_base)/%: meta-vc10sln-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \ +$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \ +-v 10 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc10sln.make b/build-0.3/meta/vc10sln.make new file mode 100644 index 0000000..ac4abed --- /dev/null +++ b/build-0.3/meta/vc10sln.make @@ -0,0 +1,5 @@ +# file : build/meta/vc10sln.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc10sln-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc11proj-functions.make b/build-0.3/meta/vc11proj-functions.make new file mode 100644 index 0000000..eff9091 --- /dev/null +++ b/build-0.3/meta/vc11proj-functions.make @@ -0,0 +1,27 @@ +# file : build/meta/vc11proj-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ project file template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3-8 - optional pairs of additional varibales and values $3=$4, $5=$6, etc +# +# +$(out_base)/%: meta-vc11proj = \ +$(call meta-vc11proj-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst $(src_root),,$(src_base)),$3,$4,$5,$6,$7,$8) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4-9 - additional varibales +# +$(out_base)/%: meta-vc11proj-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $4,$4='$5'; export $4; )$(if \ +$6,$6='$7'; export $6; )$(if $8,$8='$9'; export $8; )$(bld_root)/meta/vc10proj \ +-o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc11proj.make b/build-0.3/meta/vc11proj.make new file mode 100644 index 0000000..4cf98ea --- /dev/null +++ b/build-0.3/meta/vc11proj.make @@ -0,0 +1,5 @@ +# file : build/meta/vc11proj.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc11proj-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc11sln-functions.make b/build-0.3/meta/vc11sln-functions.make new file mode 100644 index 0000000..83cae1f --- /dev/null +++ b/build-0.3/meta/vc11sln-functions.make @@ -0,0 +1,29 @@ +# file : build/meta/vc11sln-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ solution template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3 - project suffix (-vc11.vcxproj by default) +# $4-9 - optional pairs of additional varibales and values $4=$5, $6=$7, etc +# +$(out_base)/%: meta-vc11sln = \ +$(call meta-vc11sln-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst \ +$(src_root),,$(src_base)),$(if $3,$3,-vc11.vcxproj),$4,$5,$6,$7,$8,$9) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4 - project suffix +# $4-10 - additional varibales +# +$(out_base)/%: meta-vc11sln-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \ +$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \ +-v 11 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc11sln.make b/build-0.3/meta/vc11sln.make new file mode 100644 index 0000000..8a212fe --- /dev/null +++ b/build-0.3/meta/vc11sln.make @@ -0,0 +1,5 @@ +# file : build/meta/vc11sln.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc11sln-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc12proj-functions.make b/build-0.3/meta/vc12proj-functions.make new file mode 100644 index 0000000..bee0cda --- /dev/null +++ b/build-0.3/meta/vc12proj-functions.make @@ -0,0 +1,27 @@ +# file : build/meta/vc12proj-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ project file template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3-8 - optional pairs of additional varibales and values $3=$4, $5=$6, etc +# +# +$(out_base)/%: meta-vc12proj = \ +$(call meta-vc12proj-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst $(src_root),,$(src_base)),$3,$4,$5,$6,$7,$8) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4-9 - additional varibales +# +$(out_base)/%: meta-vc12proj-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $4,$4='$5'; export $4; )$(if \ +$6,$6='$7'; export $6; )$(if $8,$8='$9'; export $8; )$(bld_root)/meta/vc10proj \ +-o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc12proj.make b/build-0.3/meta/vc12proj.make new file mode 100644 index 0000000..7ac3a9a --- /dev/null +++ b/build-0.3/meta/vc12proj.make @@ -0,0 +1,5 @@ +# file : build/meta/vc12proj.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc12proj-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc12sln-functions.make b/build-0.3/meta/vc12sln-functions.make new file mode 100644 index 0000000..3900c01 --- /dev/null +++ b/build-0.3/meta/vc12sln-functions.make @@ -0,0 +1,29 @@ +# file : build/meta/vc12sln-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ solution template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3 - project suffix (-vc12.vcxproj by default) +# $4-9 - optional pairs of additional varibales and values $4=$5, $6=$7, etc +# +$(out_base)/%: meta-vc12sln = \ +$(call meta-vc12sln-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst \ +$(src_root),,$(src_base)),$(if $3,$3,-vc12.vcxproj),$4,$5,$6,$7,$8,$9) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4 - project suffix +# $4-10 - additional varibales +# +$(out_base)/%: meta-vc12sln-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \ +$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \ +-v 12 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc12sln.make b/build-0.3/meta/vc12sln.make new file mode 100644 index 0000000..9e61b93 --- /dev/null +++ b/build-0.3/meta/vc12sln.make @@ -0,0 +1,5 @@ +# file : build/meta/vc12sln.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc12sln-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc8proj-functions.make b/build-0.3/meta/vc8proj-functions.make new file mode 100644 index 0000000..695405c --- /dev/null +++ b/build-0.3/meta/vc8proj-functions.make @@ -0,0 +1,27 @@ +# file : build/meta/vc8proj-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ project file template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3-8 - optional pairs of additional varibales and values $3=$4, $5=$6, etc +# +# +$(out_base)/%: meta-vc8proj = \ +$(call meta-vc8proj-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst $(src_root),,$(src_base)),$3,$4,$5,$6,$7,$8) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4-9 - additional varibales +# +$(out_base)/%: meta-vc8proj-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $4,$4='$5'; export $4; )$(if \ +$6,$6='$7'; export $6; )$(if $8,$8='$9'; export $8; )$(bld_root)/meta/vc9proj \ +-o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc8proj.make b/build-0.3/meta/vc8proj.make new file mode 100644 index 0000000..179db17 --- /dev/null +++ b/build-0.3/meta/vc8proj.make @@ -0,0 +1,5 @@ +# file : build/meta/vc8proj.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc8proj-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc8sln-functions.make b/build-0.3/meta/vc8sln-functions.make new file mode 100644 index 0000000..0391a1c --- /dev/null +++ b/build-0.3/meta/vc8sln-functions.make @@ -0,0 +1,29 @@ +# file : build/meta/vc8sln-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ 8 solution template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3 - project suffix (-vc8.vcproj by default) +# $4-9 - optional pairs of additional varibales and values $4=$5, $6=$7, etc +# +$(out_base)/%: meta-vc8sln = \ +$(call meta-vc8sln-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst \ +$(src_root),,$(src_base)),$(if $3,$3,-vc8.vcproj),$4,$5,$6,$7,$8,$9) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4 - project suffix +# $4-10 - additional varibales +# +$(out_base)/%: meta-vc8sln-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \ +$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \ +-v 8 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc8sln.make b/build-0.3/meta/vc8sln.make new file mode 100644 index 0000000..70e0703 --- /dev/null +++ b/build-0.3/meta/vc8sln.make @@ -0,0 +1,5 @@ +# file : build/meta/vc8sln.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc8sln-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc9proj b/build-0.3/meta/vc9proj new file mode 100755 index 0000000..03130b4 --- /dev/null +++ b/build-0.3/meta/vc9proj @@ -0,0 +1,75 @@ +#! /usr/bin/env bash + +# file : build/meta/vc9proj +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ 9 project file templates. +# +# Options: +# +# -o <output-file> +# +# Arguments: +# +# <template-file> +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +output= + +while [ $# -gt 0 ]; do + case $1 in + -o) + output=$2 + shift 2 + ;; + *) + break + ;; + esac +done + +input=$1 + +if [ "$input" = "" ]; then + error "no input file" + exit 1 +fi + +if [ "$output" = "" ]; then + error "no output file" + exit 1 +fi + +m4=m4 +u2d=todos + +# Assume this script is never found via PATH. +# +meta=`dirname $0` + +build="$meta/.." +install=$build/install/install + + +# Determine available configurations. +# +conf=`sed -n -e \ +'/^[ ]*<Configuration$/{n;s/[ ]*Name="\([^"]*\)"$/"\1",/p};d' $input` +conf=`echo $conf | sed -e 's/,$//'` + +export configurations=$conf + +# Make sure the output directory exist. +# +$install -d -m 755 `dirname $output` + +$m4 -P -D__meta_base__=$meta $meta/vc9proj.m4 $input >$output +$u2d $output +chmod 644 $output diff --git a/build-0.3/meta/vc9proj-functions.make b/build-0.3/meta/vc9proj-functions.make new file mode 100644 index 0000000..987cff7 --- /dev/null +++ b/build-0.3/meta/vc9proj-functions.make @@ -0,0 +1,27 @@ +# file : build/meta/vc9proj-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ project file template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3-8 - optional pairs of additional varibales and values $3=$4, $5=$6, etc +# +# +$(out_base)/%: meta-vc9proj = \ +$(call meta-vc9proj-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst $(src_root),,$(src_base)),$3,$4,$5,$6,$7,$8) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4-9 - additional varibales +# +$(out_base)/%: meta-vc9proj-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $4,$4='$5'; export $4; )$(if \ +$6,$6='$7'; export $6; )$(if $8,$8='$9'; export $8; )$(bld_root)/meta/vc9proj \ +-o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc9proj.m4 b/build-0.3/meta/vc9proj.m4 new file mode 100644 index 0000000..e8d56b4 --- /dev/null +++ b/build-0.3/meta/vc9proj.m4 @@ -0,0 +1,103 @@ +m4_divert(-1) +# file : build/meta/vc9proj.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_changequote([, ]) + +m4_include(__meta_base__[/common.m4]) +m4_include(__meta_base__[/windows-common.m4]) + +# file +# +m4_define([__file_entry_impl__],[ + <File + RelativePath=".\[$1]" + > + </File>]) + +m4_define([__file_entry__], +[m4_equote()__file_entry_impl__([$1])[]m4_dquote()]) + + +m4_define([__file_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [__file_entry_impl__(__f)])]) + +m4_define([__file_entries__], +[m4_equote()__file_entries_impl__([$1])[]m4_dquote()]) + +# file_custom_build +# +m4_define([__custom_build_entry_impl__],[ + <FileConfiguration + Name=[$1] + > + <Tool + Name="VCCustomBuildTool" + Description="[$2]" + CommandLine="[$3]"m4_ifelse([$5], [], [], [ + AdditionalDependencies="$5"]) + Outputs="[$4]" + /> + </FileConfiguration>]) + +m4_define([__file_entry_custom_build_impl__],[ + <File + RelativePath=".\[$1]" + >m4_dnl +m4_foreach([__c], +[__value_impl__([configurations])], +[__custom_build_entry_impl__(__c, [$2], [$3], [$4], [$5])]) + </File>]) + +# (file, cmd-description, cmd, output;output[, add-dep;add-dep]) +# +m4_define([__file_entry_custom_build__], +[m4_equote()__file_entry_custom_build_impl__([$1], +[$2], [$3], [$4], [$5])[]m4_dquote()]) + + +# source +# + +# $1 - configuration +# $2 - directory +# +m4_define([__source_config_entry_impl__],[ + <FileConfiguration + Name=[$1] + > + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)\[$2]\" + /> + </FileConfiguration>]) + +m4_define([__source_config_impl__], +[m4_ifelse([$1], [$2], [], +[m4_foreach([__c], +[__value_impl__([configurations])], +[__source_config_entry_impl__(__c, [$1])])])]) + +m4_define([__source_entry_impl__],[ + <File + RelativePath=".\[$1]" + >m4_dnl +__source_config_impl__(m4_patsubst([$1], [^\(.*\)\\\(.*\)$], [\1]), [$1]) + </File>]) + +m4_define([__source_entry__], +[m4_equote()__source_entry_impl__([$1])[]m4_dquote()]) + +m4_define([__source_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [__source_entry_impl__(__f)])]) + +m4_define([__source_entries__], +[m4_equote()__source_entries_impl__([$1])[]m4_dquote()]) + +# Disable comments and quoting. +# +m4_changecom([]) +m4_changequote([]) + +m4_divert(0)m4_dnl diff --git a/build-0.3/meta/vc9proj.make b/build-0.3/meta/vc9proj.make new file mode 100644 index 0000000..03eb2c5 --- /dev/null +++ b/build-0.3/meta/vc9proj.make @@ -0,0 +1,5 @@ +# file : build/meta/vc9proj.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc9proj-functions.make,$(out_base)) diff --git a/build-0.3/meta/vc9sln-functions.make b/build-0.3/meta/vc9sln-functions.make new file mode 100644 index 0000000..07b03c3 --- /dev/null +++ b/build-0.3/meta/vc9sln-functions.make @@ -0,0 +1,29 @@ +# file : build/meta/vc9sln-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ 9 solution template and write output to $(dist_prefix)/<path>. +# Where path is computed as difference between src_base and src_root. +# +# Arguments: +# +# $1 - template path, if doesn't start with /, assume relative to src_base +# $2 - output name (optional) +# $3 - project suffix (-vc9.vcproj by default) +# $4-9 - optional pairs of additional varibales and values $4=$5, $6=$7, etc +# +$(out_base)/%: meta-vc9sln = \ +$(call meta-vc9sln-body,$(if $(filter /%,$1),$1,$(src_base)/$1),$(if \ +$2,$2,$(notdir $1)),$(subst \ +$(src_root),,$(src_base)),$(if $3,$3,-vc9.vcproj),$4,$5,$6,$7,$8,$9) + +# $1 - template +# $2 - output name +# $3 - difference between src_base and src_root with leading '\' +# $4 - project suffix +# $4-10 - additional varibales +# +$(out_base)/%: meta-vc9sln-body = \ +$(call message,meta $(dist_prefix)$3/$2,$(if $5,$5='$6'; export $5; )$(if \ +$7,$7='$8'; export $7; )$(if $9,$9='$(10)'; export $9; )$(bld_root)/meta/vcsln \ +-v 9 -b $(dist_prefix)$3 -e '$4' -o $(dist_prefix)$3/$2 $1) diff --git a/build-0.3/meta/vc9sln.make b/build-0.3/meta/vc9sln.make new file mode 100644 index 0000000..50c6b7b --- /dev/null +++ b/build-0.3/meta/vc9sln.make @@ -0,0 +1,5 @@ +# file : build/meta/vc9sln.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vc9sln-functions.make,$(out_base)) diff --git a/build-0.3/meta/vcsln b/build-0.3/meta/vcsln new file mode 100755 index 0000000..99aaf47 --- /dev/null +++ b/build-0.3/meta/vcsln @@ -0,0 +1,181 @@ +#! /usr/bin/env bash + +# file : build/meta/vcsln +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ solution templates. +# +# Options: +# +# -b <base-dir> +# -o <output-file> +# -e <project-ext> +# -v <vc-version> {8, 9, 10, 11, 12} +# +# Arguments: +# +# <template-file> +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +base= +output= +projext= +vcver= + +while [ $# -gt 0 ]; do + case $1 in + -b) + base=$2 + shift 2 + ;; + -o) + output=$2 + shift 2 + ;; + -e) + projext=$2 + shift 2 + ;; + -v) + vcver=$2 + shift 2 + ;; + *) + break + ;; + esac +done + +input=$1 + +if [ "$input" = "" ]; then + error "no input file" + exit 1 +fi + +if [ "$base" = "" ]; then + error "no base directory" + exit 1 +fi + +if [ "$output" = "" ]; then + error "no output file" + exit 1 +fi + +if [ "$projext" = "" ]; then + error "no VC++ project file extension" + exit 1 +fi + +if [ "$vcver" = "" ]; then + error "no VC++ version" + exit 1 +fi + +m4=m4 +u2d=todos + +# Assume this script is never found via PATH. +# +meta=`dirname $0` + +build="$meta/.." +install=$build/install/install + +# Find all the project files. +# +all_proj_files=`find $base -name '*'$projext` + +# Filter out subdirectories which already have solution files. +# +proj_files= +proj_names= +for f in $all_proj_files; do + n=`echo "$f" | sed -e "s%^$base/\(.*\)/.*$%\1%"` + + # If there is no sub-directory for this project, then use the + # root directory name. + # + if [ "$n" = "$f" ]; then + n=`basename $base` + d="." + else + d=$n + fi + + while [ "$d" != "." ]; do + if ls $base/$d/*.sln >/dev/null 2>&1; then + break + fi + d=`dirname $d` + done + + # If we din't find any solutions, then add this file to the list. + # + if [ "$d" = "." ]; then + proj_names="$proj_names $n" + proj_files="$proj_files $f" + fi +done + +# Determine available configurations and project uuids. +# +conf= +proj_uuids= +for f in $proj_files; do + + if [ "$conf" = "" ]; then + if [ "$vcver" = "8" -o "$vcver" = "9" ]; then + conf=`cat $f | fromdos | sed -n -e \ + '/^[ ]*<Configuration$/{n;s/[ ]*Name="\([^"]*\)"$/"\1",/p};d' -` + conf=`echo $conf | sed -e 's/,$//'` + else + conf=`cat $f | fromdos | sed -n -e \ + 's/^[ ]*<ProjectConfiguration Include="\([^"]*\)">$/"\1",/p;d' -` + conf=`echo $conf | sed -e 's/,$//'` + fi + fi + + if [ "$vcver" = "8" -o "$vcver" = "9" ]; then + uuid=`cat $f | fromdos | sed -n -e \ + 's/^[ ]*ProjectGUID="{\([^}]*\)}"$/\1/p;d'` + else + uuid=`cat $f | fromdos | sed -n -e \ + 's/^[ ]*<ProjectGuid>{\([^}]*\)}<\/ProjectGuid>$/\1/p;d'` + fi + + if [ "$proj_uuids" = "" ]; then + proj_uuids=$uuid + else + proj_uuids="$proj_uuids $uuid" + fi +done + +proj_files=`echo $proj_files | sed -e "s%$base/%%g"` +proj_names=`echo $proj_names | sed -e "s%/%-%g"` + +#error $proj_files +#error $proj_names +#error $proj_uuids +#error $conf + +export configurations=$conf +export project_files=$proj_files +export project_names=$proj_names +export project_uuids=$proj_uuids + +# Make sure the output directory exist. +# +$install -d -m 755 `dirname $output` + +$m4 -P -D__meta_base__=$meta $meta/vcsln.m4 $input >$output +$u2d $output +chmod 644 $output diff --git a/build-0.3/meta/vcsln.m4 b/build-0.3/meta/vcsln.m4 new file mode 100644 index 0000000..2299bac --- /dev/null +++ b/build-0.3/meta/vcsln.m4 @@ -0,0 +1,82 @@ +m4_divert(-1) +# file : build/meta/vcsln.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_changequote([, ]) + +m4_include(__meta_base__[/common.m4]) +m4_include(__meta_base__[/windows-common.m4]) + +# solution_configuration +# +m4_define([__solution_configuration_entry_impl__], [ [$1] = [$1]]) + +m4_define([__solution_configurations_impl__], + [m4_foreach([__c], + [__value_impl__([configurations])], + [__solution_configuration_entry_impl__(m4_patsubst(__c, ["], [])) +])]) + +m4_define([__solution_configurations__], + [m4_equote()__solution_configurations_impl__()[]m4_dquote()]) + +# project_configuration +# +m4_define([__project_configuration_entry_item_impl__], +[ {[$1]}.[$2].ActiveCfg = [$2] + {[$1]}.[$2].Build.0 = [$2]]) + +m4_define([__project_configuration_entry_impl__], + [m4_foreach( + [__c], + [__value_impl__([configurations])], + [__project_configuration_entry_item_impl__([$1], m4_patsubst(__c, ["], [])) +])]) + +m4_define([__project_configurations_impl__], + [m4_foreach_w( + [__u], + [__value_impl__([project_uuids])], + [__project_configuration_entry_impl__(__u)])]) + +m4_define([__project_configurations__], + [m4_equote()__project_configurations_impl__()[]m4_dquote()]) + +# project_entry(name, file, uuid) +# +m4_define([__project_entry_impl__], +[Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "[$1]", "[$2]", "{[$3]}" +EndProject]) + +m4_define([__project_entry__], + [m4_equote()__project_entry_impl__([$1], [$2], [$3])[]m4_dquote()]) + +# projects +# +m4_define([__project_step_impl__], +[__project_entry_impl__( + m4_substr([$1], 0, m4_ifelse(m4_index([$1], [ ]), [-1], [m4_len([$1])], [m4_index([$1], [ ])])), + m4_substr([$2], 0, m4_ifelse(m4_index([$2], [ ]), [-1], [m4_len([$2])], [m4_index([$2], [ ])])), + m4_substr([$3], 0, m4_ifelse(m4_index([$3], [ ]), [-1], [m4_len([$3])], [m4_index([$3], [ ])])))[]m4_dnl +m4_ifelse(m4_index([$1], [ ]), [-1],, [ +__project_step_impl__( + m4_substr([$1], m4_incr(m4_index([$1], [ ]))), + m4_substr([$2], m4_incr(m4_index([$2], [ ]))), + m4_substr([$3], m4_incr(m4_index([$3], [ ]))))])]) + +m4_define([__projects_impl__], +[__project_step_impl__( + __value_impl__([project_names]), + __path_impl__([project_files]), + __value_impl__([project_uuids]))]) + +m4_define([__projects__], + [m4_equote()__projects_impl__()[]m4_dquote()]) + +# Disable comments and quoting. +# +m4_changecom([]) +m4_changequote([]) + +m4_divert(0)m4_dnl diff --git a/build-0.3/meta/vctest b/build-0.3/meta/vctest new file mode 100755 index 0000000..0502364 --- /dev/null +++ b/build-0.3/meta/vctest @@ -0,0 +1,143 @@ +#! /usr/bin/env bash + +# file : build/meta/vctest +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ test templates. +# +# Options: +# +# -b <base-dir> +# -r <root-dir> +# -o <output-file> +# -t <template-file> +# +# Arguments: +# +# <solution-files> +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +base= +root= +output= +sln= +input= + +while [ $# -gt 0 ]; do + case $1 in + -b) + base=$2 + shift 2 + ;; + -r) + root=$2 + shift 2 + ;; + -o) + output=$2 + shift 2 + ;; + -t) + input=$2 + shift 2 + ;; + *) + sln="$sln $1" + shift + ;; + esac +done + + +if [ "$input" = "" ]; then + error "no template file" + exit 1 +fi + +if [ "$base" = "" ]; then + error "no base directory" + exit 1 +fi + +if [ "$root" = "" ]; then + error "no root directory" + exit 1 +fi + +if [ "$output" = "" ]; then + error "no output file" + exit 1 +fi + +if [ "$sln" = "" ]; then + error "no solution file" + exit 1 +fi + + +m4=m4 +u2d=todos + +# Assume this script is never found via PATH. +# +meta=`dirname $0` + +build="$meta/.." +install=$build/install/install + +# Figure out topdir +# +if [ "$base" = "$root" ]; then + topdir=. +else + topdir=`echo $base | sed -e "s%^$root/%%" - | \ +sed -e 's%[^/][^/]*/%../%g;s%[^./][^./]*$%..%' -` +fi + +# + +# Determine possible configurations. +# +for f in $sln; do + sln_conf=`cat $f | fromdos | sed -n -e \ +'/^[ ]*GlobalSection(SolutionConfigurationPlatforms).*$/{\ +: loop;\ +n;\ +/^[ ]*EndGlobalSection$/q;\ +s/^[ ]*\([^=]*\) = \([^=]*\)$/\1/p;\ +b loop};\ +d' -` + break +done + +confs= +plats= +for c in $sln_conf; do + conf=`echo $c | sed -e 's/^\(.*\)|.*$/\1/'` + plat=`echo $c | sed -e 's/^.*|\(.*\)$/\1/'` + + confs="$confs $conf" + plats="$plats $plat" +done + +confs=`echo $confs | sed -e 's/ /\n/g' - | sort -u` +plats=`echo $plats | sed -e 's/ /\n/g' - | sort -u` + +export topdir +export configurations=$confs +export platforms=$plats + +# Make sure the output directory exist. +# +$install -d -m 755 `dirname $output` + +$m4 -P -D__meta_base__=$meta $meta/vctest.m4 $input >$output +$u2d $output +chmod 644 $output diff --git a/build-0.3/meta/vctest-functions.make b/build-0.3/meta/vctest-functions.make new file mode 100644 index 0000000..e67945b --- /dev/null +++ b/build-0.3/meta/vctest-functions.make @@ -0,0 +1,28 @@ +# file : build/meta/vctest-functions.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Process VC++ solution and test template and write output to +# $(dist_prefix)/<path>. Where path is computed as difference +# between src_base and src_root. +# +# Arguments: +# +# $1 - solution path, if doens't start with /, assume relative to +# dist_prefix/<path> +# $2 - template path, if doesn't start with /, assume relative to src_base +# $3 - output name (optional) +# +$(out_base)/%: meta-vctest = \ +$(call meta-vctest-body,$1,$(if $(filter /%,$2),$2,$(src_base)/$2),$(if \ +$3,$3,$(notdir $2)),$(subst $(src_root),,$(src_base))) + +# $1 - solution +# $2 - template +# $3 - output name +# $4 - difference between src_base and src_root with leading '\' +# +$(out_base)/%: meta-vctest-body = \ +$(call message,meta $(dist_prefix)$4/$3,$(bld_root)/meta/vctest \ +-r $(dist_prefix) -b $(dist_prefix)$4 -t $2 -o $(dist_prefix)$4/$3 \ +$(if $(filter /%,$1),$1,$(dist_prefix)$4/$1)) diff --git a/build-0.3/meta/vctest.m4 b/build-0.3/meta/vctest.m4 new file mode 100644 index 0000000..724a0fc --- /dev/null +++ b/build-0.3/meta/vctest.m4 @@ -0,0 +1,17 @@ +m4_divert(-1) +# file : build/meta/vctest.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_changequote([, ]) + +m4_include(__meta_base__[/common.m4]) +m4_include(__meta_base__[/windows-common.m4]) + + +# Disable comments and quoting. +# +m4_changecom([]) +m4_changequote([]) + +m4_divert(0)m4_dnl diff --git a/build-0.3/meta/vctest.make b/build-0.3/meta/vctest.make new file mode 100644 index 0000000..1cf336c --- /dev/null +++ b/build-0.3/meta/vctest.make @@ -0,0 +1,5 @@ +# file : build/meta/vctest.make +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/meta/vctest-functions.make,$(out_base)) diff --git a/build-0.3/meta/windows-common.m4 b/build-0.3/meta/windows-common.m4 new file mode 100644 index 0000000..700f8e8 --- /dev/null +++ b/build-0.3/meta/windows-common.m4 @@ -0,0 +1,49 @@ +# file : build/meta/windows-common.m4 +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +m4_define([__path_impl__], [m4_translit(__env_impl__([$1]),[/],[\])]) +m4_define([__path__], [m4_equote()__path_impl__([$1])[]m4_dquote()]) + +m4_define([__file_impl__], [__env_impl__([$1])]) +m4_define([__file__], [m4_equote()__file_impl__([$1])[]m4_dquote()]) + +# Convert POSIX shell quoting to Windows. Arguments that are in +# single quotes (') are converted to double quotes ("). Double +# quotes that are nested in single quotes are converted to \". +# Quote escaping is not recognized. Single-quoted arguments +# should be quoted as a whole, for example 'foo-bar' and not +# foo-'bar'. +# + +m4_define([__shell_quotes_convert_impl__], [m4_patsubst([$1], ["], [\\"])]) + +# $1 string without the opening quote +# $2 index of the closing quote +# +m4_define([__shell_quotes_in_quote_impl__], +["__shell_quotes_convert_impl__(m4_substr([$1], [0], [$2]))"[]m4_dnl + __shell_quotes_impl__(m4_substr([$1], m4_incr([$2])))]) + +# $1 string without the leading space +# $2 index of the next space or -1 +# +m4_define([__shell_quotes_in_space_impl__], +[m4_substr([$1], [0], m4_ifelse([$2], [-1], [m4_len([$1])], [$2]))[]m4_dnl +m4_ifelse( + [$2], [-1], + [], + [ __shell_quotes_impl__(m4_substr([$1], m4_incr([$2])))])]) + +# +# +m4_define([__shell_quotes_impl__], +[m4_ifelse( + m4_index([$1], [']), [0], + [__shell_quotes_in_quote_impl__( + m4_substr([$1], [1]), + m4_index(m4_substr([$1], [1]), [']))], + [__shell_quotes_in_space_impl__([$1], m4_index([$1], [ ]))])]) + +m4_define([__shell_quotes__], +[m4_equote()__shell_quotes_impl__([$1])[]m4_dquote()]) diff --git a/build-0.3/run-if-arg b/build-0.3/run-if-arg new file mode 100755 index 0000000..1076b46 --- /dev/null +++ b/build-0.3/run-if-arg @@ -0,0 +1,17 @@ +#! /usr/bin/env bash + +# file : build/run-if-arg +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Run command if there are any non-empty arguments. +# +# $1 command to execute +# $2 argument to test + +cmd=$1 +shift + +if [ "$*" ]; then + exec $cmd $* +fi diff --git a/build-0.3/system.make b/build-0.3/system.make new file mode 100644 index 0000000..3a9c051 --- /dev/null +++ b/build-0.3/system.make @@ -0,0 +1,13 @@ +# file : build/system.make +# copyright : Copyright (c) 2006-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(bld_root)/system/configuration-rules.make,$(dcf_root)) + +$(call -include,$(dcf_root)/system/configuration-dynamic.make) + +ifndef system_configuration + +.NOTPARALLEL: + +endif diff --git a/build-0.3/system/config.guess b/build-0.3/system/config.guess new file mode 100755 index 0000000..e792aac --- /dev/null +++ b/build-0.3/system/config.guess @@ -0,0 +1,1494 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-09-18' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to <config-patches@gnu.org> and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-0.3/system/config.sub b/build-0.3/system/config.sub new file mode 100755 index 0000000..5ecc18b --- /dev/null +++ b/build-0.3/system/config.sub @@ -0,0 +1,1700 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-10-07' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build-0.3/system/configuration-rules.make b/build-0.3/system/configuration-rules.make new file mode 100644 index 0000000..3af4514 --- /dev/null +++ b/build-0.3/system/configuration-rules.make @@ -0,0 +1,23 @@ +# file : build/system/configuration-rules.make +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + + +$(dcf_root)/system/configuration-dynamic.make: | $(dcf_root)/system/. + $(call message,,$(bld_root)/system/configure $@) + +ifeq ($(.DEFAULT_GOAL),$(dcf_root)/system/configuration-dynamic.make) +.DEFAULT_GOAL := +endif + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/system/configuration-dynamic.make,\ +rm -f $(dcf_root)/system/configuration-dynamic.make) + +ifeq ($(.DEFAULT_GOAL),$(dcf_root)/.disfigure) +.DEFAULT_GOAL := +endif + +endif diff --git a/build-0.3/system/configure b/build-0.3/system/configure new file mode 100755 index 0000000..3c1b968 --- /dev/null +++ b/build-0.3/system/configure @@ -0,0 +1,137 @@ +#! /usr/bin/env bash + +# file : build/system/configure +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# $1 out file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + +$echo +$echo +$echo "configuring '$project_name'" +$echo +$echo + +# Build system. +# + +build=`$bld_root/system/config.guess` + +if [ $? != 0 ]; then + + $echo "unable to determine build system type" + exit 1 +fi + +$echo "build system is $build" + +build_cpu=`echo $build | cut -f 1 -d -` +build_mf=`echo $build | cut -f 2 -d -` +build_kernel=`echo $build | cut -f 3 -d -` +build_os=`echo $build | cut -f 4 -d -` + +if [ -z "$build_os" ]; then + + # Old format: cpu-mf-os + # + build_os=$build_kernel + build_kernel= +fi + + +# Host system. +# + +if [ -n "$host_system" ]; then + + host=`$bld_root/system/config.sub "$host_system"` + + if [ $? != 0 ]; then + + $echo "unable to canonicalize host system '$host_system'" + exit 1 + fi +else + host=$build +fi + +$echo "host system is $host" + +host_cpu=`echo $host | cut -f 1 -d -` +host_mf=`echo $host | cut -f 2 -d -` +host_kernel=`echo $host | cut -f 3 -d -` +host_os=`echo $host | cut -f 4 -d -` + +if [ -z "$host_os" ]; then + + # Old format: cpu-mf-os + # + host_os=$host_kernel + host_kernel= +fi + + +# Target system. +# +if [ -n "$target_system" ]; then + + target=`$bld_root/system/config.sub "$target_system"` + + if [ $? != 0 ]; then + + $echo "unable to canonicalize target system '$target_system'" + exit 1 + fi + + $echo "target system is $target" + + target_cpu=`echo $target | cut -f 1 -d -` + target_mf=`echo $target | cut -f 2 -d -` + target_kernel=`echo $target | cut -f 3 -d -` + target_os=`echo $target | cut -f 4 -d -` + + if [ -z "$target_os" ]; then + + # Old format: cpu-mf-os + # + target_os=$target_kernel + target_kernel= + fi + +else +target= +target_cpu= +target_mf= +target_kernel= +target_os= +fi + + + +# Write the configuration out. +# +echo "system_configuration := y" >$1 +echo >>$1 +echo "build_system := $build" >>$1 +echo "build_cpu := $build_cpu" >>$1 +echo "build_manufacturer := $build_mf" >>$1 +echo "build_os := $build_os" >>$1 +echo "build_kernel := $build_kernel" >>$1 +echo >>$1 +echo "host_system := $host" >>$1 +echo "host_cpu := $host_cpu" >>$1 +echo "host_manufacturer := $host_mf" >>$1 +echo "host_os := $host_os" >>$1 +echo "host_kernel := $host_kernel" >>$1 +echo >>$1 +echo "target_system := $target" >>$1 +echo "target_cpu := $target_cpu" >>$1 +echo "target_manufacturer := $target_mf" >>$1 +echo "target_os := $target_os" >>$1 +echo "target_kernel := $target_kernel" >>$1 |