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 | 9ccee39 | 2009-08-20 20:20:05 +0000 | [diff] [blame] | 11 | AC_INIT(Valgrind, 3.6.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 | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 18 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 19 | # Checks for various programs. |
| 20 | #---------------------------------------------------------------------------- |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 21 | CFLAGS="-Wno-long-long" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 22 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 23 | AC_PROG_LN_S |
| 24 | AC_PROG_CC |
bart | 0affa49 | 2008-03-18 17:53:09 +0000 | [diff] [blame] | 25 | AM_PROG_CC_C_O |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 26 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 27 | AC_PROG_CXX |
njn | 629a5ec | 2009-07-14 01:29:39 +0000 | [diff] [blame] | 28 | # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with |
| 29 | # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code |
| 30 | # base (eg. most likely as Darwin-specific tests) we'll need one of the |
| 31 | # following: |
njn | 0cd2689 | 2009-07-12 23:07:13 +0000 | [diff] [blame] | 32 | # - put AC_PROG_OBJC in a Darwin-specific part of this file |
| 33 | # - Use AC_PROG_OBJC here and up the minimum autoconf version |
| 34 | # - Use the following, which is apparently equivalent: |
| 35 | # m4_ifdef([AC_PROG_OBJC], |
| 36 | # [AC_PROG_OBJC], |
| 37 | # [AC_CHECK_TOOL([OBJC], [gcc]) |
| 38 | # AC_SUBST([OBJC]) |
| 39 | # AC_SUBST([OBJCFLAGS]) |
| 40 | # ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 41 | AC_PROG_RANLIB |
| 42 | |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 43 | # If no AR variable was specified, look up the name of the archiver. Otherwise |
| 44 | # do not touch the AR variable. |
| 45 | if test "x$AR" = "x"; then |
bart | 325cd97 | 2009-04-04 14:36:51 +0000 | [diff] [blame] | 46 | AC_PATH_PROGS([AR], [`echo $LD | sed 's/ld$/ar/'` "ar"], [ar]) |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 47 | fi |
| 48 | AC_ARG_VAR([AR],[Archiver command]) |
| 49 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 50 | # Check for the compiler support |
| 51 | if test "${GCC}" != "yes" ; then |
| 52 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 53 | fi |
| 54 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 55 | # figure out where perl lives |
| 56 | AC_PATH_PROG(PERL, perl) |
| 57 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 58 | # figure out where gdb lives |
sewardj | f8722ca | 2008-11-17 00:20:45 +0000 | [diff] [blame] | 59 | AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time") |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 60 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB]) |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 61 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 62 | # some older automake's don't have it so try something on our own |
| 63 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 64 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 65 | AS="${CC}" |
| 66 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 67 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 68 | ASFLAGS="" |
| 69 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 70 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 71 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 72 | |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 73 | # Check if 'diff' supports -u (universal diffs) and use it if possible. |
| 74 | |
| 75 | AC_MSG_CHECKING([for diff -u]) |
| 76 | AC_SUBST(DIFF) |
| 77 | |
| 78 | # Comparing two identical files results in 0, unless -u isn't supported (as |
| 79 | # it's not on AIX). |
njn | 31f665e | 2009-02-26 21:25:50 +0000 | [diff] [blame] | 80 | tmpfile="tmp-xxx-yyy-zzz" |
| 81 | touch $tmpfile; |
| 82 | if diff -u $tmpfile $tmpfile ; then |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 83 | AC_MSG_RESULT([yes]) |
| 84 | DIFF="diff -u" |
| 85 | else |
| 86 | AC_MSG_RESULT([no]) |
| 87 | DIFF="diff" |
| 88 | fi |
njn | 31f665e | 2009-02-26 21:25:50 +0000 | [diff] [blame] | 89 | rm $tmpfile |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 90 | |
| 91 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 92 | # We don't want gcc < 3.0 |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 93 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 94 | |
sewardj | f33b433 | 2008-07-18 18:20:42 +0000 | [diff] [blame] | 95 | [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] | 96 | |
| 97 | case "${gcc_version}" in |
bart | 76719bf | 2008-04-19 07:47:56 +0000 | [diff] [blame] | 98 | 2.*) |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 99 | AC_MSG_RESULT([no (${gcc_version})]) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 100 | AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc]) |
| 101 | ;; |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 102 | *) |
| 103 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 104 | ;; |
| 105 | esac |
| 106 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 107 | #---------------------------------------------------------------------------- |
| 108 | # Arch/OS/platform tests. |
| 109 | #---------------------------------------------------------------------------- |
| 110 | # We create a number of arch/OS/platform-related variables. We prefix them |
| 111 | # all with "VGCONF_" which indicates that they are defined at |
| 112 | # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_* |
| 113 | # variables used when compiling C files. |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 114 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 115 | AC_CANONICAL_HOST |
| 116 | |
| 117 | AC_MSG_CHECKING([for a supported CPU]) |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 118 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 119 | # ARCH_MAX reflects the most that this CPU can do: for example if it |
| 120 | # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32. |
| 121 | # Ditto for amd64. It is used for more configuration below, but is not used |
| 122 | # outside this file. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 123 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 124 | i?86) |
| 125 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 126 | ARCH_MAX="x86" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 127 | ;; |
| 128 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 129 | x86_64) |
| 130 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 131 | ARCH_MAX="amd64" |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 132 | ;; |
| 133 | |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 134 | powerpc64) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 135 | # This value can only happen on Linux, not on AIX |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 136 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 137 | ARCH_MAX="ppc64" |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 138 | ;; |
| 139 | |
| 140 | powerpc) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 141 | # Complexity. 'powerpc' on AIX implies a 64-bit capable CPU. |
| 142 | # Whereas in Linux that means only a 32-bit capable CPU. |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 143 | AC_MSG_RESULT([ok (${host_cpu})]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 144 | case "${host_os}" in |
| 145 | aix5.*) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 146 | ARCH_MAX="ppc64" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 147 | ;; |
| 148 | *) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 149 | ARCH_MAX="ppc32" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 150 | ;; |
| 151 | esac |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 152 | ;; |
| 153 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 154 | *) |
| 155 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 156 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 157 | ;; |
| 158 | esac |
| 159 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 160 | #---------------------------------------------------------------------------- |
| 161 | |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 162 | # Sometimes it's convenient to subvert the bi-arch build system and |
| 163 | # just have a single build even though the underlying platform is |
| 164 | # capable of both. Hence handle --enable-only64bit and |
| 165 | # --enable-only32bit. Complain if both are issued :-) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 166 | # [Actually, if either of these options are used, I think both get built, |
| 167 | # but only one gets installed. So if you use an in-place build, both can be |
| 168 | # used. --njn] |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 169 | |
| 170 | # Check if a 64-bit only build has been requested |
| 171 | AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, |
| 172 | [AC_ARG_ENABLE(only64bit, |
| 173 | [ --enable-only64bit do a 64-bit only build], |
| 174 | [vg_cv_only64bit=$enableval], |
| 175 | [vg_cv_only64bit=no])]) |
| 176 | |
| 177 | # Check if a 32-bit only build has been requested |
| 178 | AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit, |
| 179 | [AC_ARG_ENABLE(only32bit, |
| 180 | [ --enable-only32bit do a 32-bit only build], |
| 181 | [vg_cv_only32bit=$enableval], |
| 182 | [vg_cv_only32bit=no])]) |
| 183 | |
| 184 | # Stay sane |
| 185 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 186 | AC_MSG_ERROR( |
| 187 | [Nonsensical: both --enable-only64bit and --enable-only32bit.]) |
| 188 | fi |
| 189 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 190 | #---------------------------------------------------------------------------- |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 191 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 192 | # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to |
| 193 | # compilation of many C files via -VGO_$(VGCONF_OS) and |
| 194 | # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 195 | AC_MSG_CHECKING([for a supported OS]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 196 | AC_SUBST(VGCONF_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 197 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 198 | DEFAULT_SUPP="" |
| 199 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 200 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 201 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 202 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 203 | VGCONF_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 204 | |
| 205 | # Ok, this is linux. Check the kernel version |
| 206 | AC_MSG_CHECKING([for the kernel version]) |
| 207 | |
| 208 | kernel=`uname -r` |
| 209 | |
| 210 | case "${kernel}" in |
| 211 | 2.6.*) |
| 212 | AC_MSG_RESULT([2.6 family (${kernel})]) |
| 213 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x]) |
| 214 | ;; |
| 215 | |
| 216 | 2.4.*) |
| 217 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 218 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 219 | ;; |
| 220 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 221 | *) |
| 222 | AC_MSG_RESULT([unsupported (${kernel})]) |
nethercote | 4fa681f | 2004-11-08 17:51:39 +0000 | [diff] [blame] | 223 | AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 224 | ;; |
| 225 | esac |
| 226 | |
| 227 | ;; |
| 228 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 229 | aix5.1.*) |
| 230 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 231 | VGCONF_OS="aix5" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 232 | ;; |
| 233 | aix5.2.*) |
| 234 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 235 | VGCONF_OS="aix5" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 236 | ;; |
| 237 | aix5.3.*) |
| 238 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 239 | VGCONF_OS="aix5" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 240 | ;; |
| 241 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 242 | *freebsd*) |
| 243 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 244 | VGCONF_OS="freebsd" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 245 | ;; |
| 246 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 247 | *darwin*) |
| 248 | AC_MSG_RESULT([ok (${host_os})]) |
| 249 | VGCONF_OS="darwin" |
| 250 | |
| 251 | AC_MSG_CHECKING([for the kernel version]) |
| 252 | kernel=`uname -r` |
| 253 | |
| 254 | # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin |
| 255 | # has only one relevant version, the OS version. The `uname` check |
| 256 | # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS |
| 257 | # X 10.5.6, and "Darwin 10.x" would presumably be Mac OS X 10.6.x |
| 258 | # Snow Leopard and darwin10.supp), and we don't know of an macros |
| 259 | # similar to __GLIBC__ to get that info. |
| 260 | # |
| 261 | # XXX: `uname -r` won't do the right thing for cross-compiles, but |
| 262 | # that's not a problem yet. |
| 263 | case "${kernel}" in |
| 264 | 9.*) |
| 265 | AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard]) |
| 266 | DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}" |
bart | 6ccda14 | 2009-07-23 07:37:32 +0000 | [diff] [blame] | 267 | DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 268 | ;; |
| 269 | *) |
| 270 | AC_MSG_RESULT([unsupported (${kernel})]) |
| 271 | AC_MSG_ERROR([Valgrind works on Darwin 9.x (Mac OS X 10.5)]) |
| 272 | ;; |
| 273 | esac |
| 274 | ;; |
| 275 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 276 | *) |
| 277 | AC_MSG_RESULT([no (${host_os})]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 278 | 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] | 279 | ;; |
| 280 | esac |
| 281 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 282 | #---------------------------------------------------------------------------- |
| 283 | |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 284 | # If we are building on a 64 bit platform test to see if the system |
| 285 | # supports building 32 bit programs and disable 32 bit support if it |
| 286 | # does not support building 32 bit programs |
| 287 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 288 | case "$ARCH_MAX-$VGCONF_OS" in |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 289 | amd64-linux|ppc64-linux) |
| 290 | AC_MSG_CHECKING([for 32 bit build support]) |
| 291 | safe_CFLAGS=$CFLAGS |
| 292 | CFLAGS="-m32" |
| 293 | AC_TRY_LINK(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 294 | return 0; |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 295 | ], |
| 296 | [ |
| 297 | AC_MSG_RESULT([yes]) |
| 298 | ], [ |
| 299 | vg_cv_only64bit="yes" |
| 300 | AC_MSG_RESULT([no]) |
| 301 | ]) |
| 302 | CFLAGS=$safe_CFLAGS;; |
| 303 | esac |
| 304 | |
| 305 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 306 | AC_MSG_ERROR( |
| 307 | [--enable-only32bit was specified but system does not support 32 bit builds]) |
| 308 | fi |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 309 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 310 | #---------------------------------------------------------------------------- |
| 311 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 312 | # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By |
| 313 | # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64 |
| 314 | # machine, but --enable-only32bit has been requested, then ARCH_MAX (see |
| 315 | # above) will be "amd64" since that reflects the most that this cpu can do, |
| 316 | # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the |
| 317 | # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 318 | # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and |
| 319 | # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). |
| 320 | AC_SUBST(VGCONF_ARCH_PRI) |
| 321 | |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 322 | # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86". |
| 323 | # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC) |
| 324 | # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target. |
| 325 | # It is empty if there is no secondary target. |
| 326 | AC_SUBST(VGCONF_ARCH_SEC) |
| 327 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 328 | # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX". |
| 329 | # The entire system, including regression and performance tests, will be |
| 330 | # built for this target. The "_CAPS" indicates that the name is in capital |
| 331 | # letters, and it also uses '_' rather than '-' as a separator, because it's |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 332 | # used to create various Makefile variables, which are all in caps by |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 333 | # convention and cannot contain '-' characters. This is in contrast to |
| 334 | # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 335 | AC_SUBST(VGCONF_PLATFORM_PRI_CAPS) |
| 336 | |
| 337 | # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one. |
| 338 | # Valgrind and tools will also be built for this target, but not the |
| 339 | # regression or performance tests. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 340 | # |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 341 | # By default, the primary arch is the same as the "max" arch, as commented |
| 342 | # above (at the definition of ARCH_MAX). We may choose to downgrade it in |
| 343 | # the big case statement just below here, in the case where we're building |
| 344 | # on a 64 bit machine but have been requested only to do a 32 bit build. |
| 345 | AC_SUBST(VGCONF_PLATFORM_SEC_CAPS) |
| 346 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 347 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 348 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 349 | case "$ARCH_MAX-$VGCONF_OS" in |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 350 | x86-linux) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 351 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 352 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 353 | VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" |
| 354 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 355 | valt_load_address_normal="0x38000000" |
| 356 | valt_load_address_inner="0x28000000" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 357 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 358 | ;; |
| 359 | amd64-linux) |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 360 | if test x$vg_cv_only64bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 361 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 362 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 363 | VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" |
| 364 | VGCONF_PLATFORM_SEC_CAPS="" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 365 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 366 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 367 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 368 | VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" |
| 369 | VGCONF_PLATFORM_SEC_CAPS="" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 370 | else |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 371 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 372 | VGCONF_ARCH_SEC="x86" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 373 | VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" |
| 374 | VGCONF_PLATFORM_SEC_CAPS="X86_LINUX" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 375 | fi |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 376 | valt_load_address_normal="0x38000000" |
| 377 | valt_load_address_inner="0x28000000" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 378 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 379 | ;; |
| 380 | ppc32-linux) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 381 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 382 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 383 | VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" |
| 384 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 385 | valt_load_address_normal="0x38000000" |
| 386 | valt_load_address_inner="0x28000000" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 387 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 388 | ;; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 389 | ppc64-aix5) |
| 390 | if test x$vg_cv_only64bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 391 | VGCONF_ARCH_PRI="ppc64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 392 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 393 | VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5" |
| 394 | VGCONF_PLATFORM_SEC_CAPS="" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 395 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 396 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 397 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 398 | VGCONF_PLATFORM_PRI_CAPS="PPC32_AIX5" |
| 399 | VGCONF_PLATFORM_SEC_CAPS="" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 400 | else |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 401 | VGCONF_ARCH_PRI="ppc64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 402 | VGCONF_ARCH_SEC="ppc32" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 403 | VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5" |
| 404 | VGCONF_PLATFORM_SEC_CAPS="PPC32_AIX5" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 405 | fi |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 406 | valt_load_address_normal="0x38000000" |
| 407 | valt_load_address_inner="0x28000000" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 408 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 409 | ;; |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 410 | ppc64-linux) |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 411 | if test x$vg_cv_only64bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 412 | VGCONF_ARCH_PRI="ppc64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 413 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 414 | VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" |
| 415 | VGCONF_PLATFORM_SEC_CAPS="" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 416 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 417 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 418 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 419 | VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" |
| 420 | VGCONF_PLATFORM_SEC_CAPS="" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 421 | else |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 422 | VGCONF_ARCH_PRI="ppc64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 423 | VGCONF_ARCH_SEC="ppc32" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 424 | VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" |
| 425 | VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 426 | fi |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 427 | valt_load_address_normal="0x38000000" |
| 428 | valt_load_address_inner="0x28000000" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 429 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 430 | ;; |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 431 | x86-darwin) |
| 432 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 433 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 434 | VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN" |
| 435 | VGCONF_PLATFORM_SEC_CAPS="" |
| 436 | valt_load_address_normal="0x0" |
| 437 | valt_load_address_inner="0x0" |
| 438 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 439 | ;; |
| 440 | amd64-darwin) |
| 441 | if test x$vg_cv_only64bit = xyes; then |
| 442 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 443 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 444 | VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN" |
| 445 | VGCONF_PLATFORM_SEC_CAPS="" |
| 446 | elif test x$vg_cv_only32bit = xyes; then |
| 447 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 448 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 449 | VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN" |
| 450 | VGCONF_PLATFORM_SEC_CAPS="" |
| 451 | VGCONF_ARCH_PRI_CAPS="x86" |
| 452 | else |
| 453 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 454 | VGCONF_ARCH_SEC="x86" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 455 | VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN" |
| 456 | VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN" |
| 457 | fi |
| 458 | valt_load_address_normal="0x0" |
| 459 | valt_load_address_inner="0x0" |
| 460 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 461 | ;; |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 462 | *) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 463 | VGCONF_ARCH_PRI="unknown" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 464 | VGCONF_ARCH_SEC="unknown" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 465 | VGCONF_PLATFORM_PRI_CAPS="UNKNOWN" |
| 466 | VGCONF_PLATFORM_SEC_CAPS="UNKNOWN" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 467 | AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 468 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 469 | ;; |
| 470 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 471 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 472 | #---------------------------------------------------------------------------- |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 473 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 474 | # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become |
| 475 | # defined. |
| 476 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86, |
| 477 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 478 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
| 479 | -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 480 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 481 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 482 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
| 483 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 484 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, |
| 485 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
| 486 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \ |
| 487 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ |
| 488 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5 ) |
| 489 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64, |
| 490 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ |
| 491 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 492 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 493 | # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these |
| 494 | # become defined. |
| 495 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX, |
| 496 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 497 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX) |
| 498 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX, |
| 499 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX) |
| 500 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX, |
| 501 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
| 502 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX) |
| 503 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX, |
| 504 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 505 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 506 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5, |
| 507 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ |
| 508 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5) |
| 509 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5, |
| 510 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5) |
| 511 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 512 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN, |
| 513 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 514 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN) |
| 515 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN, |
| 516 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) |
| 517 | |
| 518 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 519 | # Similarly, set up VGCONF_OF_IS_<os>. Exactly one of these becomes defined. |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 520 | # Relies on the assumption that the primary and secondary targets are |
| 521 | # for the same OS, so therefore only necessary to test the primary. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 522 | AM_CONDITIONAL(VGCONF_OS_IS_LINUX, |
| 523 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 524 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
| 525 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
| 526 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX) |
| 527 | AM_CONDITIONAL(VGCONF_OS_IS_AIX5, |
| 528 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ |
| 529 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 530 | AM_CONDITIONAL(VGCONF_OS_IS_DARWIN, |
| 531 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 532 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 533 | |
| 534 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 535 | # Sometimes, in the Makefile.am files, it's useful to know whether or not |
| 536 | # there is a secondary target. |
njn | ee0c66a | 2009-06-01 23:59:20 +0000 | [diff] [blame] | 537 | AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC, |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 538 | test x$VGCONF_PLATFORM_SEC_CAPS != x) |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 539 | |
tom | b637bad | 2005-11-08 12:28:35 +0000 | [diff] [blame] | 540 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 541 | #---------------------------------------------------------------------------- |
| 542 | # Inner Valgrind? |
| 543 | #---------------------------------------------------------------------------- |
| 544 | |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 545 | # Check if this should be built as an inner Valgrind, to be run within |
| 546 | # another Valgrind. Choose the load address accordingly. |
| 547 | AC_SUBST(VALT_LOAD_ADDRESS) |
| 548 | AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, |
| 549 | [AC_ARG_ENABLE(inner, |
| 550 | [ --enable-inner enables self-hosting], |
| 551 | [vg_cv_inner=$enableval], |
| 552 | [vg_cv_inner=no])]) |
| 553 | if test "$vg_cv_inner" = yes; then |
| 554 | AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind]) |
| 555 | VALT_LOAD_ADDRESS=$valt_load_address_inner |
| 556 | else |
| 557 | VALT_LOAD_ADDRESS=$valt_load_address_normal |
| 558 | fi |
| 559 | |
| 560 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 561 | #---------------------------------------------------------------------------- |
| 562 | # Libc and suppressions |
| 563 | #---------------------------------------------------------------------------- |
| 564 | # This variable will collect the suppression files to be used. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 565 | AC_SUBST(DEFAULT_SUPP) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 566 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 567 | GLIBC_VERSION="" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 568 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 569 | AC_EGREP_CPP([GLIBC_22], [ |
| 570 | #include <features.h> |
| 571 | #ifdef __GNU_LIBRARY__ |
| 572 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2) |
| 573 | GLIBC_22 |
| 574 | #endif |
| 575 | #endif |
| 576 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 577 | GLIBC_VERSION="2.2") |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 578 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 579 | AC_EGREP_CPP([GLIBC_23], [ |
| 580 | #include <features.h> |
| 581 | #ifdef __GNU_LIBRARY__ |
| 582 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3) |
| 583 | GLIBC_23 |
| 584 | #endif |
| 585 | #endif |
| 586 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 587 | GLIBC_VERSION="2.3") |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 588 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 589 | AC_EGREP_CPP([GLIBC_24], [ |
| 590 | #include <features.h> |
| 591 | #ifdef __GNU_LIBRARY__ |
| 592 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 4) |
| 593 | GLIBC_24 |
| 594 | #endif |
| 595 | #endif |
| 596 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 597 | GLIBC_VERSION="2.4") |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 598 | |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 599 | AC_EGREP_CPP([GLIBC_25], [ |
| 600 | #include <features.h> |
| 601 | #ifdef __GNU_LIBRARY__ |
| 602 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 5) |
| 603 | GLIBC_25 |
| 604 | #endif |
| 605 | #endif |
| 606 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 607 | GLIBC_VERSION="2.5") |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 608 | |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 609 | AC_EGREP_CPP([GLIBC_26], [ |
| 610 | #include <features.h> |
| 611 | #ifdef __GNU_LIBRARY__ |
| 612 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 6) |
| 613 | GLIBC_26 |
| 614 | #endif |
| 615 | #endif |
| 616 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 617 | GLIBC_VERSION="2.6") |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 618 | |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 619 | AC_EGREP_CPP([GLIBC_27], [ |
| 620 | #include <features.h> |
| 621 | #ifdef __GNU_LIBRARY__ |
| 622 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 7) |
| 623 | GLIBC_27 |
| 624 | #endif |
| 625 | #endif |
| 626 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 627 | GLIBC_VERSION="2.7") |
| 628 | |
| 629 | AC_EGREP_CPP([GLIBC_28], [ |
| 630 | #include <features.h> |
| 631 | #ifdef __GNU_LIBRARY__ |
| 632 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 8) |
| 633 | GLIBC_28 |
| 634 | #endif |
| 635 | #endif |
| 636 | ], |
| 637 | GLIBC_VERSION="2.8") |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 638 | |
dirk | d2e31eb | 2008-11-19 23:58:36 +0000 | [diff] [blame] | 639 | AC_EGREP_CPP([GLIBC_29], [ |
| 640 | #include <features.h> |
| 641 | #ifdef __GNU_LIBRARY__ |
| 642 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9) |
| 643 | GLIBC_29 |
| 644 | #endif |
| 645 | #endif |
| 646 | ], |
| 647 | GLIBC_VERSION="2.9") |
| 648 | |
sewardj | 5d425e8 | 2009-02-01 19:01:11 +0000 | [diff] [blame] | 649 | AC_EGREP_CPP([GLIBC_210], [ |
| 650 | #include <features.h> |
| 651 | #ifdef __GNU_LIBRARY__ |
| 652 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 10) |
| 653 | GLIBC_210 |
| 654 | #endif |
| 655 | #endif |
| 656 | ], |
| 657 | GLIBC_VERSION="2.10") |
| 658 | |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame^] | 659 | AC_EGREP_CPP([GLIBC_211], [ |
| 660 | #include <features.h> |
| 661 | #ifdef __GNU_LIBRARY__ |
| 662 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 11) |
| 663 | GLIBC_211 |
| 664 | #endif |
| 665 | #endif |
| 666 | ], |
| 667 | GLIBC_VERSION="2.11") |
| 668 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 669 | AC_EGREP_CPP([AIX5_LIBC], [ |
| 670 | #include <standards.h> |
| 671 | #if defined(_AIXVERSION_510) || defined(_AIXVERSION_520) || defined(_AIXVERSION_530) |
| 672 | AIX5_LIBC |
| 673 | #endif |
| 674 | ], |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 675 | GLIBC_VERSION="aix5") |
daywalker | e9212b3 | 2003-06-15 22:39:15 +0000 | [diff] [blame] | 676 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 677 | # not really a version check |
| 678 | AC_EGREP_CPP([DARWIN_LIBC], [ |
| 679 | #include <sys/cdefs.h> |
| 680 | #if defined(__DARWIN_VERS_1050) |
| 681 | DARWIN_LIBC |
| 682 | #endif |
| 683 | ], |
| 684 | GLIBC_VERSION="darwin") |
| 685 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 686 | AC_MSG_CHECKING([the GLIBC_VERSION version]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 687 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 688 | case "${GLIBC_VERSION}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 689 | 2.2) |
| 690 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 691 | 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] | 692 | DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" |
| 693 | DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 694 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 695 | ;; |
| 696 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 697 | 2.3) |
| 698 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 699 | 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] | 700 | DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 701 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 702 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 703 | ;; |
| 704 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 705 | 2.4) |
| 706 | AC_MSG_RESULT(2.4 family) |
| 707 | 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] | 708 | DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 709 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 710 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 711 | ;; |
| 712 | |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 713 | 2.5) |
| 714 | AC_MSG_RESULT(2.5 family) |
| 715 | 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] | 716 | DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 717 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 718 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 719 | ;; |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 720 | 2.6) |
| 721 | AC_MSG_RESULT(2.6 family) |
| 722 | 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] | 723 | DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 724 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 725 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 726 | ;; |
| 727 | 2.7) |
| 728 | AC_MSG_RESULT(2.7 family) |
| 729 | 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] | 730 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 731 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 732 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 733 | ;; |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 734 | 2.8) |
| 735 | AC_MSG_RESULT(2.8 family) |
dirk | eb939fc | 2008-04-27 20:38:47 +0000 | [diff] [blame] | 736 | 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] | 737 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 738 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 739 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 740 | ;; |
dirk | d2e31eb | 2008-11-19 23:58:36 +0000 | [diff] [blame] | 741 | 2.9) |
| 742 | AC_MSG_RESULT(2.9 family) |
| 743 | AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x]) |
| 744 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 745 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 746 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 747 | ;; |
sewardj | 5d425e8 | 2009-02-01 19:01:11 +0000 | [diff] [blame] | 748 | 2.10) |
| 749 | AC_MSG_RESULT(2.10 family) |
| 750 | AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x]) |
| 751 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 752 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 753 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 754 | ;; |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame^] | 755 | 2.11) |
| 756 | AC_MSG_RESULT(2.11 family) |
| 757 | AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x]) |
| 758 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 759 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 760 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 761 | ;; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 762 | aix5) |
sewardj | 2f3bcd2 | 2006-12-12 01:38:15 +0000 | [diff] [blame] | 763 | AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3) |
| 764 | 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] | 765 | DEFAULT_SUPP="aix5libc.supp ${DEFAULT_SUPP}" |
| 766 | ;; |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 767 | darwin) |
| 768 | AC_MSG_RESULT(Darwin) |
| 769 | AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) |
| 770 | # DEFAULT_SUPP set by kernel version check above. |
| 771 | ;; |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 772 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 773 | *) |
| 774 | AC_MSG_RESULT(unsupported version) |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame^] | 775 | AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.11]) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 776 | AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 777 | AC_MSG_ERROR([or Darwin libc]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 778 | ;; |
| 779 | esac |
| 780 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 781 | AC_SUBST(GLIBC_VERSION) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 782 | |
sewardj | 414f358 | 2008-07-18 20:46:00 +0000 | [diff] [blame] | 783 | |
| 784 | # Add default suppressions for the X client libraries. Make no |
| 785 | # attempt to detect whether such libraries are installed on the |
| 786 | # build machine (or even if any X facilities are present); just |
| 787 | # add the suppressions antidisirregardless. |
| 788 | DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" |
| 789 | DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 790 | |
sewardj | 5744c02 | 2008-10-19 18:58:13 +0000 | [diff] [blame] | 791 | # Add glibc and X11 suppressions for exp-ptrcheck |
| 792 | DEFAULT_SUPP="exp-ptrcheck.supp ${DEFAULT_SUPP}" |
| 793 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 794 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 795 | #---------------------------------------------------------------------------- |
| 796 | # Checking for various library functions and other definitions |
| 797 | #---------------------------------------------------------------------------- |
| 798 | |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 799 | # Check for CLOCK_MONOTONIC |
| 800 | |
| 801 | AC_MSG_CHECKING([for CLOCK_MONOTONIC]) |
| 802 | |
| 803 | AC_TRY_COMPILE( |
| 804 | [ |
| 805 | #include <time.h> |
| 806 | ], [ |
| 807 | struct timespec t; |
| 808 | clock_gettime(CLOCK_MONOTONIC, &t); |
| 809 | return 0; |
| 810 | ], |
| 811 | [ |
| 812 | AC_MSG_RESULT([yes]) |
| 813 | AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, |
| 814 | [Define to 1 if you have the `CLOCK_MONOTONIC' constant.]) |
| 815 | ], [ |
| 816 | AC_MSG_RESULT([no]) |
| 817 | ]) |
| 818 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 819 | |
| 820 | # Check for PTHREAD_MUTEX_ADAPTIVE_NP |
| 821 | |
| 822 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP]) |
| 823 | |
| 824 | AC_TRY_COMPILE( |
| 825 | [ |
| 826 | #define _GNU_SOURCE |
| 827 | #include <pthread.h> |
| 828 | ], [ |
| 829 | return (PTHREAD_MUTEX_ADAPTIVE_NP); |
| 830 | ], |
| 831 | [ |
| 832 | AC_MSG_RESULT([yes]) |
| 833 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, |
| 834 | [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.]) |
| 835 | ], [ |
| 836 | AC_MSG_RESULT([no]) |
| 837 | ]) |
| 838 | |
| 839 | |
| 840 | # Check for PTHREAD_MUTEX_ERRORCHECK_NP |
| 841 | |
| 842 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP]) |
| 843 | |
| 844 | AC_TRY_COMPILE( |
| 845 | [ |
| 846 | #define _GNU_SOURCE |
| 847 | #include <pthread.h> |
| 848 | ], [ |
| 849 | return (PTHREAD_MUTEX_ERRORCHECK_NP); |
| 850 | ], |
| 851 | [ |
| 852 | AC_MSG_RESULT([yes]) |
| 853 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1, |
| 854 | [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.]) |
| 855 | ], [ |
| 856 | AC_MSG_RESULT([no]) |
| 857 | ]) |
| 858 | |
| 859 | |
| 860 | # Check for PTHREAD_MUTEX_RECURSIVE_NP |
| 861 | |
| 862 | AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP]) |
| 863 | |
| 864 | AC_TRY_COMPILE( |
| 865 | [ |
| 866 | #define _GNU_SOURCE |
| 867 | #include <pthread.h> |
| 868 | ], [ |
| 869 | return (PTHREAD_MUTEX_RECURSIVE_NP); |
| 870 | ], |
| 871 | [ |
| 872 | AC_MSG_RESULT([yes]) |
| 873 | AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, |
| 874 | [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.]) |
| 875 | ], [ |
| 876 | AC_MSG_RESULT([no]) |
| 877 | ]) |
| 878 | |
| 879 | |
| 880 | # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
| 881 | |
| 882 | AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP]) |
| 883 | |
| 884 | AC_TRY_COMPILE( |
| 885 | [ |
| 886 | #define _GNU_SOURCE |
| 887 | #include <pthread.h> |
| 888 | ], [ |
| 889 | pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; |
| 890 | return 0; |
| 891 | ], |
| 892 | [ |
| 893 | AC_MSG_RESULT([yes]) |
| 894 | AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1, |
| 895 | [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.]) |
| 896 | ], [ |
| 897 | AC_MSG_RESULT([no]) |
| 898 | ]) |
| 899 | |
| 900 | |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 901 | # Check whether pthread_mutex_t has a member called __m_kind. |
| 902 | |
| 903 | AC_MSG_CHECKING([for pthread_mutex_t::__m_kind]) |
| 904 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 905 | AC_TRY_COMPILE( |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 906 | [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 907 | #include <pthread.h> |
| 908 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 909 | pthread_mutex_t m; |
| 910 | return m.__m_kind; |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 911 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 912 | AC_MSG_RESULT([yes]) |
| 913 | AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND], 1, |
| 914 | [Define to 1 if pthread_mutex_t has a member called __m_kind.]) |
| 915 | ], [ |
| 916 | AC_MSG_RESULT([no]) |
| 917 | ]) |
| 918 | |
| 919 | |
| 920 | # Check whether pthread_mutex_t has a member called __data.__kind. |
| 921 | |
| 922 | AC_MSG_CHECKING([for pthread_mutex_t::__data.__kind]) |
| 923 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 924 | AC_TRY_COMPILE( |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 925 | [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 926 | #include <pthread.h> |
| 927 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 928 | pthread_mutex_t m; |
| 929 | return m.__data.__kind; |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 930 | ], [ |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 931 | AC_MSG_RESULT([yes]) |
| 932 | AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND], 1, |
| 933 | [Define to 1 if pthread_mutex_t has a member __data.__kind.]) |
| 934 | ], [ |
| 935 | AC_MSG_RESULT([no]) |
| 936 | ]) |
| 937 | |
| 938 | |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 939 | # does this compiler support -maltivec and does it have the include file |
| 940 | # <altivec.h> ? |
| 941 | |
| 942 | AC_MSG_CHECKING([for Altivec]) |
| 943 | |
| 944 | safe_CFLAGS=$CFLAGS |
| 945 | CFLAGS="-maltivec" |
| 946 | |
| 947 | AC_TRY_COMPILE( |
| 948 | [ |
| 949 | #include <altivec.h> |
| 950 | ], [ |
| 951 | vector unsigned int v; |
| 952 | ], |
| 953 | [ |
| 954 | ac_have_altivec=yes |
| 955 | AC_MSG_RESULT([yes]) |
| 956 | ], [ |
| 957 | ac_have_altivec=no |
| 958 | AC_MSG_RESULT([no]) |
| 959 | ]) |
| 960 | CFLAGS=$safe_CFLAGS |
| 961 | |
| 962 | AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes]) |
| 963 | AM_CONDITIONAL([HAVE_ALTIVEC_H], [test x$ac_have_altivec = xyes]) |
| 964 | |
| 965 | |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 966 | # Check for pthread_create@GLIBC2.0 |
| 967 | AC_MSG_CHECKING([for pthread_create@GLIBC2.0()]) |
| 968 | |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 969 | safe_CFLAGS=$CFLAGS |
| 970 | CFLAGS="-lpthread" |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 971 | AC_TRY_LINK( |
| 972 | [ |
| 973 | extern int pthread_create_glibc_2_0(void*, const void*, |
| 974 | void *(*)(void*), void*); |
| 975 | __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0"); |
| 976 | ], [ |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 977 | #ifdef __powerpc__ |
| 978 | /* |
| 979 | * Apparently on PowerPC linking this program succeeds and generates an |
| 980 | * executable with the undefined symbol pthread_create@GLIBC_2.0. |
| 981 | */ |
| 982 | #error This test does not work properly on PowerPC. |
| 983 | #else |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 984 | pthread_create_glibc_2_0(0, 0, 0, 0); |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 985 | #endif |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 986 | return 0; |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 987 | ], |
| 988 | [ |
| 989 | ac_have_pthread_create_glibc_2_0=yes |
| 990 | AC_MSG_RESULT([yes]) |
| 991 | AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1, |
| 992 | [Define to 1 if you have the `pthread_create@glibc2.0' function.]) |
| 993 | ], [ |
| 994 | ac_have_pthread_create_glibc_2_0=no |
| 995 | AC_MSG_RESULT([no]) |
| 996 | ]) |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 997 | CFLAGS=$safe_CFLAGS |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 998 | |
| 999 | AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0, |
bart | 24f5390 | 2009-04-26 11:29:02 +0000 | [diff] [blame] | 1000 | test x$ac_have_pthread_create_glibc_2_0 = xyes) |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1001 | |
| 1002 | |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1003 | # Check for eventfd_t, eventfd() and eventfd_read() |
| 1004 | AC_MSG_CHECKING([for eventfd()]) |
| 1005 | |
| 1006 | AC_TRY_LINK( |
| 1007 | [ |
| 1008 | #include <sys/eventfd.h> |
| 1009 | ], [ |
| 1010 | eventfd_t ev; |
| 1011 | int fd; |
| 1012 | |
| 1013 | fd = eventfd(5, 0); |
| 1014 | eventfd_read(fd, &ev); |
| 1015 | return 0; |
| 1016 | ], |
| 1017 | [ |
| 1018 | AC_MSG_RESULT([yes]) |
| 1019 | AC_DEFINE([HAVE_EVENTFD], 1, |
| 1020 | [Define to 1 if you have the `eventfd' function.]) |
| 1021 | AC_DEFINE([HAVE_EVENTFD_READ], 1, |
| 1022 | [Define to 1 if you have the `eventfd_read' function.]) |
| 1023 | ], [ |
| 1024 | AC_MSG_RESULT([no]) |
| 1025 | ]) |
| 1026 | |
| 1027 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1028 | #---------------------------------------------------------------------------- |
| 1029 | # Checking for supported compiler flags. |
| 1030 | #---------------------------------------------------------------------------- |
| 1031 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1032 | # does this compiler support -m32 ? |
| 1033 | AC_MSG_CHECKING([if gcc accepts -m32]) |
| 1034 | |
| 1035 | safe_CFLAGS=$CFLAGS |
| 1036 | CFLAGS="-m32" |
| 1037 | |
| 1038 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1039 | return 0; |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1040 | ], |
| 1041 | [ |
| 1042 | FLAG_M32="-m32" |
| 1043 | AC_MSG_RESULT([yes]) |
| 1044 | ], [ |
| 1045 | FLAG_M32="" |
| 1046 | AC_MSG_RESULT([no]) |
| 1047 | ]) |
| 1048 | CFLAGS=$safe_CFLAGS |
| 1049 | |
| 1050 | AC_SUBST(FLAG_M32) |
| 1051 | |
| 1052 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1053 | # does this compiler support -maix32 ? |
| 1054 | AC_MSG_CHECKING([if gcc accepts -maix32]) |
| 1055 | |
| 1056 | safe_CFLAGS=$CFLAGS |
| 1057 | CFLAGS="-maix32" |
| 1058 | |
| 1059 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1060 | return 0; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1061 | ], |
| 1062 | [ |
| 1063 | FLAG_MAIX32="-maix32" |
| 1064 | AC_MSG_RESULT([yes]) |
| 1065 | ], [ |
| 1066 | FLAG_MAIX32="" |
| 1067 | AC_MSG_RESULT([no]) |
| 1068 | ]) |
| 1069 | CFLAGS=$safe_CFLAGS |
| 1070 | |
| 1071 | AC_SUBST(FLAG_MAIX32) |
| 1072 | |
| 1073 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1074 | # does this compiler support -m64 ? |
| 1075 | AC_MSG_CHECKING([if gcc accepts -m64]) |
| 1076 | |
| 1077 | safe_CFLAGS=$CFLAGS |
| 1078 | CFLAGS="-m64" |
| 1079 | |
| 1080 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1081 | return 0; |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1082 | ], |
| 1083 | [ |
| 1084 | FLAG_M64="-m64" |
| 1085 | AC_MSG_RESULT([yes]) |
| 1086 | ], [ |
| 1087 | FLAG_M64="" |
| 1088 | AC_MSG_RESULT([no]) |
| 1089 | ]) |
| 1090 | CFLAGS=$safe_CFLAGS |
| 1091 | |
| 1092 | AC_SUBST(FLAG_M64) |
| 1093 | |
| 1094 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1095 | # does this compiler support -maix64 ? |
| 1096 | AC_MSG_CHECKING([if gcc accepts -maix64]) |
| 1097 | |
| 1098 | safe_CFLAGS=$CFLAGS |
| 1099 | CFLAGS="-maix64" |
| 1100 | |
| 1101 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1102 | return 0; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1103 | ], |
| 1104 | [ |
| 1105 | FLAG_MAIX64="-maix64" |
| 1106 | AC_MSG_RESULT([yes]) |
| 1107 | ], [ |
| 1108 | FLAG_MAIX64="" |
| 1109 | AC_MSG_RESULT([no]) |
| 1110 | ]) |
| 1111 | CFLAGS=$safe_CFLAGS |
| 1112 | |
| 1113 | AC_SUBST(FLAG_MAIX64) |
| 1114 | |
| 1115 | |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1116 | # does this compiler support -mmmx ? |
| 1117 | AC_MSG_CHECKING([if gcc accepts -mmmx]) |
| 1118 | |
| 1119 | safe_CFLAGS=$CFLAGS |
| 1120 | CFLAGS="-mmmx" |
| 1121 | |
| 1122 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1123 | return 0; |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1124 | ], |
| 1125 | [ |
| 1126 | FLAG_MMMX="-mmmx" |
| 1127 | AC_MSG_RESULT([yes]) |
| 1128 | ], [ |
| 1129 | FLAG_MMMX="" |
| 1130 | AC_MSG_RESULT([no]) |
| 1131 | ]) |
| 1132 | CFLAGS=$safe_CFLAGS |
| 1133 | |
| 1134 | AC_SUBST(FLAG_MMMX) |
| 1135 | |
| 1136 | |
| 1137 | # does this compiler support -msse ? |
| 1138 | AC_MSG_CHECKING([if gcc accepts -msse]) |
| 1139 | |
| 1140 | safe_CFLAGS=$CFLAGS |
| 1141 | CFLAGS="-msse" |
| 1142 | |
| 1143 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1144 | return 0; |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1145 | ], |
| 1146 | [ |
| 1147 | FLAG_MSSE="-msse" |
| 1148 | AC_MSG_RESULT([yes]) |
| 1149 | ], [ |
| 1150 | FLAG_MSSE="" |
| 1151 | AC_MSG_RESULT([no]) |
| 1152 | ]) |
| 1153 | CFLAGS=$safe_CFLAGS |
| 1154 | |
| 1155 | AC_SUBST(FLAG_MSSE) |
| 1156 | |
| 1157 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1158 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 1159 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 1160 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1161 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1162 | CFLAGS="-mpreferred-stack-boundary=2" |
| 1163 | |
| 1164 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1165 | return 0; |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1166 | ], |
| 1167 | [ |
| 1168 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1169 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1170 | ], [ |
| 1171 | PREFERRED_STACK_BOUNDARY="" |
| 1172 | AC_MSG_RESULT([no]) |
| 1173 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1174 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1175 | |
| 1176 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 1177 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1178 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1179 | # does this compiler support -Wno-pointer-sign ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1180 | AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign]) |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1181 | |
| 1182 | safe_CFLAGS=$CFLAGS |
| 1183 | CFLAGS="-Wno-pointer-sign" |
| 1184 | |
| 1185 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1186 | return 0; |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1187 | ], |
| 1188 | [ |
| 1189 | no_pointer_sign=yes |
| 1190 | AC_MSG_RESULT([yes]) |
| 1191 | ], [ |
| 1192 | no_pointer_sign=no |
| 1193 | AC_MSG_RESULT([no]) |
| 1194 | ]) |
| 1195 | CFLAGS=$safe_CFLAGS |
| 1196 | |
| 1197 | if test x$no_pointer_sign = xyes; then |
| 1198 | CFLAGS="$CFLAGS -Wno-pointer-sign" |
| 1199 | fi |
| 1200 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1201 | |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1202 | # does this compiler support -Wdeclaration-after-statement ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1203 | AC_MSG_CHECKING([if gcc accepts -Wdeclaration-after-statement]) |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1204 | |
| 1205 | safe_CFLAGS=$CFLAGS |
| 1206 | CFLAGS="-Wdeclaration-after-statement" |
| 1207 | |
| 1208 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1209 | return 0; |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1210 | ], |
| 1211 | [ |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 1212 | declaration_after_statement=yes |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 1213 | FLAG_WDECL_AFTER_STMT="-Wdeclaration-after-statement" |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1214 | AC_MSG_RESULT([yes]) |
| 1215 | ], [ |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 1216 | declaration_after_statement=no |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 1217 | FLAG_WDECL_AFTER_STMT="" |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1218 | AC_MSG_RESULT([no]) |
| 1219 | ]) |
| 1220 | CFLAGS=$safe_CFLAGS |
| 1221 | |
sewardj | 72a547e | 2006-01-25 02:58:28 +0000 | [diff] [blame] | 1222 | AC_SUBST(FLAG_WDECL_AFTER_STMT) |
| 1223 | |
tom | e9814c3 | 2005-10-12 11:30:43 +0000 | [diff] [blame] | 1224 | if test x$declaration_after_statement = xyes; then |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1225 | CFLAGS="$CFLAGS -Wdeclaration-after-statement" |
| 1226 | fi |
| 1227 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1228 | |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1229 | # does this compiler support -Wno-empty-body ? |
| 1230 | |
| 1231 | AC_MSG_CHECKING([if gcc accepts -Wno-empty-body]) |
| 1232 | |
| 1233 | safe_CFLAGS=$CFLAGS |
| 1234 | CFLAGS="-Wno-empty-body" |
| 1235 | |
| 1236 | AC_TRY_COMPILE( |
| 1237 | [ ], |
| 1238 | [ |
| 1239 | return 0; |
| 1240 | ], |
| 1241 | [ |
| 1242 | AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body]) |
| 1243 | AC_MSG_RESULT([yes]) |
| 1244 | ], |
| 1245 | [ |
| 1246 | AC_SUBST([FLAG_W_NO_EMPTY_BODY], []) |
| 1247 | AC_MSG_RESULT([no]) |
| 1248 | ]) |
| 1249 | CFLAGS=$safe_CFLAGS |
| 1250 | |
| 1251 | |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1252 | # does this compiler support -Wno-format-zero-length ? |
| 1253 | |
| 1254 | AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length]) |
| 1255 | |
| 1256 | safe_CFLAGS=$CFLAGS |
| 1257 | CFLAGS="-Wno-format-zero-length" |
| 1258 | |
| 1259 | AC_TRY_COMPILE( |
| 1260 | [ ], |
| 1261 | [ |
| 1262 | return 0; |
| 1263 | ], |
| 1264 | [ |
| 1265 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length]) |
| 1266 | AC_MSG_RESULT([yes]) |
| 1267 | ], |
| 1268 | [ |
| 1269 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], []) |
| 1270 | AC_MSG_RESULT([no]) |
| 1271 | ]) |
| 1272 | CFLAGS=$safe_CFLAGS |
| 1273 | |
| 1274 | |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1275 | # does this compiler support -Wno-uninitialized ? |
| 1276 | |
| 1277 | AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized]) |
| 1278 | |
| 1279 | safe_CFLAGS=$CFLAGS |
| 1280 | CFLAGS="-Wno-uninitialized" |
| 1281 | |
| 1282 | AC_TRY_COMPILE( |
| 1283 | [ ], |
| 1284 | [ |
| 1285 | return 0; |
| 1286 | ], |
| 1287 | [ |
| 1288 | AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized]) |
| 1289 | AC_MSG_RESULT([yes]) |
| 1290 | ], |
| 1291 | [ |
| 1292 | AC_SUBST([FLAG_W_NO_UNINITIALIZED], []) |
| 1293 | AC_MSG_RESULT([no]) |
| 1294 | ]) |
| 1295 | CFLAGS=$safe_CFLAGS |
| 1296 | |
| 1297 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1298 | # does this compiler support -Wextra or the older -W ? |
| 1299 | |
| 1300 | AC_MSG_CHECKING([if gcc accepts -Wextra or -W]) |
| 1301 | |
| 1302 | safe_CFLAGS=$CFLAGS |
| 1303 | CFLAGS="-Wextra" |
| 1304 | |
| 1305 | AC_TRY_COMPILE( |
| 1306 | [ ], |
| 1307 | [ |
| 1308 | return 0; |
| 1309 | ], |
| 1310 | [ |
| 1311 | AC_SUBST([FLAG_W_EXTRA], [-Wextra]) |
| 1312 | AC_MSG_RESULT([-Wextra]) |
| 1313 | ], [ |
| 1314 | CFLAGS="-W" |
| 1315 | AC_TRY_COMPILE( |
| 1316 | [ ], |
| 1317 | [ |
| 1318 | return 0; |
| 1319 | ], |
| 1320 | [ |
| 1321 | AC_SUBST([FLAG_W_EXTRA], [-W]) |
| 1322 | AC_MSG_RESULT([-W]) |
| 1323 | ], [ |
| 1324 | AC_SUBST([FLAG_W_EXTRA], []) |
| 1325 | AC_MSG_RESULT([not supported]) |
| 1326 | ]) |
| 1327 | ]) |
| 1328 | CFLAGS=$safe_CFLAGS |
| 1329 | |
| 1330 | |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1331 | # does this compiler support -fno-stack-protector ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1332 | AC_MSG_CHECKING([if gcc accepts -fno-stack-protector]) |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1333 | |
| 1334 | safe_CFLAGS=$CFLAGS |
| 1335 | CFLAGS="-fno-stack-protector" |
| 1336 | |
| 1337 | AC_TRY_COMPILE(, [ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1338 | return 0; |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1339 | ], |
| 1340 | [ |
| 1341 | no_stack_protector=yes |
| 1342 | FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector" |
| 1343 | AC_MSG_RESULT([yes]) |
| 1344 | ], [ |
| 1345 | no_stack_protector=no |
| 1346 | FLAG_FNO_STACK_PROTECTOR="" |
| 1347 | AC_MSG_RESULT([no]) |
| 1348 | ]) |
| 1349 | CFLAGS=$safe_CFLAGS |
| 1350 | |
| 1351 | AC_SUBST(FLAG_FNO_STACK_PROTECTOR) |
| 1352 | |
| 1353 | if test x$no_stack_protector = xyes; then |
| 1354 | CFLAGS="$CFLAGS -fno-stack-protector" |
| 1355 | fi |
| 1356 | |
| 1357 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1358 | # does this compiler support --param inline-unit-growth=... ? |
| 1359 | |
| 1360 | AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth]) |
| 1361 | |
| 1362 | safe_CFLAGS=$CFLAGS |
| 1363 | CFLAGS="--param inline-unit-growth=900" |
| 1364 | |
| 1365 | AC_TRY_COMPILE( |
| 1366 | [ ], |
| 1367 | [ |
| 1368 | return 0; |
| 1369 | ], |
| 1370 | [ |
| 1371 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], |
| 1372 | ["--param inline-unit-growth=900"]) |
| 1373 | AC_MSG_RESULT([yes]) |
| 1374 | ], [ |
| 1375 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""]) |
| 1376 | AC_MSG_RESULT([no]) |
| 1377 | ]) |
| 1378 | CFLAGS=$safe_CFLAGS |
| 1379 | |
| 1380 | |
tom | d55121e | 2005-12-19 12:40:13 +0000 | [diff] [blame] | 1381 | # does this compiler support __builtin_expect? |
| 1382 | AC_MSG_CHECKING([if gcc supports __builtin_expect]) |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1383 | |
tom | d55121e | 2005-12-19 12:40:13 +0000 | [diff] [blame] | 1384 | AC_TRY_LINK(, [ |
| 1385 | return __builtin_expect(1, 1) ? 1 : 0 |
| 1386 | ], |
| 1387 | [ |
| 1388 | ac_have_builtin_expect=yes |
| 1389 | AC_MSG_RESULT([yes]) |
| 1390 | ], [ |
| 1391 | ac_have_builtin_expect=no |
| 1392 | AC_MSG_RESULT([no]) |
| 1393 | ]) |
| 1394 | if test x$ac_have_builtin_expect = xyes ; then |
| 1395 | AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if gcc supports __builtin_expect.]) |
| 1396 | fi |
| 1397 | |
tom | 1e94668 | 2005-10-12 11:27:33 +0000 | [diff] [blame] | 1398 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1399 | # does the ppc assembler support "mtocrf" et al? |
| 1400 | AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) |
| 1401 | |
| 1402 | AC_TRY_COMPILE(, [ |
sewardj | dd4cbe1 | 2006-03-12 17:27:44 +0000 | [diff] [blame] | 1403 | __asm__ __volatile__("mtocrf 4,0"); |
| 1404 | __asm__ __volatile__("mfocrf 0,4"); |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1405 | ], |
| 1406 | [ |
| 1407 | ac_have_as_ppc_mftocrf=yes |
| 1408 | AC_MSG_RESULT([yes]) |
| 1409 | ], [ |
| 1410 | ac_have_as_ppc_mftocrf=no |
| 1411 | AC_MSG_RESULT([no]) |
| 1412 | ]) |
| 1413 | if test x$ac_have_as_ppc_mftocrf = xyes ; then |
| 1414 | AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.]) |
| 1415 | fi |
| 1416 | |
| 1417 | |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1418 | # does the x86/amd64 assembler understand SSE3 instructions? |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1419 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1420 | # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1421 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3]) |
| 1422 | |
| 1423 | AC_TRY_COMPILE(, [ |
| 1424 | do { long long int x; |
| 1425 | __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); } |
| 1426 | while (0) |
| 1427 | ], |
| 1428 | [ |
| 1429 | ac_have_as_sse3=yes |
| 1430 | AC_MSG_RESULT([yes]) |
| 1431 | ], [ |
| 1432 | ac_have_as_sse3=no |
| 1433 | AC_MSG_RESULT([no]) |
| 1434 | ]) |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1435 | |
| 1436 | AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes) |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1437 | |
| 1438 | |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1439 | # Ditto for SSSE3 instructions (note extra S) |
| 1440 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1441 | # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's |
| 1442 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3]) |
| 1443 | |
| 1444 | AC_TRY_COMPILE(, [ |
| 1445 | do { long long int x; |
| 1446 | __asm__ __volatile__( |
| 1447 | "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); } |
| 1448 | while (0) |
| 1449 | ], |
| 1450 | [ |
| 1451 | ac_have_as_ssse3=yes |
| 1452 | AC_MSG_RESULT([yes]) |
| 1453 | ], [ |
| 1454 | ac_have_as_ssse3=no |
| 1455 | AC_MSG_RESULT([no]) |
| 1456 | ]) |
| 1457 | |
| 1458 | AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) |
| 1459 | |
| 1460 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1461 | # Check for TLS support in the compiler and linker |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 1462 | if test "x${cross_compiling}" = "xno"; then |
| 1463 | # Native compilation: check whether running a program using TLS succeeds. |
| 1464 | # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs |
| 1465 | # succeeds but running programs using TLS fails. |
| 1466 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 1467 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 1468 | [vg_cv_tls=$enableval], |
| 1469 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 1470 | [[return foo;]])], |
| 1471 | [vg_cv_tls=yes], |
| 1472 | [vg_cv_tls=no])])]) |
| 1473 | else |
| 1474 | # Cross-compiling: check whether linking a program using TLS succeeds. |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1475 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 1476 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 1477 | [vg_cv_tls=$enableval], |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 1478 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1479 | [[return foo;]])], |
| 1480 | [vg_cv_tls=yes], |
| 1481 | [vg_cv_tls=no])])]) |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 1482 | fi |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1483 | |
| 1484 | if test "$vg_cv_tls" = yes; then |
| 1485 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 1486 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1487 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1488 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1489 | #---------------------------------------------------------------------------- |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 1490 | # Checks for C header files. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1491 | #---------------------------------------------------------------------------- |
| 1492 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1493 | AC_HEADER_STDC |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1494 | AC_CHECK_HEADERS([ \ |
bart | 1f2b143 | 2009-01-16 12:06:54 +0000 | [diff] [blame] | 1495 | asm/unistd.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1496 | endian.h \ |
| 1497 | mqueue.h \ |
| 1498 | sys/endian.h \ |
| 1499 | sys/epoll.h \ |
| 1500 | sys/eventfd.h \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 1501 | sys/klog.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1502 | sys/poll.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1503 | sys/signal.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1504 | sys/signalfd.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1505 | sys/syscall.h \ |
| 1506 | sys/time.h \ |
| 1507 | sys/types.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1508 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1509 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1510 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1511 | # Checks for typedefs, structures, and compiler characteristics. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1512 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1513 | AC_TYPE_UID_T |
| 1514 | AC_TYPE_OFF_T |
| 1515 | AC_TYPE_SIZE_T |
| 1516 | AC_HEADER_TIME |
| 1517 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1518 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1519 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1520 | # Checks for library functions. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1521 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1522 | AC_FUNC_MEMCMP |
| 1523 | AC_FUNC_MMAP |
| 1524 | AC_TYPE_SIGNAL |
| 1525 | |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1526 | AC_CHECK_LIB([rt], [clock_gettime]) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1527 | |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1528 | AC_CHECK_FUNCS([ \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1529 | clock_gettime\ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1530 | epoll_create \ |
| 1531 | epoll_pwait \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1532 | floor \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 1533 | klogctl \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1534 | mallinfo \ |
| 1535 | memchr \ |
| 1536 | memset \ |
| 1537 | mkdir \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 1538 | mremap \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1539 | ppoll \ |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 1540 | pthread_barrier_init \ |
| 1541 | pthread_condattr_setclock \ |
| 1542 | pthread_mutex_timedlock \ |
| 1543 | pthread_rwlock_timedrdlock \ |
| 1544 | pthread_rwlock_timedwrlock \ |
| 1545 | pthread_spin_lock \ |
bart | d1f724c | 2009-08-26 18:11:18 +0000 | [diff] [blame] | 1546 | readlinkat \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1547 | semtimedop \ |
| 1548 | signalfd \ |
njn | 6cc2247 | 2009-03-16 03:46:48 +0000 | [diff] [blame] | 1549 | sigwaitinfo \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1550 | syscall \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1551 | strchr \ |
| 1552 | strdup \ |
| 1553 | strpbrk \ |
| 1554 | strrchr \ |
| 1555 | strstr \ |
| 1556 | timerfd \ |
| 1557 | utimensat \ |
| 1558 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1559 | |
bart | 623eec3 | 2008-07-29 17:54:49 +0000 | [diff] [blame] | 1560 | # AC_CHECK_LIB adds any library found to the variable LIBS, and links these |
| 1561 | # libraries with any shared object and/or executable. This is NOT what we |
| 1562 | # want for e.g. vgpreload_core-x86-linux.so |
| 1563 | LIBS="" |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1564 | |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 1565 | AM_CONDITIONAL([HAVE_PTHREAD_BARRIER], |
| 1566 | [test x$ac_cv_func_pthread_barrier_init = xyes]) |
bart | 2eaa8f2 | 2009-01-20 14:01:16 +0000 | [diff] [blame] | 1567 | AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK], |
| 1568 | [test x$ac_cv_func_pthread_mutex_timedlock = xyes]) |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 1569 | AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], |
| 1570 | [test x$ac_cv_func_pthread_spin_lock = xyes]) |
| 1571 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1572 | |
| 1573 | #---------------------------------------------------------------------------- |
| 1574 | # MPI checks |
| 1575 | #---------------------------------------------------------------------------- |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1576 | # Do we have a useable MPI setup on the primary and/or secondary targets? |
| 1577 | # On Linux, by default, assumes mpicc and -m32/-m64 |
| 1578 | # On AIX, by default, assumes mpxlc and -q32/-q64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1579 | # Note: this is a kludge in that it assumes the specified mpicc |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1580 | # understands -m32/-m64/-q32/-q64 regardless of what is specified using |
| 1581 | # --with-mpicc=. |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1582 | MPI_CC="mpicc" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1583 | if test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ |
| 1584 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1585 | MPI_CC="mpxlc" |
| 1586 | fi |
| 1587 | |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1588 | mflag_primary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1589 | if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 1590 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1591 | mflag_primary=$FLAG_M32 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1592 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
| 1593 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1594 | mflag_primary=$FLAG_M64 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1595 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1596 | mflag_primary=-q32 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1597 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1598 | mflag_primary=-q64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1599 | fi |
| 1600 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1601 | mflag_secondary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1602 | if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
| 1603 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1604 | mflag_secondary=$FLAG_M32 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1605 | elif test x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5 ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1606 | mflag_secondary=-q32 |
| 1607 | fi |
| 1608 | |
| 1609 | |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1610 | AC_ARG_WITH(mpicc, |
sewardj | b70a613 | 2006-05-27 21:14:09 +0000 | [diff] [blame] | 1611 | [ --with-mpicc= Specify name of MPI2-ised C compiler], |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1612 | MPI_CC=$withval |
| 1613 | ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1614 | AC_SUBST(MPI_CC) |
| 1615 | |
| 1616 | ## See if MPI_CC works for the primary target |
| 1617 | ## |
| 1618 | 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] | 1619 | saved_CC=$CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1620 | saved_CFLAGS=$CFLAGS |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1621 | CC=$MPI_CC |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1622 | CFLAGS=$mflag_primary |
sewardj | d3fcc64 | 2006-03-09 02:49:56 +0000 | [diff] [blame] | 1623 | AC_TRY_LINK([ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 1624 | #include <mpi.h> |
| 1625 | #include <stdio.h> |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1626 | ],[ |
| 1627 | int r = MPI_Init(NULL,NULL); |
| 1628 | r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL ); |
| 1629 | return r; |
| 1630 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1631 | ac_have_mpi2_pri=yes |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 1632 | AC_MSG_RESULT([yes, $MPI_CC]) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1633 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1634 | ac_have_mpi2_pri=no |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1635 | AC_MSG_RESULT([no]) |
| 1636 | ]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1637 | CC=$saved_CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1638 | CFLAGS=$saved_CFLAGS |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1639 | AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1640 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1641 | ## See if MPI_CC works for the secondary target. Complication: what if |
| 1642 | ## there is no secondary target? We need this to then fail. |
| 1643 | ## Kludge this by making MPI_CC something which will surely fail in |
| 1644 | ## such a case. |
| 1645 | ## |
| 1646 | AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) |
| 1647 | saved_CC=$CC |
| 1648 | saved_CFLAGS=$CFLAGS |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1649 | if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1650 | CC="$MPI_CC this will surely fail" |
| 1651 | else |
| 1652 | CC=$MPI_CC |
| 1653 | fi |
| 1654 | CFLAGS=$mflag_secondary |
| 1655 | AC_TRY_LINK([ |
| 1656 | #include <mpi.h> |
| 1657 | #include <stdio.h> |
| 1658 | ],[ |
| 1659 | int r = MPI_Init(NULL,NULL); |
| 1660 | r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL ); |
| 1661 | return r; |
| 1662 | ], [ |
| 1663 | ac_have_mpi2_sec=yes |
| 1664 | AC_MSG_RESULT([yes, $MPI_CC]) |
| 1665 | ], [ |
| 1666 | ac_have_mpi2_sec=no |
| 1667 | AC_MSG_RESULT([no]) |
| 1668 | ]) |
| 1669 | CC=$saved_CC |
| 1670 | CFLAGS=$saved_CFLAGS |
| 1671 | AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1672 | |
| 1673 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1674 | #---------------------------------------------------------------------------- |
| 1675 | # Other library checks |
| 1676 | #---------------------------------------------------------------------------- |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1677 | # There now follow some tests for QtCore, Boost, and OpenMP. These |
| 1678 | # tests are present because Drd has some regression tests that use |
| 1679 | # these packages. All regression test programs all compiled only |
| 1680 | # for the primary target. And so it is important that the configure |
| 1681 | # checks that follow, use the correct -m32 or -m64 flag for the |
| 1682 | # primary target (called $mflag_primary). Otherwise, we can end up |
| 1683 | # in a situation (eg) where, on amd64-linux, the test for Boost checks |
| 1684 | # for usable 64-bit Boost facilities, but because we are doing a 32-bit |
| 1685 | # only build (meaning, the primary target is x86-linux), the build |
| 1686 | # of the regtest programs that use Boost fails, because they are |
| 1687 | # build as 32-bit (IN THIS EXAMPLE). |
| 1688 | # |
| 1689 | # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES |
| 1690 | # NEEDED BY THE REGRESSION TEST PROGRAMS. |
| 1691 | |
| 1692 | |
bart | 21d3cfc | 2008-08-02 09:08:17 +0000 | [diff] [blame] | 1693 | # The test below verifies whether the QtCore package been installed. |
| 1694 | # This test works as follows: |
| 1695 | # - If pkg-config was not installed at the time autogen.sh was run, |
| 1696 | # the definition of the PKG_CHECK_EXISTS() macro will not be found by |
| 1697 | # autogen.sh. Augogen.sh will generate a configure script that prints |
| 1698 | # a warning about pkg-config and proceeds as if Qt4 has not been installed. |
| 1699 | # - If pkg-config was installed at the time autogen.sh was run, |
| 1700 | # the generated configure script will try to detect the presence of the |
| 1701 | # Qt4 QtCore library by looking up compile and linker flags in the file |
| 1702 | # called QtCore.pc. |
| 1703 | # - pkg-config settings can be overridden via the configure variables |
| 1704 | # QTCORE_CFLAGS and QTCORE_LIBS (added by the pkg-config m4 macro's to the |
| 1705 | # configure script -- see also ./configure --help). |
| 1706 | # - The QTCORE_CFLAGS and QTCORE_LIBS configure variables can be used even if |
| 1707 | # the pkg-config executable is not present on the system on which the |
| 1708 | # configure script is run. |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1709 | |
bart | 21d3cfc | 2008-08-02 09:08:17 +0000 | [diff] [blame] | 1710 | ifdef( |
| 1711 | [PKG_CHECK_EXISTS], |
| 1712 | [PKG_CHECK_EXISTS( |
| 1713 | [QtCore], |
| 1714 | [ |
| 1715 | PKG_CHECK_MODULES([QTCORE], [QtCore]) |
bart | 11fbd89 | 2008-09-21 15:00:58 +0000 | [diff] [blame] | 1716 | # Paranoia: don't trust the result reported by pkg-config, but when |
| 1717 | # pkg-config reports that QtCore has been found, verify whether linking |
| 1718 | # programs with QtCore succeeds. |
| 1719 | AC_LANG(C++) |
| 1720 | safe_CXXFLAGS="${CXXFLAGS}" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1721 | CXXFLAGS="${QTCORE_CFLAGS} ${QTCORE_LIBS} $mflag_primary" |
bart | 11fbd89 | 2008-09-21 15:00:58 +0000 | [diff] [blame] | 1722 | AC_TRY_LINK( |
| 1723 | [#include <QMutex>], |
| 1724 | [QMutex Mutex;], |
| 1725 | [ac_have_qtcore=yes], |
| 1726 | [ |
| 1727 | AC_MSG_WARN([Although pkg-config detected Qt4, linking Qt4 programs fails. Skipping Qt4.]) |
| 1728 | ac_have_qtcore=no |
| 1729 | ] |
| 1730 | ) |
| 1731 | CXXFLAGS="${safe_CXXFLAGS}" |
bart | 21d3cfc | 2008-08-02 09:08:17 +0000 | [diff] [blame] | 1732 | ], |
| 1733 | [ |
| 1734 | ac_have_qtcore=no |
| 1735 | ] |
| 1736 | ) |
| 1737 | ], |
| 1738 | AC_MSG_WARN([pkg-config has not been installed or is too old.]) |
| 1739 | AC_MSG_WARN([Detection of Qt4 will be skipped.]) |
| 1740 | [ac_have_qtcore=no] |
| 1741 | ) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1742 | |
| 1743 | AM_CONDITIONAL([HAVE_QTCORE], [test x$ac_have_qtcore = xyes]) |
| 1744 | |
| 1745 | |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 1746 | # Test for QMutex::tryLock(int), which has been introduced in Qt 4.3. |
| 1747 | # See also http://doc.trolltech.com/4.3/qmutex.html. |
| 1748 | if test x$ac_have_qtcore = xyes; then |
| 1749 | AC_MSG_CHECKING([for Qt4 QMutex::tryLock(int)]) |
| 1750 | AC_LANG(C++) |
bart | 21d3cfc | 2008-08-02 09:08:17 +0000 | [diff] [blame] | 1751 | safe_CXXFLAGS="${CXXFLAGS}" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1752 | CXXFLAGS="${QTCORE_CFLAGS} $mflag_primary" |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 1753 | AC_TRY_COMPILE([ |
| 1754 | #include <QtCore/QMutex> |
| 1755 | ], |
| 1756 | [ |
| 1757 | QMutex M; |
| 1758 | M.tryLock(1); |
| 1759 | M.unlock(); |
| 1760 | return 0; |
| 1761 | ], |
| 1762 | [ |
| 1763 | AC_MSG_RESULT([yes]) |
| 1764 | AC_DEFINE([HAVE_QTCORE_QMUTEX_TRYLOCK_INT], [1], [Define to 1 if the installed version of Qt4 provides QMutex::tryLock(int).]) |
| 1765 | ], |
| 1766 | [ |
| 1767 | AC_MSG_RESULT([no]) |
| 1768 | ]) |
bart | 21d3cfc | 2008-08-02 09:08:17 +0000 | [diff] [blame] | 1769 | CXXFLAGS="${safe_CXXFLAGS}" |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 1770 | AC_LANG(C) |
| 1771 | fi |
| 1772 | |
| 1773 | |
bart | 4f43e00 | 2009-11-09 16:07:43 +0000 | [diff] [blame] | 1774 | # Test for QAtomicInt, which has been introduced in Qt 4.4. |
| 1775 | # See also http://doc.trolltech.com/4.4/qatomicint.html. |
| 1776 | if test x$ac_have_qtcore = xyes; then |
bart | 9da08ba | 2009-11-11 19:22:05 +0000 | [diff] [blame] | 1777 | AC_MSG_CHECKING([for Qt4 QAtomicInt]) |
bart | 4f43e00 | 2009-11-09 16:07:43 +0000 | [diff] [blame] | 1778 | AC_LANG(C++) |
| 1779 | safe_CXXFLAGS="${CXXFLAGS}" |
| 1780 | CXXFLAGS="${QTCORE_CFLAGS} $mflag_primary" |
| 1781 | AC_TRY_COMPILE([ |
| 1782 | #include <QtCore/QAtomicInt> |
| 1783 | ], |
| 1784 | [ |
| 1785 | QAtomicInt I; |
| 1786 | I.testAndSetOrdered(0, 1); |
| 1787 | return 0; |
| 1788 | ], |
| 1789 | [ |
| 1790 | ac_have_qtcore_qatomicint=yes |
| 1791 | AC_MSG_RESULT([yes]) |
| 1792 | AC_DEFINE([HAVE_QTCORE_QATOMICINT], [1], [Define to 1 if the installed version of Qt4 provides QAtomicInt.]) |
| 1793 | ], |
| 1794 | [ |
| 1795 | ac_have_qtcore_qatomicint=no |
| 1796 | AC_MSG_RESULT([no]) |
| 1797 | ]) |
| 1798 | CXXFLAGS="${safe_CXXFLAGS}" |
| 1799 | AC_LANG(C) |
| 1800 | fi |
| 1801 | |
| 1802 | AM_CONDITIONAL([HAVE_QTCORE_QATOMICINT], [test x$ac_have_qtcore_qatomicint = xyes]) |
| 1803 | |
| 1804 | |
| 1805 | |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1806 | # Check whether the boost library 1.35 or later has been installed. |
| 1807 | # The Boost.Threads library has undergone a major rewrite in version 1.35.0. |
| 1808 | |
| 1809 | AC_MSG_CHECKING([for boost]) |
| 1810 | |
| 1811 | AC_LANG(C++) |
| 1812 | safe_CXXFLAGS=$CXXFLAGS |
| 1813 | CXXFLAGS="-lboost_thread-mt $mflag_primary" |
| 1814 | |
| 1815 | AC_LINK_IFELSE( |
| 1816 | [ |
| 1817 | #include <boost/thread.hpp> |
| 1818 | static void thread_func(void) |
| 1819 | { } |
| 1820 | int main(int argc, char** argv) |
| 1821 | { |
| 1822 | boost::thread t(thread_func); |
| 1823 | return 0; |
| 1824 | } |
| 1825 | ], |
| 1826 | [ |
| 1827 | ac_have_boost_1_35=yes |
| 1828 | AC_SUBST([BOOST_CFLAGS], []) |
| 1829 | AC_SUBST([BOOST_LIBS], ["${CXXFLAGS}"]) |
| 1830 | AC_MSG_RESULT([yes]) |
| 1831 | ], [ |
| 1832 | ac_have_boost_1_35=no |
| 1833 | AC_MSG_RESULT([no]) |
| 1834 | ]) |
| 1835 | |
| 1836 | CXXFLAGS=$safe_CXXFLAGS |
| 1837 | AC_LANG(C) |
| 1838 | |
| 1839 | AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes]) |
| 1840 | |
| 1841 | |
| 1842 | # does this compiler support -fopenmp, does it have the include file |
| 1843 | # <omp.h> and does it have libgomp ? |
| 1844 | |
| 1845 | AC_MSG_CHECKING([for OpenMP]) |
| 1846 | |
| 1847 | safe_CFLAGS=$CFLAGS |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1848 | CFLAGS="-fopenmp $mflag_primary" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1849 | |
| 1850 | AC_LINK_IFELSE( |
| 1851 | [ |
| 1852 | #include <omp.h> |
| 1853 | int main(int argc, char** argv) |
| 1854 | { |
| 1855 | omp_set_dynamic(0); |
| 1856 | return 0; |
| 1857 | } |
| 1858 | ], |
| 1859 | [ |
| 1860 | ac_have_openmp=yes |
| 1861 | AC_MSG_RESULT([yes]) |
| 1862 | ], [ |
| 1863 | ac_have_openmp=no |
| 1864 | AC_MSG_RESULT([no]) |
| 1865 | ]) |
| 1866 | CFLAGS=$safe_CFLAGS |
| 1867 | |
| 1868 | AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) |
| 1869 | |
| 1870 | |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1871 | # does this compiler have built-in functions for atomic memory access ? |
| 1872 | AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) |
| 1873 | |
| 1874 | safe_CFLAGS=$CFLAGS |
| 1875 | CFLAGS="$mflag_primary" |
| 1876 | |
| 1877 | AC_TRY_LINK(, |
| 1878 | [ |
| 1879 | int variable = 1; |
| 1880 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 1881 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
| 1882 | ], |
| 1883 | [ |
bart | c82d137 | 2009-05-31 16:21:23 +0000 | [diff] [blame] | 1884 | ac_have_builtin_atomic=yes |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1885 | AC_MSG_RESULT([yes]) |
| 1886 | AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) |
| 1887 | ], |
| 1888 | [ |
bart | c82d137 | 2009-05-31 16:21:23 +0000 | [diff] [blame] | 1889 | ac_have_builtin_atomic=no |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1890 | AC_MSG_RESULT([no]) |
| 1891 | ]) |
| 1892 | |
| 1893 | CFLAGS=$safe_CFLAGS |
| 1894 | |
bart | c82d137 | 2009-05-31 16:21:23 +0000 | [diff] [blame] | 1895 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], [test x$ac_have_builtin_atomic = xyes]) |
| 1896 | |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1897 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1898 | #---------------------------------------------------------------------------- |
| 1899 | # Ok. We're done checking. |
| 1900 | #---------------------------------------------------------------------------- |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1901 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 1902 | # Nb: VEX/Makefile is generated from Makefile.vex.in. |
| 1903 | AC_CONFIG_FILES([ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1904 | Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 1905 | VEX/Makefile:Makefile.vex.in |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1906 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 1907 | valgrind.pc |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 1908 | glibc-2.X.supp |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 1909 | docs/Makefile |
| 1910 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 1911 | tests/vg_regtest |
njn | ec0c27a | 2005-12-10 23:11:28 +0000 | [diff] [blame] | 1912 | perf/Makefile |
| 1913 | perf/vg_perf |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 1914 | include/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 1915 | auxprogs/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 1916 | mpi/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 1917 | coregrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1918 | memcheck/Makefile |
| 1919 | memcheck/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1920 | memcheck/tests/amd64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1921 | memcheck/tests/x86/Makefile |
njn | 3b3b76d | 2009-01-19 03:44:19 +0000 | [diff] [blame] | 1922 | memcheck/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 1923 | memcheck/tests/darwin/Makefile |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 1924 | memcheck/tests/x86-linux/Makefile |
njn | 29a5c01 | 2009-05-06 06:15:55 +0000 | [diff] [blame] | 1925 | memcheck/perf/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1926 | cachegrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1927 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1928 | cachegrind/tests/x86/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 1929 | cachegrind/cg_annotate |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 1930 | callgrind/Makefile |
| 1931 | callgrind/callgrind_annotate |
| 1932 | callgrind/callgrind_control |
| 1933 | callgrind/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1934 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 1935 | helgrind/tests/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 1936 | massif/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 1937 | massif/tests/Makefile |
njn | 734b805 | 2007-11-01 04:40:37 +0000 | [diff] [blame] | 1938 | massif/perf/Makefile |
njn | d5a8d24 | 2007-11-02 20:44:57 +0000 | [diff] [blame] | 1939 | massif/ms_print |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1940 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 1941 | lackey/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 1942 | none/Makefile |
| 1943 | none/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1944 | none/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 1945 | none/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 1946 | none/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 1947 | none/tests/x86/Makefile |
njn | 0458a12 | 2009-02-13 06:23:46 +0000 | [diff] [blame] | 1948 | none/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 1949 | none/tests/darwin/Makefile |
njn | 06ca332 | 2009-04-15 23:10:04 +0000 | [diff] [blame] | 1950 | none/tests/x86-linux/Makefile |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 1951 | exp-ptrcheck/Makefile |
| 1952 | exp-ptrcheck/tests/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 1953 | drd/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 1954 | drd/scripts/download-and-build-splash2 |
| 1955 | drd/tests/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 1956 | exp-bbv/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 1957 | exp-bbv/tests/Makefile |
| 1958 | exp-bbv/tests/x86/Makefile |
| 1959 | exp-bbv/tests/x86-linux/Makefile |
| 1960 | exp-bbv/tests/amd64-linux/Makefile |
| 1961 | exp-bbv/tests/ppc32-linux/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 1962 | ]) |
| 1963 | AC_OUTPUT |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 1964 | |
| 1965 | cat<<EOF |
| 1966 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 1967 | Maximum build arch: ${ARCH_MAX} |
| 1968 | Primary build arch: ${VGCONF_ARCH_PRI} |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 1969 | Secondary build arch: ${VGCONF_ARCH_SEC} |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 1970 | Build OS: ${VGCONF_OS} |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1971 | Primary build target: ${VGCONF_PLATFORM_PRI_CAPS} |
| 1972 | Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS} |
sewardj | e95d94f | 2008-09-19 09:02:19 +0000 | [diff] [blame] | 1973 | Default supp files: ${DEFAULT_SUPP} |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 1974 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 1975 | EOF |