Skip to content
Permalink
Browse files

switch back to clang compiler for nginx + ngx_pagespeed 1.10

fixed ngx_pagespeed 1.10's gcc =>4.8 requirements
  • Loading branch information
centminmod committed Dec 22, 2015
1 parent 03ebd92 commit 44bb8f9360f8e461079976545247db3b64332991
Showing with 24 additions and 15 deletions.
  1. +1 −1 centmin.sh
  2. +23 −14 inc/nginx_configure.inc
@@ -251,7 +251,7 @@ CCACHESIZE='2.2G'

#####################################################
# compiler related
CLANG='n' # Nginx and LibreSSL
CLANG='y' # Nginx and LibreSSL
CLANG_PHP='n' # PHP
CLANG_APC='n' # APC Cache
CLANG_MEMCACHED='n' # Memcached menu option 10 routine
@@ -677,16 +677,25 @@ if [[ "$CLANG" = [yY] ]]; then
if [[ ! -f /usr/bin/clang ]]; then
yum -q -y install clang clang-devel
fi
if [[ ! -f /opt/rh/devtoolset-3/root/usr/bin/gcc || ! -f /opt/rh/devtoolset-3/root/usr/bin/g++ ]]; then
scl_install
fi
# ngx_pagespeed => 1.10
if [[ "$(echo $NGXPGSPEED_VER | cut -d . -f1)" -ge '1' ]] && [[ "$(echo $NGXPGSPEED_VER | cut -d . -f2)" -ge '10' ]] && [[ "$NGINX_PAGESPEED" = [yY] ]]; then
CCTOOLSET=' --gcc-toolchain=/opt/rh/devtoolset-3/root/usr/'
else
CCTOOLSET=""
fi
# ccache compiler has some initial overhead for compiles but speeds up subsequent
# recompiles. however on initial install ccache has no benefits, so for initial
# centmin mod install disabling ccache will in theory speed up first time installs
if [[ "$INITIALINSTALL" != [yY] ]]; then
export CC="ccache /usr/bin/clang -ferror-limit=0"
export CC="ccache /usr/bin/clang -ferror-limit=0${CCTOOLSET}"
export CXX="ccache /usr/bin/clang++ -ferror-limit=0"
export CCACHE_CPP2=yes
CLANG_CCOPT=' -Wno-sign-compare -Wno-string-plus-int -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-const-variable -Wno-conditional-uninitialized -Wno-mismatched-tags -Wno-c++11-extensions -Wno-sometimes-uninitialized -Wno-parentheses-equality -Wno-tautological-compare -Wno-self-assign -Wno-deprecated-register -Wno-deprecated -Wno-invalid-source-encoding -Wno-pointer-sign -Wno-parentheses -Wno-enum-conversion'
else
export CC="/usr/bin/clang -ferror-limit=0"
export CC="/usr/bin/clang -ferror-limit=0${CCTOOLSET}"
export CXX="/usr/bin/clang++ -ferror-limit=0"
# export CCACHE_CPP2=yes
CLANG_CCOPT=' -Wno-sign-compare -Wno-string-plus-int -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-const-variable -Wno-conditional-uninitialized -Wno-mismatched-tags -Wno-c++11-extensions -Wno-sometimes-uninitialized -Wno-parentheses-equality -Wno-tautological-compare -Wno-self-assign -Wno-deprecated-register -Wno-deprecated -Wno-invalid-source-encoding -Wno-pointer-sign -Wno-parentheses -Wno-enum-conversion'
@@ -704,29 +713,29 @@ if [[ "$CENTOS_SIX" = '6' && "$CLANG" = [nN] ]]; then
# PS_FLAGS=$(echo " $PS_NGX_EXTRA_FLAGS")
PS_FLAGS=""
if [[ "$INITIALINSTALL" != [yY] ]]; then
unset CC
unset CXX
export CC="ccache /opt/rh/devtoolset-3/root/usr/bin/gcc"
unset CC
unset CXX
export CC="ccache /opt/rh/devtoolset-3/root/usr/bin/gcc"
export CXX="ccache /opt/rh/devtoolset-3/root/usr/bin/g++"
else
unset CC
unset CXX
export CC="/opt/rh/devtoolset-3/root/usr/bin/gcc"
unset CC
unset CXX
export CC="/opt/rh/devtoolset-3/root/usr/bin/gcc"
export CXX="/opt/rh/devtoolset-3/root/usr/bin/g++"
fi
elif [[ -f /opt/rh/devtoolset-3/root/usr/bin/gcc && -f /opt/rh/devtoolset-3/root/usr/bin/g++ ]]; then
export PS_NGX_EXTRA_FLAGS="--with-cc=/opt/rh/devtoolset-3/root/usr/bin/gcc"
# PS_FLAGS=$(echo " $PS_NGX_EXTRA_FLAGS")
PS_FLAGS=""
if [[ "$INITIALINSTALL" != [yY] ]]; then
unset CC
unset CXX
export CC="ccache /opt/rh/devtoolset-3/root/usr/bin/gcc"
unset CC
unset CXX
export CC="ccache /opt/rh/devtoolset-3/root/usr/bin/gcc"
export CXX="ccache /opt/rh/devtoolset-3/root/usr/bin/g++"
else
unset CC
unset CXX
export CC="/opt/rh/devtoolset-3/root/usr/bin/gcc"
unset CC
unset CXX
export CC="/opt/rh/devtoolset-3/root/usr/bin/gcc"
export CXX="/opt/rh/devtoolset-3/root/usr/bin/g++"
fi
fi

0 comments on commit 44bb8f9

Please sign in to comment.
You can’t perform that action at this time.