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