1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/sodium/config.m4
Peter Kokot f64c6248b5 Autotools: Update ax_check_compile_flag.m4 to serial 11 (#19127)
```sh
wget -O build/ax_check_compile_flag.m4 \
  https://cgit.git.savannah.gnu.org/cgit/autoconf-archive.git/plain/m4/ax_check_compile_flag.m4
```

New version of AX_CHECK_COMPILE_FLAG macro now adds the -Werror flag
automatically, if GNU-compatible compiler is detected.
2025-08-09 02:03:37 +02:00

32 lines
1011 B
Plaintext

PHP_ARG_WITH([sodium],
[for sodium support],
[AS_HELP_STRING([--with-sodium],
[Include sodium support])])
if test "$PHP_SODIUM" != "no"; then
PKG_CHECK_MODULES([LIBSODIUM], [libsodium >= 1.0.8])
PHP_EVAL_INCLINE([$LIBSODIUM_CFLAGS])
PHP_EVAL_LIBLINE([$LIBSODIUM_LIBS], [SODIUM_SHARED_LIBADD])
AC_DEFINE([HAVE_LIBSODIUMLIB], [1],
[Define to 1 if the PHP extension 'sodium' is available.])
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"])
])
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])
fi