]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/all/build-windows
in unescape add normal characters in addition to unescaped characters :)
[wxWidgets.git] / wxPython / distrib / all / build-windows
CommitLineData
36e91097
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
30shift;shift;shift;shift
31PYVER=$@
32
d6624155 33
36e91097
RD
34# WXDIR is the cygwin path, WXWIN is the DOS path
35WXWIN_OLD=$WXWIN
28d1454a 36WXWIN=`cygpath -w $WXDIR`
36e91097
RD
37export WXWIN
38
36e91097 39
d6624155
RD
40# # Fix the PATH. (Why is this needed??)
41# PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/robind/bin:.:$WXDIR/lib/vc_dll:$PATH
42# export PATH
43# echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
44# echo $PATH
45# echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
46# exit 0
47
48
49# untar the source
28d1454a 50echo "Unarchiving wxPython-src-$VERSION.tar.gz"
d6624155 51cd $DESTDIR
28d1454a
RD
52tar xzf wxPython-src-$VERSION.tar.gz
53rm wxPython-src-$VERSION.tar.gz
d6624155
RD
54
55
56# Fix line endings
57echo "Converting wxPython line endings to CRLF..."
58cd $WXDIR
28d1454a 59names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.xml" `
d6624155
RD
60unix2dos -D $names
61
62
63# change to the right spot in the source tree and copy our build scripts
64echo "Setting up for the build..."
36e91097
RD
65cd $WXDIR/build/msw
66cp $WXDIR/wxPython/distrib/msw/.m* .
67
d6624155 68
36e91097
RD
69# replace some settings in setup0.h and write to setup.h
70cat > .my.sedexpr <<EOF
d6624155 71s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g
36e91097
RD
72s/wxUSE_DEBUG_CONTEXT *0/wxUSE_DEBUG_CONTEXT 1/g
73s/wxUSE_MEMORY_TRACING *0/wxUSE_MEMORY_TRACING 1/g
74s/wxUSE_DIALUP_MANAGER *1/wxUSE_DIALUP_MANAGER 0/g
75s/wxUSE_GLCANVAS *0/wxUSE_GLCANVAS 1/g
76s/wxUSE_POSTSCRIPT *0/wxUSE_POSTSCRIPT 1/g
77s/wxUSE_AFM_FOR_POSTSCRIPT *1/wxUSE_AFM_FOR_POSTSCRIPT 0/g
78s/wxUSE_DISPLAY *0/wxUSE_DISPLAY 1/g
79EOF
80cat $WXDIR/include/wx/msw/setup0.h | sed -f .my.sedexpr > $WXDIR/include/wx/msw/setup.h
81rm .my.sedexpr
82
83
84echo "Building the wx DLLs..."
85.make hybrid
86.make hybrid-uni
87
d6624155 88
28d1454a
RD
89#echo "Building the wx tools..."
90#.make_tools
36e91097
RD
91
92# cheat and just copy the .CHM files from the regular project dir
28d1454a 93# TODO: Copy over the wxPython-docs fle and run hhc on the contents of that.
36e91097
RD
94mkdir -p $WXDIR/docs/htmlhelp
95cp `cygpath $WXWIN_OLD/docs/htmlhelp`/*.chm $WXDIR/docs/htmlhelp
96
97
98echo "Building wxPython and installers..."
99cd $WXDIR/wxPython
8396fb3f 100mkdir -p dist
36e91097
RD
101
102for ver in $PYVER; do
103 echo $ver
104 b $ver d USE_SWIG=0
28d1454a 105 b $ver h USE_SWIG=0 EP_ADD_OPTS=1
36e91097
RD
106 b $ver r USE_SWIG=0
107 b $ver d UNICODE=1 USE_SWIG=0
28d1454a 108 b $ver h UNICODE=1 USE_SWIG=0 EP_ADD_OPTS=1
36e91097
RD
109 b $ver r UNICODE=1 USE_SWIG=0
110done
111
112echo "Building the developer package..."
d6624155
RD
113WXWIN=`cygpath -w $WXDIR`
114export WXWIN
36e91097
RD
1154nt /c distrib/makedev.bat $VERSION
116
117
118echo "Copying installers to $DESTDIR..."
28d1454a 119mv dist/wxPython* $DESTDIR
36e91097
RD
120cd $DESTDIR
121
122
123if [ $SKIPCLEAN != yes ]; then
124 echo "Cleaning up..."
5dda6ad8 125 rm -r $WXDIR || true
36e91097
RD
126fi
127
128echo "-=-=-=- Goodbye! -=-=-=-"