sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1 | |
| 2 | ##------------------------------------------------------------## |
| 3 | # |
| 4 | # The multiple-architecture stuff in this file is pretty |
| 5 | # cryptic. Read docs/internals/multiple-architectures.txt |
| 6 | # for at least a partial explanation of what is going on. |
| 7 | # |
| 8 | ##------------------------------------------------------------## |
| 9 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 10 | # Process this file with autoconf to produce a configure script. |
njn | 0181c77 | 2005-11-28 16:45:45 +0000 | [diff] [blame] | 11 | AC_INIT(Valgrind, 3.2.0.SVN, valgrind-users@lists.sourceforge.net) |
njn | 04e1698 | 2005-05-31 00:23:43 +0000 | [diff] [blame] | 12 | AC_CONFIG_SRCDIR(coregrind/m_main.c) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 13 | AM_CONFIG_HEADER(config.h) |
thughes | 6dbad73 | 2004-08-29 09:46:38 +0000 | [diff] [blame] | 14 | AM_INIT_AUTOMAKE |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 15 | |
gobry | b0ed467 | 2002-03-27 20:58:58 +0000 | [diff] [blame] | 16 | AM_MAINTAINER_MODE |
| 17 | |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 18 | # Where is VEX ? |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 19 | # Nb: For the 2nd arg, the help string, AS_HELP_STRING is the proper way, but |
| 20 | # older autoconfs don't support it... here's what it would say: |
| 21 | # |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 22 | # AS_HELP_STRING([--with-vex], [Vex directory]), |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 23 | # |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 24 | AC_ARG_WITH(vex, |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 25 | [ --with-vex=/path/to/vex/dir Vex directory], |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 26 | [ |
| 27 | AC_CHECK_FILE($withval/pub/libvex.h, |
| 28 | [VEX_DIR=$withval], |
| 29 | [AC_MSG_ERROR([Directory '$withval' does not exist, or does not contain Vex])]) |
| 30 | ], |
| 31 | [ |
njn | 17adf1e | 2005-09-16 03:59:37 +0000 | [diff] [blame] | 32 | VEX_DIR='$(top_srcdir)/VEX' |
njn | 8738c28 | 2004-11-23 16:31:56 +0000 | [diff] [blame] | 33 | ]) |
sewardj | 50629ec | 2004-11-22 13:44:11 +0000 | [diff] [blame] | 34 | AC_SUBST(VEX_DIR) |
| 35 | |
njn | 657d951 | 2005-06-24 15:20:52 +0000 | [diff] [blame] | 36 | # "make distcheck" first builds a tarball, then extracts it. |
| 37 | # Then it creates a build directory different from the extracted sources |
| 38 | # (called _build), and issues |
| 39 | # |
| 40 | # ../configure $(DISTCHECK_CONFIGURE_FLAGS) |
| 41 | # |
| 42 | # and then builds, runs "make check", installs using DESTDIR, runs make |
| 43 | # installcheck, uninstalls, checks whether the installed base is empty |
| 44 | # again, then does yet another "make dist" and compares the resulting |
| 45 | # tarball with the one it started off with for identical content. Then it |
| 46 | # tests "make distclean" for no leftover files. |
| 47 | # |
| 48 | # So this line means: when doing "make dist", use the same --with-vex value |
| 49 | # that you used when running configure to configure this tree in the first |
| 50 | # place. |
| 51 | AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], [--with-vex=$VEX_DIR]) |
| 52 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 53 | # Checks for programs. |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 54 | CFLAGS="-Wno-long-long" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 55 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 56 | AC_PROG_LN_S |
| 57 | AC_PROG_CC |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 58 | ##AM_PROG_CC_C_O |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 59 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 60 | AC_PROG_CXX |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 61 | AC_PROG_RANLIB |
| 62 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 63 | # Check for the compiler support |
| 64 | if test "${GCC}" != "yes" ; then |
| 65 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 66 | fi |
| 67 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 68 | # figure out where perl lives |
| 69 | AC_PATH_PROG(PERL, perl) |
| 70 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 71 | # figure out where gdb lives |
| 72 | AC_PATH_PROG(GDB, gdb) |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 73 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB]) |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 74 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 75 | # some older automake's don't have it so try something on our own |
| 76 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 77 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 78 | AS="${CC}" |
| 79 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 80 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 81 | ASFLAGS="" |
| 82 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 83 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 84 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 85 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 86 | # We don't want gcc < 3.0 |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 87 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 88 | |
daywalker | 870ac4c | 2002-05-21 00:09:48 +0000 | [diff] [blame] | 89 | gcc_version=`${CC} --version | head -n 1` |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 90 | |
| 91 | case "${gcc_version}" in |
| 92 | gcc-2.7.*) |
| 93 | AC_MSG_RESULT([no (${gcc_version})]) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 94 | AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc]) |
| 95 | ;; |
| 96 | gcc-2.8.*) |
| 97 | AC_MSG_RESULT([no (${gcc_version})]) |
| 98 | AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc]) |
| 99 | ;; |
| 100 | gcc-2.9*) |
| 101 | AC_MSG_RESULT([no (${gcc_version})]) |
| 102 | AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc]) |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 103 | ;; |
| 104 | |
| 105 | *) |
| 106 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 107 | ;; |
| 108 | esac |
| 109 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 110 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 111 | # Checks for the platform |
| 112 | AC_CANONICAL_HOST |
| 113 | |
| 114 | AC_MSG_CHECKING([for a supported CPU]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 115 | AC_SUBST(VG_ARCH) |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 116 | |
sewardj | 9b0567a | 2006-01-17 02:56:18 +0000 | [diff] [blame] | 117 | AC_SUBST(VG_ARCH_ALL) |
| 118 | VG_ARCH_ALL="amd64 ppc32 ppc64 x86" |
| 119 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 120 | AC_SUBST(VALT_LOAD_ADDRESS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 121 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 122 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 123 | i?86) |
| 124 | AC_MSG_RESULT([ok (${host_cpu})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 125 | VG_ARCH="x86" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame^] | 126 | valt_load_address_normal="0x38000000" |
| 127 | valt_load_address_inner="0x28000000" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 128 | ;; |
| 129 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 130 | x86_64) |
| 131 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 132 | VG_ARCH="amd64" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame^] | 133 | valt_load_address_normal="0x38000000" |
| 134 | valt_load_address_inner="0x28000000" |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 135 | ;; |
| 136 | |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 137 | powerpc64) |
| 138 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 139 | VG_ARCH="ppc64" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame^] | 140 | valt_load_address_normal="0x38000000" |
| 141 | valt_load_address_inner="0x28000000" |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 142 | ;; |
| 143 | |
| 144 | powerpc) |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 145 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 146 | VG_ARCH="ppc32" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame^] | 147 | valt_load_address_normal="0x38000000" |
| 148 | valt_load_address_inner="0x28000000" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 149 | ;; |
| 150 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 151 | *) |
| 152 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 153 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 154 | ;; |
| 155 | esac |
| 156 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 157 | # Check if this should be built as an inner Valgrind, to be run within |
| 158 | # another Valgrind. Choose the load address accordingly. |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 159 | AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, |
| 160 | [AC_ARG_ENABLE(inner, |
| 161 | [ --enable-inner enables self-hosting], |
| 162 | [vg_cv_inner=$enableval], |
| 163 | [vg_cv_inner=no])]) |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 164 | if test "$vg_cv_inner" = yes; then |
| 165 | AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind]) |
| 166 | VALT_LOAD_ADDRESS=$valt_load_address_inner |
| 167 | else |
| 168 | VALT_LOAD_ADDRESS=$valt_load_address_normal |
| 169 | fi |
| 170 | |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 171 | # Sometimes it's convenient to subvert the bi-arch build system and |
| 172 | # just have a single build even though the underlying platform is |
| 173 | # capable of both. Hence handle --enable-only64bit and |
| 174 | # --enable-only32bit. Complain if both are issued :-) |
| 175 | |
| 176 | # Check if a 64-bit only build has been requested |
| 177 | AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, |
| 178 | [AC_ARG_ENABLE(only64bit, |
| 179 | [ --enable-only64bit do a 64-bit only build], |
| 180 | [vg_cv_only64bit=$enableval], |
| 181 | [vg_cv_only64bit=no])]) |
| 182 | |
| 183 | # Check if a 32-bit only build has been requested |
| 184 | AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit, |
| 185 | [AC_ARG_ENABLE(only32bit, |
| 186 | [ --enable-only32bit do a 32-bit only build], |
| 187 | [vg_cv_only32bit=$enableval], |
| 188 | [vg_cv_only32bit=no])]) |
| 189 | |
| 190 | # Stay sane |
| 191 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 192 | AC_MSG_ERROR( |
| 193 | [Nonsensical: both --enable-only64bit and --enable-only32bit.]) |
| 194 | fi |
| 195 | |
| 196 | |
| 197 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 198 | AC_MSG_CHECKING([for a supported OS]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 199 | AC_SUBST(VG_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 200 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 201 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 202 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 203 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 204 | VG_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 205 | |
| 206 | # Ok, this is linux. Check the kernel version |
| 207 | AC_MSG_CHECKING([for the kernel version]) |
| 208 | |
| 209 | kernel=`uname -r` |
| 210 | |
| 211 | case "${kernel}" in |
| 212 | 2.6.*) |
| 213 | AC_MSG_RESULT([2.6 family (${kernel})]) |
| 214 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x]) |
| 215 | ;; |
| 216 | |
| 217 | 2.4.*) |
| 218 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 219 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 220 | ;; |
| 221 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 222 | *) |
| 223 | AC_MSG_RESULT([unsupported (${kernel})]) |
nethercote | 4fa681f | 2004-11-08 17:51:39 +0000 | [diff] [blame] | 224 | AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 225 | ;; |
| 226 | esac |
| 227 | |
| 228 | ;; |
| 229 | |
| 230 | *freebsd*) |
| 231 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 232 | VG_OS="freebsd" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 233 | ;; |
| 234 | |
| 235 | *) |
| 236 | AC_MSG_RESULT([no (${host_os})]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 237 | 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] | 238 | ;; |
| 239 | esac |
| 240 | |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 241 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 242 | # Establish VG_PLATFORM_PRI. This is the primary build target. The |
| 243 | # entire system, including regression and performance tests, will be |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 244 | # built for this target. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 245 | # |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 246 | # Also establish VG_PLATFORM_SEC, the secondary build target, if |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 247 | # possible. The system will also be built for this target, but not |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 248 | # the regression or performance tests. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 249 | # |
| 250 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 251 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 252 | AC_SUBST(VG_PLATFORM_PRI) |
| 253 | AC_SUBST(VG_PLATFORM_SEC) |
| 254 | |
| 255 | case "$VG_ARCH-$VG_OS" in |
| 256 | x86-linux) |
| 257 | VG_PLATFORM_PRI="X86_LINUX" |
| 258 | VG_PLATFORM_SEC="" |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 259 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 260 | ;; |
| 261 | amd64-linux) |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 262 | if test x$vg_cv_only64bit = xyes; then |
| 263 | VG_PLATFORM_PRI="AMD64_LINUX" |
| 264 | VG_PLATFORM_SEC="" |
| 265 | elif test x$vg_cv_only32bit = xyes; then |
| 266 | VG_PLATFORM_PRI="X86_LINUX" |
| 267 | VG_PLATFORM_SEC="" |
| 268 | else |
| 269 | VG_PLATFORM_PRI="AMD64_LINUX" |
| 270 | VG_PLATFORM_SEC="X86_LINUX" |
| 271 | fi |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 272 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 273 | ;; |
| 274 | ppc32-linux) |
| 275 | VG_PLATFORM_PRI="PPC32_LINUX" |
| 276 | VG_PLATFORM_SEC="" |
| 277 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 278 | ;; |
| 279 | ppc64-linux) |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 280 | if test x$vg_cv_only64bit = xyes; then |
| 281 | VG_PLATFORM_PRI="PPC64_LINUX" |
| 282 | VG_PLATFORM_SEC="" |
| 283 | elif test x$vg_cv_only32bit = xyes; then |
| 284 | VG_PLATFORM_PRI="PPC32_LINUX" |
| 285 | VG_PLATFORM_SEC="" |
| 286 | else |
| 287 | VG_PLATFORM_PRI="PPC64_LINUX" |
| 288 | VG_PLATFORM_SEC="PPC32_LINUX" |
| 289 | fi |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 290 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 291 | ;; |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 292 | *) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 293 | VG_PLATFORM_PRI="unknown" |
| 294 | VG_PLATFORM_SEC="unknown" |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 295 | AC_MSG_RESULT([no (${host_cpu}-${host_os})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 296 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 297 | ;; |
| 298 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 299 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 300 | # Set up VG_<platform>. Either one or two of these become defined. |
| 301 | # |
| 302 | AM_CONDITIONAL(VG_X86_LINUX, |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 303 | test x$VG_PLATFORM_PRI = xX86_LINUX \ |
| 304 | -o x$VG_PLATFORM_SEC = xX86_LINUX) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 305 | AM_CONDITIONAL(VG_AMD64_LINUX, |
| 306 | test x$VG_PLATFORM_PRI = xAMD64_LINUX) |
| 307 | AM_CONDITIONAL(VG_PPC32_LINUX, |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 308 | test x$VG_PLATFORM_PRI = xPPC32_LINUX \ |
| 309 | -o x$VG_PLATFORM_SEC = xPPC32_LINUX) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 310 | AM_CONDITIONAL(VG_PPC64_LINUX, |
| 311 | test x$VG_PLATFORM_PRI = xPPC64_LINUX) |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 312 | |
tom | b637bad | 2005-11-08 12:28:35 +0000 | [diff] [blame] | 313 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 314 | # This variable will collect the individual suppression files |
| 315 | # depending on the results of autoconf |
| 316 | DEFAULT_SUPP="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 317 | AC_SUBST(DEFAULT_SUPP) |
| 318 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 319 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 320 | glibc="" |
| 321 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 322 | AC_EGREP_CPP([GLIBC_22], [ |
| 323 | #include <features.h> |
| 324 | #ifdef __GNU_LIBRARY__ |
| 325 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2) |
| 326 | GLIBC_22 |
| 327 | #endif |
| 328 | #endif |
| 329 | ], |
| 330 | glibc="2.2") |
| 331 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 332 | AC_EGREP_CPP([GLIBC_23], [ |
| 333 | #include <features.h> |
| 334 | #ifdef __GNU_LIBRARY__ |
| 335 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3) |
| 336 | GLIBC_23 |
| 337 | #endif |
| 338 | #endif |
| 339 | ], |
| 340 | glibc="2.3") |
| 341 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 342 | AC_EGREP_CPP([GLIBC_24], [ |
| 343 | #include <features.h> |
| 344 | #ifdef __GNU_LIBRARY__ |
| 345 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 4) |
| 346 | GLIBC_24 |
| 347 | #endif |
| 348 | #endif |
| 349 | ], |
| 350 | glibc="2.4") |
| 351 | |
daywalker | e9212b3 | 2003-06-15 22:39:15 +0000 | [diff] [blame] | 352 | AC_MSG_CHECKING([the glibc version]) |
| 353 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 354 | case "${glibc}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 355 | 2.2) |
| 356 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 357 | AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 358 | DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 359 | ;; |
| 360 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 361 | 2.3) |
| 362 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 363 | AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 364 | DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 365 | ;; |
| 366 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 367 | 2.4) |
| 368 | AC_MSG_RESULT(2.4 family) |
| 369 | AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 370 | DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}" |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 371 | ;; |
| 372 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 373 | *) |
| 374 | AC_MSG_RESULT(unsupported version) |
sewardj | 3080a86 | 2005-07-03 10:18:33 +0000 | [diff] [blame] | 375 | AC_MSG_ERROR([Valgrind requires glibc version 2.2, 2.3 or 2.4]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 376 | ;; |
| 377 | esac |
| 378 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 379 | |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 380 | # We don't know how to detect the X client library version |
| 381 | # (detecting the server version is easy, bu no help). So we |
| 382 | # just use a hack: always include the suppressions for both |
| 383 | # versions 3 and 4. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 384 | AC_PATH_X |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 385 | if test "${no_x}" != 'yes' ; then |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 386 | DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" |
| 387 | DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 388 | fi |
| 389 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 390 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 391 | # does this compiler support -m32 ? |
| 392 | AC_MSG_CHECKING([if gcc accepts -m32]) |
| 393 | |
| 394 | safe_CFLAGS=$CFLAGS |
| 395 | CFLAGS="-m32" |
| 396 | |
| 397 | AC_TRY_COMPILE(, [ |
| 398 | int main () { return 0 ; } |
| 399 | ], |
| 400 | [ |
| 401 | FLAG_M32="-m32" |
| 402 | AC_MSG_RESULT([yes]) |
| 403 | ], [ |
| 404 | FLAG_M32="" |
| 405 | AC_MSG_RESULT([no]) |
| 406 | ]) |
| 407 | CFLAGS=$safe_CFLAGS |
| 408 | |
| 409 | AC_SUBST(FLAG_M32) |
| 410 | |
| 411 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 412 | # does this compiler support -m64 ? |
| 413 | AC_MSG_CHECKING([if gcc accepts -m64]) |
| 414 | |
| 415 | safe_CFLAGS=$CFLAGS |
| 416 | CFLAGS="-m64" |
| 417 | |
| 418 | AC_TRY_COMPILE(, [ |
| 419 | int main () { return 0 ; } |
| 420 | ], |
| 421 | [ |
| 422 | FLAG_M64="-m64" |
| 423 | AC_MSG_RESULT([yes]) |
| 424 | ], [ |
| 425 | FLAG_M64="" |
| 426 | AC_MSG_RESULT([no]) |
| 427 | ]) |
| 428 | CFLAGS=$safe_CFLAGS |
| 429 | |
| 430 | AC_SUBST(FLAG_M64) |
| 431 | |
| 432 | |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 433 | # does this compiler support -mmmx ? |
| 434 | AC_MSG_CHECKING([if gcc accepts -mmmx]) |
| 435 | |
| 436 | safe_CFLAGS=$CFLAGS |
| 437 | CFLAGS="-mmmx" |
| 438 | |
| 439 | AC_TRY_COMPILE(, [ |
| 440 | int main () { return 0 ; } |
| 441 | ], |
| 442 | [ |
| 443 | FLAG_MMMX="-mmmx" |
| 444 | AC_MSG_RESULT([yes]) |
| 445 | ], [ |
| 446 | FLAG_MMMX="" |
| 447 | AC_MSG_RESULT([no]) |
| 448 | ]) |
| 449 | CFLAGS=$safe_CFLAGS |
| 450 | |
| 451 | AC_SUBST(FLAG_MMMX) |
| 452 | |
| 453 | |
| 454 | # does this compiler support -msse ? |
| 455 | AC_MSG_CHECKING([if gcc accepts -msse]) |
| 456 | |
| 457 | safe_CFLAGS=$CFLAGS |
| 458 | CFLAGS="-msse" |
| 459 | |
| 460 | AC_TRY_COMPILE(, [ |
| 461 | int main () { return 0 ; } |
| 462 | ], |
| 463 | [ |
| 464 | FLAG_MSSE="-msse" |
| 465 | AC_MSG_RESULT([yes]) |
| 466 | ], [ |
| 467 | FLAG_MSSE="" |
| 468 | AC_MSG_RESULT([no]) |
| 469 | ]) |
| 470 | CFLAGS=$safe_CFLAGS |
| 471 | |
| 472 | AC_SUBST(FLAG_MSSE) |
| 473 | |
| 474 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 475 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 476 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 477 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 478 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 479 | CFLAGS="-mpreferred-stack-boundary=2" |
| 480 | |
| 481 | AC_TRY_COMPILE(, [ |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 482 | int main () { return 0 ; } |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 483 | ], |
| 484 | [ |
| 485 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 486 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 487 | ], [ |
| 488 | PREFERRED_STACK_BOUNDARY="" |
| 489 | AC_MSG_RESULT([no]) |
| 490 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 491 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 492 | |
| 493 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 494 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 495 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 496 | # does this compiler support -Wno-pointer-sign ? |
| 497 | AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ]) |
| 498 | |
| 499 | safe_CFLAGS=$CFLAGS |
| 500 | CFLAGS="-Wno-pointer-sign" |
| 501 | |
| 502 | AC_TRY_COMPILE(, [ |
| 503 | int main () { return 0 ; } |
| 504 | ], |
| 505 | [ |
| 506 | no_pointer_sign=yes |
| 507 | AC_MSG_RESULT([yes]) |
| 508 | ], [ |
| 509 | no_pointer_sign=no |
| 510 | AC_MSG_RESULT([no]) |
| 511 | ]) |
| 512 | CFLAGS=$safe_CFLAGS |
| 513 | |
| 514 | if test x$no_pointer_sign = xyes; then |
| 515 | CFLAGS="$CFLAGS -Wno-pointer-sign" |
| 516 | fi |
| 517 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 518 | |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 519 | # does this compiler support -Wdeclaration-after-statement ? |
| 520 | AC_MSG_CHECKING([if gcc accepts -Wdeclaration-after-statement ]) |
| 521 | |
| 522 | safe_CFLAGS=$CFLAGS |
| 523 | CFLAGS="-Wdeclaration-after-statement" |
| 524 | |
| 525 | AC_TRY_COMPILE(, [ |
| 526 | int main () { return 0 ; } |
| 527 | ], |
| 528 | [ |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 529 | declaration_after_statement=yes |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 530 | FLAG_WDECL_AFTER_STMT="-Wdeclaration-after-statement" |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 531 | AC_MSG_RESULT([yes]) |
| 532 | ], [ |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 533 | declaration_after_statement=no |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 534 | FLAG_WDECL_AFTER_STMT="" |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 535 | AC_MSG_RESULT([no]) |
| 536 | ]) |
| 537 | CFLAGS=$safe_CFLAGS |
| 538 | |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 539 | AC_SUBST(FLAG_WDECL_AFTER_STMT) |
| 540 | |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 541 | if test x$declaration_after_statement = xyes; then |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 542 | CFLAGS="$CFLAGS -Wdeclaration-after-statement" |
| 543 | fi |
| 544 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 545 | |
tom | d55121e | 2005-12-19 12:40:13 +0000 | [diff] [blame] | 546 | # does this compiler support __builtin_expect? |
| 547 | AC_MSG_CHECKING([if gcc supports __builtin_expect]) |
| 548 | |
| 549 | AC_TRY_LINK(, [ |
| 550 | return __builtin_expect(1, 1) ? 1 : 0 |
| 551 | ], |
| 552 | [ |
| 553 | ac_have_builtin_expect=yes |
| 554 | AC_MSG_RESULT([yes]) |
| 555 | ], [ |
| 556 | ac_have_builtin_expect=no |
| 557 | AC_MSG_RESULT([no]) |
| 558 | ]) |
| 559 | if test x$ac_have_builtin_expect = xyes ; then |
| 560 | AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if gcc supports __builtin_expect.]) |
| 561 | fi |
| 562 | |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 563 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 564 | # does the ppc assembler support "mtocrf" et al? |
| 565 | AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) |
| 566 | |
| 567 | AC_TRY_COMPILE(, [ |
sewardj | dd4cbe1 | 2006-03-12 17:27:44 +0000 | [diff] [blame] | 568 | __asm__ __volatile__("mtocrf 4,0"); |
| 569 | __asm__ __volatile__("mfocrf 0,4"); |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 570 | ], |
| 571 | [ |
| 572 | ac_have_as_ppc_mftocrf=yes |
| 573 | AC_MSG_RESULT([yes]) |
| 574 | ], [ |
| 575 | ac_have_as_ppc_mftocrf=no |
| 576 | AC_MSG_RESULT([no]) |
| 577 | ]) |
| 578 | if test x$ac_have_as_ppc_mftocrf = xyes ; then |
| 579 | AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.]) |
| 580 | fi |
| 581 | |
| 582 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 583 | # Check for TLS support in the compiler and linker |
| 584 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 585 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 586 | [vg_cv_tls=$enableval], |
| 587 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 588 | [[return foo;]])], |
| 589 | [vg_cv_tls=yes], |
| 590 | [vg_cv_tls=no])])]) |
| 591 | |
| 592 | if test "$vg_cv_tls" = yes; then |
| 593 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 594 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 595 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 596 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 597 | # Checks for header files. |
| 598 | AC_HEADER_STDC |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 599 | AC_CHECK_HEADERS([sys/endian.h endian.h mqueue.h]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 600 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 601 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 602 | # Checks for typedefs, structures, and compiler characteristics. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 603 | AC_TYPE_UID_T |
| 604 | AC_TYPE_OFF_T |
| 605 | AC_TYPE_SIZE_T |
| 606 | AC_HEADER_TIME |
| 607 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 608 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 609 | # Checks for library functions. |
| 610 | AC_FUNC_MEMCMP |
| 611 | AC_FUNC_MMAP |
| 612 | AC_TYPE_SIGNAL |
| 613 | |
thughes | beb6eb9 | 2004-06-14 12:33:43 +0000 | [diff] [blame] | 614 | AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr semtimedop]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 615 | |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 616 | |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 617 | # Do we have a useable MPI setup on the primary target |
| 618 | # (mpicc, and suitable MPI2 headers?) |
| 619 | # Note: this is a kludge in that it assumes the specified mpicc |
| 620 | # understands '-m32' or '-m64', as established above |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 621 | MPI_CC="mpicc" |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 622 | mflag_primary= |
| 623 | if test x$VG_PLATFORM_PRI = xX86_LINUX \ |
| 624 | -o x$VG_PLATFORM_PRI = xPPC32_LINUX ; then |
| 625 | mflag_primary=$FLAG_M32 |
| 626 | elif test x$VG_PLATFORM_PRI = xAMD64_LINUX \ |
| 627 | -o x$VG_PLATFORM_PRI = xPPC64_LINUX ; then |
| 628 | mflag_primary=$FLAG_M64 |
| 629 | fi |
| 630 | |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 631 | AC_ARG_WITH(mpicc, |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 632 | [ --with-mpicc= Specify name of MPI2-ised C compiler], |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 633 | MPI_CC=$withval |
| 634 | ) |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 635 | AC_MSG_CHECKING([for usable MPI2-compliant mpicc and mpi.h]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 636 | saved_CC=$CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 637 | saved_CFLAGS=$CFLAGS |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 638 | CC=$MPI_CC |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 639 | CFLAGS=$mflag_primary |
sewardj | d3fcc64 | 2006-03-09 02:49:56 +0000 | [diff] [blame] | 640 | AC_TRY_LINK([ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 641 | #include <mpi.h> |
| 642 | #include <stdio.h> |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 643 | ],[ |
| 644 | int r = MPI_Init(NULL,NULL); |
| 645 | r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL ); |
| 646 | return r; |
| 647 | ], [ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 648 | ac_have_mpi2=yes |
| 649 | AC_MSG_RESULT([yes, $MPI_CC]) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 650 | ], [ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 651 | ac_have_mpi2=no |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 652 | AC_MSG_RESULT([no]) |
| 653 | ]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 654 | CC=$saved_CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 655 | CFLAGS=$saved_CFLAGS |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 656 | |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 657 | AM_CONDITIONAL(BUILD_MPIWRAP, test x$ac_have_mpi2 = xyes) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 658 | AC_SUBST(MPI_CC) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 659 | |
| 660 | |
| 661 | # -------------------- ok. We're done. -------------------- |
| 662 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 663 | AC_OUTPUT( |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 664 | Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 665 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 666 | valgrind.pc |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 667 | docs/Makefile |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 668 | docs/lib/Makefile |
| 669 | docs/images/Makefile |
njn | f7c00b1 | 2005-07-19 21:46:19 +0000 | [diff] [blame] | 670 | docs/internals/Makefile |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 671 | docs/xml/Makefile |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 672 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 673 | tests/vg_regtest |
njn | ec0c27a | 2005-12-10 23:11:28 +0000 | [diff] [blame] | 674 | perf/Makefile |
| 675 | perf/vg_perf |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 676 | include/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 677 | auxprogs/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 678 | coregrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 679 | memcheck/Makefile |
| 680 | memcheck/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 681 | memcheck/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 682 | memcheck/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 683 | memcheck/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 684 | memcheck/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 685 | memcheck/docs/Makefile |
| 686 | cachegrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 687 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 688 | cachegrind/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 689 | cachegrind/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 690 | cachegrind/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 691 | cachegrind/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 692 | cachegrind/docs/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 693 | cachegrind/cg_annotate |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 694 | callgrind/Makefile |
| 695 | callgrind/callgrind_annotate |
| 696 | callgrind/callgrind_control |
| 697 | callgrind/tests/Makefile |
| 698 | callgrind/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 699 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 700 | helgrind/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 701 | helgrind/docs/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 702 | massif/Makefile |
| 703 | massif/hp2ps/Makefile |
| 704 | massif/tests/Makefile |
| 705 | massif/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 706 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 707 | lackey/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 708 | lackey/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 709 | none/Makefile |
| 710 | none/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 711 | none/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 712 | none/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 713 | none/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 714 | none/tests/x86/Makefile |
njn | 9bc8c00 | 2002-10-02 13:49:13 +0000 | [diff] [blame] | 715 | none/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 716 | ) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 717 | |
| 718 | cat<<EOF |
| 719 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 720 | Primary build target: ${VG_PLATFORM_PRI} |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 721 | Secondary build target: ${VG_PLATFORM_SEC} |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 722 | Default supp files: ${DEFAULT_SUPP} |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 723 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 724 | EOF |
| 725 | |
| 726 | cat<<EOF > default.supp |
| 727 | # This is a generated file, composed of the following suppression rules: |
| 728 | # |
| 729 | # ${DEFAULT_SUPP} |
| 730 | # |
| 731 | |
| 732 | EOF |
| 733 | |
| 734 | for file in ${DEFAULT_SUPP} ; do |
| 735 | cat ${srcdir}/$file >> default.supp |
| 736 | done |