]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/all/do-build-windows
Don't build the old versions of OGL or iewin by default anymore
[wxWidgets.git] / wxPython / distrib / all / do-build-windows
CommitLineData
e4bb5998
RD
1#!/bin/bash
2# ---------------------------------------------------------------------------
3# Build wxWidgets and wxPython on a Windows box. This is normally called
4# from build-all but it should be able to be used standalone too...
5#
6# The command line must have the following parameters:
7#
8# 1. the path to the base of the wx source tree
9# 2. the path of where to put the resulting installers
10# 3. skipclean flag (yes|no)
11# 4. the VERSION
12# 5. the remaining args are the versions of Python to build for
13#
14# ---------------------------------------------------------------------------
15
16set -o errexit
17#set -o xtrace
18
19echo "-=-=-=- Hello from $HOSTNAME -=-=-=-"
20
21if [ $# -lt 5 ]; then
22 echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..."
23 exit 1
24fi
25
26WXDIR=$1
27DESTDIR=$2
28SKIPCLEAN=$3
29VERSION=$4
3d6c749c 30PYVER=$5
e4bb5998
RD
31
32
33# WXDIR is the cygwin path, WXWIN is the DOS path
34WXWIN_OLD=$WXWIN
35WXWIN=`cygpath -w $WXDIR`
36export WXWIN
37
38
39# # Fix the PATH. (Why is this needed??)
40# PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/robind/bin:.:$WXDIR/lib/vc_dll:$PATH
41# export PATH
42# echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
43# echo $PATH
44# echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
45# exit 0
46
3d6c749c
RD
47# setup the compiler
48if [ $PYVER = 2.3 ]; then
49 echo "Using MSVC ver 6"
50 . msvcset local 6
51 echo `which cl.exe`
52else
53 echo "Using MSVC ver 7"
54 . msvcset local 7
55 echo `which cl.exe`
56fi
57
e4bb5998
RD
58
59# untar the source
60echo "Unarchiving wxPython-src-$VERSION.tar.gz"
61cd $DESTDIR
62tar xzf wxPython-src-$VERSION.tar.gz
63rm wxPython-src-$VERSION.tar.gz
64
65
66# Fix line endings
67echo "Converting wxPython line endings to CRLF..."
68cd $WXDIR
69names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.xml" `
70unix2dos -D $names
71
72
73# change to the right spot in the source tree and copy our build scripts
74echo "Setting up for the build..."
75cd $WXDIR/build/msw
76cp $WXDIR/wxPython/distrib/msw/.m* .
3d6c749c 77chmod +x .m*
e4bb5998
RD
78
79
80# replace some settings in setup0.h and write to setup.h
81cat > .my.sedexpr <<EOF
82s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g
83s/wxUSE_DEBUG_CONTEXT *0/wxUSE_DEBUG_CONTEXT 1/g
84s/wxUSE_MEMORY_TRACING *0/wxUSE_MEMORY_TRACING 1/g
85s/wxUSE_DIALUP_MANAGER *1/wxUSE_DIALUP_MANAGER 0/g
86s/wxUSE_GLCANVAS *0/wxUSE_GLCANVAS 1/g
87s/wxUSE_POSTSCRIPT *0/wxUSE_POSTSCRIPT 1/g
88s/wxUSE_AFM_FOR_POSTSCRIPT *1/wxUSE_AFM_FOR_POSTSCRIPT 0/g
89s/wxUSE_DISPLAY *0/wxUSE_DISPLAY 1/g
90EOF
91cat $WXDIR/include/wx/msw/setup0.h | sed -f .my.sedexpr > $WXDIR/include/wx/msw/setup.h
92rm .my.sedexpr
93
94
95echo "Building the wx DLLs..."
96.make hybrid
97.make hybrid-uni
98
99
100#echo "Building the wx tools..."
101#.make_tools
102
103# cheat and just copy the .CHM files from the regular project dir
104# TODO: Copy over the wxPython-docs fle and run hhc on the contents of that.
105mkdir -p $WXDIR/docs/htmlhelp
106cp `cygpath $WXWIN_OLD/docs/htmlhelp`/*.chm $WXDIR/docs/htmlhelp
107
108
109echo "Building wxPython and installers..."
110cd $WXDIR/wxPython
111mkdir -p dist
112
113for ver in $PYVER; do
114 echo $ver
115 b $ver d USE_SWIG=0
116 b $ver h USE_SWIG=0 EP_ADD_OPTS=1
117 b $ver r USE_SWIG=0
118 b $ver d UNICODE=1 USE_SWIG=0
119 b $ver h UNICODE=1 USE_SWIG=0 EP_ADD_OPTS=1
120 b $ver r UNICODE=1 USE_SWIG=0
121done
122
123echo "Building the developer package..."
124WXWIN=`cygpath -w $WXDIR`
125export WXWIN
1264nt /c distrib/makedev.bat $VERSION
127
128
129echo "Copying installers to $DESTDIR..."
130mv dist/wxPython* $DESTDIR
131cd $DESTDIR
132
133
134if [ $SKIPCLEAN != yes ]; then
135 echo "Cleaning up..."
136 rm -r $WXDIR || true
137fi
138
139echo "-=-=-=- Goodbye! -=-=-=-"