Created
December 19, 2010 21:42
-
-
Save bortzmeyer/747718 to your computer and use it in GitHub Desktop.
Testing if -lresolv is necessary or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AC_CHECK_FUNC(res_mkquery, , | |
[AC_CHECK_LIB(bind, res_mkquery, , | |
[AC_CHECK_LIB(resolv, res_mkquery, , | |
[ saved_LIBS="$LIBS" | |
LIBS="$LIBS -lresolv" | |
AC_MSG_CHECKING(for res_mkquery in -lresolv again) | |
AC_LINK_IFELSE([[ | |
#include <resolv.h> | |
int main() | |
{ | |
res_mkquery (0, 0, 0, 0, 0, 0, 0, 0, 0); | |
return 0; | |
}]], | |
LIBS="$saved_LIBS -lresolv"; AC_MSG_RESULT(yes), | |
LIBS="$saved_LIBS"; AC_MSG_RESULT(no) | |
[AC_MSG_ERROR([No DNS resolver development environment found])])])])]) | |
dnl in the Makefile.in: | |
dnl LDFLAGS=@LIBS@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment