-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
executable file
·48 lines (43 loc) · 1.3 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PHP_ARG_ENABLE(getdns,
[whether to enable the "getdns" extension],
[ --enable-getdns Enable getdns support])
if test "$PHP_GETDNS" != "no"; then
AC_MSG_CHECKING(for libgetdns in default path)
for i in /usr/local /usr; do
for j in so dylib; do
if test -r $i/lib/libgetdns.$j; then
GETDNS_DIR=$i
AC_MSG_RESULT(found libgetdns.$j in $i)
fi
done
done
if test -z "$GETDNS_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please install the libgetdns library)
fi
AC_MSG_CHECKING([getdns header files])
GETDNS_INC_DIR="/usr/local/include/getdns"
INC_FILES="$GETDNS_INC_DIR/getdns.h $GETDNS_INC_DIR/getdns_extra.h"
for i in $INC_FILES; do
if test ! -f $i; then
AC_MSG_ERROR([getdns header files not found in $GETDNS_INC_DIR])
fi
done
AC_MSG_RESULT($GETDNS_INC_DIR)
PHP_CHECK_LIBRARY(getdns, getdns_context_create,
[
AC_DEFINE(HAVE_LIBGETDNS, 1, [ ])
],
[
AC_MSG_ERROR([Invalid libgetdns.])
],
[
-L$GETDNS_DIR/lib -lgetdns
]
)
PHP_SUBST(GETDNS_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(getdns, $GETDNS_DIR/lib, GETDNS_SHARED_LIBADD)
PHP_ADD_INCLUDE($GETDNS_INC_DIR)
AC_DEFINE(HAVE_GETDNS, 1, [whether the getdns extension is enabled])
PHP_NEW_EXTENSION(getdns, phpgetdns.c, $ext_shared)
fi