Commit 924c77fc authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Improve detection of resolv header and library.

parent 590ce1d3
...@@ -96,28 +96,25 @@ fi ...@@ -96,28 +96,25 @@ fi
ANTLR_LIBS="$ANTLR_LIBS -lantlr3c" ANTLR_LIBS="$ANTLR_LIBS -lantlr3c"
dnl check antlr headers dnl check antlr headers
use_libresolv=no
CPPFLAGS_save=$CPPFLAGS CPPFLAGS_save=$CPPFLAGS
CPPFLAGS="$ANTLR_CFLAGS $CPPFLAGS" CPPFLAGS="$ANTLR_CFLAGS $CPPFLAGS"
AC_CHECK_HEADERS([antlr3.h], [found_antlr3=yes]) AC_CHECK_HEADERS([antlr3.h], [found_antlr3=yes])
AC_CHECK_DECL( [antlr3StringStreamNew] AC_CHECK_DECL([antlr3StringStreamNew]
,[AC_DEFINE(HAVE_ANTLR_STRING_STREAM_NEW,1,[Defined when antlr 3.4 api is detected])] ,[AC_DEFINE(HAVE_ANTLR_STRING_STREAM_NEW,1,[Defined when antlr 3.4 api is detected])]
,[foo=bar] ,[foo=bar]
,[#include <antlr3.h>]) ,[#include <antlr3.h>])
AC_CHECK_DECL( [res_ndestroy] libresolv_have_res_get_servers=no
,[AC_DEFINE(HAVE_RESINIT,1,[Defined when res_ninit api is available]) use_libresolv=yes] resolv_h_hav_res_ndestroy=no
AC_CHECK_LIB([resolv], [res_getservers]
,[libresolv_have_res_get_servers=yes]
,[foo=bar])
AC_CHECK_DECL([res_ndestroy]
,[resolv_h_hav_res_ndestroy=yes]
,[foo=bar] ,[foo=bar]
,[#include <resolv.h>]) ,[#include <resolv.h>])
case "$target_os" in if test "${libresolv_have_res_get_servers}${resolv_h_hav_res_ndestroy}" == "yesyes" ; then
*nto-qnx*) AC_DEFINE(HAVE_RESINIT,1,[Defined when res_ninit api is available])
# libresolv is not available on QNX fi
;;
*)
if test "$use_libresolv" == "yes" ; then
LIBS="$LIBS -lresolv"
fi
;;
esac
CPPFLAGS=$CPPFLAGS_save CPPFLAGS=$CPPFLAGS_save
if test "$found_antlr3" != "yes" ; then if test "$found_antlr3" != "yes" ; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment