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. |
sewardj | 17c4eb1 | 2007-12-11 00:50:54 +0000 | [diff] [blame] | 11 | AC_INIT(Valgrind, 3.4.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) |
bart | 3a2dac0 | 2008-03-18 17:40:38 +0000 | [diff] [blame] | 14 | AM_INIT_AUTOMAKE([foreign]) |
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" |
bart | 6995375 | 2008-07-08 08:53:15 +0000 | [diff] [blame] | 55 | CXXFLAGS="-I/usr/include/qt4" |
| 56 | CPPFLAGS="-I/usr/include/qt4" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 57 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 58 | AC_PROG_LN_S |
| 59 | AC_PROG_CC |
bart | 0affa49 | 2008-03-18 17:53:09 +0000 | [diff] [blame] | 60 | AM_PROG_CC_C_O |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 61 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 62 | AC_PROG_CXX |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 63 | AC_PROG_RANLIB |
| 64 | |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 65 | # If no AR variable was specified, look up the name of the archiver. Otherwise |
| 66 | # do not touch the AR variable. |
| 67 | if test "x$AR" = "x"; then |
| 68 | AC_PATH_PROGS([AR], ["${LD%ld}ar" "ar"], [ar]) |
| 69 | fi |
| 70 | AC_ARG_VAR([AR],[Archiver command]) |
| 71 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 72 | # Check for the compiler support |
| 73 | if test "${GCC}" != "yes" ; then |
| 74 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 75 | fi |
| 76 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 77 | # figure out where perl lives |
| 78 | AC_PATH_PROG(PERL, perl) |
| 79 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 80 | # figure out where gdb lives |
| 81 | AC_PATH_PROG(GDB, gdb) |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 82 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB]) |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 83 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 84 | # some older automake's don't have it so try something on our own |
| 85 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 86 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 87 | AS="${CC}" |
| 88 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 89 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 90 | ASFLAGS="" |
| 91 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 92 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 93 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 94 | |
sewardj | f33b433 | 2008-07-18 18:20:42 +0000 | [diff] [blame^] | 95 | # Check we have GNU sed: some of the stuff done by "make install" relies |
| 96 | # on some pretty fancy sed expressions, and AIX sed doesn't produce the |
| 97 | # same results, causing install to fail |
| 98 | |
| 99 | AC_MSG_CHECKING([for GNU sed]) |
| 100 | |
| 101 | [sed_firstline=`sed --version | head -n 1`] |
| 102 | |
| 103 | case "${sed_firstline}" in |
| 104 | GNU*) |
| 105 | AC_MSG_RESULT([ok, looks like GNU sed]) |
| 106 | ;; |
| 107 | *) |
| 108 | AC_MSG_RESULT([please ensure first 'sed' in your path is GNU sed]) |
| 109 | AC_MSG_RESULT([note: GNU sed is only required at build/install time]) |
| 110 | AC_MSG_ERROR([build/install requires that 'sed' is GNU sed]) |
| 111 | ;; |
| 112 | esac |
| 113 | |
| 114 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 115 | # We don't want gcc < 3.0 |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 116 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 117 | |
sewardj | f33b433 | 2008-07-18 18:20:42 +0000 | [diff] [blame^] | 118 | [gcc_version=`${CC} --version | head -n 1 | sed 's/^[^0-9]*\([0-9.]*\).*$/\1/'`] |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 119 | |
| 120 | case "${gcc_version}" in |
bart | 76719bf | 2008-04-19 07:47:56 +0000 | [diff] [blame] | 121 | 2.*) |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 122 | AC_MSG_RESULT([no (${gcc_version})]) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 123 | AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc]) |
| 124 | ;; |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 125 | *) |
| 126 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 127 | ;; |
| 128 | esac |
| 129 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 130 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 131 | # Checks for the platform, with the aim of setting VG_ARCH. Note |
| 132 | # that VG_ARCH must be set to reflect the most that this CPU can |
| 133 | # do: for example if it is a 64-bit capable PowerPC, then it must |
| 134 | # be set to ppc64 and not ppc32. Ditto for amd64. |
| 135 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 136 | AC_CANONICAL_HOST |
| 137 | |
| 138 | AC_MSG_CHECKING([for a supported CPU]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 139 | AC_SUBST(VG_ARCH) |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 140 | |
sewardj | 9b0567a | 2006-01-17 02:56:18 +0000 | [diff] [blame] | 141 | AC_SUBST(VG_ARCH_ALL) |
| 142 | VG_ARCH_ALL="amd64 ppc32 ppc64 x86" |
| 143 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 144 | AC_SUBST(VALT_LOAD_ADDRESS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 145 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 146 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 147 | i?86) |
| 148 | AC_MSG_RESULT([ok (${host_cpu})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 149 | VG_ARCH="x86" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame] | 150 | valt_load_address_normal="0x38000000" |
| 151 | valt_load_address_inner="0x28000000" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 152 | ;; |
| 153 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 154 | x86_64) |
| 155 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 156 | VG_ARCH="amd64" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame] | 157 | valt_load_address_normal="0x38000000" |
| 158 | valt_load_address_inner="0x28000000" |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 159 | ;; |
| 160 | |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 161 | powerpc64) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 162 | # This value can only happen on Linux, not on AIX |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 163 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 164 | VG_ARCH="ppc64" |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame] | 165 | valt_load_address_normal="0x38000000" |
| 166 | valt_load_address_inner="0x28000000" |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 167 | ;; |
| 168 | |
| 169 | powerpc) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 170 | # Complexity. 'powerpc' on AIX implies a 64-bit capable CPU. |
| 171 | # Whereas in Linux that means only a 32-bit capable CPU. |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 172 | AC_MSG_RESULT([ok (${host_cpu})]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 173 | case "${host_os}" in |
| 174 | aix5.*) |
| 175 | VG_ARCH="ppc64" |
| 176 | ;; |
| 177 | *) |
| 178 | VG_ARCH="ppc32" |
| 179 | ;; |
| 180 | esac |
sewardj | d7baad4 | 2006-05-20 01:13:38 +0000 | [diff] [blame] | 181 | valt_load_address_normal="0x38000000" |
| 182 | valt_load_address_inner="0x28000000" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 183 | ;; |
| 184 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 185 | *) |
| 186 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 187 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 188 | ;; |
| 189 | esac |
| 190 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 191 | # Check if this should be built as an inner Valgrind, to be run within |
| 192 | # another Valgrind. Choose the load address accordingly. |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 193 | AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, |
| 194 | [AC_ARG_ENABLE(inner, |
| 195 | [ --enable-inner enables self-hosting], |
| 196 | [vg_cv_inner=$enableval], |
| 197 | [vg_cv_inner=no])]) |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 198 | if test "$vg_cv_inner" = yes; then |
| 199 | AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind]) |
| 200 | VALT_LOAD_ADDRESS=$valt_load_address_inner |
| 201 | else |
| 202 | VALT_LOAD_ADDRESS=$valt_load_address_normal |
| 203 | fi |
| 204 | |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 205 | # Sometimes it's convenient to subvert the bi-arch build system and |
| 206 | # just have a single build even though the underlying platform is |
| 207 | # capable of both. Hence handle --enable-only64bit and |
| 208 | # --enable-only32bit. Complain if both are issued :-) |
| 209 | |
| 210 | # Check if a 64-bit only build has been requested |
| 211 | AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, |
| 212 | [AC_ARG_ENABLE(only64bit, |
| 213 | [ --enable-only64bit do a 64-bit only build], |
| 214 | [vg_cv_only64bit=$enableval], |
| 215 | [vg_cv_only64bit=no])]) |
| 216 | |
| 217 | # Check if a 32-bit only build has been requested |
| 218 | AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit, |
| 219 | [AC_ARG_ENABLE(only32bit, |
| 220 | [ --enable-only32bit do a 32-bit only build], |
| 221 | [vg_cv_only32bit=$enableval], |
| 222 | [vg_cv_only32bit=no])]) |
| 223 | |
| 224 | # Stay sane |
| 225 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 226 | AC_MSG_ERROR( |
| 227 | [Nonsensical: both --enable-only64bit and --enable-only32bit.]) |
| 228 | fi |
| 229 | |
| 230 | |
| 231 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 232 | AC_MSG_CHECKING([for a supported OS]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 233 | AC_SUBST(VG_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 234 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 235 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 236 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 237 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 238 | VG_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 239 | |
| 240 | # Ok, this is linux. Check the kernel version |
| 241 | AC_MSG_CHECKING([for the kernel version]) |
| 242 | |
| 243 | kernel=`uname -r` |
| 244 | |
| 245 | case "${kernel}" in |
| 246 | 2.6.*) |
| 247 | AC_MSG_RESULT([2.6 family (${kernel})]) |
| 248 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x]) |
| 249 | ;; |
| 250 | |
| 251 | 2.4.*) |
| 252 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 253 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 254 | ;; |
| 255 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 256 | *) |
| 257 | AC_MSG_RESULT([unsupported (${kernel})]) |
nethercote | 4fa681f | 2004-11-08 17:51:39 +0000 | [diff] [blame] | 258 | AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 259 | ;; |
| 260 | esac |
| 261 | |
| 262 | ;; |
| 263 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 264 | aix5.1.*) |
| 265 | AC_MSG_RESULT([ok (${host_os})]) |
| 266 | VG_OS="aix5" |
| 267 | ;; |
| 268 | aix5.2.*) |
| 269 | AC_MSG_RESULT([ok (${host_os})]) |
| 270 | VG_OS="aix5" |
| 271 | ;; |
| 272 | aix5.3.*) |
| 273 | AC_MSG_RESULT([ok (${host_os})]) |
| 274 | VG_OS="aix5" |
| 275 | ;; |
| 276 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 277 | *freebsd*) |
| 278 | AC_MSG_RESULT([ok (${host_os})]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 279 | VG_OS="freebsd" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 280 | ;; |
| 281 | |
| 282 | *) |
| 283 | AC_MSG_RESULT([no (${host_os})]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 284 | 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] | 285 | ;; |
| 286 | esac |
| 287 | |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 288 | # If we are building on a 64 bit platform test to see if the system |
| 289 | # supports building 32 bit programs and disable 32 bit support if it |
| 290 | # does not support building 32 bit programs |
| 291 | |
| 292 | case "$VG_ARCH-$VG_OS" in |
| 293 | amd64-linux|ppc64-linux) |
| 294 | AC_MSG_CHECKING([for 32 bit build support]) |
| 295 | safe_CFLAGS=$CFLAGS |
| 296 | CFLAGS="-m32" |
| 297 | AC_TRY_LINK(, [ |
| 298 | int main () { return 0 ; } |
| 299 | ], |
| 300 | [ |
| 301 | AC_MSG_RESULT([yes]) |
| 302 | ], [ |
| 303 | vg_cv_only64bit="yes" |
| 304 | AC_MSG_RESULT([no]) |
| 305 | ]) |
| 306 | CFLAGS=$safe_CFLAGS;; |
| 307 | esac |
| 308 | |
| 309 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 310 | AC_MSG_ERROR( |
| 311 | [--enable-only32bit was specified but system does not support 32 bit builds]) |
| 312 | fi |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 313 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 314 | # Establish VG_PLATFORM_PRI. This is the primary build target. The |
| 315 | # entire system, including regression and performance tests, will be |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 316 | # built for this target. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 317 | # |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 318 | # Also establish VG_PLATFORM_SEC, the secondary build target, if |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 319 | # possible. The system will also be built for this target, but not |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 320 | # the regression or performance tests. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 321 | # |
| 322 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 323 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 324 | AC_SUBST(VG_PLATFORM_PRI) |
| 325 | AC_SUBST(VG_PLATFORM_SEC) |
| 326 | |
| 327 | case "$VG_ARCH-$VG_OS" in |
| 328 | x86-linux) |
| 329 | VG_PLATFORM_PRI="X86_LINUX" |
| 330 | VG_PLATFORM_SEC="" |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 331 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 332 | ;; |
| 333 | amd64-linux) |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 334 | if test x$vg_cv_only64bit = xyes; then |
| 335 | VG_PLATFORM_PRI="AMD64_LINUX" |
| 336 | VG_PLATFORM_SEC="" |
| 337 | elif test x$vg_cv_only32bit = xyes; then |
| 338 | VG_PLATFORM_PRI="X86_LINUX" |
| 339 | VG_PLATFORM_SEC="" |
| 340 | else |
| 341 | VG_PLATFORM_PRI="AMD64_LINUX" |
| 342 | VG_PLATFORM_SEC="X86_LINUX" |
| 343 | fi |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 344 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 345 | ;; |
| 346 | ppc32-linux) |
| 347 | VG_PLATFORM_PRI="PPC32_LINUX" |
| 348 | VG_PLATFORM_SEC="" |
| 349 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 350 | ;; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 351 | ppc64-aix5) |
| 352 | if test x$vg_cv_only64bit = xyes; then |
| 353 | VG_PLATFORM_PRI="PPC64_AIX5" |
| 354 | VG_PLATFORM_SEC="" |
| 355 | elif test x$vg_cv_only32bit = xyes; then |
| 356 | VG_PLATFORM_PRI="PPC32_AIX5" |
| 357 | VG_PLATFORM_SEC="" |
| 358 | else |
| 359 | VG_PLATFORM_PRI="PPC64_AIX5" |
| 360 | VG_PLATFORM_SEC="PPC32_AIX5" |
| 361 | fi |
| 362 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 363 | ;; |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 364 | ppc64-linux) |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 365 | if test x$vg_cv_only64bit = xyes; then |
| 366 | VG_PLATFORM_PRI="PPC64_LINUX" |
| 367 | VG_PLATFORM_SEC="" |
| 368 | elif test x$vg_cv_only32bit = xyes; then |
| 369 | VG_PLATFORM_PRI="PPC32_LINUX" |
| 370 | VG_PLATFORM_SEC="" |
| 371 | else |
| 372 | VG_PLATFORM_PRI="PPC64_LINUX" |
| 373 | VG_PLATFORM_SEC="PPC32_LINUX" |
| 374 | fi |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 375 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 376 | ;; |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 377 | *) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 378 | VG_PLATFORM_PRI="unknown" |
| 379 | VG_PLATFORM_SEC="unknown" |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 380 | AC_MSG_RESULT([no (${host_cpu}-${host_os})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 381 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 382 | ;; |
| 383 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 384 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 385 | # Set up VGP_<platform>. Either one or two of these become defined. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 386 | # |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 387 | AM_CONDITIONAL(VGP_X86_LINUX, |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 388 | test x$VG_PLATFORM_PRI = xX86_LINUX \ |
| 389 | -o x$VG_PLATFORM_SEC = xX86_LINUX) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 390 | AM_CONDITIONAL(VGP_AMD64_LINUX, |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 391 | test x$VG_PLATFORM_PRI = xAMD64_LINUX) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 392 | AM_CONDITIONAL(VGP_PPC32_LINUX, |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 393 | test x$VG_PLATFORM_PRI = xPPC32_LINUX \ |
| 394 | -o x$VG_PLATFORM_SEC = xPPC32_LINUX) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 395 | AM_CONDITIONAL(VGP_PPC64_LINUX, |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 396 | test x$VG_PLATFORM_PRI = xPPC64_LINUX) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 397 | AM_CONDITIONAL(VGP_PPC32_AIX5, |
| 398 | test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ |
| 399 | -o x$VG_PLATFORM_SEC = xPPC32_AIX5) |
| 400 | AM_CONDITIONAL(VGP_PPC64_AIX5, |
| 401 | test x$VG_PLATFORM_PRI = xPPC64_AIX5) |
| 402 | |
| 403 | # Similarly, set up VGO_<os>. Exactly one of these becomes defined. |
| 404 | # Relies on the assumption that the primary and secondary targets are |
| 405 | # for the same OS, so therefore only necessary to test the primary. |
| 406 | # |
| 407 | AM_CONDITIONAL(VGO_LINUX, |
| 408 | test x$VG_PLATFORM_PRI = xX86_LINUX \ |
| 409 | -o x$VG_PLATFORM_PRI = xAMD64_LINUX \ |
| 410 | -o x$VG_PLATFORM_PRI = xPPC32_LINUX \ |
| 411 | -o x$VG_PLATFORM_PRI = xPPC64_LINUX) |
| 412 | AM_CONDITIONAL(VGO_AIX5, |
| 413 | test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ |
| 414 | -o x$VG_PLATFORM_PRI = xPPC64_AIX5) |
| 415 | |
| 416 | |
| 417 | # Sometimes, in the Makefile.am-s, it's useful to know |
| 418 | # whether or not there is a secondary target. |
| 419 | # |
| 420 | AM_CONDITIONAL(VGP_HAVE_SECONDARY, |
| 421 | test x$VG_PLATFORM_SEC != x) |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 422 | |
tom | b637bad | 2005-11-08 12:28:35 +0000 | [diff] [blame] | 423 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 424 | # This variable will collect the individual suppression files |
| 425 | # depending on the results of autoconf |
| 426 | DEFAULT_SUPP="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 427 | AC_SUBST(DEFAULT_SUPP) |
| 428 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 429 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 430 | GLIBC_VERSION="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 431 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 432 | AC_EGREP_CPP([GLIBC_22], [ |
| 433 | #include <features.h> |
| 434 | #ifdef __GNU_LIBRARY__ |
| 435 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2) |
| 436 | GLIBC_22 |
| 437 | #endif |
| 438 | #endif |
| 439 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 440 | GLIBC_VERSION="2.2") |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 441 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 442 | AC_EGREP_CPP([GLIBC_23], [ |
| 443 | #include <features.h> |
| 444 | #ifdef __GNU_LIBRARY__ |
| 445 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3) |
| 446 | GLIBC_23 |
| 447 | #endif |
| 448 | #endif |
| 449 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 450 | GLIBC_VERSION="2.3") |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 451 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 452 | AC_EGREP_CPP([GLIBC_24], [ |
| 453 | #include <features.h> |
| 454 | #ifdef __GNU_LIBRARY__ |
| 455 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 4) |
| 456 | GLIBC_24 |
| 457 | #endif |
| 458 | #endif |
| 459 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 460 | GLIBC_VERSION="2.4") |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 461 | |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 462 | AC_EGREP_CPP([GLIBC_25], [ |
| 463 | #include <features.h> |
| 464 | #ifdef __GNU_LIBRARY__ |
| 465 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 5) |
| 466 | GLIBC_25 |
| 467 | #endif |
| 468 | #endif |
| 469 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 470 | GLIBC_VERSION="2.5") |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 471 | |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 472 | AC_EGREP_CPP([GLIBC_26], [ |
| 473 | #include <features.h> |
| 474 | #ifdef __GNU_LIBRARY__ |
| 475 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 6) |
| 476 | GLIBC_26 |
| 477 | #endif |
| 478 | #endif |
| 479 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 480 | GLIBC_VERSION="2.6") |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 481 | |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 482 | AC_EGREP_CPP([GLIBC_27], [ |
| 483 | #include <features.h> |
| 484 | #ifdef __GNU_LIBRARY__ |
| 485 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 7) |
| 486 | GLIBC_27 |
| 487 | #endif |
| 488 | #endif |
| 489 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 490 | GLIBC_VERSION="2.7") |
| 491 | |
| 492 | AC_EGREP_CPP([GLIBC_28], [ |
| 493 | #include <features.h> |
| 494 | #ifdef __GNU_LIBRARY__ |
| 495 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 8) |
| 496 | GLIBC_28 |
| 497 | #endif |
| 498 | #endif |
| 499 | ], |
| 500 | GLIBC_VERSION="2.8") |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 501 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 502 | AC_EGREP_CPP([AIX5_LIBC], [ |
| 503 | #include <standards.h> |
| 504 | #if defined(_AIXVERSION_510) || defined(_AIXVERSION_520) || defined(_AIXVERSION_530) |
| 505 | AIX5_LIBC |
| 506 | #endif |
| 507 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 508 | GLIBC_VERSION="aix5") |
daywalker | e9212b3 | 2003-06-15 22:39:15 +0000 | [diff] [blame] | 509 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 510 | AC_MSG_CHECKING([the GLIBC_VERSION version]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 511 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 512 | case "${GLIBC_VERSION}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 513 | 2.2) |
| 514 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 515 | AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 516 | DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" |
| 517 | DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 518 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 519 | ;; |
| 520 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 521 | 2.3) |
| 522 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 523 | AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 524 | DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 525 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 526 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 527 | ;; |
| 528 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 529 | 2.4) |
| 530 | AC_MSG_RESULT(2.4 family) |
| 531 | AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 532 | DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 533 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 534 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 535 | ;; |
| 536 | |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 537 | 2.5) |
| 538 | AC_MSG_RESULT(2.5 family) |
| 539 | AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 540 | DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 541 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 542 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 543 | ;; |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 544 | 2.6) |
| 545 | AC_MSG_RESULT(2.6 family) |
| 546 | AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 547 | DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 548 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 549 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 550 | ;; |
| 551 | 2.7) |
| 552 | AC_MSG_RESULT(2.7 family) |
| 553 | AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x]) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 554 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 555 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 556 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 557 | ;; |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 558 | 2.8) |
| 559 | AC_MSG_RESULT(2.8 family) |
dirk | eb939fc | 2008-04-27 20:38:47 +0000 | [diff] [blame] | 560 | AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x]) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 561 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 562 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 563 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 564 | ;; |
| 565 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 566 | aix5) |
sewardj | 2f3bcd2 | 2006-12-12 01:38:15 +0000 | [diff] [blame] | 567 | AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3) |
| 568 | AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1 or 5.2 or 5.3]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 569 | DEFAULT_SUPP="aix5libc.supp ${DEFAULT_SUPP}" |
| 570 | ;; |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 571 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 572 | *) |
| 573 | AC_MSG_RESULT(unsupported version) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 574 | AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.8]) |
| 575 | AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 576 | ;; |
| 577 | esac |
| 578 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 579 | AC_SUBST(GLIBC_VERSION) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 580 | |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 581 | # We don't know how to detect the X client library version |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 582 | # (detecting the server version is easy, but no help). So we |
nethercote | 3d260f6 | 2004-10-31 19:39:18 +0000 | [diff] [blame] | 583 | # just use a hack: always include the suppressions for both |
| 584 | # versions 3 and 4. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 585 | AC_PATH_X |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 586 | if test "${no_x}" != 'yes' ; then |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 587 | DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" |
| 588 | DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 589 | fi |
| 590 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 591 | |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 592 | # Check for CLOCK_MONOTONIC |
| 593 | |
| 594 | AC_MSG_CHECKING([for CLOCK_MONOTONIC]) |
| 595 | |
| 596 | AC_TRY_COMPILE( |
| 597 | [ |
| 598 | #include <time.h> |
| 599 | ], [ |
| 600 | struct timespec t; |
| 601 | clock_gettime(CLOCK_MONOTONIC, &t); |
| 602 | return 0; |
| 603 | ], |
| 604 | [ |
| 605 | AC_MSG_RESULT([yes]) |
| 606 | AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, |
| 607 | [Define to 1 if you have the `CLOCK_MONOTONIC' constant.]) |
| 608 | ], [ |
| 609 | AC_MSG_RESULT([no]) |
| 610 | ]) |
| 611 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 612 | |
| 613 | # Check for PTHREAD_MUTEX_ADAPTIVE_NP |
| 614 | |
| 615 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP]) |
| 616 | |
| 617 | AC_TRY_COMPILE( |
| 618 | [ |
| 619 | #define _GNU_SOURCE |
| 620 | #include <pthread.h> |
| 621 | ], [ |
| 622 | return (PTHREAD_MUTEX_ADAPTIVE_NP); |
| 623 | ], |
| 624 | [ |
| 625 | AC_MSG_RESULT([yes]) |
| 626 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, |
| 627 | [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.]) |
| 628 | ], [ |
| 629 | AC_MSG_RESULT([no]) |
| 630 | ]) |
| 631 | |
| 632 | |
| 633 | # Check for PTHREAD_MUTEX_ERRORCHECK_NP |
| 634 | |
| 635 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP]) |
| 636 | |
| 637 | AC_TRY_COMPILE( |
| 638 | [ |
| 639 | #define _GNU_SOURCE |
| 640 | #include <pthread.h> |
| 641 | ], [ |
| 642 | return (PTHREAD_MUTEX_ERRORCHECK_NP); |
| 643 | ], |
| 644 | [ |
| 645 | AC_MSG_RESULT([yes]) |
| 646 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1, |
| 647 | [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.]) |
| 648 | ], [ |
| 649 | AC_MSG_RESULT([no]) |
| 650 | ]) |
| 651 | |
| 652 | |
| 653 | # Check for PTHREAD_MUTEX_RECURSIVE_NP |
| 654 | |
| 655 | AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP]) |
| 656 | |
| 657 | AC_TRY_COMPILE( |
| 658 | [ |
| 659 | #define _GNU_SOURCE |
| 660 | #include <pthread.h> |
| 661 | ], [ |
| 662 | return (PTHREAD_MUTEX_RECURSIVE_NP); |
| 663 | ], |
| 664 | [ |
| 665 | AC_MSG_RESULT([yes]) |
| 666 | AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, |
| 667 | [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.]) |
| 668 | ], [ |
| 669 | AC_MSG_RESULT([no]) |
| 670 | ]) |
| 671 | |
| 672 | |
| 673 | # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
| 674 | |
| 675 | AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP]) |
| 676 | |
| 677 | AC_TRY_COMPILE( |
| 678 | [ |
| 679 | #define _GNU_SOURCE |
| 680 | #include <pthread.h> |
| 681 | ], [ |
| 682 | pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; |
| 683 | return 0; |
| 684 | ], |
| 685 | [ |
| 686 | AC_MSG_RESULT([yes]) |
| 687 | AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1, |
| 688 | [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.]) |
| 689 | ], [ |
| 690 | AC_MSG_RESULT([no]) |
| 691 | ]) |
| 692 | |
| 693 | |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 694 | # Check whether pthread_mutex_t has a member called __m_kind. |
| 695 | |
| 696 | AC_MSG_CHECKING([for pthread_mutex_t::__m_kind]) |
| 697 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 698 | AC_TRY_COMPILE( |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 699 | [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 700 | #include <pthread.h> |
| 701 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 702 | pthread_mutex_t m; |
| 703 | return m.__m_kind; |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 704 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 705 | AC_MSG_RESULT([yes]) |
| 706 | AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND], 1, |
| 707 | [Define to 1 if pthread_mutex_t has a member called __m_kind.]) |
| 708 | ], [ |
| 709 | AC_MSG_RESULT([no]) |
| 710 | ]) |
| 711 | |
| 712 | |
| 713 | # Check whether pthread_mutex_t has a member called __data.__kind. |
| 714 | |
| 715 | AC_MSG_CHECKING([for pthread_mutex_t::__data.__kind]) |
| 716 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 717 | AC_TRY_COMPILE( |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 718 | [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 719 | #include <pthread.h> |
| 720 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 721 | pthread_mutex_t m; |
| 722 | return m.__data.__kind; |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 723 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 724 | AC_MSG_RESULT([yes]) |
| 725 | AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND], 1, |
| 726 | [Define to 1 if pthread_mutex_t has a member __data.__kind.]) |
| 727 | ], [ |
| 728 | AC_MSG_RESULT([no]) |
| 729 | ]) |
| 730 | |
| 731 | |
bart | 6111133 | 2008-03-10 17:57:41 +0000 | [diff] [blame] | 732 | # does this compiler support -fopenmp, does it have the include file |
| 733 | # <omp.h> and does it have libgomp ? |
bart | 29cc9db | 2008-03-09 15:59:30 +0000 | [diff] [blame] | 734 | |
bart | 1f52b82 | 2008-03-12 17:11:48 +0000 | [diff] [blame] | 735 | AC_MSG_CHECKING([for OpenMP]) |
| 736 | |
bart | 29cc9db | 2008-03-09 15:59:30 +0000 | [diff] [blame] | 737 | safe_CFLAGS=$CFLAGS |
| 738 | CFLAGS="-fopenmp" |
| 739 | |
bart | 1f52b82 | 2008-03-12 17:11:48 +0000 | [diff] [blame] | 740 | AC_LINK_IFELSE( |
bart | 29cc9db | 2008-03-09 15:59:30 +0000 | [diff] [blame] | 741 | [ |
bart | 1f52b82 | 2008-03-12 17:11:48 +0000 | [diff] [blame] | 742 | #include <omp.h> |
| 743 | int main(int argc, char** argv) |
| 744 | { |
| 745 | omp_set_dynamic(0); |
| 746 | return 0; |
| 747 | } |
| 748 | ], |
| 749 | [ |
| 750 | ac_have_openmp=yes |
bart | 29cc9db | 2008-03-09 15:59:30 +0000 | [diff] [blame] | 751 | AC_MSG_RESULT([yes]) |
| 752 | ], [ |
bart | 1f52b82 | 2008-03-12 17:11:48 +0000 | [diff] [blame] | 753 | ac_have_openmp=no |
bart | 29cc9db | 2008-03-09 15:59:30 +0000 | [diff] [blame] | 754 | AC_MSG_RESULT([no]) |
| 755 | ]) |
| 756 | CFLAGS=$safe_CFLAGS |
| 757 | |
bart | 1f52b82 | 2008-03-12 17:11:48 +0000 | [diff] [blame] | 758 | AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) |
bart | 29cc9db | 2008-03-09 15:59:30 +0000 | [diff] [blame] | 759 | |
| 760 | |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 761 | # does this compiler support -maltivec and does it have the include file |
| 762 | # <altivec.h> ? |
| 763 | |
| 764 | AC_MSG_CHECKING([for Altivec]) |
| 765 | |
| 766 | safe_CFLAGS=$CFLAGS |
| 767 | CFLAGS="-maltivec" |
| 768 | |
| 769 | AC_TRY_COMPILE( |
| 770 | [ |
| 771 | #include <altivec.h> |
| 772 | ], [ |
| 773 | vector unsigned int v; |
| 774 | ], |
| 775 | [ |
| 776 | ac_have_altivec=yes |
| 777 | AC_MSG_RESULT([yes]) |
| 778 | ], [ |
| 779 | ac_have_altivec=no |
| 780 | AC_MSG_RESULT([no]) |
| 781 | ]) |
| 782 | CFLAGS=$safe_CFLAGS |
| 783 | |
| 784 | AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes]) |
| 785 | AM_CONDITIONAL([HAVE_ALTIVEC_H], [test x$ac_have_altivec = xyes]) |
| 786 | |
| 787 | |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 788 | # Check for eventfd_t, eventfd() and eventfd_read() |
| 789 | AC_MSG_CHECKING([for eventfd()]) |
| 790 | |
| 791 | AC_TRY_LINK( |
| 792 | [ |
| 793 | #include <sys/eventfd.h> |
| 794 | ], [ |
| 795 | eventfd_t ev; |
| 796 | int fd; |
| 797 | |
| 798 | fd = eventfd(5, 0); |
| 799 | eventfd_read(fd, &ev); |
| 800 | return 0; |
| 801 | ], |
| 802 | [ |
| 803 | AC_MSG_RESULT([yes]) |
| 804 | AC_DEFINE([HAVE_EVENTFD], 1, |
| 805 | [Define to 1 if you have the `eventfd' function.]) |
| 806 | AC_DEFINE([HAVE_EVENTFD_READ], 1, |
| 807 | [Define to 1 if you have the `eventfd_read' function.]) |
| 808 | ], [ |
| 809 | AC_MSG_RESULT([no]) |
| 810 | ]) |
| 811 | |
| 812 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 813 | # does this compiler support -m32 ? |
| 814 | AC_MSG_CHECKING([if gcc accepts -m32]) |
| 815 | |
| 816 | safe_CFLAGS=$CFLAGS |
| 817 | CFLAGS="-m32" |
| 818 | |
| 819 | AC_TRY_COMPILE(, [ |
| 820 | int main () { return 0 ; } |
| 821 | ], |
| 822 | [ |
| 823 | FLAG_M32="-m32" |
| 824 | AC_MSG_RESULT([yes]) |
| 825 | ], [ |
| 826 | FLAG_M32="" |
| 827 | AC_MSG_RESULT([no]) |
| 828 | ]) |
| 829 | CFLAGS=$safe_CFLAGS |
| 830 | |
| 831 | AC_SUBST(FLAG_M32) |
| 832 | |
| 833 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 834 | # does this compiler support -maix32 ? |
| 835 | AC_MSG_CHECKING([if gcc accepts -maix32]) |
| 836 | |
| 837 | safe_CFLAGS=$CFLAGS |
| 838 | CFLAGS="-maix32" |
| 839 | |
| 840 | AC_TRY_COMPILE(, [ |
| 841 | int main () { return 0 ; } |
| 842 | ], |
| 843 | [ |
| 844 | FLAG_MAIX32="-maix32" |
| 845 | AC_MSG_RESULT([yes]) |
| 846 | ], [ |
| 847 | FLAG_MAIX32="" |
| 848 | AC_MSG_RESULT([no]) |
| 849 | ]) |
| 850 | CFLAGS=$safe_CFLAGS |
| 851 | |
| 852 | AC_SUBST(FLAG_MAIX32) |
| 853 | |
| 854 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 855 | # does this compiler support -m64 ? |
| 856 | AC_MSG_CHECKING([if gcc accepts -m64]) |
| 857 | |
| 858 | safe_CFLAGS=$CFLAGS |
| 859 | CFLAGS="-m64" |
| 860 | |
| 861 | AC_TRY_COMPILE(, [ |
| 862 | int main () { return 0 ; } |
| 863 | ], |
| 864 | [ |
| 865 | FLAG_M64="-m64" |
| 866 | AC_MSG_RESULT([yes]) |
| 867 | ], [ |
| 868 | FLAG_M64="" |
| 869 | AC_MSG_RESULT([no]) |
| 870 | ]) |
| 871 | CFLAGS=$safe_CFLAGS |
| 872 | |
| 873 | AC_SUBST(FLAG_M64) |
| 874 | |
| 875 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 876 | # does this compiler support -maix64 ? |
| 877 | AC_MSG_CHECKING([if gcc accepts -maix64]) |
| 878 | |
| 879 | safe_CFLAGS=$CFLAGS |
| 880 | CFLAGS="-maix64" |
| 881 | |
| 882 | AC_TRY_COMPILE(, [ |
| 883 | int main () { return 0 ; } |
| 884 | ], |
| 885 | [ |
| 886 | FLAG_MAIX64="-maix64" |
| 887 | AC_MSG_RESULT([yes]) |
| 888 | ], [ |
| 889 | FLAG_MAIX64="" |
| 890 | AC_MSG_RESULT([no]) |
| 891 | ]) |
| 892 | CFLAGS=$safe_CFLAGS |
| 893 | |
| 894 | AC_SUBST(FLAG_MAIX64) |
| 895 | |
| 896 | |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 897 | # does this compiler support -mmmx ? |
| 898 | AC_MSG_CHECKING([if gcc accepts -mmmx]) |
| 899 | |
| 900 | safe_CFLAGS=$CFLAGS |
| 901 | CFLAGS="-mmmx" |
| 902 | |
| 903 | AC_TRY_COMPILE(, [ |
| 904 | int main () { return 0 ; } |
| 905 | ], |
| 906 | [ |
| 907 | FLAG_MMMX="-mmmx" |
| 908 | AC_MSG_RESULT([yes]) |
| 909 | ], [ |
| 910 | FLAG_MMMX="" |
| 911 | AC_MSG_RESULT([no]) |
| 912 | ]) |
| 913 | CFLAGS=$safe_CFLAGS |
| 914 | |
| 915 | AC_SUBST(FLAG_MMMX) |
| 916 | |
| 917 | |
| 918 | # does this compiler support -msse ? |
| 919 | AC_MSG_CHECKING([if gcc accepts -msse]) |
| 920 | |
| 921 | safe_CFLAGS=$CFLAGS |
| 922 | CFLAGS="-msse" |
| 923 | |
| 924 | AC_TRY_COMPILE(, [ |
| 925 | int main () { return 0 ; } |
| 926 | ], |
| 927 | [ |
| 928 | FLAG_MSSE="-msse" |
| 929 | AC_MSG_RESULT([yes]) |
| 930 | ], [ |
| 931 | FLAG_MSSE="" |
| 932 | AC_MSG_RESULT([no]) |
| 933 | ]) |
| 934 | CFLAGS=$safe_CFLAGS |
| 935 | |
| 936 | AC_SUBST(FLAG_MSSE) |
| 937 | |
| 938 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 939 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 940 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 941 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 942 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 943 | CFLAGS="-mpreferred-stack-boundary=2" |
| 944 | |
| 945 | AC_TRY_COMPILE(, [ |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 946 | int main () { return 0 ; } |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 947 | ], |
| 948 | [ |
| 949 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 950 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 951 | ], [ |
| 952 | PREFERRED_STACK_BOUNDARY="" |
| 953 | AC_MSG_RESULT([no]) |
| 954 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 955 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 956 | |
| 957 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 958 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 959 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 960 | # does this compiler support -Wno-pointer-sign ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 961 | AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign]) |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 962 | |
| 963 | safe_CFLAGS=$CFLAGS |
| 964 | CFLAGS="-Wno-pointer-sign" |
| 965 | |
| 966 | AC_TRY_COMPILE(, [ |
| 967 | int main () { return 0 ; } |
| 968 | ], |
| 969 | [ |
| 970 | no_pointer_sign=yes |
| 971 | AC_MSG_RESULT([yes]) |
| 972 | ], [ |
| 973 | no_pointer_sign=no |
| 974 | AC_MSG_RESULT([no]) |
| 975 | ]) |
| 976 | CFLAGS=$safe_CFLAGS |
| 977 | |
| 978 | if test x$no_pointer_sign = xyes; then |
| 979 | CFLAGS="$CFLAGS -Wno-pointer-sign" |
| 980 | fi |
| 981 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 982 | |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 983 | # does this compiler support -Wdeclaration-after-statement ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 984 | AC_MSG_CHECKING([if gcc accepts -Wdeclaration-after-statement]) |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 985 | |
| 986 | safe_CFLAGS=$CFLAGS |
| 987 | CFLAGS="-Wdeclaration-after-statement" |
| 988 | |
| 989 | AC_TRY_COMPILE(, [ |
| 990 | int main () { return 0 ; } |
| 991 | ], |
| 992 | [ |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 993 | declaration_after_statement=yes |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 994 | FLAG_WDECL_AFTER_STMT="-Wdeclaration-after-statement" |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 995 | AC_MSG_RESULT([yes]) |
| 996 | ], [ |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 997 | declaration_after_statement=no |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 998 | FLAG_WDECL_AFTER_STMT="" |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 999 | AC_MSG_RESULT([no]) |
| 1000 | ]) |
| 1001 | CFLAGS=$safe_CFLAGS |
| 1002 | |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 1003 | AC_SUBST(FLAG_WDECL_AFTER_STMT) |
| 1004 | |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 1005 | if test x$declaration_after_statement = xyes; then |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1006 | CFLAGS="$CFLAGS -Wdeclaration-after-statement" |
| 1007 | fi |
| 1008 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1009 | |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1010 | # does this compiler support -Wno-format-zero-length ? |
| 1011 | |
| 1012 | AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length]) |
| 1013 | |
| 1014 | safe_CFLAGS=$CFLAGS |
| 1015 | CFLAGS="-Wno-format-zero-length" |
| 1016 | |
| 1017 | AC_TRY_COMPILE( |
| 1018 | [ ], |
| 1019 | [ |
| 1020 | return 0; |
| 1021 | ], |
| 1022 | [ |
| 1023 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length]) |
| 1024 | AC_MSG_RESULT([yes]) |
| 1025 | ], |
| 1026 | [ |
| 1027 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], []) |
| 1028 | AC_MSG_RESULT([no]) |
| 1029 | ]) |
| 1030 | CFLAGS=$safe_CFLAGS |
| 1031 | |
| 1032 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1033 | # does this compiler support -Wextra or the older -W ? |
| 1034 | |
| 1035 | AC_MSG_CHECKING([if gcc accepts -Wextra or -W]) |
| 1036 | |
| 1037 | safe_CFLAGS=$CFLAGS |
| 1038 | CFLAGS="-Wextra" |
| 1039 | |
| 1040 | AC_TRY_COMPILE( |
| 1041 | [ ], |
| 1042 | [ |
| 1043 | return 0; |
| 1044 | ], |
| 1045 | [ |
| 1046 | AC_SUBST([FLAG_W_EXTRA], [-Wextra]) |
| 1047 | AC_MSG_RESULT([-Wextra]) |
| 1048 | ], [ |
| 1049 | CFLAGS="-W" |
| 1050 | AC_TRY_COMPILE( |
| 1051 | [ ], |
| 1052 | [ |
| 1053 | return 0; |
| 1054 | ], |
| 1055 | [ |
| 1056 | AC_SUBST([FLAG_W_EXTRA], [-W]) |
| 1057 | AC_MSG_RESULT([-W]) |
| 1058 | ], [ |
| 1059 | AC_SUBST([FLAG_W_EXTRA], []) |
| 1060 | AC_MSG_RESULT([not supported]) |
| 1061 | ]) |
| 1062 | ]) |
| 1063 | CFLAGS=$safe_CFLAGS |
| 1064 | |
| 1065 | |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1066 | # does this compiler support -fno-stack-protector ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1067 | AC_MSG_CHECKING([if gcc accepts -fno-stack-protector]) |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1068 | |
| 1069 | safe_CFLAGS=$CFLAGS |
| 1070 | CFLAGS="-fno-stack-protector" |
| 1071 | |
| 1072 | AC_TRY_COMPILE(, [ |
| 1073 | int main () { return 0 ; } |
| 1074 | ], |
| 1075 | [ |
| 1076 | no_stack_protector=yes |
| 1077 | FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector" |
| 1078 | AC_MSG_RESULT([yes]) |
| 1079 | ], [ |
| 1080 | no_stack_protector=no |
| 1081 | FLAG_FNO_STACK_PROTECTOR="" |
| 1082 | AC_MSG_RESULT([no]) |
| 1083 | ]) |
| 1084 | CFLAGS=$safe_CFLAGS |
| 1085 | |
| 1086 | AC_SUBST(FLAG_FNO_STACK_PROTECTOR) |
| 1087 | |
| 1088 | if test x$no_stack_protector = xyes; then |
| 1089 | CFLAGS="$CFLAGS -fno-stack-protector" |
| 1090 | fi |
| 1091 | |
| 1092 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1093 | # does this compiler support --param inline-unit-growth=... ? |
| 1094 | |
| 1095 | AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth]) |
| 1096 | |
| 1097 | safe_CFLAGS=$CFLAGS |
| 1098 | CFLAGS="--param inline-unit-growth=900" |
| 1099 | |
| 1100 | AC_TRY_COMPILE( |
| 1101 | [ ], |
| 1102 | [ |
| 1103 | return 0; |
| 1104 | ], |
| 1105 | [ |
| 1106 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], |
| 1107 | ["--param inline-unit-growth=900"]) |
| 1108 | AC_MSG_RESULT([yes]) |
| 1109 | ], [ |
| 1110 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""]) |
| 1111 | AC_MSG_RESULT([no]) |
| 1112 | ]) |
| 1113 | CFLAGS=$safe_CFLAGS |
| 1114 | |
| 1115 | |
tom | d55121e | 2005-12-19 12:40:13 +0000 | [diff] [blame] | 1116 | # does this compiler support __builtin_expect? |
| 1117 | AC_MSG_CHECKING([if gcc supports __builtin_expect]) |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1118 | |
tom | d55121e | 2005-12-19 12:40:13 +0000 | [diff] [blame] | 1119 | AC_TRY_LINK(, [ |
| 1120 | return __builtin_expect(1, 1) ? 1 : 0 |
| 1121 | ], |
| 1122 | [ |
| 1123 | ac_have_builtin_expect=yes |
| 1124 | AC_MSG_RESULT([yes]) |
| 1125 | ], [ |
| 1126 | ac_have_builtin_expect=no |
| 1127 | AC_MSG_RESULT([no]) |
| 1128 | ]) |
| 1129 | if test x$ac_have_builtin_expect = xyes ; then |
| 1130 | AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if gcc supports __builtin_expect.]) |
| 1131 | fi |
| 1132 | |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1133 | |
bart | cd529dc | 2008-06-26 08:43:12 +0000 | [diff] [blame] | 1134 | # does this compiler have built-in functions for atomic memory access ? |
| 1135 | AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) |
| 1136 | |
| 1137 | AC_TRY_LINK(, |
| 1138 | [ |
| 1139 | int variable = 1; |
| 1140 | return __sync_bool_compare_and_swap(&variable, 1, 2) ? 1 : 0 |
| 1141 | ], |
| 1142 | [ |
| 1143 | AC_MSG_RESULT([yes]) |
| 1144 | AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) |
| 1145 | ], |
| 1146 | [ |
| 1147 | AC_MSG_RESULT([no]) |
| 1148 | ]) |
| 1149 | |
| 1150 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1151 | # does the ppc assembler support "mtocrf" et al? |
| 1152 | AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) |
| 1153 | |
| 1154 | AC_TRY_COMPILE(, [ |
sewardj | dd4cbe1 | 2006-03-12 17:27:44 +0000 | [diff] [blame] | 1155 | __asm__ __volatile__("mtocrf 4,0"); |
| 1156 | __asm__ __volatile__("mfocrf 0,4"); |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1157 | ], |
| 1158 | [ |
| 1159 | ac_have_as_ppc_mftocrf=yes |
| 1160 | AC_MSG_RESULT([yes]) |
| 1161 | ], [ |
| 1162 | ac_have_as_ppc_mftocrf=no |
| 1163 | AC_MSG_RESULT([no]) |
| 1164 | ]) |
| 1165 | if test x$ac_have_as_ppc_mftocrf = xyes ; then |
| 1166 | AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.]) |
| 1167 | fi |
| 1168 | |
| 1169 | |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1170 | # does the x86/amd64 assembler understand SSE3 instructions? |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1171 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1172 | # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1173 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3]) |
| 1174 | |
| 1175 | AC_TRY_COMPILE(, [ |
| 1176 | do { long long int x; |
| 1177 | __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); } |
| 1178 | while (0) |
| 1179 | ], |
| 1180 | [ |
| 1181 | ac_have_as_sse3=yes |
| 1182 | AC_MSG_RESULT([yes]) |
| 1183 | ], [ |
| 1184 | ac_have_as_sse3=no |
| 1185 | AC_MSG_RESULT([no]) |
| 1186 | ]) |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1187 | |
| 1188 | AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes) |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1189 | |
| 1190 | |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1191 | # Ditto for SSSE3 instructions (note extra S) |
| 1192 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1193 | # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's |
| 1194 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3]) |
| 1195 | |
| 1196 | AC_TRY_COMPILE(, [ |
| 1197 | do { long long int x; |
| 1198 | __asm__ __volatile__( |
| 1199 | "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); } |
| 1200 | while (0) |
| 1201 | ], |
| 1202 | [ |
| 1203 | ac_have_as_ssse3=yes |
| 1204 | AC_MSG_RESULT([yes]) |
| 1205 | ], [ |
| 1206 | ac_have_as_ssse3=no |
| 1207 | AC_MSG_RESULT([no]) |
| 1208 | ]) |
| 1209 | |
| 1210 | AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) |
| 1211 | |
| 1212 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1213 | # Check for TLS support in the compiler and linker |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 1214 | if test "x${cross_compiling}" = "xno"; then |
| 1215 | # Native compilation: check whether running a program using TLS succeeds. |
| 1216 | # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs |
| 1217 | # succeeds but running programs using TLS fails. |
| 1218 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 1219 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 1220 | [vg_cv_tls=$enableval], |
| 1221 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 1222 | [[return foo;]])], |
| 1223 | [vg_cv_tls=yes], |
| 1224 | [vg_cv_tls=no])])]) |
| 1225 | else |
| 1226 | # Cross-compiling: check whether linking a program using TLS succeeds. |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1227 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 1228 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 1229 | [vg_cv_tls=$enableval], |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 1230 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1231 | [[return foo;]])], |
| 1232 | [vg_cv_tls=yes], |
| 1233 | [vg_cv_tls=no])])]) |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 1234 | fi |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1235 | |
| 1236 | if test "$vg_cv_tls" = yes; then |
| 1237 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 1238 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1239 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1240 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1241 | # Checks for header files. |
| 1242 | AC_HEADER_STDC |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1243 | AC_CHECK_HEADERS([ \ |
| 1244 | endian.h \ |
| 1245 | mqueue.h \ |
| 1246 | sys/endian.h \ |
| 1247 | sys/epoll.h \ |
| 1248 | sys/eventfd.h \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 1249 | sys/klog.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1250 | sys/poll.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1251 | sys/signal.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1252 | sys/signalfd.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1253 | sys/syscall.h \ |
| 1254 | sys/time.h \ |
| 1255 | sys/types.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1256 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1257 | |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1258 | AC_LANG(C++) |
| 1259 | AC_CHECK_HEADERS([ \ |
| 1260 | QtCore/QMutex \ |
| 1261 | QtCore/QSemaphore \ |
| 1262 | QtCore/QThread \ |
| 1263 | ]) |
| 1264 | AC_LANG(C) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1265 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1266 | # Checks for typedefs, structures, and compiler characteristics. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1267 | AC_TYPE_UID_T |
| 1268 | AC_TYPE_OFF_T |
| 1269 | AC_TYPE_SIZE_T |
| 1270 | AC_HEADER_TIME |
| 1271 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1272 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1273 | # Checks for library functions. |
| 1274 | AC_FUNC_MEMCMP |
| 1275 | AC_FUNC_MMAP |
| 1276 | AC_TYPE_SIGNAL |
| 1277 | |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1278 | AC_CHECK_LIB([rt], [clock_gettime]) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1279 | AC_CHECK_LIB([QtCore], [_ZN6QMutex4lockEv]) # QMutex::lock() |
| 1280 | |
| 1281 | # AC_CHECK_LIB adds any library found to the variable LIBS, and links these |
| 1282 | # libraries with any shared object and/or executable. This is NOT what we |
| 1283 | # want for e.g. vgpreload_core-x86-linux.so |
| 1284 | LIBS="" |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1285 | |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1286 | AC_CHECK_FUNCS([ \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1287 | clock_gettime\ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1288 | epoll_create \ |
| 1289 | epoll_pwait \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1290 | floor \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 1291 | klogctl \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1292 | mallinfo \ |
| 1293 | memchr \ |
| 1294 | memset \ |
| 1295 | mkdir \ |
| 1296 | ppoll \ |
| 1297 | semtimedop \ |
| 1298 | signalfd \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1299 | syscall \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1300 | strchr \ |
| 1301 | strdup \ |
| 1302 | strpbrk \ |
| 1303 | strrchr \ |
| 1304 | strstr \ |
| 1305 | timerfd \ |
| 1306 | utimensat \ |
| 1307 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1308 | |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1309 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1310 | # Do we have a useable MPI setup on the primary and/or secondary targets? |
| 1311 | # On Linux, by default, assumes mpicc and -m32/-m64 |
| 1312 | # On AIX, by default, assumes mpxlc and -q32/-q64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1313 | # Note: this is a kludge in that it assumes the specified mpicc |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1314 | # understands -m32/-m64/-q32/-q64 regardless of what is specified using |
| 1315 | # --with-mpicc=. |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1316 | MPI_CC="mpicc" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1317 | if test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ |
| 1318 | -o x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then |
| 1319 | MPI_CC="mpxlc" |
| 1320 | fi |
| 1321 | |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1322 | mflag_primary= |
| 1323 | if test x$VG_PLATFORM_PRI = xX86_LINUX \ |
| 1324 | -o x$VG_PLATFORM_PRI = xPPC32_LINUX ; then |
| 1325 | mflag_primary=$FLAG_M32 |
| 1326 | elif test x$VG_PLATFORM_PRI = xAMD64_LINUX \ |
| 1327 | -o x$VG_PLATFORM_PRI = xPPC64_LINUX ; then |
| 1328 | mflag_primary=$FLAG_M64 |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1329 | elif test x$VG_PLATFORM_PRI = xPPC32_AIX5 ; then |
| 1330 | mflag_primary=-q32 |
| 1331 | elif test x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then |
| 1332 | mflag_primary=-q64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1333 | fi |
| 1334 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1335 | mflag_secondary= |
| 1336 | if test x$VG_PLATFORM_SEC = xX86_LINUX \ |
| 1337 | -o x$VG_PLATFORM_SEC = xPPC32_LINUX ; then |
| 1338 | mflag_secondary=$FLAG_M32 |
| 1339 | elif test x$VG_PLATFORM_SEC = xPPC32_AIX5 ; then |
| 1340 | mflag_secondary=-q32 |
| 1341 | fi |
| 1342 | |
| 1343 | |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1344 | AC_ARG_WITH(mpicc, |
sewardj | b70a613 | 2006-05-27 21:14:09 +0000 | [diff] [blame] | 1345 | [ --with-mpicc= Specify name of MPI2-ised C compiler], |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1346 | MPI_CC=$withval |
| 1347 | ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1348 | AC_SUBST(MPI_CC) |
| 1349 | |
| 1350 | ## See if MPI_CC works for the primary target |
| 1351 | ## |
| 1352 | AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1353 | saved_CC=$CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1354 | saved_CFLAGS=$CFLAGS |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1355 | CC=$MPI_CC |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1356 | CFLAGS=$mflag_primary |
sewardj | d3fcc64 | 2006-03-09 02:49:56 +0000 | [diff] [blame] | 1357 | AC_TRY_LINK([ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 1358 | #include <mpi.h> |
| 1359 | #include <stdio.h> |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1360 | ],[ |
| 1361 | int r = MPI_Init(NULL,NULL); |
| 1362 | r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL ); |
| 1363 | return r; |
| 1364 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1365 | ac_have_mpi2_pri=yes |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 1366 | AC_MSG_RESULT([yes, $MPI_CC]) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1367 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1368 | ac_have_mpi2_pri=no |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1369 | AC_MSG_RESULT([no]) |
| 1370 | ]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1371 | CC=$saved_CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1372 | CFLAGS=$saved_CFLAGS |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1373 | AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1374 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1375 | ## See if MPI_CC works for the secondary target. Complication: what if |
| 1376 | ## there is no secondary target? We need this to then fail. |
| 1377 | ## Kludge this by making MPI_CC something which will surely fail in |
| 1378 | ## such a case. |
| 1379 | ## |
| 1380 | AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) |
| 1381 | saved_CC=$CC |
| 1382 | saved_CFLAGS=$CFLAGS |
| 1383 | if test x$VG_PLATFORM_SEC = x ; then |
| 1384 | CC="$MPI_CC this will surely fail" |
| 1385 | else |
| 1386 | CC=$MPI_CC |
| 1387 | fi |
| 1388 | CFLAGS=$mflag_secondary |
| 1389 | AC_TRY_LINK([ |
| 1390 | #include <mpi.h> |
| 1391 | #include <stdio.h> |
| 1392 | ],[ |
| 1393 | int r = MPI_Init(NULL,NULL); |
| 1394 | r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL ); |
| 1395 | return r; |
| 1396 | ], [ |
| 1397 | ac_have_mpi2_sec=yes |
| 1398 | AC_MSG_RESULT([yes, $MPI_CC]) |
| 1399 | ], [ |
| 1400 | ac_have_mpi2_sec=no |
| 1401 | AC_MSG_RESULT([no]) |
| 1402 | ]) |
| 1403 | CC=$saved_CC |
| 1404 | CFLAGS=$saved_CFLAGS |
| 1405 | AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1406 | |
| 1407 | |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1408 | # does this compiler have the include file <Qt/qmutex.h> and does it have |
| 1409 | # libQtCore.so ? |
| 1410 | |
| 1411 | AC_MSG_CHECKING([for Qt4 core library]) |
| 1412 | |
bart | 6995375 | 2008-07-08 08:53:15 +0000 | [diff] [blame] | 1413 | AC_TRY_COMPILE([ ], |
| 1414 | [ |
| 1415 | #if ! defined(HAVE_LIBQTCORE) || ! defined(HAVE_QTCORE_QMUTEX) |
| 1416 | #error Qt4 not supported. |
| 1417 | #endif |
| 1418 | return 0; |
| 1419 | ], |
| 1420 | [ |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1421 | ac_have_qtcore=yes |
| 1422 | AC_MSG_RESULT([yes]) |
bart | 6995375 | 2008-07-08 08:53:15 +0000 | [diff] [blame] | 1423 | ], |
| 1424 | [ |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1425 | ac_have_qtcore=no |
| 1426 | AC_MSG_RESULT([no]) |
bart | 6995375 | 2008-07-08 08:53:15 +0000 | [diff] [blame] | 1427 | ]) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1428 | |
| 1429 | AM_CONDITIONAL([HAVE_QTCORE], [test x$ac_have_qtcore = xyes]) |
| 1430 | |
| 1431 | |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1432 | # -------------------- ok. We're done. -------------------- |
| 1433 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 1434 | AC_OUTPUT( |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1435 | Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1436 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 1437 | valgrind.pc |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 1438 | glibc-2.X.supp |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 1439 | docs/Makefile |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 1440 | docs/lib/Makefile |
| 1441 | docs/images/Makefile |
njn | f7c00b1 | 2005-07-19 21:46:19 +0000 | [diff] [blame] | 1442 | docs/internals/Makefile |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 1443 | docs/xml/Makefile |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 1444 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 1445 | tests/vg_regtest |
njn | ec0c27a | 2005-12-10 23:11:28 +0000 | [diff] [blame] | 1446 | perf/Makefile |
| 1447 | perf/vg_perf |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 1448 | include/Makefile |
sewardj | 0f8881b | 2006-10-18 01:16:57 +0000 | [diff] [blame] | 1449 | include/vki/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 1450 | auxprogs/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 1451 | coregrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1452 | memcheck/Makefile |
| 1453 | memcheck/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1454 | memcheck/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 1455 | memcheck/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 1456 | memcheck/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1457 | memcheck/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1458 | memcheck/docs/Makefile |
| 1459 | cachegrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1460 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1461 | cachegrind/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 1462 | cachegrind/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 1463 | cachegrind/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1464 | cachegrind/tests/x86/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1465 | cachegrind/docs/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 1466 | cachegrind/cg_annotate |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 1467 | callgrind/Makefile |
| 1468 | callgrind/callgrind_annotate |
| 1469 | callgrind/callgrind_control |
| 1470 | callgrind/tests/Makefile |
| 1471 | callgrind/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1472 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 1473 | helgrind/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 1474 | helgrind/docs/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 1475 | massif/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 1476 | massif/tests/Makefile |
njn | 734b805 | 2007-11-01 04:40:37 +0000 | [diff] [blame] | 1477 | massif/perf/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 1478 | massif/docs/Makefile |
njn | d5a8d24 | 2007-11-02 20:44:57 +0000 | [diff] [blame] | 1479 | massif/ms_print |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1480 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 1481 | lackey/tests/Makefile |
njn | 83157fc | 2002-10-03 10:07:34 +0000 | [diff] [blame] | 1482 | lackey/docs/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1483 | none/Makefile |
| 1484 | none/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1485 | none/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 1486 | none/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 1487 | none/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1488 | none/tests/x86/Makefile |
njn | 9bc8c00 | 2002-10-02 13:49:13 +0000 | [diff] [blame] | 1489 | none/docs/Makefile |
sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 1490 | exp-omega/Makefile |
| 1491 | exp-omega/tests/Makefile |
| 1492 | exp-omega/docs/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 1493 | drd/Makefile |
| 1494 | drd/docs/Makefile |
| 1495 | drd/scripts/download-and-build-splash2 |
| 1496 | drd/tests/Makefile |
bart | 0b2b462 | 2008-06-17 19:19:16 +0000 | [diff] [blame] | 1497 | ) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 1498 | |
| 1499 | cat<<EOF |
| 1500 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1501 | Primary build target: ${VG_PLATFORM_PRI} |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1502 | Secondary build target: ${VG_PLATFORM_SEC} |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1503 | Default supp files: ${DEFAULT_SUPP} |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 1504 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 1505 | EOF |
| 1506 | |
| 1507 | cat<<EOF > default.supp |
| 1508 | # This is a generated file, composed of the following suppression rules: |
| 1509 | # |
| 1510 | # ${DEFAULT_SUPP} |
| 1511 | # |
| 1512 | |
| 1513 | EOF |
| 1514 | |
| 1515 | for file in ${DEFAULT_SUPP} ; do |
| 1516 | cat ${srcdir}/$file >> default.supp |
| 1517 | done |