summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-10-28 19:47:21 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-10-28 19:49:26 +0100
commitc5da685240c4a9d85eae2ce34f4c1254c925c6f6 (patch)
tree7b4b401191e9c6fec10b18ed7352fd213084a4aa /configure.ac
parentcbfe5edc9ade74b56c7cbf4b0a49831325ae6e22 (diff)
Create an improved function search macro, and use it to look for res_query.
Instead of using AC_SEARCH_LIBS or AC_CHECK_LIB, create a new macro to search for function in different libraries; this is needed since the function name might just be a (preprocessor) macro for another symbol. The new macro is released under GPL2 (or later) + exception, and allows to provide a custom source code to use to test for the function.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 6 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index c8f8941..09e3518 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,20 +78,12 @@ AC_CHECK_FUNCS([memset select strndup setresuid setreuid strerror])
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, connect)
-AC_CHECK_FUNC(res_query, ,
- [AC_CHECK_LIB(resolv, res_query, [],
- [ save_libs="$LIBS"
- LIBS="-lresolv $LIBS"
- AC_MSG_CHECKING([for res_query in -lresolv (alternate version)])
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[#include <resolv.h>]], [[res_query(0,0,0,0,0)]])],
- [ AC_MSG_RESULT(yes) ],
- [ AC_MSG_RESULT(no)
- LIBS="$save_libs"
- AC_CHECK_LIB(bind, res_query,
- [], [ AC_MSG_ERROR(res_query not found) ] ) ] ) ] )
- ]
-)
+ACF_SEARCH_FUNCTION([res_query], [-lresolv, -lbind],
+ [], [AC_MSG_ERROR([res_query not found])],
+ [AC_LANG_PROGRAM([[
+ #include <resolv.h>
+ ]], [[res_query(0, 0, 0, 0, 0);]])
+ ])
ACX_PTHREAD