summaryrefslogtreecommitdiffstats
path: root/php-zephir-parser-build.patch
diff options
context:
space:
mode:
Diffstat (limited to 'php-zephir-parser-build.patch')
-rw-r--r--php-zephir-parser-build.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/php-zephir-parser-build.patch b/php-zephir-parser-build.patch
new file mode 100644
index 0000000..6c16bcb
--- /dev/null
+++ b/php-zephir-parser-build.patch
@@ -0,0 +1,74 @@
+diff -up ./install.rpm ./install
+--- ./install.rpm 2017-10-12 11:26:32.000000000 +0200
++++ ./install 2017-10-12 11:29:16.000000000 +0200
+@@ -33,7 +33,6 @@ fi
+
+ # Check best compilation flags for compiler
+ export CC=gcc
+-export CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer"
+
+ # Set defaults
+ PHPIZE_BIN=$(command -v phpize 2>/dev/null)
+@@ -74,28 +73,6 @@ if [ "${PHP_FULL_VERSION:0:3}" == "5.4"
+ exit 1
+ fi
+
+-# Detect possible flags
+-echo "int main() {}" > t.c
+-gcc ${CFLAGS} t.c -o t 2> t.t
+-if [ $? != 0 ]; then
+- chmod +x gcccpuopt
+- BFLAGS=`./gcccpuopt`
+- export CFLAGS="-O2 -fomit-frame-pointer $BFLAGS"
+- gcc ${CFLAGS} t.c -o t 2> t.t
+- if [ $? != 0 ]; then
+- export CFLAGS="-O2"
+- fi
+-fi
+-
+-# Activate some gcc specific optimizations for gcc >= 4
+-if [ $(gcc -dumpversion | cut -f1 -d.) -ge 4 ]; then
+- gcc ${CFLAGS} -fvisibility=hidden t.c -o t 2> t.t && export CFLAGS="$CFLAGS -fvisibility=hidden"
+-fi
+-
+-gcc ${CFLAGS} -flto t.c -o t 2> t.t && { export CFLAGS="$CFLAGS -flto"; export LDFLAGS="$LDFLAGS $CFLAGS"; }
+-
+-rm -f t.t t.c t
+-
+ cd ${CURRENT_DIR}/parser
+
+ # Cleanup
+@@ -166,33 +143,3 @@ if [ "$(uname -s 2>/dev/null)" = "Darwin
+ aclocal && ${LIBTOOLIZE_BIN} --force && autoheader && autoconf
+ fi
+
+-./configure --silent --with-php-config=${PHPCONFIG_BIN} --enable-zephir_parser
+-
+-make -s -j"$(getconf _NPROCESSORS_ONLN)"
+-make -s install
+-
+-# Clean current compilation
+-if [ -f Makefile ]; then
+- make -s clean
+- ${PHPIZE_BIN} --clean
+-fi
+-
+-cd ${CURRENT_DIR}/parser
+-
+-# Cleanup
+-rm -f \
+- *.o \
+- *.lo \
+- lemon \
+- scanner.c \
+- parser.c \
+- parser.php5.c \
+- parser.php5.h \
+- parser.php5.out \
+- parser.php7.c \
+- parser.php7.h \
+- parser.php7.out \
+- config.h.in~
+-
+-echo -e "\nThanks for compiling Zephir Parser!\nBuild succeed: Please restart your web server to complete the installation\n"
+-