xref: /PHP-8.3/ext/sodium/config.m4 (revision 3c84f656)
1PHP_ARG_WITH([sodium],
2  [for sodium support],
3  [AS_HELP_STRING([--with-sodium],
4    [Include sodium support])])
5
6if test "$PHP_SODIUM" != "no"; then
7  PKG_CHECK_MODULES([LIBSODIUM], [libsodium >= 1.0.8])
8
9  PHP_EVAL_INCLINE($LIBSODIUM_CFLAGS)
10  PHP_EVAL_LIBLINE($LIBSODIUM_LIBS, SODIUM_SHARED_LIBADD)
11
12  AC_DEFINE(HAVE_LIBSODIUMLIB, 1, [ ])
13
14  dnl Add -Wno-type-limits and -Wno-logical-op as this may arise on 32bits platforms
15  SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS -Wno-type-limits"
16  AX_CHECK_COMPILE_FLAG([-Wno-logical-op], SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-logical-op", , [-Werror])
17  PHP_NEW_EXTENSION(sodium, libsodium.c sodium_pwhash.c, $ext_shared, , $SODIUM_COMPILER_FLAGS)
18  PHP_SUBST(SODIUM_SHARED_LIBADD)
19fi
20