panda3d/direct/src/ffi/genPyCode

107 lines
3.3 KiB
Bash
Executable File

#! /bin/sh
# This is just a helper script to generatePythonCode to cover
# the three or four cases we use all the time
# usage: genPyCode [-t] win-[linux/win-debug/win-release/win-publish] [other libs]
# -t adds libtoontown
firstarg="$1"
extra_genPyCode_libs=""
fSqueeze="squeezeMe"
optimizeFlag=""
ppythonOptimizeFlag=""
if [ "$firstarg" = "-t" ]; then
extra_genPyCode_libs="$extra_genPyCode_libs libtoontown"
shift
firstarg="$1"
fi
if [ "$firstarg" = "-b" ]; then
extra_genPyCode_libs="$extra_genPyCode_libs libbartop"
shift
firstarg="$1"
fi
if [ "$firstarg" = "-tt" ]; then
extra_genPyCode_libs="$extra_genPyCode_libs libttrader"
shift
firstarg="$1"
fi
if [ "$firstarg" = "-v" ]; then
extra_genPyCode_libs="$extra_genPyCode_libs libvrpn"
shift
firstarg="$1"
fi
if [ "$firstarg" = "-ns" ]; then
fSqueeze=""
shift
firstarg="$1"
fi
shift
extra_genPyCode_libs="$extra_genPyCode_libs $*"
if [ "$firstarg" = "linux" ]; then
pyDir=$DIRECT/lib/py
cd $DIRECT/bin
ppython -d generatePythonCode -v -d $pyDir -e $DIRECT/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
pSqueezer=$DIRECT/src/showbase/pandaSqueezer.py
fi
if [ "$firstarg" = "win-debug" ]; then
pyDir=`cygpath -w $DIRECT/lib/py`
cd $DIRECT/bin
ppython -d generatePythonCode -v -d $pyDir -e `cygpath -w $DIRECT/src/extensions` -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
fi
if [ "$firstarg" = "win-release" ]; then
pyDir=`cygpath -w $DIRECT/lib/py`
cd $DIRECT/bin
ppython generatePythonCode -v -d $pyDir -e `cygpath -w $DIRECT/src/extensions` -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
pSqueezer=`cygpath -w $DIRECT/src/showbase/pandaSqueezer.py`
fi
if [ "$firstarg" = "win-publish" ]; then
# no assertions, no comments, no docstrings
pyDir=`cygpath -w $DIRECT/lib/py`
cd $DIRECT/bin
ppython -OO generatePythonCode -O -v -d $pyDir -e `cygpath -w $DIRECT/src/extensions` -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
optimizeFlag="-O"
ppythonOptimizeFlag="-OO"
pSqueezer=`cygpath -w $DIRECT/src/showbase/pandaSqueezer.py`
fi
if [ "$firstarg" = "install" ]; then
# as installed on a machine without ctattach etc.
pyDir=install/lib/py
install/bin/ppython -d install/bin/generatePythonCode -O -v -d $pyDir -e direct/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
pSqueezer=../../direct/src/showbase/pandaSqueezer.py
fi
if [ "$firstarg" = "release" ]; then
# as installed on a machine without ctattach etc.
pyDir=install/lib/py
install/bin/ppython install/bin/generatePythonCode -v -d $pyDir -e direct/src/extensions -i libdtoolconfig libpandaexpress libpanda libpandaphysics libdirect $extra_genPyCode_libs || exit
pSqueezer=../../direct/src/showbase/pandaSqueezer.py
fi
if [ "$fSqueeze" = "squeezeMe" ]; then
echo SQUEEZING PandaModules
cd $pyDir
rm -f PandaModules.py*
ppython $ppythonOptimizeFlag $pSqueezer $optimizeFlag || exit
else
cd $pyDir
echo RENAMING PandaModulesUnsqueezed.py to PandaModules.py
rm -f PandaModules.py*
mv PandaModulesUnsqueezed.py PandaModules.py
fi
echo DONE