blob: 3bda390f1f9855d788d1447e5482e599ccc49a87 [file] [log] [blame]
sewardjde4a1d02002-03-22 01:27:54 +00001# Process this file with autoconf to produce a configure script.
2AC_INIT(vg_clientmalloc.c)
3AM_CONFIG_HEADER(config.h)
4AM_INIT_AUTOMAKE(valgrind, 20020317)
5
6# Checks for programs.
7AC_PROG_LN_S
8AC_PROG_CC
9AC_PROG_CPP
10AC_PROG_RANLIB
11
12CFLAGS="-Winline -Wall -Wshadow -O -fomit-frame-pointer -g"
13AC_SUBST(CFLAGS)
14
15# Checks for the platform
16AC_CANONICAL_HOST
17
18AC_MSG_CHECKING([for a supported CPU])
19
20case ${host_cpu} in
21 i?86)
22 AC_MSG_RESULT([ok (${host_cpu})])
23 ;;
24
25 *)
26 AC_MSG_RESULT([no (${host_cpu})])
27 AC_MSG_ERROR([Valgrind is ix86 specific. Sorry])
28 ;;
29esac
30
31AC_MSG_CHECKING([for a supported OS])
32
33case ${host_os} in
34 *linux*)
35 AC_MSG_RESULT([ok (${host_os})])
36 ;;
37
38 *)
39 AC_MSG_RESULT([no (${host_os})])
40 AC_MSG_ERROR([Valgrind is Linux specific. Sorry])
41 ;;
42esac
43
44
45# Ok, this is linux. Check the kernel version
46AC_MSG_CHECKING([for the kernel version])
47
48kernel=`uname -r`
49
50case ${kernel} in
51 2.4.*)
52 AC_MSG_RESULT([2.4 family (${kernel})])
53 AC_DEFINE(KERNEL_2_4)
54 DEFAULT_SUPP="linux24.supp"
55 ;;
56
57 2.2.*)
58 AC_MSG_RESULT([2.2 family (${kernel})])
59 AC_DEFINE(KERNEL_2_2)
60 DEFAULT_SUPP="linux22.supp"
61 ;;
62
63 *)
64 AC_MSG_RESULT([unsupported (${kernel})])
65 AC_MSG_ERROR([Valgrind works on kernels 2.2 and 2.4])
66 ;;
67esac
68
69AC_SUBST(DEFAULT_SUPP)
70
71
72# Ok, this is linux. Check the kernel version
73AC_MSG_CHECKING([the glibc version])
74
75glibc=""
76
77AC_EGREP_CPP([GLIBC_21], [
78#include <features.h>
79#ifdef __GNU_LIBRARY__
80 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 1)
81 GLIBC_21
82 #endif
83#endif
84],
85glibc="2.1")
86
87AC_EGREP_CPP([GLIBC_22], [
88#include <features.h>
89#ifdef __GNU_LIBRARY__
90 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2)
91 GLIBC_22
92 #endif
93#endif
94],
95glibc="2.2")
96
97case ${glibc} in
98 2.1)
99 AC_MSG_RESULT(2.1 family)
100 AC_DEFINE(GLIBC_2_1)
101 ;;
102
103 2.2)
104 AC_MSG_RESULT(2.2 family)
105 AC_DEFINE(GLIBC_2_2)
106 ;;
107
108 *)
109 AC_MSG_RESULT(unsupported version)
110 AC_MSG_ERROR([Valgrind requires the glibc version 2.1 or 2.2])
111 ;;
112esac
113
114# try to detect the XFree version
115
116# Checks for header files.
117AC_HEADER_STDC
118AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h termios.h unistd.h utime.h])
119
120# Checks for typedefs, structures, and compiler characteristics.
121AC_C_CONST
122AC_TYPE_UID_T
123AC_TYPE_OFF_T
124AC_TYPE_SIZE_T
125AC_HEADER_TIME
126
127# Checks for library functions.
128AC_FUNC_MEMCMP
129AC_FUNC_MMAP
130AC_TYPE_SIGNAL
131
132AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr])
133
134AC_OUTPUT(valgrind
135 Makefile
136 docs/Makefile
137 tests/Makefile
138 demangle/Makefile)