-
Notifications
You must be signed in to change notification settings - Fork 11
/
aclocal.m4
36 lines (35 loc) · 958 Bytes
/
aclocal.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- Autoconf -*-
AC_DEFUN([RESOLV_SEARCH_LIBS],
[AS_VAR_PUSHDEF([ac_Search], [ac_cv_search_$1])dnl
AC_CACHE_CHECK([for library containing $1], [ac_Search],
[ac_func_search_save_LIBS=$LIBS
AC_LANG_CONFTEST([AC_LANG_PROGRAM([[
#include <sys/types.h>
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h>
#endif
#include <resolv.h>
]], [$2])])
for ac_lib in '' $3; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $6 $ac_func_search_save_LIBS"
fi
AC_LINK_IFELSE([], [AS_VAR_SET([ac_Search], [$ac_res])])
AS_VAR_SET_IF([ac_Search], [break])
done
AS_VAR_SET_IF([ac_Search], , [AS_VAR_SET([ac_Search], [no])])
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS])
AS_VAR_COPY([ac_res], [ac_Search])
AS_IF([test "$ac_res" != no],
[test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$4],
[$5])
AS_VAR_POPDEF([ac_Search])dnl
])