]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/build_packages.sh
Mac compilation fix after const patch
[wxWidgets.git] / wxPython / distrib / build_packages.sh
1 #!/bin/bash
2
3 PY_VERSION=$1
4 shift
5
6 unicode=no
7 debug=no
8
9 for flag in $*; do
10 case ${flag} in
11 debug) debug=yes ;;
12 unicode) unicode=yes ;;
13 esac
14 done
15
16 if [ "$WXWIN" = "" ]; then
17 export WXWIN=`pwd`/../..
18 fi
19
20 echo "wxWidgets directory is: $WXWIN"
21
22 if [ "$OSTYPE" = "cygwin" ]; then
23 # do setup of build environment vars
24 if [ "$TOOLS" = "" ]; then
25 export TOOLS=`cygpath C:\\`
26 fi
27
28 if [ "$SWIGDIR" = "" ]; then
29 export SWIGDIR=$TOOLS/SWIG-1.3.24
30 fi
31
32 # copy wxPython build scripts
33 cp $WXWIN/wxPython/distrib/msw/.m* $WXWIN/build/msw
34
35 # setup wxPython defines
36 cp $WXWIN/include/wx/msw/setup0.h $WXWIN/include/wx/msw/setup.h
37 $TOOLS/Python$PY_VERSION/python `cygpath -d $WXWIN/wxPython/distrib/create_setup.h.py` $@
38
39 export PATH=${PATH}:${WXWIN}/lib/vc_dll
40
41 cd $WXWIN/build/msw
42 # remove old build files
43 rm -rf vc_msw*
44 UNI=
45 if [ $unicode = yes ]; then
46 UNI=-uni
47 fi
48 ./.make hybrid$UNI
49
50 # make tools for docs creation, etc.
51 ./.make_tools
52
53 # update the language files
54 cd $WXWIN/locale
55 make allmo
56
57 # TODO: Make the documentation
58 cd $WXWIN/wxPython
59 #distrib/makedocs
60
61 $TOOLS/Python$PY_VERSION/python `cygpath -d distrib/makemo.py`
62
63 rm -rf build build.unicode
64 rm -rf wx/*.pyd
65
66 # re-generate SWIG files
67 b $PY_VERSION t
68
69 # build the hybrid extension
70 # NOTE: Win Python needs Windows-style pathnames, so we
71 # need to convert
72 export WXWIN=`cygpath -d $WXWIN`
73 export SWIGDIR=`cygpath -d $SWIGDIR`
74
75 DEBUG_FLAG=
76 UNICODE_FLAG=
77 if [ "$DEBUG" != "" ]; then
78 DEBUG_FLAG=--debug
79 fi
80 if [ $unicode = yes ]; then
81 UNICODE_FLAG="UNICODE=1"
82 fi
83 b $PY_VERSION h $DEBUG_FLAG $UNICODE_FLAG
84
85 # make the dev package
86 #distrib/makedev
87
88 $TOOLS/Python$PY_VERSION/python distrib/make_installer_inno4.py $UNICODE_FLAG
89 exit
90 elif [ "$OSTYPE" = "darwin" ]; then
91 cd $WXWIN/wxPython
92
93 # re-generate SWIG files
94 ./b $PY_VERSION t
95
96 PY_DOT_VER=2.3
97 if [ "$PY_VERSION" = "24" ]; then
98 PY_DOT_VER=2.4
99 fi
100
101 UNICODE_OPT=
102 if [ $unicode = yes ]; then
103 UNICODE_OPT=unicode
104 fi
105
106 sudo distrib/mac/wxPythonOSX/build $PY_DOT_VER panther inplace $UNICODE_OPT
107 exit
108 else
109 echo "OSTYPE $OSTYPE not yet supported by this build script."
110 fi