]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/distrib/all/build-windows
Restructured for new style RPMs, etc. Can build all the RPMs from a
[wxWidgets.git] / wxPython / distrib / all / build-windows
... / ...
CommitLineData
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
33
34# WXDIR is the cygwin path, WXWIN is the DOS path
35WXWIN_OLD=$WXWIN
36WXWIN=`cygpath -m $WXDIR`
37export WXWIN
38
39
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
50echo "Unarchiving wxPythonSrc-$VERSION.tar.gz"
51cd $DESTDIR
52tar xzf wxPythonSrc-$VERSION.tar.gz
53rm wxPythonSrc-$VERSION.tar.gz
54
55
56# Fix line endings
57echo "Converting wxPython line endings to CRLF..."
58cd $WXDIR
59names=`find wxPython -name "*.py" -o -name "*.txt" -o -name "*.htm*" -o -name "*.css" -o -name "*.h" -o -name "*.cpp" -o -name "*.c" -o -name "*.xml" `
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..."
65cd $WXDIR/build/msw
66cp $WXDIR/wxPython/distrib/msw/.m* .
67
68
69# replace some settings in setup0.h and write to setup.h
70cat > .my.sedexpr <<EOF
71s/wxDIALOG_UNIT_COMPATIBILITY *1/wxDIALOG_UNIT_COMPATIBILITY 0/g
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
88
89echo "Building the wx tools..."
90.make_tools
91
92# cheat and just copy the .CHM files from the regular project dir
93# TODO: Copy over the wxPythonDocs fle and run hhc on the contents of that.
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
100mkdir -p dist
101
102for ver in $PYVER; do
103 echo $ver
104 b $ver d USE_SWIG=0
105 b $ver h USE_SWIG=0
106 b $ver r USE_SWIG=0
107 b $ver d UNICODE=1 USE_SWIG=0
108 b $ver h UNICODE=1 USE_SWIG=0
109 b $ver r UNICODE=1 USE_SWIG=0
110done
111
112echo "Building the developer package..."
113WXWIN=`cygpath -w $WXDIR`
114export WXWIN
1154nt /c distrib/makedev.bat $VERSION
116
117
118echo "Copying installers to $DESTDIR..."
119mv dist/wxPythonWIN32* $DESTDIR
120cd $DESTDIR
121
122
123if [ $SKIPCLEAN != yes ]; then
124 echo "Cleaning up..."
125 rm -r $WXDIR || true
126fi
127
128echo "-=-=-=- Goodbye! -=-=-=-"