From 75eb3249676c5dce3c7ca69cdd6c83bd8e272e17 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Thu, 24 Jan 2013 17:11:30 +0100 Subject: [PATCH] Added inline compiler optimization for big servers --- compile_php.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compile_php.sh b/compile_php.sh index 6bd3097a..0d927540 100644 --- a/compile_php.sh +++ b/compile_php.sh @@ -101,9 +101,17 @@ mv pthreads-$PTHREADS_VERSION $DIR/install_data/php/ext/pthreads echo " done!" echo -n "[PHP5] checking..." +MAX_MEMORY=$(free -m | awk '/^Mem:/{print $2}') +if [ $MAX_MEMORY -gt 2048 ] +then + echo -n " enabling optimizations..." + OPTIMIZATION="--enable-inline-optimization " +else + OPTIMIZATION="" +fi cd php ./buildconf --force >> $DIR/install.log 2>&1 -./configure --prefix=$DIR/php5 \ +./configure $OPTIMIZATION--prefix=$DIR/php5 \ --exec-prefix=$DIR/php5 \ --enable-embedded-mysqli \ --enable-bcmath \