#! /bin/sh

SED="sed"
prefix="/Users/Shared/Software/Php83"
datarootdir="/Users/Shared/Software/Php83/share"
exec_prefix="${prefix}"
version="8.3.30"
vernum="80330"
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/Users/Shared/Software/Php83/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr//lib"
libs="  -lresolv -lstdc++ -liconv -lbz2 -lnetwork -lm  -lxml2 -lpcre2-8 -lgd -largon2 -lxml2 -lssl -lcrypto "
extension_dir='/Users/Shared/Software/Php83/lib/php/20230831'
man_dir=`eval echo ${datarootdir}/man`
program_prefix=""
program_suffix=""
exe_extension=""
php_cli_binary=NONE
php_cgi_binary=NONE
configure_options=" '--disable-all' '--disable-option-checking' '--disable-static' '--disable-debug' '--disable-cgi' '--disable-phpdbg' '--disable-phpdbg-webhelper' '--disable-phpdbg-debug' '--enable-ipv6' '--enable-mysqlnd' '--enable-sockets=shared' '--enable-soap=shared' '--enable-json=shared' '--enable-xml' '--enable-libxml' '--enable-xmlwriter=shared' '--enable-xmlreader=shared' '--enable-simplexml=shared' '--enable-exif=shared' '--enable-pcntl=shared' '--enable-posix=shared' '--enable-ftp=shared' '--enable-calendar=shared' '--enable-bcmath=shared' '--enable-wddx=shared' '--enable-tokenizer=shared' '--enable-session=shared' '--enable-hash' '--enable-filter=shared' '--enable-mbstring=shared' '--enable-fileinfo=shared' '--enable-dom=shared' '--enable-opcache=shared' '--enable-sysvshm=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-shmop=shared' '--enable-phar' '--enable-embed=shared' '--enable-cli' '--enable-fpm' '--enable-pdo=shared' '--enable-gettext=shared' '--enable-dba=shared' '--with-pdo-mysql=shared,/Users/Shared/Software/Php83' '--with-pdo-pgsql=shared,/Users/Shared/Software/Php83' '--with-zlib-dir=/usr' '--with-bz2=shared' '--with-pic' '--with-iconv' '--with-layout=GNU' '--with-system-tzdata' '--with-password-argon2=shared,/Users/Shared/Software/Php83' '--with-onig=/Users/Shared/Software/Php83' '--with-libxml' '--with-libxml-dir=/Users/Shared/Software/Php83' '--with-openssl=shared,/Users/Shared/Software/Php83' '--with-openssl-dir=/Users/Shared/Software/Php83' '--with-mcrypt=shared,/Users/Shared/Software/Php83' '--with-mysqli=mysqlnd' '--with-pgsql=shared,/Users/Shared/Software/Php83' '--with-curl=shared,/Users/Shared/Software/Php83' '--with-gmp=shared,/Users/Shared/Software/Php83' '--with-pear' '--with-xmlrpc=shared' '--enable-ctype=shared' '--with-mhash=shared,/Users/Shared/Software/Php83' '--with-png-dir=/Users/Shared/Software/Php83' '--with-jpeg-dir=/Users/Shared/Software/Php83' '--with-xsl=shared,/Users/Shared/Software/Php83' '--with-libedit=shared,/Users/Shared/Software/Php83' '--with-pcre-regex=/Users/Shared/Software/Php83' '--without-pcre-jit' '--enable-gd' '--enable-gd-native-ttf' '--with-gd=shared,/Users/Shared/Software/Php83' '--with-icu-dir=/Users/Shared/Software/Php83' '--with-freetype-dir=/Users/Shared/Software/Php83' '--enable-freetype=shared' '--enable-fontconfig=shared' '--with-config-file-scan-dir=/Users/Shared/Services/Php83/etc/php' '--with-sodium=shared,/Users/Shared/Software/Php83' '--enable-intl=shared,/Users/Shared/Software/Php83' '--with-libzip=shared,/Users/Shared/Software/Php83' 'ac_cv_sizeof_off_t=8' 'ac_cv_decimal_fp_supported=no' 'ac_cv_func_RAND_egd=no' 'lt_cv_path_SED=sed' '--disable-fpm' '--enable-dtrace' '--with-config-file-path=/Users/Shared/Services/Php83/etc' '--without-kerberos' '--without-ldap' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-bz2=/Users/Shared/Software/Php83' '--with-zlib=shared' 'ZLIB_CFLAGS=-I/Users/Shared/Software/Php83/include' 'ZLIB_LIBS=-L/Users/Shared/Software/Php83/lib' 'PNG_CFLAGS=I/Users/Shared/Software/Php83/include' 'PNG_LIBS=-L/Users/Shared/Software/Php83/lib' '--disable-embed' '--with-external-gd' '--with-external-pcre' '--with-xpm=/opt/X11' '--without-pgsql' '--without-pdo-pgsql' '--host=aarch64-apple-darwin24.6.0' '--with-os-sdkpath=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/' '--with-iconv=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/' '--prefix=/Users/Shared/Software/Php83' '--sysconfdir=/Users/Shared/Services/Php83/etc' '--localstatedir=/Users/Shared/Services/Php83/var' 'host_alias=aarch64-apple-darwin24.6.0' 'PKG_CONFIG_PATH=/Users/Shared/Software/Php83/lib/pkgconfig' 'CPP=clang -E'"
php_sapis=" cli"
ini_dir="/Users/Shared/Services/Php83/etc/php"
ini_path="/Users/Shared/Services/Php83/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
