#! /bin/sh

SED="/usr/bin/sed"
prefix='/var/www/pear'
exec_prefix="${prefix}"
version="5.3.28"
vernum="50328"
include_dir="/usr/local/share/php-5.3/include"
includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"
ldflags=" -L/usr/local/lib"
libs="  -liconv -liconv -lintl -lz -lm  -lxml2 -lz -liconv -lm -lgssapi -lkrb5 -lasn1 -lcrypto -lwind -lroken -lcom_err -lheimbase -lssl -lcrypto -lxml2 -lz -liconv -lm -lssl -lcrypto -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm "
extension_dir='/usr/local/lib/php-5.3/modules'
man_dir=`eval echo /usr/local/man`
program_prefix=""
program_suffix="-5.3"
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-pcntl=shared' '--with-sqlite=shared,/usr/local' '--enable-sqlite-utf8' '--enable-shared' '--disable-static' '--disable-rpath' '--with-config-file-path=/etc' '--enable-inline-optimization' '--with-pic' '--with-pear=/usr/local/share/php-5.3' '--with-config-file-scan-dir=/etc/php-5.3' '--with-pdo-sqlite' '--enable-sqlite-utf8' '--with-sqlite3' '--program-suffix=-5.3' '--with-apxs=/usr/sbin/apxs' '--with-openssl' '--with-zlib' '--enable-xml' '--enable-wddx' '--enable-cli' '--with-iconv=/usr/local' '--with-gettext=/usr/local' '--enable-bcmath' '--enable-session' '--enable-calendar' '--enable-ctype' '--enable-ftp' '--with-pcre-regex' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--enable-exif' '--enable-zend-multibyte' '--enable-fastcgi' '--with-bz2=shared,/usr/local' '--with-curl=shared,/usr/local' '--enable-dba=shared' '--with-gdbm=/usr/local' '--with-gd=shared' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-zlib-dir=/usr' '--with-t1lib=/usr/local' '--with-freetype-dir=/usr/X11R6' '--with-xpm-dir=/usr/X11R6' '--with-gmp=shared,/usr/local' '--enable-intl=shared' '--with-icu-dir=/usr/local' '--with-imap=shared,/usr/local' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared,/usr/local' '--with-mcrypt=shared,/usr/local' '--with-mysql=shared,/usr/local' '--with-mysqli=shared,/usr/local/bin/mysql_config' '--with-iodbc=shared,/usr/local' '--with-pdo-mysql=shared,/usr/local' '--with-pdo-pgsql=shared,/usr/local' '--with-pgsql=shared,/usr/local' '--with-pspell=shared,/usr/local' '--enable-shmop=shared,/usr/local' '--enable-soap=shared,/usr/local' '--with-snmp=shared,/usr/local' '--enable-ucd-snmp-hack' '--with-pdo-dblib=shared,/usr/local' '--with-mssql=shared,/usr/local' '--with-tidy=shared,/usr/local' '--with-xmlrpc=shared' '--with-xsl=shared' '--enable-dom' '--enable-zip=shared,/usr/local' '--enable-suhosin' '--prefix=/usr/local' '--sysconfdir=/etc' '--mandir=/usr/local/man' '--infodir=/usr/local/info' '--localstatedir=/var' '--disable-silent-rules'"
php_sapis="cli apache"

# Set php_cli_binary and php_cgi_binary if available
for sapi in $php_sapis; do
  case $sapi in
  cli)
    php_cli_binary="/usr/local/bin/php${program_suffix}"
    ;;
  cgi)
    php_cgi_binary="/usr/local/bin/php-cgi${program_suffix}"
    ;;
  esac
done

# Determine which (if any) php binary is available
if test "$php_cli_binary" != "NONE"; then
  php_binary="$php_cli_binary"
else
  php_binary="$php_cgi_binary"
fi

# Remove quotes
configure_options=`echo $configure_options | $SED -e "s#'##g"`

case "$1" in
--prefix)
  echo $prefix;;
--includes)
  echo $includes;;
--ldflags)
  echo $ldflags;;
--libs)
  echo $libs;;
--extension-dir)
  echo $extension_dir;;
--include-dir)
  echo $include_dir;;
--php-binary)
  echo $php_binary;;
--php-sapis)
  echo $php_sapis;;
--configure-options)
  echo $configure_options;;
--man-dir)
  echo $man_dir;;
--version)
  echo $version;;
--vernum)
  echo $vernum;;
*)
  cat << EOF
Usage: $0 [OPTION]
Options:
  --prefix            [$prefix]
  --includes          [$includes]
  --ldflags           [$ldflags]
  --libs              [$libs]
  --extension-dir     [$extension_dir]
  --include-dir       [$include_dir]
  --man-dir           [$man_dir]
  --php-binary        [$php_binary]
  --php-sapis         [$php_sapis]
  --configure-options [$configure_options]
  --version           [$version]
  --vernum            [$vernum]
EOF
  exit 1;;
esac

exit 0
