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