From f6daaf76c8840169048969615448548f74b20006 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 2 Mar 2014 02:05:40 +0100 Subject: [PATCH 01/22] Update CONTRIBUTING.md --- CONTRIBUTING.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0675237f..f015b0c40 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ -![](http://www.pocketmine.net/favicon.png) +![](http://cdn.pocketmine.net/img/PocketMine-MP-h.png) # PocketMine-MP Contribution Guidelines -Before contributing to PocketMine-MP, please read this. +Before contributing to PocketMine-MP, please read this. Also, take a look if your contribution fits the PocketMine-MP goals below. ## I've a question -* For questions, please refer to the _#pocketmine_ or _#mcpedevs_ IRC channel on Freenode. There is a [WebIRC](http://webchat.freenode.net?channels=pockdetmine,mcpedevs&uio=d4) if you want. +* For questions, please refer to the _#pocketmine_ or _#mcpedevs_ IRC channel on Freenode. There is a [WebIRC](http://webchat.freenode.net?channels=pocketmine,mcpedevs&uio=d4) if you want. * You can ask directly to _[@PocketMine](https://twitter.com/PocketMine)_ in Twitter, but don't expect an inmediate reply. ## I want to create an issue @@ -28,8 +28,7 @@ __Thanks for contributing to PocketMine-MP!__ - -#### Code syntax +### Code syntax It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) with a few exceptions. * Opening braces MUST go on the same line. @@ -39,7 +38,7 @@ It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accept * Long arrays MAY be split across multiple lines, where each subsequent line is indented once. * Files MUST use only the `` tag. -* Code MUST NOT use namespaces. _(This restriction will be lifted on the Alpha_1.4 code)_ +* Code MUST NOT use namespaces. Descriptive and unique class names are enforced. * Strings SHOULD use the double quote `"` except when the single quote is required. * Arrays SHOULD be declared using `array()`, not the `[]` shortcut. * Argument lists MAY NOT be split across multiple lines, except long arrays. @@ -70,4 +69,4 @@ class ExampleClass{ } } -``` \ No newline at end of file +``` From a375a17d17292210ad1a2cabf200708bf47b69f2 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 04:20:59 +0100 Subject: [PATCH 02/22] New compile script --- src/build/compile.sh | 144 ++++++++++++++++++++++++++++--------------- src/build/jenkins.sh | 22 +++---- 2 files changed, 104 insertions(+), 62 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 08ab28930..d5e9ab734 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -41,36 +41,53 @@ export CC="gcc" COMPILE_FOR_ANDROID=no RANLIB=ranlib HAVE_MYSQLI="--with-mysqli=mysqlnd" -if [ "$1" == "rpi" ]; then - [ -z "$march" ] && march=armv6zk; - [ -z "$mtune" ] && mtune=arm1176jzf-s; - [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; - OPENSSL_TARGET="linux-armv4" - echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float" -elif [ "$1" == "mac" ]; then - [ -z "$march" ] && march=prescott; - [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-m32 -arch i386 -fomit-frame-pointer -mmacosx-version-min=10.5"; - [ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib"; - export DYLD_LIBRARY_PATH="@loader_path/../lib" - OPENSSL_TARGET="darwin-i386-cc" - echo "[INFO] Compiling for Intel MacOS x86" -elif [ "$1" == "mac64" ]; then - [ -z "$march" ] && march=core2; - [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-m64 -arch x86_64 -fomit-frame-pointer -mmacosx-version-min=10.5"; - [ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib"; - export DYLD_LIBRARY_PATH="@loader_path/../lib" - OPENSSL_TARGET="darwin64-x86_64-cc" - echo "[INFO] Compiling for Intel MacOS x86_64" -elif [ "$1" == "ios" ]; then - [ -z "$march" ] && march=armv6; - [ -z "$mtune" ] && mtune=cortex-a8; - echo "[INFO] Compiling for iOS ARMv6" - OPENSSL_TARGET="linux-armv4" -elif [ "$1" == "crosscompile" ]; then - HAVE_MYSQLI="--without-mysqli" - if [ "$2" == "android" ] || [ "$2" == "android-armv6" ]; then +COMPILE_TARGET="" +COMPILE_OPENSSL="no" +COMPILE_CURL="default" +COMPILE_LIBEDIT="no" +IS_CROSSCOMPILE="no" +DO_OPTIMIZE="no" +while getopts "t:oj:cxf" OPTION; do + case $OPTION in + t) + echo "[opt] Set target to $OPTARG" + COMPILE_TARGET=$OPTARG + ;; + j) + echo "[opt] Set make threads to $OPTARG" + THREADS=$OPTARG + ;; + o) + echo "[opt] Will compile OpenSSL" + COMPILE_OPENSSL="yes" + ;; + l) + echo "[opt] Will compile libedit" + COMPILE_LIBEDIT="yes" + ;; + c) + echo "[opt] Will force compile cURL" + COMPILE_CURL="yes" + ;; + x) + echo "[opt] Doing cross-compile" + IS_CROSSCOMPILE="yes" + ;; + f) + echo "[opt] Enabling abusive optimizations..." + DO_OPTIMIZE="yes" + FAST_MATH="-fno-math-errno -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range" #workaround SQLite3 fail + CFLAGS="$CFLAGS -O2 -DSQLITE_HAVE_ISNAN $FAST_MATH -finline-functions -funsafe-loop-optimizations -fomit-frame-pointer -frename-registers -funroll-loops -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -msse2 -ftracer -mfpmath=sse -ftree-loop-im -fprefetch-loop-arrays -ftree-parallelize-loops=4" + ;; + \?) + echo "Invalid option: -$OPTION$OPTARG" >&2 + exit 1 + ;; + esac +done + +if [ "$IS_CROSSCOMPILE" == "yes" ]; then + if [ "$COMPILE_TARGET" == "android" ] || [ "$COMPILE_TARGET" == "android-armv6" ]; then COMPILE_FOR_ANDROID=yes [ -z "$march" ] && march=armv6; [ -z "$mtune" ] && mtune=arm1136jf-s; @@ -80,7 +97,8 @@ elif [ "$1" == "crosscompile" ]; then CFLAGS="-static -uclibc -Wl,-Bdynamic $CFLAGS" echo "[INFO] Cross-compiling for Android ARMv6" OPENSSL_TARGET="android" - elif [ "$2" == "android-armv7" ]; then + HAVE_MYSQLI="--without-mysqli" + elif [ "$COMPILE_TARGET" == "android-armv7" ]; then COMPILE_FOR_ANDROID=yes [ -z "$march" ] && march=armv7-a; [ -z "$mtune" ] && mtune=cortex-a8; @@ -90,7 +108,8 @@ elif [ "$1" == "crosscompile" ]; then CFLAGS="-static -uclibc -Wl,-Bdynamic $CFLAGS" echo "[INFO] Cross-compiling for Android ARMv7" OPENSSL_TARGET="android-armv7" - elif [ "$2" == "rpi" ]; then + HAVE_MYSQLI="--without-mysqli" + elif [ "$COMPILE_TARGET" == "rpi" ]; then TOOLCHAIN_PREFIX="arm-linux-gnueabihf" [ -z "$march" ] && march=armv6zk; [ -z "$mtune" ] && mtune=arm1176jzf-s; @@ -100,7 +119,7 @@ elif [ "$1" == "crosscompile" ]; then [ -z "$CFLAGS" ] && CFLAGS="-uclibc"; OPENSSL_TARGET="linux-armv4" echo "[INFO] Cross-compiling for Raspberry Pi ARMv6zk hard float" - elif [ "$2" == "mac" ]; then + elif [ "$COMPILE_TARGET" == "mac" ]; then [ -z "$march" ] && march=prescott; [ -z "$mtune" ] && mtune=generic; [ -z "$CFLAGS" ] && CFLAGS="-fomit-frame-pointer"; @@ -111,20 +130,49 @@ elif [ "$1" == "crosscompile" ]; then RANLIB=$TOOLCHAIN_PREFIX-ranlib OPENSSL_TARGET="darwin64-x86_64-cc" echo "[INFO] Cross-compiling for Intel MacOS" - elif [ "$2" == "ios" ] || [ "$2" == "ios-armv6" ]; then + elif [ "$COMPILE_TARGET" == "ios" ] || [ "$COMPILE_TARGET" == "ios-armv6" ]; then [ -z "$march" ] && march=armv6; [ -z "$mtune" ] && mtune=generic-armv6; CONFIGURE_FLAGS="--target=arm-apple-darwin10" OPENSSL_TARGET="linux-armv4" - elif [ "$2" == "ios-armv7" ]; then + HAVE_MYSQLI="--without-mysqli" + elif [ "$COMPILE_TARGET" == "ios-armv7" ]; then [ -z "$march" ] && march=armv7-a; [ -z "$mtune" ] && mtune=generic-armv7-a; CONFIGURE_FLAGS="--target=arm-apple-darwin10" OPENSSL_TARGET="linux-armv4" + HAVE_MYSQLI="--without-mysqli" else echo "Please supply a proper platform [android android-armv6 android-armv7 rpi mac ios ios-armv6 ios-armv7] to cross-compile" exit 1 fi +elif [ "$COMPILE_TARGET" == "rpi" ]; then + [ -z "$march" ] && march=armv6zk; + [ -z "$mtune" ] && mtune=arm1176jzf-s; + [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; + OPENSSL_TARGET="linux-armv4" + echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float" +elif [ "$COMPILE_TARGET" == "mac" ]; then + [ -z "$march" ] && march=prescott; + [ -z "$mtune" ] && mtune=generic; + [ -z "$CFLAGS" ] && CFLAGS="-m32 -arch i386 -fomit-frame-pointer -mmacosx-version-min=10.5"; + [ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib"; + export DYLD_LIBRARY_PATH="@loader_path/../lib" + OPENSSL_TARGET="darwin-i386-cc" + echo "[INFO] Compiling for Intel MacOS x86" +elif [ "$COMPILE_TARGET" == "mac64" ]; then + [ -z "$march" ] && march=core2; + [ -z "$mtune" ] && mtune=generic; + [ -z "$CFLAGS" ] && CFLAGS="-m64 -arch x86_64 -fomit-frame-pointer -mmacosx-version-min=10.5"; + [ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib"; + export DYLD_LIBRARY_PATH="@loader_path/../lib" + OPENSSL_TARGET="darwin64-x86_64-cc" + echo "[INFO] Compiling for Intel MacOS x86_64" +elif [ "$COMPILE_TARGET" == "ios" ]; then + [ -z "$march" ] && march=armv6; + [ -z "$mtune" ] && mtune=cortex-a8; + echo "[INFO] Compiling for iOS ARMv6" + OPENSSL_TARGET="linux-armv4" elif [ -z "$CFLAGS" ]; then if [ `getconf LONG_BIT` == "64" ]; then echo "[INFO] Compiling for current machine using 64-bit" @@ -188,7 +236,7 @@ download_file "http://php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror" | ta mv php-$PHP_VERSION php echo " done!" -if [ "$1" == "crosscompile" ] || [ "$1" == "rpi" ] || [ "$1" == "mac" ]; then +if [ "$IS_CROSSCOMPILE" == "yes" ] || [ "$COMPILE_TARGET" == "rpi" ] || [ "$COMPILE_TARGET" == "mac" ] || [ "$COMPILE_LIBEDIT" != "yes" ]; then HAVE_LIBEDIT="--without-readline --without-libedit" else #libedit @@ -234,7 +282,7 @@ cd .. rm -r -f ./zlib echo " done!" -if [ "$2" == "openssl" ] || [ "$2" == "curl" ] && [ "$1" != "crosscompile" ]; then +if [ "$COMPILE_OPENSSL" == "yes" ] || [ "$COMPILE_CURL" == "yes" ] && [ "$IS_CROSSCOMPILE" != "yes" ]; then #OpenSSL WITH_SSL="--with-ssl=$DIR/bin/php5" WITH_OPENSSL="--with-openssl=$DIR/bin/php5" @@ -273,7 +321,7 @@ else fi fi -if [ "$(uname -s)" == "Darwin" ] && [ "$1" != "crosscompile" ] && [ "$2" != "curl" ]; then +if [ "$(uname -s)" == "Darwin" ] && [ "$IS_CROSSCOMPILE" != "yes" ] && [ "$COMPILE_CURL" != "yes" ]; then HAVE_CURL="shared,/usr" else #curl @@ -354,31 +402,25 @@ rm -r -f ./yaml echo " done!" echo -n "[PHP]" -set +e -if which free >/dev/null; then - MAX_MEMORY=$(free -m | awk '/^Mem:/{print $2}') -else - MAX_MEMORY=$(top -l 1 | grep PhysMem: | awk '{print $10}' | tr -d 'a-zA-Z') -fi -if [ $MAX_MEMORY -gt 512 2>> /dev/null ] && [ "$1" != "crosscompile" ]; then + +if [ "$DO_OPTIMIZE" != "no" ]; then echo -n " enabling optimizations..." - OPTIMIZATION="--enable-inline-optimization " + PHP_OPTIMIZATION="--enable-inline-optimization " else - OPTIMIZATION="--disable-inline-optimization " + PHP_OPTIMIZATION="--disable-inline-optimization " fi -set -e echo -n " checking..." cd php rm -rf ./aclocal.m4 >> "$DIR/install.log" 2>&1 rm -rf ./autom4te.cache/ >> "$DIR/install.log" 2>&1 rm -f ./configure >> "$DIR/install.log" 2>&1 ./buildconf --force >> "$DIR/install.log" 2>&1 -if [ "$1" == "crosscompile" ]; then +if [ "$IS_CROSSCOMPILE" == "yes" ]; then sed -i 's/pthreads_working=no/pthreads_working=yes/' ./configure export LIBS="-lpthread -ldl" CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-opcache=no" fi -RANLIB=$RANLIB ./configure $OPTIMIZATION--prefix="$DIR/bin/php5" \ +RANLIB=$RANLIB ./configure $PHP_OPTIMIZATION--prefix="$DIR/bin/php5" \ --exec-prefix="$DIR/bin/php5" \ --with-curl="$HAVE_CURL" \ --with-zlib="$DIR/bin/php5" \ @@ -422,7 +464,7 @@ make -j $THREADS >> "$DIR/install.log" 2>&1 echo -n " installing..." make install >> "$DIR/install.log" 2>&1 -if [ "$(uname -s)" == "Darwin" ] && [ "$1" != "crosscompile" ]; then +if [ "$(uname -s)" == "Darwin" ] && [ "$IS_CROSSCOMPILE" != "yes" ]; then set +e install_name_tool -delete_rpath "$DIR/bin/php5/lib" "$DIR/bin/php5/bin/php" >> "$DIR/install.log" 2>&1 install_name_tool -change "$DIR/bin/php5/lib/libz.1.dylib" "@loader_path/../lib/libz.1.dylib" "$DIR/bin/php5/bin/php" >> "$DIR/install.log" 2>&1 diff --git a/src/build/jenkins.sh b/src/build/jenkins.sh index 064649b5d..18300b01a 100644 --- a/src/build/jenkins.sh +++ b/src/build/jenkins.sh @@ -32,7 +32,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/linux/32bit cd $COMPILEDIR/linux/32bit - OPENSSL_TARGET="linux-generic32" CFLAGS="-m32" march=i386 mtune=none $SCRIPT linux openssl + OPENSSL_TARGET="linux-generic32" CFLAGS="-m32" march=i686 mtune=pentium4 $SCRIPT -t linux -o -j 1 -c -f tar -czf PHP_${PHP_VERSION}_x86_Linux.tar.gz bin/ cp -r $COMPILEDIR/linux/32bit/{install.log,PHP_${PHP_VERSION}_x86_Linux.tar.gz,install_data/*} $ARCHIVE/linux/32bit/ @@ -46,7 +46,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/linux/64bit cd $COMPILEDIR/linux/64bit - OPENSSL_TARGET="linux-x86_64" CFLAGS="-m64" march=x86-64 mtune=none $SCRIPT linux openssl + OPENSSL_TARGET="linux-x86_64" CFLAGS="-m64" march=x86-64 mtune=nocona $SCRIPT -t linux -o -j 1 -c -f tar -czf PHP_${PHP_VERSION}_x86-64_Linux.tar.gz bin/ cp -r $COMPILEDIR/linux/64bit/{install.log,PHP_${PHP_VERSION}_x86-64_Linux.tar.gz,install_data/*} $ARCHIVE/linux/64bit/ @@ -69,7 +69,7 @@ then rm -rf libtool-2.4.2 export LIBTOOL="$COMPILEDIR/mac/libtool/bin/libtool" export LIBTOOLIZE="$COMPILEDIR/mac/libtool/bin/libtoolize" - $SCRIPT mac curl + $SCRIPT -t mac32 -o -j 1 -c -f tar -czf PHP_${PHP_VERSION}_x86_MacOS.tar.gz bin/ cp -r $COMPILEDIR/mac32/{install.log,PHP_${PHP_VERSION}_x86_MacOS.tar.gz,install_data/*} $ARCHIVE/mac32/ @@ -92,7 +92,7 @@ then rm -rf libtool-2.4.2 export LIBTOOL="$COMPILEDIR/mac/libtool/bin/libtool" export LIBTOOLIZE="$COMPILEDIR/mac/libtool/bin/libtoolize" - $SCRIPT mac64 curl + $SCRIPT -t mac64 -o -j 1 -c -f tar -czf PHP_${PHP_VERSION}_x86-64_MacOS.tar.gz bin/ cp -r $COMPILEDIR/mac64/{install.log,PHP_${PHP_VERSION}_x86-64_MacOS.tar.gz,install_data/*} $ARCHIVE/mac64 @@ -106,7 +106,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/rpi cd $COMPILEDIR/rpi - $SCRIPT rpi + $SCRIPT -t rpi -o -j 1 -c tar -czf PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz bin/ cp -r $COMPILEDIR/rpi/{install.log,PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz,install_data/*} $ARCHIVE/rpi/ @@ -120,7 +120,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/android-armv6 cd $COMPILEDIR/crosscompile/android-armv6 - $SCRIPT crosscompile android-armv6 + $SCRIPT -t android-armv6 -o -j 1 -c -x tar -czf PHP_${PHP_VERSION}_ARMv6_Android.tar.gz bin/ cp -r $COMPILEDIR/crosscompile/android-armv6/{install.log,PHP_${PHP_VERSION}_ARMv6_Android.tar.gz,install_data/*} $ARCHIVE/crosscompile/android-armv6/ @@ -134,7 +134,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/android-armv7 cd $COMPILEDIR/crosscompile/android-armv7 - $SCRIPT crosscompile android-armv7 + $SCRIPT -t android-armv7 -o -j 1 -c -x tar -czf PHP_${PHP_VERSION}_ARMv7_Android.tar.gz bin/ cp -r $COMPILEDIR/crosscompile/android-armv7/{install.log,PHP_${PHP_VERSION}_ARMv7_Android.tar.gz,install_data/*} $ARCHIVE/crosscompile/android-armv7/ @@ -156,7 +156,7 @@ then rm -rf libtool-2.4.2 export LIBTOOL="$COMPILEDIR/crosscompile/ios-armv6/libtool/bin/libtool" export LIBTOOLIZE="$COMPILEDIR/crosscompile/ios-armv6/libtool/bin/libtoolize" - PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" $SCRIPT crosscompile ios-armv6 + PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" $SCRIPT -t ios-armv6 -o -j 1 -c -x cp -r $COMPILEDIR/crosscompile/ios-armv6/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/ios-armv6/ if [ ! -f $COMPILEDIR/crosscompile/ios-armv6/bin/php5/bin/php ]; then @@ -177,7 +177,7 @@ then rm -rf libtool-2.4.2 export LIBTOOL="$COMPILEDIR/crosscompile/ios-armv7/libtool/bin/libtool" export LIBTOOLIZE="$COMPILEDIR/crosscompile/ios-armv7/libtool/bin/libtoolize" - PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" $SCRIPT crosscompile ios-armv7 + PATH="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH" $SCRIPT -t ios-armv6 -o -j 1 -c -x cp -r $COMPILEDIR/crosscompile/ios-armv7/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/ios-armv7/ if [ ! -f $COMPILEDIR/crosscompile/ios-armv7/bin/php5/bin/php ]; then @@ -190,7 +190,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/rpi cd $COMPILEDIR/crosscompile/rpi - $SCRIPT crosscompile rpi + $SCRIPT -t rpi -o -j 1 -c -x tar -czf PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz bin/ cp -r $COMPILEDIR/crosscompile/rpi/{install.log,PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz,install_data/*} $ARCHIVE/crosscompile/rpi/ @@ -204,7 +204,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/mac cd $COMPILEDIR/crosscompile/mac - $SCRIPT crosscompile mac curl + $SCRIPT -t mac -o -j 1 -c -f -x cp -r $COMPILEDIR/crosscompile/mac/{install.log,bin/*,install_data/*} $ARCHIVE/crosscompile/mac/ if [ ! -f $COMPILEDIR/crosscompile/mac/bin/php5/bin/php ]; then From c12c6f1f180fd35a859bc19c4f454134b1f0f77d Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 04:24:41 +0100 Subject: [PATCH 03/22] Added remaining env. vars to compile.sh --- src/build/compile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index d5e9ab734..0f1b20495 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -316,7 +316,7 @@ if [ "$COMPILE_OPENSSL" == "yes" ] || [ "$COMPILE_CURL" == "yes" ] && [ "$IS_CRO else WITH_SSL="--with-ssl" WITH_OPENSSL="--without-ssl" - if [ "$(uname -s)" == "Darwin" ] && [ "$1" != "crosscompile" ]; then + if [ "$(uname -s)" == "Darwin" ] && [ "$COMPILE_TARGET" != "crosscompile" ]; then WITH_SSL="--with-darwinssl" fi fi @@ -483,7 +483,7 @@ TIMEZONE=$(date +%Z) echo "date.timezone=$TIMEZONE" > "$DIR/bin/php5/bin/php.ini" echo "short_open_tag=0" >> "$DIR/bin/php5/bin/php.ini" echo "asp_tags=0" >> "$DIR/bin/php5/bin/php.ini" -if [ "$1" != "crosscompile" ]; then +if [ "$IS_CROSSCOMPILE" != "crosscompile" ]; then echo "zend_extension=opcache.so" >> "$DIR/bin/php5/bin/php.ini" echo "opcache.enable=1" >> "$DIR/bin/php5/bin/php.ini" echo "opcache.enable_cli=1" >> "$DIR/bin/php5/bin/php.ini" From e81f4430cb0f11f3d21f1bcf7da0e7c85b43e22e Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 04:29:47 +0100 Subject: [PATCH 04/22] Fixed mac 32-bit compilation --- src/build/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 0f1b20495..96eed6884 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -152,7 +152,7 @@ elif [ "$COMPILE_TARGET" == "rpi" ]; then [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; OPENSSL_TARGET="linux-armv4" echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float" -elif [ "$COMPILE_TARGET" == "mac" ]; then +elif [ "$COMPILE_TARGET" == "mac" ] || [ "$COMPILE_TARGET" == "mac32" ]; then [ -z "$march" ] && march=prescott; [ -z "$mtune" ] && mtune=generic; [ -z "$CFLAGS" ] && CFLAGS="-m32 -arch i386 -fomit-frame-pointer -mmacosx-version-min=10.5"; From 7ad7398f2b80fa8422af4ad7ec7b4e56d36fe41b Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 04:47:15 +0100 Subject: [PATCH 05/22] Updated PHP version to 5.5.10 --- src/build/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 96eed6884..26cf3117e 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -1,5 +1,5 @@ #!/bin/bash -PHP_VERSION="5.5.9" +PHP_VERSION="5.5.10" ZEND_VM="GOTO" ZLIB_VERSION="1.2.8" From 73b78e14556a29679d4bacceb1dccead2aec8ff5 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 04:49:26 +0100 Subject: [PATCH 06/22] Updated helper scripts PHP version to 5.5.10 --- src/build/installer.sh | 8 ++++---- src/build/jenkins.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/build/installer.sh b/src/build/installer.sh index 1bf0a9804..f9140003f 100644 --- a/src/build/installer.sh +++ b/src/build/installer.sh @@ -1,9 +1,9 @@ #!/bin/bash PMMP_VERSION="" -LINUX_32_BUILD="PHP_5.5.9_x86_Linux" -LINUX_64_BUILD="PHP_5.5.9_x86-64_Linux" -MAC_32_BUILD="PHP_5.5.9_x86_MacOS" -MAC_64_BUILD="PHP_5.5.9_x86-64_MacOS" +LINUX_32_BUILD="PHP_5.5.10_x86_Linux" +LINUX_64_BUILD="PHP_5.5.10_x86-64_Linux" +MAC_32_BUILD="PHP_5.5.10_x86_MacOS" +MAC_64_BUILD="PHP_5.5.10_x86-64_MacOS" RPI_BUILD="PHP_5.5.9_ARM_Raspbian_hard" # Temporal build ODROID_BUILD="PHP_5.5.9_ARM_Raspbian_hard" diff --git a/src/build/jenkins.sh b/src/build/jenkins.sh index 18300b01a..47c893383 100644 --- a/src/build/jenkins.sh +++ b/src/build/jenkins.sh @@ -1,7 +1,7 @@ #!/bin/bash -x export PATH="/opt/arm-2013.05/bin:/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:/opt/arm-unknown-linux-uclibcgnueabi/bin:$PATH" export THREADS=2 -PHP_VERSION="5.5.9" +PHP_VERSION="5.5.10" #Needed to use aliases shopt -s expand_aliases From ee51f75c78cf145dfc1a350120ead2853d73e234 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 05:15:01 +0100 Subject: [PATCH 07/22] Fixed issues with zlib --- src/build/compile.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 26cf3117e..335189fd7 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -295,10 +295,12 @@ if [ "$COMPILE_OPENSSL" == "yes" ] || [ "$COMPILE_CURL" == "yes" ] && [ "$IS_CRO $OPENSSL_TARGET \ --prefix="$DIR/bin/php5" \ --openssldir="$DIR/bin/php5" \ + zlib \ + zlib-dynamic \ --with-zlib-lib="$DIR/bin/php5/lib" \ --with-zlib-include="$DIR/bin/php5/include" \ - zlib-dynamic \ shared \ + no-ssl2 \ no-asm \ no-hw \ no-engines \ From 052f6417154e25a673e4d8943b6f9c5659e82735 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 06:29:35 +0100 Subject: [PATCH 08/22] Fixed levels not being read properly --- src/pmf/PMFLevel.php | 2 +- src/world/LevelImport.php | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index 08187737a..812c82a49 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -179,7 +179,7 @@ class PMFLevel extends PMF{ } private function getChunkPath($X, $Z){ - return dirname($this->file)."/chunks/".(($X ^ $Z) & 0xff)."/".$Z.".".$X.".pmc"; + return dirname($this->file)."/chunks/".(((int) $X ^ (int) $Z) & 0xff)."/".$Z.".".$X.".pmc"; } public function generateChunk($X, $Z){ diff --git a/src/world/LevelImport.php b/src/world/LevelImport.php index aad449491..a2c1ecb7a 100644 --- a/src/world/LevelImport.php +++ b/src/world/LevelImport.php @@ -58,12 +58,12 @@ class LevelImport{ } $pmf = new PMFLevel($this->path."level.pmf", array( - "name" => $level["LevelName"], - "seed" => $level["RandomSeed"], - "time" => $level["Time"], - "spawnX" => $level["SpawnX"], - "spawnY" => $level["SpawnY"], - "spawnZ" => $level["SpawnZ"], + "name" => $level->LevelName, + "seed" => $level->RandomSeed, + "time" => $level->Time, + "spawnX" => $level->SpawnX, + "spawnY" => $level->SpawnY, + "spawnZ" => $level->SpawnZ, "height" => 8, "generator" => "NormalGenerator", "generatorSettings" => "", @@ -84,6 +84,7 @@ class LevelImport{ 6 => "", 7 => "" ); + for($z = 0; $z < 16; ++$z){ for($x = 0; $x < 16; ++$x){ $block = $chunks->getChunkColumn($X, $Z, $x, $z, 0); @@ -95,6 +96,8 @@ class LevelImport{ } } } + + $pmf->initCleanChunk($X, $Z); foreach($chunk as $Y => $data){ $pmf->setMiniChunk($X, $Z, $Y, $data); } @@ -103,6 +106,7 @@ class LevelImport{ } console("[NOTICE] Importing level ".ceil(($Z + 1)/0.16)."%"); } + $pmf->saveData(); $chunks->map = null; $chunks = null; @unlink($this->path."level.dat"); From 8bfd22c9ac066f92c3b96dee557175326dea9016 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 13:34:31 +0100 Subject: [PATCH 09/22] Added arch-specific compile optimizations --- src/build/compile.sh | 9 +++++++-- src/build/jenkins.sh | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 335189fd7..5ae305ddf 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -47,7 +47,7 @@ COMPILE_CURL="default" COMPILE_LIBEDIT="no" IS_CROSSCOMPILE="no" DO_OPTIMIZE="no" -while getopts "t:oj:cxf" OPTION; do +while getopts "t:oj:cxf::" OPTION; do case $OPTION in t) echo "[opt] Set target to $OPTARG" @@ -77,7 +77,12 @@ while getopts "t:oj:cxf" OPTION; do echo "[opt] Enabling abusive optimizations..." DO_OPTIMIZE="yes" FAST_MATH="-fno-math-errno -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range" #workaround SQLite3 fail - CFLAGS="$CFLAGS -O2 -DSQLITE_HAVE_ISNAN $FAST_MATH -finline-functions -funsafe-loop-optimizations -fomit-frame-pointer -frename-registers -funroll-loops -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -msse2 -ftracer -mfpmath=sse -ftree-loop-im -fprefetch-loop-arrays -ftree-parallelize-loops=4" + CFLAGS="$CFLAGS -O2 -DSQLITE_HAVE_ISNAN $FAST_MATH -finline-functions -funsafe-loop-optimizations -fomit-frame-pointer -frename-registers -funroll-loops -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -ftracer -ftree-loop-im -fprefetch-loop-arrays -ftree-parallelize-loops=4" + if [ "$OPTARG" == "arm" ]; then + CFLAGS="$CFLAGS -mfloat-abi=softfp -mfpu=vfp -fomit-frame-pointer" + else + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" + fi ;; \?) echo "Invalid option: -$OPTION$OPTARG" >&2 diff --git a/src/build/jenkins.sh b/src/build/jenkins.sh index 47c893383..458c8c066 100644 --- a/src/build/jenkins.sh +++ b/src/build/jenkins.sh @@ -21,11 +21,11 @@ rm -rf $WORKSPACE/compile.sh download_file "https://github.com/PocketMine/PocketMine-MP/raw/master/src/build/compile.sh" > $WORKSPACE/compile.sh chmod +x $WORKSPACE/compile.sh SCRIPT="$WORKSPACE/compile.sh" -ARCHIVE=$WORKSPACE/archive -COMPILEDIR=$WORKSPACE/compile -rm -rf $ARCHIVE $COMPILEDIR -mkdir -p $ARCHIVE -mkdir -p $COMPILEDIR +ARCHIVE="$WORKSPACE/archive" +COMPILEDIR="$WORKSPACE/compile" +rm -rf "$ARCHIVE" "$COMPILEDIR" +mkdir -p "$ARCHIVE" +mkdir -p "$COMPILEDIR" if [ "$COMPILE_LINUX_32BIT" = "true" ]; then @@ -106,7 +106,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/rpi cd $COMPILEDIR/rpi - $SCRIPT -t rpi -o -j 1 -c + $SCRIPT -t rpi -o -j 1 -c -f arm tar -czf PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz bin/ cp -r $COMPILEDIR/rpi/{install.log,PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz,install_data/*} $ARCHIVE/rpi/ @@ -120,7 +120,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/android-armv6 cd $COMPILEDIR/crosscompile/android-armv6 - $SCRIPT -t android-armv6 -o -j 1 -c -x + $SCRIPT -t android-armv6 -o -j 1 -c -x -f arm tar -czf PHP_${PHP_VERSION}_ARMv6_Android.tar.gz bin/ cp -r $COMPILEDIR/crosscompile/android-armv6/{install.log,PHP_${PHP_VERSION}_ARMv6_Android.tar.gz,install_data/*} $ARCHIVE/crosscompile/android-armv6/ @@ -134,7 +134,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/android-armv7 cd $COMPILEDIR/crosscompile/android-armv7 - $SCRIPT -t android-armv7 -o -j 1 -c -x + $SCRIPT -t android-armv7 -o -j 1 -c -x -f arm tar -czf PHP_${PHP_VERSION}_ARMv7_Android.tar.gz bin/ cp -r $COMPILEDIR/crosscompile/android-armv7/{install.log,PHP_${PHP_VERSION}_ARMv7_Android.tar.gz,install_data/*} $ARCHIVE/crosscompile/android-armv7/ @@ -190,8 +190,8 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/crosscompile/rpi cd $COMPILEDIR/crosscompile/rpi - $SCRIPT -t rpi -o -j 1 -c -x - + $SCRIPT -t rpi -o -j 1 -c -x -f arm + tar -czf PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz bin/ cp -r $COMPILEDIR/crosscompile/rpi/{install.log,PHP_${PHP_VERSION}_ARM_Raspbian_hard.tar.gz,install_data/*} $ARCHIVE/crosscompile/rpi/ if [ ! -f $COMPILEDIR/crosscompile/rpi/bin/php5/bin/php ]; then From c7854a3417dff58f8986dd33c9c912396e49ad64 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 15:33:32 +0100 Subject: [PATCH 10/22] Added arm flags --- src/build/compile.sh | 16 +++++++++------- src/build/jenkins.sh | 8 ++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 5ae305ddf..16bec4ef7 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -76,12 +76,14 @@ while getopts "t:oj:cxf::" OPTION; do f) echo "[opt] Enabling abusive optimizations..." DO_OPTIMIZE="yes" - FAST_MATH="-fno-math-errno -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range" #workaround SQLite3 fail - CFLAGS="$CFLAGS -O2 -DSQLITE_HAVE_ISNAN $FAST_MATH -finline-functions -funsafe-loop-optimizations -fomit-frame-pointer -frename-registers -funroll-loops -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -ftracer -ftree-loop-im -fprefetch-loop-arrays -ftree-parallelize-loops=4" + ffast_math="-fno-math-errno -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range" #workaround SQLite3 fail + CFLAGS="$CFLAGS -O2 -DSQLITE_HAVE_ISNAN $ffast_math -fno-signed-zeros -finline-functions -funsafe-loop-optimizations -fomit-frame-pointer -frename-registers -funroll-loops -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -ftracer -ftree-loop-im -fprefetch-loop-arrays -ftree-parallelize-loops=4 -fomit-frame-pointer" if [ "$OPTARG" == "arm" ]; then - CFLAGS="$CFLAGS -mfloat-abi=softfp -mfpu=vfp -fomit-frame-pointer" - else - CFLAGS="$CFLAGS -msse2 -mfpmath=sse" + CFLAGS="$CFLAGS -mfloat-abi=softfp -mfpu=vfp" + elif [ "$OPTARG" == "x86_64" ]; then + CFLAGS="$CFLAGS -mmx -msse -msse2 -msse3 -mfpmath=sse -free -msahf" + elif [ "$OPTARG" == "x86" ]; then + CFLAGS="$CFLAGS -mmx -msse -msse2 -mfpmath=sse -m128bit-long-double -malign-double" fi ;; \?) @@ -137,13 +139,13 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then echo "[INFO] Cross-compiling for Intel MacOS" elif [ "$COMPILE_TARGET" == "ios" ] || [ "$COMPILE_TARGET" == "ios-armv6" ]; then [ -z "$march" ] && march=armv6; - [ -z "$mtune" ] && mtune=generic-armv6; + [ -z "$mtune" ] && mtune=arm1176jzf-s; CONFIGURE_FLAGS="--target=arm-apple-darwin10" OPENSSL_TARGET="linux-armv4" HAVE_MYSQLI="--without-mysqli" elif [ "$COMPILE_TARGET" == "ios-armv7" ]; then [ -z "$march" ] && march=armv7-a; - [ -z "$mtune" ] && mtune=generic-armv7-a; + [ -z "$mtune" ] && mtune=cortex-a8; CONFIGURE_FLAGS="--target=arm-apple-darwin10" OPENSSL_TARGET="linux-armv4" HAVE_MYSQLI="--without-mysqli" diff --git a/src/build/jenkins.sh b/src/build/jenkins.sh index 458c8c066..1e17307d4 100644 --- a/src/build/jenkins.sh +++ b/src/build/jenkins.sh @@ -32,7 +32,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/linux/32bit cd $COMPILEDIR/linux/32bit - OPENSSL_TARGET="linux-generic32" CFLAGS="-m32" march=i686 mtune=pentium4 $SCRIPT -t linux -o -j 1 -c -f + OPENSSL_TARGET="linux-generic32" CFLAGS="-m32" march=i686 mtune=pentium4 $SCRIPT -t linux -o -j 1 -c -f x86 tar -czf PHP_${PHP_VERSION}_x86_Linux.tar.gz bin/ cp -r $COMPILEDIR/linux/32bit/{install.log,PHP_${PHP_VERSION}_x86_Linux.tar.gz,install_data/*} $ARCHIVE/linux/32bit/ @@ -46,7 +46,7 @@ then mkdir -p {$COMPILEDIR,$ARCHIVE}/linux/64bit cd $COMPILEDIR/linux/64bit - OPENSSL_TARGET="linux-x86_64" CFLAGS="-m64" march=x86-64 mtune=nocona $SCRIPT -t linux -o -j 1 -c -f + OPENSSL_TARGET="linux-x86_64" CFLAGS="-m64" march=x86-64 mtune=nocona $SCRIPT -t linux -o -j 1 -c -f x86_64 tar -czf PHP_${PHP_VERSION}_x86-64_Linux.tar.gz bin/ cp -r $COMPILEDIR/linux/64bit/{install.log,PHP_${PHP_VERSION}_x86-64_Linux.tar.gz,install_data/*} $ARCHIVE/linux/64bit/ @@ -69,7 +69,7 @@ then rm -rf libtool-2.4.2 export LIBTOOL="$COMPILEDIR/mac/libtool/bin/libtool" export LIBTOOLIZE="$COMPILEDIR/mac/libtool/bin/libtoolize" - $SCRIPT -t mac32 -o -j 1 -c -f + $SCRIPT -t mac32 -o -j 1 -c -f x86 tar -czf PHP_${PHP_VERSION}_x86_MacOS.tar.gz bin/ cp -r $COMPILEDIR/mac32/{install.log,PHP_${PHP_VERSION}_x86_MacOS.tar.gz,install_data/*} $ARCHIVE/mac32/ @@ -92,7 +92,7 @@ then rm -rf libtool-2.4.2 export LIBTOOL="$COMPILEDIR/mac/libtool/bin/libtool" export LIBTOOLIZE="$COMPILEDIR/mac/libtool/bin/libtoolize" - $SCRIPT -t mac64 -o -j 1 -c -f + $SCRIPT -t mac64 -o -j 1 -c -f x86_64 tar -czf PHP_${PHP_VERSION}_x86-64_MacOS.tar.gz bin/ cp -r $COMPILEDIR/mac64/{install.log,PHP_${PHP_VERSION}_x86-64_MacOS.tar.gz,install_data/*} $ARCHIVE/mac64 From 604f0681124256e06f4e97ab7e8f9cf097f9460a Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 15:41:08 +0100 Subject: [PATCH 11/22] Added iOS flags --- src/build/compile.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 16bec4ef7..2ced2d516 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -3,7 +3,7 @@ PHP_VERSION="5.5.10" ZEND_VM="GOTO" ZLIB_VERSION="1.2.8" -OPENSSL_VERSION="0.9.8y" +OPENSSL_VERSION="1.0.0l" CURL_VERSION="curl-7_35_0" LIBEDIT_VERSION="0.3" PTHREADS_VERSION="0.1.0" @@ -140,14 +140,14 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then elif [ "$COMPILE_TARGET" == "ios" ] || [ "$COMPILE_TARGET" == "ios-armv6" ]; then [ -z "$march" ] && march=armv6; [ -z "$mtune" ] && mtune=arm1176jzf-s; - CONFIGURE_FLAGS="--target=arm-apple-darwin10" - OPENSSL_TARGET="linux-armv4" + CONFIGURE_FLAGS="--target=arm-apple-darwin10 -arch=armv6 -miphoneos-version-min=4.2" + OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" elif [ "$COMPILE_TARGET" == "ios-armv7" ]; then [ -z "$march" ] && march=armv7-a; [ -z "$mtune" ] && mtune=cortex-a8; - CONFIGURE_FLAGS="--target=arm-apple-darwin10" - OPENSSL_TARGET="linux-armv4" + CONFIGURE_FLAGS="--target=arm-apple-darwin10 -arch=armv7-a -miphoneos-version-min=4.2" + OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" else echo "Please supply a proper platform [android android-armv6 android-armv7 rpi mac ios ios-armv6 ios-armv7] to cross-compile" From bfe746235f35b581b4aa03b8ec5c56687dbef2bf Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 16:20:17 +0100 Subject: [PATCH 12/22] Removed iOS -arch --- src/build/compile.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 2ced2d516..8bc79c34a 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -140,13 +140,13 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then elif [ "$COMPILE_TARGET" == "ios" ] || [ "$COMPILE_TARGET" == "ios-armv6" ]; then [ -z "$march" ] && march=armv6; [ -z "$mtune" ] && mtune=arm1176jzf-s; - CONFIGURE_FLAGS="--target=arm-apple-darwin10 -arch=armv6 -miphoneos-version-min=4.2" + CONFIGURE_FLAGS="--target=arm-apple-darwin10 -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" elif [ "$COMPILE_TARGET" == "ios-armv7" ]; then [ -z "$march" ] && march=armv7-a; [ -z "$mtune" ] && mtune=cortex-a8; - CONFIGURE_FLAGS="--target=arm-apple-darwin10 -arch=armv7-a -miphoneos-version-min=4.2" + CONFIGURE_FLAGS="--target=arm-apple-darwin10 -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" else @@ -176,9 +176,9 @@ elif [ "$COMPILE_TARGET" == "mac64" ]; then OPENSSL_TARGET="darwin64-x86_64-cc" echo "[INFO] Compiling for Intel MacOS x86_64" elif [ "$COMPILE_TARGET" == "ios" ]; then - [ -z "$march" ] && march=armv6; + [ -z "$march" ] && march=armv7-a; [ -z "$mtune" ] && mtune=cortex-a8; - echo "[INFO] Compiling for iOS ARMv6" + echo "[INFO] Compiling for iOS ARMv7" OPENSSL_TARGET="linux-armv4" elif [ -z "$CFLAGS" ]; then if [ `getconf LONG_BIT` == "64" ]; then @@ -289,7 +289,7 @@ cd .. rm -r -f ./zlib echo " done!" -if [ "$COMPILE_OPENSSL" == "yes" ] || [ "$COMPILE_CURL" == "yes" ] && [ "$IS_CROSSCOMPILE" != "yes" ]; then +if [ "$COMPILE_OPENSSL" == "yes" ] || [ "$COMPILE_CURL" != "no" ] && [ "$IS_CROSSCOMPILE" != "yes" ]; then #OpenSSL WITH_SSL="--with-ssl=$DIR/bin/php5" WITH_OPENSSL="--with-openssl=$DIR/bin/php5" From 2916b0f04997d5fdce825ea935a045b66c1a5700 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 16:22:16 +0100 Subject: [PATCH 13/22] Added Phar extension to PHP --- src/build/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 8bc79c34a..e9de8a487 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -444,11 +444,11 @@ $HAVE_LIBEDIT \ --disable-cgi \ --disable-session \ --disable-debug \ ---disable-phar \ --disable-pdo \ --without-pear \ --without-iconv \ --without-pdo-sqlite \ +--enable-phar \ --enable-ctype \ --enable-sockets \ --enable-shared=no \ From 4a2dea4e45d5ee21d24cae32d76b48abf0240c6b Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 16:25:40 +0100 Subject: [PATCH 14/22] Added correct toolchain for iOS --- src/build/compile.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index e9de8a487..bcf7a576b 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -140,13 +140,17 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then elif [ "$COMPILE_TARGET" == "ios" ] || [ "$COMPILE_TARGET" == "ios-armv6" ]; then [ -z "$march" ] && march=armv6; [ -z "$mtune" ] && mtune=arm1176jzf-s; - CONFIGURE_FLAGS="--target=arm-apple-darwin10 -miphoneos-version-min=4.2" + TOOLCHAIN_PREFIX="arm-apple-darwin10" + export CC="$TOOLCHAIN_PREFIX-gcc" + CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=arm-apple-darwin10 -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" elif [ "$COMPILE_TARGET" == "ios-armv7" ]; then [ -z "$march" ] && march=armv7-a; [ -z "$mtune" ] && mtune=cortex-a8; - CONFIGURE_FLAGS="--target=arm-apple-darwin10 -miphoneos-version-min=4.2" + TOOLCHAIN_PREFIX="arm-apple-darwin10" + export CC="$TOOLCHAIN_PREFIX-gcc" + CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=arm-apple-darwin10 -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" else From 971e18d9b0f8644289576943e2add64ba0beb1b8 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 16:33:29 +0100 Subject: [PATCH 15/22] Added php.ini Phar directives --- src/build/compile.sh | 6 ++++-- src/build/installer.sh | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index bcf7a576b..c77ac12cd 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -142,7 +142,7 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then [ -z "$mtune" ] && mtune=arm1176jzf-s; TOOLCHAIN_PREFIX="arm-apple-darwin10" export CC="$TOOLCHAIN_PREFIX-gcc" - CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=arm-apple-darwin10 -miphoneos-version-min=4.2" + CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=$TOOLCHAIN_PREFIX -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" elif [ "$COMPILE_TARGET" == "ios-armv7" ]; then @@ -150,7 +150,7 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then [ -z "$mtune" ] && mtune=cortex-a8; TOOLCHAIN_PREFIX="arm-apple-darwin10" export CC="$TOOLCHAIN_PREFIX-gcc" - CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=arm-apple-darwin10 -miphoneos-version-min=4.2" + CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=$TOOLCHAIN_PREFIX -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" else @@ -496,6 +496,8 @@ TIMEZONE=$(date +%Z) echo "date.timezone=$TIMEZONE" > "$DIR/bin/php5/bin/php.ini" echo "short_open_tag=0" >> "$DIR/bin/php5/bin/php.ini" echo "asp_tags=0" >> "$DIR/bin/php5/bin/php.ini" +echo "phar.readonly=0" >> "$DIR/bin/php5/bin/php.ini" +echo "phar.require_hash=1" >> "$DIR/bin/php5/bin/php.ini" if [ "$IS_CROSSCOMPILE" != "crosscompile" ]; then echo "zend_extension=opcache.so" >> "$DIR/bin/php5/bin/php.ini" echo "opcache.enable=1" >> "$DIR/bin/php5/bin/php.ini" diff --git a/src/build/installer.sh b/src/build/installer.sh index f9140003f..3a27e9261 100644 --- a/src/build/installer.sh +++ b/src/build/installer.sh @@ -95,6 +95,8 @@ else echo "date.timezone=$TIMEZONE" >> "./bin/php5/bin/php.ini" echo "short_open_tag=0" >> "./bin/php5/bin/php.ini" echo "asp_tags=0" >> "./bin/php5/bin/php.ini" + echo "phar.readonly=0" >> "./bin/php5/bin/php.ini" + echo "phar.require_hash=1" >> "./bin/php5/bin/php.ini" echo " done" alldone=yes else @@ -127,6 +129,8 @@ else echo "date.timezone=$TIMEZONE" >> "./bin/php5/bin/php.ini" echo "short_open_tag=0" >> "./bin/php5/bin/php.ini" echo "asp_tags=0" >> "./bin/php5/bin/php.ini" + echo "phar.readonly=0" >> "./bin/php5/bin/php.ini" + echo "phar.require_hash=1" >> "./bin/php5/bin/php.ini" echo " done" alldone=yes else @@ -159,6 +163,8 @@ else echo "date.timezone=$TIMEZONE" >> "./bin/php5/bin/php.ini" echo "short_open_tag=0" >> "./bin/php5/bin/php.ini" echo "asp_tags=0" >> "./bin/php5/bin/php.ini" + echo "phar.readonly=0" >> "./bin/php5/bin/php.ini" + echo "phar.require_hash=1" >> "./bin/php5/bin/php.ini" echo " done" alldone=yes else @@ -185,6 +191,8 @@ else echo "date.timezone=$TIMEZONE" >> "./bin/php5/bin/php.ini" echo "short_open_tag=0" >> "./bin/php5/bin/php.ini" echo "asp_tags=0" >> "./bin/php5/bin/php.ini" + echo "phar.readonly=0" >> "./bin/php5/bin/php.ini" + echo "phar.require_hash=1" >> "./bin/php5/bin/php.ini" echo " done" alldone=yes else @@ -217,6 +225,8 @@ else echo "date.timezone=$TIMEZONE" >> "./bin/php5/bin/php.ini" echo "short_open_tag=0" >> "./bin/php5/bin/php.ini" echo "asp_tags=0" >> "./bin/php5/bin/php.ini" + echo "phar.readonly=0" >> "./bin/php5/bin/php.ini" + echo "phar.require_hash=1" >> "./bin/php5/bin/php.ini" echo " done" alldone=yes else From 612cf98a08ac50ec3a2b654d2d4695db004435c4 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 16:42:18 +0100 Subject: [PATCH 16/22] typo fix --- src/build/installer.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/build/installer.sh b/src/build/installer.sh index 3a27e9261..873a436f9 100644 --- a/src/build/installer.sh +++ b/src/build/installer.sh @@ -74,7 +74,7 @@ rm -f -r PocketMine-MP-$PMMP_VERSION/ rm -f ./start.cmd chmod +x ./start.sh chmod +x ./src/build/compile.sh -if [ $update == on ]; then +if [ "$update" == "on" ]; then echo "[3/3] Skipping PHP recompilation due to user request" else echo -n "[3/3] Obtaining PHP:" @@ -84,7 +84,7 @@ else UNAME_M=$(uname -m) IS_IOS=$(expr match $UNAME_M 'iP[a-zA-Z0-9,]*' 2> /dev/null) set -e - if [[ $IS_IOS -gt 0 ]]; then + if [[ "$IS_IOS" -gt 0 ]]; then rm -r -f bin/ >> /dev/null 2>&1 echo -n "[3/3] iOS PHP build available, downloading $IOS_BUILD.tar.gz..." download_file "http://sourceforge.net/projects/pocketmine/files/builds/$IOS_BUILD.tar.gz" | tar -zx > /dev/null 2>&1 @@ -92,6 +92,7 @@ else echo -n " checking..." if [ $(./bin/php5/bin/php -r 'echo "yes";' 2>/dev/null) == "yes" ]; then echo -n " regenerating php.ini..." + TIMEZONE=$(date +%Z) echo "date.timezone=$TIMEZONE" >> "./bin/php5/bin/php.ini" echo "short_open_tag=0" >> "./bin/php5/bin/php.ini" echo "asp_tags=0" >> "./bin/php5/bin/php.ini" @@ -106,16 +107,17 @@ else rm -r -f bin/ >> /dev/null 2>&1 if [ `getconf LONG_BIT` == "64" ]; then echo -n "[3/3] MacOS 64-bit PHP build available, downloading $MAC_64_BUILD.tar.gz..." - MAC_BUILD=$MAC_64_BUILD + MAC_BUILD="$MAC_64_BUILD" else echo -n "[3/3] MacOS 32-bit PHP build available, downloading $MAC_32_BUILD.tar.gz..." - MAC_BUILD=$MAC_32_BUILD + MAC_BUILD="$MAC_32_BUILD" fi download_file "http://sourceforge.net/projects/pocketmine/files/builds/$MAC_BUILD.tar.gz" | tar -zx > /dev/null 2>&1 chmod +x ./bin/php5/bin/* echo -n " checking..." if [ $(./bin/php5/bin/php -r 'echo "yes";' 2>/dev/null) == "yes" ]; then echo -n " regenerating php.ini..." + TIMEZONE=$(date +%Z) OPCACHE_PATH="$(find $(pwd) -name opcache.so)" echo "zend_extension=\"$OPCACHE_PATH\"" > "./bin/php5/bin/php.ini" echo "opcache.enable=1" >> "./bin/php5/bin/php.ini" @@ -142,7 +144,7 @@ else IS_RPI=$? grep -q ODROID /proc/cpuinfo > /dev/null 2>&1 IS_ODROID=$? - if [ $IS_RPI -eq 0 ] && [ "$forcecompile" == "off" ]; then + if [ "$IS_RPI" -eq 0 ] && [ "$forcecompile" == "off" ]; then rm -r -f bin/ >> /dev/null 2>&1 echo -n "[3/3] Raspberry Pi PHP build available, downloading $RPI_BUILD.tar.gz..." download_file "http://sourceforge.net/projects/pocketmine/files/builds/$RPI_BUILD.tar.gz" | tar -zx > /dev/null 2>&1 @@ -150,6 +152,7 @@ else echo -n " checking..." if [ $(./bin/php5/bin/php -r 'echo "yes";' 2>/dev/null) == "yes" ]; then echo -n " regenerating php.ini..." + TIMEZONE=$(date +%Z) OPCACHE_PATH="$(find $(pwd) -name opcache.so)" echo "zend_extension=\"$OPCACHE_PATH\"" > "./bin/php5/bin/php.ini" echo "opcache.enable=1" >> "./bin/php5/bin/php.ini" @@ -170,7 +173,7 @@ else else echo " invalid build detected" fi - elif [ $IS_ODROID -eq 0 ] && [ "$forcecompile" == "off" ]; then + elif [ "$IS_ODROID" -eq 0 ] && [ "$forcecompile" == "off" ]; then rm -r -f bin/ >> /dev/null 2>&1 echo -n "[3/3] ODROID PHP build available, downloading $ODROID_BUILD.tar.gz..." download_file "http://sourceforge.net/projects/pocketmine/files/builds/$ODROID_BUILD.tar.gz" | tar -zx > /dev/null 2>&1 @@ -202,10 +205,10 @@ else rm -r -f bin/ >> /dev/null 2>&1 if [ `getconf LONG_BIT` = "64" ]; then echo -n "[3/3] Linux 64-bit PHP build available, downloading $LINUX_64_BUILD.tar.gz..." - LINUX_BUILD=$LINUX_64_BUILD + LINUX_BUILD="$LINUX_64_BUILD" else echo -n "[3/3] Linux 32-bit PHP build available, downloading $LINUX_32_BUILD.tar.gz..." - LINUX_BUILD=$LINUX_32_BUILD + LINUX_BUILD="$LINUX_32_BUILD" fi download_file "http://sourceforge.net/projects/pocketmine/files/builds/$LINUX_BUILD.tar.gz" | tar -zx > /dev/null 2>&1 chmod +x ./bin/php5/bin/* From 8c02555a8d8f51227724d1dc1325a4fc8c0a0a88 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 17:02:05 +0100 Subject: [PATCH 17/22] Added sed -i ".backup" --- src/build/compile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index c77ac12cd..ce6029df2 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -429,7 +429,7 @@ rm -rf ./autom4te.cache/ >> "$DIR/install.log" 2>&1 rm -f ./configure >> "$DIR/install.log" 2>&1 ./buildconf --force >> "$DIR/install.log" 2>&1 if [ "$IS_CROSSCOMPILE" == "yes" ]; then - sed -i 's/pthreads_working=no/pthreads_working=yes/' ./configure + sed -i ".backup" 's/pthreads_working=no/pthreads_working=yes/' ./configure export LIBS="-lpthread -ldl" CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-opcache=no" fi @@ -471,7 +471,7 @@ $HAVE_MYSQLI \ $CONFIGURE_FLAGS >> "$DIR/install.log" 2>&1 echo -n " compiling..." if [ $COMPILE_FOR_ANDROID == "yes" ]; then - sed -i 's/-export-dynamic/-all-static/g' Makefile + sed -i ".backup" 's/-export-dynamic/-all-static/g' Makefile fi make -j $THREADS >> "$DIR/install.log" 2>&1 echo -n " installing..." From a74f5809c7343f09257204795efd7db3347725b6 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 17:38:36 +0100 Subject: [PATCH 18/22] Added -lresolv --- src/build/compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index ce6029df2..862b80d64 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -430,7 +430,7 @@ rm -f ./configure >> "$DIR/install.log" 2>&1 ./buildconf --force >> "$DIR/install.log" 2>&1 if [ "$IS_CROSSCOMPILE" == "yes" ]; then sed -i ".backup" 's/pthreads_working=no/pthreads_working=yes/' ./configure - export LIBS="-lpthread -ldl" + export LIBS="-lpthread -ldl -lresolv" CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-opcache=no" fi RANLIB=$RANLIB ./configure $PHP_OPTIMIZATION--prefix="$DIR/bin/php5" \ From 47ad8b6fac21d27a8136200c38e6bd6905cc1e55 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 18:26:12 +0100 Subject: [PATCH 19/22] Added PHP_VAR_NAME to crosscompile --- src/build/compile.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/build/compile.sh b/src/build/compile.sh index 862b80d64..0eb484f95 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -94,6 +94,8 @@ while getopts "t:oj:cxf::" OPTION; do done if [ "$IS_CROSSCOMPILE" == "yes" ]; then + export PHP_VAR_NAME="php" + export php_var_name="php" if [ "$COMPILE_TARGET" == "android" ] || [ "$COMPILE_TARGET" == "android-armv6" ]; then COMPILE_FOR_ANDROID=yes [ -z "$march" ] && march=armv6; From 5ad511cd113562bcb05e12ed4f3b62a987b7610c Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 19:12:06 +0100 Subject: [PATCH 20/22] Disabled phar cmdtools generation on crosscompile --- src/build/compile.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 0eb484f95..c501020d0 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -94,8 +94,6 @@ while getopts "t:oj:cxf::" OPTION; do done if [ "$IS_CROSSCOMPILE" == "yes" ]; then - export PHP_VAR_NAME="php" - export php_var_name="php" if [ "$COMPILE_TARGET" == "android" ] || [ "$COMPILE_TARGET" == "android-armv6" ]; then COMPILE_FOR_ANDROID=yes [ -z "$march" ] && march=armv6; @@ -431,7 +429,7 @@ rm -rf ./autom4te.cache/ >> "$DIR/install.log" 2>&1 rm -f ./configure >> "$DIR/install.log" 2>&1 ./buildconf --force >> "$DIR/install.log" 2>&1 if [ "$IS_CROSSCOMPILE" == "yes" ]; then - sed -i ".backup" 's/pthreads_working=no/pthreads_working=yes/' ./configure + sed -i=".backup" 's/pthreads_working=no/pthreads_working=yes/' ./configure export LIBS="-lpthread -ldl -lresolv" CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-opcache=no" fi @@ -472,8 +470,12 @@ $HAVE_MYSQLI \ --with-zend-vm=$ZEND_VM \ $CONFIGURE_FLAGS >> "$DIR/install.log" 2>&1 echo -n " compiling..." -if [ $COMPILE_FOR_ANDROID == "yes" ]; then - sed -i ".backup" 's/-export-dynamic/-all-static/g' Makefile +if [ "$COMPILE_FOR_ANDROID" == "yes" ]; then + sed -i=".backup" 's/-export-dynamic/-all-static/g' Makefile +fi +if [ "$IS_CROSSCOMPILE" == "yes" ]; then + sed -i=".backup" 's/PHP_BINARIES. pharcmd$/PHP_BINARIES)/g' Makefile + sed -i=".backup" 's/install-programs install-pharcmd$/install-programs/g' Makefile fi make -j $THREADS >> "$DIR/install.log" 2>&1 echo -n " installing..." From e246e10a82fb347fbd3661c8c9ae4ddd92a5d8ad Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 20:04:18 +0100 Subject: [PATCH 21/22] Added NEON optimizations to iOS --- src/build/compile.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/build/compile.sh b/src/build/compile.sh index c501020d0..15f83afaf 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -153,6 +153,9 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX --target=$TOOLCHAIN_PREFIX -miphoneos-version-min=4.2" OPENSSL_TARGET="BSD-generic32" HAVE_MYSQLI="--without-mysqli" + if [ "$DO_OPTIMIZE" == "yes" ]; then + CFLAGS="$CFLAGS -mfpu=neon" + fi else echo "Please supply a proper platform [android android-armv6 android-armv7 rpi mac ios ios-armv6 ios-armv7] to cross-compile" exit 1 From a817234aa8a8f289eaf99b202e61a484e3f0a0aa Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Mar 2014 23:29:28 +0100 Subject: [PATCH 22/22] Do not generate Phar utilities by default, only generate extension --- src/build/compile.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/build/compile.sh b/src/build/compile.sh index 15f83afaf..c7eb54f08 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -51,11 +51,11 @@ while getopts "t:oj:cxf::" OPTION; do case $OPTION in t) echo "[opt] Set target to $OPTARG" - COMPILE_TARGET=$OPTARG + COMPILE_TARGET="$OPTARG" ;; j) echo "[opt] Set make threads to $OPTARG" - THREADS=$OPTARG + THREADS="$OPTARG" ;; o) echo "[opt] Will compile OpenSSL" @@ -476,10 +476,8 @@ echo -n " compiling..." if [ "$COMPILE_FOR_ANDROID" == "yes" ]; then sed -i=".backup" 's/-export-dynamic/-all-static/g' Makefile fi -if [ "$IS_CROSSCOMPILE" == "yes" ]; then - sed -i=".backup" 's/PHP_BINARIES. pharcmd$/PHP_BINARIES)/g' Makefile - sed -i=".backup" 's/install-programs install-pharcmd$/install-programs/g' Makefile -fi +sed -i=".backup" 's/PHP_BINARIES. pharcmd$/PHP_BINARIES)/g' Makefile +sed -i=".backup" 's/install-programs install-pharcmd$/install-programs/g' Makefile make -j $THREADS >> "$DIR/install.log" 2>&1 echo -n " installing..." make install >> "$DIR/install.log" 2>&1