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"
|
2017-08-01 17:05:29 +00:00
|
|
|
elif [[ "$0" != /* ]]; then
|
|
|
|
# Make the path absolute
|
|
|
|
BASE_DIR="$WORKDIR/$BASE_DIR"
|
2015-02-17 05:06:42 +00:00
|
|
|
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
|
|
|
|
|
2017-08-01 17:05:29 +00:00
|
|
|
JOBS=${JOBS:-7}
|
2015-02-06 11:30:20 +00:00
|
|
|
|
|
|
|
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
|
2017-09-19 18:51:43 +00:00
|
|
|
if uname -o | grep -i Msys > /dev/null 2>&1; then
|
|
|
|
MAKE=make
|
|
|
|
elif 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
|
|
|
|
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-18 00:04:25 +00:00
|
|
|
. "$BASE_DIR/libretro-build-common.sh"
|
2013-05-19 10:03:25 +00:00
|
|
|
|
2015-07-31 03:53:55 +00:00
|
|
|
# These are cores which only work properly right
|
|
|
|
# now on little-endian architecture systems
|
|
|
|
|
|
|
|
build_default_cores_little_endian_only() {
|
|
|
|
libretro_build_core tgbdual
|
2015-07-31 04:48:22 +00:00
|
|
|
if [ $platform != "psp1" ]; then
|
|
|
|
libretro_build_core gpsp
|
|
|
|
libretro_build_core o2em
|
|
|
|
fi
|
2015-07-31 03:53:55 +00:00
|
|
|
libretro_build_core 4do
|
|
|
|
|
|
|
|
if [ $platform != "qnx" ]; then
|
2015-07-31 04:48:22 +00:00
|
|
|
if [ $platform != "psp1" ]; then
|
2018-02-24 13:45:17 +00:00
|
|
|
libretro_build_core desmume2015
|
2015-07-31 04:48:22 +00:00
|
|
|
fi
|
2015-07-31 03:53:55 +00:00
|
|
|
libretro_build_core picodrive
|
|
|
|
fi
|
|
|
|
|
|
|
|
# TODO - Verify endianness compatibility - for now exclude
|
|
|
|
libretro_build_core virtualjaguar
|
|
|
|
}
|
|
|
|
|
2015-07-31 05:41:02 +00:00
|
|
|
# These are C++11 cores
|
2015-07-31 03:09:54 +00:00
|
|
|
|
|
|
|
build_default_cores_cpp11() {
|
|
|
|
libretro_build_core dinothawr
|
|
|
|
libretro_build_core stonesoup
|
2015-08-02 03:09:18 +00:00
|
|
|
libretro_build_core bsnes_accuracy
|
|
|
|
libretro_build_core bsnes_balanced
|
|
|
|
libretro_build_core bsnes_performance
|
2015-08-02 03:27:59 +00:00
|
|
|
libretro_build_core bsnes_mercury_accuracy
|
|
|
|
libretro_build_core bsnes_mercury_balanced
|
|
|
|
libretro_build_core bsnes_mercury_performance
|
2015-11-03 15:06:30 +00:00
|
|
|
libretro_build_core mame2014
|
2017-01-24 15:36:34 +00:00
|
|
|
libretro_build_core mame2016
|
2015-07-31 03:09:54 +00:00
|
|
|
libretro_build_core mame
|
|
|
|
}
|
2013-05-03 09:32:01 +00:00
|
|
|
|
2015-07-31 03:23:51 +00:00
|
|
|
# These are cores intended for platforms with a limited
|
|
|
|
# amount of RAM, where the full version would not fit
|
|
|
|
# into memory
|
|
|
|
|
|
|
|
build_default_cores_small_memory_footprint() {
|
|
|
|
libretro_build_core fb_alpha_cps1
|
|
|
|
libretro_build_core fb_alpha_cps2
|
|
|
|
libretro_build_core fb_alpha_neo
|
|
|
|
}
|
|
|
|
|
2015-07-31 03:12:01 +00:00
|
|
|
build_default_cores_libretro_gl() {
|
|
|
|
# Reasons for not compiling this yet on these targets (other than endianness issues)
|
|
|
|
# 1) Wii/NGC - no PPC dynarec, no usable graphics plugins that work with GX
|
|
|
|
# 2) PS3 - no PPC dynarec, PSGL is GLES 1.0 while graphics plugins right now require GL 2.0+/GLES2
|
2015-07-31 03:53:55 +00:00
|
|
|
# 3) QNX - Compilation issues, ARM NEON compiler issues
|
|
|
|
if [ $platform != "qnx" ]; then
|
|
|
|
libretro_build_core mupen64plus
|
|
|
|
fi
|
2015-07-31 03:12:01 +00:00
|
|
|
|
|
|
|
# Graphics require GLES 2/GL 2.0
|
2015-07-31 04:48:22 +00:00
|
|
|
if [ $platform != "psp1" ]; then
|
|
|
|
libretro_build_core 3dengine
|
|
|
|
fi
|
2015-07-31 03:12:01 +00:00
|
|
|
}
|
|
|
|
|
2015-07-31 03:09:54 +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-07-31 03:09:54 +00:00
|
|
|
build_default_cores() {
|
2015-07-31 04:17:17 +00:00
|
|
|
if [ $platform == "wii" ] || [ $platform == "ngc" ] || [ $platform == "psp1" ]; then
|
2015-07-31 03:23:51 +00:00
|
|
|
build_default_cores_small_memory_footprint
|
|
|
|
fi
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core 2048
|
|
|
|
libretro_build_core bluemsx
|
2016-11-06 22:32:25 +00:00
|
|
|
|
2015-09-15 06:35:40 +00:00
|
|
|
if [ $platform != "psp1" ] && [ $platform != "ngc" ] && [ $platform != "wii" ] && [ $platform != "ps3" ] && [ $platform != "sncps3" ] && [ $platform != "vita" ]; then
|
2015-07-31 04:17:17 +00:00
|
|
|
libretro_build_core dosbox
|
|
|
|
fi
|
2016-11-06 22:32:25 +00:00
|
|
|
|
2016-08-05 15:57:37 +00:00
|
|
|
libretro_build_core snes9x2005
|
2015-07-31 04:17:17 +00:00
|
|
|
if [ $platform != "psp1" ]; then
|
|
|
|
# Excluded for binary size reasons
|
2017-01-18 13:34:36 +00:00
|
|
|
libretro_build_core fbalpha
|
2015-07-31 04:17:17 +00:00
|
|
|
fi
|
2015-02-26 22:43:29 +00:00
|
|
|
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-09-15 00:48:56 +00:00
|
|
|
libretro_build_core handy
|
2015-07-31 05:25:29 +00:00
|
|
|
libretro_build_core stella
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core nestopia
|
2015-02-26 22:43:29 +00:00
|
|
|
libretro_build_core nxengine
|
|
|
|
libretro_build_core prboom
|
|
|
|
libretro_build_core quicknes
|
2016-08-05 15:57:37 +00:00
|
|
|
libretro_build_core snes9x2010
|
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 vecx
|
2015-07-29 23:34:15 +00:00
|
|
|
|
2015-07-31 04:17:17 +00:00
|
|
|
if [ $platform != "psp1" ]; then
|
|
|
|
# (PSP) Compilation issues
|
|
|
|
libretro_build_core mgba
|
|
|
|
# (PSP) Performance issues
|
|
|
|
libretro_build_core genesis_plus_gx
|
|
|
|
fi
|
2015-07-31 03:53:55 +00:00
|
|
|
|
2015-09-05 00:54:50 +00:00
|
|
|
if [ $platform != "psp1" ] && [ $platform != "wii" ] && [ $platform != "ngc" ] && [ $platform != "vita" ]; then
|
|
|
|
# (PSP/NGC/Wii/Vita) Performance and/or binary size issues
|
2015-07-31 04:17:17 +00:00
|
|
|
libretro_build_core bsnes_cplusplus98
|
2015-11-03 15:06:30 +00:00
|
|
|
libretro_build_core mame2003
|
2015-07-31 04:17:17 +00:00
|
|
|
libretro_build_core mednafen_gba
|
|
|
|
fi
|
2015-07-31 03:53:55 +00:00
|
|
|
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core mednafen_lynx
|
|
|
|
libretro_build_core mednafen_ngp
|
|
|
|
libretro_build_core mednafen_pce_fast
|
2015-07-31 04:17:17 +00:00
|
|
|
|
2015-03-10 21:16:45 +00:00
|
|
|
libretro_build_core mednafen_supergrafx
|
|
|
|
libretro_build_core mednafen_vb
|
|
|
|
libretro_build_core mednafen_wswan
|
|
|
|
|
2015-07-31 03:21:23 +00:00
|
|
|
libretro_build_core gw
|
2015-08-02 18:40:47 +00:00
|
|
|
libretro_build_core prosystem
|
2015-07-31 03:05:01 +00:00
|
|
|
|
2015-09-15 06:35:40 +00:00
|
|
|
if [ $platform != "ps3" ] && [ $platform != "sncps3" ] && [ $platform != "vita" ]; then
|
2015-08-04 05:08:57 +00:00
|
|
|
libretro_build_core 81
|
2015-07-31 03:53:55 +00:00
|
|
|
libretro_build_core fuse
|
2015-07-31 08:01:57 +00:00
|
|
|
libretro_build_core lutro
|
2015-07-31 03:53:55 +00:00
|
|
|
fi
|
|
|
|
|
2016-11-06 22:32:25 +00:00
|
|
|
if [ $platform != "ps3" ] && [ $platform != "sncps3" ] && [ $platform != "wii" ] && [ $platform != "wiiu" ] && [ $platform != "ngc" ] && [ $platform != "vita" ]; then
|
2015-07-31 03:53:55 +00:00
|
|
|
build_default_cores_little_endian_only
|
2015-07-31 03:25:02 +00:00
|
|
|
|
2015-07-31 03:12:01 +00:00
|
|
|
build_default_cores_libretro_gl
|
2015-07-31 03:05:01 +00:00
|
|
|
|
2015-07-31 04:48:22 +00:00
|
|
|
if [ $platform != "psp1" ]; then
|
2015-08-01 18:51:59 +00:00
|
|
|
# (PS3/NGC/Wii/PSP) Excluded for performance reasons
|
|
|
|
libretro_build_core snes9x
|
|
|
|
libretro_build_core vbam
|
|
|
|
|
2015-07-31 06:22:50 +00:00
|
|
|
# The only reason ScummVM won't be compiled in yet is
|
|
|
|
# 1) Wii/NGC/PSP - too big in binary size
|
|
|
|
# 2) PS3 - filesystem API issues
|
2015-07-31 04:48:22 +00:00
|
|
|
libretro_build_core scummvm
|
2015-07-31 06:22:50 +00:00
|
|
|
|
|
|
|
# Excluded for performance reasons
|
|
|
|
libretro_build_core mednafen_pcfx
|
|
|
|
libretro_build_core mednafen_psx
|
|
|
|
if [ $platform != "qnx" ]; then
|
|
|
|
libretro_build_core mednafen_snes
|
|
|
|
fi
|
2015-07-31 04:48:22 +00:00
|
|
|
fi
|
2015-07-31 03:05:01 +00:00
|
|
|
|
|
|
|
# Could work on PS3/Wii right now but way too slow right now,
|
|
|
|
# and messed up big-endian colors
|
|
|
|
libretro_build_core yabause
|
2015-07-31 05:25:29 +00:00
|
|
|
|
|
|
|
# Compilation/port status issues
|
|
|
|
libretro_build_core hatari
|
|
|
|
libretro_build_core meteor
|
2015-07-31 03:05:01 +00:00
|
|
|
|
2015-08-02 07:42:28 +00:00
|
|
|
|
2015-09-05 00:54:50 +00:00
|
|
|
if [ $platform != "qnx" ] && [ $platform != "psp1" ] && [ $platform != "vita" ]; then
|
2015-11-03 15:06:30 +00:00
|
|
|
libretro_build_core mame2010
|
2015-08-02 07:42:28 +00:00
|
|
|
|
2015-07-31 06:22:50 +00:00
|
|
|
build_default_cores_cpp11
|
2015-07-31 03:23:51 +00:00
|
|
|
|
2015-07-31 06:22:50 +00:00
|
|
|
# Just basic compilation issues right now for these platforms
|
|
|
|
libretro_build_core emux
|
2015-07-29 23:34:15 +00:00
|
|
|
|
2015-07-31 06:22:50 +00:00
|
|
|
if [ $platform != "win" ]; then
|
|
|
|
# Reasons for not compiling this on Windows yet -
|
|
|
|
# (Windows) - Doesn't work properly
|
|
|
|
# (QNX) - Compilation issues
|
|
|
|
# (PSP1) - Performance/compilation issues
|
|
|
|
# (Wii) - Performance/compilation issues
|
|
|
|
# (PS3) - Performance/compilation issues
|
|
|
|
libretro_build_core pcsx_rearmed
|
|
|
|
fi
|
|
|
|
|
2015-10-15 14:32:03 +00:00
|
|
|
if [ $platform != "ios" ] || [ $platform != "ios9" ]; then
|
2015-07-31 06:22:50 +00:00
|
|
|
# Would need ffmpeg libraries baked in
|
|
|
|
libretro_build_core ffmpeg
|
|
|
|
libretro_build_core ppsspp
|
|
|
|
|
|
|
|
libretro_build_core bnes
|
|
|
|
fi
|
2015-07-31 05:41:02 +00:00
|
|
|
fi
|
2015-03-10 21:16:45 +00:00
|
|
|
|
2015-07-31 06:22:50 +00:00
|
|
|
build_libretro_test
|
2015-02-17 19:44:01 +00:00
|
|
|
fi
|
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
|
2015-03-29 03:30:22 +00:00
|
|
|
--nologs)
|
|
|
|
LIBRETRO_LOG_SUPER=""
|
|
|
|
LIBRETRO_LOG_CORE=""
|
2015-03-10 21:16:45 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# New style (just generic cores for now)
|
2015-03-29 03:30:22 +00:00
|
|
|
want_cores="$want_cores $1"
|
2015-03-10 21:16:45 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2015-03-29 03:30:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
libretro_log_init
|
|
|
|
if [ -n "$want_cores" ]; then
|
|
|
|
for core in $want_cores; do
|
|
|
|
libretro_build_core $core
|
|
|
|
done
|
2015-03-10 21:16:45 +00:00
|
|
|
else
|
|
|
|
build_default_cores
|
2013-05-03 15:17:38 +00:00
|
|
|
fi
|
2015-03-26 03:09:06 +00:00
|
|
|
summary
|