1
0
Fork 0
forked from fte/fteqw

Allow cross-compiling etc without forcing to the latest(and breakiest) version. This should help with recreating older builds deterministically, as proof that microsoft suck and that I'm fully complying with the GPL without injecting any malware. Fuck you microsoft. Fuck you and your slander.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5601 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-01-20 17:28:24 +00:00
parent 67b5041ec8
commit 10ca5f2bd6
2 changed files with 96 additions and 11 deletions

View file

@ -89,6 +89,46 @@ else
fi
fi
if [ "$BUILD_CLEAN" == "n" ]; then
NOUPDATE="y"
fi
#check args (and override config as desired)
while [[ $# -gt 0 ]]
do
case $1 in
-r)
SVN_REV_ARG="-r $2"
NOUPDATE=
shift
;;
-j)
THREADS="-j $2"
shift
;;
-help|--help)
echo " -r VER Specifies the SVN revision to update to"
echo " -j THREADS Specifies how many jobs to make with"
echo " --help This text"
exit 0
;;
-build|--build)
TARGET="FTE_CONFIG=$2"
shift
;;
--noupdate)
NOUPDATE="y"
;;
*)
echo "Unknown option $1"
;;
esac
shift
done
if [ "$REUSE_CONFIG" != "y" ]; then
#linux compiles are native-only, so don't bug out on cygwin which lacks a cross compiler.
BUILD_LINUXx86=n
@ -139,6 +179,7 @@ if [ "$REUSE_CONFIG" != "y" ]; then
read -n 1 -p "Build for NaCL? [y/N] " BUILD_NACL && echo
fi
BUILD_CLEAN=${BUILD_CLEAN:-y}
BUILD_LINUXx86=${BUILD_LINUXx86:-y}
BUILD_LINUXx64=${BUILD_LINUXx64:-y}
BUILD_LINUXx32=${BUILD_LINUXx32:-n}
@ -169,6 +210,8 @@ if [ "$UID" != "0" ]; then
echo "NACL_SDK_ROOT=\"$NACLROOT/nacl_sdk/$NACLSDKVERSION\"" >>$FTECONFIG
echo "NACLSDKVERSION=\"$NACLSDKVERSION\"" >>$FTECONFIG
echo "BUILD_CLEAN=\"$BUILD_CLEAN\"" >>$FTECONFIG
echo "BUILD_LINUXx86=\"$BUILD_LINUXx86\"" >>$FTECONFIG
echo "BUILD_LINUXx64=\"$BUILD_LINUXx64\"" >>$FTECONFIG
echo "BUILD_LINUXx32=\"$BUILD_LINUXx32\"" >>$FTECONFIG
@ -381,13 +424,15 @@ if [ "$BUILD_NACL" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ];
fi
#initial checkout of fte's svn
if [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
if [ ! -d $SVNROOT ]; then
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT
else
cd $SVNROOT
svn up
#initial checkout of fte's svn
if [ "$NOUPDATE"!="n" ]; then
if [ ! -d $SVNROOT ]; then
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT $SVN_REV_ARG
else
cd $SVNROOT
svn up $SVN_REV_ARG
fi
fi
#FIXME: there may be race conditions when compiling.
@ -449,3 +494,4 @@ fi
echo "Setup script complete."
echo "When you run build_wip.sh output will be written to $BUILDFOLDER/*"

View file

@ -39,6 +39,45 @@ else
echo "WARNING: $FTECONFIG does not exist yet."
fi
if [ "$BUILD_CLEAN" == "n" ]; then
NOUPDATE="y"
fi
#check args (and override config as desired)
while [[ $# -gt 0 ]]
do
case $1 in
-r)
SVN_REV_ARG="-r $2"
NOUPDATE=
shift
;;
-j)
THREADS="-j $2"
shift
;;
-help|--help)
echo " -r VER Specifies the SVN revision to update to"
echo " -j THREADS Specifies how many jobs to make with"
echo " --help This text"
exit 0
;;
-build|--build)
TARGET="FTE_CONFIG=$2"
shift
;;
--noupdate)
NOUPDATE="y"
;;
*)
echo "Unknown option $1"
;;
esac
shift
done
MAKEARGS="$THREADS $TARGET"
export NACL_SDK_ROOT
########### Emscripten / Web Stuff
@ -84,14 +123,14 @@ fi
mkdir -p $BUILDLOGFOLDER
if [ ! -d $SVNROOT ]; then
#just in case...
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT $SVN_REV_ARG
fi
cd $SVNROOT/
if [ "$BUILD_CLEAN" != "n" ]; then
if [ "$NOUPDATE" != "y" ]; then
echo "SVN Update"
svn update
svn update $SVN_REV_ARG
fi
cd engine
@ -109,8 +148,8 @@ function build {
fi
echo -n "Making $NAME... "
date > $BUILDLOGFOLDER/$DEST.txt
echo make $THREADS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
make $THREADS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
echo make $MAKEARGS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
make $MAKEARGS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
if [ $? -eq 0 ]; then
BUILDEND=$(date +%s)
BUILDTIME=$(( $BUILDEND - $BUILDSTART ))