#! /bin/sh

SED="/usr/bin/sed"
prefix="/usr"
datarootdir="/usr/php"
exec_prefix="${prefix}"
version="8.4.14"
vernum="80414"
include_dir="${prefix}/include/php"
lib_dir="/usr/lib64"
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=""
libs="  -lncurses -lstdc++ -lm  -lpthread -lxml2 -lpcre2-8 -ledit -lxml2 -lsodium -largon2 -lrt -ldl -lexpat -lxml2"
extension_dir="/usr/lib64/php/extensions"
man_dir=`eval echo /usr/man`
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--prefix=/usr' '--libdir=/usr/lib64' '--with-libdir=lib64' '--localstatedir=/var' '--sysconfdir=/etc' '--datarootdir=/usr/share' '--datadir=/usr/share' '--infodir=/usr/info' '--mandir=/usr/man' '--with-apxs2=/usr/bin/apxs' '--enable-fpm' '--with-fpm-user=apache' '--with-fpm-group=apache' '--enable-pcntl' '--enable-mbregex' '--enable-tokenizer=shared' '--with-config-file-scan-dir=/etc/php.d' '--with-config-file-path=/etc' '--with-layout=PHP' '--disable-sigchild' '--with-libxml' '--with-expat' '--enable-simplexml' '--enable-xmlreader=shared' '--enable-dom=shared' '--enable-filter' '--disable-debug' '--with-openssl=shared' '--with-kerberos' '--with-external-pcre' '--with-zlib=shared,/usr' '--enable-bcmath=shared' '--with-bz2=shared,/usr' '--enable-calendar=shared' '--enable-ctype=shared' '--with-curl=shared' '--enable-dba=shared' '--with-gdbm=/usr' '--with-db4=/usr' '--enable-exif=shared' '--enable-ftp=shared' '--enable-gd=shared' '--with-external-gd' '--with-jpeg' '--with-xpm' '--with-gettext=shared,/usr' '--with-gmp=shared,/usr' '--with-iconv=shared' '--with-ldap=shared' '--enable-mbstring=shared' '--enable-mysqlnd=shared' '--with-mysqli=shared,mysqlnd' '--with-mysql-sock=/var/run/mysql/mysql.sock' '--with-iodbc=shared,/usr' '--enable-pdo=shared' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-sqlite=shared,/usr' '--with-pdo-odbc=shared,iODBC,/usr' '--with-pspell=shared,/usr' '--with-enchant=shared,/usr' '--enable-shmop=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--enable-sockets' '--with-sqlite3=shared' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-xsl=shared,/usr' '--with-zip=shared' '--enable-intl=shared' '--enable-opcache' '--enable-shared=yes' '--enable-static=no' '--with-gnu-ld' '--with-pic' '--enable-phpdbg' '--with-sodium' '--with-password-argon2' '--without-readline' '--with-libedit' '--with-pear' '--with-tidy=shared' '--build=x86_64-slackware-linux' 'build_alias=x86_64-slackware-linux' 'PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig' 'EXTENSION_DIR=/usr/lib64/php/extensions'"
php_sapis=" apache2handler cli fpm phpdbg cgi"
ini_dir="/etc/php.d"
ini_path="/etc"
php_embed_type=""

# 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

# Set embed SAPI library path
if test "$php_embed_type" = "shared"; then
  php_embed_lib=libphp.so
elif test "$php_embed_type" = "static"; then
  php_embed_lib=libphp.a
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;;
--lib-dir)
  echo $lib_dir;;
--lib-embed)
  echo $php_embed_lib;;
--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]
  --lib-dir           [$lib_dir]
  --lib-embed         [$php_embed_lib]
  --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
