Added the build-everything script from triptohell to the svn. Made more generic, and included a second script to install emscripten+android+nacl dependancies. Updated the makefile and fixed a couple of bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5089 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-04-16 09:27:43 +00:00
parent aef821b9c6
commit 81a9c45efa
5 changed files with 770 additions and 31 deletions

View file

@ -19,6 +19,16 @@ You do not need to configure. The makefile will automatically do that depending
Easy Build Bot System:
If you want to set up a linux box that cross-compiles each target with your own private customisations, then you can run the build_setup.sh script to set up which targets you wish to support.
You can then just run the build_wip.sh script any time your code changes to have it rebuild every target you previously picked.
The script can also be run from cygwin, but does not support compiling for linux then.
(The setup script will install android+emscripten+nacl dependancies for you, so you're likely to find this an easier way to deal with those special targets).
(note that the android sdk can be a big download, while installing emscripten may require several hours to compile clang and about 40gb of disk space if emscripten doesn't provide prebuilt stuff for your distro).
To compile the FTEDroid port with cygwin:
make droid-rel PATH=C:\Cygwin\bin\ DROID_SDK_PATH=/cygdrive/c/Games/tools/android-sdk DROID_NDK_PATH=/cygdrive/c/Games/tools/android-ndk-r7 ANT=/cygdrive/c/Games/tools/apache-ant-1.8.2/bin/ant JAVATOOL="/cygdrive/c/Program\ Files/Java/jdk1.7.0_02/bin/" DROID_ARCH="armeabi x86" -j4 DROID_PACKSU=/cygdrive/c/games/quake/id1/pak0.pak
On linux you can omit the PATH, ANT, and JAVATOOL parts as they should already be in the path (yes I copied the above out of a batch file).

388
build_setup.sh Executable file
View file

@ -0,0 +1,388 @@
#!/bin/bash
#sets up dependancies for debian-jessie (8.7)
#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
OSXCROSSROOT=$FTEROOT/osxcross
NACLROOT=$FTEROOT/nacl_sdk
THREADS="-j 4"
#windows is always cross compiled, so we don't have issues with non-native avplug
PLUGINS_LINUXx86="ode qi ezhud xmpp irc"
PLUGINS_LINUXx64="ode qi ezhud xmpp irc"
PLUGINS_LINUXx32="qi ezhud xmpp irc"
PLUGINS_LINUXarmhf="qi ezhud xmpp irc"
if [ "$(uname -m)" != "x86_64" ]; then
PLUGINS_LINUXx86="avplug ode qi ezhud xmpp irc"
fi
if [ "$(uname -m)" == "x86_64" ]; then
PLUGINS_LINUX64="avplug ode qi ezhud xmpp irc"
fi
#windows doesn't cross compile, so no system dependancy issues
#skip some dependancies if we're running on cygwin, ode is buggy.
if [ "$(uname -s)" == "Linux" ]; then
PLUGINS_WINDOWS="avplug ode qi ezhud xmpp irc"
else
PLUGINS_WINDOWS="qi ezhud xmpp irc"
fi
echo
echo "This is Spike's script to set up various cross compilers and dependancies."
echo "This script will check dependancies. If something isn't installed you can either rerun the script as root (which will ONLY install system packages), or manually apt-get or whatever. You can then re-run the script as a regular user to finish configuring 3rd party dependancies."
echo
echo "You can change your choices later by just re-running this script"
echo "(Your settings will be autosaved in $FTECONFIG)"
echo
echo "If you just want to compile a native build, just use the following command:"
echo "cd $SVNROOT/engine && make gl-rel"
echo "(if you're in cygwin, add FTE_TARGET=win32 to compile for native windows)"
echo "(add plugins-rel qcc-rel qccgui-rel sv-rel vk-rel etc for additional targets)"
echo "(or use -dbg if you want debug builds for whatever reason)"
echo
#always execute it if it exists, so that we preserve custom paths etc that are not prompted for here
if [ -e $FTECONFIG ]; then
. $FTECONFIG
if [ $UID -eq 0 ]; then
REUSE_CONFIG=y #root shouldn't be writing/owning the config file.
else
read -n 1 -p "Reuse previous build config? [y/N] " REUSE_CONFIG && echo
REUSE_CONFIG=${REUSE_CONFIG:-n}
fi
else
if [ $UID -eq 0 ]; then
exit #root can't create the output, as that would take ownership.
else
REUSE_CONFIG=n
fi
fi
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
BUILD_LINUXx64=n
BUILD_LINUXx32=n
BUILD_LINUXarmhf=n
if [ "$(uname -s)" == "Linux" ]; then
read -n 1 -p "Build for Linux x86? [Y/n] " BUILD_LINUXx86 && echo
read -n 1 -p "Build for Linux x86_64? [Y/n] " BUILD_LINUXx64 && echo
read -n 1 -p "Build for Linux x32? [y/N] " BUILD_LINUXx32 && echo
#ubuntu's gcc-multilib-arm-foo package conflicts with gcc-multilib...
#the whole point of multilib was to avoid conflicts... someone fucked up.
#read -n 1 -p "Build for Linux armhf [y/N] " BUILD_LINUXarmhf && echo
else
echo "Skipping Linux options."
fi
BUILD_CYGWIN=n
if [ "$(uname -o)" == "Cygwin" ]; then
read -n 1 -p "Build for Cygwin? [y/N] " BUILD_CYGWIN && echo
else
echo "Skipping Cygwin option."
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
read -n 1 -p "Build for Android? [y/N] " BUILD_ANDROID && echo
read -n 1 -p "Build for Emscripten? [y/N] " BUILD_WEB && echo
if [ 0 -ne 0 ]; then
read -n 1 -p "Build for MacOSX? [y/N] " BUILD_MAC && echo
else
echo "Skipping mac option."
fi
read -n 1 -p "Build for NaCL? [y/N] " BUILD_NACL && echo
fi
BUILD_LINUXx86=${BUILD_LINUXx86:-y}
BUILD_LINUXx64=${BUILD_LINUXx64:-y}
BUILD_LINUXx32=${BUILD_LINUXx32:-n}
BUILD_LINUXarmhf=${BUILD_LINUXarmhf:-n}
BUILD_CYGWIN=${BUILD_CYGWIN:-n}
BUILD_WINDOWS=${BUILD_WINDOWS:-y}
BUILD_SDL=${BUILD_SDL:-n}
BUILD_ANDROID=${BUILD_ANDROID:-n}
BUILD_WEB=${BUILD_WEB:-n}
BUILD_MAC=${BUILD_MAC:-n}
BUILD_NACL=${BUILD_NACL:-n}
if [ "$UID" != "0" ]; then
echo "#path config for fte build scripts" >$FTECONFIG
echo "THREADS=\"$THREADS\"" >>$FTECONFIG
echo "BUILDFOLDER=\"$BUILDFOLDER\"" >>$FTECONFIG
echo "BUILDLOGFOLDER=\"$BUILDLOGFOLDER\"" >>$FTECONFIG
echo "SVNROOT=\"$SVNROOT\"" >>$FTECONFIG
echo "ANDROIDROOT=\"$ANDROIDROOT\"" >>$FTECONFIG
echo "EMSCRIPTENROOT=\"$EMSCRIPTENROOT\"" >>$FTECONFIG
echo "OSXCROSSROOT=\"$OSXCROSSROOT\"" >>$FTECONFIG
echo "NACLROOT=\"$NACLROOT\"" >>$FTECONFIG
echo "NACL_SDK_ROOT=\"$NACLROOT/nacl_sdk/$NACLSDKVERSION\"" >>$FTECONFIG
echo "NACLSDKVERSION=\"$NACLSDKVERSION\"" >>$FTECONFIG
echo "BUILD_LINUXx86=\"$BUILD_LINUXx86\"" >>$FTECONFIG
echo "BUILD_LINUXx64=\"$BUILD_LINUXx64\"" >>$FTECONFIG
echo "BUILD_LINUXx32=\"$BUILD_LINUXx32\"" >>$FTECONFIG
echo "BUILD_LINUXarmhf=\"$BUILD_LINUXarmhf\"" >>$FTECONFIG
echo "BUILD_CYGWIN=\"$BUILD_CYGWIN\"" >>$FTECONFIG
echo "BUILD_WINDOWS=\"$BUILD_WINDOWS\"" >>$FTECONFIG
echo "BUILD_ANDROID=\"$BUILD_ANDROID\"" >>$FTECONFIG
echo "BUILD_SDL=\"$BUILD_SDL\"" >>$FTECONFIG
echo "BUILD_WEB=\"$BUILD_WEB\"" >>$FTECONFIG
echo "BUILD_MAC=\"$BUILD_MAC\"" >>$FTECONFIG
echo "BUILD_NACL=\"$BUILD_NACL\"" >>$FTECONFIG
echo "PLUGINS_WINDOWS=\"$PLUGINS_WINDOWS\"" >>$FTECONFIG
echo "PLUGINS_LINUXx86=\"$PLUGINS_LINUXx86\"" >>$FTECONFIG
echo "PLUGINS_LINUXx64=\"$PLUGINS_LINUXx64\"" >>$FTECONFIG
echo "PLUGINS_LINUXx32=\"$PLUGINS_LINUXx32\"" >>$FTECONFIG
echo "PLUGINS_LINUXarmhf=\"$PLUGINS_LINUXarmhf\"" >>$FTECONFIG
fi
true
true=$?
false
false=$?
if [ "$(uname -s)" == "Linux" ]; then
. /etc/os-release
fi
function debianpackages {
#make sure apt-get is installed
if [ -z `which apt-get 2>>/dev/null` ]; then
return $false
fi
local ret=$true
for i in "$@"
do
dpkg -s $i 2>&1 >> /dev/null
if [ $? -eq 1 ]; then
ret=$false
fi
done
if [ $ret == $false ]; then
if [ $UID -eq 0 ]; then
apt-get install --no-install-recommends $@
ret=$true
else
echo "Packages not installed. Run as root to easily install dependancies."
fi
fi
return $ret
}
function jessiepackages {
if [ "$PRETTY_NAME" != "Debian GNU/Linux 8 (jessie)" ]; then
return $false
fi
debianpackages $@
return $?
}
#we don't really know what system we're on. assume they have any system dependancies.
#fixme: args are programs findable with which
function otherpackages {
if [ -z "$PRETTY_NAME" ]; then
return $true
fi
return $false
}
#Note: only the native linux-sdl target can be compiled, as libSDL[2]-dev doesn't support multiarch properly, and we depend upon it instead of building from source (thus ensuring it has whatever distro stuff needed... though frankly that should be inside the .so instead of the headers).
if [ $UID -eq 0 ] && [ ! -z `which apt-get` ]; then
#because multiarch requires separate packages for some things, we'll need to set that up now (in case noone did that yet)
dpkg --add-architecture i386
apt-get update
fi
#generic crap. much of this is needed to set up and decompress dependancies and stuff.
debianpackages subversion make automake libtool p7zip-full zip || otherpackages z7 make svn || exit
if [ "$BUILD_LINUXx86" == "y" ]; then
#for building linux targets
debianpackages gcc-multilib g++-multilib mesa-common-dev libasound2-dev libvorbis-dev || otherpackages gcc || exit
jessiepackages libgnutls28-dev || debianpackages libgnutls-dev || otherpackages gcc || exit
if [[ "$PLUGINS_LINUXx86" =~ "avplug" ]]; then
debianpackages libswscale-dev libavcodec-dev || otherpackages || exit
fi
fi
if [ "$BUILD_LINUXx64" == "y" ]; then
#for building linux targets
debianpackages gcc-multilib g++-multilib mesa-common-dev libasound2-dev || otherpackages gcc || exit
jessiepackages libgnutls28-dev || debianpackages libgnutls-dev || otherpackages gcc || exit
if [[ "$PLUGINS_LINUXx64" =~ "avplug" ]]; then
debianpackages libswscale-dev libavcodec-dev || otherpackages || exit
fi
fi
if [ "$BUILD_LINUXx32" == "y" ]; then
#for building linux targets
debianpackages gcc-multilib g++-multilib mesa-common-dev libasound2-dev || otherpackages gcc || exit
jessiepackages libgnutls28-dev || debianpackages libgnutls-dev || otherpackages gcc || exit
fi
if [ "$BUILD_LINUXarmhf" == "y" ]; then
#for building linux targets
debianpackages gcc-multilib-arm-linux-gnueabihf g++-multilib-arm-linux-gnueabihf mesa-common-dev libasound2-dev || otherpackages gcc || exit
jessiepackages libgnutls28-dev || debianpackages libgnutls-dev || otherpackages gcc || exit
fi
if [ "$BUILD_SDL" == "y" ]; then
#for building SDL targets
debianpackages libSDL1.2-dev libSDL2-dev libspeex-dev libspeexdsp-dev || otherpackages || exit
fi
if [ "$BUILD_WINDOWS" == "y" ]; then
#for building windows targets
debianpackages mingw-w64 || otherpackages x86_64-w64-mingw32-gcc || exit
fi
if [ "$BUILD_ANDROID" == "y" ]; then
( (jessiepackages openjdk-8-jdk-headless || debianpackages openjdk-8-jdk-headless ) && debianpackages ant) || otherpackages || exit
fi
if [ "$BUILD_WEB" == "y" ]; then
( (jessiepackages cmake || debianpackages cmake) && debianpackages git build-essential) || exit
fi
if [ "$BUILD_MAC" == "y" ]; then
debianpackages git cmake libxml2-dev fuse || otherpackages || exit
fi
debianpackages subversion make build-essential || otherpackages svn make || exit
echo "System Package checks complete."
if [ "$UID" == "0" ]; then
#avoid root taking ownership of anything.
echo "Refusing to update/rebuild toolchains as root."
echo "Please continue running this script as a regular user."
exit
fi
echo
echo "(Any new toolchains will be installed to $FTEROOT)"
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
REBUILD_TOOLCHAINS=${REBUILD_TOOLCHAINS:-n}
mkdir -p $FTEROOT
#android shit. WARNING: should come first as it spits out some EULAs that need confirming.
if [ "$BUILD_ANDROID" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
mkdir -p $ANDROIDROOT
cd $ANDROIDROOT
wget -N https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
unzip -qn tools_r25.2.3-linux.zip
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"
echo "downloading android platform tools"
./sdkmanager "platform-tools"
echo "downloading android-9"
./sdkmanager "platforms;android-9"
echo "downloading android ndk"
./sdkmanager "ndk-bundle"
cd ~
fi
#emscripten/web shit
if [ "$BUILD_WEB" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
mkdir -p $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
./emsdk install latest
./emsdk activate latest
cd ~
fi
#osxcross, for mac crap
if [ "$BUILD_MAC" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
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
git clone https://github.com/tpoechtrager/osxcross.git $OSXCROSSROOT
cd $OSXCROSSROOT
tools/gen_sdk_package_darling_dmg.sh $XCODE
cp *.tar.xz
SDK_VERSION=10.10 UNATTENDED=0 ./build.sh
cd ~
fi
if [ "$BUILD_NACL" == "y" ] && [ $UID -ne 0 ] && [ $REBUILD_TOOLCHAINS == "y" ]; then
echo "Setting up NaCL..."
mkdir -p $NACLROOT
cd $NACLROOT/..
wget -N https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip
unzip -qn nacl_sdk.zip
cd $NACLROOT
./naclsdk update $NACLSDKVERSION
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
fi
#FIXME: there may be race conditions when compiling.
#so make sure we've pre-built certain targets without using -j
#linux distros vary too much with various dependancies and versions and such, so we might as well pre-build our own copies of certain libraries. this really only needs to be done once, but its safe to retry anyway.
cd $SVNROOT/engine
if [ "$BUILD_LINUXx86" == "y" ]; then
echo "Making libraries (x86)..."
make FTE_TARGET=linux32 makelibs CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi
if [ "$BUILD_LINUx64" == "y" ]; then
echo "Making libraries (linux x86_64)..."
make FTE_TARGET=linux64 makelibs CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi
if [ "$BUILD_LINUXx32" == "y" ]; then
echo "Making libraries (linux x32)..."
make FTE_TARGET=linuxx32 makelibs CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi
if [ "$BUILD_LINUXarmhf" == "y" ]; then
echo "Making libraries (linux armhf)..."
make FTE_TARGET=linuxarmhf makelibs CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi
if [ "$BUILD_WINDOWS" == "y" ] && [[ "$PLUGINS_WINDOWS" =~ "ode" ]]; then
echo "Prebuilding ODE library (win32)..."
make FTE_TARGET=win32 plugins-rel NATIVE_PLUGINS=ode 2>&1 >>/dev/null
echo "Prebuilding ODE library (win64)..."
make FTE_TARGET=win64 plugins-rel NATIVE_PLUGINS=ode 2>&1 >>/dev/null
fi
if [ "$BUILD_LINUXx86" == "y" ] && [[ "$PLUGINS_LINUXx86" =~ "ode" ]]; then
echo "Prebuilding ODE library (linux x86)..."
make FTE_TARGET=linux32 plugins-rel NATIVE_PLUGINS=ode CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi
if [ "$BUILD_LINUXx64" == "y" ] && [[ "$PLUGINS_LINUXx64" =~ "ode" ]]; then
echo "Prebuilding ODE library (linux x86_64)..."
make FTE_TARGET=linux64 plugins-rel NATIVE_PLUGINS=ode CPUOPTIMISATIONS=-fno-finite-math-only 2>&1 >>/dev/null
fi
if [ "$BUILD_WINDOWS" == "y" ]; then
echo "Obtaining ffmpeg library (win32)..."
make FTE_TARGET=win32 plugins-rel NATIVE_PLUGINS=avplug 2>&1 >>/dev/null
echo "Obtaining ffmpeg library (win64)..."
make FTE_TARGET=win64 plugins-rel NATIVE_PLUGINS=avplug 2>&1 >>/dev/null
fi
cd ~
fi
echo "Setup script complete."
echo "When you run build_wip.sh output will be written to $BUILDFOLDER/*"

314
build_wip.sh Executable file
View file

@ -0,0 +1,314 @@
#!/bin/bash
START=$(date +%s)
SVNROOT=$(cd "$(dirname "$(readlink "$BASH_SOURCE")")" && pwd)
FTECONFIG=$SVNROOT/build_cfg.sh
HOME=`echo ~`
BASE=$SVNROOT/..
#how many cpu cores do you have?
THREADS="-j 4"
#set this if you want non-default branding, for customised builds.
#export BRANDING=wastes
#defaults, if we're not set up properly.
BUILDFOLDER=$HOME/htdocs
SVNROOT=$BASE/fteqw-code
BUILD_LINUXx86=y
BUILD_LINUXx64=y
BUILD_WINDOWS=y
BUILD_ANDROID=y
BUILD_WEB=y
PLUGINS_LINUXx86="qi ezhud xmpp irc"
PLUGINS_LINUXx64="qi ezhud xmpp irc"
PLUGINS_LINUXx32="qi ezhud xmpp irc"
PLUGINS_WINDOWS="avplug ode qi ezhud xmpp irc"
########### NaCL stuff
NACL_SDK_ROOT=/opt/nacl_sdk/pepper_31/
if [ -e $FTECONFIG ]; then
. $FTECONFIG
fi
export NACL_SDK_ROOT
########### Emscripten / Web Stuff
export EMSDK=$EMSCRIPTENROOT/emsdk-portable
#export WEB_PREJS="--pre-js $HOME/prejs.js"
########### Android Stuff. so messy...
#This is some android password that you should keep private. You should keep the keystore file private too, of course. Frankly, that part is more important than this small random number.
KEYPASSFILE=$BASE/.fte_keypass
if [ ! -e $KEYPASSFILE ]; then
dd if=/dev/urandom count=9 bs=1 2>/dev/null | base64 > $KEYPASSFILE
chmod 400 $KEYPASSFILE
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/
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
WARNINGLEVEL="-w"
FILELOCK=$BASE/.fte_buildlock
#./ccache-alias.sh
exec 9>$FILELOCK
if ! flock -n 9 ; then
echo "Build script is already running!";
exit 1
fi
mkdir -p $BUILDLOGFOLDER
if [ ! -d $SVNROOT ]; then
#just in case...
svn checkout https://svn.code.sf.net/p/fteqw/code/trunk $SVNROOT
fi
cd $SVNROOT/
echo "SVN Update"
svn update
cd engine
date > $BUILDLOGFOLDER/buildlog.txt
echo "Starting build" >> $BUILDLOGFOLDER/buildlog.txt
function build {
BUILDSTART=$(date +%s)
NAME=$1
DEST=$2
shift; shift
make clean >> /dev/null
echo -n "Making $NAME... "
date > $BUILDLOGFOLDER/$DEST.txt
echo make $THREADS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
make $THREADS $* >> $BUILDLOGFOLDER/$DEST.txt 2>&1
if [ $? -eq 0 ]; then
BUILDEND=$(date +%s)
BUILDTIME=$(( $BUILDEND - $BUILDSTART ))
echo "$BUILDTIME seconds"
echo "$NAME done, took $BUILDTIME seconds" >> $BUILDLOGFOLDER/buildlog.txt
rm -rf $BUILDFOLDER/$DEST >> /dev/null 2>&1
mkdir $BUILDFOLDER/$DEST 2>> /dev/null
mkdir $BUILDFOLDER/$DEST/debug 2>> /dev/null
cp $SVNFOLDER/* $BUILDFOLDER/$DEST >> /dev/null 2>> /dev/null
cp $SVNDBGFOLDER/* $BUILDFOLDER/$DEST/debug >> /dev/null 2>> /dev/null
rm -rf $BUILDFOLDER/$DEST/*.a >> /dev/null 2>&1
rm -rf $BUILDFOLDER/$DEST/debug/*.a >> /dev/null 2>&1
rmdir $BUILDFOLDER/$DEST/debug 2>> /dev/null
else
echo "$NAME failed" >> $BUILDLOGFOLDER/buildlog.txt
echo "failed"
fi
}
function build_fteqcc {
echo "--- no code ---"
}
echo "--- Engine builds ---"
#the -fno-finite-math-only is to avoid a glibc dependancy
if [ "$BUILD_LINUXx86" != "n" ]; then
NATIVE_PLUGINS="$PLUGINS_LINUXx86" build "Linux 32-bit" linux_x86 FTE_TARGET=linux32 CPUOPTIMIZATIONS=-fno-finite-math-only qcc-rel rel dbg vk-rel plugins-rel plugins-dbg
fi
if [ "$BUILD_LINUXx64" != "n" ]; then
NATIVE_PLUGINS="$PLUGINS_LINUXx64" build "Linux 64-bit" linux_amd64 FTE_TARGET=linux64 LDFLAGS="-Llibs/64" CPUOPTIMIZATIONS=-fno-finite-math-only qcc-rel rel dbg vk-rel plugins-rel plugins-dbg
fi
if [ "$BUILD_LINUXx32" != "n" ]; then
# CFLAGS="-DNO_JPEG"
NATIVE_PLUGINS="$PLUGINS_LINUXx32" build "Linux x32" linux_x32 FTE_TARGET=linuxx32 CPUOPTIMIZATIONS=-fno-finite-math-only qcc-rel rel dbg plugins-rel plugins-dbg
fi
if [ "$BUILD_LINUXarmhf" != "n" ]; then
#debian/ubuntu's armhf targets armv7. we instead target armv6, because that means we work on rpi too (but still with hard-float). It should be compatible although we likely need more ops.
NATIVE_PLUGINS="$PLUGINS_LINUXarmhf" build "Linux ARMhf" linux_armhf FTE_TARGET=linuxarmhf CPUOPTIMIZATIONS=-fno-finite-math-only rel dbg qcc-rel plugins-rel plugins-dbg
fi
if [ "$BUILD_CYGWIN" != "n" ]; then
NATIVE_PLUGINS="qi ezhud" build "Cygwin" cygwin qcc-rel rel dbg plugins-rel plugins-dbg
fi
if [ "$BUILD_WINDOWS" != "n" ]; then
NATIVE_PLUGINS="$PLUGINS_WINDOWS" build "Windows 32-bit" win32 FTE_TARGET=win32 CFLAGS="$WARNINGLEVEL" sv-rel gl-rel vk-rel mingl-rel m-rel d3d-rel qcc-rel qccgui-scintilla qccgui-dbg gl-dbg sv-dbg plugins-dbg plugins-rel NATIVE_PLUGINS="$PLUGINS_WINDOWS"
NATIVE_PLUGINS="$PLUGINS_WINDOWS" build "Windows 64-bit" win64 FTE_TARGET=win64 CFLAGS="$WARNINGLEVEL" sv-rel gl-rel vk-rel mingl-rel m-rel d3d-rel qcc-rel qccgui-scintilla qccgui-dbg gl-dbg sv-dbg plugins-dbg plugins-rel
fi
export NATIVE_PLUGINS="qi ezhud xmpp irc"
if [ "$BUILD_ANDROID" != "n" ]; then
build "Android" android droid-rel
fi
if [ "$BUILD_WINDOWS" != "n" ]; then
build "NPFTE" npfte npfte-rel
fi
if [ "$BUILD_WEB" != "n" ]; then
source $EMSDK/emsdk_env.sh >> /dev/null
build "Emscripten" web FTE_TARGET=web gl-rel CC=emcc
fi
if [ "$BUILD_LINUX" != "n" ] && [ "$BUILD_SDL" != "n" ] && [ "$(uname -m)" != "x86_64" ]; then
build "Linux 32-bit (SDL)" linux_x86_sdl FTE_TARGET=SDL BITS=32 LTO=1
fi
if [ "$BUILD_LINUX" != "n" ] && [ "$BUILD_SDL" != "n" ] && [ "$(uname -m)" == "x86_64" ]; then
build "Linux 64-bit (SDL)" linux_amd64_sdl FTE_TARGET=SDL BITS=64 LDFLAGS="-Llibs/64" LTO=1
fi
if [ "$BUILD_WINDOWS" != "n" ] && [ "$BUILD_SDL" != "n" ]; then
build "Windows 32-bit (SDL)" win32_sdl FTE_TARGET=win32_SDL gl-rel mingl-rel
build "Windows 64-bit (SDL)" win64_sdl FTE_TARGET=win64_SDL LDFLAGS="-L./libs/mingw64-libs/" gl-rel mingl-rel
CFLAGS="$WARNINGLEVEL -DNOLEGACY -DOMIT_QCC" build "Windows 32-bit nocompat" nocompat FTE_TARGET=win32 LTO=1 NOCOMPAT=1 BOTLIB_CFLAGS="" BOTLIB_OBJS="" gl-rel m-rel -k
fi
if [ "$BUILD_NACL" != "n" ]; then
#non-pnacl is supported ONLY in chrome's store crap, but pnacl works anywhere.
# build "Native Client 64-bit" nacl_amd64 FTE_TARGET=nacl NARCH=x86_64 gl-rel
# build "Native Client 32-bit" nacl_x86 FTE_TARGET=nacl NARCH=x86_32 gl-rel
#internal compiler error build "Native Client ARM" nacl_arm FTE_TARGET=nacl NARCH=arm gl-rel
build "Native Client Portable" nacl_portable FTE_TARGET=nacl NARCH=pnacl gl-rel
fi
####build "MorphOS" morphos CFLAGS="-I$BASE/morphos/os-include/ -I$BASE/morphos/lib/ -L$BASE/morphos/lib/ -I$BASE/zlib/zlib-1.2.5 -L$BASE/zlib/zlib-1.2.5 -I./libs $WARNINGLEVEL" gl-rel mingl-rel sv-rel qcc-rel
if [ "$BUILD_MAC" != "n" ]; then
#build "MacOSX" macosx_tiger CFLAGS="-I$BASE/mac/x86/include/ -L$BASE/mac/x86/lib -I./libs" FTE_TARGET=macosx_x86 sv-rel gl-rel mingl-rel qcc-rel
build "MacOSX 32-bit" osx32 CC=o32-clang CXX=o32-clang++ FTE_TARGET=osx_x86 BITS=32 sv-rel gl-rel mingl-rel qcc-rel
build "MacOSX 64-bit" osx64 CC=o64-clang CXX=o64-clang++ FTE_TARGET=osx_x86_64 BITS=64 sv-rel gl-rel mingl-rel qcc-rel
fi
#third party stuff / misc crap
if [ "$BUILD_WEB" != "n" ]; then
cp $BASE/3rdparty/web/* $BUILDFOLDER/web/
fi
if [ "$BUILD_WINDOWS" != "n" ]; then
cp $BASE/3rdparty/win32/3rdparty.zip $BUILDFOLDER/win32/3rdparty.zip
cp $BASE/3rdparty/win64/3rdparty.zip $BUILDFOLDER/win64/3rdparty.zip
if [ "$BUILD_SDL" != "n" ]; then
cp $SVNROOT/engine/libs/SDL2-2.0.1/i686-w64-mingw32/bin/SDL2.dll $BUILDFOLDER/win32_sdl
cp $SVNROOT/engine/libs/SDL2-2.0.1/x86_64-w64-mingw32/bin/SDL2.dll $BUILDFOLDER/win64_sdl
fi
cp $HOME/nocompat_readme.html $BUILDFOLDER/nocompat/README.html
fi
echo "--- QC builds ---"
rm -rf $QCCBUILDFOLDER 2>&1
mkdir -p $QCCBUILDFOLDER
if [ -e "$BUILDFOLDER/linux_x86/fteqw-gl32" ]
then
echo "Making fteextensions.qc"
mkdir -p ~/.fte/fte
echo "pr_dumpplatform -o fteextensions" > ~/.fte/fte/minusargsaresilly.cfg
echo "pr_dumpplatform -o csqcsysdefs -Tcs" >> ~/.fte/fte/minusargsaresilly.cfg
echo "pr_dumpplatform -o menusysdefs -Tmenu" >> ~/.fte/fte/minusargsaresilly.cfg
$BUILDFOLDER/linux_x86/fteqw-gl32 -basedir ~/.fte -nohome -quake +set snd_device none -nosound +set vid_renderer sv +exec minusargsaresilly.cfg +quit >> /dev/null
mv ~/.fte/fte/src/fteextensions.qc $QCCBUILDFOLDER
mv ~/.fte/fte/src/csqcsysdefs.qc $QCCBUILDFOLDER
mv ~/.fte/fte/src/menusysdefs.qc $QCCBUILDFOLDER
else
echo "Skipping FTE Extensions, no Linux build located"
fi
if [ -e $BUILDFOLDER/linux_x86/fteqcc32 ]; then
echo "Making csaddon + qcmenu"
mkdir -p $BUILDFOLDER/csaddon/
cd $SVNROOT/quakec
cd csaddon/src
$BUILDFOLDER/linux_x86/fteqcc32 -srcfile csaddon.src > $BUILDLOGFOLDER/csaddon.txt
mv ../csaddon.dat $BUILDFOLDER/csaddon/
cd ../../menusys
$BUILDFOLDER/linux_x86/fteqcc32 -srcfile menu.src > $BUILDLOGFOLDER/menu.txt
rm fteqcc.log
zip -q -9 -o -r $BUILDFOLDER/csaddon/menusys_src.zip .
mv ../menu.dat $BUILDFOLDER/csaddon/
else
echo "Skiping csaddon + qcmenu, no compiler build"
fi
cd $SVNROOT/engine/
svn info > $BUILDFOLDER/version.txt
if [ "$BUILD_LINUXx86" != "n" ]; then
cp $BUILDFOLDER/linux_x86/fteqcc32 $QCCBUILDFOLDER/linux32-fteqcc
fi
if [ "$BUILD_LINUXx64" != "n" ]; then
cp $BUILDFOLDER/linux_amd64/fteqcc64 $QCCBUILDFOLDER/linux64-fteqcc
fi
if [ "$BUILD_LINUXx32" != "n" ]; then
cp $BUILDFOLDER/linux_x32/fteqccx32 $QCCBUILDFOLDER/linuxx32-fteqcc
fi
if [ "$BUILD_LINUXarmhf" != "n" ]; then
cp $BUILDFOLDER/linux_armhf/fteqccarmhf $QCCBUILDFOLDER/linuxarmhf-fteqcc
fi
if [ "$BUILD_WINDOWS" != "n" ]; then
cp $BUILDFOLDER/win32/fteqcc.exe $QCCBUILDFOLDER/win32-fteqcc.exe
cp $BUILDFOLDER/win32/fteqccgui.exe $QCCBUILDFOLDER/win32-fteqccgui.exe
cp $BUILDFOLDER/win64/fteqcc64.exe $QCCBUILDFOLDER/win64-fteqcc.exe
cp $BUILDFOLDER/win64/fteqccgui64.exe $QCCBUILDFOLDER/win64-fteqccgui.exe
fi
#cp $BUILDFOLDER/morphos/fteqcc $QCCBUILDFOLDER/morphos-fteqcc
#cp $BUILDFOLDER/macosx_tiger/fteqcc $QCCBUILDFOLDER/macosx_tiger-fteqcc
cp $BUILDFOLDER/version.txt $QCCBUILDFOLDER/version.txt
if [ "$BUILD_NACL" != "n" ]; then
mkdir -p $BUILDFOLDER/nacl
NACL=$BUILDFOLDER/nacl/fteqw.nmf
echo "{ \"program\":{" > $NACL
if [ -e "$BUILDFOLDER/nacl_amd64/fteqw-x86_64.nexe" ]; then
mv $BUILDFOLDER/nacl_amd64/fteqw-x86_64.nexe $BUILDFOLDER/nacl/fteqw-x86_64.nexe
echo " \"x86-64\":{\"url\":\"fteqw-x86_64.nexe\"}," >> $NACL
fi
if [ -e "$BUILDFOLDER/nacl_x86/fteqw-x86_32.nexe" ]; then
mv $BUILDFOLDER/nacl_x86/fteqw-x86_32.nexe $BUILDFOLDER/nacl/fteqw-x86_32.nexe
echo " \"x86-32\":{\"url\":\"fteqw-x86_32.nexe\"}," >> $NACL
fi
if [ -e "$BUILDFOLDER/nacl_arm/fteqw-arm.nexe" ]; then
mv $BUILDFOLDER/nacl_arm/fteqw-arm.nexe $BUILDFOLDER/nacl/fteqw-arm.nexe
echo " \"arm\":{\"url\":\"fteqw-arm.nexe\"}" >> $NACL
fi
$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-finalize -o $BUILDFOLDER/nacl/fteqw.pexe $BUILDFOLDER/nacl_portable/fteqw.pexe
echo " \"portable\":{\"pnacl-translate\":{\"url\":\"fteqw.pexe\"}}" >> $NACL
echo "} }" >> $NACL
rm -rf "$BUILDFOLDER/nacl_amd64"
rm -rf "$BUILDFOLDER/nacl_x86"
rm -rf "$BUILDFOLDER/nacl_arm"
rm -rf "$BUILDFOLDER/nacl_portable"
fi
if [ "$BUILD_WINDOWS" != "n" ]; then
echo Archiving output
SVNVER=$(svnversion $SVNROOT)
cd $BUILDFOLDER/
zip -q -9 $ARCHIVEFOLDER/win_fteqw_$SVNVER.zip win32/fteglqw.exe win32/fteqwsv.exe win32/fteqccgui.exe win32/debug/fteglqw.exe win64/fteqw.exe win64/debug/fteglqw.exe
cd $BUILDFOLDER/win32/
zip -q -j -9 $BUILDFOLDER/fteqw_for_windows.zip fteglqw.exe fteqwsv.exe fteqccgui.exe fteplug_qi_x86.dll fteplug_xmpp_x86.dll fteplug_irc_x86.dll fteplug_ezhud_x86.dll
cd $HOME/3rdparty_win32/
zip -q -9 $BUILDFOLDER/fteqw_for_windows.zip ogg.dll vorbis.dll vorbisfile.dll freetype6.dll zlib1.dll
mkdir -p $BASE/tmp/fte
cd $BASE/tmp/
cp $BUILDFOLDER/csaddon/menu.dat fte
zip -q -9 $BUILDFOLDER/fteqw_for_windows.zip fte/menu.dat
#~/afterquake/updatemini.sh
fi
echo "All done"
END=$(date +%s)
DIFF=$(( $END - $START ))
MINS=$(( $DIFF / 60 ))
echo "Total Compile Time: $MINS minutes" >> $BUILDLOGFOLDER/buildlog.txt
echo "Total Compile Time: $MINS minutes"
cd $HOME
#./errorlog.sh
#cd $HOME
#rm .bitchxrc
#cp ./fteqw/.bitchxrc ./
#./BitchX -a irc.quakenet.org -A -c "#fte" -n A_Gorilla

View file

@ -285,6 +285,12 @@ ifeq ($(FTE_TARGET),linux32)
CC=gcc -m32
BITS=32
endif
ifeq ($(FTE_TARGET),linuxarmhf)
#debian's armhf is armv7, but armv6 works on RPI too.
FTE_TARGET=linux
CC=arm-linux-gnueabihf-gcc -marm -march=armv6 -mfpu=vfp -mfloat-abi=hard
BITS=armhf
endif
ifeq ($(FTE_TARGET),linuxx32)
#note: the x32 abi is still not finished or something.
#at the current time, you will need to edit your kernel's commandline to allow this stuff to run
@ -357,7 +363,7 @@ ifeq ($(NOCOMPAT),1)
NCCFLAGS=-DNOLEGACY -DOMIT_QCC
NCDIRPREFIX=nc
endif
ALL_CFLAGS=$(HAVECONFIG) $(VISIBILITY_FLAGS) $(BRANDFLAGS) $(CFLAGS) $(BASE_CFLAGS) $(WCFLAGS) $(ARCH_CFLAGS) $(NCCFLAGS)
ALL_CFLAGS=$(HAVECONFIG) $(VISIBILITY_FLAGS) $(BRANDFLAGS) $(CFLAGS) $(BASE_CFLAGS) $(WCFLAGS) $(ARCH_CFLAGS) $(NCCFLAGS) -I$(ARCHLIBS)
#cheap compile-everything-in-one-unit (compile becomes preprocess only)
ifneq ($(WPO),)
@ -374,7 +380,7 @@ endif
#DO_ECHO=@echo $< &&
DO_ECHO=@
#DO_ECHO=
DO_ECHO=
DO_CC=$(DO_ECHO) $(CC) $(LTO_CC) $(ALL_CFLAGS) -o $@ -c $<
ifeq ($(FTE_TARGET),vc)
@ -425,7 +431,7 @@ OGGVORBISLDFLAGS ?= -lvorbisfile -lvorbis -logg
VISIBILITY_FLAGS?=
#BASELDFLAGS=-lm -lz
XLDFLAGS=$(IMAGELDFLAGS)
XLDFLAGS=-L$(ARCHLIBS) $(IMAGELDFLAGS)
#hack some other arguments based upon the toolchain
ifeq ($(FTE_TARGET),vc)
@ -446,6 +452,9 @@ DEBUG_CFLAGS?=-ggdb -g
DEBUG_CFLAGS+=-DDEBUG
RELEASE_CFLAGS?=-O3 -ffast-math $(CPUOPTIMIZATIONS)
ARCH?=$(shell $(CC) -dumpmachine)
ARCHLIBS=$(NATIVE_ABSBASE_DIR)/libs-$(ARCH)
#incase our compiler doesn't support it (mingw)
ifeq ($(shell LANG=c $(CC) -rdynamic 2>&1 | grep unrecognized),)
DEBUG_CFLAGS+= -rdynamic
@ -824,7 +833,7 @@ ifeq (,$(findstring NO_ZLIB,$(CFLAGS)))
SV_LDFLAGS+=-lz
GL_LDFLAGS+=-lz
M_LDFLAGS+=-lz
QCC_LDFLAGS+=-lz
QCC_LDFLAGS+=-L$(ARCHLIBS) -lz
endif
@ -843,23 +852,24 @@ ifeq ($(FTE_TARGET),nacl)
CC=
STRIP=
NACLLIBC=glibc
ifeq ($(NARCH),x86_32)
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_newlib/bin/i686-nacl-gcc -DNACL -m32
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_newlib/bin/i686-nacl-strip
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-gcc -DNACL -m32
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-strip
BITS=
NACLLIBS=newlib_x86_32/Release
NACLLIBS=$(NACLLIBC)_x86_32/Release
endif
ifeq ($(NARCH),x86_64)
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_newlib/bin/i686-nacl-gcc -DNACL -m64
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_newlib/bin/i686-nacl-strip
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-gcc -DNACL -m64
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_x86_$(NACLLIBC)/bin/i686-nacl-strip
BITS=
NACLLIBS=newlib_x86_64/Release
NACLLIBS=$(NACLLIBC)_x86_64/Release
endif
ifeq ($(NARCH),arm)
CC=NACL_SDK_ROOT/toolchain/$(MYOS)_arm_newlib/bin/arm-nacl-gcc -DNACL
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_arm_newlib/bin/arm-nacl-strip
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_arm_$(NACLLIBC)/bin/arm-nacl-gcc -DNACL
STRIP=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_arm_$(NACLLIBC)/bin/arm-nacl-strip
BITS=
NACLLIBS=newlib_arm/Release
NACLLIBS=$(NACLLIBC)_arm/Release
endif
ifeq ($(NARCH),pnacl)
CC=$(NACL_SDK_ROOT)/toolchain/$(MYOS)_pnacl/bin/pnacl-clang -DNACL
@ -1435,6 +1445,8 @@ endif
SV_DIR?=sv_sdl
DEPCC?=$(CC)
ARCH:=$(ARCH)
BASELDFLAGS:=-L$(ARCHLIBS) $(BASELDFLAGS)
-include Makefile_private
@ -1590,7 +1602,7 @@ _clsv-profile: reldir
@$(MAKE) _out-profile EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
sv-tmp: reldir debugdir
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(SV_EXE_NAME)" WCFLAGS="$(SV_CFLAGS)" LDFLAGS="$(SV_LDFLAGS) $(LDFLAGS)" OBJS="SV_OBJS"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(SV_EXE_NAME)" WCFLAGS="$(SV_CFLAGS)" LDFLAGS="$(ARCH_LDFLAGS) $(SV_LDFLAGS) $(LDFLAGS)" OBJS="SV_OBJS"
sv-rel:
@$(MAKE) sv-tmp TYPE=_out-rel OUT_DIR="$(RELEASE_DIR)/$(NCDIRPREFIX)$(SV_DIR)"
sv-dbg:
@ -1967,7 +1979,7 @@ $(BASE_DIR)/libs/SDL2-2.0.1/x86_64-w64-mingw32/bin/sdl2-config: $(BASE_DIR)/libs
#update these to download+build a different version. this assumes that the url+subdirs etc contain a consistant version everywhere.
JPEGVER=9a
ZLIBVER=1.2.8
ZLIBVER=1.2.11
PNGVER=1.6.14
OGGVER=1.3.2
VORBISVER=1.3.4
@ -1975,13 +1987,11 @@ VORBISVER=1.3.4
AR?=$(ARCH)-ar
CONFIGARGS+= -host=$(ARCH) --enable-shared=no
CONFIGARGS+= -host=$(ARCH) --enable-shared=no CC="$(CC)"
CONFIGARGS:= $(CONFIGARGS)
#--disable-silent-rules
makelibs:
#lock these down, to avoid expanding them too often
#TOOLOVERRIDES:=$(TOOLOVERRIDES)
#CONFIGARGS:=$(CONFIGARGS)
ifndef ARCH
$(MAKE) makelibs ARCH=$(shell $(CC) -dumpmachine)
else
@ -1990,10 +2000,10 @@ else
-test -f libs-$(ARCH)/libjpeg.a || (cd libs-$(ARCH) && tar -xvzf ../jpegsrc.v$(JPEGVER).tar.gz && cd jpeg-$(JPEGVER) && $(TOOLOVERRIDES) ./configure $(CONFIGARGS) && $(TOOLOVERRIDES) $(MAKE) && cp .libs/libjpeg.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libjpeg.a && cp jconfig.h jerror.h jmorecfg.h jpeglib.h jversion.h ../ )
test -f zlib-$(ZLIBVER).tar.gz || wget http://zlib.net/zlib-$(ZLIBVER).tar.gz
-test -f libs-$(ARCH)/libz.a || (cd libs-$(ARCH) && tar -xvzf ../zlib-$(ZLIBVER).tar.gz && cd zlib-$(ZLIBVER) && $(TOOLOVERRIDES) ./configure --static && $(TOOLOVERRIDES) $(MAKE) libz.a CC="$(CC) $(W32_CFLAGS)" && cp libz.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libz.a && cp zlib.h zconf.h zutil.h ../ )
-test -f libs-$(ARCH)/libz.a || (cd libs-$(ARCH) && tar -xvzf ../zlib-$(ZLIBVER).tar.gz && cd zlib-$(ZLIBVER) && $(TOOLOVERRIDES) ./configure --static && $(TOOLOVERRIDES) $(MAKE) libz.a CC="$(CC) $(W32_CFLAGS) -fPIC" && cp libz.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libz.a && cp zlib.h zconf.h zutil.h ../ )
test -f libpng-$(PNGVER).tar.gz || wget http://prdownloads.sourceforge.net/libpng/libpng-$(PNGVER).tar.gz?download -O libpng-$(PNGVER).tar.gz
-test -f libs-$(ARCH)/libpng.a || (cd libs-$(ARCH) && tar -xvzf ../libpng-$(PNGVER).tar.gz && cd libpng-$(PNGVER) && $(TOOLOVERRIDES) ./configure $(CONFIGARGS) --with-zlib-prefix=$(NATIVE_ABSBASE_DIR)/libs-$(ARCH)/zlib-$(ZLIBVER)/ && $(TOOLOVERRIDES) $(MAKE) && cp .libs/libpng16.a ../libpng.a && cp png*.h ../ )
-test -f libs-$(ARCH)/libpng.a || (cd libs-$(ARCH) && tar -xvzf ../libpng-$(PNGVER).tar.gz && cd libpng-$(PNGVER) && $(TOOLOVERRIDES) ./configure CPPFLAGS=-I$(NATIVE_ABSBASE_DIR)/libs-$(ARCH)/ LDFLAGS=-L$(NATIVE_ABSBASE_DIR)/libs-$(ARCH)/ $(CONFIGARGS) --enable-static && $(TOOLOVERRIDES) $(MAKE) && cp .libs/libpng16.a ../libpng.a && cp png*.h ../ )
test -f libogg-$(OGGVER).tar.gz || wget http://downloads.xiph.org/releases/ogg/libogg-$(OGGVER).tar.gz
-test -f libs-$(ARCH)/libogg.a || (cd libs-$(ARCH) && tar -xvzf ../libogg-$(OGGVER).tar.gz && cd libogg-$(OGGVER) && $(TOOLOVERRIDES) ./configure $(CONFIGARGS) && $(TOOLOVERRIDES) $(MAKE) && cp src/.libs/libogg.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libogg.a)

View file

@ -2,19 +2,22 @@
#windows is special as always, but we don't support itanium, and microsoft don't support anything else (not even arm with the nt win32 api)
ifeq ($(FTE_TARGET),win32)
PLUG_NATIVE_EXT=_x86.dll
PLUG_LDFLAGS=-L../engine/libs/mingw-libs -lzlib
PLUG_LDFLAGS=
PLUG_LDFLAGS_ZLIB=-L../engine/libs/mingw-libs -lzlib
BITS=32
PLUG_LDFLAGS_DL=
endif
ifeq ($(FTE_TARGET),win64)
PLUG_NATIVE_EXT=_x64.dll
PLUG_LDFLAGS=-L../engine/libs/mingw64-libs -lz -Wl,--support-old-code
PLUG_LDFLAGS=-Wl,--support-old-code
PLUG_LDFLAGS_ZLIB=-L../engine/libs/mingw64-libs -lz
BITS=64
PLUG_LDFLAGS_DL=
endif
PLUG_LDFLAGS_DL?=-ldl
PLUG_LDFLAGS?=-L/usr/local/lib -Wl,-R/usr/local/lib -lz -lm
PLUG_LDFLAGS?=-L/usr/local/lib -Wl,-R/usr/local/lib -lm
PLUG_LDFLAGS_ZLIB?=-lz
ifneq ($(PLUG_NATIVE_EXT),)
#if we're on windows, we'll put our windows-specific hacks here.
@ -38,18 +41,28 @@ endif
#if they're not on windows, we'll try asking the compiler directly
#the check to see if its already set is to avoid asking msvc, which would probably break things.
ifeq ($(PLUG_NATIVE_EXT),)
LIBRESOLV=-lresolv
LIBRESOLV=-lresolv
ifneq ($(shell echo|$(CC) -E -dM -|grep __amd64__),)
PLUG_NATIVE_EXT=_amd64.so
#either x32 or x64 ABIs
ifneq ($(shell echo|$(CC) -E -dM -|grep __ILP32__),)
PLUG_NATIVE_EXT=_x32.so
else
PLUG_NATIVE_EXT=_amd64.so
endif
endif
ifneq ($(shell echo|$(CC) -E -dM -|grep __i386__),)
PLUG_NATIVE_EXT=_x86.so
PLUG_NATIVE_EXT=_x86.so
endif
ifneq ($(shell echo|$(CC) -E -dM -|grep __arm__),)
PLUG_NATIVE_EXT=_arm.so
#gnueabi[hf]
ifneq ($(shell echo|$(CC) -E -dM -|grep __SOFTFP__),)
PLUG_NATIVE_EXT=_arm.so
else
PLUG_NATIVE_EXT=_armhf.so
endif
endif
ifneq ($(shell echo|$(CC) -E -dM -|grep __ppc__),)
PLUG_NATIVE_EXT=_ppc.so
PLUG_NATIVE_EXT=_ppc.so
endif
endif
@ -59,7 +72,11 @@ PLUG_NATIVE_EXT?=_unk.so
PLUG_DEFFILE?=
PLUG_CFLAGS?=-fPIC -Wl,--no-undefined -Bsymbolic -fvisibility=hidden
PLUG_CXXFLAGS?=-fPIC -Wl,--no-undefined -Bsymbolic -fvisibility=hidden
PLUG_LDFLAGS?=
PLUG_LDFLAGS_ZLIB?=
ARCH:=$(shell $(CC) -dumpmachine)
PLUG_LDFLAGS:=-L../engine/libs-$(ARCH) $(PLUG_LDFLAGS)
PLUG_CFLAGS:=-I../engine/libs-$(ARCH) $(PLUG_CFLAGS)
PLUG_CXXFLAGS:=-I../engine/libs-$(ARCH) $(PLUG_CXXFLAGS)
all: ezscript qi hud irc
@ -177,7 +194,7 @@ $(OUT_DIR)/fteplug_bullet$(PLUG_NATIVE_EXT): bullet/bulletplug.c plugin.c qvm_ap
-include Makefile.private
$(OUT_DIR)/fteplug_mpq$(PLUG_NATIVE_EXT): mpq/fs_mpq.c mpq/blast.c plugin.c qvm_api.c
$(CC) $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -o $@ -shared $(PLUG_CFLAGS) -Impq $^ $(PLUG_DEFFILE) $(PLUG_LDFLAGS)
$(CC) $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -o $@ -shared $(PLUG_CFLAGS) -Impq $^ $(PLUG_DEFFILE) $(PLUG_LDFLAGS_ZLIB) $(PLUG_LDFLAGS)
NATIVE_PLUGINS+=mpq
$(OUT_DIR)/fteplug_xmpp$(PLUG_NATIVE_EXT): jabber/jabberclient.c jabber/jingle.c jabber/sift.c jabber/xml.c plugin.c qvm_api.c ../engine/common/sha1.c emailnot/md5.c