2014-11-06 00:25:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
####usage:
|
2014-11-06 00:25:06 +00:00
|
|
|
# ./libretro-fetch-and-build.sh configfile
|
|
|
|
# if you want to force all enabled cores to rebuild prepend FORCE=YES
|
|
|
|
# you may need to specify your make command by prepending it to the commandline, for instance MAKE=mingw32-make
|
|
|
|
#
|
2014-12-06 18:46:21 +00:00
|
|
|
# eg: FORCE=YES MAKE=mingw32-make ./libretro-fetch-and-build.sh buildbot
|
2014-11-06 00:25:06 +00:00
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
####environment configuration:
|
2014-11-08 20:28:26 +00:00
|
|
|
echo "Setting up Environment for $1"
|
|
|
|
echo ============================================
|
|
|
|
|
|
|
|
ORIGPATH=$PATH
|
2014-12-17 23:59:08 +00:00
|
|
|
WORK=$PWD
|
2014-11-08 20:28:26 +00:00
|
|
|
|
|
|
|
echo Original PATH: $PATH
|
|
|
|
|
|
|
|
while read line; do
|
|
|
|
KEY=`echo $line | cut --fields=1 --delimiter=" "`
|
|
|
|
VALUE=`echo $line | cut --fields=2 --delimiter=" "`
|
|
|
|
|
|
|
|
if [ "${KEY}" == "PATH" ];
|
|
|
|
then
|
2014-12-06 18:46:21 +00:00
|
|
|
export PATH=${VALUE}:${ORIGPATH}
|
2014-11-08 20:28:26 +00:00
|
|
|
echo New PATH: $PATH
|
|
|
|
|
|
|
|
else
|
|
|
|
export ${KEY}=${VALUE}
|
|
|
|
echo $KEY: $VALUE
|
|
|
|
|
|
|
|
fi
|
|
|
|
done < $1.conf
|
2014-12-06 18:46:21 +00:00
|
|
|
echo
|
|
|
|
echo
|
2014-11-08 20:28:26 +00:00
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
. ./libretro-config.sh
|
2014-11-06 00:25:06 +00:00
|
|
|
|
2014-11-06 05:34:54 +00:00
|
|
|
echo
|
|
|
|
[[ "${ARM_NEON}" ]] && echo 'ARM NEON opts enabled...' && export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-neon"
|
|
|
|
[[ "${CORTEX_A8}" ]] && echo 'Cortex A8 opts enabled...' && export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-cortexa8"
|
|
|
|
[[ "${CORTEX_A9}" ]] && echo 'Cortex A9 opts enabled...' && export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-cortexa9"
|
|
|
|
[[ "${ARM_HARDFLOAT}" ]] && echo 'ARM hardfloat ABI enabled...' && export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-hardfloat"
|
|
|
|
[[ "${ARM_SOFTFLOAT}" ]] && echo 'ARM softfloat ABI enabled...' && export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-softfloat"
|
|
|
|
[[ "${IOS}" ]] && echo 'iOS detected...'
|
|
|
|
|
2014-11-06 03:40:39 +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"
|
|
|
|
BASE_DIR=$(dirname "$SCRIPT")
|
|
|
|
if [ -z "$RARCH_DIST_DIR" ]; then
|
|
|
|
RARCH_DIR="$BASE_DIR/dist"
|
|
|
|
RARCH_DIST_DIR="$RARCH_DIR/$DIST_DIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$RARCH_DIST_DIR"
|
2014-12-18 03:39:09 +00:00
|
|
|
IFS=' ' read -ra ABIS <<< "$TARGET_ABIS"
|
|
|
|
for a in "${ABIS[@]}"; do
|
|
|
|
echo $a
|
|
|
|
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
|
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
if [ "$HOST_CC" ]; then
|
|
|
|
CC="${HOST_CC}-gcc"
|
|
|
|
CXX="${HOST_CC}-g++"
|
|
|
|
CXX11="${HOST_CC}-g++"
|
|
|
|
STRIP="${HOST_CC}-strip"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$MAKE" ]; then
|
|
|
|
if uname -s | grep -i MINGW32 > /dev/null 2>&1; then
|
|
|
|
MAKE=mingw32-make
|
|
|
|
else
|
|
|
|
if type gmake > /dev/null 2>&1; then
|
|
|
|
MAKE=gmake
|
|
|
|
else
|
|
|
|
MAKE=make
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$CC" ]; then
|
|
|
|
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
|
|
|
|
CC=cc
|
|
|
|
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
|
|
|
|
CC=mingw32-gcc
|
|
|
|
else
|
|
|
|
CC=gcc
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CXX" ]; then
|
|
|
|
if [ $FORMAT_COMPILER_TARGET = "osx" ]; then
|
|
|
|
CXX=c++
|
|
|
|
CXX11="clang++ -std=c++11 -stdlib=libc++"
|
|
|
|
elif uname -s | grep -i MINGW32 > /dev/null 2>&1; then
|
|
|
|
CXX=mingw32-g++
|
|
|
|
CXX11=mingw32-g++
|
|
|
|
else
|
|
|
|
CXX=g++
|
|
|
|
CXX11=g++
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-12-06 18:46:21 +00:00
|
|
|
if [ "${CC}" ] && [ "${CXX}" ]; then
|
2014-12-07 18:25:31 +00:00
|
|
|
COMPILER="CC=${CC} CXX=${CXX}"
|
2014-12-06 18:46:21 +00:00
|
|
|
else
|
|
|
|
COMPILER=""
|
|
|
|
fi
|
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
echo
|
|
|
|
echo "CC = $CC"
|
|
|
|
echo "CXX = $CXX"
|
|
|
|
echo "STRIP = $STRIP"
|
2014-12-06 18:46:21 +00:00
|
|
|
echo "COMPILER = $COMPILER"
|
2014-11-06 03:40:39 +00:00
|
|
|
echo
|
|
|
|
|
2014-12-07 17:42:11 +00:00
|
|
|
export CC=$CC
|
|
|
|
export CXX=$CXX
|
|
|
|
|
2014-11-06 05:34:54 +00:00
|
|
|
RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET
|
|
|
|
RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT
|
|
|
|
|
|
|
|
check_opengl() {
|
|
|
|
if [ "${BUILD_LIBRETRO_GL}" ]; then
|
|
|
|
if [ "${ENABLE_GLES}" ]; then
|
|
|
|
echo '=== OpenGL ES enabled ==='
|
|
|
|
export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-gles"
|
|
|
|
export FORMAT_COMPILER_TARGET_ALT="${FORMAT_COMPILER_TARGET}"
|
|
|
|
else
|
|
|
|
echo '=== OpenGL enabled ==='
|
|
|
|
export FORMAT_COMPILER_TARGET="${FORMAT_COMPILER_TARGET}-opengl"
|
|
|
|
export FORMAT_COMPILER_TARGET_ALT="${FORMAT_COMPILER_TARGET}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo '=== OpenGL disabled in build ==='
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
reset_compiler_targets() {
|
|
|
|
export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET
|
|
|
|
export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
cd "${BASE_DIR}"
|
|
|
|
|
|
|
|
####build commands
|
2014-11-06 00:25:06 +00:00
|
|
|
build_libretro_generic_makefile() {
|
|
|
|
|
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
NAME=$1
|
|
|
|
DIR=$2
|
|
|
|
SUBDIR=$3
|
|
|
|
MAKEFILE=$4
|
|
|
|
PLATFORM=$5
|
2014-11-06 05:34:54 +00:00
|
|
|
ARGS=$6
|
2014-11-06 00:25:06 +00:00
|
|
|
|
|
|
|
cd $DIR
|
|
|
|
cd $SUBDIR
|
2014-11-06 03:40:39 +00:00
|
|
|
|
2014-11-08 20:02:21 +00:00
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
if [ -z "${NOCLEAN}" ];
|
|
|
|
then
|
|
|
|
echo "cleaning up..."
|
2014-12-08 01:26:41 +00:00
|
|
|
echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean"
|
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS} clean
|
2014-11-06 00:25:06 +00:00
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo success!
|
|
|
|
else
|
|
|
|
echo error while cleaning up
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "compiling..."
|
2014-11-08 21:27:50 +00:00
|
|
|
if [ -z "${ARGS}" ]
|
2014-11-06 05:34:54 +00:00
|
|
|
then
|
2014-12-07 18:25:31 +00:00
|
|
|
echo "buid command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}"
|
2014-12-07 17:42:11 +00:00
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}
|
2014-11-06 05:34:54 +00:00
|
|
|
else
|
2014-12-07 18:25:31 +00:00
|
|
|
echo "buid command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}"
|
2014-12-07 17:42:11 +00:00
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}
|
2014-11-06 05:34:54 +00:00
|
|
|
fi
|
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo success!
|
2014-12-07 08:08:27 +00:00
|
|
|
cp -v ${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}
|
2014-11-06 00:25:06 +00:00
|
|
|
else
|
|
|
|
echo error while compiling $1
|
|
|
|
fi
|
2014-11-08 20:02:21 +00:00
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-12-18 03:39:09 +00:00
|
|
|
build_libretro_generic_jni() {
|
|
|
|
|
|
|
|
|
|
|
|
NAME=$1
|
|
|
|
DIR=$2
|
|
|
|
SUBDIR=$3
|
|
|
|
MAKEFILE=$4
|
|
|
|
PLATFORM=$5
|
|
|
|
ARGS=$6
|
|
|
|
|
|
|
|
cd $DIR
|
|
|
|
cd $SUBDIR
|
|
|
|
|
2014-12-18 22:22:51 +00:00
|
|
|
for a in "${ABIS[@]}"; do
|
2014-12-18 22:19:36 +00:00
|
|
|
if [ -z "${NOCLEAN}" ];
|
|
|
|
then
|
2014-12-18 22:22:51 +00:00
|
|
|
echo "cleaning up..."
|
|
|
|
echo "cleanup command: ${NDK} -j${JOBS} ${ARGS} APP_ABI=${a} clean"
|
2014-12-18 22:19:36 +00:00
|
|
|
${NDK} -j${JOBS} ${ARGS} APP_ABI=${a} clean
|
|
|
|
if [ $? -eq 0 ];
|
2014-12-18 22:22:51 +00:00
|
|
|
then
|
|
|
|
echo success!
|
|
|
|
else
|
|
|
|
echo error while cleaning up
|
|
|
|
fi
|
2014-12-18 03:39:09 +00:00
|
|
|
fi
|
2014-12-18 22:19:36 +00:00
|
|
|
|
2014-12-18 22:22:51 +00:00
|
|
|
echo "compiling for ${a}..."
|
2014-12-18 03:39:09 +00:00
|
|
|
if [ -z "${ARGS}" ]
|
|
|
|
then
|
2014-12-18 22:22:51 +00:00
|
|
|
echo "buid command: ${NDK} -j${JOBS} APP_ABI=${a}"
|
|
|
|
${NDK} -j${JOBS} APP_ABI=${a}
|
2014-12-18 03:39:09 +00:00
|
|
|
else
|
2014-12-18 22:22:51 +00:00
|
|
|
echo "buid command: ${NDK} -j${JOBS} APP_ABI=${a} ${ARGS} "
|
|
|
|
${NDK} -j${JOBS} APP_ABI=${a} ${ARGS}
|
2014-12-18 03:39:09 +00:00
|
|
|
fi
|
2014-12-18 22:19:36 +00:00
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
2014-12-18 22:22:51 +00:00
|
|
|
echo success!
|
|
|
|
cp -v ../libs/${a}/libretro.${FORMAT_EXT} $RARCH_DIST_DIR/${a}/${1}_libretro${FORMAT}.${FORMAT_EXT}
|
2014-12-18 22:19:36 +00:00
|
|
|
else
|
2014-12-18 22:22:51 +00:00
|
|
|
echo error while compiling $1
|
2014-12-18 22:19:36 +00:00
|
|
|
fi
|
2014-12-18 22:22:51 +00:00
|
|
|
done
|
2014-12-18 03:39:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-11-06 06:21:26 +00:00
|
|
|
build_libretro_generic_gl_makefile() {
|
|
|
|
|
|
|
|
|
|
|
|
NAME=$1
|
|
|
|
DIR=$2
|
|
|
|
SUBDIR=$3
|
|
|
|
MAKEFILE=$4
|
|
|
|
PLATFORM=$5
|
|
|
|
ARGS=$6
|
|
|
|
|
|
|
|
|
|
|
|
check_opengl
|
|
|
|
|
2014-11-08 20:02:21 +00:00
|
|
|
cd $DIR
|
|
|
|
cd $SUBDIR
|
|
|
|
|
2014-11-06 06:21:26 +00:00
|
|
|
if [ -z "${NOCLEAN}" ];
|
|
|
|
then
|
|
|
|
echo "cleaning up..."
|
2014-12-07 18:25:31 +00:00
|
|
|
echo "cleanup command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean"
|
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} clean
|
2014-11-06 06:21:26 +00:00
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo success!
|
|
|
|
else
|
|
|
|
echo error while cleaning up
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "compiling..."
|
2014-11-08 21:27:50 +00:00
|
|
|
if [ -z "${ARGS}" ];
|
2014-11-06 06:21:26 +00:00
|
|
|
then
|
2014-12-07 18:25:31 +00:00
|
|
|
echo "buid command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}"
|
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS}
|
2014-11-06 06:21:26 +00:00
|
|
|
else
|
|
|
|
echo "buid command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} ${COMPILER} -j${JOBS} ${ARGS}"
|
2014-12-07 18:25:31 +00:00
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} -j${JOBS} ${ARGS}
|
2014-11-06 06:21:26 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo success!
|
2014-12-07 08:08:27 +00:00
|
|
|
cp -v ${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT} $RARCH_DIST_DIR/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}
|
2014-11-06 06:21:26 +00:00
|
|
|
else
|
|
|
|
echo error while compiling $1
|
|
|
|
fi
|
|
|
|
|
|
|
|
reset_compiler_targets
|
2014-11-08 20:02:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_libretro_bsnes() {
|
|
|
|
|
|
|
|
|
|
|
|
NAME=$1
|
|
|
|
DIR=$2
|
|
|
|
PROFILE=$3
|
|
|
|
MAKEFILE=$4
|
|
|
|
PLATFORM=$5
|
|
|
|
BSNESCOMPILER=$6
|
|
|
|
|
|
|
|
|
|
|
|
cd $DIR
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "${NOCLEAN}" ];
|
|
|
|
then
|
|
|
|
echo "cleaning up..."
|
|
|
|
|
|
|
|
rm -f obj/*.{o,"${FORMAT_EXT}"}
|
|
|
|
rm -f out/*.{o,"${FORMAT_EXT}"}
|
|
|
|
|
|
|
|
|
2014-12-06 18:46:21 +00:00
|
|
|
if [ "${PROFILE}" == "cpp98" -o "${PROFILE}" == "bnes" ];
|
2014-11-08 20:02:21 +00:00
|
|
|
then
|
|
|
|
${MAKE} clean
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo success!
|
|
|
|
else
|
|
|
|
echo error while cleaning up
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "compiling..."
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${PROFILE}" == "cpp98" ];
|
|
|
|
then
|
|
|
|
${MAKE} platform="${PLATFORM}" ${COMPILER} "-j${JOBS}"
|
|
|
|
elif [ "${PROFILE}" == "bnes" ];
|
|
|
|
then
|
2014-12-06 18:46:21 +00:00
|
|
|
echo "buid command: ${MAKE} -f Makefile ${COMPILER} "-j${JOBS}" compiler=${BSNESCOMPILER}" platform=${FORMAT_COMPILER_TARGET}
|
|
|
|
${MAKE} -f Makefile ${COMPILER} "-j${JOBS}" compiler="${BSNESCOMPILER}" platform=${FORMAT_COMPILER_TARGET}
|
2014-11-08 20:02:21 +00:00
|
|
|
else
|
|
|
|
echo "buid command: ${MAKE} -f ${MAKEFILE} platform=${PLATFORM} compiler=${BSNESCOMPILER} ui='target-libretro' profile=${PROFILE} -j${JOBS}"
|
|
|
|
${MAKE} -f ${MAKEFILE} platform=${PLATFORM} compiler=${BSNESCOMPILER} ui='target-libretro' profile=${PROFILE} -j${JOBS}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $? -eq 0 ];
|
|
|
|
then
|
|
|
|
echo success!
|
|
|
|
if [ "${PROFILE}" == "cpp98" ];
|
|
|
|
then
|
2014-12-07 08:08:27 +00:00
|
|
|
cp -fv "out/libretro.${FORMAT_EXT}" "${RARCH_DIST_DIR}/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}"
|
2014-11-08 20:02:21 +00:00
|
|
|
elif [ "${PROFILE}" == "bnes" ];
|
|
|
|
then
|
2014-12-07 08:08:27 +00:00
|
|
|
cp -fv "libretro.${FORMAT_EXT}" "${RARCH_DIST_DIR}/${NAME}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}"
|
2014-11-08 20:02:21 +00:00
|
|
|
else
|
2014-12-07 08:08:27 +00:00
|
|
|
cp -fv "out/${NAME}_libretro$FORMAT.${FORMAT_EXT}" $RARCH_DIST_DIR/${NAME}_${PROFILE}_libretro${FORMAT}${SUFFIX}.${FORMAT_EXT}
|
2014-11-08 20:02:21 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo error while compiling $1
|
|
|
|
fi
|
|
|
|
|
2014-11-06 06:21:26 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
#fetch a project and mark it for building if there have been any changes
|
|
|
|
|
2014-11-06 05:34:54 +00:00
|
|
|
#sleep 10
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
while read line; do
|
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
NAME=`echo $line | cut --fields=1 --delimiter=" "`
|
|
|
|
DIR=`echo $line | cut --fields=2 --delimiter=" "`
|
|
|
|
URL=`echo $line | cut --fields=3 --delimiter=" "`
|
|
|
|
TYPE=`echo $line | cut --fields=4 --delimiter=" "`
|
|
|
|
ENABLED=`echo $line | cut --fields=5 --delimiter=" "`
|
|
|
|
COMMAND=`echo $line | cut --fields=6 --delimiter=" "`
|
|
|
|
MAKEFILE=`echo $line | cut --fields=7 --delimiter=" "`
|
|
|
|
SUBDIR=`echo $line | cut --fields=8 --delimiter=" "`
|
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
if [ "${ENABLED}" == "YES" ];
|
|
|
|
then
|
|
|
|
echo "Processing $NAME"
|
2014-11-06 03:40:39 +00:00
|
|
|
echo ============================================
|
|
|
|
echo URL: $URL
|
|
|
|
echo REPO TYPE: $TYPE
|
|
|
|
echo ENABLED: $ENABLED
|
|
|
|
echo COMMAND: $COMMAND
|
|
|
|
echo MAKEFILE: $MAKEFILE
|
|
|
|
|
|
|
|
ARGS=""
|
|
|
|
|
|
|
|
TEMP=`echo $line | cut --fields=9 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=10 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=11 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
2014-11-06 00:25:06 +00:00
|
|
|
then
|
2014-11-06 03:40:39 +00:00
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
2014-11-06 22:40:27 +00:00
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=12 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=13 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=14 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
2014-11-06 03:40:39 +00:00
|
|
|
|
2014-11-08 20:02:21 +00:00
|
|
|
ARGS="${ARGS%"${ARGS##*[![:space:]]}"}"
|
|
|
|
|
2014-12-17 18:32:42 +00:00
|
|
|
echo ARGS: $ARGS
|
2014-11-06 05:34:54 +00:00
|
|
|
echo
|
|
|
|
echo
|
2014-11-06 03:40:39 +00:00
|
|
|
|
2014-11-06 22:40:27 +00:00
|
|
|
if [ "${TYPE}" == "PROJECT" ];
|
2014-11-06 03:40:39 +00:00
|
|
|
then
|
2014-11-06 22:40:27 +00:00
|
|
|
if [ -d "${DIR}/.git" ];
|
2014-11-06 00:25:06 +00:00
|
|
|
then
|
2014-11-06 22:40:27 +00:00
|
|
|
|
|
|
|
cd $DIR
|
|
|
|
echo "pulling from repo... "
|
|
|
|
OUT=`git pull`
|
|
|
|
if [[ $OUT == *"Already up-to-date"* ]]
|
|
|
|
then
|
|
|
|
BUILD="NO"
|
|
|
|
else
|
2014-12-07 08:08:27 +00:00
|
|
|
BUILD="YES"
|
2014-11-06 22:40:27 +00:00
|
|
|
fi
|
2014-11-09 17:05:45 +00:00
|
|
|
|
|
|
|
if [ "${PREVCORE}" == "bsnes" -a "${PREVBUILD}" == "YES" -a "${COMMAND}" == "BSNES" ]; then
|
|
|
|
FORCE="YES"
|
|
|
|
BUILD="YES"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${PREVCORE}" == "mame" -a "${PREVBUILD}" == "YES" -a "${NAME}" == "mess" ]; then
|
|
|
|
FORCE="YES"
|
|
|
|
BUILD="YES"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${PREVCORE}" == "mess" -a "${PREVBUILD}" == "YES" -a "${NAME}" == "ume" ]; then
|
2014-11-08 22:57:11 +00:00
|
|
|
FORCE="YES"
|
|
|
|
BUILD="YES"
|
|
|
|
fi
|
|
|
|
|
2014-11-06 22:40:27 +00:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2014-12-07 08:08:27 +00:00
|
|
|
else
|
2014-11-06 22:40:27 +00:00
|
|
|
echo "cloning repo..."
|
|
|
|
git clone --depth=1 "$URL" "$DIR"
|
|
|
|
BUILD="YES"
|
2014-12-07 08:08:27 +00:00
|
|
|
fi
|
|
|
|
elif [ "${TYPE}" == "psp_hw_render" ];
|
|
|
|
then
|
|
|
|
if [ -d "${DIR}/.git" ];
|
|
|
|
then
|
|
|
|
|
|
|
|
cd $DIR
|
|
|
|
echo "pulling from repo... "
|
|
|
|
OUT=`git pull`
|
|
|
|
if [[ $OUT == *"Already up-to-date"* ]]
|
|
|
|
then
|
|
|
|
BUILD="NO"
|
|
|
|
else
|
2014-12-17 18:32:42 +00:00
|
|
|
BUILD="YES"
|
2014-12-07 08:08:27 +00:00
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "cloning repo..."
|
2014-12-17 23:59:08 +00:00
|
|
|
git clone "$URL" "$DIR" --depth=1
|
2014-12-07 08:08:27 +00:00
|
|
|
cd $DIR
|
|
|
|
git checkout $TYPE
|
|
|
|
cd ..
|
|
|
|
BUILD="YES"
|
2014-12-17 18:32:42 +00:00
|
|
|
fi
|
2014-12-07 08:08:27 +00:00
|
|
|
|
2014-11-06 22:40:27 +00:00
|
|
|
elif [ "${TYPE}" == "SUBMODULE" ];
|
2014-12-07 08:08:27 +00:00
|
|
|
then
|
2014-11-06 22:40:27 +00:00
|
|
|
if [ -d "${DIR}/.git" ];
|
|
|
|
then
|
2014-11-06 00:25:06 +00:00
|
|
|
|
2014-11-06 22:40:27 +00:00
|
|
|
cd $DIR
|
|
|
|
echo "pulling from repo... "
|
|
|
|
OUT=`git pull`
|
|
|
|
if [[ $OUT == *"Already up-to-date"* ]]
|
|
|
|
then
|
|
|
|
BUILD="NO"
|
|
|
|
else
|
2014-12-07 08:08:27 +00:00
|
|
|
BUILD="YES"
|
2014-11-06 22:40:27 +00:00
|
|
|
fi
|
2014-12-19 18:55:03 +00:00
|
|
|
OUT=`git submodule foreach git pull origin master`
|
2014-11-06 22:40:27 +00:00
|
|
|
cd ..
|
|
|
|
else
|
|
|
|
echo "cloning repo..."
|
|
|
|
git clone --depth=1 "$URL" "$DIR"
|
|
|
|
cd $DIR
|
|
|
|
git submodule update --init
|
|
|
|
BUILD="YES"
|
2014-12-07 08:08:27 +00:00
|
|
|
fi
|
2014-11-06 00:25:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ];
|
|
|
|
then
|
|
|
|
echo building core...
|
2014-11-06 03:40:39 +00:00
|
|
|
if [ "${COMMAND}" == "GENERIC" ]; then
|
2014-11-06 05:34:54 +00:00
|
|
|
build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}"
|
2014-11-06 22:40:27 +00:00
|
|
|
elif [ "${COMMAND}" == "GENERIC_GL" ]; then
|
2014-11-06 06:21:26 +00:00
|
|
|
build_libretro_generic_gl_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET} "${ARGS}"
|
2014-11-06 22:40:27 +00:00
|
|
|
elif [ "${COMMAND}" == "GENERIC_ALT" ]; then
|
|
|
|
build_libretro_generic_makefile $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}"
|
2014-12-18 03:39:09 +00:00
|
|
|
elif [ "${COMMAND}" == "GENERIC_JNI" ]; then
|
|
|
|
build_libretro_generic_jni $NAME $DIR $SUBDIR $MAKEFILE ${FORMAT_COMPILER_TARGET_ALT} "${ARGS}"
|
2014-11-08 20:02:21 +00:00
|
|
|
elif [ "${COMMAND}" == "BSNES" ]; then
|
|
|
|
build_libretro_bsnes $NAME $DIR "${ARGS}" $MAKEFILE ${FORMAT_COMPILER_TARGET} ${CXX11}
|
2014-11-06 06:21:26 +00:00
|
|
|
|
2014-11-06 03:40:39 +00:00
|
|
|
fi
|
2014-11-06 00:25:06 +00:00
|
|
|
else
|
|
|
|
echo core already up-to-date...
|
|
|
|
fi
|
2014-11-06 05:34:54 +00:00
|
|
|
echo
|
2014-11-06 00:25:06 +00:00
|
|
|
|
|
|
|
fi
|
2014-11-06 03:40:39 +00:00
|
|
|
|
|
|
|
cd "${BASE_DIR}"
|
2014-11-09 17:05:45 +00:00
|
|
|
PREVCORE=$NAME
|
2014-11-08 22:57:11 +00:00
|
|
|
PREVBUILD=$BUILD
|
2014-11-06 05:34:54 +00:00
|
|
|
|
2014-11-06 00:25:06 +00:00
|
|
|
done < $1
|
|
|
|
|
2014-12-07 08:08:27 +00:00
|
|
|
echo "Building RetroArch"
|
|
|
|
echo ============================================
|
2014-12-17 23:59:08 +00:00
|
|
|
cd $WORK
|
|
|
|
BUILD=""
|
2014-12-07 08:08:27 +00:00
|
|
|
|
|
|
|
if [ "${PLATFORM}" == "psp1" ];
|
|
|
|
then
|
|
|
|
|
2014-12-17 18:32:42 +00:00
|
|
|
while read line; do
|
2014-12-07 08:08:27 +00:00
|
|
|
|
2014-12-17 18:32:42 +00:00
|
|
|
NAME=`echo $line | cut --fields=1 --delimiter=" "`
|
|
|
|
DIR=`echo $line | cut --fields=2 --delimiter=" "`
|
|
|
|
URL=`echo $line | cut --fields=3 --delimiter=" "`
|
|
|
|
TYPE=`echo $line | cut --fields=4 --delimiter=" "`
|
|
|
|
ENABLED=`echo $line | cut --fields=5 --delimiter=" "`
|
|
|
|
SUBDIR=`echo $line | cut --fields=8 --delimiter=" "`
|
|
|
|
|
|
|
|
if [ "${ENABLED}" == "YES" ];
|
|
|
|
then
|
|
|
|
echo "Processing $NAME"
|
|
|
|
echo ============================================
|
|
|
|
echo NAME: $NAME
|
|
|
|
echo DIR: $DIR
|
|
|
|
echo SUBDIR: $SUBDIR
|
|
|
|
echo URL: $URL
|
|
|
|
echo REPO TYPE: $TYPE
|
|
|
|
echo ENABLED: $ENABLED
|
|
|
|
|
|
|
|
ARGS=""
|
|
|
|
|
|
|
|
TEMP=`echo $line | cut --fields=9 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=10 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=11 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=12 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=13 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=14 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARGS="${ARGS%"${ARGS##*[![:space:]]}"}"
|
|
|
|
|
|
|
|
echo ARGS: $ARGS
|
|
|
|
|
|
|
|
if [ -d "${DIR}/.git" ];
|
|
|
|
then
|
2014-12-07 08:08:27 +00:00
|
|
|
|
2014-12-17 18:32:42 +00:00
|
|
|
cd $DIR
|
|
|
|
echo "pulling from repo... "
|
|
|
|
OUT=`git pull`
|
2014-12-17 18:56:09 +00:00
|
|
|
echo $OUT
|
2014-12-17 18:32:42 +00:00
|
|
|
if [[ $OUT == *"Already up-to-date"* ]]
|
|
|
|
then
|
|
|
|
BUILD="NO"
|
|
|
|
else
|
|
|
|
BUILD="YES"
|
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "cloning repo..."
|
2014-12-17 23:59:08 +00:00
|
|
|
git clone "$URL" "$DIR" --depth=1
|
2014-12-17 18:32:42 +00:00
|
|
|
cd $DIR
|
|
|
|
BUILD="YES"
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ];
|
|
|
|
then
|
|
|
|
cd $DIR
|
|
|
|
rm -rfv psp1/pkg/
|
|
|
|
cd dist-scripts
|
|
|
|
rm *.a
|
|
|
|
cp -v $RARCH_DIST_DIR/* .
|
|
|
|
sh ./psp1-cores.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
done < $1.ra
|
|
|
|
|
2014-12-17 23:59:08 +00:00
|
|
|
fi
|
|
|
|
|
2014-12-18 03:39:09 +00:00
|
|
|
if [ "${PLATFORM}" == "android" ];
|
2014-12-17 23:59:08 +00:00
|
|
|
then
|
|
|
|
|
|
|
|
while read line; do
|
|
|
|
|
|
|
|
NAME=`echo $line | cut --fields=1 --delimiter=" "`
|
|
|
|
DIR=`echo $line | cut --fields=2 --delimiter=" "`
|
|
|
|
URL=`echo $line | cut --fields=3 --delimiter=" "`
|
|
|
|
TYPE=`echo $line | cut --fields=4 --delimiter=" "`
|
|
|
|
ENABLED=`echo $line | cut --fields=5 --delimiter=" "`
|
|
|
|
PARENTDIR=`echo $line | cut --fields=6 --delimiter=" "`
|
|
|
|
|
|
|
|
if [ "${ENABLED}" == "YES" ];
|
|
|
|
then
|
|
|
|
echo "Processing $NAME"
|
|
|
|
echo ============================================
|
|
|
|
echo NAME: $NAME
|
|
|
|
echo DIR: $DIR
|
|
|
|
echo PARENT: $PARENTDIR
|
|
|
|
echo URL: $URL
|
|
|
|
echo REPO TYPE: $TYPE
|
|
|
|
echo ENABLED: $ENABLED
|
|
|
|
|
|
|
|
ARGS=""
|
|
|
|
|
|
|
|
TEMP=`echo $line | cut --fields=9 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=10 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=11 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=12 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=13 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
TEMP=""
|
|
|
|
TEMP=`echo $line | cut --fields=14 --delimiter=" "`
|
|
|
|
if [ -n ${TEMP} ];
|
|
|
|
then
|
|
|
|
ARGS="${ARGS} ${TEMP}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARGS="${ARGS%"${ARGS##*[![:space:]]}"}"
|
|
|
|
|
|
|
|
echo ARGS: $ARGS
|
|
|
|
|
|
|
|
if [ -d "${PARENTDIR}/${DIR}/.git" ];
|
|
|
|
then
|
|
|
|
cd $PARENTDIR
|
|
|
|
cd $DIR
|
|
|
|
echo "pulling from repo... "
|
|
|
|
OUT=`git pull`
|
|
|
|
echo $OUT
|
|
|
|
if [ "${TYPE}" == "PROJECT" ];
|
|
|
|
then
|
|
|
|
RADIR=$DIR
|
|
|
|
if [[ $OUT == *"Already up-to-date"* ]]
|
|
|
|
then
|
|
|
|
BUILD="NO"
|
|
|
|
else
|
|
|
|
BUILD="YES"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cd $WORK
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "cloning repo..."
|
|
|
|
cd $PARENTDIR
|
|
|
|
git clone "$URL" "$DIR" --depth=1
|
|
|
|
cd $DIR
|
|
|
|
if [ "${TYPE}" == "PROJECT" ];
|
|
|
|
then
|
|
|
|
BUILD="YES"
|
|
|
|
fi
|
|
|
|
cd $WORK
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
done < $1.ra
|
|
|
|
if [ "${BUILD}" == "YES" -o "${FORCE}" == "YES" ];
|
|
|
|
then
|
|
|
|
echo "Compiling Shaders"
|
|
|
|
echo ============================================
|
|
|
|
|
|
|
|
cd $RADIR
|
|
|
|
$MAKE -f Makefile.griffin shaders-convert-glsl PYTHON3=$PYTHON
|
|
|
|
|
|
|
|
echo "Processing Assets"
|
|
|
|
echo ============================================
|
|
|
|
|
|
|
|
rm -Rv android/phoenix/assets/overlays
|
|
|
|
cp -Rv media/overlays android/phoenix/assets/
|
|
|
|
rm -Rv android/phoenix/assets/shaders_glsl
|
|
|
|
cp -Rv media/shaders_glsl android/phoenix/assets/
|
|
|
|
rm -Rv android/phoenix/assets/autoconfig
|
|
|
|
cp -Rv media/autoconfig android/phoenix/assets/
|
|
|
|
rm -Rv android/phoenix/assets/info
|
|
|
|
cp -Rv $RARCH_DIR/info android/phoenix/assets/
|
|
|
|
|
|
|
|
echo "Building"
|
|
|
|
echo ============================================
|
|
|
|
|
|
|
|
cd android/phoenix
|
|
|
|
rm bin/*.apk
|
2014-12-18 03:39:09 +00:00
|
|
|
|
|
|
|
ndk-build.cmd clean
|
|
|
|
ndk-build.cmd -j8
|
2014-12-17 23:59:08 +00:00
|
|
|
android.bat update project --path . --target android-21
|
|
|
|
android.bat update project --path libs/googleplay --target android-21
|
|
|
|
android.bat update project --path libs/appcompat --target android-21
|
|
|
|
|
|
|
|
ant debug
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-17 18:32:42 +00:00
|
|
|
fi
|
2014-12-07 08:08:27 +00:00
|
|
|
|
2014-11-08 20:28:26 +00:00
|
|
|
PATH=$ORIGPATH
|