2015-02-16 19:19:30 -08:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
# vim: set ts=3 sw=3 noet ft=sh : bash
|
2013-02-10 18:30:38 +01:00
|
|
|
|
2014-07-26 18:56:49 -07:00
|
|
|
. ./libretro-config.sh
|
|
|
|
|
2014-08-17 22:07:05 -07:00
|
|
|
#split TARGET_ABI string into an array we can iterate over
|
|
|
|
IFS=' ' read -ra ABIS <<< "$TARGET_ABIS"
|
|
|
|
|
2013-07-12 17:31:12 +02:00
|
|
|
# BSDs don't have readlink -f
|
|
|
|
read_link()
|
|
|
|
{
|
2015-02-16 19:19:30 -08:00
|
|
|
TARGET_FILE="$1"
|
|
|
|
cd $(dirname "$TARGET_FILE")
|
|
|
|
TARGET_FILE=$(basename "$TARGET_FILE")
|
2013-07-12 17:31:12 +02:00
|
|
|
|
2015-02-16 19:19:30 -08:00
|
|
|
while [ -L "$TARGET_FILE" ]
|
|
|
|
do
|
|
|
|
TARGET_FILE=$(readlink "$TARGET_FILE")
|
|
|
|
cd $(dirname "$TARGET_FILE")
|
|
|
|
TARGET_FILE=$(basename "$TARGET_FILE")
|
|
|
|
done
|
2013-07-12 17:31:12 +02:00
|
|
|
|
2015-02-16 19:19:30 -08:00
|
|
|
PHYS_DIR=$(pwd -P)
|
|
|
|
RESULT="$PHYS_DIR/$TARGET_FILE"
|
|
|
|
echo $RESULT
|
2013-07-12 17:31:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
SCRIPT=$(read_link "$0")
|
|
|
|
echo "Script: $SCRIPT"
|
2013-04-29 22:12:35 +02:00
|
|
|
BASE_DIR=$(dirname $SCRIPT)
|
|
|
|
RARCH_DIR=$BASE_DIR/dist
|
2013-04-29 22:36:13 +02:00
|
|
|
RARCH_DIST_DIR=$RARCH_DIR/android
|
2013-10-30 02:11:09 +01:00
|
|
|
FORMAT=_android
|
2013-05-18 02:11:06 +02:00
|
|
|
FORMAT_EXT=so
|
2013-07-12 17:31:12 +02:00
|
|
|
|
2013-02-10 18:30:38 +01:00
|
|
|
die()
|
|
|
|
{
|
2015-02-16 19:19:30 -08:00
|
|
|
echo $1
|
|
|
|
#exit 1
|
2013-02-10 18:30:38 +01:00
|
|
|
}
|
|
|
|
|
2014-08-22 13:13:37 +02:00
|
|
|
# $1 is core name
|
2014-08-22 13:40:22 +02:00
|
|
|
# $2 is subdir (if there's no subdir, put "." here)
|
2015-11-09 14:53:42 +01:00
|
|
|
# $3 is appendage to core name for output JNI file
|
2014-08-22 13:40:22 +02:00
|
|
|
build_libretro_generic_makefile()
|
2014-06-21 18:34:11 +02:00
|
|
|
{
|
2015-02-16 19:19:30 -08:00
|
|
|
cd $BASE_DIR
|
|
|
|
if [ -d "libretro-${1}" ]; then
|
|
|
|
echo "=== Building ${1} ==="
|
|
|
|
cd libretro-${1}
|
|
|
|
cd ${2}
|
|
|
|
for a in "${ABIS[@]}"; do
|
|
|
|
if [ -z "${NOCLEAN}" ]; then
|
|
|
|
ndk-build clean APP_ABI=${a} || die "Failed to clean ${a} ${1}"
|
|
|
|
fi
|
|
|
|
ndk-build -j$JOBS APP_ABI=${a} || die "Failed to build ${a} ${1}"
|
2015-11-09 14:53:42 +01:00
|
|
|
cp ../libs/${a}/libretro${3}.${FORMAT_EXT} $RARCH_DIST_DIR/${a}/${1}_libretro${FORMAT}.${FORMAT_EXT}
|
2015-02-16 19:19:30 -08:00
|
|
|
done
|
|
|
|
else
|
|
|
|
echo "${1} not fetched, skipping ..."
|
|
|
|
fi
|
2014-06-21 18:34:11 +02:00
|
|
|
}
|
|
|
|
|
2013-04-29 22:12:35 +02:00
|
|
|
create_dist_dir()
|
|
|
|
{
|
2015-02-16 19:19:30 -08:00
|
|
|
if [ -d $RARCH_DIR ]; then
|
|
|
|
echo "Directory $RARCH_DIR already exists, skipping creation..."
|
|
|
|
else
|
|
|
|
mkdir $RARCH_DIR
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d $RARCH_DIST_DIR ]; then
|
|
|
|
echo "Directory $RARCH_DIST_DIR already exists, skipping creation..."
|
|
|
|
else
|
|
|
|
mkdir $RARCH_DIST_DIR
|
|
|
|
fi
|
|
|
|
|
|
|
|
for a in "${ABIS[@]}"; do
|
|
|
|
if [ -d $RARCH_DIST_DIR/${a} ]; then
|
|
|
|
echo "Directory $RARCH_DIST_DIR/${a} already exists, skipping creation..."
|
|
|
|
else
|
|
|
|
mkdir $RARCH_DIST_DIR/${a}
|
|
|
|
fi
|
|
|
|
done
|
2013-04-29 22:12:35 +02:00
|
|
|
}
|
|
|
|
|
2013-10-19 20:22:44 +02:00
|
|
|
|
2014-07-13 04:22:50 +02:00
|
|
|
|
2013-04-29 22:12:35 +02:00
|
|
|
create_dist_dir
|
|
|
|
|
2013-05-03 17:22:09 +02:00
|
|
|
if [ $1 ]; then
|
2015-11-09 03:24:41 +01:00
|
|
|
WANT_CORES="$1"
|
2013-05-03 17:22:09 +02:00
|
|
|
else
|
2015-11-09 03:24:41 +01:00
|
|
|
WANT_CORES=" \
|
|
|
|
2048 \
|
|
|
|
4do \
|
|
|
|
bluemsx \
|
|
|
|
fmsx \
|
|
|
|
mednafen_lynx \
|
|
|
|
mednafen_ngp \
|
|
|
|
mednafen_pce_fast \
|
|
|
|
mednafen_supergrafx \
|
|
|
|
mednafen_pcfx \
|
|
|
|
mednafen_vb \
|
|
|
|
mednafen_wswan \
|
|
|
|
mednafen_psx \
|
|
|
|
catsfc \
|
|
|
|
snes9x \
|
|
|
|
snes9x_next \
|
|
|
|
genesis_plus_gx \
|
|
|
|
virtualjaguar \
|
|
|
|
stella \
|
|
|
|
gpsp \
|
|
|
|
dosbox \
|
|
|
|
picodrive \
|
|
|
|
3dengine \
|
|
|
|
prosystem \
|
|
|
|
meteor \
|
|
|
|
nxengine \
|
|
|
|
o2em \
|
2015-11-09 03:28:21 +01:00
|
|
|
pcsx_rearmed \
|
2015-11-09 03:32:56 +01:00
|
|
|
mupen64plus \
|
2015-11-09 03:35:46 +01:00
|
|
|
vecx \
|
|
|
|
nestopia \
|
2015-11-09 03:38:20 +01:00
|
|
|
tgbdual \
|
2015-11-09 03:40:55 +01:00
|
|
|
quicknes \
|
2015-11-09 03:51:28 +01:00
|
|
|
handy \
|
2015-11-09 03:55:35 +01:00
|
|
|
gambatte \
|
|
|
|
prboom \
|
2015-11-09 04:10:18 +01:00
|
|
|
tyrquake \
|
|
|
|
vba_next \
|
2015-11-09 13:38:55 +01:00
|
|
|
vbam \
|
2015-11-09 13:44:16 +01:00
|
|
|
fceumm \
|
2015-11-09 14:42:28 +01:00
|
|
|
dinothawr \
|
2015-11-09 14:53:42 +01:00
|
|
|
desmume \
|
|
|
|
fb_alpha \
|
2015-11-09 14:42:28 +01:00
|
|
|
bsnes_mercury_performance \
|
2015-11-14 04:27:41 +01:00
|
|
|
bsnes_performance \
|
2016-02-23 21:17:03 +01:00
|
|
|
mame2000 \
|
2016-01-23 19:13:00 +01:00
|
|
|
mame2003 \
|
2015-11-14 04:27:41 +01:00
|
|
|
pocketsnes"
|
2013-05-03 17:22:09 +02:00
|
|
|
fi
|
2015-11-09 03:24:41 +01:00
|
|
|
|
|
|
|
for core in $WANT_CORES; do
|
|
|
|
path="jni"
|
2015-11-09 14:53:42 +01:00
|
|
|
append=""
|
2015-11-09 14:24:54 +01:00
|
|
|
if [ $core = "snes9x" ] || [ $core = "genesis_plus_gx" ] || [ $core = "meteor" ] || [ $core = "nestopia" ] || [ $core = "yabause" ] || [ $core = "vbam" ] || [ $core = "vba_next" ] || [ $core = "ppsspp" ]; then
|
2015-11-09 03:24:41 +01:00
|
|
|
path="libretro/jni"
|
|
|
|
fi
|
2015-11-09 03:51:28 +01:00
|
|
|
if [ $core = "gambatte" ]; then
|
|
|
|
path="libgambatte/libretro/jni"
|
|
|
|
fi
|
2015-11-09 14:53:42 +01:00
|
|
|
if [ $core = "desmume" ]; then
|
|
|
|
path="desmume/src/libretro/jni"
|
|
|
|
fi
|
|
|
|
if [ $core = "fb_alpha" ]; then
|
|
|
|
path="svn-current/trunk/projectfiles/libretro-android/jni"
|
|
|
|
fi
|
2015-11-09 14:42:28 +01:00
|
|
|
|
|
|
|
if [ $core = "bsnes_mercury_performance" ] || [ $core = "bsnes_performance" ]; then
|
|
|
|
path="target-libretro/jni"
|
2015-11-09 14:53:42 +01:00
|
|
|
append="_$core"
|
2015-11-09 14:42:28 +01:00
|
|
|
fi
|
2015-11-09 14:53:42 +01:00
|
|
|
build_libretro_generic_makefile $core $path $append
|
2015-11-09 03:24:41 +01:00
|
|
|
done
|
|
|
|
|