1 dnl ** Additional Autoconf tests for BIRD configure script
2 dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
4 AC_DEFUN([BIRD_CHECK_THREAD_LOCAL],
7 [whether _Thread_local is known],
8 [bird_cv_thread_local],
12 _Thread_local static int x = 42;
17 [bird_cv_thread_local=yes],
18 [bird_cv_thread_local=no]
23 AC_DEFUN([BIRD_CHECK_PTHREADS],
25 bird_tmp_cflags="$CFLAGS"
26 CFLAGS="$CFLAGS -pthread"
29 [whether POSIX threads are available],
30 [bird_cv_lib_pthreads],
35 [ #include <pthread.h> ],
38 pthread_create(&pt, NULL, NULL, NULL);
39 pthread_spinlock_t lock;
40 pthread_spin_lock(&lock);
44 [bird_cv_lib_pthreads=yes],
45 [bird_cv_lib_pthreads=no]
50 CFLAGS="$bird_tmp_cflags"
53 AC_DEFUN([BIRD_CHECK_MPLS_KERNEL],
56 [for Linux MPLS headers],
57 [bird_cv_mpls_kernel],
63 #include <linux/lwtunnel.h>
64 #include <linux/netlink.h>
65 #include <linux/rtnetlink.h>
66 #include <sys/socket.h>
76 t(LWTUNNEL_ENCAP_MPLS);
80 [bird_cv_mpls_kernel=yes],
81 [bird_cv_mpls_kernel=no]
87 AC_DEFUN([BIRD_CHECK_ANDROID_GLOB],
98 [ glob(NULL, 0, NULL, NULL); ]
101 [bird_cv_lib_glob=yes],
103 bird_tmp_libs="$LIBS"
104 LIBS="$LIBS -landroid-glob"
111 [ glob(NULL, 0, NULL, NULL); ]
114 [bird_cv_lib_glob=-landroid-glob],
115 [bird_cv_lib_glob=no]
117 LIBS="$bird_tmp_libs"
123 AC_DEFUN([BIRD_CHECK_ANDROID_LOG],
126 [for syslog lib flags],
130 [ #include <sys/syslog.h> ],
134 [bird_cv_lib_log=yes],
136 bird_tmp_libs="$LIBS"
140 [ #include <sys/syslog.h> ],
144 [bird_cv_lib_log=-llog],
147 LIBS="$bird_tmp_libs"
153 AC_DEFUN([BIRD_CHECK_LTO],
155 bird_tmp_cflags="$CFLAGS"
156 bird_tmp_ldflags="$LDFLAGS"
161 [whether link time optimizer is available],
172 CFLAGS="$bird_tmp_cflags"
173 LDFLAGS="$bird_tmp_ldflags"
177 AC_DEFUN([BIRD_CHECK_GCC_OPTION],
179 bird_tmp_cflags="$CFLAGS"
183 [whether CC supports $2],
194 CFLAGS="$bird_tmp_cflags"
197 AC_DEFUN([BIRD_ADD_GCC_OPTION],
199 if test "$$1" = yes ; then
204 # BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE])
205 # copied from autoconf internal _AC_PATH_PROG_FLAVOR_GNU
206 AC_DEFUN([BIRD_CHECK_PROG_FLAVOR_GNU],
209 case `"$1" --version 2>&1` in
222 AC_DEFUN([BIRD_CHECK_BISON_VERSION],
224 $1=`bison --version | ( read line; echo ${line##* } )`
226 1.* | 2.0* | 2.1* | 2.2* | 2.3*)
227 AC_MSG_ERROR([Provided Bison version $$1 is too old, need at least 2.4])
230 bird_bison_synclines=no
231 bird_bison_enhanced_error=no
233 3.* | 4.* | 5.* | 6.* | 7.* | 8.* | 9.*)
234 bird_bison_synclines=yes
235 bird_bison_enhanced_error=yes
238 AC_MSG_ERROR([Couldn't parse Bison version $$1. Call the developers for help.])