- improve checks for ld an cpp flags
authorMichael Wallner <mike@php.net>
Mon, 11 Dec 2006 13:08:01 +0000 (13:08 +0000)
committerMichael Wallner <mike@php.net>
Mon, 11 Dec 2006 13:08:01 +0000 (13:08 +0000)
git-svn-id: http://svn.php.net/repository/pecl/courierauth/trunk@224828 c90b9560-bf6c-de11-be94-00142212c4b1

config.m4

index 682c1a78151a541a0f65b923666521abf32dbc34..6cdf750e5150802b60740df003f2f519a70328dd 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -23,8 +23,29 @@ if test "$PHP_COURIERAUTH" != "no"; then
                AC_MSG_RESULT($COURIERAUTHCONFIG)
        fi
        
-       PHP_EVAL_LIBLINE("`$COURIERAUTHCONFIG --ldflags` -lcourierauth", COURIERAUTH_SHARED_LIBADD)
-       PHP_EVAL_INCLINE(`$COURIERAUTHCONFIG --cppflags`)
+       AC_MSG_CHECKING(for courierauth ldflags)
+       COURIERAUTH_LIBS="`$COURIERAUTHCONFIG --ldflags`"
+       AC_MSG_RESULT("$COURIERAUTH_LIBS -lcourierauth")
+       if test -z "$COURIERAUTH_LIBS"; then
+               PHP_ADD_LIBRARY(courierauth, COURIERAUTH_SHARED_LIBADD)
+       else
+               PHP_EVAL_LIBLINE("$COURIERAUTH_LIBS -lcourierauth", COURIERAUTH_SHARED_LIBADD)
+       fi
+       
+       AC_MSG_CHECKING(for courierauth includes)
+       COURIERAUTH_INCS="`$COURIERAUTHCONFIG --cppflags`"
+       if test -z "$COURIERAUTH_INCS"; then
+               for i in /usr/local/include /usr/include; do
+                       if test -f $i/courierauth.h; then
+                               COURIERAUTH_INCS="-I$i"
+                               PHP_ADD_INCLUDE($i)
+                               break
+                       fi
+               done
+       else
+               PHP_EVAL_INCLINE("$COURIERAUTH_INCS")
+       fi
+       AC_MSG_RESULT("$COURIERAUTH_INCS")
        
        if test "$PHP_COURIERAUTH_SECURITY_RISK" = "yes"; then
                AC_DEFINE(PHP_COURIERAUTH_SECURITY_RISK, 1, [passwd security risk])