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