mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
OSX build: mighty tweak osxbuild.sh and link to LibPNG from Fink on x86_64.
The build script now has two more presets: helix and installtools (which was previously attempted after the build; untested). Also, - when detecting git, run commands such that the SVN repo isn't accessed - package kextract, kgroup and arttool into tools/ in the zip - try to exit on failure in some places, though that doesn't seem to work git-svn-id: https://svn.eduke32.com/eduke32@2852 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b1f98d241e
commit
19d426ba02
2 changed files with 121 additions and 74 deletions
|
@ -310,8 +310,8 @@ ifeq ($(PLATFORM),WINDOWS)
|
|||
else
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
ifneq ($(USE_LIBPNG),0)
|
||||
BUILDCFLAGS+= -I/opt/local/include -I/usr/local/include
|
||||
LIBS+= -L/opt/local/lib -L/usr/local/lib -lpng -lz
|
||||
BUILDCFLAGS+= -I/opt/local/include -I/sw/include -I/usr/local/include
|
||||
LIBS+= -L/opt/local/lib -L/usr/local/lib -lpng # -lz
|
||||
endif
|
||||
else
|
||||
LIBS+= -lpng -lz
|
||||
|
|
|
@ -8,8 +8,10 @@ build86=1
|
|||
build64=1
|
||||
buildmain=1
|
||||
buildtools=0
|
||||
installtools=0
|
||||
builddebug=0
|
||||
pack=1
|
||||
iamhelix=0
|
||||
|
||||
# Enforce OS:
|
||||
if [ `uname -s` != Darwin ]; then
|
||||
|
@ -37,12 +39,22 @@ fi
|
|||
# Parse arguments:
|
||||
for i in $*; do
|
||||
case $i in
|
||||
# onlyzip: For Helixhorned's convenience.
|
||||
# onlyzip, helix: For Helixhorned's convenience.
|
||||
onlyzip)
|
||||
buildmain=0
|
||||
buildtools=0
|
||||
pack=1
|
||||
;;
|
||||
helix)
|
||||
iamhelix=1
|
||||
buildppc=0
|
||||
build86=1
|
||||
build64=1
|
||||
buildmain=1
|
||||
buildtools=1
|
||||
builddebug=0
|
||||
pack=1
|
||||
;;
|
||||
|
||||
# For the convenience of universal distributors:
|
||||
dist)
|
||||
|
@ -73,6 +85,18 @@ for i in $*; do
|
|||
pack=1
|
||||
;;
|
||||
|
||||
# misc.
|
||||
installtools)
|
||||
buildppc=0
|
||||
build86=0
|
||||
build64=0
|
||||
buildmain=0
|
||||
buildtools=0
|
||||
builddebug=0
|
||||
pack=0
|
||||
installtools=1
|
||||
;;
|
||||
|
||||
--buildppc=*)
|
||||
buildppc=${i#*=}
|
||||
;;
|
||||
|
@ -106,7 +130,7 @@ for i in $*; do
|
|||
echo " [--main=<0|1>] [--tools=<0|1>]"
|
||||
echo " [--pack=<0|1>]"
|
||||
echo "presets:"
|
||||
echo " [onlyzip] [dist] [disttools] [full]"
|
||||
echo " [onlyzip] [dist] [disttools] [full] [installtools]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
@ -123,11 +147,12 @@ if [ `expr $darwinversion \> 10` == 1 ]; then
|
|||
fi
|
||||
|
||||
# Detect versioning systems and pull the revision number:
|
||||
rev=`svn info | grep Revision | awk '{ print $2 }'`
|
||||
rev=$(svn info 2> /dev/null | grep Revision | awk '{ print $2 }')
|
||||
vc=svn
|
||||
if [ -z "$rev" ]; then
|
||||
vc=git
|
||||
rev=`git svn info | grep 'Revision' | awk '{ print $2 }'`
|
||||
rev=$(git log | grep 'git-svn-id:' | head -n 1 | sed -E 's/.*\@([0-9]+).*/\1/')
|
||||
echo "Detected git repository, revision r$rev"
|
||||
fi
|
||||
|
||||
if [ -n "$rev" ]; then
|
||||
|
@ -173,73 +198,83 @@ if [ $buildppc == 1 ]; then
|
|||
fi
|
||||
|
||||
# Building the buildtools:
|
||||
if [ $buildtools == 1 ] && [ -d "build" ]; then
|
||||
if [ $buildtools$installtools != 00 ] && [ -d "build" ]; then
|
||||
cd build
|
||||
|
||||
rm -f *{.x86,.x64,.ppc}
|
||||
make veryclean
|
||||
EXESUFFIX_OVERRIDE=.debug make veryclean
|
||||
makecmd="make -k"
|
||||
|
||||
if [ $build64 == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildtools "x86_64 debug" \
|
||||
"ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.debug.x64 $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=1 make -k utils"
|
||||
fi
|
||||
if [ $buildtools == 1 ]; then
|
||||
rm -f *{.x86,.x64,.ppc}
|
||||
make veryclean
|
||||
EXESUFFIX_OVERRIDE=.debug make veryclean
|
||||
|
||||
dobuildtools "x86_64 release" \
|
||||
"ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.x64 $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 make -k utils"
|
||||
fi
|
||||
|
||||
if [ $build86 == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildtools "x86 debug" \
|
||||
"EXESUFFIX_OVERRIDE=.debug.x86 $commonargs RELEASE=0 BUILD32_ON_64=1 USE_LIBVPX=0 make -k utils"
|
||||
fi
|
||||
|
||||
dobuildtools "x86 release" \
|
||||
"EXESUFFIX_OVERRIDE=.x86 $commonargs RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 make -k utils"
|
||||
fi
|
||||
|
||||
if [ $buildppc == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildtools "PowerPC debug" \
|
||||
"ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.debug.ppc $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=0 make -k utils"
|
||||
fi
|
||||
|
||||
dobuildtools "PowerPC release" \
|
||||
"ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.ppc $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 make -k utils"
|
||||
fi
|
||||
|
||||
echo buildtools: Creating fat binaries.
|
||||
utils=`make printutils && EXESUFFIX_OVERRIDE=.debug make printutils`
|
||||
for i in $utils; do
|
||||
binaries=
|
||||
for j in ${i}.{x86,x64,ppc}; do
|
||||
if [ -f "$j" ]; then
|
||||
binaries="$binaries $j"
|
||||
if [ $build64 == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildtools "x86_64 debug" \
|
||||
"ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.debug.x64 $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=1 $makecmd utils"
|
||||
fi
|
||||
done
|
||||
if [ -n "$binaries" ]; then
|
||||
lipo -create $binaries -output $i
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -d "/opt/local/bin" ]; then
|
||||
echo buildtools: Installing to MacPorts search path.
|
||||
dobuildtools "x86_64 release" \
|
||||
"ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.x64 $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 $makecmd utils"
|
||||
fi
|
||||
|
||||
if [ $build86 == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildtools "x86 debug" \
|
||||
"EXESUFFIX_OVERRIDE=.debug.x86 $commonargs RELEASE=0 BUILD32_ON_64=1 USE_LIBVPX=0 $makecmd utils"
|
||||
fi
|
||||
|
||||
dobuildtools "x86 release" \
|
||||
"EXESUFFIX_OVERRIDE=.x86 $commonargs RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 $makecmd utils"
|
||||
fi
|
||||
|
||||
if [ $buildppc == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildtools "PowerPC debug" \
|
||||
"ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.debug.ppc $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=0 $makecmd utils"
|
||||
fi
|
||||
|
||||
dobuildtools "PowerPC release" \
|
||||
"ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.ppc $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 $makecmd utils"
|
||||
fi
|
||||
|
||||
mkdir -p ../tools
|
||||
|
||||
echo buildtools: Creating fat binaries.
|
||||
utils=`make printutils && EXESUFFIX_OVERRIDE=.debug make printutils`
|
||||
for i in $utils; do
|
||||
if [ -f "$i" ]; then
|
||||
cp -f "$i" "/opt/local/bin/"
|
||||
binaries=
|
||||
for j in ${i}.{x86,x64,ppc}; do
|
||||
if [ -f "$j" ]; then
|
||||
binaries="$binaries $j"
|
||||
fi
|
||||
done
|
||||
if [ -n "$binaries" ]; then
|
||||
lipo -create $binaries -output $i || exit 1
|
||||
# ln -f -s ../build/$i ../tools/$i || exit 1
|
||||
cp -f $i ../tools/$i || exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -d "/usr/local/bin" ]; then
|
||||
echo buildtools: Installing to Homebrew search path.
|
||||
for i in $utils; do
|
||||
if [ -f "$i" ]; then
|
||||
cp -f "$i" "/usr/local/bin/"
|
||||
fi
|
||||
done
|
||||
if [ $installtools == 1 ]; then
|
||||
if [ -d "/opt/local/bin" ]; then
|
||||
echo buildtools: Installing to MacPorts search path.
|
||||
for i in $utils; do
|
||||
if [ -f "$i" ]; then
|
||||
cp -f "$i" "/opt/local/bin/" || exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -d "/usr/local/bin" ]; then
|
||||
echo buildtools: Installing to Homebrew search path.
|
||||
for i in $utils; do
|
||||
if [ -f "$i" ]; then
|
||||
cp -f "$i" "/usr/local/bin/" || exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
@ -250,28 +285,34 @@ if [ $buildmain == 1 ]; then
|
|||
rm -f {eduke32,mapster32}{.debug,}{.x86,.x64,.ppc,}
|
||||
rm -rf {EDuke32,Mapster32}{.debug,}.app
|
||||
|
||||
if [ $iamhelix == 1 ]; then
|
||||
makecmd="make -j 2"
|
||||
else
|
||||
makecmd="make"
|
||||
fi
|
||||
|
||||
if [ $build64 == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildem debug.x64 "ARCH='-arch x86_64' $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=1 make"
|
||||
dobuildem debug.x64 "ARCH='-arch x86_64' $commonargs RELEASE=0 BUILD32_ON_64=0 $makecmd"
|
||||
fi
|
||||
|
||||
dobuildem x64 "ARCH='-arch x86_64' $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 make"
|
||||
dobuildem x64 "ARCH='-arch x86_64' $commonargs RELEASE=1 BUILD32_ON_64=0 $makecmd"
|
||||
fi
|
||||
|
||||
if [ $build86 == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildem debug.x86 "$commonargs RELEASE=0 BUILD32_ON_64=1 USE_LIBVPX=0 make"
|
||||
dobuildem debug.x86 "$commonargs RELEASE=0 BUILD32_ON_64=1 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
||||
fi
|
||||
|
||||
dobuildem x86 "$commonargs RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 make"
|
||||
dobuildem x86 "$commonargs RELEASE=1 BUILD32_ON_64=1 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
||||
fi
|
||||
|
||||
if [ $buildppc == 1 ]; then
|
||||
if [ $builddebug == 1 ]; then
|
||||
dobuildem debug.ppc "ARCH='-arch ppc' $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=0 make"
|
||||
dobuildem debug.ppc "ARCH='-arch ppc' $commonargs RELEASE=0 BUILD32_ON_64=0 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
||||
fi
|
||||
|
||||
dobuildem ppc "ARCH='-arch ppc' $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 make"
|
||||
dobuildem ppc "ARCH='-arch ppc' $commonargs RELEASE=1 BUILD32_ON_64=0 USE_LIBPNG=0 USE_LIBVPX=0 $makecmd"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -283,7 +324,7 @@ elif [ "$vc" == "git" ]; then
|
|||
fi
|
||||
|
||||
# Duplicating .app bundles for debug build:
|
||||
if [ $builddebug == 1 ]; then
|
||||
if [ $builddebug == 1 ] || [ $pack == 1 ]; then
|
||||
for i in Mapster32 EDuke32; do
|
||||
if [ -d "$i.app" ]; then
|
||||
cp -RP "$i.app" "$i.debug.app"
|
||||
|
@ -292,7 +333,7 @@ if [ $builddebug == 1 ]; then
|
|||
fi
|
||||
|
||||
# Begin assembling archive contents:
|
||||
arcontents="README.OSX Changelog.txt"
|
||||
arcontents="README.OSX Changelog.txt tools/kextract tools/kgroup tools/arttool"
|
||||
|
||||
echo Creating fat binaries.
|
||||
success=0
|
||||
|
@ -304,6 +345,7 @@ for i in {eduke32,mapster32}{.debug,}; do
|
|||
success=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$binaries" ]; then
|
||||
lipo -create $binaries -output $i
|
||||
app=${i//eduke32/EDuke32}
|
||||
|
@ -315,6 +357,7 @@ done
|
|||
|
||||
# Almost done...
|
||||
if [ $success == 1 ]; then
|
||||
echo "Generating README.OSX and Changelog.txt"
|
||||
|
||||
# Output README.OSX:
|
||||
let "darwinversion -= 4"
|
||||
|
@ -323,10 +366,11 @@ if [ $success == 1 ]; then
|
|||
echo "EDuke32 home: http://www.eduke32.com" >> README.OSX
|
||||
echo "OS X build discussion on Duke4.net: http://forums.duke4.net/topic/4242-building-eduke-on-mac-os-x/" >> README.OSX
|
||||
echo "The 64-bit build in this archive has LibVPX (http://www.webmproject.org/code/)" >> README.OSX
|
||||
echo "from MacPorts (http://www.macports.org/) statically linked into it." >> README.OSX
|
||||
echo "from MacPorts (http://www.macports.org/) and" >> README.OSX
|
||||
echo "LibPNG from Fink (http://www.finkproject.org/) statically linked into it." >> README.OSX
|
||||
|
||||
# Generate Changelog:
|
||||
lastrevision=`ls -A1 eduke32-osx* | tail -n1 | cut -d- -f3 | cut -d. -f1`
|
||||
lastrevision=$(ls -A1 eduke32-osx* | tail -n1 | cut -d- -f3 | cut -d. -f1)
|
||||
|
||||
if [ -z $lastrevision ]; then
|
||||
let lastrevision=rev-1
|
||||
|
@ -337,14 +381,17 @@ if [ $success == 1 ]; then
|
|||
fi
|
||||
|
||||
if [ "$vc" == "svn" ]; then
|
||||
svn log -r $rev:$lastrevision > Changelog.txt
|
||||
svn log -r $rev:$lastrevision > Changelog.txt
|
||||
elif [ "$vc" == "git" ]; then
|
||||
git svn log -r $rev:$lastrevision > Changelog.txt
|
||||
commitid=$(git log --grep="git-svn-id: .*@$lastrevision" -n 1 | grep -E '^commit ' | head -n 1 | awk '{print $2}')
|
||||
# Get the commit messages and strip the email addresses
|
||||
git log $commitid..HEAD | sed 's/<.*@.*>//g' > Changelog.txt
|
||||
fi
|
||||
|
||||
# Package
|
||||
if [ $pack == 1 ]; then
|
||||
arfilename="eduke32-osx-$rev.zip"
|
||||
echo "Packing distribution into $arfilename"
|
||||
rm -f "$arfilename"
|
||||
zip -r -y "$arfilename" $arcontents -x "*.svn*" "*.git*"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue