-#!/bin/sh
+#!/bin/bash
+
+# Are we using bash on win32? If so source that file and then exit.
+if [ "$OSTYPE" = "cygwin" ]; then
+ source b.win32
+ exit
+fi
+
function getpyver {
if [ "$1" = "15" ]; then
PYVER=2.1
elif [ "$1" = "22" ]; then
PYVER=2.2
+ elif [ "$1" = "23" ]; then
+ PYVER=2.3
else
echo You must specify Python version as first parameter.
exit
SETUP="python$PYVER -u setup.py"
-FLAGS="USE_SWIG=1 IN_CVS_TREE=1" # BUILD_GLCANVAS=0"
+FLAGS="USE_SWIG=1 SWIG=/opt/swig/bin/swig"
OTHERFLAGS=""
+PORTFLAGS=""
+
+
+
+if [ "$1" = "gtk1" -o "$1" = "gtk" ]; then
+ PORTFLAGS="WXPORT=gtk UNICODE=0"
+ shift
+elif [ "$1" = "gtk2" ]; then
+ PORTFLAGS="WXPORT=gtk2 UNICODE=1"
+ shift
+fi
+
+FLAGS="$FLAGS $PORTFLAGS"
+
# "c" --> clean
if [ "$1" = "c" ]; then
shift
- CMD="$SETUP $FLAGS $OTHERFLAGS clean"
- OTHERCMD="rm -f wxPython/*.so"
+ CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
+ OTHERCMD="rm -f wx/*.so"
# "d" --> clean extension modules only
elif [ "$1" = "d" ]; then
shift
- CMD="rm -f wxPython/*.so"
+ CMD="rm -f wx/*.so"
# "t" --> touch *.i files
elif [ "$1" = "t" ]; then
shift
- #CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i"
- CMD='find . -name "*.i" | xargs -l touch'
+ CMD='find . -name "*.i" | xargs touch'
# "i" --> install
elif [ "$1" = "i" ]; then
shift
- CMD="$SETUP build $OTHERFLAGS install"
+ CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"
# "s" --> source dist
elif [ "$1" = "s" ]; then
shift
- CMD="$SETUP $OTHERFLAGS sdist"
+ CMD="$SETUP $OTHERFLAGS sdist $*"
# "r" --> rpm dist
elif [ "$1" = "r" ]; then
echo $CMD
eval $CMD
+RC=$?
-
-if [ "$OTHERCMD" != "" ]; then
+if [ "$RC" = "0" -a "$OTHERCMD" != "" ]; then
echo $OTHERCMD
$OTHERCMD
+ RC=$?
fi
+exit $RC