From 3ccbbcf63beda006ad468a07c94c0149ed1bb774 Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 5 Dec 2013 22:41:23 +1000 Subject: [PATCH] Buildfixes from homebrew merge. --- .travis.yml | 20 ++++++++++---------- Blackberry/build.sh | 7 ++++--- CMakeLists.txt | 6 +++--- Core/Util/GameManager.cpp | 4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4831d909e8..72f89aa362 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,37 +22,37 @@ matrix: before_install: - git submodule update --init --recursive - sudo apt-get install aria2 -qq + - download_extract() { aria2c -x 16 $1 -o $2 && tar -xf $2; } # Travis uses CMake 2.8.7. We require 2.8.8. Grab latest - if [ "$CMAKE" == "TRUE" ]; then - sudo apt-get install lib32z1-dev lib32stdc++6 && + sudo apt-get install lib32stdc++6 -qq && aria2c -x 16 http://www.cmake.org/files/v2.8/cmake-2.8.12.1-Linux-i386.sh && chmod a+x cmake-2.8.12.1-Linux-i386.sh && sudo ./cmake-2.8.12.1-Linux-i386.sh --skip-license --prefix=/usr; fi + +install: # Linux Setup - if [ "$PPSSPP_BUILD_TYPE" == "Linux" ]; then sudo apt-get install libsdl1.2-dev -qq; # Android NDK - elif [ "$PPSSPP_BUILD_TYPE" == "Android" ]; then NDK_VER=android-ndk-r9b - NDK_TAR=${NDK_VER}-linux-x86_64.tar.bz2 && sudo apt-get install ant -qq && - aria2c -x 16 http://dl.google.com/android/ndk/${NDK_TAR} && - tar -xf ${NDK_TAR} && + download_extract http://dl.google.com/android/ndk/${NDK_TAR}-linux-x86_64.tar.bz2 ${NDK_VER}-linux-x86_64.tar.bz2 export ANDROID_HOME=$(pwd)/${NDK_VER} NDK=$(pwd)/${NDK_VER}; if [[ "$CXX" == *clang* ]]; then export NDK_TOOLCHAIN_VERSION=clang; fi # Blackberry NDK: 10.2.0.1155 - elif [ "$PPSSPP_BUILD_TYPE" == "Blackberry" ]; then - aria2c -x 16 https://googledrive.com/host/0B5UBD4wjtpZ-QVdzSElobzNTOU0 -o libs.tar.gz && tar -xf libs.tar.gz && - aria2c -x 16 https://googledrive.com/host/0B5UBD4wjtpZ-NV80UzFYMVRkSXM -o tools.tar.gz && tar -xf tools.tar.gz && + download_extract https://googledrive.com/host/0B5UBD4wjtpZ-QVdzSElobzNTOU0 libs.tar.gz && + download_extract https://googledrive.com/host/0B5UBD4wjtpZ-NV80UzFYMVRkSXM tools.tar.gz && export QNX_TARGET="$(pwd)/target_10_2_0_1155/qnx6" QNX_HOST="$(pwd)/host_10_2_0_15/linux/x86" && PATH="$QNX_HOST/usr/bin:$PATH"; # Symbian NDK: Belle - elif [ "$PPSSPP_BUILD_TYPE" == "Symbian" ]; then - sudo apt-get install lib32z1-dev lib32stdc++6 lib32bz2-1.0 -qq && - aria2c -x 16 https://googledrive.com/host/0B5UBD4wjtpZ-T0Iwa0F3b2JqREE -o ndk.tar.bz2 && - tar -xf ndk.tar.bz2 && sed -i "s!/SDKs!$(pwd)/SDKs!" SDKs/SymbianSR1Qt474/bin/qt.conf && + sudo apt-get install lib32stdc++6 lib32bz2-1.0 -qq && + download_extract https://googledrive.com/host/0B5UBD4wjtpZ-T0Iwa0F3b2JqREE ndk.tar.bz2 && + sed -i "s!/SDKs!$(pwd)/SDKs!" SDKs/SymbianSR1Qt474/bin/qt.conf && cp ffmpeg/symbian/armv6/lib/* SDKs/SymbianSR1Qt474/epoc32/release/armv5/urel/ && - SDKs/SymbianSR1Qt474/setenv.sh && export EPOCROOT=$(pwd)/SDKs/SymbianSR1Qt474 SBS_GCCE463BIN=$(pwd)/tools/gcce4/bin && PATH=$SBS_GCCE463BIN:$(pwd)/tools/sbs/bin:$EPOCROOT/epoc32/tools:$(pwd)/tools:$EPOCROOT/bin:$(pwd)/tools/sbs/linux-x86_64-libc2_15/bin:$PATH; fi diff --git a/Blackberry/build.sh b/Blackberry/build.sh index 31e93064c5..a689c926a5 100755 --- a/Blackberry/build.sh +++ b/Blackberry/build.sh @@ -1,11 +1,12 @@ -# Strict errors. Any non-zero return exits this script -set -e - +# Check Blackberry NDK BB_OS=`cat ${QNX_TARGET}/etc/qversion 2>/dev/null` if [ -z "$BB_OS" ]; then echo "Could not find your Blackberry NDK. Please source bbndk-env.sh" exit 1 fi + +# Strict errors. Any non-zero return exits this script +set -e echo "Building for Blackberry ${BB_OS}" if [[ "$1" == "--simulator" ]]; then diff --git a/CMakeLists.txt b/CMakeLists.txt index 9825926c81..591ff2f60f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,9 +428,9 @@ include_directories(native/ext/stb_vorbis) native/ext/libzip/zip_unchange_all.c native/ext/libzip/zip_unchange_archive.c native/ext/libzip/zip_unchange_data.c) - target_link_libraries(libzip zlib) + target_link_libraries(libzip ${LIBZIP}) include_directories(native/ext/libzip) - set(LIBZIP libzip zlib) + set(LIBZIP libzip) # endif() set(nativeExtra) @@ -659,7 +659,7 @@ add_library(native STATIC native/ext/jpge/jpge.cpp native/ext/jpge/jpge.h) include_directories(native) -target_link_libraries(native ${LIBZIP} rg_etc1 vjson stb_image stb_vorbis snappy libzip ${GLEW_LIBRARIES}) +target_link_libraries(native ${LIBZIP} rg_etc1 vjson stb_image stb_vorbis snappy ${GLEW_LIBRARIES}) if(ANDROID) target_link_libraries(native log) diff --git a/Core/Util/GameManager.cpp b/Core/Util/GameManager.cpp index 6584d8c80c..611576727a 100644 --- a/Core/Util/GameManager.cpp +++ b/Core/Util/GameManager.cpp @@ -179,7 +179,7 @@ bool GameManager::InstallGame(std::string zipfile) { const char *fn = zip_get_name(z, i, 0); std::string zippedName = fn; std::string outFilename = pspGame + zippedName.substr(stripChars); - bool isDir = outFilename.back() == '/'; + bool isDir = *outFilename.rbegin() == '/'; if (isDir) { File::CreateFullPath(outFilename.c_str()); } else { @@ -203,7 +203,7 @@ bool GameManager::InstallGame(std::string zipfile) { fn += stripChars; std::string outFilename = pspGame + fn; - bool isDir = outFilename.back() == '/'; + bool isDir = *outFilename.rbegin() == '/'; if (isDir) continue;