extracted MSW-specific setup.h options to their own wx/msw/setup_inc.h file which is now used to automaitcally generate both wx/msw/setup0.h and setup.h.in by update-setup-h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,18 +24,19 @@ msg()
|
||||
}
|
||||
|
||||
# write all the common options to stdout, massaging them specially if they are
|
||||
# meant to be included in a configure input file setup.h.in (the name of the
|
||||
# file the common options are meant to be included in is the parameter)
|
||||
# meant to be included in a configure input file setup.h.in
|
||||
#
|
||||
# usage: cat_common_options_for setup_inc.h setup0.h
|
||||
cat_common_options_for()
|
||||
{
|
||||
# get rid of the copyright header on top of the file
|
||||
cmd="sed '1,/^$/d' include/wx/setup_inc.h"
|
||||
cmd="sed '1,/^\$/d' $1"
|
||||
|
||||
# the file used for configure is special: we need to get rid of C++
|
||||
# comments in it because it is included by some C code and we also have to
|
||||
# set all options to 0 by default as they're put to 1 only by configure
|
||||
# (and hence any #ifdefs setting default values for them become unneeded)
|
||||
if [ $1 = "setup.h.in" ]; then
|
||||
if [ $2 = "setup.h.in" ]; then
|
||||
cmd="$cmd | sed -e '/^\/\//d' \
|
||||
-e 's@ *//.*\$@@' \
|
||||
-e 's/# *define \(.\+\) \+1 *\$/#define \1 0/'"
|
||||
@@ -46,9 +47,16 @@ cat_common_options_for()
|
||||
|
||||
# update the single setup.h file passed in as the parameter if it is out of
|
||||
# date
|
||||
#
|
||||
# usage: update_single_setup_h {common|MSW} setup_inc.h setup0.h
|
||||
update_single_setup_h()
|
||||
{
|
||||
if [ include/wx/setup_inc.h -ot $1 ]; then
|
||||
section=$1
|
||||
shift
|
||||
setup_inc=$1
|
||||
shift
|
||||
|
||||
if [ $setup_inc -ot $1 ]; then
|
||||
echo "Skipping $1 which is already up to date."
|
||||
return 0
|
||||
fi
|
||||
@@ -56,9 +64,9 @@ update_single_setup_h()
|
||||
echo -n "Updating $1 ..."
|
||||
|
||||
tmp=$i.$$.tmp
|
||||
sed -e '/^\/\* --- start common options --- \*\/$/q' $1 > $tmp &&
|
||||
cat_common_options_for $1 >> $tmp &&
|
||||
sed -n -e '/^\/\* --- end common options --- \*\/$/,$p' $1 >> $tmp &&
|
||||
sed -e "/^\/\* --- start $section options --- \*\/\$/q" $1 > $tmp &&
|
||||
cat_common_options_for $setup_inc $1 >> $tmp &&
|
||||
sed -n -e "/^\/\* --- end $section options --- \*\/\$/,\$p" $1 >> $tmp &&
|
||||
mv $tmp $1
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -70,19 +78,34 @@ update_single_setup_h()
|
||||
fi
|
||||
}
|
||||
|
||||
# wrapper for update_single_setup_h which only updates the common options
|
||||
update_common_setup_h()
|
||||
{
|
||||
update_single_setup_h common include/wx/setup_inc.h $1
|
||||
}
|
||||
|
||||
# wrapper for update_single_setup_h which only updates the MSW options
|
||||
update_msw_setup_h()
|
||||
{
|
||||
update_single_setup_h MSW include/wx/msw/setup_inc.h $1
|
||||
}
|
||||
|
||||
# entry point
|
||||
if [ ! -f wxwin.m4 ]; then
|
||||
error "$0: must be ran from root wx directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
update_single_setup_h include/wx/msw/setup0.h
|
||||
update_single_setup_h include/wx/msw/wince/setup.h
|
||||
update_single_setup_h include/wx/mac/setup0.h
|
||||
update_single_setup_h include/wx/palmos/setup0.h
|
||||
update_single_setup_h include/wx/os2/setup0.h
|
||||
update_single_setup_h include/wx/motif/setup0.h
|
||||
update_single_setup_h setup.h.in
|
||||
update_common_setup_h include/wx/msw/setup0.h
|
||||
update_common_setup_h include/wx/msw/wince/setup.h
|
||||
update_common_setup_h include/wx/mac/setup0.h
|
||||
update_common_setup_h include/wx/palmos/setup0.h
|
||||
update_common_setup_h include/wx/os2/setup0.h
|
||||
update_common_setup_h include/wx/motif/setup0.h
|
||||
update_common_setup_h setup.h.in
|
||||
|
||||
update_msw_setup_h include/wx/msw/setup0.h
|
||||
update_msw_setup_h setup.h.in
|
||||
|
||||
exit $rc
|
||||
|
||||
|
Reference in New Issue
Block a user