sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame^] | 1 | # Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT(vg_clientmalloc.c) |
| 3 | AM_CONFIG_HEADER(config.h) |
| 4 | AM_INIT_AUTOMAKE(valgrind, 20020317) |
| 5 | |
| 6 | # Checks for programs. |
| 7 | AC_PROG_LN_S |
| 8 | AC_PROG_CC |
| 9 | AC_PROG_CPP |
| 10 | AC_PROG_RANLIB |
| 11 | |
| 12 | CFLAGS="-Winline -Wall -Wshadow -O -fomit-frame-pointer -g" |
| 13 | AC_SUBST(CFLAGS) |
| 14 | |
| 15 | # Checks for the platform |
| 16 | AC_CANONICAL_HOST |
| 17 | |
| 18 | AC_MSG_CHECKING([for a supported CPU]) |
| 19 | |
| 20 | case ${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 | ;; |
| 29 | esac |
| 30 | |
| 31 | AC_MSG_CHECKING([for a supported OS]) |
| 32 | |
| 33 | case ${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 | ;; |
| 42 | esac |
| 43 | |
| 44 | |
| 45 | # Ok, this is linux. Check the kernel version |
| 46 | AC_MSG_CHECKING([for the kernel version]) |
| 47 | |
| 48 | kernel=`uname -r` |
| 49 | |
| 50 | case ${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 | ;; |
| 67 | esac |
| 68 | |
| 69 | AC_SUBST(DEFAULT_SUPP) |
| 70 | |
| 71 | |
| 72 | # Ok, this is linux. Check the kernel version |
| 73 | AC_MSG_CHECKING([the glibc version]) |
| 74 | |
| 75 | glibc="" |
| 76 | |
| 77 | AC_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 | ], |
| 85 | glibc="2.1") |
| 86 | |
| 87 | AC_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 | ], |
| 95 | glibc="2.2") |
| 96 | |
| 97 | case ${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 | ;; |
| 112 | esac |
| 113 | |
| 114 | # try to detect the XFree version |
| 115 | |
| 116 | # Checks for header files. |
| 117 | AC_HEADER_STDC |
| 118 | AC_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. |
| 121 | AC_C_CONST |
| 122 | AC_TYPE_UID_T |
| 123 | AC_TYPE_OFF_T |
| 124 | AC_TYPE_SIZE_T |
| 125 | AC_HEADER_TIME |
| 126 | |
| 127 | # Checks for library functions. |
| 128 | AC_FUNC_MEMCMP |
| 129 | AC_FUNC_MMAP |
| 130 | AC_TYPE_SIGNAL |
| 131 | |
| 132 | AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr]) |
| 133 | |
| 134 | AC_OUTPUT(valgrind |
| 135 | Makefile |
| 136 | docs/Makefile |
| 137 | tests/Makefile |
| 138 | demangle/Makefile) |