Skip to content

Commit 10ca5f2

Browse files
author
Spoike
committed
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
1 parent 67b5041 commit 10ca5f2

File tree

2 files changed

+96
-11
lines changed

2 files changed

+96
-11
lines changed

build_setup.sh

+52-6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,46 @@ else
8989
fi
9090
fi
9191

92+
93+
94+
if [ "$BUILD_CLEAN" == "n" ]; then
95+
NOUPDATE="y"
96+
fi
97+
98+
#check args (and override config as desired)
99+
while [[ $# -gt 0 ]]
100+
do
101+
case $1 in
102+
-r)
103+
SVN_REV_ARG="-r $2"
104+
NOUPDATE=
105+
shift
106+
;;
107+
-j)
108+
THREADS="-j $2"
109+
shift
110+
;;
111+
-help|--help)
112+
echo " -r VER Specifies the SVN revision to update to"
113+
echo " -j THREADS Specifies how many jobs to make with"
114+
echo " --help This text"
115+
exit 0
116+
;;
117+
-build|--build)
118+
TARGET="FTE_CONFIG=$2"
119+
shift
120+
;;
121+
--noupdate)
122+
NOUPDATE="y"
123+
;;
124+
*)
125+
echo "Unknown option $1"
126+
;;
127+
esac
128+
shift
129+
done
130+
131+
92132
if [ "$REUSE_CONFIG" != "y" ]; then
93133
#linux compiles are native-only, so don't bug out on cygwin which lacks a cross compiler.
94134
BUILD_LINUXx86=n
@@ -139,6 +179,7 @@ if [ "$REUSE_CONFIG" != "y" ]; then
139179
read -n 1 -p "Build for NaCL? [y/N] " BUILD_NACL && echo
140180
fi
141181

182+
BUILD_CLEAN=${BUILD_CLEAN:-y}
142183
BUILD_LINUXx86=${BUILD_LINUXx86:-y}
143184
BUILD_LINUXx64=${BUILD_LINUXx64:-y}
144185
BUILD_LINUXx32=${BUILD_LINUXx32:-n}
@@ -169,6 +210,8 @@ if [ "$UID" != "0" ]; then
169210
echo "NACL_SDK_ROOT=\"$NACLROOT/nacl_sdk/$NACLSDKVERSION\"" >>$FTECONFIG
170211
echo "NACLSDKVERSION=\"$NACLSDKVERSION\"" >>$FTECONFIG
171212

213+
echo "BUILD_CLEAN=\"$BUILD_CLEAN\"" >>$FTECONFIG
214+
172215
echo "BUILD_LINUXx86=\"$BUILD_LINUXx86\"" >>$FTECONFIG
173216
echo "BUILD_LINUXx64=\"$BUILD_LINUXx64\"" >>$FTECONFIG
174217
echo "BUILD_LINUXx32=\"$BUILD_LINUXx32\"" >>$FTECONFIG
@@ -381,13 +424,15 @@ if [ "$BUILD_NACL" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ];
381424
fi
382425

383426

384-
#initial checkout of fte's svn
385427
if [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
386-
if [ ! -d $SVNROOT ]; then
387-
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT
388-
else
389-
cd $SVNROOT
390-
svn up
428+
#initial checkout of fte's svn
429+
if [ "$NOUPDATE"!="n" ]; then
430+
if [ ! -d $SVNROOT ]; then
431+
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT $SVN_REV_ARG
432+
else
433+
cd $SVNROOT
434+
svn up $SVN_REV_ARG
435+
fi
391436
fi
392437

393438
#FIXME: there may be race conditions when compiling.
@@ -449,3 +494,4 @@ fi
449494

450495
echo "Setup script complete."
451496
echo "When you run build_wip.sh output will be written to $BUILDFOLDER/*"
497+

build_wip.sh

+44-5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,45 @@ else
3939
echo "WARNING: $FTECONFIG does not exist yet."
4040
fi
4141

42+
if [ "$BUILD_CLEAN" == "n" ]; then
43+
NOUPDATE="y"
44+
fi
45+
46+
#check args (and override config as desired)
47+
while [[ $# -gt 0 ]]
48+
do
49+
case $1 in
50+
-r)
51+
SVN_REV_ARG="-r $2"
52+
NOUPDATE=
53+
shift
54+
;;
55+
-j)
56+
THREADS="-j $2"
57+
shift
58+
;;
59+
-help|--help)
60+
echo " -r VER Specifies the SVN revision to update to"
61+
echo " -j THREADS Specifies how many jobs to make with"
62+
echo " --help This text"
63+
exit 0
64+
;;
65+
-build|--build)
66+
TARGET="FTE_CONFIG=$2"
67+
shift
68+
;;
69+
--noupdate)
70+
NOUPDATE="y"
71+
;;
72+
*)
73+
echo "Unknown option $1"
74+
;;
75+
esac
76+
shift
77+
done
78+
79+
MAKEARGS="$THREADS $TARGET"
80+
4281
export NACL_SDK_ROOT
4382

4483
########### Emscripten / Web Stuff
@@ -84,14 +123,14 @@ fi
84123
mkdir -p $BUILDLOGFOLDER
85124
if [ ! -d $SVNROOT ]; then
86125
#just in case...
87-
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT
126+
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT $SVN_REV_ARG
88127
fi
89128

90129
cd $SVNROOT/
91130

92-
if [ "$BUILD_CLEAN" != "n" ]; then
131+
if [ "$NOUPDATE" != "y" ]; then
93132
echo "SVN Update"
94-
svn update
133+
svn update $SVN_REV_ARG
95134
fi
96135

97136
cd engine
@@ -109,8 +148,8 @@ function build {
109148
fi
110149
echo -n "Making $NAME... "
111150
date > $BUILDLOGFOLDER/$DEST.txt
112-
echo make $THREADS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
113-
make $THREADS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
151+
echo make $MAKEARGS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
152+
make $MAKEARGS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
114153
if [ $? -eq 0 ]; then
115154
BUILDEND=$(date +%s)
116155
BUILDTIME=$(( $BUILDEND - $BUILDSTART ))

0 commit comments

Comments
 (0)