#! /bin/sh

SED="/usr/bin/gsed"
prefix="@CLIENT_BASEDIR@"
exec_prefix="${prefix}"
version="5.2.9"
vernum="50209"
include_dir="${prefix}/include/php"
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/ucblib"
libs="  -lintl -lresolv -lm -lnsl -lsocket  -lxml2 -lz -lm -lsocket -lnsl "
extension_dir='@CLIENT_BASEDIR@/lib/php/extensions/debug-zts-20060613'
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--with-libdir=lib/amd64' '--prefix=@CLIENT_BASEDIR@' '--disable-static' '--enable-shared' '--enable-cli' '--disable-cgi' '--enable-discard-path' '--enable-path-info-check' '--enable-debug' '--enable-safe-mode' '--enable-magic-quotes' '--disable-rpath' '--enable-short-tags' '--disable-ipv6' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-ctype=shared' '--enable-dba=shared' '--enable-dbase=shared' '--enable-exif=shared' '--enable-filepro=shared' '--disable-filter' '--enable-ftp=shared' '--enable-gd-native-ttf=shared' '--enable-gd-jis-conv=shared' '--enable-hash=shared' '--enable-json=shared' '--enable-mbstring=shared' '--enable-mbregex=shared' '--enable-embedded-mysqli=no' '--enable-pdo=shared' '--enable-posix=shared' '--enable-reflection=shared' '--enable-session=shared' '--enable-shmop=shared' '--enable-sockets=shared' '--disable-spl' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-tokenizer=shared' '--enable-zip=shared' '--disable-xml' '--disable-soap' '--disable-dom' '--disable-simplexml' '--disable-libxml' '--disable-xmlreader' '--disable-xmlwriter' '--disable-wddx' '--enable-inline-optimization' '--enable-memory-limit' '--enable-zend-multibyte' '--with-apxs2=/export/scratch/elkner/build/root4build//opt/apache2/bin/apxs' '--with-config-file-path=/etc' '--with-exec-dir' '--with-openssl=shared,/usr/sfw' '--with-zlib=shared,/usr' '--with-zlib-dir=/usr' '--with-bz2=shared,/usr' '--without-cpdflib' '--with-jpeg-dir=/usr' '--with-tiff-dir=/usr' '--without-curl' '--without-curl-wrappers' '--without-qdbm' '--with-db4=/export/scratch/elkner/build/root4build/usr' '--with-inifile=shared' '--with-flatfile=shared' '--with-gd=shared' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--without-ttf' '--with-freetype-dir=/usr/sfw' '--with-gettext' '--without-gmp' '--with-iconv=shared' '--without-imap' '--without-mime-magic' '--with-mysql=shared,/export/scratch/elkner/build/root4build/usr' '--with-mysql-sock=/var/run/mysql.sock' '--with-pdo-mysql=shared,/export/scratch/elkner/build/root4build/usr' '--without-pdo-sqlite' '--with-pcre-regex=shared,/export/scratch/elkner/build/root4build/usr' '--with-pcre-dir=/export/scratch/elkner/build/root4build/usr' '--without-sqlite' '--without-readline' '--without-pear' '--with-regex=php' '--enable-dbx=shared' '--enable-dio=shared' '--enable-maintainer-zts' '--enable-libxml' '--enable-dom=shared' '--enable-xml=shared' '--with-libxml-dir=/usr' '--enable-shared=xml' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-xsl=shared,/usr'"
php_sapis="cli apache2handler"

# Set php_cli_binary and php_cgi_binary if available
for sapi in $php_sapis; do
  case $sapi in
  cli)
    php_cli_binary="${exec_prefix}/bin/${program_prefix}php${program_suffix}${exe_extension}"
    ;;
  cgi)
    php_cgi_binary="${exec_prefix}/bin/${program_prefix}php-cgi${program_suffix}${exe_extension}"
    ;;
  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;;
--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]
  --php-binary        [$php_binary]
  --php-sapis         [$php_sapis]
  --configure-options [$configure_options]
  --version           [$version]
  --vernum            [$vernum]
EOF
  exit 1;;
esac

exit 0
