libretro-build.sh now runs anywhere

This commit is contained in:
T. Joseph Carter 2015-02-02 09:57:07 -08:00
parent 0ada2ddbd1
commit 189fed77e2
2 changed files with 32 additions and 32 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash # vi: ts=3 sw=3 et ft=bash
die() { die() {
echo $1 echo $1
@ -59,7 +59,7 @@ reset_compiler_targets() {
} }
build_libretro_pcsx_rearmed_interpreter() { build_libretro_pcsx_rearmed_interpreter() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-pcsx_rearmed' ]; then if [ -d 'libretro-pcsx_rearmed' ]; then
echo '=== Building PCSX ReARMed Interpreter ===' echo '=== Building PCSX ReARMed Interpreter ==='
cd libretro-pcsx_rearmed cd libretro-pcsx_rearmed
@ -81,7 +81,7 @@ build_libretro_pcsx_rearmed_interpreter() {
# $4 is Makefile name # $4 is Makefile name
# $5 is preferred platform # $5 is preferred platform
build_libretro_generic_makefile_subcore() { build_libretro_generic_makefile_subcore() {
cd $BASE_DIR cd ${WORKDIR}
if [ -d "libretro-${1}" ]; then if [ -d "libretro-${1}" ]; then
echo "=== Building ${2} ===" echo "=== Building ${2} ==="
cd libretro-${1}/ cd libretro-${1}/
@ -124,7 +124,7 @@ copy_core_to_dist() {
# $3 is Makefile name # $3 is Makefile name
# $4 is preferred platform # $4 is preferred platform
build_libretro_generic_makefile() { build_libretro_generic_makefile() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d "libretro-${1}" ]; then if [ -d "libretro-${1}" ]; then
echo "=== Building ${1} ===" echo "=== Building ${1} ==="
cd libretro-${1} cd libretro-${1}
@ -364,7 +364,7 @@ build_libretro_ppsspp() {
build_libretro_mame() { build_libretro_mame() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-mame' ]; then if [ -d 'libretro-mame' ]; then
echo '' echo ''
echo '=== Building MAME ===' echo '=== Building MAME ==='
@ -397,7 +397,7 @@ build_libretro_mame() {
} }
build_libretro_mess() { build_libretro_mess() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-mame' ]; then if [ -d 'libretro-mame' ]; then
echo '' echo ''
echo '=== Building MESS ===' echo '=== Building MESS ==='
@ -424,7 +424,7 @@ build_libretro_mess() {
} }
rebuild_libretro_mess() { rebuild_libretro_mess() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-mame' ]; then if [ -d 'libretro-mame' ]; then
echo '' echo ''
echo '=== Building MESS ===' echo '=== Building MESS ==='
@ -451,7 +451,7 @@ rebuild_libretro_mess() {
} }
build_libretro_ume() { build_libretro_ume() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-mame' ]; then if [ -d 'libretro-mame' ]; then
echo '' echo ''
echo '=== Building UME ===' echo '=== Building UME ==='
@ -478,7 +478,7 @@ build_libretro_ume() {
} }
rebuild_libretro_ume() { rebuild_libretro_ume() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-mame' ]; then if [ -d 'libretro-mame' ]; then
echo '' echo ''
echo '=== Building MESS ===' echo '=== Building MESS ==='
@ -509,7 +509,7 @@ rebuild_libretro_ume() {
# $3 is profile name # $3 is profile name
# $4 is compiler # $4 is compiler
build_libretro_bsnes_modern() { build_libretro_bsnes_modern() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d "libretro-${1}" ]; then if [ -d "libretro-${1}" ]; then
echo "=== Building ${1} ${3} ===" echo "=== Building ${1} ${3} ==="
cd libretro-${1} cd libretro-${1}
@ -540,7 +540,7 @@ build_libretro_bsnes_mercury() {
build_libretro_bsnes_cplusplus98() { build_libretro_bsnes_cplusplus98() {
CORENAME="bsnes_cplusplus98" CORENAME="bsnes_cplusplus98"
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d "libretro-${CORENAME}" ]; then if [ -d "libretro-${CORENAME}" ]; then
echo "=== Building ${CORENAME} ===" echo "=== Building ${CORENAME} ==="
cd libretro-${CORENAME} cd libretro-${CORENAME}
@ -557,7 +557,7 @@ build_libretro_bsnes_cplusplus98() {
} }
build_libretro_bnes() { build_libretro_bnes() {
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-bnes' ]; then if [ -d 'libretro-bnes' ]; then
echo '=== Building bNES ===' echo '=== Building bNES ==='
cd libretro-bnes cd libretro-bnes
@ -576,7 +576,7 @@ build_libretro_bnes() {
build_libretro_mupen64() { build_libretro_mupen64() {
check_opengl check_opengl
cd "${BASE_DIR}" cd "${WORKDIR}"
if [ -d 'libretro-mupen64plus' ]; then if [ -d 'libretro-mupen64plus' ]; then
cd libretro-mupen64plus cd libretro-mupen64plus

View File

@ -1,31 +1,31 @@
#!/bin/bash #! /bin/bash
# vi: sw=3 ts=3 et
. ./libretro-config.sh
# BSDs don't have readlink -f # BSDs don't have readlink -f
read_link() read_link()
{ {
TARGET_FILE="$1" TARGET_FILE="${1}"
cd $(dirname "$TARGET_FILE") cd "`dirname "${TARGET_FILE}"`"
TARGET_FILE=$(basename "$TARGET_FILE") TARGET_FILE="`basename "${TARGET_FILE}"`"
while [ -L "$TARGET_FILE" ] while [ -L "${TARGET_FILE}" ]; do
do TARGET_FILE="`readlink "${TARGET_FILE}"`"
TARGET_FILE=$(readlink "$TARGET_FILE") cd "`dirname "${TARGET_FILE}"`"
cd $(dirname "$TARGET_FILE") TARGET_FILE="`basename "${TARGET_FILE}"`"
TARGET_FILE=$(basename "$TARGET_FILE")
done done
PHYS_DIR=$(pwd -P) PHYS_DIR="`pwd -P`"
RESULT="$PHYS_DIR/$TARGET_FILE" RESULT="${PHYS_DIR}/${TARGET_FILE}"
echo $RESULT echo ${RESULT}
} }
SCRIPT="`read_link "$0"`"
BASE_DIR="`dirname "${SCRIPT}"`"
WORKDIR="`pwd`"
. ${BASE_DIR}/libretro-config.sh
SCRIPT=$(read_link "$0")
echo "Script: $SCRIPT"
BASE_DIR=$(dirname "$SCRIPT")
if [ -z "$RARCH_DIST_DIR" ]; then if [ -z "$RARCH_DIST_DIR" ]; then
RARCH_DIR="$BASE_DIR/dist" RARCH_DIR="${WORKDIR}/dist"
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR" RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
fi fi
@ -87,7 +87,7 @@ echo "CC = $CC"
echo "CXX = $CXX" echo "CXX = $CXX"
echo "STRIP = $STRIP" echo "STRIP = $STRIP"
. ./libretro-build-common.sh . ${BASE_DIR}/libretro-build-common.sh
mkdir -p "$RARCH_DIST_DIR" mkdir -p "$RARCH_DIST_DIR"