From 10b2530b3c3e83a083c0241f52e193f33b79c315 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 8 Jan 2009 13:35:36 +0000 Subject: [PATCH] this should finally do it git-svn-id: http://svn.php.net/repository/pecl/ares/trunk@273072 c90b9560-bf6c-de11-be94-00142212c4b1 --- config.m4 | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/config.m4 b/config.m4 index 1b96e73..77c2592 100644 --- a/config.m4 +++ b/config.m4 @@ -18,21 +18,27 @@ if test "$PHP_ARES" != "no"; then AC_MSG_ERROR(could not find ares.h) fi - PHP_ADD_LIBRARY(rt, ARES_SHARED_LIBADD) + dnl ########## + dnl newer versions of libcares need -lrt + dnl ########## + PHP_ADD_LIBRARY(rt, 1, ARES_SHARED_LIBADD) + PHP_ARES_LIB= PHP_CHECK_LIBRARY(cares, ares_init, [ PHP_ARES_LIB=cares + echo $LDFLAGS ], [ + echo $LDFLAGS PHP_CHECK_LIBRARY(ares, ares_init, [ PHP_ARES_LIB=ares ], [ PHP_ARES_LIB=unknown ], [ - -L$PHP_ARES_DIR/$PHP_LIBDIR + -lrt -L$PHP_ARES_DIR/$PHP_LIBDIR ] ) ], [ - -L$PHP_ARES_DIR/$PHP_LIBDIR + -lrt -L$PHP_ARES_DIR/$PHP_LIBDIR ] ) AC_MSG_CHECKING(for libares/libcares) @@ -51,28 +57,28 @@ if test "$PHP_ARES" != "no"; then PHP_CHECK_LIBRARY($PHP_ARES_LIB, ares_cancel, [AC_DEFINE([HAVE_ARES_CANCEL], [1], [ ])], [ ], - [-L$PHP_ARES_DIR/$PHP_LIBDIR] + [-lrt -L$PHP_ARES_DIR/$PHP_LIBDIR] ) PHP_CHECK_LIBRARY($PHP_ARES_LIB, ares_getnameinfo, [AC_DEFINE([HAVE_ARES_GETNAMEINFO], [1], [ ])], [ ], - [-L$PHP_ARES_DIR/$PHP_LIBDIR] + [-lrt -L$PHP_ARES_DIR/$PHP_LIBDIR] ) PHP_CHECK_LIBRARY($PHP_ARES_LIB, ares_getsock, [AC_DEFINE([HAVE_ARES_GETSOCK], [1], [ ])], [ ], - [-L$PHP_ARES_DIR/$PHP_LIBDIR] + [-lrt -L$PHP_ARES_DIR/$PHP_LIBDIR] ) PHP_CHECK_LIBRARY($PHP_ARES_LIB, ares_version, [AC_DEFINE([HAVE_ARES_VERSION], [1], [ ])], [ ], - [-L$PHP_ARES_DIR/$PHP_LIBDIR] + [-lrt -L$PHP_ARES_DIR/$PHP_LIBDIR] ) - - dnl check new c-ares API - + dnl ########## + dnl check new c-ares callback API + dnl ########## save_LIBS=$LIBS save_CFLAGS=$CFLAGS - LIBS="-L $PHP_ARES_DIR/$PHP_LIBDIR -l $PHP_ARES_LIB" - CFLAGS="-I$PHP_ARES_DIR/include -pedantic-errors" + LDFLIBS="-L$PHP_ARES_DIR/$PHP_LIBDIR -l$PHP_ARES_LIB -lrt" + CFLAGS="-I$PHP_ARES_DIR/include -Werror" AC_MSG_CHECKING(for new c-ares callback API) AC_TRY_COMPILE( -- 2.30.2