2011-12-31 18:50:17 +00:00
|
|
|
#!/bin/sh
|
2011-12-24 11:15:42 +00:00
|
|
|
|
2012-04-18 14:09:18 +00:00
|
|
|
# PCSX2 - PS2 Emulator for PCs
|
|
|
|
# Copyright (C) 2002-2011 PCSX2 Dev Team
|
|
|
|
#
|
|
|
|
# PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
# of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
# ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
# PURPOSE. See the GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
# If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2014-02-23 16:00:55 +00:00
|
|
|
flags="-DCMAKE_BUILD_PO=FALSE"
|
2014-07-04 21:50:51 +00:00
|
|
|
clean_build=0
|
|
|
|
use_clang=0;
|
2011-12-24 11:15:42 +00:00
|
|
|
|
2012-01-07 22:20:50 +00:00
|
|
|
for f in $*
|
|
|
|
do
|
2014-04-10 07:20:42 +00:00
|
|
|
case $f in
|
|
|
|
--dev|--devel ) flags="$flags -DCMAKE_BUILD_TYPE=Devel" ;;
|
|
|
|
--dbg|--debug ) flags="$flags -DCMAKE_BUILD_TYPE=Debug" ;;
|
2014-07-10 07:17:07 +00:00
|
|
|
--strip ) flags="$flags -DCMAKE_BUILD_STRIP=TRUE" ;;
|
2014-04-10 07:20:42 +00:00
|
|
|
--release ) flags="$flags -DCMAKE_BUILD_TYPE=Release" ;;
|
|
|
|
--glsl ) flags="$flags -DGLSL_API=TRUE" ;;
|
|
|
|
--egl ) flags="$flags -DEGL_API=TRUE" ;;
|
|
|
|
--gles ) flags="$flags -DGLES_API=TRUE" ;;
|
|
|
|
--sdl2 ) flags="$flags -DSDL2_API=TRUE" ;;
|
|
|
|
--extra ) flags="$flags -DEXTRA_PLUGINS=TRUE" ;;
|
2014-07-12 17:57:26 +00:00
|
|
|
--asan ) flags="$flags -DUSE_ASAN=TRUE";;
|
2014-07-04 21:50:51 +00:00
|
|
|
--clang ) use_clang=1; flags="$flags -DUSE_CLANG=TRUE" ;;
|
|
|
|
--clean ) clean_build=1 ;;
|
2014-04-10 07:20:42 +00:00
|
|
|
|
|
|
|
*)
|
|
|
|
# unknown option
|
|
|
|
echo "** User options **"
|
|
|
|
echo "--dev / --devel : Build PCSX2 as a Development build."
|
|
|
|
echo "--debug : Build PCSX2 as a Debug build."
|
|
|
|
echo "--release : Build PCSX2 as a Release build."
|
|
|
|
echo "--clean : Do a clean build."
|
2014-03-29 10:24:39 +00:00
|
|
|
echo "** Developper option **"
|
2014-07-12 17:57:26 +00:00
|
|
|
echo "--clang : Build with Clang/llvm"
|
|
|
|
echo "--extra : Build all plugins"
|
|
|
|
echo "--asan : Enable with Address sanitizer"
|
|
|
|
echo ""
|
2014-03-29 10:24:39 +00:00
|
|
|
echo "--glsl : Replace CG backend of ZZogl by GLSL"
|
|
|
|
echo "--egl : Replace GLX by EGL (ZZogl plugins only)"
|
|
|
|
echo "--sdl2 : Build with SDL2 (crash if wx is linked to SDL1)"
|
|
|
|
echo "--gles : Replace openGL backend of GSdx by openGLES3"
|
2014-04-10 07:20:42 +00:00
|
|
|
exit 1;;
|
|
|
|
esac
|
2012-01-07 22:20:50 +00:00
|
|
|
done
|
2011-12-24 11:15:42 +00:00
|
|
|
|
2014-07-04 21:50:51 +00:00
|
|
|
[ $clean_build -eq 1 ] && (echo "Doing a clean build."; rm -fr build )
|
2012-10-21 18:10:13 +00:00
|
|
|
|
2014-07-04 21:50:51 +00:00
|
|
|
echo "Building pcsx2 with $flags\n" | tee install_log.txt
|
2012-10-21 18:10:13 +00:00
|
|
|
|
|
|
|
mkdir -p build
|
2011-12-24 11:15:42 +00:00
|
|
|
cd build
|
|
|
|
|
2014-07-04 21:50:51 +00:00
|
|
|
if [ $use_clang -eq 1 ]
|
|
|
|
then
|
|
|
|
CC=clang CXX=clang++ cmake $flags .. 2>&1 | tee -a ../install_log.txt
|
|
|
|
else
|
|
|
|
cmake $flags .. 2>&1 | tee -a ../install_log.txt
|
|
|
|
fi
|
2012-10-21 18:10:13 +00:00
|
|
|
|
2012-04-23 18:58:03 +00:00
|
|
|
CORE=`grep -w -c processor /proc/cpuinfo`
|
2014-04-10 07:20:42 +00:00
|
|
|
make -j $CORE 2>&1 | tee -a ../install_log.txt
|
|
|
|
make install 2>&1 | tee -a ../install_log.txt
|
2011-12-24 11:15:42 +00:00
|
|
|
|
2012-04-18 14:09:18 +00:00
|
|
|
cd ..
|