Autotools: Sync CS in extensions (#15343)

- Redundant double quotes removed
- AS_* macros used
- Few nits adjusted here and there
This commit is contained in:
Peter Kokot 2024-08-11 17:42:26 +02:00 committed by GitHub
parent 687eb9125a
commit bb35da336d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 51 additions and 70 deletions

View File

@ -5,12 +5,11 @@ PHP_ARG_WITH([gettext],
if test "$PHP_GETTEXT" != "no"; then
for i in $PHP_GETTEXT /usr/local /usr; do
test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
AS_IF([test -r $i/include/libintl.h], [GETTEXT_DIR=$i; break;])
done
if test -z "$GETTEXT_DIR"; then
AC_MSG_ERROR([Cannot locate header file libintl.h])
fi
AS_VAR_IF([GETTEXT_DIR],,
[AC_MSG_ERROR([Cannot locate header file libintl.h])])
GETTEXT_LIBDIR=$GETTEXT_DIR/$PHP_LIBDIR
GETTEXT_INCDIR=$GETTEXT_DIR/include
@ -47,9 +46,8 @@ if test "$PHP_GETTEXT" != "no"; then
[Define to 1 if you have the 'bind_textdomain_codeset' function.])])
LDFLAGS=$O_LDFLAGS
if test -n "$GETTEXT_LIBS"; then
PHP_ADD_LIBRARY_WITH_PATH([$GETTEXT_LIBS],
AS_VAR_IF([GETTEXT_LIBS],,,
[PHP_ADD_LIBRARY_WITH_PATH([$GETTEXT_LIBS],
[$GETTEXT_LIBDIR],
[GETTEXT_SHARED_LIBADD])
fi
[GETTEXT_SHARED_LIBADD])])
fi

View File

@ -8,8 +8,8 @@ if test "$PHP_ICONV" != "no"; then
PHP_SETUP_ICONV([ICONV_SHARED_LIBADD],,
[AC_MSG_FAILURE([The iconv not found.])])
save_LDFLAGS="$LDFLAGS"
save_CFLAGS="$CFLAGS"
save_LDFLAGS=$LDFLAGS
save_CFLAGS=$CFLAGS
LDFLAGS="$ICONV_SHARED_LIBADD $LDFLAGS"
CFLAGS="$INCLUDES $CFLAGS"
@ -124,8 +124,8 @@ int main(void) {
[AC_DEFINE([ICONV_BROKEN_IGNORE], [1],
[Define to 1 if iconv has broken IGNORE.])])
LDFLAGS="$save_LDFLAGS"
CFLAGS="$save_CFLAGS"
LDFLAGS=$save_LDFLAGS
CFLAGS=$save_CFLAGS
AC_DEFINE([HAVE_ICONV], [1],
[Define to 1 if the PHP extension 'iconv' is available.])

View File

