Skip to content

Instantly share code, notes, and snippets.

@phalcon
Created December 11, 2012 04:40
Show Gist options
  • Save phalcon/4255921 to your computer and use it in GitHub Desktop.
Save phalcon/4255921 to your computer and use it in GitHub Desktop.
if [ -f Makefile ]; then
make clean
phpize --clean
fi
export CC="gcc"
export CFLAGS="-march=native -mtune=native -O2 -fno-delete-null-pointer-checks -finline-functions"
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 -fno-delete-null-pointer-checks -finline-functions $BFLAGS"
gcc $CFLAGS t.c -o t 2> t.t
if [ $? != 0 ]; then
export CFLAGS="-O2 -fno-delete-null-pointer-checks"
fi
fi
rm -f t.t t.c
phpize
./configure --enable-phalcon && make && make install && echo "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web browser to complete the installation"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment