1
0
Fork 0
forked from fte/fteqw

Add an extra --unattended arg to build_setup.sh to make life easier for Zel with his absurd insistance to use docker for everything.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5851 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-05-13 10:17:16 +00:00
parent f35928f4fd
commit afed650758

View file

@ -78,21 +78,18 @@ if [ -e $FTECONFIG ]; then
. $FTECONFIG . $FTECONFIG
if [ $UID -eq 0 ]; then if [ $UID -eq 0 ]; then
REUSE_CONFIG=y #root shouldn't be writing/owning the config file. REUSE_CONFIG="y" #root shouldn't be writing/owning the config file.
else else
read -n 1 -p "Reuse previous build config? [y/N] " REUSE_CONFIG && echo REUSE_CONFIG="u"
REUSE_CONFIG=${REUSE_CONFIG:-n}
fi fi
else else
if [ $UID -eq 0 ]; then if [ $UID -eq 0 ]; then
exit #root can't create the output, as that would take ownership. exit #root can't create the output, as that would take ownership.
else else
REUSE_CONFIG=n REUSE_CONFIG="n"
fi fi
fi fi
if [ "$BUILD_CLEAN" == "n" ]; then if [ "$BUILD_CLEAN" == "n" ]; then
NOUPDATE="y" NOUPDATE="y"
fi fi
@ -101,7 +98,7 @@ fi
while [[ $# -gt 0 ]] while [[ $# -gt 0 ]]
do do
case $1 in case $1 in
-r) -r) #for people that want to build a specific revision for some reason.
SVN_REV_ARG="-r $2" SVN_REV_ARG="-r $2"
NOUPDATE= NOUPDATE=
shift shift
@ -116,13 +113,20 @@ do
echo " --help This text" echo " --help This text"
exit 0 exit 0
;; ;;
-build|--build) -build|--build) #for custom build settings
TARGET="FTE_CONFIG=$2" TARGET="FTE_CONFIG=$2"
shift shift
;; ;;
--noupdate) --fast) #for people that want to live dangerously.
BUILD_CLEAN="n"
;;
--noupdate) #for people living privately or building old revisions...
NOUPDATE="y" NOUPDATE="y"
;; ;;
--unattended) #don't prompt, use various defaults.
UNATTENDED="y"
REUSE_CONFIG="y"
;;
*) *)
echo "Unknown option $1" echo "Unknown option $1"
;; ;;
@ -130,6 +134,10 @@ do
shift shift
done done
if [ "$REUSE_CONFIG" == "u" ]; then
read -n 1 -p "Reuse previous build config? [y/N] " REUSE_CONFIG && echo
REUSE_CONFIG=${REUSE_CONFIG:-n}
fi
if [ "$REUSE_CONFIG" != "y" ]; then if [ "$REUSE_CONFIG" != "y" ]; then
#linux compiles are native-only, so don't bug out on cygwin which lacks a cross compiler. #linux compiles are native-only, so don't bug out on cygwin which lacks a cross compiler.
@ -265,7 +273,9 @@ function debianpackages {
if [ $ret == $false ]; then if [ $ret == $false ]; then
echo "Packages are not installed. Press enter to continue (or ctrl+c and install)." echo "Packages are not installed. Press enter to continue (or ctrl+c and install)."
read if [ "$UNATTENDED" != "y" ]; then
read
fi
ret=$true ret=$true
fi fi
return $ret return $ret
@ -361,10 +371,14 @@ if [ "$UID" == "0" ]; then
exit exit
fi fi
echo if [ "$UNATTENDED" != "y" ]; then
echo "(Any new toolchains will be installed to $FTEROOT)" echo
echo "(Say no if you're certain you already set up everything)" echo "(Any new toolchains will be installed to $FTEROOT)"
read -n 1 -p "Rebuild/update any toolchains now? [y/N] " REBUILD_TOOLCHAINS && echo echo "(Say no if you're certain you already set up everything)"
read -n 1 -p "Rebuild/update any toolchains now? [y/N] " REBUILD_TOOLCHAINS && echo
else
REBUILD_TOOLCHAINS="y"
fi
REBUILD_TOOLCHAINS=${REBUILD_TOOLCHAINS:-n} REBUILD_TOOLCHAINS=${REBUILD_TOOLCHAINS:-n}
mkdir -p $FTEROOT mkdir -p $FTEROOT
@ -406,7 +420,7 @@ fi
#osxcross, for mac crap #osxcross, for mac crap
if [ "$BUILD_MAC" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then if [ "$BUILD_MAC" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ] && [ "$UNATTENDED" != "y" ]; then
echo "Setting up OSXCross... THIS IS TOTALLY UNTESTED" echo "Setting up OSXCross... THIS IS TOTALLY UNTESTED"
read -p "You need to download xcode first. Where did you download the .dmg file to?" XCODE read -p "You need to download xcode first. Where did you download the .dmg file to?" XCODE
git clone https://github.com/tpoechtrager/osxcross.git $OSXCROSSROOT git clone https://github.com/tpoechtrager/osxcross.git $OSXCROSSROOT
@ -467,6 +481,8 @@ if [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
echo "Making libraries (win64)..." echo "Making libraries (win64)..."
make FTE_TARGET=win64 makelibs CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null make FTE_TARGET=win64 makelibs CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi fi
#These plugins have external 3rd-party dependancies that are downloaded as part of building.
if [ "$BUILD_WIN32" == "y" ] && [[ "$PLUGINS_WIN32" =~ "ode" ]]; then if [ "$BUILD_WIN32" == "y" ] && [[ "$PLUGINS_WIN32" =~ "ode" ]]; then
echo "Prebuilding ODE library (win32)..." echo "Prebuilding ODE library (win32)..."
make FTE_TARGET=win32 plugins-rel NATIVE_PLUGINS=ode 2>&1 >>/dev/null make FTE_TARGET=win32 plugins-rel NATIVE_PLUGINS=ode 2>&1 >>/dev/null