etc/services - sync with NetBSD-8
[minix.git] / external / bsd / bind / dist / contrib / perftcpdns / configure.in
blob661b67127ce781cf4a3c15c27ac61ab384c89be7
1 # Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
3 # Permission to use, copy, modify, and/or distribute this software for any
4 # purpose with or without fee is hereby granted, provided that the above
5 # copyright notice and this permission notice appear in all copies.
7 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9 # AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
12 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13 # PERFORMANCE OF THIS SOFTWARE.
15 AC_INIT(perftcpdns.c)
17 AC_PREREQ(2.13)
19 AC_PROG_CC
21 AC_CHECK_LIB(m, sqrt)
22 AC_CHECK_LIB(rt, clock_gettime)
24 AC_MSG_CHECKING(epoll support)
25 AC_TRY_RUN([
26 #include <sys/epoll.h>
27 int main() {
28         if (epoll_create(1) < 0)
29                 return (1);
30         return (0);
32 ], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(epoll not found)])
34 case "$host" in
35         *-freebsd*)
36                 # We don't want to set -lpthread as that break
37                 # the ability to choose threads library at final
38                 # link time and is not valid for all architectures.
39                 
40                 PTHREAD=
41                 if test "X$GCC" = "Xyes"; then
42                         saved_cc="$CC"
43                         CC="$CC -pthread"
44                         AC_MSG_CHECKING(for gcc -pthread support);
45                         AC_TRY_LINK([#include <pthread.h>],
46                                     [printf("%x\n", pthread_create);],
47                                     PTHREAD="yes"
48                                     AC_MSG_RESULT(yes),
49                                     AC_MSG_RESULT(no))
50                         CC="$saved_cc"
51                 fi
52                 if test "X$PTHREAD" != "Xyes"; then
53                         AC_CHECK_LIB(pthread, pthread_create,,
54                         AC_CHECK_LIB(thr, thread_create,,
55                         AC_CHECK_LIB(c_r, pthread_create,,
56                         AC_CHECK_LIB(c, pthread_create,,
57                         AC_MSG_ERROR("could not find thread libraries")))))
58                 fi
59                 ;;
60         *)
61                 AC_CHECK_LIB(pthread, pthread_create,,
62                         AC_CHECK_LIB(pthread, __pthread_create,,
63                         AC_CHECK_LIB(pthread, __pthread_create_system,,
64                         AC_CHECK_LIB(c_r, pthread_create,,
65                         AC_CHECK_LIB(c, pthread_create,,
66                         AC_MSG_ERROR("could not find thread libraries"))))))
67         ;;
68 esac
70 AC_OUTPUT(Makefile)