#! /bin/sh

SED="/usr/bin/sed"
prefix="/opt/eenos/php74/usr"
datarootdir="/opt/eenos/php74/usr/share"
exec_prefix="${prefix}"
version="7.4.33"
vernum="70433"
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/opt/eenos-enchant/lib"
libs="-lcrypt   -largon2 -lcrypt -lrt -lstdc++ -lrt -lm  -lxml2 -lpcre2-8 -lenchant -lcrypt -largon2 -lxml2 -lcrypt "
extension_dir='/opt/eenos/php74/usr/lib/php/modules'
man_dir=`eval echo /opt/eenos/php74/usr/share/man`
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--prefix=/opt/eenos/php74/usr' '--enable-cli' '--disable-cgi' '--disable-phpdbg' '--with-config-file-path=/opt/eenos/php74/etc' '--with-config-file-scan-dir=/opt/eenos/php74/etc/conf.d' '--enable-pcntl' '--with-libedit=shared,/usr' '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--libdir=/opt/eenos/php74/usr/lib/php' '--libexecdir=/opt/eenos/php74/usr/lib/php' '--datadir=/opt/eenos/php74/usr/share/php' '--sysconfdir=/opt/eenos/php74/etc' '--localstatedir=/opt/eenos/php74/usr/var' '--runstatedir=/opt/eenos/php74/usr/run' '--mandir=/opt/eenos/php74/usr/share/man' '--cache-file=config.cache' '--disable-all' '--disable-debug' '--disable-rpath' '--disable-static' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-ctype=shared' '--enable-dba=shared' '--enable-dom=shared' '--enable-exif=shared' '--enable-fileinfo=shared' '--enable-filter=shared' '--enable-ftp=shared' '--enable-gd=shared' '--enable-intl=shared' '--enable-json=shared' '--enable-mbregex' '--enable-mbstring=shared' '--enable-mysqlnd=shared' '--enable-opcache=shared' '--enable-pdo=shared' '--enable-phar=shared' '--enable-posix=shared' '--enable-session' '--enable-shmop=shared' '--enable-simplexml=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-tokenizer=shared' '--enable-xmlreader=shared' '--enable-xml' '--enable-xmlwriter=shared' '--with-bz2=shared' '--with-curl=shared' '--with-db4=/usr/include/db5.3' '--with-enchant=/opt/eenos-enchant,shared' '--with-external-pcre' '--with-freetype=/usr' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-imap=shared,/usr' '--with-imap-ssl' '--with-jpeg=shared,/usr' '--with-kerberos' '--with-layout=GNU' '--with-ldap-sasl=shared' '--with-ldap=shared' '--with-libxml' '--with-mhash=shared,/usr' '--with-mysqli=shared,mysqlnd' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-openssl=shared,/usr' '--with-onig=shared,/usr' '--with-gdbm=shared,/usr' '--with-pear=/opt/eenos/php74/usr/lib/php' '--with-readline=shared' '--with-password-argon2=/usr' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-pgsql=shared' '--with-pgsql=shared' '--with-pic=shared' '--with-pspell=shared,/usr' '--with-snmp=shared,/usr' '--with-sodium=shared' '--with-sqlite3=shared,/usr' '--with-tidy=shared,/usr' '--with-unixODBC=shared,/usr' '--with-webp=shared' '--with-xmlrpc=shared' '--with-xpm=/usr' '--with-xsl=shared,/usr' '--with-zip=shared' '--with-zlib=shared,/usr' '--with-zlib-dir=/usr' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu'"
php_sapis=" cli"
ini_dir="/opt/eenos/php74/etc/conf.d"
ini_path="/opt/eenos/php74/etc"

# 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;;
--ini-path)
  echo $ini_path;;
--ini-dir)
  echo $ini_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]
  --ini-path          [$ini_path]
  --ini-dir           [$ini_dir]
  --configure-options [$configure_options]
  --version           [$version]
  --vernum            [$vernum]
EOF
  exit 1;;
esac

exit 0
