libretro-super/libretro-build.sh

372 lines
11 KiB
Bash
Raw Normal View History

2011-11-02 15:27:23 +00:00
#!/bin/sh
SCRIPT=$(readlink -f $0)
BASE_DIR=$(dirname $SCRIPT)
2013-05-03 09:32:01 +00:00
RARCH_DIR=$BASE_DIR/dist
RARCH_DIST_DIR=$RARCH_DIR/pc
2013-04-30 01:26:46 +00:00
JOBS=4
2011-11-02 15:27:23 +00:00
die()
{
echo $1
2012-04-16 17:33:18 +00:00
#exit 1
2011-11-02 15:27:23 +00:00
}
ARCH=`uname -m`
X86=false
X86_64=false
ARM=false
ARMV5=false
ARMV6=false
ARMV7=false
if [ $ARCH = x86_64 ]; then
echo "x86_64 CPU detected"
X86=true
X86_64=true
elif [ $ARCH = i686 ]; then
echo "x86_32 CPU detected"
X86=true
elif [ $ARCH = armv5tel ]; then
echo "ARMv5 CPU detected"
ARM=true
ARMV5=true
elif [ $ARCH = armv6l ]; then
echo "ARMv6 CPU detected"
ARM=true
ARMV6=true
elif [ $ARCH = armv7l ]; then
echo "ARMv7 CPU detected"
ARM=true
ARMV7=true
fi
2012-04-16 17:33:18 +00:00
build_libretro_bsnes()
2011-11-02 15:27:23 +00:00
{
if [ -z "$CC" ]; then
CC=gcc
fi
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-bsnes/perf" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building bSNES performance ==="
2013-01-15 11:24:05 +00:00
cd libretro-bsnes/perf/higan
2013-04-30 01:26:46 +00:00
make compiler="$CC" ui=target-libretro profile=performance -j$JOBS clean || die "Failed to clean bSNES performance core"
make compiler="$CC" ui=target-libretro profile=performance -j$JOBS || die "Failed to build bSNES performance core"
2013-05-03 09:32:01 +00:00
cp -f out/libretro.so "$RARCH_DIST_DIR"/libretro-bsnes-performance.so
2011-11-02 15:27:23 +00:00
else
echo "bSNES performance not fetched, skipping ..."
fi
cd $BASE_DIR
2013-01-15 11:24:05 +00:00
if [ -d "libretro-bsnes/balanced" ]; then
echo "=== Building bSNES balanced ==="
cd libretro-bsnes/balanced/higan
2013-04-30 01:26:46 +00:00
make compiler="$CC" ui=target-libretro profile=balanced -j$JOBS clean || die "Failed to clean bSNES balanced core"
make compiler="$CC" ui=target-libretro profile=balanced -j$JOBS || die "Failed to build bSNES balanced core"
2013-05-03 09:32:01 +00:00
cp -f out/libretro.so "$RARCH_DIST_DIR"/libretro-bsnes-balanced.so
2011-11-02 15:27:23 +00:00
else
echo "bSNES compat not fetched, skipping ..."
fi
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-bsnes" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building bSNES accuracy ==="
2013-01-15 11:24:05 +00:00
cd libretro-bsnes/higan
2013-04-30 01:26:46 +00:00
make compiler="$CC" ui=target-libretro profile=accuracy -j$JOBS clean || die "Failed to clean bSNES accuracy core"
make compiler="$CC" ui=target-libretro profile=accuracy -j$JOBS || die "Failed to build bSNES accuracy core"
2013-05-03 09:32:01 +00:00
cp -f out/libretro.so "$RARCH_DIST_DIR"/libretro-bsnes-accuracy.so
2011-11-02 15:27:23 +00:00
fi
}
2012-11-08 21:55:59 +00:00
build_libretro_mednafen()
{
cd $BASE_DIR
2012-11-08 21:55:59 +00:00
if [ -d "libretro-mednafen" ]; then
echo "=== Building Mednafen ==="
cd libretro-mednafen
2012-11-25 02:47:40 +00:00
for core in psx pce-fast wswan ngp gba snes vb
2012-11-08 21:55:59 +00:00
do
2013-04-30 01:26:46 +00:00
make core=${core} -j$JOBS clean || die "Failed to clean mednafen/${core}"
make core=${core} -j$JOBS || die "Failed to build mednafen/${core}"
2013-05-03 09:32:01 +00:00
cp mednafen_$(echo ${core} | tr '[\-]' '[_]')_libretro.so "$RARCH_DIST_DIR"/libretro-mednafen-${core}.so
2012-11-08 21:55:59 +00:00
done
else
echo "Mednafen not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_s9x()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-s9x" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building SNES9x ==="
2012-04-16 17:33:18 +00:00
cd libretro-s9x/libretro
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean SNES9x"
make -j$JOBS || die "Failed to build SNES9x"
2013-05-03 09:32:01 +00:00
cp libretro.so "$RARCH_DIST_DIR"/libretro-snes9x.so
2011-11-02 15:27:23 +00:00
else
echo "SNES9x not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_s9x_next()
2011-11-08 20:20:44 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-s9x-next" ]; then
2011-11-08 20:20:44 +00:00
echo "=== Building SNES9x-Next ==="
2012-04-16 17:33:18 +00:00
cd libretro-s9x-next/
2013-04-30 01:26:46 +00:00
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean SNES9x-Next"
make -f Makefile.libretro -j$JOBS || die "Failed to build SNES9x-Next"
2013-05-03 09:32:01 +00:00
cp snes9x_next_libretro.so "$RARCH_DIST_DIR"/libretro-snes9x-next.so
2011-11-08 20:20:44 +00:00
else
echo "SNES9x-Next not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_genplus()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-genplus" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building Genplus GX ==="
2012-04-16 17:33:18 +00:00
cd libretro-genplus/
2013-04-30 01:26:46 +00:00
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean Genplus GX"
make -f Makefile.libretro -j$JOBS || die "Failed to build Genplus GX"
2013-05-03 09:32:01 +00:00
cp genesis_plus_gx_libretro.so "$RARCH_DIST_DIR"/libretro-genplus.so
2011-11-02 15:27:23 +00:00
else
echo "Genplus GX not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_fba()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-fba" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building Final Burn Alpha ==="
2012-04-16 17:33:18 +00:00
cd libretro-fba/
2013-04-30 01:26:46 +00:00
cd svn-current/trunk
make -f makefile.libretro clean || die "Failed to clean Final Burn Alpha"
make -f makefile.libretro -j$JOBS || die "Failed to build Final Burn Alpha"
2013-05-03 09:32:01 +00:00
cp fb_alpha_libretro.so "$RARCH_DIST_DIR"/libretro-fba.so
2011-11-02 15:27:23 +00:00
else
echo "Final Burn Alpha not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_vba()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-vba" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building VBA-Next ==="
2012-04-16 17:33:18 +00:00
cd libretro-vba/
2013-04-30 01:26:46 +00:00
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean VBA-Next"
make -f Makefile.libretro -j$JOBS || die "Failed to build VBA-Next"
2013-05-03 09:32:01 +00:00
cp vba_next_libretro.so "$RARCH_DIST_DIR"/libretro-vba.so
2011-11-02 15:27:23 +00:00
else
echo "VBA-Next not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_bnes()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-bnes" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building bNES ==="
2012-04-16 17:33:18 +00:00
cd libretro-bnes
2011-11-02 15:27:23 +00:00
mkdir -p obj
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean bNES"
make -j$JOBS || die "Failed to build bNES"
2013-05-03 09:32:01 +00:00
cp libretro.so "$RARCH_DIST_DIR"/libretro-bnes.so
2011-11-02 15:27:23 +00:00
else
echo "bNES not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_fceu()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-fceu" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building FCEU ==="
2012-04-16 17:33:18 +00:00
cd libretro-fceu
2013-04-30 01:26:46 +00:00
make -C fceumm-code -f Makefile.libretro -j$JOBS clean || die "Failed to clean FCEU"
make -C fceumm-code -f Makefile.libretro -j$JOBS || die "Failed to build FCEU"
2013-05-03 09:32:01 +00:00
cp fceumm-code/fceumm_libretro.so "$RARCH_DIST_DIR"/libretro-fceu.so
2011-11-02 15:27:23 +00:00
else
2011-11-19 19:53:53 +00:00
echo "FCEU not fetched, skipping ..."
2011-11-02 15:27:23 +00:00
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_gambatte()
2011-11-02 15:27:23 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-gambatte" ]; then
2011-11-02 15:27:23 +00:00
echo "=== Building Gambatte ==="
2012-04-16 17:33:18 +00:00
cd libretro-gambatte/libgambatte
2013-04-30 01:26:46 +00:00
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean Gambatte"
make -f Makefile.libretro -j$JOBS || die "Failed to build Gambatte"
2013-05-03 09:32:01 +00:00
cp gambatte_libretro.so "$RARCH_DIST_DIR"/libretro-gambatte.so
2011-11-02 15:27:23 +00:00
else
echo "Gambatte not fetched, skipping ..."
fi
}
2012-04-16 17:33:18 +00:00
build_libretro_meteor()
2012-01-03 14:15:33 +00:00
{
cd $BASE_DIR
2012-04-16 17:33:18 +00:00
if [ -d "libretro-meteor" ]; then
2012-01-03 14:15:33 +00:00
echo "=== Building Meteor ==="
2012-04-16 17:33:18 +00:00
cd libretro-meteor/libretro
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean Meteor"
make -j$JOBS || die "Failed to build Meteor"
2013-05-03 09:32:01 +00:00
cp libretro.so "$RARCH_DIST_DIR"/libretro-meteor.so
2012-01-03 14:15:33 +00:00
else
echo "Meteor not fetched, skipping ..."
fi
}
2012-04-22 18:45:51 +00:00
build_libretro_nx()
{
cd $BASE_DIR
2012-04-22 18:45:51 +00:00
if [ -d "libretro-nx" ]; then
echo "=== Building NXEngine ==="
2013-01-16 18:29:34 +00:00
cd libretro-nx
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean NXEngine"
make -j$JOBS || die "Failed to build NXEngine"
2013-05-03 09:32:01 +00:00
cp nxengine_libretro.so "$RARCH_DIST_DIR"/libretro-nx.so
2012-04-22 18:45:51 +00:00
else
echo "NXEngine not fetched, skipping ..."
fi
}
2011-11-02 15:27:23 +00:00
2012-05-16 21:22:42 +00:00
build_libretro_prboom()
{
cd $BASE_DIR
2012-05-16 21:22:42 +00:00
if [ -d "libretro-prboom" ]; then
echo "=== Building PRBoom ==="
cd libretro-prboom
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean PRBoom"
make -j$JOBS || die "Failed to build PRBoom"
2013-05-03 09:32:01 +00:00
cp prboom_libretro.so "$RARCH_DIST_DIR"/libretro-prboom.so
2012-05-16 21:22:42 +00:00
else
echo "PRBoom not fetched, skipping ..."
fi
}
2012-08-28 08:07:58 +00:00
build_libretro_stella()
2012-08-28 07:49:17 +00:00
{
cd $BASE_DIR
2012-08-28 08:07:58 +00:00
if [ -d "libretro-stella" ]; then
echo "=== Building Stella ==="
cd libretro-stella
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean Stella"
make -j$JOBS || die "Failed to build Stella"
2013-05-03 09:32:01 +00:00
cp libretro.so "$RARCH_DIST_DIR"/libretro-stella.so
2012-08-28 07:49:17 +00:00
else
2012-08-28 08:07:58 +00:00
echo "Stella not fetched, skipping ..."
fi
}
2012-10-31 20:05:58 +00:00
build_libretro_desmume()
{
cd $BASE_DIR
2012-10-31 20:05:58 +00:00
if [ -d "libretro-desmume" ]; then
echo "=== Building Desmume ==="
cd libretro-desmume
if [ $X86 = true ]; then
echo "=== Building Desmume with x86 JIT recompiler ==="
make -f Makefile.libretro DESMUME_JIT=1 -j$JOBS clean || die "Failed to clean Desmume"
make -f Makefile.libretro DESMUME_JIT=1 -j$JOBS || die "Failed to build Desmume"
else
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean Desmume"
make -f Makefile.libretro -j$JOBS || die "Failed to build Desmume"
fi
cp desmume_libretro.so "$RARCH_DIST_DIR"/libretro-desmume.so
2012-10-31 20:05:58 +00:00
else
echo "Desmume not fetched, skipping ..."
fi
}
2012-08-28 08:07:58 +00:00
build_libretro_pcsx_rearmed()
{
cd $BASE_DIR
pwd
if [ -d "libretro-pcsx-rearmed" ]; then
echo "=== Building PCSX ReARMed ==="
cd libretro-pcsx-rearmed
if [ $ARMV7 = true ]; then
echo "=== Building PCSX ReARMed (ARMV7 NEON) ==="
make -f Makefile.libretro platform=arm -j$JOBS clean || die "Failed to clean PCSX ReARMed"
make -f Makefile.libretro platform=arm -j$JOBS || die "Failed to build PCSX ReARMed"
else
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean PCSX ReARMed"
make -f Makefile.libretro -j$JOBS || die "Failed to build PCSX ReARMed"
fi
cp pcsx_rearmed_libretro.so "$RARCH_DIST_DIR"/libretro-pcsx-rearmed.so
else
echo "PCSX ReARMed not fetched, skipping ..."
fi
}
2013-01-10 13:33:48 +00:00
build_libretro_quicknes()
{
cd $BASE_DIR
2013-01-10 13:33:48 +00:00
if [ -d "libretro-quicknes" ]; then
echo "=== Building QuickNES ==="
cd libretro-quicknes/libretro
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean QuickNES"
make -j$JOBS || die "Failed to build QuickNES"
2013-05-03 09:32:01 +00:00
cp libretro.so "$RARCH_DIST_DIR"/libretro-quicknes.so
2013-01-10 13:33:48 +00:00
else
echo "QuickNES not fetched, skipping ..."
fi
}
2013-01-16 08:08:42 +00:00
build_libretro_nestopia()
{
cd $BASE_DIR
2013-01-16 08:08:42 +00:00
if [ -d "libretro-nestopia" ]; then
echo "=== Building Nestopia ==="
cd libretro-nestopia/libretro
2013-04-30 01:26:46 +00:00
make -j$JOBS clean || die "Failed to clean Nestopia"
make -j$JOBS || die "Failed to build Nestopia"
2013-05-03 09:32:01 +00:00
cp nestopia_libretro.so "$RARCH_DIST_DIR"/libretro-nestopia.so
2013-01-16 08:08:42 +00:00
else
echo "Nestopia not fetched, skipping ..."
fi
}
2013-01-10 13:33:48 +00:00
build_libretro_tyrquake()
{
cd $BASE_DIR
if [ -d "libretro-tyrquake" ]; then
echo "=== Building Tyr Quake ==="
cd libretro-tyrquake
2013-04-30 01:26:46 +00:00
make -f Makefile.libretro -j$JOBS clean || die "Failed to clean Tyr Quake"
make -f Makefile.libretro -j$JOBS || die "Failed to build Tyr Quake"
2013-05-03 09:32:01 +00:00
cp tyrquake_libretro.so "$RARCH_DIST_DIR"/libretro-tyrquake.so
else
echo "Tyr Quake not fetched, skipping ..."
fi
}
2013-05-03 09:32:01 +00:00
mkdir -p "$RARCH_DIST_DIR"
build_libretro_desmume
2012-04-16 17:33:18 +00:00
build_libretro_bsnes
2012-11-08 21:55:59 +00:00
build_libretro_mednafen
2012-04-16 17:33:18 +00:00
build_libretro_s9x
build_libretro_s9x_next
build_libretro_genplus
build_libretro_fba
build_libretro_vba
build_libretro_bnes
build_libretro_fceu
build_libretro_gambatte
build_libretro_meteor
2012-04-22 18:45:51 +00:00
build_libretro_nx
2012-05-16 21:22:42 +00:00
build_libretro_prboom
2012-08-28 08:07:58 +00:00
build_libretro_stella
2013-01-10 13:33:48 +00:00
build_libretro_quicknes
2013-01-16 08:08:42 +00:00
build_libretro_nestopia
build_libretro_tyrquake
build_libretro_pcsx_rearmed