wxWidgets/utils/ifacecheck/rungccxml.sh.in
Francesco Montorsi 97f0dbd6f8 BIG CHANGES:
- removed fix from the rungccxml.sh.in; not only it was unnecessary
  but it's also better to keep all references to specific wxWidgets
  classes in a single place: the ifacecheck sources;
- added g_bLogEnabled and LogNull class;
- added an HACK_TO_AUTO_CORRECT_ONLY_VIRTUAL_AND_CONST_ATTRIBUTES
  mode for fixing virtualness and constness of interface headers
  in an automated way
- added options to wxMethod::GetAsString to provide an easier way
  to debug ifacecheck comparisons between wxMethods
- fixed wxMethod::FixMethod for single-line prototypes and added
  a boolean return value from it


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-22 21:55:38 +00:00

84 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
# $Id$
#
# Runs gccxml on the wxWidgets include folder, in order to build the XML
# file to fetch to ifacecheck to check the coherency of the wxWidgets
# interface headers with the "real" ones.
## CONSTANTS
############
gccxmloutput="wxapi.xml" # the file where we store the gccXML output
preprocoutput="wxapi-preproc.txt" # the file where we store the preprocessor's #define values
allheaders="/tmp/wx-all.h" # the header which includes all wx public headers (autogenerated)
# the list of all wxWidgets public headers
listcmd="ls wx/*.h wx/aui/*.h wx/html/*.h wx/protocol/*.h wx/richtext/*.h wx/stc/*.h wx/xml/*.h wx/xrc/*.h"
## MAIN
#######
if [[ ! -z "$1" ]]; then
echo "This script does not accept arguments."
echo "Usage: $0"
echo "Creates a '$gccxmloutput' file which you can pass to ifacecheck."
exit 1
fi
me=$(basename $0)
path=${0%%/$me}
current=$(pwd) # current path
#gccxmloutput="$current/$gccxmloutput"
cd @top_srcdir@/include # go to wx include folder
# now filter it
headerlist=`$listcmd | grep -v wxshl | grep -v wx_cw | grep -v setup | grep -v xti | grep -v dde.h | grep -v fmappriv`
cd $current # return to the original path
# create the header file to pass to gccxml
echo "Creating the $allheaders dummy file which #includes all wxWidgets interface header files..."
if [[ -f $allheaders ]]; then rm $allheaders; fi
for f in $headerlist; do
echo "#include <$f>" >> $allheaders
done
# filter the configure flags to pass to gccxml
flags="@CXXFLAGS@"
# NOTE: it's important to define __WXDEBUG__ because some functions of wx
# are declared (and thus parsed by gcc) only if that symbol is defined.
# So we remove it from $flags (in case it's defined) and then readd it.
flags=`echo "$flags" | sed -e 's/-pthread//g' | sed -e 's/__WXDEBUG__//g'`
# append some other flags:
flags="-I . -I @top_srcdir@/include $flags -D__WXDEBUG__ -D__WX@TOOLKIT@__ -DWXBUILDING $allheaders"
# run gccxml with the same flag used for the real compilation of wx sources:
echo "Running gccxml on the $allheaders file... results in $gccxmloutput"
if [[ -f "$gccxmloutput" ]]; then rm $gccxmloutput; fi
gccxml $flags -fxml=$gccxmloutput
if [[ $? != 0 ]]; then
echo "Errors running gccxml... aborting."
exit
fi
# now get the list of the #defined values for wx headers, so that the result
# can be passed to ifacecheck to aid the comparison
echo "Running gccxml's preprocessor on the $allheaders file... results in $preprocoutput"
gccxml -E -dM $flags >$preprocoutput
if [[ $? != 0 ]]; then
echo "Errors running gccxml preprocessor... aborting."
exit
fi
# cleanup
rm $allheaders