git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5091 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Spoike 2017-04-18 13:47:02 +00:00
parent 09ec3bf6ea
commit 46d3fedc14
4 changed files with 52 additions and 23 deletions

View file

@ -3,18 +3,33 @@
#this script must be run twice. first time as root, which installs system packages
#second time as a regular user (probably not your normal one), which installs 3rd-party stuff
NACLSDKVERSION=pepper_49
SVNROOT=$(cd "$(dirname "$BASH_SOURCE")" && pwd)
FTEROOT=$(realpath $SVNROOT/..)
FTEROOT=${FTEROOT:-~}
FTECONFIG=$SVNROOT/build.cfg
BUILDFOLDER=`echo ~`/htdocs
ANDROIDROOT=$FTEROOT/android
EMSCRIPTENROOT=$FTEROOT/emscripten
BUILDLOGFOLDER=$BUILDFOLDER/build_logs
#mac defaults
OSXCROSSROOT=$FTEROOT/osxcross
#emscripten defaults
EMSCRIPTENROOT=$FTEROOT/emsdk-portable
#nacl defaults
NACLROOT=$FTEROOT/nacl_sdk
NACLSDKVERSION=pepper_49
#android defaults
ANDROIDROOT=$FTEROOT/android
ifneq ($(shell uname -o 2>&1 | grep Cygwin),)
ANDROID_HOSTSYSTEM?=windows-x86_64
else
ANDROID_HOSTSYSTEM?=linux-$(shell uname -m)
endif
ANDROIDBUILDTOOLS=25.0.0
ANDROID_ZIPALIGN=$ANDROIDROOT/build-tools/$ANDROIDBUILDTOOLS/zipalign #relative to ndk tools
THREADS="-j 4"
@ -86,10 +101,12 @@ if [ "$REUSE_CONFIG" != "y" ]; then
echo "Skipping Linux options."
fi
BUILD_CYGWIN=n
BUILD_MSVC=n
if [ "$(uname -o)" == "Cygwin" ]; then
read -n 1 -p "Build for Cygwin? [y/N] " BUILD_CYGWIN && echo
read -n 1 -p "Build with MSVC? (requires windows7 sdk) [y/N] " BUILD_MSVC && echo
else
echo "Skipping Cygwin option."
echo "Skipping Cygwin options."
fi
read -n 1 -p "Build for Windows? [Y/n] " BUILD_WINDOWS && echo
read -n 1 -p "Build for SDL? [y/N] " BUILD_SDL && echo
@ -109,6 +126,7 @@ BUILD_LINUXx32=${BUILD_LINUXx32:-n}
BUILD_LINUXarmhf=${BUILD_LINUXarmhf:-n}
BUILD_CYGWIN=${BUILD_CYGWIN:-n}
BUILD_WINDOWS=${BUILD_WINDOWS:-y}
BUILD_MSVC=${BUILD_MSVC:-n}
BUILD_SDL=${BUILD_SDL:-n}
BUILD_ANDROID=${BUILD_ANDROID:-n}
BUILD_WEB=${BUILD_WEB:-n}
@ -122,6 +140,8 @@ if [ "$UID" != "0" ]; then
echo "BUILDLOGFOLDER=\"$BUILDLOGFOLDER\"" >>$FTECONFIG
echo "SVNROOT=\"$SVNROOT\"" >>$FTECONFIG
echo "ANDROIDROOT=\"$ANDROIDROOT\"" >>$FTECONFIG
echo "export ANDROID_HOSTSYSTEM=\"ANDROID_HOSTSYSTEM\"" >>$FTECONFIG
echo "export ANDROID_ZIPALIGN=\"ANDROID_ZIPALIGN\"" >>$FTECONFIG
echo "EMSCRIPTENROOT=\"$EMSCRIPTENROOT\"" >>$FTECONFIG
echo "OSXCROSSROOT=\"$OSXCROSSROOT\"" >>$FTECONFIG
echo "NACLROOT=\"$NACLROOT\"" >>$FTECONFIG
@ -134,6 +154,7 @@ if [ "$UID" != "0" ]; then
echo "BUILD_LINUXarmhf=\"$BUILD_LINUXarmhf\"" >>$FTECONFIG
echo "BUILD_CYGWIN=\"$BUILD_CYGWIN\"" >>$FTECONFIG
echo "BUILD_WINDOWS=\"$BUILD_WINDOWS\"" >>$FTECONFIG
echo "BUILD_MSVC=\"$BUILD_MSVC\"" >>$FTECONFIG
echo "BUILD_ANDROID=\"$BUILD_ANDROID\"" >>$FTECONFIG
echo "BUILD_SDL=\"$BUILD_SDL\"" >>$FTECONFIG
echo "BUILD_WEB=\"$BUILD_WEB\"" >>$FTECONFIG
@ -284,7 +305,7 @@ if [ "$BUILD_ANDROID" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y"
cd tools/bin
#yes, android-8 is fucking old now. newer versions won't work on older devices.
echo "downloading android build tools"
./sdkmanager "build-tools;25.0.0"
./sdkmanager "build-tools;$ANDROID_BUILDTOOLS"
echo "downloading android platform tools"
./sdkmanager "platform-tools"
echo "downloading android-9"
@ -297,10 +318,10 @@ fi
#emscripten/web shit
if [ "$BUILD_WEB" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
mkdir -p $EMSCRIPTENROOT
cd $EMSCRIPTENROOT
cd $EMSCRIPTENROOT/..
wget -N https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
tar xzf emsdk-portable.tar.gz
cd emsdk-portable
cd $EMSCRIPTENROOT
tar xzf ../emsdk-portable.tar.gz --strip-components=1
./emsdk install latest
./emsdk activate latest
cd ~

View file

@ -10,7 +10,9 @@ BASE=$SVNROOT/..
#export BRANDING=wastes
#defaults, if we're not set up properly.
#should be overriden in build.cfg
BUILDFOLDER=$HOME/htdocs
BUILDLOGFOLDER=$BUILDFOLDER/build_logs
SVNROOT=$BASE/fteqw-code
BUILD_LINUXx86=y
BUILD_LINUXx64=y
@ -35,7 +37,7 @@ fi
export NACL_SDK_ROOT
########### Emscripten / Web Stuff
export EMSDK=$EMSCRIPTENROOT/emsdk-portable
export EMSDK=$EMSCRIPTENROOT
#export WEB_PREJS="--pre-js $HOME/prejs.js"
########### Android Stuff. so messy...
@ -47,17 +49,19 @@ if [ ! -e $KEYPASSFILE ]; then
fi
KEYPASS=`cat $KEYPASSFILE`
export JAVA_HOME=/usr
export ANDROID_HOME=$ANDROIDROOT
export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
export ANDROID_TOOLS=$ANDROID_HOME/build-tools/25.0.0/
if [ ! -z "$ANDROIDROOT" ]; then
export ANDROID_HOME=$ANDROIDROOT
fi
if [ ! -z "$ANDROIDNDKROOT" ]; then
export ANDROID_NDK_ROOT=$ANDROIDNDKROOT
else
export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
fi
export KEYTOOLARGS="-keypass $KEYPASS -storepass $KEYPASS -dname \"CN=fteqw.com, OU=ID, O=FTE, L=Unknown, S=Unknown, C=GB\""
export JARSIGNARGS="-storepass $KEYPASS"
########### Various Output etc Paths
#BUILDFOLDER=$HOME/htdocs
BUILDLOGFOLDER=$BUILDFOLDER/build_logs
QCCBUILDFOLDER=$BUILDFOLDER/fteqcc
#SVNROOT=$BASE/fteqw-code
SVNFOLDER=$SVNROOT/engine/release
ARCHIVEFOLDER=$BUILDFOLDER/archive
SVNDBGFOLDER=$SVNROOT/engine/debug

View file

@ -145,7 +145,7 @@ DROID_PACKSU?= $(BASE_DIR)/droid/fte.cfg $(BASE_DIR)/droid/default.fmf $(BASE_DI
ANDROID_HOME?=~/android-sdk-linux
#ANDROID_NDK_ROOT?=~/android-ndk-r8e
ANDROID_NDK_ROOT?=$(ANDROID_HOME)/ndk-bundle
ANDROID_TOOLS?=$(ANDROID_HOME)/tools
ZIPALIGN?=$(ANDROID_HOME)/tools/zipalign
ANT?=ant
JAVA_HOME?=/usr
JAVATOOL=$(JAVA_HOME)/bin/
@ -158,13 +158,13 @@ ifeq ($(FTE_TARGET),droid)
#figure out the host system, required to find a usable compiler
ifneq ($(shell uname -o 2>&1 | grep Cygwin),)
# ifeq ($(shell uname -m 2>&1), i686)
# ANDROID_HOSTSYSTEM=windows
# ANDROID_HOSTSYSTEM?=windows
# else
# ANDROID_HOSTSYSTEM=windows-$(shell uname -m)
# ANDROID_HOSTSYSTEM?=windows-$(shell uname -m)
# endif
ANDROID_HOSTSYSTEM=windows-x86_64
ANDROID_HOSTSYSTEM?=windows-x86_64
else
ANDROID_HOSTSYSTEM=linux-$(shell uname -m)
ANDROID_HOSTSYSTEM?=linux-$(shell uname -m)
endif
#ask the android ndk which compiler version strings we should be using
@ -1943,7 +1943,7 @@ endif
@echo
@$(JAVATOOL)jarsigner $(JARSIGNARGS) -digestalg SHA1 -sigalg MD5withRSA -keystore droid/ftekeystore droid/bin/FTEDroid-release-unsigned.apk autogen
-rm -f $(RELEASE_DIR)/FTEDroid.apk
$(ANDROID_TOOLS)/zipalign 4 droid/bin/FTEDroid-release-unsigned.apk $(NATIVE_RELEASE_DIR)/FTEDroid.apk
$(ZIPALIGN) 4 droid/bin/FTEDroid-release-unsigned.apk $(NATIVE_RELEASE_DIR)/FTEDroid.apk
droid-opt:
$(MAKE) FTE_TARGET=droid droid/build.xml droid/ftekeystore

View file

@ -1054,6 +1054,7 @@ static int QDECL PM_EnumeratedPlugin (const char *name, qofs_t size, time_t mtim
return true;
}
#ifndef SERVERONLY
void PM_PluginDetected(void *ctx, int status)
{
PM_WriteInstalledPackages();
@ -1064,6 +1065,7 @@ void PM_PluginDetected(void *ctx, int status)
}
}
#endif
#endif
static void PM_PreparePackageList(void)
{
@ -1088,7 +1090,9 @@ static void PM_PreparePackageList(void)
if (foundone && !pluginpromptshown)
{
pluginpromptshown = true;
#ifndef SERVERONLY
M_Menu_Prompt(PM_PluginDetected, NULL, "Plugin(s) appears to have\nbeen installed externally.\nUse the updates menu\ntoenable them.", "View", NULL, "Disable");
#endif
}
}
#endif
@ -1793,7 +1797,7 @@ static void PM_WriteInstalledPackages(void)
if (p->fsroot == FS_BINARYPATH)
{
Q_strncatz(buf, " ", sizeof(buf));
COM_QuotedConcat(va("root=bin", p->previewimage), buf, sizeof(buf));
COM_QuotedConcat("root=bin", buf, sizeof(buf));
}
for (dep = p->deps; dep; dep = dep->next)