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