sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
jseward | dc0b4e8 | 2004-08-31 16:26:27 +0000 | [diff] [blame] | 2 | AC_INIT(Valgrind, 2.3.0.CVS, valgrind-users@lists.sourceforge.net) |
thughes | 6dbad73 | 2004-08-29 09:46:38 +0000 | [diff] [blame] | 3 | AC_CONFIG_SRCDIR(coregrind/vg_main.c) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 4 | AM_CONFIG_HEADER(config.h) |
thughes | 6dbad73 | 2004-08-29 09:46:38 +0000 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 6 | |
gobry | b0ed467 | 2002-03-27 20:58:58 +0000 | [diff] [blame] | 7 | AM_MAINTAINER_MODE |
| 8 | |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 9 | # Where is VEX ? |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 10 | # Nb: For the 2nd arg, the help string, AS_HELP_STRING is the proper way, but |
| 11 | # older autoconfs don't support it... here's what it would say: |
| 12 | # |
| 13 | # AS_HELP_STRING([--with-vex], [Vex directory (must be specified!)]), |
| 14 | # |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 15 | AC_ARG_WITH(vex, |
sewardj | 2a99cf6 | 2004-11-24 10:44:19 +0000 | [diff] [blame] | 16 | [ --with-vex=/path/to/vex/dir Vex directory (must be specified!)], |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 17 | [ |
| 18 | AC_CHECK_FILE($withval/pub/libvex.h, |
| 19 | [VEX_DIR=$withval], |
| 20 | [AC_MSG_ERROR([Directory '$withval' does not exist, or does not contain Vex])]) |
| 21 | ], |
| 22 | [ |
sewardj | 2a99cf6 | 2004-11-24 10:44:19 +0000 | [diff] [blame] | 23 | AC_MSG_ERROR([You must specify --with-vex=/path/to/vex/dir]) |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 24 | ]) |
sewardj | 50629ec | 2004-11-22 13:44:11 +0000 | [diff] [blame] | 25 | AC_SUBST(VEX_DIR) |
| 26 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 27 | # Checks for programs. |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame^] | 28 | CFLAGS="-Wno-long-long" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 29 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 30 | AC_PROG_LN_S |
| 31 | AC_PROG_CC |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 32 | ##AM_PROG_CC_C_O |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 33 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 34 | AC_PROG_CXX |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 35 | AC_PROG_RANLIB |
| 36 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 37 | # Check for the compiler support |
| 38 | if test "${GCC}" != "yes" ; then |
| 39 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 40 | fi |
| 41 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 42 | # figure out where perl lives |
| 43 | AC_PATH_PROG(PERL, perl) |
| 44 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 45 | # figure out where gdb lives |
| 46 | AC_PATH_PROG(GDB, gdb) |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 47 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB]) |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 48 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 49 | # some older automake's don't have it so try something on our own |
| 50 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 51 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 52 | AS="${CC}" |
| 53 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 54 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 55 | ASFLAGS="" |
| 56 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 57 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 58 | |
| 59 | # This variable will collect the individual suppression files |
| 60 | # depending on the results of autoconf |
| 61 | |
| 62 | DEFAULT_SUPP="" |
| 63 | |
| 64 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 65 | # We don't want gcc 2.7 |
| 66 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 67 | |
daywalker | 870ac4c | 2002-05-21 00:09:48 +0000 | [diff] [blame] | 68 | gcc_version=`${CC} --version | head -n 1` |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 69 | |
| 70 | case "${gcc_version}" in |
| 71 | gcc-2.7.*) |
| 72 | AC_MSG_RESULT([no (${gcc_version})]) |
| 73 | AC_MSG_ERROR([please use a recent (>= gcc-2.95) version of gcc]) |
| 74 | ;; |
| 75 | |
| 76 | *) |
| 77 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 78 | ;; |
| 79 | esac |
| 80 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 81 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 82 | # Checks for the platform |
| 83 | AC_CANONICAL_HOST |
| 84 | |
| 85 | AC_MSG_CHECKING([for a supported CPU]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 86 | AC_SUBST(VG_ARCH) |
njn | a5f1bcd | 2004-11-27 16:47:42 +0000 | [diff] [blame] | 87 | AC_SUBST(VG_ARCH_ALL) |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 88 | VG_ARCH_ALL="amd64 arm x86" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 89 | AC_SUBST(KICKSTART_BASE) |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 90 | AC_SUBST(ARCH_CORE_AM_CFLAGS) |
| 91 | AC_SUBST(ARCH_TOOL_AM_CFLAGS) |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame] | 92 | AC_SUBST(ARCH_CORE_AM_CCASFLAGS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 93 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 94 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 95 | i?86) |
| 96 | AC_MSG_RESULT([ok (${host_cpu})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 97 | VG_ARCH="x86" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 98 | KICKSTART_BASE="0xb0000000" |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame^] | 99 | ARCH_CORE_AM_CFLAGS="@PREFERRED_STACK_BOUNDARY@ -DELFSZ=32" |
| 100 | ARCH_TOOL_AM_CFLAGS="@PREFERRED_STACK_BOUNDARY@" |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame] | 101 | ARCH_CORE_AM_CCASFLAGS="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 102 | ;; |
| 103 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 104 | x86_64) |
| 105 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 106 | VG_ARCH="amd64" |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 107 | # XXX: relocations under amd64's "small model" are 32-bit signed |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 108 | # quantities; therefore going above 0x7fffffff doesn't work... this is |
| 109 | # a problem. |
| 110 | KICKSTART_BASE="0x70000000" |
| 111 | ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -DELFSZ=64" |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 112 | # XXX: need to use -fpic, otherwise when linking tools I get this error |
| 113 | # message: |
| 114 | # relocation R_X86_64_32 can not be used when making a shared object; |
| 115 | # recompile with -fPIC |
| 116 | # |
| 117 | # I don't understand... --njn |
| 118 | ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -fpic" |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 119 | ARCH_CORE_AM_CCASFLAGS="" |
| 120 | ;; |
| 121 | |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 122 | arm*) |
| 123 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 124 | VG_ARCH="arm" |
| 125 | KICKSTART_BASE="0xb0000000" |
| 126 | ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -DELFSZ=32" |
| 127 | ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@" |
| 128 | ARCH_CORE_AM_CCASFLAGS="" |
| 129 | ;; |
| 130 | |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 131 | powerpc*) |
| 132 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | da8735a | 2004-10-19 14:24:42 +0000 | [diff] [blame] | 133 | VG_ARCH="ppc" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 134 | KICKSTART_BASE="0x70000000" |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 135 | ARCH_CORE_AM_CFLAGS="-DELFSZ=32" |
| 136 | ARCH_TOOL_AM_CFLAGS="-fpic" |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame] | 137 | ARCH_CORE_AM_CCASFLAGS="-Wa,-maltivec" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 138 | AC_MSG_ERROR([PowerPC not supported. Sorry]) |
| 139 | ;; |
| 140 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 141 | *) |
| 142 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 143 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 144 | ;; |
| 145 | esac |
| 146 | |
| 147 | AC_MSG_CHECKING([for a supported OS]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 148 | AC_SUBST(VG_OS) |
njn | a5f1bcd | 2004-11-27 16:47:42 +0000 | [diff] [blame] | 149 | AC_SUBST(VG_OS_ALL) |
| 150 | VG_OS_ALL="linux" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 151 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 152 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 153 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 154 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 155 | VG_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 156 | |
| 157 | # Ok, this is linux. Check the kernel version |
| 158 | AC_MSG_CHECKING([for the kernel version]) |
| 159 | |
| 160 | kernel=`uname -r` |
| 161 | |
| 162 | case "${kernel}" in |
| 163 | 2.6.*) |
| 164 | AC_MSG_RESULT([2.6 family (${kernel})]) |
| 165 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x]) |
| 166 | ;; |
| 167 | |
| 168 | 2.4.*) |
| 169 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 170 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 171 | ;; |
| 172 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 173 | *) |
| 174 | AC_MSG_RESULT([unsupported (${kernel})]) |
nethercote | 4fa681f | 2004-11-08 17:51:39 +0000 | [diff] [blame] | 175 | AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 176 | ;; |
| 177 | esac |
| 178 | |
| 179 | ;; |
| 180 | |
| 181 | *freebsd*) |
| 182 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 183 | VG_OS="freebsd" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 184 | ;; |
| 185 | |
| 186 | *) |
| 187 | AC_MSG_RESULT([no (${host_os})]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 188 | AC_MSG_ERROR([Valgrind is operating system specific. Sorry. Please consider doing a port.]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 189 | ;; |
| 190 | esac |
| 191 | |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 192 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
| 193 | AC_SUBST(VG_PLATFORM) |
njn | a5f1bcd | 2004-11-27 16:47:42 +0000 | [diff] [blame] | 194 | AC_SUBST(VG_PLATFORM_ALL) |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 195 | VG_PLATFORM_ALL="amd64-linux arm-linux x86-linux" |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 196 | |
| 197 | VG_PLATFORM="$VG_ARCH-$VG_OS" |
| 198 | |
| 199 | case $VG_PLATFORM in |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 200 | x86-linux|amd64-linux|arm-linux) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 201 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 202 | ;; |
| 203 | |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 204 | *) |
| 205 | AC_MSG_RESULT([no (${host_cpu}-${host_os})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 206 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 207 | ;; |
| 208 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 209 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 210 | AC_SUBST(DEFAULT_SUPP) |
| 211 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 212 | glibc="" |
| 213 | |
| 214 | AC_EGREP_CPP([GLIBC_21], [ |
| 215 | #include <features.h> |
| 216 | #ifdef __GNU_LIBRARY__ |
| 217 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 1) |
| 218 | GLIBC_21 |
| 219 | #endif |
| 220 | #endif |
| 221 | ], |
| 222 | glibc="2.1") |
| 223 | |
| 224 | AC_EGREP_CPP([GLIBC_22], [ |
| 225 | #include <features.h> |
| 226 | #ifdef __GNU_LIBRARY__ |
| 227 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2) |
| 228 | GLIBC_22 |
| 229 | #endif |
| 230 | #endif |
| 231 | ], |
| 232 | glibc="2.2") |
| 233 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 234 | AC_EGREP_CPP([GLIBC_23], [ |
| 235 | #include <features.h> |
| 236 | #ifdef __GNU_LIBRARY__ |
| 237 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3) |
| 238 | GLIBC_23 |
| 239 | #endif |
| 240 | #endif |
| 241 | ], |
| 242 | glibc="2.3") |
| 243 | |
daywalker | e9212b3 | 2003-06-15 22:39:15 +0000 | [diff] [blame] | 244 | AC_MSG_CHECKING([the glibc version]) |
| 245 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 246 | case "${glibc}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 247 | 2.1) |
| 248 | AC_MSG_RESULT(2.1 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 249 | AC_DEFINE([GLIBC_2_1], 1, [Define to 1 if you're using glibc 2.1.x]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 250 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.1.supp" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 251 | ;; |
| 252 | |
| 253 | 2.2) |
| 254 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 255 | AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 256 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.2.supp" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 257 | ;; |
| 258 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 259 | 2.3) |
| 260 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 261 | AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x]) |
daywalker | 63f6f78 | 2003-05-27 00:19:52 +0000 | [diff] [blame] | 262 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.3.supp" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 263 | ;; |
| 264 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 265 | *) |
| 266 | AC_MSG_RESULT(unsupported version) |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 267 | AC_MSG_ERROR([Valgrind requires the glibc version 2.1, 2.2 or 2.3]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 268 | ;; |
| 269 | esac |
| 270 | |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 271 | # We don't know how to detect the X client library version |
| 272 | # (detecting the server version is easy, bu no help). So we |
| 273 | # just use a hack: always include the suppressions for both |
| 274 | # versions 3 and 4. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 275 | AC_PATH_X |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 276 | if test "${no_x}" != 'yes' ; then |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 277 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-4.supp" |
| 278 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-3.supp" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 279 | fi |
| 280 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 281 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 282 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 283 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 284 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 285 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 286 | CFLAGS="-mpreferred-stack-boundary=2" |
| 287 | |
| 288 | AC_TRY_COMPILE(, [ |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 289 | int main () { return 0 ; } |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 290 | ], |
| 291 | [ |
| 292 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 293 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 294 | ], [ |
| 295 | PREFERRED_STACK_BOUNDARY="" |
| 296 | AC_MSG_RESULT([no]) |
| 297 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 298 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 299 | |
| 300 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 301 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame^] | 302 | # does this compiler support -Wno-pointer-sign ? |
| 303 | AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ]) |
| 304 | |
| 305 | safe_CFLAGS=$CFLAGS |
| 306 | CFLAGS="-Wno-pointer-sign" |
| 307 | |
| 308 | AC_TRY_COMPILE(, [ |
| 309 | int main () { return 0 ; } |
| 310 | ], |
| 311 | [ |
| 312 | no_pointer_sign=yes |
| 313 | AC_MSG_RESULT([yes]) |
| 314 | ], [ |
| 315 | no_pointer_sign=no |
| 316 | AC_MSG_RESULT([no]) |
| 317 | ]) |
| 318 | CFLAGS=$safe_CFLAGS |
| 319 | |
| 320 | if test x$no_pointer_sign = xyes; then |
| 321 | CFLAGS="$CFLAGS -Wno-pointer-sign" |
| 322 | fi |
| 323 | |
| 324 | # Check for TLS support in the compiler and linker |
| 325 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 326 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 327 | [vg_cv_tls=$enableval], |
| 328 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 329 | [[return foo;]])], |
| 330 | [vg_cv_tls=yes], |
| 331 | [vg_cv_tls=no])])]) |
| 332 | |
| 333 | if test "$vg_cv_tls" = yes; then |
| 334 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 335 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 336 | |
nethercote | 7f39002 | 2004-10-25 17:18:24 +0000 | [diff] [blame] | 337 | # Check for PIE support in the compiler and linker |
| 338 | AC_CACHE_CHECK([for PIE support], vg_cv_pie, |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame^] | 339 | [AC_ARG_ENABLE(pie, [ --enable-pie platform supports PIE linking], |
| 340 | [vg_cv_pie=$enableval], |
| 341 | [safe_CFLAGS=$CFLAGS |
| 342 | CFLAGS="$CFLAGS -fpie" |
| 343 | safe_LDFLAGS=$LDFLAGS |
| 344 | LDFLAGS="$LDFLAGS -pie" |
| 345 | AC_TRY_LINK([int foo;], |
| 346 | [], |
| 347 | [vg_cv_pie=yes], |
| 348 | [vg_cv_pie=no]) |
| 349 | CFLAGS=$safe_CFLAGS |
| 350 | LDFLAGS=$safe_LDFLAGS])]) |
nethercote | 7f39002 | 2004-10-25 17:18:24 +0000 | [diff] [blame] | 351 | if test "$vg_cv_pie" = yes; then |
| 352 | AC_DEFINE([HAVE_PIE], 1, [can create position-independent executables]) |
| 353 | fi |
| 354 | AM_CONDITIONAL(USE_PIE, test "$vg_cv_pie" = "yes") |
| 355 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 356 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 357 | # Checks for header files. |
| 358 | AC_HEADER_STDC |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 359 | AC_CHECK_HEADERS([sys/endian.h endian.h mqueue.h]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 360 | |
| 361 | # Checks for typedefs, structures, and compiler characteristics. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 362 | AC_TYPE_UID_T |
| 363 | AC_TYPE_OFF_T |
| 364 | AC_TYPE_SIZE_T |
| 365 | AC_HEADER_TIME |
| 366 | |
| 367 | # Checks for library functions. |
| 368 | AC_FUNC_MEMCMP |
| 369 | AC_FUNC_MMAP |
| 370 | AC_TYPE_SIGNAL |
| 371 | |
thughes | beb6eb9 | 2004-06-14 12:33:43 +0000 | [diff] [blame] | 372 | AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr semtimedop]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 373 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 374 | AC_OUTPUT( |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 375 | Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 376 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 377 | valgrind.pc |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 378 | docs/Makefile |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 379 | docs/lib/Makefile |
| 380 | docs/images/Makefile |
| 381 | docs/xml/Makefile |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 382 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 383 | tests/vg_regtest |
njn25 | 1ffab94 | 2002-09-23 16:42:19 +0000 | [diff] [blame] | 384 | tests/unused/Makefile |
nethercote | e90c683 | 2004-10-18 18:07:49 +0000 | [diff] [blame] | 385 | include/valgrind.h |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 386 | include/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 387 | include/amd64/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 388 | include/arm/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 389 | include/x86/Makefile |
nethercote | 73b526f | 2004-10-31 18:48:21 +0000 | [diff] [blame] | 390 | include/linux/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 391 | include/amd64-linux/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 392 | include/arm-linux/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 393 | include/x86-linux/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 394 | auxprogs/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 395 | coregrind/Makefile |
| 396 | coregrind/demangle/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 397 | coregrind/amd64/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 398 | coregrind/arm/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 399 | coregrind/x86/Makefile |
nethercote | 8ff888f | 2004-11-17 17:11:45 +0000 | [diff] [blame] | 400 | coregrind/linux/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 401 | coregrind/amd64-linux/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 402 | coregrind/arm-linux/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 403 | coregrind/x86-linux/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 404 | addrcheck/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 405 | addrcheck/tests/Makefile |
njn | 7da8fa7 | 2002-10-03 10:38:40 +0000 | [diff] [blame] | 406 | addrcheck/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 407 | memcheck/Makefile |
| 408 | memcheck/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 409 | memcheck/tests/amd64/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 410 | memcheck/tests/arm/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 411 | memcheck/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 412 | memcheck/docs/Makefile |
| 413 | cachegrind/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 414 | cachegrind/amd64/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 415 | cachegrind/arm/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 416 | cachegrind/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 417 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 418 | cachegrind/tests/amd64/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 419 | cachegrind/tests/arm/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 420 | cachegrind/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 421 | cachegrind/docs/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 422 | cachegrind/cg_annotate |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 423 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 424 | helgrind/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 425 | helgrind/docs/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 426 | massif/Makefile |
| 427 | massif/hp2ps/Makefile |
| 428 | massif/tests/Makefile |
| 429 | massif/docs/Makefile |
| 430 | corecheck/Makefile |
| 431 | corecheck/tests/Makefile |
| 432 | corecheck/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 433 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 434 | lackey/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 435 | lackey/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 436 | none/Makefile |
| 437 | none/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 438 | none/tests/amd64/Makefile |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 439 | none/tests/arm/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 440 | none/tests/x86/Makefile |
njn | 9bc8c00 | 2002-10-02 13:49:13 +0000 | [diff] [blame] | 441 | none/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 442 | ) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 443 | |
| 444 | cat<<EOF |
| 445 | |
| 446 | Using the following suppressions by default: |
| 447 | |
| 448 | ${DEFAULT_SUPP} |
| 449 | EOF |
| 450 | |
| 451 | cat<<EOF > default.supp |
| 452 | # This is a generated file, composed of the following suppression rules: |
| 453 | # |
| 454 | # ${DEFAULT_SUPP} |
| 455 | # |
| 456 | |
| 457 | EOF |
| 458 | |
| 459 | for file in ${DEFAULT_SUPP} ; do |
| 460 | cat ${srcdir}/$file >> default.supp |
| 461 | done |