1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/bin/bash
# ---------------------------------------------------------------------------
# New and improved build script for wrapping build-wxpython.py and
# only needing to use super-simple one or two letter command line args.
# ---------------------------------------------------------------------------
set -o errexit
#set -o xtrace
# Why are these not being translated already like they used to be?
if [ "$OSTYPE" = "cygwin" ]; then
TOOLS=`cygpath -u $TOOLS`
#PROJECTS=`cygpath -u $PROJECTS`
fi
if [ "$PYTHON" = "" ]; then
case $1 in
23 | 2.3) VER=23; PYVER=2.3; shift ;;
24 | 2.4) VER=24; PYVER=2.4; shift ;;
25 | 2.5) VER=25; PYVER=2.5; shift ;;
26 | 2.6) VER=26; PYVER=2.6; shift ;;
27 | 2.7) VER=27; PYVER=2.7; shift ;;
30 | 3.0) VER=30; PYVER=3.0; shift ;;
*) VER=27; PYVER=2.7
esac
if [ "$OSTYPE" = "cygwin" ]; then
PYTHON=$TOOLS/python$VER/python.exe
else
PYTHON=python$PYVER
fi
fi
echo "Using:" `which $PYTHON`
$PYTHON -c "import sys;print sys.version, '\n'"
if [ "$SWIG" = "" ]; then
if [ "$OSTYPE" = "cygwin" ]; then
SWIG=$PROJECTS\\SWIG-1.3.29\\swig.exe
else
SWIG=/opt/swig/bin/swig-1.3.29
fi
fi
export SWIG
function show_help {
echo "build commands:"
echo " c clean"
echo " cw clean only wx"
echo " cp clean only wxPython"
echo " ce clean only extension modules"
echo ""
echo " cb clean both debug and release (MSW)"
echo ""
echo " d build debug (default)"
echo " r build release"
echo " b build both debug and release (MSW)"
echo ""
echo " t touch all *.i files"
}
ARGS="--reswig --unicode --build_dir=build/wxbld --prefix=/opt/wx/3.0 --cairo"
DEBUG="--debug"
BOTH="no"
case $1 in
c) ARGS="$ARGS --clean"; shift ;;
cw) ARGS="$ARGS --clean=wx"; shift ;;
cp) ARGS="$ARGS --clean=py"; shift ;;
ce) ARGS="$ARGS --clean=pyext"; shift ;;
cb) BOTH="yes"; ARGS="$ARGS --clean"; shift ;;
cbw) BOTH="yes"; ARGS="$ARGS --clean=wx"; shift ;;
cbp) BOTH="yes"; ARGS="$ARGS --clean=py"; shift ;;
cbe) BOTH="yes"; ARGS="$ARGS --clean=pyext"; shift ;;
d) DEBUG="--debug"; shift ;;
r) DEBUG=""; shift ;;
b) BOTH="yes"; shift ;;
t) find . -name "*.i" | xargs -t touch; echo "*.i files touched"; exit 0 ;;
help) show_help; exit 0 ;;
esac
if [ "$OSTYPE" = "cygwin" -a "$BOTH" = "yes" ]; then
set -o xtrace
$PYTHON -u ./build-wxpython.py $ARGS --debug $@
$PYTHON -u ./build-wxpython.py $ARGS $@
else
set -o xtrace
$PYTHON -u ./build-wxpython.py $ARGS $DEBUG $@
fi
|