-
Notifications
You must be signed in to change notification settings - Fork 7.8k
/
config.m4
32 lines (26 loc) · 1 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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"],,
[-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])
fi