2
##############################################################################
3
# Name: build/update-setup.h
4
# Purpose: run from root wx directory to update wx/*/setup.h files: those
5
# having special comment markers in them will be update using
6
# include/wx/setup_inc.h contents
8
# RCS-ID: $Id: update-setup-h 71726 2012-06-12 21:41:59Z VZ $
9
# Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
10
# Licence: wxWindows licence
11
##############################################################################
22
# TODO: only output from here if "quiet" option is not given
26
# write all the common options to stdout, massaging them specially if they are
27
# meant to be included in a configure input file setup.h.in
29
# usage: cat_common_options_for setup_inc.h setup0.h
30
cat_common_options_for()
32
# get rid of the copyright header on top of the file
33
cmd="sed '1,/^\$/d' $1"
35
# the file used for configure is special: we need to get rid of C++
36
# comments in it because it is included by some C code and we also have to
37
# set all options to 0 by default as they're put to 1 only by configure
38
# (and hence any #ifdefs setting default values for them become unneeded)
39
if [ $2 = "setup.h.in" ]; then
40
cmd="$cmd | sed -e '/^\/\//d' \
42
-e 's/# *define \(.\+\) \+1 *\$/#define \1 0/'"
48
# update the single setup.h file passed in as the parameter if it is out of
51
# usage: update_single_setup_h {common|MSW} setup_inc.h setup0.h
52
update_single_setup_h()
59
if [ $setup_inc -ot $1 ]; then
60
echo "Skipping $1 which is already up to date."
64
echo -n "Updating $1 ..."
67
sed -e "/^\/\* --- start $section options --- \*\/\$/q" $1 > $tmp &&
68
cat_common_options_for $setup_inc $1 >> $tmp &&
69
sed -n -e "/^\/\* --- end $section options --- \*\/\$/,\$p" $1 >> $tmp &&
74
error "$0: failed to update file $1"
81
# wrapper for update_single_setup_h which only updates the common options
82
update_common_setup_h()
84
update_single_setup_h common include/wx/setup_inc.h $1
87
# wrapper for update_single_setup_h which only updates the MSW options
90
update_single_setup_h MSW include/wx/msw/setup_inc.h $1
94
if [ ! -f wxwin.m4 ]; then
95
error "$0: must be ran from root wx directory"
99
update_common_setup_h include/wx/motif/setup0.h
100
update_common_setup_h include/wx/msw/setup0.h
101
update_common_setup_h include/wx/msw/wince/setup.h
102
update_common_setup_h include/wx/gtk/setup0.h
103
update_common_setup_h include/wx/osx/setup0.h
104
update_common_setup_h include/wx/os2/setup0.h
105
update_common_setup_h include/wx/univ/setup0.h
106
update_common_setup_h setup.h.in
108
update_msw_setup_h include/wx/msw/setup0.h
109
update_msw_setup_h include/wx/gtk/setup0.h
110
update_msw_setup_h setup.h.in
112
update_single_setup_h wxUniv include/wx/univ/setup_inc.h include/wx/univ/setup0.h