44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
AC_PATH_TOOL(AR, ar)
AC_PROG_RANLIB
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")
], [
AC_MSG_ERROR(You need ObjOpenSSL installed!)
])
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
AC_PATH_TOOL(AR, ar)
AC_PROG_RANLIB
AC_SUBST(OBJXMPP_STATIC_LIB, "libobjxmpp.a")
])
AC_CHECK_LIB(objopenssl, main, [
AC_SUBST(OBJOPENSSL_LIBS, "-lobjopenssl -lcrypto")
AC_SUBST(OBJOPENSSL_FRAMEWORK_LIBS, "-framework ObjOpenSSL -lcrypto")
], [
AC_MSG_ERROR(You need ObjOpenSSL installed!)
])
|