From ffe5419c05437e3e08e2d9580de29371dace19cf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 6 Sep 2010 15:34:58 +0200 Subject: Use [ and ] as quote characters instead of ` and ' --- build/meta/autoconf.m4 | 17 ++++--- build/meta/automake.m4 | 17 ++++--- build/meta/common.m4 | 62 +++++++++++------------ build/meta/vc10proj.m4 | 135 +++++++++++++++++++++++++------------------------ build/meta/vc9proj.m4 | 74 ++++++++++++++------------- 5 files changed, 157 insertions(+), 148 deletions(-) diff --git a/build/meta/autoconf.m4 b/build/meta/autoconf.m4 index 3370b9c..9e5db6d 100644 --- a/build/meta/autoconf.m4 +++ b/build/meta/autoconf.m4 @@ -4,16 +4,19 @@ m4_divert(-1) # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -m4_include(__meta_base__`/common.m4') +m4_changequote([, ]) -m4_define(`__path_impl__', `__env_impl__(`$1')') -m4_define(`__path__', `m4_equote()__path_impl__(`$1')`'m4_dquote()') +m4_include(__meta_base__[/common.m4]) -m4_define(`__file_impl__', `__env_impl__(`$1')') -m4_define(`__file__', `m4_equote()__file_impl__(`$1')`'m4_dquote()') +m4_define([__path_impl__], [__env_impl__([$1])]) +m4_define([__path__], [m4_equote()__path_impl__([$1])[]m4_dquote()]) -# Disable quoting. +m4_define([__file_impl__], [__env_impl__([$1])]) +m4_define([__file__], [m4_equote()__file_impl__([$1])[]m4_dquote()]) + +# Disable comments and quoting. # -m4_changequote('') +m4_changecom([]) +m4_changequote([]) m4_divert(0)m4_dnl diff --git a/build/meta/automake.m4 b/build/meta/automake.m4 index 3efb5b7..d057f26 100644 --- a/build/meta/automake.m4 +++ b/build/meta/automake.m4 @@ -4,16 +4,19 @@ m4_divert(-1) # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -m4_include(__meta_base__`/common.m4') +m4_changequote([, ]) -m4_define(`__path_impl__', `__env_impl__(`$1')') -m4_define(`__path__', `m4_equote()__path_impl__(`$1')`'m4_dquote()') +m4_include(__meta_base__[/common.m4]) -m4_define(`__file_impl__', `__env_impl__(`$1')') -m4_define(`__file__', `m4_equote()__file_impl__(`$1')`'m4_dquote()') +m4_define([__path_impl__], [__env_impl__([$1])]) +m4_define([__path__], [m4_equote()__path_impl__([$1])[]m4_dquote()]) -# Disable quoting. +m4_define([__file_impl__], [__env_impl__([$1])]) +m4_define([__file__], [m4_equote()__file_impl__([$1])[]m4_dquote()]) + +# Disable comments and quoting. # -m4_changequote('') +m4_changecom([]) +m4_changequote([]) m4_divert(0)m4_dnl diff --git a/build/meta/common.m4 b/build/meta/common.m4 index 54be556..bb4fcc4 100644 --- a/build/meta/common.m4 +++ b/build/meta/common.m4 @@ -3,32 +3,25 @@ # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -# Quote character literals. -# -m4_changequote([, ]) -m4_define([m4_oquote],`) -m4_define([m4_cquote],') -m4_changequote(`, ') - # 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_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_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*. +# quoted with ] and ]. Beginning spaces and end spaces *are kept*. # Use m4_strip to remove them. # # REGEXP specifies where to split. Default is [\t ]+. @@ -36,41 +29,48 @@ m4_define(`m4_normalize', `m4_strip(`$1')') # 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_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')') +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_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_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([m4_equote], [m4_changequote([,])]) +m4_define([m4_dquote], [m4_changequote([])]) # # -m4_define(`__env_impl__', `m4_esyscmd(`echo -n $'`$1')') -m4_define(`__env__', `m4_equote()__env_impl__(`$1')`'m4_dquote()') +m4_define([__env_impl__], [m4_esyscmd([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([__value_impl__], [__env_impl__([$1])]) +m4_define([__value__], [m4_equote()__value_impl__([$1])[]m4_dquote()]) diff --git a/build/meta/vc10proj.m4 b/build/meta/vc10proj.m4 index 9b8e2fd..4dbeea5 100644 --- a/build/meta/vc10proj.m4 +++ b/build/meta/vc10proj.m4 @@ -4,47 +4,49 @@ m4_divert(-1) # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -m4_include(__meta_base__`/common.m4') +m4_changequote([, ]) -m4_define(`__path_impl__', `m4_translit(__env_impl__(`$1'),`/',`\')') -m4_define(`__path__', `m4_equote()__path_impl__(`$1')`'m4_dquote()') +m4_include(__meta_base__[/common.m4]) -m4_define(`__file_impl__', `__env_impl__(`$1')') -m4_define(`__file__', `m4_equote()__file_impl__(`$1')`'m4_dquote()') +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()]) # header # -m4_define(`__header_entry_impl__', -` ') +m4_define([__header_entry_impl__], +[ ]) -m4_define(`__header_entry__', -`m4_equote()__header_entry_impl__(`$1')`'m4_equote()') +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_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [ +__header_entry_impl__(__f)])]) -m4_define(`__header_entries__', -`m4_equote()__header_entries_impl__(`$1')`'m4_equote()') +m4_define([__header_entries__], +[m4_equote()__header_entries_impl__([$1])[]m4_dquote()]) # header_filter # -m4_define(`__header_filter_entry_impl__', -` +m4_define([__header_filter_entry_impl__], +[ Header Files - ') + ]) -m4_define(`__header_filter_entry__', -`m4_equote()__header_filter_entry_impl__(`$1')`'m4_equote()') +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_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_equote()') +m4_define([__header_filter_entries__], +[m4_equote()__header_filter_entries_impl__([$1])[]m4_dquote()]) # source # @@ -52,58 +54,57 @@ m4_define(`__header_filter_entries__', # $1 - configuration # $2 - directory # -m4_define(`__source_config_entry_impl__', -` m4_dnl -$(IntDir)\`$2'\') - -m4_define(`__source_entry_body__', -`m4_ifelse(`$1', `$2', -` ', -` m4_dnl -m4_foreach(`__c', -`__value_impl__(`configurations')', -` -__source_config_entry_impl__(__c, `$2')') - ')') - -m4_define(`__source_entry_impl__', -`__source_entry_body__(`$1', -m4_patsubst(`$1', `^\(.*\)\\\(.*\)$', `\1'))') - -m4_define(`__source_entry__', -`m4_equote()__source_entry_impl__(`$1')`'m4_equote()') - -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_equote()') +m4_define([__source_config_entry_impl__], +[ m4_dnl +$(IntDir)\[$2]\]) + +m4_define([__source_entry_body__], +[m4_ifelse([$1], [$2], +[ ], +[ m4_dnl +m4_foreach([__c], +[__value_impl__([configurations])], +[ +__source_config_entry_impl__(__c, [$2])]) + ])]) + +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__', -` +m4_define([__source_filter_entry_impl__], +[ Source Files - ') - -m4_define(`__source_filter_entry__', -`m4_equote()__source_filter_entry_impl__(`$1')`'m4_equote()') + ]) +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_equote()') +m4_define([__source_filter_entries_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [ +__source_filter_entry_impl__(__f)])]) -# Disable quoting. -# -m4_changequote(`') +m4_define([__source_filter_entries__], +[m4_equote()__source_filter_entries_impl__([$1])[]m4_dquote()]) +# Disable comments and quoting. # +m4_changecom([]) +m4_changequote([]) m4_divert(0)m4_dnl diff --git a/build/meta/vc9proj.m4 b/build/meta/vc9proj.m4 index a79355a..57bb1b7 100644 --- a/build/meta/vc9proj.m4 +++ b/build/meta/vc9proj.m4 @@ -4,31 +4,33 @@ m4_divert(-1) # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -m4_include(__meta_base__`/common.m4') +m4_changequote([, ]) -m4_define(`__path_impl__', `m4_translit(__env_impl__(`$1'),`/',`\')') -m4_define(`__path__', `m4_equote()__path_impl__(`$1')`'m4_dquote()') +m4_include(__meta_base__[/common.m4]) -m4_define(`__file_impl__', `__env_impl__(`$1')') -m4_define(`__file__', `m4_equote()__file_impl__(`$1')`'m4_dquote()') +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()]) # file # -m4_define(`__file_entry_impl__',` +m4_define([__file_entry_impl__],[ - ') + ]) -m4_define(`__file_entry__', -`m4_equote()__file_entry_impl__(`$1')`'m4_equote()') +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_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [__file_entry_impl__(__f)])]) -m4_define(`__file_entries__', -`m4_equote()__file_entries_impl__(`$1')`'m4_equote()') +m4_define([__file_entries__], +[m4_equote()__file_entries_impl__([$1])[]m4_dquote()]) # source # @@ -36,42 +38,42 @@ m4_define(`__file_entries__', # $1 - configuration # $2 - directory # -m4_define(`__source_config_entry_impl__',` +m4_define([__source_config_entry_impl__],[ - ') + ]) -m4_define(`__source_config_impl__', -`m4_ifelse(`$1', `$2', `', -`m4_foreach(`__c', -`__value_impl__(`configurations')', -`__source_config_entry_impl__(__c, `$1')')')') +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__',` +m4_define([__source_entry_impl__],[ m4_dnl -__source_config_impl__(m4_patsubst(`$1', `^\(.*\)\\\(.*\)$', `\1'), `$1') - ') +__source_config_impl__(m4_patsubst([$1], [^\(.*\)\\\(.*\)$], [\1]), [$1]) + ]) -m4_define(`__source_entry__', -`m4_equote()__source_entry_impl__(`$1')`'m4_equote()') +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_impl__], +[m4_foreach_w([__f], __path_impl__([$1]), [__source_entry_impl__(__f)])]) -m4_define(`__source_entries__', -`m4_equote()__source_entries_impl__(`$1')`'m4_equote()') +m4_define([__source_entries__], +[m4_equote()__source_entries_impl__([$1])[]m4_dquote()]) -# Disable quoting. -# -m4_changequote(`') +# Disable comments and quoting. # +m4_changecom([]) +m4_changequote([]) m4_divert(0)m4_dnl -- cgit v1.1