-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
75 lines (60 loc) · 1.71 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
dnl config.m4 for extension nis
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.
dnl If your extension references something external, use with:
PHP_ARG_WITH(nis, for nis support,
[ --with-nis Include nis support])
if test "$PHP_NIS" != "no"; then
AC_DEFINE(HAVE_NIS,1,[ ])
NIS_PARAMETER="$CPPLAGS"
PHP_SUBST(LDFLAGS)
PHP_SUBST(CPPFLAGS)
SEARCH_PATH="/usr /usr/local $PHP_NIS $LIBSEARCH"
parch=`uname -m`
test "$parch" = "x86_64" && NIS_LIBDIR="lib64" || NIS_LIBDIR="lib"
for i in $SEARCH_PATH
do
if test -f $i/$NIS_LIBDIR/libnsl.$SHLIB_SUFFIX_NAME -o -f $i/$NIS_LIBDIR/libnsl.a ; then
NIS_LIB_DIR=$i/$NIS_LIBDIR
break
fi
done
if test -z "$NIS_LIB_DIR"; then
AC_MSG_ERROR([libnsl.(a|so) not found.])
fi
dnl Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/types.h grp.h pwd.h)
dnl Checks for library functions.
PHP_CHECK_LIBRARY(nsl, yp_get_default_domain,
[
PHP_ADD_LIBRARY_WITH_PATH(nsl, $NIS_LIB_DIR, NIS_SHARED_LIBADD)
],[
AC_MSG_ERROR([wrong nsl library version or library not found])
],[
-L$NIS_LIB_DIR -lnsl
])
PHP_CHECK_LIBRARY(nsl, yp_match,
[ ],[
AC_MSG_ERROR([wrong nsl library version or library not found])
],[
-L$NIS_LIB_DIR -lnsl
])
PHP_CHECK_LIBRARY(nsl, yperr_string,
[ ],[
AC_MSG_ERROR([wrong nsl library version or library not found])
],[
-L$NIS_LIB_DIR -lnsl
])
PHP_CHECK_LIBRARY(crypt, crypt,
[
PHP_ADD_LIBRARY_WITH_PATH(crypt, $NIS_LIB_DIR, NIS_SHARED_LIBADD)
],[
AC_MSG_ERROR([wrong crypt library version or library not found])
],[
-L$NIS_LIB_DIR -lcrypt
])
PHP_SUBST(NIS_SHARED_LIBADD)
PHP_NEW_EXTENSION(nis, php_nis.c, $ext_shared)
fi