#!/usr/bin/sh

SED="/usr/bin/sed"
prefix="/home/solarspeed/admserv-php"
datarootdir="/home/solarspeed/admserv-php/share"
exec_prefix="${prefix}"
version="8.3.31"
vernum="80331"
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/lib64/x86_64-linux-gnu"
libs="  -laspell -lpspell -lrt -lldap -llber -lstdc++ -lgmp -ldb-5.3 -lbz2 -lrt -lm  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lssl -lcrypto -lz -lpng16 -lwebp -ljpeg -lXpm -lX11 -lfreetype -licuio -licui18n -licuuc -licudata -lonig -lodbc -lodbc -lsqlite3 -lxml2 -lxml2 -lsodium -largon2 -lrt -ldl -lxml2 -lxml2 -lxml2 -lxslt -lxml2 -lexslt -lxslt -lxml2 -lzip -lz -lssl -lcrypto "
extension_dir='/home/solarspeed/admserv-php/lib/php/20230831'
man_dir=`eval echo /home/solarspeed/admserv-php/man`
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--prefix=/home/solarspeed/admserv-php' '--enable-cli' '--enable-fpm' '--with-fpm-user=admserv' '--with-fpm-group=admserv' '--with-fpm-systemd' '--with-config-file-path=/home/solarspeed/admserv-php/etc' '--with-config-file-scan-dir=/home/solarspeed/admserv-php/etc/php.d' '--enable-shared' '--disable-debug' '--disable-rpath' '--enable-opcache' '--enable-mysqlnd' '--with-mysqli' '--with-pgsql=shared' '--enable-dom' '--enable-simplexml' '--enable-xml' '--with-snmp=shared' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-odbc=unixODBC,/usr' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=shared' '--with-pdo-sqlite' '--with-sqlite3' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-exif' '--enable-ftp' '--enable-gd' '--with-webp' '--with-jpeg' '--with-xpm' '--with-password-argon2' '--enable-gd-jis-conv' '--enable-mbregex' '--enable-mbstring' '--enable-shmop' '--enable-sockets' '--with-bz2' '--with-curl' '--with-db4=/usr' '--with-gettext=/usr' '--with-gmp' '--with-iconv' '--with-kerberos' '--with-layout=GNU' '--with-ldap' '--with-mhash' '--with-openssl' '--with-pspell' '--with-zlib' '--enable-soap' '--with-libdir=lib64' '--with-unixODBC=/usr' '--enable-intl' '--with-freetype' '--with-xsl' '--with-sodium' '--with-pear' '--mandir=/home/solarspeed/admserv-php/man/' '--docdir=/home/solarspeed/admserv-php/docs/' '--sbindir=/home/solarspeed/admserv-php/sbin/' '--with-zip'"
php_sapis=" cli fpm phpdbg cgi"
ini_dir="/home/solarspeed/admserv-php/etc/php.d"
ini_path="/home/solarspeed/admserv-php/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
