2013-12-09 01:10:42 +00:00
|
|
|
#!/bin/bash
|
2013-02-10 17:30:38 +00:00
|
|
|
|
2014-07-27 01:56:49 +00:00
|
|
|
. ./libretro-config.sh
|
|
|
|
|
2014-08-18 05:07:05 +00:00
|
|
|
#split TARGET_ABI string into an array we can iterate over
|
|
|
|
IFS=' ' read -ra ABIS <<< "$TARGET_ABIS"
|
|
|
|
|
2013-07-12 15:31:12 +00:00
|
|
|
# BSDs don't have readlink -f
|
|
|
|
read_link()
|
|
|
|
{
|
|
|
|
TARGET_FILE="$1"
|
|
|
|
cd $(dirname "$TARGET_FILE")
|
|
|
|
TARGET_FILE=$(basename "$TARGET_FILE")
|
|
|
|
|
|
|
|
while [ -L "$TARGET_FILE" ]
|
|
|
|
do
|
|
|
|
TARGET_FILE=$(readlink "$TARGET_FILE")
|
|
|
|
cd $(dirname "$TARGET_FILE")
|
|
|
|
TARGET_FILE=$(basename "$TARGET_FILE")
|
|
|
|
done
|
|
|
|
|
|
|
|
PHYS_DIR=$(pwd -P)
|
|
|
|
RESULT="$PHYS_DIR/$TARGET_FILE"
|
|
|
|
echo $RESULT
|
|
|
|
}
|
|
|
|
|
|
|
|
SCRIPT=$(read_link "$0")
|
|
|
|
echo "Script: $SCRIPT"
|
2013-04-29 20:12:35 +00:00
|
|
|
BASE_DIR=$(dirname $SCRIPT)
|
|
|
|
RARCH_DIR=$BASE_DIR/dist
|
2013-04-29 20:36:13 +00:00
|
|
|
RARCH_DIST_DIR=$RARCH_DIR/android
|
2013-10-30 01:11:09 +00:00
|
|
|
FORMAT=_android
|
2013-05-18 00:11:06 +00:00
|
|
|
FORMAT_EXT=so
|
2013-07-12 15:31:12 +00:00
|
|
|
|
2013-02-10 17:30:38 +00:00
|
|
|
die()
|
|
|
|
{
|
|
|
|
echo $1
|
|
|
|
#exit 1
|
|
|
|
}
|
|
|
|
|
2014-06-22 23:50:36 +00:00
|
|
|
|
2014-06-22 21:34:25 +00:00
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
# $1 is core name
|
2014-08-22 11:40:22 +00:00
|
|
|
# $2 is subdir (if there's no subdir, put "." here)
|
|
|
|
build_libretro_generic_makefile()
|
2014-06-21 16:34:11 +00:00
|
|
|
{
|
|
|
|
cd $BASE_DIR
|
2014-08-22 11:13:37 +00:00
|
|
|
if [ -d "libretro-${1}" ]; then
|
|
|
|
echo "=== Building ${1} ==="
|
|
|
|
cd libretro-${1}
|
2014-08-22 11:40:22 +00:00
|
|
|
cd ${2}
|
2014-08-18 05:07:05 +00:00
|
|
|
for a in "${ABIS[@]}"; do
|
2014-08-18 17:12:49 +00:00
|
|
|
if [ -z "${NOCLEAN}" ]; then
|
2014-08-22 11:13:37 +00:00
|
|
|
ndk-build clean APP_ABI=${a} || die "Failed to clean ${a} ${1}"
|
2014-08-18 17:12:49 +00:00
|
|
|
fi
|
2014-08-22 11:13:37 +00:00
|
|
|
ndk-build -j$JOBS APP_ABI=${a} || die "Failed to build ${a} ${1}"
|
|
|
|
cp ../libs/${a}/libretro.${FORMAT_EXT} $RARCH_DIST_DIR/${a}/${1}_libretro${FORMAT}.${FORMAT_EXT}
|
2014-08-18 05:07:05 +00:00
|
|
|
done
|
2014-06-21 16:34:11 +00:00
|
|
|
else
|
2014-08-22 11:13:37 +00:00
|
|
|
echo "${1} not fetched, skipping ..."
|
2014-06-21 16:34:11 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_2048() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "2048" "jni"
|
2014-06-22 00:12:59 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_stella() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "stella" "jni"
|
2014-06-18 18:30:58 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_genesis_plus_gx() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "genesis_plus_gx" "libretro/jni"
|
2014-06-22 01:14:12 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_vba_next() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "vba_next" "libretro/jni"
|
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_vbam() {
|
2014-09-18 21:56:51 +00:00
|
|
|
build_libretro_generic_makefile "vbam" "src/libretro/jni"
|
2014-06-21 16:22:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-01 07:29:23 +00:00
|
|
|
build_libretro_catsfc() {
|
|
|
|
build_libretro_generic_makefile "catsfc" "jni"
|
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_snes9x() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "snes9x" "libretro/jni"
|
2014-06-18 23:38:24 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_snes9x_next() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "snes9x_next" "libretro/jni"
|
2014-06-22 03:13:43 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_bsnes() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_snes" "jni"
|
2013-07-31 10:49:36 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_lynx() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_lynx" "jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_gba() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_gba" "jni"
|
2014-07-29 17:19:15 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_ngp() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_ngp" "jni"
|
2013-07-31 00:05:30 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_wswan() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_wswan" "jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_psx() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_psx" "jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_pcfx() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_pcfx" "jni"
|
2013-10-31 16:54:26 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_beetle_vb() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_vb" "jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_pce_fast() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_pce_fast" "jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_supergrafx() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_supergrafx" "jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_nx() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "nxengine" "jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_prboom()
|
|
|
|
{
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "prboom" "libretro/jni"
|
2013-09-23 02:21:31 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_nestopia() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "nestopia" "libretro/jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_tyrquake() {
|
|
|
|
build_libretro_generic_makefile "tyrquake" "libretro/jni"
|
2013-02-10 17:30:38 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_pcsx_rearmed() {
|
|
|
|
build_libretro_generic_makefile "pcsx_rearmed" "jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:40:22 +00:00
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_picodrive() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "picodrive" "jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_quicknes() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "quicknes" "libretro/jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_handy() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "handy" "libretro/jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_yabause() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "yabause" "libretro/jni"
|
2014-08-22 11:13:37 +00:00
|
|
|
}
|
|
|
|
|
2014-11-01 07:04:41 +00:00
|
|
|
build_libretro_vecx() {
|
|
|
|
build_libretro_generic_makefile "vecx" "libretro/jni"
|
|
|
|
}
|
|
|
|
|
2014-08-22 11:13:37 +00:00
|
|
|
build_libretro_mupen64()
|
2013-03-10 17:16:49 +00:00
|
|
|
{
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "mupen64plus" "libretro/jni"
|
2013-03-10 17:16:49 +00:00
|
|
|
}
|
|
|
|
|
2014-01-20 10:01:06 +00:00
|
|
|
build_libretro_3dengine() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "3dengine" "jni"
|
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_fceumm() {
|
|
|
|
build_libretro_generic_makefile "fceumm" "src/drivers/libretro/jni"
|
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_gambatte() {
|
|
|
|
build_libretro_generic_makefile "gambatte" "libgambatte/libretro/jni"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_libretro_dinothawr() {
|
|
|
|
build_libretro_generic_makefile "dinothawr" "android/eclipse/jni"
|
2014-01-20 10:01:06 +00:00
|
|
|
}
|
|
|
|
|
2014-11-01 08:27:34 +00:00
|
|
|
build_libretro_virtualjaguar() {
|
|
|
|
build_libretro_generic_makefile "virtualjaguar" "jni"
|
|
|
|
}
|
|
|
|
|
2014-08-22 13:39:20 +00:00
|
|
|
build_libretro_desmume() {
|
2014-08-22 11:40:22 +00:00
|
|
|
build_libretro_generic_makefile "desmume" "desmume/src/libretro/jni"
|
2013-07-31 13:47:58 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 13:39:20 +00:00
|
|
|
build_libretro_fb_alpha() {
|
|
|
|
build_libretro_generic_makefile "fb_alpha" "svn-current/trunk/projectfiles/libretro-android/jni"
|
|
|
|
}
|
2013-07-31 13:37:07 +00:00
|
|
|
|
2013-04-29 20:12:35 +00:00
|
|
|
create_dist_dir()
|
|
|
|
{
|
|
|
|
if [ -d $RARCH_DIR ]; then
|
|
|
|
echo "Directory $RARCH_DIR already exists, skipping creation..."
|
|
|
|
else
|
|
|
|
mkdir $RARCH_DIR
|
|
|
|
fi
|
|
|
|
|
2013-04-29 20:36:13 +00:00
|
|
|
if [ -d $RARCH_DIST_DIR ]; then
|
|
|
|
echo "Directory $RARCH_DIST_DIR already exists, skipping creation..."
|
2013-04-29 20:12:35 +00:00
|
|
|
else
|
2013-04-29 20:36:13 +00:00
|
|
|
mkdir $RARCH_DIST_DIR
|
2013-04-29 20:12:35 +00:00
|
|
|
fi
|
2014-08-20 17:46:07 +00:00
|
|
|
|
|
|
|
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 20:12:35 +00:00
|
|
|
}
|
|
|
|
|
2013-12-16 01:15:02 +00:00
|
|
|
build_libretro_bsnes()
|
2013-09-06 06:01:33 +00:00
|
|
|
{
|
2014-08-11 18:11:34 +00:00
|
|
|
CORENAME="bsnes"
|
2013-12-16 01:15:02 +00:00
|
|
|
#TODO - maybe accuracy/balanced cores as well
|
2013-09-06 06:01:33 +00:00
|
|
|
cd $BASE_DIR
|
2014-08-11 18:11:34 +00:00
|
|
|
if [ -d "libretro-${CORENAME}" ]; then
|
2014-08-11 18:25:14 +00:00
|
|
|
echo "=== Building ${CORENAME} ==="
|
2014-08-11 18:11:34 +00:00
|
|
|
cd libretro-${CORENAME}/
|
2014-11-01 07:04:41 +00:00
|
|
|
cd target-libretro/jni
|
2014-08-18 05:07:05 +00:00
|
|
|
for a in "${ABIS[@]}"; do
|
2014-08-20 17:46:07 +00:00
|
|
|
if [ -z "${NOCLEAN}" ]; then
|
|
|
|
ndk-build clean APP_ABI=${a} || die "Failed to clean ${a} ${CORENAME}"
|
|
|
|
fi
|
|
|
|
ndk-build -j$JOBS APP_ABI=${a} || die "Failed to build ${a} ${CORENAME}"
|
2014-08-21 03:27:02 +00:00
|
|
|
cp ../libs/${a}/libretro_bsnes_performance.${FORMAT_EXT} $RARCH_DIST_DIR/${a}/bsnes_performance_libretro${FORMAT}.${FORMAT_EXT}
|
2014-08-18 05:07:05 +00:00
|
|
|
done
|
2013-09-06 06:01:33 +00:00
|
|
|
else
|
2014-08-11 18:25:14 +00:00
|
|
|
echo "${CORENAME} not fetched, skipping ..."
|
2013-09-06 06:01:33 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-10-19 18:22:44 +00:00
|
|
|
|
2014-07-13 02:22:50 +00:00
|
|
|
|
2013-04-29 20:12:35 +00:00
|
|
|
create_dist_dir
|
|
|
|
|
2013-05-03 15:22:09 +00:00
|
|
|
if [ $1 ]; then
|
|
|
|
$1
|
|
|
|
else
|
2014-07-29 17:19:15 +00:00
|
|
|
build_libretro_2048
|
2014-11-01 08:27:34 +00:00
|
|
|
#build_libretro_4do
|
|
|
|
#build_libretro_bluemsx
|
|
|
|
#build_libretro_fmsx
|
2013-12-16 01:15:02 +00:00
|
|
|
#build_libretro_bsnes_cplusplus98
|
|
|
|
build_libretro_bsnes
|
2014-11-01 08:27:34 +00:00
|
|
|
#build_libretro_bsnes_mercury
|
2014-06-22 23:50:36 +00:00
|
|
|
build_libretro_beetle_lynx
|
2014-11-01 07:04:41 +00:00
|
|
|
#build_libretro_beetle_gba
|
2014-06-22 21:34:25 +00:00
|
|
|
build_libretro_beetle_ngp
|
|
|
|
build_libretro_beetle_pce_fast
|
|
|
|
build_libretro_beetle_supergrafx
|
|
|
|
build_libretro_beetle_pcfx
|
|
|
|
build_libretro_beetle_vb
|
|
|
|
build_libretro_beetle_wswan
|
|
|
|
build_libretro_beetle_psx
|
2014-11-01 07:04:41 +00:00
|
|
|
#build_libretro_beetle_bsnes
|
2014-11-01 07:29:23 +00:00
|
|
|
build_libretro_catsfc
|
2014-08-22 10:17:52 +00:00
|
|
|
build_libretro_snes9x
|
|
|
|
build_libretro_snes9x_next
|
2014-08-22 10:28:27 +00:00
|
|
|
build_libretro_genesis_plus_gx
|
2014-08-22 13:39:20 +00:00
|
|
|
build_libretro_fb_alpha
|
2013-10-31 16:54:26 +00:00
|
|
|
build_libretro_vbam
|
2013-08-15 12:50:25 +00:00
|
|
|
build_libretro_vba_next
|
2013-12-16 01:15:02 +00:00
|
|
|
#build_libretro_bnes
|
2014-04-14 03:53:23 +00:00
|
|
|
build_libretro_fceumm
|
2013-05-03 15:22:09 +00:00
|
|
|
build_libretro_gambatte
|
2014-08-21 03:27:02 +00:00
|
|
|
#build_libretro_meteor
|
2013-05-03 15:22:09 +00:00
|
|
|
build_libretro_nx
|
|
|
|
build_libretro_prboom
|
2013-07-31 13:47:58 +00:00
|
|
|
build_libretro_stella
|
|
|
|
build_libretro_quicknes
|
2013-05-03 15:22:09 +00:00
|
|
|
build_libretro_nestopia
|
|
|
|
build_libretro_tyrquake
|
2013-12-16 01:15:02 +00:00
|
|
|
#build_libretro_mame078
|
|
|
|
#build_libretro_mame
|
|
|
|
#build_libretro_dosbox
|
|
|
|
#build_libretro_scummvm
|
|
|
|
build_libretro_picodrive
|
|
|
|
build_libretro_handy
|
|
|
|
build_libretro_desmume
|
|
|
|
build_libretro_pcsx_rearmed
|
2014-07-13 02:22:50 +00:00
|
|
|
build_libretro_yabause
|
2014-11-01 07:04:41 +00:00
|
|
|
build_libretro_vecx
|
2014-11-01 08:27:34 +00:00
|
|
|
#build_libretro_tgbdual
|
|
|
|
#build_libretro_prosystem
|
2013-09-23 02:21:31 +00:00
|
|
|
build_libretro_dinothawr
|
2014-11-01 08:27:34 +00:00
|
|
|
build_libretro_virtualjaguar
|
|
|
|
build_libretro_mupen64
|
|
|
|
#build_libretro_ffmpeg
|
2014-03-09 20:11:12 +00:00
|
|
|
build_libretro_3dengine
|
2014-11-01 08:27:34 +00:00
|
|
|
#build_libretro_ppsspp
|
|
|
|
#build_libretro_o2em
|
2013-05-03 15:22:09 +00:00
|
|
|
fi
|