Annotation of embedaddon/bird/aclocal.m4, revision 1.1.1.2
1.1 misho 1: dnl ** Additional Autoconf tests for BIRD configure script
2: dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
3:
1.1.1.2 ! misho 4: AC_DEFUN([BIRD_CHECK_PTHREADS],
1.1 misho 5: [
6: bird_tmp_cflags="$CFLAGS"
7: CFLAGS="$CFLAGS -pthread"
1.1.1.2 ! misho 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: )
1.1 misho 30:
31: CFLAGS="$bird_tmp_cflags"
32: ])
33:
1.1.1.2 ! misho 34: AC_DEFUN([BIRD_CHECK_ANDROID_GLOB],
1.1 misho 35: [
1.1.1.2 ! misho 36: AC_CACHE_CHECK(
! 37: [for glob.h],
! 38: [bird_cv_lib_glob],
! 39: AC_LINK_IFELSE([
! 40: AC_LANG_PROGRAM(
! 41: [
! 42: #include <glob.h>
! 43: #include <stdlib.h>
! 44: ],
! 45: [ glob(NULL, 0, NULL, NULL); ]
! 46: )
! 47: ],
! 48: [bird_cv_lib_glob=yes],
! 49: [
! 50: bird_tmp_libs="$LIBS"
! 51: LIBS="$LIBS -landroid-glob"
! 52: AC_LINK_IFELSE([
! 53: AC_LANG_PROGRAM(
! 54: [
! 55: #include <glob.h>
! 56: #include <stdlib.h>
! 57: ],
! 58: [ glob(NULL, 0, NULL, NULL); ]
! 59: )
! 60: ],
! 61: [bird_cv_lib_glob=-landroid-glob],
! 62: [bird_cv_lib_glob=no]
! 63: )
! 64: LIBS="$bird_tmp_libs"
! 65: ]
! 66: )
! 67: )
! 68: ])
! 69:
! 70: AC_DEFUN([BIRD_CHECK_ANDROID_LOG],
! 71: [
! 72: AC_CACHE_CHECK(
! 73: [for syslog lib flags],
! 74: [bird_cv_lib_log],
! 75: AC_LINK_IFELSE([
! 76: AC_LANG_PROGRAM(
! 77: [ #include <sys/syslog.h> ],
! 78: [ syslog(0, ""); ]
! 79: )
! 80: ],
! 81: [bird_cv_lib_log=yes],
! 82: [
! 83: bird_tmp_libs="$LIBS"
! 84: LIBS="$LIBS -llog"
! 85: AC_LINK_IFELSE([
! 86: AC_LANG_PROGRAM(
! 87: [ #include <sys/syslog.h> ],
! 88: [ syslog(0, ""); ]
! 89: )
! 90: ],
! 91: [bird_cv_lib_log=-llog],
! 92: [bird_cv_lib_log=no]
! 93: )
! 94: LIBS="$bird_tmp_libs"
! 95: ]
! 96: )
! 97: )
! 98: ])
1.1 misho 99:
1.1.1.2 ! misho 100: AC_DEFUN([BIRD_CHECK_GCC_OPTION],
! 101: [
! 102: bird_tmp_cflags="$CFLAGS"
1.1 misho 103: CFLAGS="$3 $2"
1.1.1.2 ! misho 104:
! 105: AC_CACHE_CHECK(
! 106: [whether CC supports $2],
! 107: [$1],
! 108: [
! 109: AC_COMPILE_IFELSE(
! 110: [AC_LANG_PROGRAM()],
! 111: [$1=yes],
! 112: [$1=no]
! 113: )
! 114: ]
! 115: )
1.1 misho 116:
117: CFLAGS="$bird_tmp_cflags"
118: ])
119:
1.1.1.2 ! misho 120: AC_DEFUN([BIRD_ADD_GCC_OPTION],
1.1 misho 121: [
122: if test "$$1" = yes ; then
123: CFLAGS="$CFLAGS $2"
124: fi
125: ])
126:
127: # BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE])
1.1.1.2 ! misho 128: # copied from autoconf internal _AC_PATH_PROG_FLAVOR_GNU
! 129: AC_DEFUN([BIRD_CHECK_PROG_FLAVOR_GNU],
! 130: [
! 131: # Check for GNU $1
! 132: case `"$1" --version 2>&1` in
! 133: *GNU*)
! 134: $2
! 135: ;;
! 136: m4_ifval([$3],
! 137: [*)
! 138: $3
! 139: ;;
! 140: ]
! 141: )
! 142: esac
! 143: ])
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>