2011-11-02 15:27:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-05-18 00:53:55 +00:00
|
|
|
. ./libretro-config.sh
|
|
|
|
|
2013-05-19 09:20:33 +00:00
|
|
|
if [ "$platform" ]; then
|
|
|
|
if [ "$platform" = "win" ]; then
|
|
|
|
FORMAT_EXT="dll"
|
|
|
|
FORMAT_COMPILER_TARGET=win
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=win
|
|
|
|
DIST_DIR=win
|
|
|
|
elif [ "$platform" = "osx" ]; then
|
|
|
|
FORMAT_EXT="dylib"
|
|
|
|
FORMAT_COMPILER_TARGET=osx
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=osx
|
|
|
|
DIST_DIR=osx
|
|
|
|
else
|
|
|
|
FORMAT_EXT="so"
|
|
|
|
FORMAT_COMPILER_TARGET=unix
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=unix
|
|
|
|
DIST_DIR=unix
|
|
|
|
fi
|
2013-05-08 10:39:37 +00:00
|
|
|
else
|
2013-05-19 09:20:33 +00:00
|
|
|
UNAME=$(uname)
|
|
|
|
|
|
|
|
if [ $(echo $UNAME | grep Linux) ]; then
|
|
|
|
FORMAT_EXT="so"
|
|
|
|
FORMAT_COMPILER_TARGET=unix
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=unix
|
|
|
|
DIST_DIR=unix
|
|
|
|
elif [ $(echo $UNAME | grep BSD) ]; then
|
|
|
|
FORMAT_EXT="so"
|
|
|
|
FORMAT_COMPILER_TARGET=unix
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=unix
|
|
|
|
DIST_DIR=bsd
|
|
|
|
elif [ $(echo $UNAME | grep Darwin) ]; then
|
|
|
|
FORMAT_EXT="dylib"
|
|
|
|
FORMAT_COMPILER_TARGET=osx
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=osx
|
|
|
|
DIST_DIR=osx
|
|
|
|
elif [ $(echo $UNAME | grep -i MINGW) ]; then
|
|
|
|
FORMAT_EXT="dll"
|
|
|
|
FORMAT_COMPILER_TARGET=win
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=win
|
|
|
|
DIST_DIR=win
|
|
|
|
else
|
|
|
|
# assume this is UNIX-based at least
|
|
|
|
FORMAT_EXT="so"
|
|
|
|
FORMAT_COMPILER_TARGET=unix
|
|
|
|
FORMAT_COMPILER_TARGET_ALT=unix
|
|
|
|
DIST_DIR=unix
|
|
|
|
fi
|
2013-05-08 10:39:37 +00:00
|
|
|
fi
|
|
|
|
|
2013-05-08 11:00:38 +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-05-08 10:39:37 +00:00
|
|
|
BASE_DIR=$(dirname "$SCRIPT")
|
2013-05-20 07:18:17 +00:00
|
|
|
if [ -z "$RARCH_DIST_DIR" ]; then
|
|
|
|
RARCH_DIR="$BASE_DIR/dist"
|
|
|
|
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
|
|
|
fi
|
2013-05-08 10:39:37 +00:00
|
|
|
|
|
|
|
if [ -z "$JOBS" ]; then
|
|
|
|
JOBS=4
|
|
|
|
fi
|
2013-04-29 20:12:35 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-05-08 10:39:37 +00:00
|
|
|
ARCH=$(uname -m)
|
2013-05-03 14:18:57 +00:00
|
|
|
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
|
|
|
|
|
2013-05-18 22:12:36 +00:00
|
|
|
if [ "$HOST_CC" ]; then
|
|
|
|
CC="${HOST_CC}-gcc"
|
|
|
|
CXX="${HOST_CC}-g++"
|
|
|
|
STRIP="${HOST_CC}-strip"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$MAKE" ]; then
|
2013-07-13 16:05:04 +00:00
|
|
|
if [ "$(expr substr $(uname -s) 1 7)" = "MINGW32" ]; then
|
2013-05-18 22:12:36 +00:00
|
|
|
MAKE=mingw32-make
|
|
|
|
else
|
|
|
|
MAKE=make
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-05-08 11:00:38 +00:00
|
|
|
if [ -z "$CC" ]; then
|
2013-07-13 15:59:37 +00:00
|
|
|
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
|
2013-05-19 18:05:35 +00:00
|
|
|
CC=clang
|
2013-07-13 15:59:37 +00:00
|
|
|
elif [ "$(expr substr $(uname -s) 1 7)" = "MINGW32" ]; then
|
2013-05-18 22:12:36 +00:00
|
|
|
CC=mingw32-gcc
|
|
|
|
else
|
|
|
|
CC=gcc
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CXX" ]; then
|
2013-07-13 15:59:37 +00:00
|
|
|
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
|
2013-05-18 22:28:45 +00:00
|
|
|
CXX=clang++
|
2013-07-13 15:59:37 +00:00
|
|
|
elif [ "$(expr substr $(uname -s) 1 7)" = "MINGW32" ]; then
|
2013-05-18 22:12:36 +00:00
|
|
|
CXX=mingw32-g++
|
|
|
|
else
|
|
|
|
CXX=g++
|
|
|
|
fi
|
2013-05-08 11:00:38 +00:00
|
|
|
fi
|
|
|
|
|
2013-05-19 10:03:25 +00:00
|
|
|
echo "CC = $CC"
|
|
|
|
echo "CXX = $CXX"
|
|
|
|
echo "STRIP = $STRIP"
|
|
|
|
|
|
|
|
. ./libretro-build-common.sh
|
|
|
|
|
2013-05-03 09:32:01 +00:00
|
|
|
mkdir -p "$RARCH_DIST_DIR"
|
|
|
|
|
2013-05-03 15:17:38 +00:00
|
|
|
if [ $1 ]; then
|
|
|
|
$1
|
|
|
|
else
|
2013-06-30 16:23:26 +00:00
|
|
|
if [ -z $BUILD_LIBRETRO_GL ]; then
|
|
|
|
build_libretro_modelviewer
|
|
|
|
build_libretro_scenewalker
|
|
|
|
if [ -z $BUILD_EXPERIMENTAL ]; then
|
|
|
|
build_libretro_mupen64
|
|
|
|
fi
|
|
|
|
fi
|
2013-05-19 08:55:09 +00:00
|
|
|
build_libretro_bsnes
|
2013-05-03 15:17:38 +00:00
|
|
|
build_libretro_mednafen
|
2013-05-18 17:04:19 +00:00
|
|
|
build_libretro_mednafen_gba
|
|
|
|
build_libretro_mednafen_snes
|
|
|
|
build_libretro_mednafen_psx
|
2013-05-03 15:17:38 +00:00
|
|
|
build_libretro_s9x
|
|
|
|
build_libretro_s9x_next
|
|
|
|
build_libretro_genplus
|
2013-05-18 17:04:19 +00:00
|
|
|
build_libretro_fba_full
|
2013-05-03 15:17:38 +00:00
|
|
|
build_libretro_vba
|
|
|
|
build_libretro_bnes
|
|
|
|
build_libretro_fceu
|
|
|
|
build_libretro_gambatte
|
|
|
|
build_libretro_meteor
|
|
|
|
build_libretro_nx
|
|
|
|
build_libretro_prboom
|
|
|
|
build_libretro_stella
|
|
|
|
build_libretro_quicknes
|
|
|
|
build_libretro_nestopia
|
|
|
|
build_libretro_tyrquake
|
2013-05-05 15:54:04 +00:00
|
|
|
build_libretro_mame078
|
2013-05-05 16:09:42 +00:00
|
|
|
build_libretro_dosbox
|
2013-05-06 09:11:17 +00:00
|
|
|
build_libretro_scummvm
|
2013-05-18 00:53:55 +00:00
|
|
|
build_libretro_modelviewer
|
|
|
|
build_libretro_scenewalker
|
2013-06-30 15:33:15 +00:00
|
|
|
build_libretro_picodrive
|
2013-05-18 22:12:36 +00:00
|
|
|
if [ $FORMAT_COMPILER_TARGET != "win" ]; then
|
|
|
|
build_libretro_desmume
|
2013-05-20 01:30:29 +00:00
|
|
|
build_libretro_pcsx_rearmed
|
2013-05-18 22:12:36 +00:00
|
|
|
fi
|
2013-05-03 15:17:38 +00:00
|
|
|
fi
|