#! /bin/sh

SED="/bin/sed"
prefix="/usr"
datarootdir="/usr/php"
sysconfdir='/etc/php83'
exec_prefix="/usr"
version="8.3.30"
vernum="80330"
include_dir="/usr/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=""
libs="-lcrypt   -lcrypt -lrt -lrt -lm  -lxml2 -lpcre2-8 -largon2 -lrt -ldl -lcrypt "
extension_dir='/usr/libx32/php83'
man_dir=`eval echo /usr/share/man`
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--host=x86_64-pld-linux-gnux32' '--build=x86_64-pld-linux-gnux32' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc/php83' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/libx32' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--x-libraries=/usr/libx32' 'EXTRA_LDFLAGS=-Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc ' '--disable-cgi' '--disable-cli' '--disable-phpdbg' '--enable-phpdbg' '--cache-file=config.cache' '--with-libdir=libx32' '--with-config-file-path=/etc/php83' '--with-config-file-scan-dir=/etc/php83/conf.d' '--with-system-tzdata' '--with-password-argon2' '--disable-debug' '--enable-option-checking=fatal' '--enable-bcmath=shared' '--enable-calendar=shared' '--with-capstone' '--enable-ctype=shared' '--enable-dba=shared' '--enable-dom=shared' '--enable-exif=shared' '--enable-fileinfo=shared' '--enable-ftp=shared' '--enable-intl=shared' '--with-libxml' '--enable-mbstring=shared,all' '--enable-mbregex' '--enable-pcntl=shared' '--enable-pdo=shared' '--enable-xmlwriter=shared' '--with-avif' '--with-fpm-user=http' '--with-fpm-group=http' '--with-pdo-dblib=shared' '--with-pdo-firebird=shared' '--with-mhash=yes' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared' '--with-webp' '--enable-posix=shared' '--enable-shared' '--enable-session=shared' '--enable-shmop=shared' '--enable-simplexml=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-soap=shared' '--enable-sockets=shared' '--with-sodium=shared' '--enable-tokenizer=shared' '--enable-xml=shared' '--enable-xmlreader=shared' '--with-bz2=shared' '--with-curl=shared' '--with-db4' '--with-iconv=shared' '--with-enchant=shared' '--with-freetype' '--with-gettext=shared' '--enable-gd=shared' '--with-external-gd' '--with-gdbm' '--with-gmp=shared' '--with-ffi=shared' '--with-imap=shared' '--with-imap-ssl' '--with-jpeg' '--with-ldap=shared' '--with-ldap-sasl' '--enable-mysqlnd=shared' '--with-mysqli=shared,mysqlnd' '--enable-opcache=shared' '--with-openssl=shared' '--with-kerberos' '--with-tcadb=/usr' '--with-external-libcrypt' '--with-external-pcre' '--without-pcre-jit' '--enable-filter=shared' '--with-pgsql=shared' '--enable-phar=shared' '--with-pspell=shared' '--with-readline=shared' '--with-snmp=shared' '--with-sqlite3=shared' '--with-tidy=shared' '--with-unixODBC=shared' '--with-xsl=shared' '--with-zlib=shared' '--with-zip=shared' 'build_alias=x86_64-pld-linux-gnux32' 'host_alias=x86_64-pld-linux-gnux32' 'PKG_CONFIG_PATH=/home/users/builder/GNUstep/Library/Libraries/pkgconfig:/usr/local/libx32/pkgconfig:/usr/libx32/pkgconfig:/usr/libx32/pkgconfig:/usr/share/pkgconfig' 'CFLAGS=-O2 -fwrapv -pipe -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=trampolines -fPIC -mtune=generic -march=x86-64 -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2 -Wformat -Werror=format-security -fPIC -DPIC' 'CPP=/usr/bin/cpp' 'CXXFLAGS=-O2 -fwrapv -pipe -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=trampolines -fPIC -mtune=generic -march=x86-64 -gdwarf-4 -fno-debug-types-section -fvar-tracking-assignments -g2 -Wformat -Werror=format-security -fPIC -DPIC'"
php_sapis="apache2handler cgi cli fpm litespeed phpdbg"
ini_dir="/etc/php83/conf.d"
ini_path="/etc/php83"

# Set php_cli_binary and php_cgi_binary if available
for sapi in $php_sapis; do
  case $sapi in
  cli)
    php_cli_binary="/usr/bin/${program_prefix}php${program_suffix}${exe_extension}"
    ;;
  cgi)
    php_cgi_binary="/usr/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;;
--sysconfdir)
  echo $sysconfdir;;
--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]
  --sysconfdir        [$sysconfdir]
  --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
