1. set all wxUSE_XXXs to 0 in the generated setup.h.in

2. don't update the files unless necessary (i.e. check modification time)
3. show progress messages


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-01-16 15:44:44 +00:00
parent c7d94ca4f9
commit 8d51d7d2f9

View File

@ -17,17 +17,55 @@ error()
echo $* 1>&2 echo $* 1>&2
} }
msg()
{
# TODO: only output from here if "quiet" option is not given
echo "$*"
}
# 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)
cat_common_options_for()
{
cmd="cat include/wx/setup_inc.h"
# 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
cmd="$cmd | sed -e '/^\/\//d' \
-e 's@ *//.*\$@@' \
-e 's/#define wxUSE_\(.\+\) \+1/#define wxUSE\1 0/'"
fi
eval $cmd
}
# update the single setup.h file passed in as the parameter if it is out of
# date
update_single_setup_h() update_single_setup_h()
{ {
if [ include/wx/setup_inc.h -ot $1 ]; then
echo "Skipping $1 which is already up to date."
return 0
fi
echo -n "Updating $1..."
tmp=$i.$$.tmp tmp=$i.$$.tmp
sed -e '/^\/\* --- start common options --- \*\/$/q' $1 > $tmp && sed -e '/^\/\* --- start common options --- \*\/$/q' $1 > $tmp &&
cat include/wx/setup_inc.h >> $tmp && cat_common_options_for $1 >> $tmp &&
sed -n -e '/^\/\* --- end common options --- \*\/$/,$p' $1 >> $tmp && sed -n -e '/^\/\* --- end common options --- \*\/$/,$p' $1 >> $tmp &&
mv $tmp $1 mv $tmp $1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg " FAILED"
error "$0: failed to update file $1" error "$0: failed to update file $1"
rc=2 rc=2
else
msg " ok"
fi fi
} }
@ -39,10 +77,7 @@ fi
update_single_setup_h include/wx/msw/setup0.h update_single_setup_h include/wx/msw/setup0.h
update_single_setup_h include/wx/mac/setup0.h update_single_setup_h include/wx/mac/setup0.h
# get rid of C++ comments in this file
update_single_setup_h setup.h.in update_single_setup_h setup.h.in
sed -i -e '/^\/\//d' -e 's@ *//.*$@@' setup.h.in
exit $rc exit $rc