1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add -Wno-type-limits and -Wno-logical-op only on 32-bit (#14271)

For ext/sodium these two flags can be added conditionally only for the
32-bit target architecture.
This commit is contained in:
Peter Kokot
2024-05-20 12:31:07 +02:00
committed by GitHub
parent b7dd3d8347
commit 39b48f8473

View File

@@ -11,9 +11,16 @@ if test "$PHP_SODIUM" != "no"; then
AC_DEFINE(HAVE_LIBSODIUMLIB, 1, [ ])
SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS"
dnl Add -Wno-type-limits and -Wno-logical-op as this may arise on 32bits platforms
SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS -Wno-type-limits"
AX_CHECK_COMPILE_FLAG([-Wno-logical-op], SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-logical-op", , [-Werror])
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])
])
PHP_NEW_EXTENSION(sodium, libsodium.c sodium_pwhash.c, $ext_shared, , $SODIUM_COMPILER_FLAGS)
PHP_INSTALL_HEADERS([ext/sodium], [php_libsodium.h])
PHP_SUBST(SODIUM_SHARED_LIBADD)