Revision 5d6dc930 aclocal.m4

View differences:

aclocal.m4
1 1
dnl ** Additional Autoconf tests for BIRD configure script
2 2
dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
3 3

  
4
AC_DEFUN([BIRD_CHECK_INTEGERS],
5
[AC_CHECK_SIZEOF(char, 0)
6
AC_CHECK_SIZEOF(short int, 0)
7
AC_CHECK_SIZEOF(int, 0)
8
AC_CHECK_SIZEOF(long int, 0)
9
AC_CHECK_SIZEOF(long long int, 0)
10
AH_TEMPLATE([INTEGER_8],  [8-bit integer type])
11
AH_TEMPLATE([INTEGER_16], [16-bit integer type])
12
AH_TEMPLATE([INTEGER_32], [32-bit integer type])
13
AH_TEMPLATE([INTEGER_64], [64-bit integer type])
14

  
15
for size in 1 2 4 8; do
16
	bits=`expr $size "*" 8`
17
	AC_MSG_CHECKING([for $bits-bit type])
18
	if test $ac_cv_sizeof_int = $size ; then
19
		res=int
20
	elif test $ac_cv_sizeof_char = $size ; then
21
		res=char
22
	elif test $ac_cv_sizeof_short_int = $size ; then
23
		res="short int"
24
	elif test $ac_cv_sizeof_long_int = $size ; then
25
		res="long int"
26
	elif test $ac_cv_sizeof_long_long_int = $size ; then
27
		res="long long int"
28
	else
29
		AC_MSG_RESULT([not found])
30
		AC_MSG_ERROR([Cannot find $bits-bit integer type.])
31
	fi
32
	AC_MSG_RESULT($res)
33
	AC_DEFINE_UNQUOTED(INTEGER_$bits, $res)
34
	done
35
])
36

  
37
dnl BIRD_CHECK_ENDIAN is unused and obsolete
38
AC_DEFUN([BIRD_CHECK_ENDIAN],
39
[AC_CACHE_CHECK([CPU endianity], bird_cv_c_endian,[
40
AC_TRY_RUN([
41
#include <stdio.h>
42

  
43
unsigned int x = 0x12345678;
44
unsigned char *z = (unsigned char *) &x;
45

  
46
int main(void)
47
{
48
  FILE *f = fopen("conftestresult", "w");
49
  if (!f) return 10;
50
  fprintf(f, "%02x %02x %02x %02x", *z, *(z+1), *(z+2), *(z+3));
51
  fclose(f);
52
  exit(0);
53
}
54
],[
55
	endian=`cat conftestresult`
56
	if test "$endian" = "12 34 56 78" ; then
57
		bird_cv_c_endian=big-endian
58
	elif test "$endian" = "78 56 34 12" ; then
59
		bird_cv_c_endian=little-endian
60
	fi
61
],[endian="test program failed"],[endian="not available, we're cross compiling"])
62
if test -z "$bird_cv_c_endian" ; then
63
	AC_MSG_RESULT($endian)
64
	AC_MSG_ERROR([Cannot determine CPU endianity.])
65
	fi
66
])
67
case $bird_cv_c_endian in
68
	big-endian)	AC_DEFINE(CPU_BIG_ENDIAN) ;;
69
	little-endian)	AC_DEFINE(CPU_LITTLE_ENDIAN) ;;
70
	esac
71
])
72

  
73 4
AC_DEFUN([BIRD_CHECK_STRUCT_ALIGN],
74 5
[AC_CACHE_CHECK([usual alignment of structures],bird_cv_c_struct_align,[
75 6
AC_TRY_RUN([
......
126 57
	esac
127 58
])
128 59

  
129
AC_DEFUN([BIRD_CHECK_STRUCT_IP_MREQN],
130
[AC_CACHE_CHECK([for struct ip_mreqn], bird_cv_struct_ip_mreqn,[
131
AC_TRY_COMPILE([#include <netinet/in.h>
132
],[struct ip_mreqn x;
133
],[bird_cv_struct_ip_mreqn=yes
134
],[bird_cv_struct_ip_mreqn=no
135
])])
136
if test "$bird_cv_struct_ip_mreqn" = yes ; then
137
	AC_DEFINE([HAVE_STRUCT_IP_MREQN], [1], [Define to 1 if you have struct ip_mreqn])
138
fi
139
])
140

  
141 60
AC_DEFUN([BIRD_CHECK_PTHREADS],
142 61
[
143 62
  bird_tmp_cflags="$CFLAGS"
......
170 89

  
171 90
# BIRD_CHECK_PROG_FLAVOR_GNU(PROGRAM-PATH, IF-SUCCESS, [IF-FAILURE])
172 91
# copied autoconf internal _AC_PATH_PROG_FLAVOR_GNU
173
m4_define([BIRD_CHECK_PROG_FLAVOR_GNU],
92
AC_DEFUN([BIRD_CHECK_PROG_FLAVOR_GNU],
174 93
[# Check for GNU $1
175 94
case `"$1" --version 2>&1` in
176 95
*GNU*)
......
179 98
[*)
180 99
  $3;;
181 100
])esac
182
])#
101
])

Also available in: Unified diff