Sam Varshavchik napsal(a):
I don't know the right way to fix this, but something is
broken; and something needs to be fixed, one way or the other. The
question is what exactly needs to be fixed.
AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
/tmp/ccW7EeDX.o(.text+0x7): In function `main':
/home/mrsam/src/courier/authlib/configure:5160: undefined reference to
The reason appears to be that you have to #include
x86_64 in order to succesfully pull res_query() out of libresolv.so.
You don't need to do this on x86, and the test program generated by
AC_TRY_LINK_FUNC does not include any headers, but uses a manual prototype.
So, what now?
Fetchmail uses this (after checking for the presence of the
| #include <sys/types.h>
| #ifdef HAVE_NETINET_IN_H
| #include <netinet/in.h>
| #ifdef HAVE_ARPA_NAMESER_H
| #include <arpa/nameser.h>
| #ifdef HAVE_RESOLV_H
| #include <resolv.h>
| extern int res_search();
| ]], [[res_search(0, 0, 0, 0, 0);]])],
| AC_DEFINE(HAVE_RES_SEARCH, ,
| [Define to 1 if you have the 'res_search' function.])
| break], [AC_MSG_RESULT([not found])])