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.
22 AC_CHECK_LIB(rt, clock_gettime)
24 AC_MSG_CHECKING(epoll support)
26 #include <sys/epoll.h>
28 if (epoll_create(1) < 0)
32 ], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(epoll not found)])
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.
41 if test "X$GCC" = "Xyes"; then
44 AC_MSG_CHECKING(for gcc -pthread support);
45 AC_TRY_LINK([#include <pthread.h>],
46 [printf("%x\n", pthread_create);],
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")))))
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"))))))