@ -53,23 +53,18 @@ PHP_ARG_WITH([ldap-sasl],
[no])
if test "$PHP_LDAP" != "no"; then
PHP_NEW_EXTENSION([ldap],
[ldap.c],
[$ext_shared],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
if test "$PHP_LDAP" = "yes"; then
AS_VAR_IF([PHP_LDAP], [yes], [
for i in /usr/local /usr; do
PHP_LDAP_CHECKS($i)
PHP_LDAP_CHECKS([$i])
done
else
PHP_LDAP_CHECKS($PHP_LDAP)
fi
], [PHP_LDAP_CHECKS([$PHP_LDAP])])
if test -z "$LDAP_DIR"; then
AC_MSG_ERROR([Cannot find ldap.h])
fi
AS_VAR_IF([LDAP_DIR],, [AC_MSG_ERROR([Cannot find ldap.h])])
dnl -pc removal is a hack for clang
MACHINE_INCLUDES=$($CC -dumpmachine | $SED 's/-pc//')

View File

@ -5,7 +5,6 @@ PHP_ARG_WITH([libxml],
[yes])
if test "$PHP_LIBXML" != "no"; then
dnl This extension can not be build as shared
ext_shared=no

View File

@ -173,9 +173,7 @@ if test "$PHP_MBSTRING" != "no"; then
PHP_MBSTRING_ADD_BASE_SOURCES([mbstring.c php_unicode.c mb_gpc.c])
if test "$PHP_MBREGEX" != "no"; then
PHP_MBSTRING_SETUP_MBREGEX
fi
AS_VAR_IF([PHP_MBREGEX], [no],, [PHP_MBSTRING_SETUP_MBREGEX])
dnl libmbfl is required
PHP_MBSTRING_SETUP_LIBMBFL

View File

@ -66,7 +66,6 @@ fi
AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`)
])
dnl
dnl Figure out which library file to link with for the Empress support.
dnl
@ -107,9 +106,7 @@ PHP_ARG_WITH([adabas],,
AC_MSG_CHECKING([for Adabas support])
if test "$PHP_ADABAS" != "no"; then
if test "$PHP_ADABAS" = "yes"; then
PHP_ADABAS=/usr/local
fi
AS_VAR_IF([PHP_ADABAS], [yes], [PHP_ADABAS=/usr/local])
PHP_ADD_INCLUDE([$PHP_ADABAS/incl])
PHP_ADD_LIBPATH([$PHP_ADABAS/$PHP_LIBDIR])
ODBC_OBJS="$PHP_ADABAS/$PHP_LIBDIR/odbclib.a"
@ -138,9 +135,7 @@ PHP_ARG_WITH([sapdb],,
AC_MSG_CHECKING([for SAP DB support])
if test "$PHP_SAPDB" != "no"; then
if test "$PHP_SAPDB" = "yes"; then
PHP_SAPDB=/usr/local
fi
AS_VAR_IF([PHP_SAPDB], [yes], [PHP_SAPDB=/usr/local])
PHP_ADD_INCLUDE([$PHP_SAPDB/incl])
PHP_ADD_LIBPATH([$PHP_SAPDB/$PHP_LIBDIR])
PHP_ADD_LIBRARY([sqlod])
@ -160,9 +155,7 @@ PHP_ARG_WITH([solid],,
AC_MSG_CHECKING([for Solid support])
if test "$PHP_SOLID" != "no"; then
if test "$PHP_SOLID" = "yes"; then
PHP_SOLID=/usr/local/solid
fi
AS_VAR_IF([PHP_SOLID], [yes], [PHP_SOLID=/usr/local/solid])
ODBC_INCDIR=$PHP_SOLID/include
ODBC_LIBDIR=$PHP_SOLID/$PHP_LIBDIR
ODBC_CFLAGS=-I$ODBC_INCDIR
@ -304,9 +297,7 @@ PHP_ARG_WITH([custom-odbc],,
AC_MSG_CHECKING([for a custom ODBC support])
if test "$PHP_CUSTOM_ODBC" != "no"; then
if test "$PHP_CUSTOM_ODBC" = "yes"; then
PHP_CUSTOM_ODBC=/usr/local
fi
AS_VAR_IF([PHP_CUSTOM_ODBC], [yes], [PHP_CUSTOM_ODBC=/usr/local])
ODBC_INCDIR=$PHP_CUSTOM_ODBC/include
ODBC_LIBDIR=$PHP_CUSTOM_ODBC/$PHP_LIBDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR
@ -346,9 +337,7 @@ PHP_ARG_WITH([esoob],,
AC_MSG_CHECKING([for Easysoft ODBC-ODBC Bridge support])
if test "$PHP_ESOOB" != "no"; then
if test "$PHP_ESOOB" = "yes"; then
PHP_ESOOB=/usr/local/easysoft/oob/client
fi
AS_VAR_IF([PHP_ESOOB], [yes], [PHP_ESOOB=/usr/local/easysoft/oob/client])
ODBC_INCDIR=$PHP_ESOOB/include
ODBC_LIBDIR=$PHP_ESOOB/$PHP_LIBDIR
ODBC_LFLAGS=-L$ODBC_LIBDIR

View File

@ -5,7 +5,6 @@ PHP_ARG_ENABLE([pdo],
[yes])
if test "$PHP_PDO" != "no"; then
dnl Make sure $PHP_PDO is 'yes' when it's not 'no' :)
PHP_PDO=yes

View File

@ -4,7 +4,6 @@ PHP_ARG_WITH([pdo-dblib],
[PDO: DBLIB-DB support. DIR is the FreeTDS home directory])])
if test "$PHP_PDO_DBLIB" != "no"; then
if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
fi
@ -17,7 +16,6 @@ if test "$PHP_PDO_DBLIB" != "no"; then
[AC_MSG_FAILURE([Cannot find FreeTDS in known installation directories.])])
PHP_ADD_LIBRARY([sybdb],, [PDO_DBLIB_SHARED_LIBADD])
elif test "$PHP_PDO_DBLIB" != "no"; then
if test -f $PHP_PDO_DBLIB/include/sybdb.h; then
PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB
PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include
@ -28,9 +26,7 @@ if test "$PHP_PDO_DBLIB" != "no"; then
AC_MSG_ERROR([Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory])
fi
if test "x$PHP_LIBDIR" = "x" ; then
PHP_LIBDIR=lib
fi
AS_VAR_IF([PHP_LIBDIR],, [PHP_LIBDIR=lib])
if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
AC_MSG_ERROR([[Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so]]])

View File

@ -5,7 +5,6 @@ PHP_ARG_WITH([pdo-firebird],
[/opt/firebird]])])
if test "$PHP_PDO_FIREBIRD" != "no"; then
if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
fi

View File

@ -16,12 +16,11 @@ fi
if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
for i in $PHP_READLINE /usr/local /usr; do
test -f $i/include/readline/readline.h && READLINE_DIR=$i && break
AS_IF([test -f $i/include/readline/readline.h], [READLINE_DIR=$i; break;])
done
if test -z "$READLINE_DIR"; then
AC_MSG_ERROR([Please reinstall readline - I cannot find readline.h])
fi
AS_VAR_IF([READLINE_DIR],,
[AC_MSG_ERROR([Please reinstall readline - I cannot find readline.h])])
PHP_ADD_INCLUDE([$READLINE_DIR/include])
@ -88,9 +87,13 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
[Define to 1 if readline extension uses the 'readline' library.])
elif test "$PHP_LIBEDIT" != "no"; then
if test "$PHP_LIBEDIT" != "yes"; then
AC_MSG_WARN([libedit directory ignored, rely on pkg-config])
fi
AS_VAR_IF([PHP_LIBEDIT], [yes],,
[AC_MSG_WARN(m4_text_wrap([
The libedit directory argument is not supported anymore, rely on
pkg-config. Replace '--with-libedit=$PHP_LIBEDIT' with '--with-libedit'
and use environment variables 'PKG_CONFIG_PATH', 'EDIT_LIBS', or
'EDIT_CFLAGS'.
]))])
PKG_CHECK_MODULES([EDIT], [libedit])
PHP_EVAL_LIBLINE([$EDIT_LIBS], [READLINE_SHARED_LIBADD])

View File

@ -10,21 +10,24 @@ if test "$PHP_SOCKETS" != "no"; then
[Define to 1 if the PHP extension 'sockets' is available.])
dnl Check for field ss_family in sockaddr_storage (missing in AIX until 5.3)
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],,,[#include <sys/socket.h>])
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],,,
[#include <sys/socket.h>])
dnl Check for struct ucred. Checking the header is not enough (DragonFlyBSD).
AC_CHECK_TYPES([struct ucred],,,
[#ifndef _GNU_SOURCE
AC_CHECK_TYPES([struct ucred],,, [
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <sys/socket.h>])
#include <sys/socket.h>
])
AC_CHECK_TYPES([struct cmsgcred],,,[#include <sys/socket.h>])
AC_CHECK_TYPES([struct cmsgcred],,, [#include <sys/socket.h>])
PHP_SOCKETS_CFLAGS=-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1
case $host_alias in
*darwin*) PHP_SOCKETS_CFLAGS="$PHP_SOCKETS_CFLAGS -D__APPLE_USE_RFC_3542"
esac
AS_CASE([$host_alias],
[*darwin*],
[PHP_SOCKETS_CFLAGS="$PHP_SOCKETS_CFLAGS -D__APPLE_USE_RFC_3542"])
PHP_NEW_EXTENSION([sockets],
[sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c],
[$ext_shared],,

View File

@ -12,14 +12,15 @@ if test "$PHP_SODIUM" != "no"; then
AC_DEFINE([HAVE_LIBSODIUMLIB], [1],
[Define to 1 if the PHP extension 'sodium' is available.])
SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS"
SODIUM_COMPILER_FLAGS=$LIBSODIUM_CFLAGS
dnl Add -Wno-type-limits and -Wno-logical-op as this may arise on 32bits platforms
AC_CHECK_SIZEOF([long])
AS_IF([test "$ac_cv_sizeof_long" -eq 4], [
SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-type-limits"
AX_CHECK_COMPILE_FLAG([-Wno-logical-op],
[SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-logical-op"],, [-Werror])
[SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-logical-op"],,
[-Werror])
])
PHP_NEW_EXTENSION([sodium],

View File

@ -277,7 +277,6 @@ int main(void) {
ac_cv_crypt_sha256=no
])])
if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no"; then
AC_MSG_FAILURE([Cannot use external libcrypt as some algo are missing.])
fi
@ -366,14 +365,14 @@ PHP_ARG_WITH([password-argon2],
[AS_HELP_STRING([[--with-password-argon2]],
[Include Argon2 support in password_*])])
if test "$PHP_PASSWORD_ARGON2" != "no"; then
AS_VAR_IF([PHP_PASSWORD_ARGON2], [no],, [
PKG_CHECK_MODULES([ARGON2], [libargon2])
PHP_EVAL_INCLINE([$ARGON2_CFLAGS])
PHP_EVAL_LIBLINE([$ARGON2_LIBS])
AC_DEFINE([HAVE_ARGON2LIB], [1],
[Define to 1 if the system has the 'libargon2' library.])
fi
])
dnl
dnl Check net/if.h for net_get_interfaces. Darwin and BSD-like systems need

View File

@ -7,7 +7,9 @@ if test "$PHP_SYSVSEM" != "no"; then
PHP_NEW_EXTENSION([sysvsem], [sysvsem.c], [$ext_shared])
AC_DEFINE([HAVE_SYSVSEM], [1],
[Define to 1 if the PHP extension 'sysvsem' is available.])
AC_CHECK_TYPES([union semun],,,[#include <sys/types.h>
AC_CHECK_TYPES([union semun],,, [
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>])
#include <sys/sem.h>
])
fi