]> git.ipfire.org Git - thirdparty/bird.git/blob - aclocal.m4
RAdv: Buffer prefixes awhile after they disappear
[thirdparty/bird.git] / aclocal.m4
1 dnl ** Additional Autoconf tests for BIRD configure script
2 dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
3
4 AC_DEFUN([BIRD_CHECK_PTHREADS],
5 [
6 bird_tmp_cflags="$CFLAGS"
7 CFLAGS="$CFLAGS -pthread"
8
9 AC_CACHE_CHECK(
10 [whether POSIX threads are available],
11 [bird_cv_lib_pthreads],
12 [
13 AC_LINK_IFELSE(
14 [
15 AC_LANG_PROGRAM(
16 [ #include <pthread.h> ],
17 [
18 pthread_t pt;
19 pthread_create(&pt, NULL, NULL, NULL);
20 pthread_spinlock_t lock;
21 pthread_spin_lock(&lock);
22 ]
23 )
24 ],
25 [bird_cv_lib_pthreads=yes],
26 [bird_cv_lib_pthreads=no]
27 )
28 ]
29 )
30
31 CFLAGS="$bird_tmp_cflags"
32 ])
33
34 AC_DEFUN([BIRD_CHECK_GCC_OPTION],
35 [
36 bird_tmp_cflags="$CFLAGS"
37 CFLAGS="$3 $2"
38
39 AC_CACHE_CHECK(
40 [whether CC supports $2],
41 [$1],
42 [
43 AC_COMPILE_IFELSE(
44 [AC_LANG_PROGRAM()],
45 [$1=yes],
46 [$1=no]
47 )
48 ]
49 )
50
51 CFLAGS="$bird_tmp_cflags"
52 ])
53
54 AC_DEFUN([BIRD_ADD_GCC_OPTION],
55 [
56 if test "$$1" = yes ; then
57 CFLAGS="$CFLAGS $2"
58 fi
59 ])
60
61 # BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE])
62 # copied from autoconf internal _AC_PATH_PROG_FLAVOR_GNU
63 AC_DEFUN([BIRD_CHECK_PROG_FLAVOR_GNU],
64 [
65 # Check for GNU $1
66 case `"$1" --version 2>&1` in
67 *GNU*)
68 $2
69 ;;
70 m4_ifval([$3],
71 [*)
72 $3
73 ;;
74 ]
75 )
76 esac
77 ])