diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-07-23 15:25:44 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-07-23 15:25:44 +0200 |
commit | 8286ac511144e4f17d34eac9affb97e50646344a (patch) | |
tree | f1af7320d7b6be6be059216d0ad08ac7b4f73fd0 /build-0.3/meta | |
parent | a15cf65c44d5c224169c32ef5495b68c758134b7 (diff) |
Imported Upstream version 4.0.0upstream/4.0.0
Diffstat (limited to 'build-0.3/meta')
40 files changed, 1578 insertions, 0 deletions
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()]) |