PHP 7 support; just for fun
[m6w6/ext-courierauth] / config.m4
1 dnl $Id$
2 dnl config.m4 for extension courierauth
3
4 PHP_ARG_WITH(courierauth, for courierauth support,
5 [ --with-courierauth
6 Path to courierauthconfig script])
7 PHP_ARG_WITH(courierauth-security-risk, whether to enable passwd security risk,
8 [ --with-courierauth-security-risk
9 Enable passwd security risk], no, no)
10
11 if test "$PHP_COURIERAUTH" != "no"; then
12 AC_MSG_CHECKING(for courierauthconfig)
13 COURIERAUTHCONFIG=
14 for i in "$PHP_COURIERAUTH_CONFIG" /usr/local/bin/courierauthconfig /usr/bin/courierauthconfig "`which courierauthconfig`"; do
15 if test -x "$i"; then
16 COURIERAUTHCONFIG="$i"
17 break
18 fi
19 done
20 if test -z "$COURIERAUTHCONFIG"; then
21 AC_MSG_ERROR(not found)
22 else
23 AC_MSG_RESULT($COURIERAUTHCONFIG)
24 fi
25
26 AC_MSG_CHECKING(for courierauth ldflags)
27 COURIERAUTH_LIBS="`$COURIERAUTHCONFIG --ldflags`"
28 AC_MSG_RESULT("$COURIERAUTH_LIBS -lcourierauth")
29 if test -z "$COURIERAUTH_LIBS"; then
30 PHP_ADD_LIBRARY(courierauth, COURIERAUTH_SHARED_LIBADD)
31 else
32 PHP_EVAL_LIBLINE("$COURIERAUTH_LIBS -lcourierauth", COURIERAUTH_SHARED_LIBADD)
33 fi
34
35 AC_MSG_CHECKING(for courierauth includes)
36 COURIERAUTH_INCS="`$COURIERAUTHCONFIG --cppflags`"
37 if test -z "$COURIERAUTH_INCS"; then
38 for i in /usr/local/include /usr/include; do
39 if test -f $i/courierauth.h; then
40 COURIERAUTH_INCS="-I$i"
41 PHP_ADD_INCLUDE($i)
42 break
43 fi
44 done
45 else
46 PHP_EVAL_INCLINE("$COURIERAUTH_INCS")
47 fi
48 AC_MSG_RESULT("$COURIERAUTH_INCS")
49
50 if test "$PHP_COURIERAUTH_SECURITY_RISK" = "yes"; then
51 AC_DEFINE(PHP_COURIERAUTH_SECURITY_RISK, 1, [passwd security risk])
52 else
53 AC_DEFINE(PHP_COURIERAUTH_SECURITY_RISK, 0, [passwd security risk])
54 fi
55
56 PHP_SUBST(COURIERAUTH_SHARED_LIBADD)
57
58 PHP_NEW_EXTENSION(courierauth, courierauth.c, $ext_shared)
59 fi