]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/all/do-build-windows
Needed so we can install TaskRunner to Python's site-packages dir and use it from...
[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
e4bb5998 39
3d6c749c
RD
40# setup the compiler
41if [ $PYVER = 2.3 ]; then
42 echo "Using MSVC ver 6"
43 . msvcset local 6
44 echo `which cl.exe`
45else
46 echo "Using MSVC ver 7"
47 . msvcset local 7
48 echo `which cl.exe`
49fi
50
e4bb5998
RD
51
52# untar the source
53echo "Unarchiving wxPython-src-$VERSION.tar.gz"
54cd $DESTDIR
55tar xzf wxPython-src-$VERSION.tar.gz
56rm wxPython-src-$VERSION.tar.gz
57
58
59# Fix line endings
60echo "Converting wxPython line endings to CRLF..."
61cd $WXDIR
62names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.xml" `
63unix2dos -D $names
64
65
66# change to the right spot in the source tree and copy our build scripts
67echo "Setting up for the build..."
68cd $WXDIR/build/msw
69cp $WXDIR/wxPython/distrib/msw/.m* .
3d6c749c 70chmod +x .m*
e4bb5998
RD
71
72
73# replace some settings in setup0.h and write to setup.h
74cat > .my.sedexpr <<EOF
75s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g
8c87c6b4 76s/wxUSE_EXCEPTIONS *1/wxUSE_EXCEPTIONS 0/g
e4bb5998
RD
77s/wxUSE_DEBUG_CONTEXT *0/wxUSE_DEBUG_CONTEXT 1/g
78s/wxUSE_MEMORY_TRACING *0/wxUSE_MEMORY_TRACING 1/g
79s/wxUSE_DIALUP_MANAGER *1/wxUSE_DIALUP_MANAGER 0/g
80s/wxUSE_GLCANVAS *0/wxUSE_GLCANVAS 1/g
81s/wxUSE_POSTSCRIPT *0/wxUSE_POSTSCRIPT 1/g
82s/wxUSE_AFM_FOR_POSTSCRIPT *1/wxUSE_AFM_FOR_POSTSCRIPT 0/g
83s/wxUSE_DISPLAY *0/wxUSE_DISPLAY 1/g
8c87c6b4 84s/wxUSE_DIB_FOR_BITMAP *0/wxUSE_DIB_FOR_BITMAP 1/g
30eb969a 85s/wxUSE_DEBUGREPORT *1/wxUSE_DEBUGREPORT 0/g
e4bb5998
RD
86EOF
87cat $WXDIR/include/wx/msw/setup0.h | sed -f .my.sedexpr > $WXDIR/include/wx/msw/setup.h
88rm .my.sedexpr
89
90
91echo "Building the wx DLLs..."
92.make hybrid
93.make hybrid-uni
94
95
96#echo "Building the wx tools..."
97#.make_tools
98
99# cheat and just copy the .CHM files from the regular project dir
100# TODO: Copy over the wxPython-docs fle and run hhc on the contents of that.
101mkdir -p $WXDIR/docs/htmlhelp
102cp `cygpath $WXWIN_OLD/docs/htmlhelp`/*.chm $WXDIR/docs/htmlhelp
103
104
105echo "Building wxPython and installers..."
106cd $WXDIR/wxPython
107mkdir -p dist
108
109for ver in $PYVER; do
110 echo $ver
1d84f787
RD
111 b $ver d UNICODE=0 USE_SWIG=0
112 b $ver h UNICODE=0 USE_SWIG=0 EP_ADD_OPTS=1
113 b $ver r UNICODE=0 USE_SWIG=0
e4bb5998
RD
114 b $ver d UNICODE=1 USE_SWIG=0
115 b $ver h UNICODE=1 USE_SWIG=0 EP_ADD_OPTS=1
116 b $ver r UNICODE=1 USE_SWIG=0
117done
118
119echo "Building the developer package..."
120WXWIN=`cygpath -w $WXDIR`
121export WXWIN
1224nt /c distrib/makedev.bat $VERSION
123
124
125echo "Copying installers to $DESTDIR..."
126mv dist/wxPython* $DESTDIR
127cd $DESTDIR
128
129
130if [ $SKIPCLEAN != yes ]; then
131 echo "Cleaning up..."
132 rm -r $WXDIR || true
133fi
134
135echo "-=-=-=- Goodbye! -=-=-=-"