2015-02-17 03:19:30 +00:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
# vim: set ts=3 sw=3 noet ft=sh : bash
|
2013-05-18 00:53:55 +00:00
|
|
|
|
2015-02-17 05:06:42 +00:00
|
|
|
SCRIPT="${0#./}"
|
|
|
|
BASE_DIR="${SCRIPT%/*}"
|
2015-02-22 04:36:05 +00:00
|
|
|
WORKDIR="$PWD"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-17 05:06:42 +00:00
|
|
|
if [ "$BASE_DIR" = "$SCRIPT" ]; then
|
|
|
|
BASE_DIR="$WORKDIR"
|
|
|
|
else
|
|
|
|
if [[ "$0" != /* ]]; then
|
|
|
|
# Make the path absolute
|
|
|
|
BASE_DIR="$WORKDIR/$BASE_DIR"
|
|
|
|
fi
|
|
|
|
fi
|
2015-02-06 12:00:22 +00:00
|
|
|
|
2015-02-22 04:36:05 +00:00
|
|
|
. "$BASE_DIR/libretro-config.sh"
|
2015-02-06 11:30:20 +00:00
|
|
|
|
|
|
|
if [ -z "$RARCH_DIST_DIR" ]; then
|
2015-02-17 19:44:01 +00:00
|
|
|
RARCH_DIR="$WORKDIR/dist"
|
2015-02-17 03:19:30 +00:00
|
|
|
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
2015-02-06 11:30:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$JOBS" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
JOBS=7
|
2015-02-06 11:30:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$HOST_CC" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
CC="${HOST_CC}-gcc"
|
|
|
|
CXX="${HOST_CC}-g++"
|
|
|
|
CXX11="${HOST_CC}-g++"
|
|
|
|
STRIP="${HOST_CC}-strip"
|
2015-02-06 11:30:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$MAKE" ]; then
|
2015-03-19 14:31:27 +00:00
|
|
|
if uname -s | grep -i MINGW > /dev/null 2>&1; then
|
2015-02-17 03:19:30 +00:00
|
|
|
MAKE=mingw32-make
|
|
|
|
else
|
|
|
|
if type gmake > /dev/null 2>&1; then
|
|
|
|
MAKE=gmake
|
|
|
|
else
|
|
|
|
MAKE=make
|
|
|
|
fi
|
|
|
|
fi
|
2015-02-06 11:30:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CC" ]; then
|
2015-02-19 18:14:22 +00:00
|
|
|
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
CC=cc
|
|
|
|
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
|
|
|
|
CC=mingw32-gcc
|
|
|
|
else
|
|
|
|
CC=gcc
|
|
|
|
fi
|
2015-02-06 11:30:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CXX" ]; then
|
2015-02-19 18:14:22 +00:00
|
|
|
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
CXX=c++
|
|
|
|
CXX11="clang++ -std=c++11 -stdlib=libc++"
|
|
|
|
# FIXME: Do this right later.
|
|
|
|
if [ "$ARCH" = "i386" ]; then
|
|
|
|
CC="cc -arch i386"
|
|
|
|
CXX="c++ -arch i386"
|
|
|
|
CXX11="clang++ -arch i386 -std=c++11 -stdlib=libc++"
|
|
|
|
fi
|
|
|
|
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
|
|
|
|
CXX=mingw32-g++
|
|
|
|
CXX11=mingw32-g++
|
|
|
|
else
|
|
|
|
CXX=g++
|
|
|
|
CXX11=g++
|
|
|
|
fi
|
2015-02-06 11:30:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET
|
2015-02-17 19:44:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
if [ "$FORMAT_COMPILER_TARGET" = "ios" ]; then
|
|
|
|
echo "iOS path: ${IOSSDK}"
|
|
|
|
echo "iOS version: ${IOSVER}"
|
|
|
|
fi
|
2015-02-06 11:30:20 +00:00
|
|
|
echo "CC = $CC"
|
|
|
|
echo "CXX = $CXX"
|
2015-02-10 21:13:41 +00:00
|
|
|
echo "CXX11 = $CXX11"
|
2015-02-06 11:30:20 +00:00
|
|
|
echo "STRIP = $STRIP"
|
|
|
|
|
2015-02-17 19:44:01 +00:00
|
|
|
|
2015-02-18 00:04:25 +00:00
|
|
|
. "$BASE_DIR/libretro-build-common.sh"
|
2013-05-19 10:03:25 +00:00
|
|
|
|
2015-03-10 21:16:45 +00:00
|
|
|
build_default_cores() {
|
2013-05-03 09:32:01 +00:00
|
|
|
|
2015-03-10 21:16:45 +00:00
|
|
|
# These build everywhere libretro-build.sh works
|
|
|
|
# (They also use rules builds, which will help later)
|
2015-02-19 06:45:23 +00:00
|
|
|
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core 2048
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core 3dengine
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core 4do
|
|
|
|
libretro_build_core bluemsx
|
|
|
|
libretro_build_core catsfc
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core desmume
|
|
|
|
libretro_build_core dosbox
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core fb_alpha
|
|
|
|
libretro_build_core fceumm
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core fmsx
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core gambatte
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core gpsp
|
|
|
|
libretro_build_core handy
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core meteor
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core nestopia
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core nxengine
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core o2em
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core prboom
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core prosystem
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core quicknes
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core snes9x
|
|
|
|
libretro_build_core snes9x_next
|
|
|
|
libretro_build_core stella
|
|
|
|
libretro_build_core tgbdual
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core tyrquake
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core vba_next
|
|
|
|
libretro_build_core vbam
|
|
|
|
libretro_build_core vecx
|
|
|
|
libretro_build_core virtualjaguar
|
|
|
|
|
|
|
|
# Nothing past here supports theos
|
|
|
|
[ "$platform" = "theos_ios" ] && return
|
|
|
|
|
2015-03-12 08:14:21 +00:00
|
|
|
libretro_build_core bsnes
|
|
|
|
libretro_build_core bsnes_cplusplus98
|
|
|
|
libretro_build_core bsnes_mercury
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core dinothawr
|
2015-03-12 08:14:21 +00:00
|
|
|
libretro_build_core emux
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core fuse
|
|
|
|
libretro_build_core genesis_plus_gx
|
|
|
|
libretro_build_core gw
|
|
|
|
libretro_build_core hatari
|
|
|
|
libretro_build_core lutro
|
2015-03-23 06:31:15 +00:00
|
|
|
libretro_build_core mame
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core mame078
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core mednafen_gba
|
|
|
|
libretro_build_core mednafen_lynx
|
|
|
|
libretro_build_core mednafen_ngp
|
|
|
|
libretro_build_core mednafen_pce_fast
|
|
|
|
libretro_build_core mednafen_pcfx
|
|
|
|
libretro_build_core mednafen_psx
|
|
|
|
libretro_build_core mednafen_snes
|
|
|
|
libretro_build_core mednafen_supergrafx
|
|
|
|
libretro_build_core mednafen_vb
|
|
|
|
libretro_build_core mednafen_wswan
|
2015-03-12 08:14:21 +00:00
|
|
|
libretro_build_core mupen64plus
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core picodrive
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core scummvm
|
|
|
|
libretro_build_core stonesoup
|
|
|
|
libretro_build_core yabause
|
|
|
|
|
|
|
|
if [ $platform != "win" ]; then
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core pcsx_rearmed
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-03-10 21:16:45 +00:00
|
|
|
|
|
|
|
if [ $platform != "ios" ]; then
|
2015-03-06 03:26:16 +00:00
|
|
|
libretro_build_core ffmpeg
|
|
|
|
libretro_build_core ppsspp
|
2015-03-10 21:16:45 +00:00
|
|
|
|
2015-03-12 08:14:21 +00:00
|
|
|
libretro_build_core bnes
|
2015-02-17 19:44:01 +00:00
|
|
|
fi
|
2015-02-26 22:43:29 +00:00
|
|
|
|
2015-02-17 03:19:30 +00:00
|
|
|
build_libretro_test
|
2015-03-10 21:16:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p "$RARCH_DIST_DIR"
|
|
|
|
|
|
|
|
if [ -n "$SKIP_UNCHANGED" ]; then
|
|
|
|
[ -z "$BUILD_REVISIONS_DIR" ] && BUILD_REVISIONS_DIR="$WORKDIR/build-revisions"
|
|
|
|
echo "mkdir -p \"$BUILD_REVISIONS_DIR\""
|
|
|
|
mkdir -p "$BUILD_REVISIONS_DIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
while [ -n "$1" ]; do
|
|
|
|
case "$1" in
|
|
|
|
build_libretro_*)
|
|
|
|
# "Old"-style
|
|
|
|
$1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# New style (just generic cores for now)
|
|
|
|
libretro_build_core $1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
else
|
|
|
|
build_default_cores
|
2013-05-03 15:17:38 +00:00
|
|
|
fi
|
2015-02-18 00:04:25 +00:00
|
|
|
build_summary
|