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. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 28 | CFLAGS="" |
| 29 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 30 | AC_PROG_LN_S |
| 31 | AC_PROG_CC |
thughes | a92ffd5 | 2004-11-01 09:50:57 +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) |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 87 | AC_SUBST(KICKSTART_BASE) |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 88 | AC_SUBST(ARCH_CORE_AM_CFLAGS) |
| 89 | AC_SUBST(ARCH_TOOL_AM_CFLAGS) |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame] | 90 | AC_SUBST(ARCH_CORE_AM_CCASFLAGS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 91 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 92 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 93 | i?86) |
| 94 | AC_MSG_RESULT([ok (${host_cpu})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 95 | VG_ARCH="x86" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 96 | KICKSTART_BASE="0xb0000000" |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 97 | ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -DELFSZ=32" |
| 98 | ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@" |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame] | 99 | ARCH_CORE_AM_CCASFLAGS="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 100 | ;; |
| 101 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 102 | x86_64) |
| 103 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 104 | VG_ARCH="amd64" |
| 105 | # OOO: relocations under x86-64 small model are 32-bit signed |
| 106 | # quantities; therefore going above 0x7fffffff doesn't work... this is |
| 107 | # a problem. |
| 108 | KICKSTART_BASE="0x70000000" |
| 109 | ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -DELFSZ=64" |
| 110 | ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@" |
| 111 | ARCH_CORE_AM_CCASFLAGS="" |
| 112 | ;; |
| 113 | |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 114 | arm*) |
| 115 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 116 | VG_ARCH="arm" |
| 117 | KICKSTART_BASE="0xb0000000" |
| 118 | ARCH_CORE_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@ -DELFSZ=32" |
| 119 | ARCH_TOOL_AM_CFLAGS="-fomit-frame-pointer @PREFERRED_STACK_BOUNDARY@" |
| 120 | ARCH_CORE_AM_CCASFLAGS="" |
| 121 | ;; |
| 122 | |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 123 | powerpc*) |
| 124 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | da8735a | 2004-10-19 14:24:42 +0000 | [diff] [blame] | 125 | VG_ARCH="ppc" |
nethercote | 2b72e94 | 2004-10-25 14:05:56 +0000 | [diff] [blame] | 126 | KICKSTART_BASE="0x70000000" |
nethercote | cf4d997 | 2004-10-25 15:21:00 +0000 | [diff] [blame] | 127 | ARCH_CORE_AM_CFLAGS="-DELFSZ=32" |
| 128 | ARCH_TOOL_AM_CFLAGS="-fpic" |
nethercote | 8df0a40 | 2004-10-25 19:20:14 +0000 | [diff] [blame] | 129 | ARCH_CORE_AM_CCASFLAGS="-Wa,-maltivec" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 130 | AC_MSG_ERROR([PowerPC not supported. Sorry]) |
| 131 | ;; |
| 132 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 133 | *) |
| 134 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 135 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 136 | ;; |
| 137 | esac |
| 138 | |
| 139 | AC_MSG_CHECKING([for a supported OS]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 140 | AC_SUBST(VG_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 141 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 142 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 143 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 144 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 145 | VG_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 146 | |
| 147 | # Ok, this is linux. Check the kernel version |
| 148 | AC_MSG_CHECKING([for the kernel version]) |
| 149 | |
| 150 | kernel=`uname -r` |
| 151 | |
| 152 | case "${kernel}" in |
| 153 | 2.6.*) |
| 154 | AC_MSG_RESULT([2.6 family (${kernel})]) |
| 155 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x]) |
| 156 | ;; |
| 157 | |
| 158 | 2.4.*) |
| 159 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 160 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 161 | ;; |
| 162 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 163 | *) |
| 164 | AC_MSG_RESULT([unsupported (${kernel})]) |
nethercote | 4fa681f | 2004-11-08 17:51:39 +0000 | [diff] [blame] | 165 | AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 166 | ;; |
| 167 | esac |
| 168 | |
| 169 | ;; |
| 170 | |
| 171 | *freebsd*) |
| 172 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 173 | VG_OS="freebsd" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 174 | ;; |
| 175 | |
| 176 | *) |
| 177 | AC_MSG_RESULT([no (${host_os})]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 178 | 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] | 179 | ;; |
| 180 | esac |
| 181 | |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 182 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
| 183 | AC_SUBST(VG_PLATFORM) |
| 184 | |
| 185 | VG_PLATFORM="$VG_ARCH-$VG_OS" |
| 186 | |
| 187 | case $VG_PLATFORM in |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 188 | x86-linux|amd64-linux|arm-linux) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 189 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 190 | ;; |
| 191 | |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 192 | *) |
| 193 | AC_MSG_RESULT([no (${host_cpu}-${host_os})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 194 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 195 | ;; |
| 196 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 197 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 198 | AC_SUBST(DEFAULT_SUPP) |
| 199 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 200 | glibc="" |
| 201 | |
| 202 | AC_EGREP_CPP([GLIBC_21], [ |
| 203 | #include <features.h> |
| 204 | #ifdef __GNU_LIBRARY__ |
| 205 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 1) |
| 206 | GLIBC_21 |
| 207 | #endif |
| 208 | #endif |
| 209 | ], |
| 210 | glibc="2.1") |
| 211 | |
| 212 | AC_EGREP_CPP([GLIBC_22], [ |
| 213 | #include <features.h> |
| 214 | #ifdef __GNU_LIBRARY__ |
| 215 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2) |
| 216 | GLIBC_22 |
| 217 | #endif |
| 218 | #endif |
| 219 | ], |
| 220 | glibc="2.2") |
| 221 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 222 | AC_EGREP_CPP([GLIBC_23], [ |
| 223 | #include <features.h> |
| 224 | #ifdef __GNU_LIBRARY__ |
| 225 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3) |
| 226 | GLIBC_23 |
| 227 | #endif |
| 228 | #endif |
| 229 | ], |
| 230 | glibc="2.3") |
| 231 | |
daywalker | e9212b3 | 2003-06-15 22:39:15 +0000 | [diff] [blame] | 232 | AC_MSG_CHECKING([the glibc version]) |
| 233 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 234 | case "${glibc}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 235 | 2.1) |
| 236 | AC_MSG_RESULT(2.1 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 237 | 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] | 238 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.1.supp" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 239 | ;; |
| 240 | |
| 241 | 2.2) |
| 242 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 243 | 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] | 244 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.2.supp" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 245 | ;; |
| 246 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 247 | 2.3) |
| 248 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 249 | 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] | 250 | DEFAULT_SUPP="${DEFAULT_SUPP} glibc-2.3.supp" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 251 | ;; |
| 252 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 253 | *) |
| 254 | AC_MSG_RESULT(unsupported version) |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 255 | 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] | 256 | ;; |
| 257 | esac |
| 258 | |
sewardj | 3e909ce | 2002-06-03 13:27:15 +0000 | [diff] [blame] | 259 | # APIs introduced in recent glibc versions |
| 260 | |
| 261 | AC_MSG_CHECKING([whether sched_param has a sched_priority member]) |
| 262 | AC_CACHE_VAL(vg_have_sched_priority, |
| 263 | [ |
| 264 | AC_TRY_COMPILE([#include <pthread.h>],[ |
| 265 | struct sched_param p; p.sched_priority=1;], |
| 266 | vg_have_sched_priority=yes, |
| 267 | vg_have_sched_priority=no) |
| 268 | ]) |
| 269 | AC_MSG_RESULT($vg_have_sched_priority) |
| 270 | if test "$vg_have_sched_priority" = yes; then |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 271 | AC_DEFINE([HAVE_SCHED_PRIORITY], 1, [pthread / sched_priority exists]) |
sewardj | 3e909ce | 2002-06-03 13:27:15 +0000 | [diff] [blame] | 272 | fi |
| 273 | |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 274 | # We don't know how to detect the X client library version |
| 275 | # (detecting the server version is easy, bu no help). So we |
| 276 | # just use a hack: always include the suppressions for both |
| 277 | # versions 3 and 4. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 278 | AC_PATH_X |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 279 | if test "${no_x}" != 'yes' ; then |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 280 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-4.supp" |
| 281 | DEFAULT_SUPP="${DEFAULT_SUPP} xfree-3.supp" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 282 | fi |
| 283 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 284 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 285 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 286 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 287 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 288 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 289 | CFLAGS="-mpreferred-stack-boundary=2" |
| 290 | |
| 291 | AC_TRY_COMPILE(, [ |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 292 | int main () { return 0 ; } |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 293 | ], |
| 294 | [ |
| 295 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 296 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 297 | ], [ |
| 298 | PREFERRED_STACK_BOUNDARY="" |
| 299 | AC_MSG_RESULT([no]) |
| 300 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 301 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 302 | |
| 303 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 304 | |
| 305 | |
nethercote | 7f39002 | 2004-10-25 17:18:24 +0000 | [diff] [blame] | 306 | # Check for PIE support in the compiler and linker |
| 307 | AC_CACHE_CHECK([for PIE support], vg_cv_pie, |
| 308 | [safe_CFLAGS=$CFLAGS |
| 309 | CFLAGS="$CFLAGS -fpie" |
| 310 | safe_LDFLAGS=$LDFLAGS |
| 311 | LDFLAGS="$LDFLAGS -pie" |
| 312 | AC_TRY_LINK([int foo;], |
| 313 | [], |
| 314 | [vg_cv_pie=yes], |
| 315 | [vg_cv_pie=no]) |
| 316 | CFLAGS=$safe_CFLAGS |
| 317 | LDFLAGS=$safe_LDFLAGS]) |
| 318 | if test "$vg_cv_pie" = yes; then |
| 319 | AC_DEFINE([HAVE_PIE], 1, [can create position-independent executables]) |
| 320 | fi |
| 321 | AM_CONDITIONAL(USE_PIE, test "$vg_cv_pie" = "yes") |
| 322 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 323 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 324 | # Checks for header files. |
| 325 | AC_HEADER_STDC |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 326 | AC_CHECK_HEADERS([sys/endian.h endian.h mqueue.h]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 327 | |
| 328 | # Checks for typedefs, structures, and compiler characteristics. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 329 | AC_TYPE_UID_T |
| 330 | AC_TYPE_OFF_T |
| 331 | AC_TYPE_SIZE_T |
| 332 | AC_HEADER_TIME |
thughes | ebed998 | 2004-06-12 17:25:25 +0000 | [diff] [blame] | 333 | AC_CHECK_TYPES(__pthread_unwind_buf_t,,,[#include <pthread.h>]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 334 | |
| 335 | # Checks for library functions. |
| 336 | AC_FUNC_MEMCMP |
| 337 | AC_FUNC_MMAP |
| 338 | AC_TYPE_SIGNAL |
| 339 | |
thughes | beb6eb9 | 2004-06-14 12:33:43 +0000 | [diff] [blame] | 340 | AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr semtimedop]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 341 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 342 | AC_OUTPUT( |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 343 | Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 344 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 345 | valgrind.pc |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 346 | docs/Makefile |
| 347 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 348 | tests/vg_regtest |
njn25 | 1ffab94 | 2002-09-23 16:42:19 +0000 | [diff] [blame] | 349 | tests/unused/Makefile |
nethercote | e90c683 | 2004-10-18 18:07:49 +0000 | [diff] [blame] | 350 | include/valgrind.h |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 351 | include/Makefile |
nethercote | c06e213 | 2004-09-03 13:45:29 +0000 | [diff] [blame] | 352 | include/x86/Makefile |
nethercote | 73b526f | 2004-10-31 18:48:21 +0000 | [diff] [blame] | 353 | include/linux/Makefile |
| 354 | include/x86-linux/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 355 | auxprogs/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 356 | coregrind/Makefile |
| 357 | coregrind/demangle/Makefile |
| 358 | coregrind/docs/Makefile |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 359 | coregrind/x86/Makefile |
nethercote | 8ff888f | 2004-11-17 17:11:45 +0000 | [diff] [blame] | 360 | coregrind/linux/Makefile |
nethercote | f94fe2f | 2004-09-10 14:23:59 +0000 | [diff] [blame] | 361 | coregrind/x86-linux/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 362 | addrcheck/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 363 | addrcheck/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 364 | addrcheck/tests/x86/Makefile |
njn | 7da8fa7 | 2002-10-03 10:38:40 +0000 | [diff] [blame] | 365 | addrcheck/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 366 | memcheck/Makefile |
| 367 | memcheck/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 368 | memcheck/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 369 | memcheck/docs/Makefile |
| 370 | cachegrind/Makefile |
nethercote | b35a8b9 | 2004-09-11 16:45:27 +0000 | [diff] [blame] | 371 | cachegrind/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 372 | cachegrind/tests/Makefile |
nethercote | a255d80 | 2004-10-19 17:00:59 +0000 | [diff] [blame] | 373 | cachegrind/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 374 | cachegrind/docs/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 375 | cachegrind/cg_annotate |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 376 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 377 | helgrind/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 378 | helgrind/tests/x86/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 379 | helgrind/docs/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 380 | massif/Makefile |
| 381 | massif/hp2ps/Makefile |
| 382 | massif/tests/Makefile |
| 383 | massif/docs/Makefile |
| 384 | corecheck/Makefile |
| 385 | corecheck/tests/Makefile |
| 386 | corecheck/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 387 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 388 | lackey/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 389 | lackey/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 390 | none/Makefile |
| 391 | none/tests/Makefile |
nethercote | bfd2019 | 2004-10-19 18:54:11 +0000 | [diff] [blame] | 392 | none/tests/x86/Makefile |
njn | 9bc8c00 | 2002-10-02 13:49:13 +0000 | [diff] [blame] | 393 | none/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 394 | ) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 395 | |
| 396 | cat<<EOF |
| 397 | |
| 398 | Using the following suppressions by default: |
| 399 | |
| 400 | ${DEFAULT_SUPP} |
| 401 | EOF |
| 402 | |
| 403 | cat<<EOF > default.supp |
| 404 | # This is a generated file, composed of the following suppression rules: |
| 405 | # |
| 406 | # ${DEFAULT_SUPP} |
| 407 | # |
| 408 | |
| 409 | EOF |
| 410 | |
| 411 | for file in ${DEFAULT_SUPP} ; do |
| 412 | cat ${srcdir}/$file >> default.supp |
| 413 | done |