#! /bin/sh

SED="/usr/bin/sed"
prefix="/usr"
exec_prefix="${prefix}"
version="5.3.27"
vernum="50327"
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/local/lib/c-client/lib"
libs="-lcrypt  -lc-client  -lresolv -lcrypt -lmm -lmcrypt -lltdl -lcrypt -lpcre -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -lxml2 -lz -lm -lssl -lcrypto -ldl -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt "
extension_dir='/usr/lib/php/extensions'
man_dir=`eval echo ${prefix}/man`
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--prefix=/usr' '--with-apxs2=/usr/sbin/apxs' '--prefix=/usr' '--libdir=/usr/lib' '--with-libdir=lib' '--sysconfdir=/etc' '--disable-safe-mode' '--disable-magic-quotes' '--enable-zend-multibyte' '--enable-mbregex' '--enable-tokenizer=shared' '--with-config-file-scan-dir=/etc/php' '--with-config-file-path=/etc/httpd' '--enable-mod_charset' '--with-layout=PHP' '--with-mcrypt=/usr' '--enable-sigchild' '--enable-xml' '--with-libxml-dir=/usr' '--enable-simplexml' '--enable-filter' '--disable-debug' '--with-openssl=shared' '--with-pcre-regex=/usr' '--with-zlib=shared,/usr' '--enable-bcmath=shared' '--with-bz2=shared,/usr' '--enable-calendar=shared' '--enable-ctype=shared' '--with-curl=shared' '--with-curlwrappers' '--enable-dba=shared' '--with-gdbm=/usr' '--with-db4=/usr' '--enable-exif=shared' '--enable-ftp=shared' '--with-gd=shared' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-xpm-dir=/usr' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-gettext=shared,/usr' '--with-gmp=shared,/usr' '--with-iconv=shared' '--with-imap-ssl=/usr' '--with-imap=/usr/local/lib/c-client' '--with-ldap=shared' '--enable-mbstring=shared' '--enable-hash' '--with-mysql=shared,mysqlnd' '--with-mysqli=shared,mysqlnd' '--with-mysql-sock=/var/run/mysql/mysql.sock' '--enable-pdo=shared' '--without-sqlite' '--with-pdo-sqlite=shared' '--with-pdo-sqlite3=shared' '--with-pdo-mysql=shared,mysqlnd' '--with-pspell=shared,/usr' '--with-enchant=shared,/usr' '--with-mm=/usr' '--enable-shmop=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--enable-sockets' '--with-sqlite3=shared,/usr' '--enable-sqlite-utf8' '--with-regex=php' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx=shared' '--with-xsl=shared,/usr' '--enable-zip=shared' '--with-tsrm-pthreads' '--enable-shared=yes' '--enable-static=no' '--with-gnu-ld' '--with-pic' '--build=arm-slackware-linux-gnueabi'"
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;;
--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
