# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/php/php.conf # Copyright (C) 2004 - 2023 The T2 SDE Project # Copyright (C) 1998 - 2003 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # seems not to handle --libdir... var_append confopt ' ' "--with-libdir=${libdir##*/}" #var_append extraconfopt ' ' "--with-pear=$root$libdir/php" var_append extraconfopt " " "--without-pear" var_remove_regex makeopt ' ' 'CC=.*' pkginstalled apache || var_append extraconfopt " " "--without-apache" case "$SDECFG_PKG_PHP_CGIAPI" in fastcgi) var_append extraconfopt " " "--enable-fastcgi" var_append extraconfopt " " "--enable-force-cgi-redirect" ;; apache) if pkginstalled apache; then pkgprefix -t apache var_append extraconfopt " " "--with-apxs2=$(pkgprefix bindir apache)/apxs" fi ;; FPM) var_append extraconfopt " " "--enable-fpm" ;; esac if atstage cross; then hook_add preconf 5 "echo 'ac_cv_c_bigendian_php=$arch_bigendian' >> config.cache" var_append extraconfopt " " "--disable-phar" var_append extraconfopt " " "--without-pear" var_append extraconfopt " " "--disable-opcache" fi var_append extraconfopt " " "--with-zlib --with-bz2" [ "$SDECFG_PKG_PHP_BCMATH" = 1 ] && var_append extraconfopt " " "--enable-bcmath" [ "$SDECFG_PKG_PHP_MBSTRING" = 1 ] && var_append extraconfopt " " "--enable-mbstring" if pkginstalled mysql; then pkgprefix -t mysql if [ $? -eq 0 -o "$SDECFG_PKG_PHP_FORCESHARED" = 1 ]; then pkg_php_shared="=$root/$(pkgprefix mysql)" var_append CC_WRAPPER_APPEND ' ' "-Wl,--rpath $(pkgprefix libdir mysql)/mysql" else pkg_php_shared= fi var_append extraconfopt " " "--with-mysql$pkg_php_shared" var_append extraconfopt " " "--enable-mysqli" var_append extraconfopt " " "--with-mysqli=$root/$(pkgprefix bindir mysql)/mysql_config" var_append extraconfopt " " "--with-pdo-mysql$pkg_php_shared" fi if pkginstalled postgresql; then pkgprefix -t postgresql var_append extraconfopt " " "--with-pgsql=$root/$(pkgprefix postgresql)" var_append extraconfopt " " "--with-pdo-pgsql=$root/$(pkgprefix postgresql)" fi if pkginstalled openldap; then pkgprefix -t openldap var_append extraconfopt " " "--with-ldap=$root/$(pkgprefix openldap)" fi pkginstalled openssl && var_append extraconfopt " " "--with-openssl" pkginstalled libmcrypt && var_append extraconfopt " " "--with-mcrypt" pkginstalled libmhash && var_append extraconfopt " " "--with-mhash" pkginstalled gettext && var_append extraconfopt " " "--with-gettext" pkginstalled libgd && var_append extraconfopt " " "--with-gd --enable-gd-native-ttf" pkginstalled libjpeg && var_append extraconfopt " " "--with-jpeg-dir" pkginstalled libpng && var_append extraconfopt " " "--with-png-dir" pkginstalled freetype1 && var_append extraconfopt " " "--with-ttf" pkginstalled libxml && var_append extraconfopt " " "--with-libxml-dir=$root/$(pkgprefix libxml)" pkginstalled openssl && var_append extraconfopt " " "--with-openssl=$root/$(pkgprefix openssl)" pkginstalled bzip2 && var_append extraconfopt " " "--with-bz2=$root/$(pkgprefix bzip2)" pkginstalled pcre && var_append extraconfopt ' ' "--with-pcre-regex=$root/$(pkgprefix pcre)" pkginstalled curl && var_append extraconfopt ' ' '--with-curl' if pkginstalled freetype; then pkgprefix -t freetype var_append extraconfopt " " "--with-freetype-dir=$root/$(pkgprefix freetype)" fi if [ "$SDECFG_PKG_PHP_EXTRACONFOPT" ]; then var_append extraconfopt " " "$SDECFG_PKG_PHP_EXTRACONFOPT" fi hook_add postmake 5 'cp php.ini-* $root$docdir' # if we don't inject this file php's Makefile will try to download it #hook_add premake 5 'cp -v `match_source_file -p install-pear-nozlib` pear/install-pear-nozlib.phar' # HACK ALERT fix_configure() { sed -i "s,lib/lib,${libdir##*/}/lib,g" configure for i in PHP_LDAP PHP_LDAP_SASL; do sed -i "s,$i/lib,$i/${libdir##*/}," configure done } [[ $libdir != *lib ]] && hook_add preconf 5 "fix_configure" # install into sysroot atstage cross && var_append makeinstopt ' ' "INSTALL_ROOT=$root"