summaryrefslogblamecommitdiffstats
path: root/php-pear/php/BUILD
blob: a92da7e884f7559cd9e9cf105ee6a1c278df0bb7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                          

                              
 


                                                                                       

                                                                                                         


                          
            






                                                                               
      


                                         
      

      
 


                                                   

     

                                  




                                                      





                                       

                                                                         






                                              
                
. "$GRIMOIRE/FUNCTIONS" &&

cd "${SOURCE_DIRECTORY}" &&
OPTS="${PHP5_OPTS} ${OPTS}" &&

if [[ $PHP5_SAPI == cgi ]]; then
  # If the CGI or FastCGI SAPI (or both) are selected, enable 'force-cgi-redirect'
  if list_find "${OPTS}" "--enable-cgi" || list_find "${OPTS}" "--enable-fastcgi"; then
    message "${MESSAGE_COLOR}CGI or FastCGI SAPI enabled, enabling force-cgi-redirect${DEFAULT_COLOR}" &&
    OPTS="--enable-force-cgi-redirect ${OPTS}"
  fi
else
  case "${PHP5_APACHE}" in
    handler)
      if httpd -v | grep -q "Apache/2\."; then
        message "${MESSAGE_COLOR}Configuring for Apache 2.x${DEFAULT_COLOR}" &&
        OPTS="--with-apxs2 ${OPTS}"
      else
        message "${MESSAGE_COLOR}Configuring for Apache 1.x${DEFAULT_COLOR}" &&
        OPTS="--with-apxs ${OPTS}"
      fi
    ;;

    filter)
        OPTS="--with-apxs2filter ${OPTS}"
    ;;
  esac
fi &&

# Check to see if internal GD requested
if [[ "${PHP5_GD}" == "internal" ]]; then
    OPTS="--with-gd --enable-gd-native-ttf ${OPTS}"
fi &&

CFLAGS="${CFLAGS//-ffast-math}" &&

if is_version_less "${VERSION}" 5.4; then
  OPTS="--with-exec-dir=${INSTALL_ROOT}/usr/bin $OPTS"
fi &&

OPTS="--with-config-file-path=${INSTALL_ROOT}/etc \
               --disable-rpath \
                --enable-bcmath \
         --enable-inline-optimization \
           --with-layout=GNU \
                   ${OPTS}" &&
default_build &&

# safety precaution against earlier PHP installations removing httpd.conf
pushd "${INSTALL_LOGS}" &>/dev/null &&
local log &&
for log in ${SPELL}-*; do
    if [[ -f "${log}" ]]; then
        sedit 's|.*/httpd\.conf.*||g' "${log}"
    fi
done &&
popd &>/dev/null