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
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 (the name of the
28 # file the common options are meant to be included in is the parameter)
29 cat_common_options_for
()
31 # get rid of the copyright header on top of the file
32 cmd
="sed '1,/^$/d' include/wx/setup_inc.h"
34 # the file used for configure is special: we need to get rid of C++
35 # comments in it because it is included by some C code and we also have to
36 # set all options to 0 by default as they're put to 1 only by configure
37 # (and hence any #ifdefs setting default values for them become unneeded)
38 if [ $1 = "setup.h.in" ]; then
39 cmd
="$cmd | sed -e '/^\/\//d' \
41 -e 's/# *define \(.\+\) \+1 *\$/#define \1 0/'"
47 # update the single setup.h file passed in as the parameter if it is out of
49 update_single_setup_h
()
51 if [ include
/wx
/setup_inc.h
-ot $1 ]; then
52 echo "Skipping $1 which is already up to date."
56 echo -n "Updating $1 ..."
59 sed -e '/^\/\* --- start common options --- \*\/$/q' $1 > $tmp &&
60 cat_common_options_for
$1 >> $tmp &&
61 sed -n -e '/^\/\* --- end common options --- \*\/$/,$p' $1 >> $tmp &&
66 error
"$0: failed to update file $1"
74 if [ ! -f wxwin.
m4 ]; then
75 error
"$0: must be ran from root wx directory"
79 update_single_setup_h include
/wx
/msw
/setup0.h
80 update_single_setup_h include
/wx
/msw
/wince
/setup.h
81 update_single_setup_h include
/wx
/mac
/setup0.h
82 update_single_setup_h include
/wx
/palmos
/setup0.h
83 update_single_setup_h include
/wx
/os
2/setup0.h
84 update_single_setup_h include
/wx
/motif
/setup0.h
85 update_single_setup_h setup.h.
in