added the rungccxml.sh script and the setup_gccxml.h file to make it easier to genera...
[wxWidgets.git] / utils / ifacecheck / rungccxml.sh.in
1 #!/bin/bash
2
3 # $Id$
4 #
5 # Runs gccxml on the wxWidgets include folder, in order to build the XML
6 # file to fetch to ifacecheck to check the coherency of the wxWidgets
7 # interface headers with the "real" ones.
8
9
10 ## CONSTANTS
11 ############
12
13
14 gccxmloutput="wxapi.xml" # where do we put the gccXML output:
15 allheaders="/tmp/wx-all.h" # headers which includes all wx public headers
16
17 # the list of all wxWidgets public headers
18 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"
19
20
21
22 ## MAIN
23 #######
24
25 if [[ ! -z "$1" ]]; then
26 echo "This script does not accept arguments."
27 echo "Usage: $0"
28 echo "Creates a '$gccxmloutput' file which you can pass to ifacecheck."
29 exit 1
30 fi
31
32 me=$(basename $0)
33 path=${0%%/$me}
34 current=$(pwd) # current path
35
36 gccxmloutput="$current/$gccxmloutput"
37
38 cd @top_srcdir@/include # go to wx include folder
39
40 # now filter it
41 headerlist=`$listcmd | grep -v wxshl | grep -v wx_cw | grep -v setup | grep -v xti | grep -v dde.h | grep -v fmappriv`
42
43 cd $current # return to the original path
44
45 # create the header file to pass to gccxml
46 if [[ -f $allheaders ]]; then rm $allheaders; fi
47 for f in $headerlist; do
48 echo "#include <$f>" >> $allheaders
49 done
50
51 # filter the configure flags to pass to gccxml
52 flags="@CXXFLAGS@"
53
54 # NOTE: it's important to define __WXDEBUG__ because some functions of wx
55 # are declared (and thus parsed by gcc) only if that symbol is defined;
56 # so we remove __WXDEBUG__ symbol from $flags, in case it's defined:
57 flags=`echo "$flags" | sed -e 's/-pthread//g' | sed -e 's/__WXDEBUG__//g'`
58
59 # run gccxml with the same flag used for the real compilation of wx sources:
60 echo "Running gccxml on the $allheaders file..."
61 if [[ -f "$gccxmloutput" ]]; then rm $gccxmloutput; fi
62 gccxml -I . -I @top_srcdir@/include $flags -D__WX@TOOLKIT@__ -DWXBUILDING $allheaders -fxml=$gccxmloutput
63
64 # cleanup
65 rm $allheaders