Remove dependency on libresolv
This commit is contained in:
parent
3c10a522cd
commit
d6f82eb3d5
7 changed files with 111 additions and 649 deletions
43
configure.ac
43
configure.ac
|
@ -48,49 +48,6 @@ AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
|
|||
AC_SUBST(OBJXMPP_STATIC_LIB, "libobjxmpp.a")
|
||||
])
|
||||
|
||||
# This is an adapted version of what glib does for res_query
|
||||
# It should recognize the correct library on (at least) Linux,
|
||||
# NetBSD, FreeBSD, Mac OS X and Haiku
|
||||
AC_MSG_CHECKING([for res_nsearch])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>],
|
||||
[res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[save_libs="$LIBS"
|
||||
LIBS="$LIBS -lresolv"
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>],
|
||||
[res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
|
||||
[AC_MSG_RESULT([in -lresolv])],
|
||||
[LIBS="$save_libs -lnetwork"
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>],
|
||||
[res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
|
||||
[AC_MSG_RESULT([in -lnetwork])],
|
||||
[LIBS="$save_libs -lbind"
|
||||
AC_TRY_LINK([#include <resolv.h>],
|
||||
[res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
|
||||
[AC_MSG_RESULT([in -lbind])],
|
||||
[AC_MSG_ERROR(not found)])])])])
|
||||
|
||||
AC_MSG_CHECKING([for res_ndestroy])
|
||||
AC_TRY_LINK([
|
||||
#include <resolv.h>
|
||||
], [
|
||||
res_ndestroy(&_res)
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RES_NDESTROY, 1, [Whether we have res_ndestroy])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_CHECK_LIB(objopenssl, main, [
|
||||
AC_SUBST(OBJOPENSSL_LIBS, "-lobjopenssl -lcrypto")
|
||||
AC_SUBST(OBJOPENSSL_FRAMEWORK_LIBS, "-framework ObjOpenSSL -lcrypto")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue