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 | |
tom | b637bad | 2005-11-08 12:28:35 +0000 | [diff] [blame] | 619 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 620 | #---------------------------------------------------------------------------- |
| 621 | # Inner Valgrind? |
| 622 | #---------------------------------------------------------------------------- |
| 623 | |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 624 | # Check if this should be built as an inner Valgrind, to be run within |
| 625 | # another Valgrind. Choose the load address accordingly. |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 626 | AC_SUBST(VALT_LOAD_ADDRESS_PRI) |
| 627 | AC_SUBST(VALT_LOAD_ADDRESS_SEC) |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 628 | AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, |
| 629 | [AC_ARG_ENABLE(inner, |
| 630 | [ --enable-inner enables self-hosting], |
| 631 | [vg_cv_inner=$enableval], |
| 632 | [vg_cv_inner=no])]) |
| 633 | if test "$vg_cv_inner" = yes; then |
| 634 | AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind]) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 635 | VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner |
| 636 | VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 637 | else |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 638 | VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml |
| 639 | VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 640 | fi |
| 641 | |
| 642 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 643 | #---------------------------------------------------------------------------- |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 644 | # Extra fine-tuning of installation directories |
| 645 | #---------------------------------------------------------------------------- |
| 646 | AC_ARG_WITH(tmpdir, |
| 647 | [ --with-tmpdir=PATH Specify path for temporary files], |
| 648 | tmpdir="$withval", |
| 649 | tmpdir="/tmp") |
| 650 | AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory]) |
| 651 | |
sewardj | 0ba37c9 | 2011-07-12 11:46:24 +0000 | [diff] [blame] | 652 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 653 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 654 | # Libc and suppressions |
| 655 | #---------------------------------------------------------------------------- |
| 656 | # This variable will collect the suppression files to be used. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 657 | AC_SUBST(DEFAULT_SUPP) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 658 | |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 659 | AC_CHECK_HEADER([features.h]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 660 | |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 661 | if test x$ac_cv_header_features_h = xyes; then |
| 662 | rm -f conftest.$ac_ext |
| 663 | cat <<_ACEOF >conftest.$ac_ext |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 664 | #include <features.h> |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 665 | #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) |
| 666 | glibc version is: __GLIBC__ __GLIBC_MINOR__ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 667 | #endif |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 668 | _ACEOF |
| 669 | GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`" |
| 670 | fi |
bart | b7c3f08 | 2010-05-13 06:32:36 +0000 | [diff] [blame] | 671 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 672 | # not really a version check |
| 673 | AC_EGREP_CPP([DARWIN_LIBC], [ |
| 674 | #include <sys/cdefs.h> |
| 675 | #if defined(__DARWIN_VERS_1050) |
| 676 | DARWIN_LIBC |
| 677 | #endif |
| 678 | ], |
| 679 | GLIBC_VERSION="darwin") |
| 680 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 681 | # not really a version check |
| 682 | AC_EGREP_CPP([BIONIC_LIBC], [ |
| 683 | #if defined(__ANDROID__) |
| 684 | BIONIC_LIBC |
| 685 | #endif |
| 686 | ], |
| 687 | GLIBC_VERSION="bionic") |
| 688 | |
| 689 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 690 | AC_MSG_CHECKING([the GLIBC_VERSION version]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 691 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 692 | case "${GLIBC_VERSION}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 693 | 2.2) |
| 694 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 695 | 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] | 696 | DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" |
| 697 | DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 698 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 699 | ;; |
| 700 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 701 | 2.3) |
| 702 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 703 | 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] | 704 | DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 705 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 706 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 707 | ;; |
| 708 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 709 | 2.4) |
| 710 | AC_MSG_RESULT(2.4 family) |
| 711 | 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] | 712 | DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 713 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 714 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 715 | ;; |
| 716 | |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 717 | 2.5) |
| 718 | AC_MSG_RESULT(2.5 family) |
| 719 | 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] | 720 | DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 721 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 722 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 723 | ;; |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 724 | 2.6) |
| 725 | AC_MSG_RESULT(2.6 family) |
| 726 | 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] | 727 | DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 728 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 729 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 730 | ;; |
| 731 | 2.7) |
| 732 | AC_MSG_RESULT(2.7 family) |
| 733 | 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] | 734 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 735 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 736 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 737 | ;; |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 738 | 2.8) |
| 739 | AC_MSG_RESULT(2.8 family) |
dirk | eb939fc | 2008-04-27 20:38:47 +0000 | [diff] [blame] | 740 | 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] | 741 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 742 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 743 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 744 | ;; |
dirk | d2e31eb | 2008-11-19 23:58:36 +0000 | [diff] [blame] | 745 | 2.9) |
| 746 | AC_MSG_RESULT(2.9 family) |
| 747 | AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x]) |
| 748 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 749 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 750 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 751 | ;; |
sewardj | 5d425e8 | 2009-02-01 19:01:11 +0000 | [diff] [blame] | 752 | 2.10) |
| 753 | AC_MSG_RESULT(2.10 family) |
| 754 | AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x]) |
| 755 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 756 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 757 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 758 | ;; |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame] | 759 | 2.11) |
| 760 | AC_MSG_RESULT(2.11 family) |
| 761 | AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x]) |
| 762 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 763 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 764 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
bart | b7c3f08 | 2010-05-13 06:32:36 +0000 | [diff] [blame] | 765 | ;; |
| 766 | 2.12) |
| 767 | AC_MSG_RESULT(2.12 family) |
| 768 | AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x]) |
| 769 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 770 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 771 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame] | 772 | ;; |
tom | ebd619b | 2011-02-10 09:09:09 +0000 | [diff] [blame] | 773 | 2.13) |
| 774 | AC_MSG_RESULT(2.13 family) |
| 775 | AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x]) |
| 776 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 777 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 778 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 779 | ;; |
tom | cc07741 | 2011-06-07 21:52:26 +0000 | [diff] [blame] | 780 | 2.14) |
| 781 | AC_MSG_RESULT(2.14 family) |
| 782 | AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x]) |
| 783 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 784 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 785 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 786 | ;; |
dirk | e75fdeb | 2011-12-29 08:24:55 +0000 | [diff] [blame] | 787 | 2.15) |
| 788 | AC_MSG_RESULT(2.15 family) |
| 789 | AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x]) |
| 790 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 791 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 792 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 793 | ;; |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 794 | darwin) |
| 795 | AC_MSG_RESULT(Darwin) |
| 796 | AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) |
| 797 | # DEFAULT_SUPP set by kernel version check above. |
| 798 | ;; |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 799 | bionic) |
| 800 | AC_MSG_RESULT(Bionic) |
| 801 | AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic]) |
| 802 | DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}" |
| 803 | ;; |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 804 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 805 | *) |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 806 | AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) |
dirk | e75fdeb | 2011-12-29 08:24:55 +0000 | [diff] [blame] | 807 | AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.15]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 808 | AC_MSG_ERROR([or Darwin libc]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 809 | ;; |
| 810 | esac |
| 811 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 812 | AC_SUBST(GLIBC_VERSION) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 813 | |
sewardj | 414f358 | 2008-07-18 20:46:00 +0000 | [diff] [blame] | 814 | |
| 815 | # Add default suppressions for the X client libraries. Make no |
| 816 | # attempt to detect whether such libraries are installed on the |
| 817 | # build machine (or even if any X facilities are present); just |
| 818 | # add the suppressions antidisirregardless. |
| 819 | DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" |
| 820 | DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 821 | |
sewardj | d2f95a0 | 2011-05-11 16:04:28 +0000 | [diff] [blame] | 822 | # Add glibc and X11 suppressions for exp-sgcheck |
| 823 | DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}" |
sewardj | 5744c02 | 2008-10-19 18:58:13 +0000 | [diff] [blame] | 824 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 825 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 826 | #---------------------------------------------------------------------------- |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 827 | # Platform variants? |
| 828 | #---------------------------------------------------------------------------- |
| 829 | |
| 830 | # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough. |
| 831 | # But there are times where we need a bit more control. The motivating |
| 832 | # and currently only case is Android: this is almost identical to arm-linux, |
| 833 | # but not quite. So this introduces the concept of platform variant tags, |
| 834 | # which get passed in the compile as -DVGPV_<arch>_<os>_<variant> along |
| 835 | # with the main -DVGP_<arch>_<os> definition. |
| 836 | # |
| 837 | # In almost all cases, the <variant> bit is "vanilla". But for Android |
| 838 | # it is "android" instead. |
| 839 | # |
| 840 | # Consequently (eg), plain arm-linux would build with |
| 841 | # |
| 842 | # -DVGP_arm_linux -DVGPV_arm_linux_vanilla |
| 843 | # |
| 844 | # whilst an Android build would have |
| 845 | # |
| 846 | # -DVGP_arm_linux -DVGPV_arm_linux_android |
| 847 | # |
| 848 | # The setup of the platform variant is pushed relatively far down this |
| 849 | # file in order that we can inspect any of the variables set above. |
| 850 | |
| 851 | # In the normal case .. |
| 852 | VGCONF_PLATVARIANT="vanilla" |
| 853 | |
| 854 | # Android on ARM ? |
| 855 | if test "$VGCONF_ARCH_PRI-$VGCONF_OS" = "arm-linux" \ |
| 856 | -a "$GLIBC_VERSION" = "bionic"; |
| 857 | then |
| 858 | VGCONF_PLATVARIANT="android" |
| 859 | fi |
| 860 | |
| 861 | AC_SUBST(VGCONF_PLATVARIANT) |
| 862 | |
| 863 | |
| 864 | # FIXME: do we also want to define automake variables |
| 865 | # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently) |
| 866 | # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE, |
| 867 | # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough |
| 868 | # do that. Problem is that we can't do and-ing in Makefile.am's, but |
| 869 | # that's what we'd need to do to use this, since what we'd want to write |
| 870 | # is something like |
| 871 | # |
| 872 | # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID |
| 873 | # |
sewardj | 0ba37c9 | 2011-07-12 11:46:24 +0000 | [diff] [blame] | 874 | # Hmm. Can't think of a nice clean solution to this. |
| 875 | |
| 876 | AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA, |
| 877 | test x$VGCONF_PLATVARIANT = xvanilla) |
| 878 | AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID, |
| 879 | test x$VGCONF_PLATVARIANT = xandroid) |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 880 | |
| 881 | |
| 882 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 883 | # Checking for various library functions and other definitions |
| 884 | #---------------------------------------------------------------------------- |
| 885 | |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 886 | # Check for CLOCK_MONOTONIC |
| 887 | |
| 888 | AC_MSG_CHECKING([for CLOCK_MONOTONIC]) |
| 889 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 890 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 891 | #include <time.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 892 | ]], [[ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 893 | struct timespec t; |
| 894 | clock_gettime(CLOCK_MONOTONIC, &t); |
| 895 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 896 | ]])], [ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 897 | AC_MSG_RESULT([yes]) |
| 898 | AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, |
| 899 | [Define to 1 if you have the `CLOCK_MONOTONIC' constant.]) |
| 900 | ], [ |
| 901 | AC_MSG_RESULT([no]) |
| 902 | ]) |
| 903 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 904 | |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 905 | # Check for PTHREAD_RWLOCK_T |
| 906 | |
| 907 | AC_MSG_CHECKING([for pthread_rwlock_t]) |
| 908 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 909 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 910 | #define _GNU_SOURCE |
| 911 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 912 | ]], [[ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 913 | pthread_rwlock_t rwl; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 914 | ]])], [ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 915 | AC_MSG_RESULT([yes]) |
| 916 | AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1, |
| 917 | [Define to 1 if you have the `pthread_rwlock_t' type.]) |
| 918 | ], [ |
| 919 | AC_MSG_RESULT([no]) |
| 920 | ]) |
| 921 | |
| 922 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 923 | # Check for PTHREAD_MUTEX_ADAPTIVE_NP |
| 924 | |
| 925 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP]) |
| 926 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 927 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 928 | #define _GNU_SOURCE |
| 929 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 930 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 931 | return (PTHREAD_MUTEX_ADAPTIVE_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 932 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 933 | AC_MSG_RESULT([yes]) |
| 934 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, |
| 935 | [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.]) |
| 936 | ], [ |
| 937 | AC_MSG_RESULT([no]) |
| 938 | ]) |
| 939 | |
| 940 | |
| 941 | # Check for PTHREAD_MUTEX_ERRORCHECK_NP |
| 942 | |
| 943 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP]) |
| 944 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 945 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 946 | #define _GNU_SOURCE |
| 947 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 948 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 949 | return (PTHREAD_MUTEX_ERRORCHECK_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 950 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 951 | AC_MSG_RESULT([yes]) |
| 952 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1, |
| 953 | [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.]) |
| 954 | ], [ |
| 955 | AC_MSG_RESULT([no]) |
| 956 | ]) |
| 957 | |
| 958 | |
| 959 | # Check for PTHREAD_MUTEX_RECURSIVE_NP |
| 960 | |
| 961 | AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP]) |
| 962 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 963 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 964 | #define _GNU_SOURCE |
| 965 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 966 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 967 | return (PTHREAD_MUTEX_RECURSIVE_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 968 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 969 | AC_MSG_RESULT([yes]) |
| 970 | AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, |
| 971 | [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.]) |
| 972 | ], [ |
| 973 | AC_MSG_RESULT([no]) |
| 974 | ]) |
| 975 | |
| 976 | |
| 977 | # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
| 978 | |
| 979 | AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP]) |
| 980 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 981 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 982 | #define _GNU_SOURCE |
| 983 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 984 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 985 | pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; |
| 986 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 987 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 988 | AC_MSG_RESULT([yes]) |
| 989 | AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1, |
| 990 | [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.]) |
| 991 | ], [ |
| 992 | AC_MSG_RESULT([no]) |
| 993 | ]) |
| 994 | |
| 995 | |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 996 | # Check whether pthread_mutex_t has a member called __m_kind. |
| 997 | |
bart | b11355c | 2010-04-29 16:37:26 +0000 | [diff] [blame] | 998 | AC_CHECK_MEMBER([pthread_mutex_t.__m_kind], |
| 999 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND], |
| 1000 | 1, |
| 1001 | [Define to 1 if pthread_mutex_t has a member called __m_kind.]) |
| 1002 | ], |
| 1003 | [], |
| 1004 | [#include <pthread.h>]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1005 | |
| 1006 | |
| 1007 | # Check whether pthread_mutex_t has a member called __data.__kind. |
| 1008 | |
bart | b11355c | 2010-04-29 16:37:26 +0000 | [diff] [blame] | 1009 | AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind], |
| 1010 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND], |
| 1011 | 1, |
| 1012 | [Define to 1 if pthread_mutex_t has a member __data.__kind.]) |
| 1013 | ], |
| 1014 | [], |
| 1015 | [#include <pthread.h>]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1016 | |
| 1017 | |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1018 | # does this compiler support -maltivec and does it have the include file |
| 1019 | # <altivec.h> ? |
| 1020 | |
| 1021 | AC_MSG_CHECKING([for Altivec]) |
| 1022 | |
| 1023 | safe_CFLAGS=$CFLAGS |
| 1024 | CFLAGS="-maltivec" |
| 1025 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1026 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1027 | #include <altivec.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1028 | ]], [[ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1029 | vector unsigned int v; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1030 | ]])], [ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1031 | ac_have_altivec=yes |
| 1032 | AC_MSG_RESULT([yes]) |
sewardj | f9fe602 | 2010-09-03 14:36:50 +0000 | [diff] [blame] | 1033 | AC_DEFINE([HAS_ALTIVEC], 1, |
sewardj | 6467a15 | 2010-09-03 14:02:22 +0000 | [diff] [blame] | 1034 | [Define to 1 if gcc/as can do Altivec.]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1035 | ], [ |
| 1036 | ac_have_altivec=no |
| 1037 | AC_MSG_RESULT([no]) |
| 1038 | ]) |
| 1039 | CFLAGS=$safe_CFLAGS |
| 1040 | |
sewardj | 0e342a0 | 2010-09-03 23:49:33 +0000 | [diff] [blame] | 1041 | AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1042 | |
| 1043 | |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1044 | # Check that both: the compiler supports -mvsx and that the assembler |
| 1045 | # understands VSX instructions. If either of those doesn't work, |
| 1046 | # conclude that we can't do VSX. NOTE: basically this is a kludge |
| 1047 | # in that it conflates two things that should be separate -- whether |
| 1048 | # the compiler understands the flag vs whether the assembler |
| 1049 | # understands the opcodes. This really ought to be cleaned up |
| 1050 | # and done properly, like it is for x86/x86_64. |
| 1051 | |
| 1052 | AC_MSG_CHECKING([for VSX]) |
| 1053 | |
| 1054 | safe_CFLAGS=$CFLAGS |
| 1055 | CFLAGS="-mvsx" |
| 1056 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1057 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1058 | #include <altivec.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1059 | ]], [[ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1060 | vector unsigned int v; |
sewardj | 9b80ebb | 2011-04-15 21:16:00 +0000 | [diff] [blame] | 1061 | __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1062 | ]])], [ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1063 | ac_have_vsx=yes |
| 1064 | AC_MSG_RESULT([yes]) |
| 1065 | ], [ |
| 1066 | ac_have_vsx=no |
| 1067 | AC_MSG_RESULT([no]) |
| 1068 | ]) |
| 1069 | CFLAGS=$safe_CFLAGS |
| 1070 | |
| 1071 | AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes) |
| 1072 | |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1073 | AC_MSG_CHECKING([that assembler knows DFP]) |
| 1074 | |
| 1075 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1076 | ]], [[ |
| 1077 | __asm__ __volatile__("dadd 1, 2, 3"); |
| 1078 | ]])], [ |
| 1079 | ac_asm_have_dfp=yes |
| 1080 | AC_MSG_RESULT([yes]) |
| 1081 | ], [ |
| 1082 | ac_asm_have_dfp=no |
| 1083 | AC_MSG_RESULT([no]) |
| 1084 | ]) |
| 1085 | |
| 1086 | AC_MSG_CHECKING([that compiler knows -mhard-dfp switch]) |
| 1087 | safe_CFLAGS=$CFLAGS |
| 1088 | CFLAGS="-mhard-dfp" |
| 1089 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1090 | ]], [[ |
| 1091 | __asm__ __volatile__("dadd 1, 2, 3"); |
| 1092 | ]])], [ |
| 1093 | ac_gcc_have_dfp=yes |
| 1094 | AC_MSG_RESULT([yes]) |
| 1095 | ], [ |
| 1096 | ac_gcc_have_dfp=no |
| 1097 | AC_MSG_RESULT([no]) |
| 1098 | ]) |
| 1099 | |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1100 | CFLAGS=$safe_CFLAGS |
| 1101 | |
| 1102 | 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] | 1103 | |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1104 | # Check for pthread_create@GLIBC2.0 |
| 1105 | AC_MSG_CHECKING([for pthread_create@GLIBC2.0()]) |
| 1106 | |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1107 | safe_CFLAGS=$CFLAGS |
| 1108 | CFLAGS="-lpthread" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1109 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1110 | extern int pthread_create_glibc_2_0(void*, const void*, |
| 1111 | void *(*)(void*), void*); |
| 1112 | __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1113 | ]], [[ |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 1114 | #ifdef __powerpc__ |
| 1115 | /* |
| 1116 | * Apparently on PowerPC linking this program succeeds and generates an |
| 1117 | * executable with the undefined symbol pthread_create@GLIBC_2.0. |
| 1118 | */ |
| 1119 | #error This test does not work properly on PowerPC. |
| 1120 | #else |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1121 | pthread_create_glibc_2_0(0, 0, 0, 0); |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 1122 | #endif |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1123 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1124 | ]])], [ |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1125 | ac_have_pthread_create_glibc_2_0=yes |
| 1126 | AC_MSG_RESULT([yes]) |
| 1127 | AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1, |
| 1128 | [Define to 1 if you have the `pthread_create@glibc2.0' function.]) |
| 1129 | ], [ |
| 1130 | ac_have_pthread_create_glibc_2_0=no |
| 1131 | AC_MSG_RESULT([no]) |
| 1132 | ]) |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1133 | CFLAGS=$safe_CFLAGS |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1134 | |
| 1135 | AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0, |
bart | 24f5390 | 2009-04-26 11:29:02 +0000 | [diff] [blame] | 1136 | test x$ac_have_pthread_create_glibc_2_0 = xyes) |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1137 | |
| 1138 | |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1139 | # Check for eventfd_t, eventfd() and eventfd_read() |
| 1140 | AC_MSG_CHECKING([for eventfd()]) |
| 1141 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1142 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1143 | #include <sys/eventfd.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1144 | ]], [[ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1145 | eventfd_t ev; |
| 1146 | int fd; |
| 1147 | |
| 1148 | fd = eventfd(5, 0); |
| 1149 | eventfd_read(fd, &ev); |
| 1150 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1151 | ]])], [ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1152 | AC_MSG_RESULT([yes]) |
| 1153 | AC_DEFINE([HAVE_EVENTFD], 1, |
| 1154 | [Define to 1 if you have the `eventfd' function.]) |
| 1155 | AC_DEFINE([HAVE_EVENTFD_READ], 1, |
| 1156 | [Define to 1 if you have the `eventfd_read' function.]) |
| 1157 | ], [ |
| 1158 | AC_MSG_RESULT([no]) |
| 1159 | ]) |
| 1160 | |
| 1161 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1162 | #---------------------------------------------------------------------------- |
| 1163 | # Checking for supported compiler flags. |
| 1164 | #---------------------------------------------------------------------------- |
| 1165 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1166 | # does this compiler support -m32 ? |
| 1167 | AC_MSG_CHECKING([if gcc accepts -m32]) |
| 1168 | |
| 1169 | safe_CFLAGS=$CFLAGS |
| 1170 | CFLAGS="-m32" |
| 1171 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1172 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1173 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1174 | ]])], [ |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1175 | FLAG_M32="-m32" |
| 1176 | AC_MSG_RESULT([yes]) |
| 1177 | ], [ |
| 1178 | FLAG_M32="" |
| 1179 | AC_MSG_RESULT([no]) |
| 1180 | ]) |
| 1181 | CFLAGS=$safe_CFLAGS |
| 1182 | |
| 1183 | AC_SUBST(FLAG_M32) |
| 1184 | |
| 1185 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1186 | # does this compiler support -m64 ? |
| 1187 | AC_MSG_CHECKING([if gcc accepts -m64]) |
| 1188 | |
| 1189 | safe_CFLAGS=$CFLAGS |
| 1190 | CFLAGS="-m64" |
| 1191 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1192 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1193 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1194 | ]])], [ |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1195 | FLAG_M64="-m64" |
| 1196 | AC_MSG_RESULT([yes]) |
| 1197 | ], [ |
| 1198 | FLAG_M64="" |
| 1199 | AC_MSG_RESULT([no]) |
| 1200 | ]) |
| 1201 | CFLAGS=$safe_CFLAGS |
| 1202 | |
| 1203 | AC_SUBST(FLAG_M64) |
| 1204 | |
| 1205 | |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1206 | # does this compiler support -mmmx ? |
| 1207 | AC_MSG_CHECKING([if gcc accepts -mmmx]) |
| 1208 | |
| 1209 | safe_CFLAGS=$CFLAGS |
| 1210 | CFLAGS="-mmmx" |
| 1211 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1212 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1213 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1214 | ]])], [ |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1215 | FLAG_MMMX="-mmmx" |
| 1216 | AC_MSG_RESULT([yes]) |
| 1217 | ], [ |
| 1218 | FLAG_MMMX="" |
| 1219 | AC_MSG_RESULT([no]) |
| 1220 | ]) |
| 1221 | CFLAGS=$safe_CFLAGS |
| 1222 | |
| 1223 | AC_SUBST(FLAG_MMMX) |
| 1224 | |
| 1225 | |
| 1226 | # does this compiler support -msse ? |
| 1227 | AC_MSG_CHECKING([if gcc accepts -msse]) |
| 1228 | |
| 1229 | safe_CFLAGS=$CFLAGS |
| 1230 | CFLAGS="-msse" |
| 1231 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1232 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1233 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1234 | ]])], [ |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1235 | FLAG_MSSE="-msse" |
| 1236 | AC_MSG_RESULT([yes]) |
| 1237 | ], [ |
| 1238 | FLAG_MSSE="" |
| 1239 | AC_MSG_RESULT([no]) |
| 1240 | ]) |
| 1241 | CFLAGS=$safe_CFLAGS |
| 1242 | |
| 1243 | AC_SUBST(FLAG_MSSE) |
| 1244 | |
| 1245 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1246 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 1247 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 1248 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1249 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1250 | CFLAGS="-mpreferred-stack-boundary=2" |
| 1251 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1252 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1253 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1254 | ]])], [ |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1255 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1256 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1257 | ], [ |
| 1258 | PREFERRED_STACK_BOUNDARY="" |
| 1259 | AC_MSG_RESULT([no]) |
| 1260 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1261 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1262 | |
| 1263 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 1264 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1265 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1266 | # does this compiler support -Wno-pointer-sign ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1267 | AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign]) |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1268 | |
| 1269 | safe_CFLAGS=$CFLAGS |
| 1270 | CFLAGS="-Wno-pointer-sign" |
| 1271 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1272 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1273 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1274 | ]])], [ |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1275 | no_pointer_sign=yes |
| 1276 | AC_MSG_RESULT([yes]) |
| 1277 | ], [ |
| 1278 | no_pointer_sign=no |
| 1279 | AC_MSG_RESULT([no]) |
| 1280 | ]) |
| 1281 | CFLAGS=$safe_CFLAGS |
| 1282 | |
| 1283 | if test x$no_pointer_sign = xyes; then |
| 1284 | CFLAGS="$CFLAGS -Wno-pointer-sign" |
| 1285 | fi |
| 1286 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1287 | |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1288 | # does this compiler support -Wno-empty-body ? |
| 1289 | |
| 1290 | AC_MSG_CHECKING([if gcc accepts -Wno-empty-body]) |
| 1291 | |
| 1292 | safe_CFLAGS=$CFLAGS |
| 1293 | CFLAGS="-Wno-empty-body" |
| 1294 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1295 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1296 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1297 | ]])], [ |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1298 | AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body]) |
| 1299 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1300 | ], [ |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1301 | AC_SUBST([FLAG_W_NO_EMPTY_BODY], []) |
| 1302 | AC_MSG_RESULT([no]) |
| 1303 | ]) |
| 1304 | CFLAGS=$safe_CFLAGS |
| 1305 | |
| 1306 | |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1307 | # does this compiler support -Wno-format-zero-length ? |
| 1308 | |
| 1309 | AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length]) |
| 1310 | |
| 1311 | safe_CFLAGS=$CFLAGS |
| 1312 | CFLAGS="-Wno-format-zero-length" |
| 1313 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1314 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1315 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1316 | ]])], [ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1317 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length]) |
| 1318 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1319 | ], [ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1320 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], []) |
| 1321 | AC_MSG_RESULT([no]) |
| 1322 | ]) |
| 1323 | CFLAGS=$safe_CFLAGS |
| 1324 | |
| 1325 | |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1326 | # does this compiler support -Wno-nonnull ? |
| 1327 | |
| 1328 | AC_MSG_CHECKING([if gcc accepts -Wno-nonnull]) |
| 1329 | |
| 1330 | safe_CFLAGS=$CFLAGS |
| 1331 | CFLAGS="-Wno-nonnull" |
| 1332 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1333 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1334 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1335 | ]])], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1336 | AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull]) |
| 1337 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1338 | ], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1339 | AC_SUBST([FLAG_W_NO_NONNULL], []) |
| 1340 | AC_MSG_RESULT([no]) |
| 1341 | ]) |
| 1342 | CFLAGS=$safe_CFLAGS |
| 1343 | |
| 1344 | |
| 1345 | # does this compiler support -Wno-overflow ? |
| 1346 | |
| 1347 | AC_MSG_CHECKING([if gcc accepts -Wno-overflow]) |
| 1348 | |
| 1349 | safe_CFLAGS=$CFLAGS |
| 1350 | CFLAGS="-Wno-overflow" |
| 1351 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1352 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1353 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1354 | ]])], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1355 | AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow]) |
| 1356 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1357 | ], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1358 | AC_SUBST([FLAG_W_NO_OVERFLOW], []) |
| 1359 | AC_MSG_RESULT([no]) |
| 1360 | ]) |
| 1361 | CFLAGS=$safe_CFLAGS |
| 1362 | |
| 1363 | |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1364 | # does this compiler support -Wno-uninitialized ? |
| 1365 | |
| 1366 | AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized]) |
| 1367 | |
| 1368 | safe_CFLAGS=$CFLAGS |
| 1369 | CFLAGS="-Wno-uninitialized" |
| 1370 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1371 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1372 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1373 | ]])], [ |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1374 | AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized]) |
| 1375 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1376 | ], [ |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1377 | AC_SUBST([FLAG_W_NO_UNINITIALIZED], []) |
| 1378 | AC_MSG_RESULT([no]) |
| 1379 | ]) |
| 1380 | CFLAGS=$safe_CFLAGS |
| 1381 | |
| 1382 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1383 | # does this compiler support -Wextra or the older -W ? |
| 1384 | |
| 1385 | AC_MSG_CHECKING([if gcc accepts -Wextra or -W]) |
| 1386 | |
| 1387 | safe_CFLAGS=$CFLAGS |
| 1388 | CFLAGS="-Wextra" |
| 1389 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1390 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1391 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1392 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1393 | AC_SUBST([FLAG_W_EXTRA], [-Wextra]) |
| 1394 | AC_MSG_RESULT([-Wextra]) |
| 1395 | ], [ |
| 1396 | CFLAGS="-W" |
sewardj | 9bdf2a6 | 2011-10-27 06:22:23 +0000 | [diff] [blame] | 1397 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1398 | return 0; |
sewardj | 9bdf2a6 | 2011-10-27 06:22:23 +0000 | [diff] [blame] | 1399 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1400 | AC_SUBST([FLAG_W_EXTRA], [-W]) |
| 1401 | AC_MSG_RESULT([-W]) |
| 1402 | ], [ |
| 1403 | AC_SUBST([FLAG_W_EXTRA], []) |
| 1404 | AC_MSG_RESULT([not supported]) |
| 1405 | ]) |
| 1406 | ]) |
| 1407 | CFLAGS=$safe_CFLAGS |
| 1408 | |
| 1409 | |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1410 | # does this compiler support -fno-stack-protector ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1411 | AC_MSG_CHECKING([if gcc accepts -fno-stack-protector]) |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1412 | |
| 1413 | safe_CFLAGS=$CFLAGS |
| 1414 | CFLAGS="-fno-stack-protector" |
| 1415 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1416 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1417 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1418 | ]])], [ |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1419 | no_stack_protector=yes |
| 1420 | FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector" |
| 1421 | AC_MSG_RESULT([yes]) |
| 1422 | ], [ |
| 1423 | no_stack_protector=no |
| 1424 | FLAG_FNO_STACK_PROTECTOR="" |
| 1425 | AC_MSG_RESULT([no]) |
| 1426 | ]) |
| 1427 | CFLAGS=$safe_CFLAGS |
| 1428 | |
| 1429 | AC_SUBST(FLAG_FNO_STACK_PROTECTOR) |
| 1430 | |
| 1431 | if test x$no_stack_protector = xyes; then |
| 1432 | CFLAGS="$CFLAGS -fno-stack-protector" |
| 1433 | fi |
| 1434 | |
| 1435 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1436 | # does this compiler support --param inline-unit-growth=... ? |
| 1437 | |
| 1438 | AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth]) |
| 1439 | |
| 1440 | safe_CFLAGS=$CFLAGS |
| 1441 | CFLAGS="--param inline-unit-growth=900" |
| 1442 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1443 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1444 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1445 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1446 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], |
| 1447 | ["--param inline-unit-growth=900"]) |
| 1448 | AC_MSG_RESULT([yes]) |
| 1449 | ], [ |
| 1450 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""]) |
| 1451 | AC_MSG_RESULT([no]) |
| 1452 | ]) |
| 1453 | CFLAGS=$safe_CFLAGS |
| 1454 | |
| 1455 | |
sewardj | d935068 | 2012-04-05 07:55:47 +0000 | [diff] [blame] | 1456 | # does this compiler support -gdwarf-4 -fdebug-types-section ? |
| 1457 | |
| 1458 | AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section]) |
| 1459 | |
| 1460 | safe_CFLAGS=$CFLAGS |
| 1461 | CFLAGS="-gdwarf-4 -fdebug-types-section" |
| 1462 | |
| 1463 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
| 1464 | return 0; |
| 1465 | ]])], [ |
| 1466 | ac_have_dwarf4=yes |
| 1467 | AC_MSG_RESULT([yes]) |
| 1468 | ], [ |
| 1469 | ac_have_dwarf4=no |
| 1470 | AC_MSG_RESULT([no]) |
| 1471 | ]) |
| 1472 | AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes) |
| 1473 | CFLAGS=$safe_CFLAGS |
| 1474 | |
| 1475 | |
sewardj | d364580 | 2010-06-13 22:13:58 +0000 | [diff] [blame] | 1476 | # does the linker support -Wl,--build-id=none ? Note, it's |
| 1477 | # important that we test indirectly via whichever C compiler |
| 1478 | # is selected, rather than testing /usr/bin/ld or whatever |
| 1479 | # directly. |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1480 | |
sewardj | d364580 | 2010-06-13 22:13:58 +0000 | [diff] [blame] | 1481 | AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1482 | |
| 1483 | safe_CFLAGS=$CFLAGS |
| 1484 | CFLAGS="-Wl,--build-id=none" |
| 1485 | |
bart | 8508c75 | 2010-06-10 06:26:21 +0000 | [diff] [blame] | 1486 | AC_LINK_IFELSE( |
| 1487 | [AC_LANG_PROGRAM([ ], [return 0;])], |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1488 | [ |
| 1489 | AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"]) |
| 1490 | AC_MSG_RESULT([yes]) |
| 1491 | ], [ |
| 1492 | AC_SUBST([FLAG_NO_BUILD_ID], [""]) |
| 1493 | AC_MSG_RESULT([no]) |
| 1494 | ]) |
| 1495 | CFLAGS=$safe_CFLAGS |
| 1496 | |
| 1497 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1498 | # does the ppc assembler support "mtocrf" et al? |
| 1499 | AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) |
| 1500 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1501 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | dd4cbe1 | 2006-03-12 17:27:44 +0000 | [diff] [blame] | 1502 | __asm__ __volatile__("mtocrf 4,0"); |
| 1503 | __asm__ __volatile__("mfocrf 0,4"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1504 | ]])], [ |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1505 | ac_have_as_ppc_mftocrf=yes |
| 1506 | AC_MSG_RESULT([yes]) |
| 1507 | ], [ |
| 1508 | ac_have_as_ppc_mftocrf=no |
| 1509 | AC_MSG_RESULT([no]) |
| 1510 | ]) |
| 1511 | if test x$ac_have_as_ppc_mftocrf = xyes ; then |
| 1512 | AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.]) |
| 1513 | fi |
| 1514 | |
| 1515 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 1516 | CFLAGS=$safe_CFLAGS |
| 1517 | |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1518 | # does the x86/amd64 assembler understand SSE3 instructions? |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1519 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1520 | # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1521 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3]) |
| 1522 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1523 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1524 | do { long long int x; |
| 1525 | __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); } |
| 1526 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1527 | ]])], [ |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1528 | ac_have_as_sse3=yes |
| 1529 | AC_MSG_RESULT([yes]) |
| 1530 | ], [ |
| 1531 | ac_have_as_sse3=no |
| 1532 | AC_MSG_RESULT([no]) |
| 1533 | ]) |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1534 | |
| 1535 | AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes) |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1536 | |
| 1537 | |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1538 | # Ditto for SSSE3 instructions (note extra S) |
| 1539 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1540 | # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's |
| 1541 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3]) |
| 1542 | |
florian | c443b96 | 2011-10-28 21:37:19 +0000 | [diff] [blame] | 1543 | save_CFLAGS="$CFLAGS" |
| 1544 | CFLAGS="$CFLAGS -msse" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1545 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1546 | do { long long int x; |
| 1547 | __asm__ __volatile__( |
| 1548 | "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); } |
| 1549 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1550 | ]])], [ |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1551 | ac_have_as_ssse3=yes |
| 1552 | AC_MSG_RESULT([yes]) |
| 1553 | ], [ |
| 1554 | ac_have_as_ssse3=no |
| 1555 | AC_MSG_RESULT([no]) |
| 1556 | ]) |
florian | c443b96 | 2011-10-28 21:37:19 +0000 | [diff] [blame] | 1557 | CFLAGS="$save_CFLAGS" |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1558 | |
| 1559 | AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) |
| 1560 | |
| 1561 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1562 | # does the x86/amd64 assembler understand the PCLMULQDQ instruction? |
| 1563 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1564 | # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 1565 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq']) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1566 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 1567 | do { |
| 1568 | __asm__ __volatile__( |
| 1569 | "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); } |
| 1570 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1571 | ]])], [ |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 1572 | ac_have_as_pclmulqdq=yes |
| 1573 | AC_MSG_RESULT([yes]) |
| 1574 | ], [ |
| 1575 | ac_have_as_pclmulqdq=no |
| 1576 | AC_MSG_RESULT([no]) |
| 1577 | ]) |
| 1578 | |
| 1579 | AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes) |
| 1580 | |
| 1581 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1582 | # does the x86/amd64 assembler understand the LZCNT instruction? |
| 1583 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1584 | # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 1585 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt']) |
| 1586 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1587 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 1588 | do { |
| 1589 | __asm__ __volatile__("lzcnt %rax,%rax"); |
| 1590 | } while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1591 | ]])], [ |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 1592 | ac_have_as_lzcnt=yes |
| 1593 | AC_MSG_RESULT([yes]) |
| 1594 | ], [ |
| 1595 | ac_have_as_lzcnt=no |
| 1596 | AC_MSG_RESULT([no]) |
| 1597 | ]) |
| 1598 | |
| 1599 | AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes]) |
| 1600 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1601 | |
| 1602 | # does the x86/amd64 assembler understand SSE 4.2 instructions? |
| 1603 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1604 | # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's |
| 1605 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2]) |
| 1606 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1607 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1608 | do { long long int x; |
| 1609 | __asm__ __volatile__( |
florian | fdfca22 | 2012-01-17 13:16:50 +0000 | [diff] [blame] | 1610 | "crc32q %%r15,%%r15" : : : "r15" ); |
| 1611 | __asm__ __volatile__( |
| 1612 | "pblendvb (%rcx), %xmm11"); } |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1613 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1614 | ]])], [ |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1615 | ac_have_as_sse42=yes |
| 1616 | AC_MSG_RESULT([yes]) |
| 1617 | ], [ |
| 1618 | ac_have_as_sse42=no |
| 1619 | AC_MSG_RESULT([no]) |
| 1620 | ]) |
| 1621 | |
| 1622 | AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes) |
| 1623 | |
| 1624 | |
sewardj | e089f01 | 2010-10-13 21:47:29 +0000 | [diff] [blame] | 1625 | # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this |
| 1626 | # when building the tool executables. I think we should get rid of it. |
| 1627 | # |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1628 | # Check for TLS support in the compiler and linker |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 1629 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 1630 | [[return foo;]])], |
| 1631 | [vg_cv_linktime_tls=yes], |
| 1632 | [vg_cv_linktime_tls=no]) |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 1633 | # Native compilation: check whether running a program using TLS succeeds. |
| 1634 | # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs |
| 1635 | # succeeds but running programs using TLS fails. |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 1636 | # Cross-compiling: check whether linking a program using TLS succeeds. |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 1637 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 1638 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 1639 | [vg_cv_tls=$enableval], |
| 1640 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 1641 | [[return foo;]])], |
| 1642 | [vg_cv_tls=yes], |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 1643 | [vg_cv_tls=no], |
| 1644 | [vg_cv_tls=$vg_cv_linktime_tls])])]) |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 1645 | |
| 1646 | if test "$vg_cv_tls" = yes; then |
| 1647 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 1648 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1649 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1650 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1651 | #---------------------------------------------------------------------------- |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 1652 | # Checks for C header files. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1653 | #---------------------------------------------------------------------------- |
| 1654 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1655 | AC_HEADER_STDC |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1656 | AC_CHECK_HEADERS([ \ |
bart | 1f2b143 | 2009-01-16 12:06:54 +0000 | [diff] [blame] | 1657 | asm/unistd.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1658 | endian.h \ |
| 1659 | mqueue.h \ |
| 1660 | sys/endian.h \ |
| 1661 | sys/epoll.h \ |
| 1662 | sys/eventfd.h \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 1663 | sys/klog.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1664 | sys/poll.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1665 | sys/signal.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1666 | sys/signalfd.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1667 | sys/syscall.h \ |
| 1668 | sys/time.h \ |
| 1669 | sys/types.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1670 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1671 | |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 1672 | # Verify whether the <linux/futex.h> header is usable. |
| 1673 | AC_MSG_CHECKING([if <linux/futex.h> is usable]) |
| 1674 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1675 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 1676 | #include <linux/futex.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1677 | ]], [[ |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 1678 | return FUTEX_WAIT; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1679 | ]])], [ |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 1680 | ac_have_usable_linux_futex_h=yes |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 1681 | AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1, |
| 1682 | [Define to 1 if you have a usable <linux/futex.h> header file.]) |
| 1683 | AC_MSG_RESULT([yes]) |
| 1684 | ], [ |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 1685 | ac_have_usable_linux_futex_h=no |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 1686 | AC_MSG_RESULT([no]) |
| 1687 | ]) |
| 1688 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1689 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1690 | # Checks for typedefs, structures, and compiler characteristics. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1691 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1692 | AC_TYPE_UID_T |
| 1693 | AC_TYPE_OFF_T |
| 1694 | AC_TYPE_SIZE_T |
| 1695 | AC_HEADER_TIME |
| 1696 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1697 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1698 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1699 | # Checks for library functions. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1700 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1701 | AC_FUNC_MEMCMP |
| 1702 | AC_FUNC_MMAP |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1703 | |
bart | 26288e4 | 2011-04-03 16:46:01 +0000 | [diff] [blame] | 1704 | AC_CHECK_LIB([pthread], [pthread_create]) |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1705 | AC_CHECK_LIB([rt], [clock_gettime]) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 1706 | |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1707 | AC_CHECK_FUNCS([ \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 1708 | clock_gettime\ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1709 | epoll_create \ |
| 1710 | epoll_pwait \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 1711 | klogctl \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1712 | mallinfo \ |
| 1713 | memchr \ |
| 1714 | memset \ |
| 1715 | mkdir \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 1716 | mremap \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1717 | ppoll \ |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 1718 | pthread_barrier_init \ |
| 1719 | pthread_condattr_setclock \ |
| 1720 | pthread_mutex_timedlock \ |
| 1721 | pthread_rwlock_timedrdlock \ |
| 1722 | pthread_rwlock_timedwrlock \ |
| 1723 | pthread_spin_lock \ |
bart | a72a27b | 2010-04-29 06:22:17 +0000 | [diff] [blame] | 1724 | pthread_yield \ |
bart | d1f724c | 2009-08-26 18:11:18 +0000 | [diff] [blame] | 1725 | readlinkat \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1726 | semtimedop \ |
| 1727 | signalfd \ |
njn | 6cc2247 | 2009-03-16 03:46:48 +0000 | [diff] [blame] | 1728 | sigwaitinfo \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1729 | strchr \ |
| 1730 | strdup \ |
| 1731 | strpbrk \ |
| 1732 | strrchr \ |
| 1733 | strstr \ |
bart | a72a27b | 2010-04-29 06:22:17 +0000 | [diff] [blame] | 1734 | syscall \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1735 | utimensat \ |
tom | 9e4b636 | 2012-02-10 09:39:37 +0000 | [diff] [blame] | 1736 | process_vm_readv \ |
| 1737 | process_vm_writev \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 1738 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1739 | |
bart | 623eec3 | 2008-07-29 17:54:49 +0000 | [diff] [blame] | 1740 | # AC_CHECK_LIB adds any library found to the variable LIBS, and links these |
| 1741 | # libraries with any shared object and/or executable. This is NOT what we |
| 1742 | # want for e.g. vgpreload_core-x86-linux.so |
| 1743 | LIBS="" |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1744 | |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 1745 | AM_CONDITIONAL([HAVE_PTHREAD_BARRIER], |
| 1746 | [test x$ac_cv_func_pthread_barrier_init = xyes]) |
bart | 2eaa8f2 | 2009-01-20 14:01:16 +0000 | [diff] [blame] | 1747 | AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK], |
| 1748 | [test x$ac_cv_func_pthread_mutex_timedlock = xyes]) |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 1749 | AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], |
| 1750 | [test x$ac_cv_func_pthread_spin_lock = xyes]) |
| 1751 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1752 | |
| 1753 | #---------------------------------------------------------------------------- |
| 1754 | # MPI checks |
| 1755 | #---------------------------------------------------------------------------- |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1756 | # Do we have a useable MPI setup on the primary and/or secondary targets? |
| 1757 | # On Linux, by default, assumes mpicc and -m32/-m64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1758 | # Note: this is a kludge in that it assumes the specified mpicc |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 1759 | # understands -m32/-m64 regardless of what is specified using |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1760 | # --with-mpicc=. |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1761 | MPI_CC="mpicc" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1762 | |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1763 | mflag_primary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1764 | if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 1765 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
| 1766 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1767 | mflag_primary=$FLAG_M32 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1768 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 1769 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ |
| 1770 | -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1771 | mflag_primary=$FLAG_M64 |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1772 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then |
| 1773 | mflag_primary="$FLAG_M32 -arch i386" |
| 1774 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then |
| 1775 | mflag_primary="$FLAG_M64 -arch x86_64" |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 1776 | fi |
| 1777 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1778 | mflag_secondary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1779 | if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
| 1780 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1781 | mflag_secondary=$FLAG_M32 |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1782 | elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then |
| 1783 | mflag_secondary="$FLAG_M32 -arch i386" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1784 | fi |
| 1785 | |
| 1786 | |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1787 | AC_ARG_WITH(mpicc, |
sewardj | b70a613 | 2006-05-27 21:14:09 +0000 | [diff] [blame] | 1788 | [ --with-mpicc= Specify name of MPI2-ised C compiler], |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1789 | MPI_CC=$withval |
| 1790 | ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1791 | AC_SUBST(MPI_CC) |
| 1792 | |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1793 | ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can |
| 1794 | ## use these values in the check for a functioning mpicc. |
| 1795 | ## |
| 1796 | ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that |
| 1797 | ## mflag_primary/mflag_secondary are sufficient approximations of that behavior |
| 1798 | AM_COND_IF([VGCONF_OS_IS_LINUX], |
| 1799 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic" |
| 1800 | LDFLAGS_MPI="-fpic -shared"]) |
| 1801 | AM_COND_IF([VGCONF_OS_IS_DARWIN], |
| 1802 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic" |
| 1803 | LDFLAGS_MPI="-dynamic -dynamiclib -all_load"]) |
| 1804 | |
| 1805 | AC_SUBST([CFLAGS_MPI]) |
| 1806 | AC_SUBST([LDFLAGS_MPI]) |
| 1807 | |
| 1808 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1809 | ## See if MPI_CC works for the primary target |
| 1810 | ## |
| 1811 | 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] | 1812 | saved_CC=$CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1813 | saved_CFLAGS=$CFLAGS |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1814 | CC=$MPI_CC |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1815 | CFLAGS="$CFLAGS_MPI $mflag_primary" |
| 1816 | saved_LDFLAGS="$LDFLAGS" |
| 1817 | LDFLAGS="$LDFLAGS_MPI $mflag_primary" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1818 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 1819 | #include <mpi.h> |
| 1820 | #include <stdio.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1821 | ]], [[ |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1822 | int ni, na, nd, comb; |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1823 | int r = MPI_Init(NULL,NULL); |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1824 | r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb ); |
| 1825 | r |= MPI_Finalize(); |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1826 | return r; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1827 | ]])], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1828 | ac_have_mpi2_pri=yes |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 1829 | AC_MSG_RESULT([yes, $MPI_CC]) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1830 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1831 | ac_have_mpi2_pri=no |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1832 | AC_MSG_RESULT([no]) |
| 1833 | ]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 1834 | CC=$saved_CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 1835 | CFLAGS=$saved_CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1836 | LDFLAGS="$saved_LDFLAGS" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1837 | AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1838 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1839 | ## See if MPI_CC works for the secondary target. Complication: what if |
| 1840 | ## there is no secondary target? We need this to then fail. |
| 1841 | ## Kludge this by making MPI_CC something which will surely fail in |
| 1842 | ## such a case. |
| 1843 | ## |
| 1844 | AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) |
| 1845 | saved_CC=$CC |
| 1846 | saved_CFLAGS=$CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1847 | saved_LDFLAGS="$LDFLAGS" |
| 1848 | LDFLAGS="$LDFLAGS_MPI $mflag_secondary" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1849 | if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1850 | CC="$MPI_CC this will surely fail" |
| 1851 | else |
| 1852 | CC=$MPI_CC |
| 1853 | fi |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1854 | CFLAGS="$CFLAGS_MPI $mflag_secondary" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1855 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1856 | #include <mpi.h> |
| 1857 | #include <stdio.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1858 | ]], [[ |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1859 | int ni, na, nd, comb; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1860 | int r = MPI_Init(NULL,NULL); |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1861 | r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb ); |
| 1862 | r |= MPI_Finalize(); |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1863 | return r; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1864 | ]])], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1865 | ac_have_mpi2_sec=yes |
| 1866 | AC_MSG_RESULT([yes, $MPI_CC]) |
| 1867 | ], [ |
| 1868 | ac_have_mpi2_sec=no |
| 1869 | AC_MSG_RESULT([no]) |
| 1870 | ]) |
| 1871 | CC=$saved_CC |
| 1872 | CFLAGS=$saved_CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame^] | 1873 | LDFLAGS="$saved_LDFLAGS" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1874 | AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 1875 | |
| 1876 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1877 | #---------------------------------------------------------------------------- |
| 1878 | # Other library checks |
| 1879 | #---------------------------------------------------------------------------- |
bart | 2ef12d4 | 2010-10-18 16:32:11 +0000 | [diff] [blame] | 1880 | # There now follow some tests for Boost, and OpenMP. These |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1881 | # tests are present because Drd has some regression tests that use |
| 1882 | # these packages. All regression test programs all compiled only |
| 1883 | # for the primary target. And so it is important that the configure |
| 1884 | # checks that follow, use the correct -m32 or -m64 flag for the |
| 1885 | # primary target (called $mflag_primary). Otherwise, we can end up |
| 1886 | # in a situation (eg) where, on amd64-linux, the test for Boost checks |
| 1887 | # for usable 64-bit Boost facilities, but because we are doing a 32-bit |
| 1888 | # only build (meaning, the primary target is x86-linux), the build |
| 1889 | # of the regtest programs that use Boost fails, because they are |
| 1890 | # build as 32-bit (IN THIS EXAMPLE). |
| 1891 | # |
| 1892 | # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES |
| 1893 | # NEEDED BY THE REGRESSION TEST PROGRAMS. |
| 1894 | |
| 1895 | |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1896 | # Check whether the boost library 1.35 or later has been installed. |
| 1897 | # The Boost.Threads library has undergone a major rewrite in version 1.35.0. |
| 1898 | |
| 1899 | AC_MSG_CHECKING([for boost]) |
| 1900 | |
| 1901 | AC_LANG(C++) |
| 1902 | safe_CXXFLAGS=$CXXFLAGS |
bart | 7129c72 | 2012-04-18 18:34:22 +0000 | [diff] [blame] | 1903 | CXXFLAGS="$mflag_primary" |
| 1904 | safe_LIBS="$LIBS" |
| 1905 | LIBS="-lboost_thread-mt $LIBS" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1906 | |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 1907 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1908 | #include <boost/thread.hpp> |
| 1909 | static void thread_func(void) |
| 1910 | { } |
| 1911 | int main(int argc, char** argv) |
| 1912 | { |
| 1913 | boost::thread t(thread_func); |
| 1914 | return 0; |
| 1915 | } |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 1916 | ])], |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1917 | [ |
| 1918 | ac_have_boost_1_35=yes |
| 1919 | AC_SUBST([BOOST_CFLAGS], []) |
bart | bb31f2d | 2012-04-18 18:42:34 +0000 | [diff] [blame] | 1920 | AC_SUBST([BOOST_LIBS], [-lboost_thread-mt]) |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1921 | AC_MSG_RESULT([yes]) |
| 1922 | ], [ |
| 1923 | ac_have_boost_1_35=no |
| 1924 | AC_MSG_RESULT([no]) |
| 1925 | ]) |
| 1926 | |
bart | 7129c72 | 2012-04-18 18:34:22 +0000 | [diff] [blame] | 1927 | LIBS="$safe_LIBS" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1928 | CXXFLAGS=$safe_CXXFLAGS |
| 1929 | AC_LANG(C) |
| 1930 | |
| 1931 | AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes]) |
| 1932 | |
| 1933 | |
| 1934 | # does this compiler support -fopenmp, does it have the include file |
| 1935 | # <omp.h> and does it have libgomp ? |
| 1936 | |
| 1937 | AC_MSG_CHECKING([for OpenMP]) |
| 1938 | |
| 1939 | safe_CFLAGS=$CFLAGS |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1940 | CFLAGS="-fopenmp $mflag_primary" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1941 | |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 1942 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1943 | #include <omp.h> |
| 1944 | int main(int argc, char** argv) |
| 1945 | { |
| 1946 | omp_set_dynamic(0); |
| 1947 | return 0; |
| 1948 | } |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 1949 | ])], |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 1950 | [ |
| 1951 | ac_have_openmp=yes |
| 1952 | AC_MSG_RESULT([yes]) |
| 1953 | ], [ |
| 1954 | ac_have_openmp=no |
| 1955 | AC_MSG_RESULT([no]) |
| 1956 | ]) |
| 1957 | CFLAGS=$safe_CFLAGS |
| 1958 | |
| 1959 | AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) |
| 1960 | |
| 1961 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 1962 | # does this compiler have built-in functions for atomic memory access for the |
| 1963 | # primary target ? |
| 1964 | 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] | 1965 | |
| 1966 | safe_CFLAGS=$CFLAGS |
| 1967 | CFLAGS="$mflag_primary" |
| 1968 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1969 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1970 | int variable = 1; |
| 1971 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 1972 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1973 | ]])], [ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 1974 | ac_have_builtin_atomic_primary=yes |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1975 | AC_MSG_RESULT([yes]) |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 1976 | 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] | 1977 | ], [ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 1978 | ac_have_builtin_atomic_primary=no |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 1979 | AC_MSG_RESULT([no]) |
| 1980 | ]) |
| 1981 | |
| 1982 | CFLAGS=$safe_CFLAGS |
| 1983 | |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 1984 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], |
| 1985 | [test x$ac_have_builtin_atomic_primary = xyes]) |
bart | c82d137 | 2009-05-31 16:21:23 +0000 | [diff] [blame] | 1986 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 1987 | |
| 1988 | # does this compiler have built-in functions for atomic memory access for the |
| 1989 | # secondary target ? |
| 1990 | |
| 1991 | if test x$VGCONF_PLATFORM_SEC_CAPS != x; then |
| 1992 | |
| 1993 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target]) |
| 1994 | |
| 1995 | safe_CFLAGS=$CFLAGS |
| 1996 | CFLAGS="$mflag_secondary" |
| 1997 | |
| 1998 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1999 | int variable = 1; |
| 2000 | return (__sync_add_and_fetch(&variable, 1) ? 1 : 0) |
| 2001 | ]])], [ |
| 2002 | ac_have_builtin_atomic_secondary=yes |
| 2003 | AC_MSG_RESULT([yes]) |
| 2004 | ], [ |
| 2005 | ac_have_builtin_atomic_secondary=no |
| 2006 | AC_MSG_RESULT([no]) |
| 2007 | ]) |
| 2008 | |
| 2009 | CFLAGS=$safe_CFLAGS |
| 2010 | |
| 2011 | fi |
| 2012 | |
| 2013 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY], |
| 2014 | [test x$ac_have_builtin_atomic_secondary = xyes]) |
| 2015 | |
bart | 1e856ea | 2011-12-17 12:53:23 +0000 | [diff] [blame] | 2016 | # does this compiler have built-in functions for atomic memory access on |
| 2017 | # 64-bit integers for all targets ? |
| 2018 | |
| 2019 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets]) |
| 2020 | |
| 2021 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2022 | #include <stdint.h> |
| 2023 | ]], [[ |
| 2024 | uint64_t variable = 1; |
| 2025 | return __sync_add_and_fetch(&variable, 1) |
| 2026 | ]])], [ |
| 2027 | ac_have_builtin_atomic64_primary=yes |
| 2028 | ], [ |
| 2029 | ac_have_builtin_atomic64_primary=no |
| 2030 | ]) |
| 2031 | |
| 2032 | if test x$VGCONF_PLATFORM_SEC_CAPS != x; then |
| 2033 | |
| 2034 | safe_CFLAGS=$CFLAGS |
| 2035 | CFLAGS="$mflag_secondary" |
| 2036 | |
| 2037 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2038 | #include <stdint.h> |
| 2039 | ]], [[ |
| 2040 | uint64_t variable = 1; |
| 2041 | return __sync_add_and_fetch(&variable, 1) |
| 2042 | ]])], [ |
| 2043 | ac_have_builtin_atomic64_secondary=yes |
| 2044 | ], [ |
| 2045 | ac_have_builtin_atomic64_secondary=no |
| 2046 | ]) |
| 2047 | |
| 2048 | CFLAGS=$safe_CFLAGS |
| 2049 | |
| 2050 | fi |
| 2051 | |
| 2052 | if test x$ac_have_builtin_atomic64_primary = xyes && \ |
| 2053 | test x$VGCONF_PLATFORM_SEC_CAPS = x \ |
| 2054 | -o x$ac_have_builtin_atomic64_secondary = xyes; then |
| 2055 | AC_MSG_RESULT([yes]) |
| 2056 | ac_have_builtin_atomic64=yes |
| 2057 | else |
| 2058 | AC_MSG_RESULT([no]) |
| 2059 | ac_have_builtin_atomic64=no |
| 2060 | fi |
| 2061 | |
| 2062 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64], |
| 2063 | [test x$ac_have_builtin_atomic64 = xyes]) |
| 2064 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2065 | |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2066 | # does g++ have built-in functions for atomic memory access ? |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2067 | AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch]) |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2068 | |
| 2069 | safe_CXXFLAGS=$CXXFLAGS |
| 2070 | CXXFLAGS="$mflag_primary" |
| 2071 | |
| 2072 | AC_LANG_PUSH(C++) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2073 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2074 | int variable = 1; |
| 2075 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 2076 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2077 | ]])], [ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2078 | ac_have_builtin_atomic_cxx=yes |
| 2079 | AC_MSG_RESULT([yes]) |
| 2080 | 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] | 2081 | ], [ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2082 | ac_have_builtin_atomic_cxx=no |
| 2083 | AC_MSG_RESULT([no]) |
| 2084 | ]) |
| 2085 | AC_LANG_POP(C++) |
| 2086 | |
| 2087 | CXXFLAGS=$safe_CXXFLAGS |
| 2088 | |
| 2089 | 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] | 2090 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2091 | |
| 2092 | if test x$ac_have_usable_linux_futex_h = xyes \ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 2093 | -a x$ac_have_builtin_atomic_primary = xyes; then |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2094 | ac_enable_linux_ticket_lock_primary=yes |
| 2095 | fi |
| 2096 | AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY], |
| 2097 | [test x$ac_enable_linux_ticket_lock_primary = xyes]) |
| 2098 | |
| 2099 | if test x$VGCONF_PLATFORM_SEC_CAPS != x \ |
| 2100 | -a x$ac_have_usable_linux_futex_h = xyes \ |
| 2101 | -a x$ac_have_builtin_atomic_secondary = xyes; then |
| 2102 | ac_enable_linux_ticket_lock_secondary=yes |
| 2103 | fi |
| 2104 | AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY], |
| 2105 | [test x$ac_enable_linux_ticket_lock_secondary = xyes]) |
| 2106 | |
| 2107 | |
bart | f68af88 | 2011-12-10 19:42:05 +0000 | [diff] [blame] | 2108 | # does libstdc++ support annotating shared pointers ? |
| 2109 | AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers]) |
| 2110 | |
| 2111 | safe_CXXFLAGS=$CFLAGS |
| 2112 | CXXFLAGS="-std=c++0x" |
| 2113 | |
| 2114 | AC_LANG_PUSH(C++) |
| 2115 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2116 | #include <memory> |
| 2117 | ]], [[ |
| 2118 | std::shared_ptr<int> p |
| 2119 | ]])], [ |
| 2120 | ac_have_shared_ptr=yes |
| 2121 | ], [ |
| 2122 | ac_have_shared_ptr=no |
| 2123 | ]) |
| 2124 | if test x$ac_have_shared_ptr = xyes; then |
| 2125 | # If compilation of the program below fails because of a syntax error |
| 2126 | # triggered by substituting one of the annotation macros then that |
| 2127 | # means that libstdc++ supports these macros. |
| 2128 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2129 | #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)---- |
| 2130 | #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)---- |
| 2131 | #include <memory> |
| 2132 | ]], [[ |
| 2133 | std::shared_ptr<int> p |
| 2134 | ]])], [ |
| 2135 | ac_have_shared_pointer_annotation=no |
| 2136 | AC_MSG_RESULT([no]) |
| 2137 | ], [ |
| 2138 | ac_have_shared_pointer_annotation=yes |
| 2139 | AC_MSG_RESULT([yes]) |
| 2140 | AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1, |
| 2141 | [Define to 1 if libstd++ supports annotating shared pointers]) |
| 2142 | ]) |
| 2143 | else |
| 2144 | ac_have_shared_pointer_annotation=no |
| 2145 | AC_MSG_RESULT([no]) |
| 2146 | fi |
| 2147 | AC_LANG_POP(C++) |
| 2148 | |
| 2149 | CXXFLAGS=$safe_CXXFLAGS |
| 2150 | |
| 2151 | AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION], |
| 2152 | [test x$ac_have_shared_pointer_annotation = xyes]) |
| 2153 | |
| 2154 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2155 | #---------------------------------------------------------------------------- |
| 2156 | # Ok. We're done checking. |
| 2157 | #---------------------------------------------------------------------------- |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2158 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2159 | # Nb: VEX/Makefile is generated from Makefile.vex.in. |
| 2160 | AC_CONFIG_FILES([ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2161 | Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2162 | VEX/Makefile:Makefile.vex.in |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2163 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 2164 | valgrind.pc |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 2165 | glibc-2.X.supp |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 2166 | docs/Makefile |
| 2167 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 2168 | tests/vg_regtest |
njn | ec0c27a | 2005-12-10 23:11:28 +0000 | [diff] [blame] | 2169 | perf/Makefile |
| 2170 | perf/vg_perf |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 2171 | gdbserver_tests/Makefile |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 2172 | include/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 2173 | auxprogs/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2174 | mpi/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 2175 | coregrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2176 | memcheck/Makefile |
| 2177 | memcheck/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2178 | memcheck/tests/amd64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2179 | memcheck/tests/x86/Makefile |
njn | 3b3b76d | 2009-01-19 03:44:19 +0000 | [diff] [blame] | 2180 | memcheck/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 2181 | memcheck/tests/darwin/Makefile |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 2182 | memcheck/tests/amd64-linux/Makefile |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 2183 | memcheck/tests/x86-linux/Makefile |
sewardj | 0e342a0 | 2010-09-03 23:49:33 +0000 | [diff] [blame] | 2184 | memcheck/tests/ppc32/Makefile |
| 2185 | memcheck/tests/ppc64/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2186 | cachegrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2187 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2188 | cachegrind/tests/x86/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 2189 | cachegrind/cg_annotate |
njn | 69d495d | 2010-06-30 05:23:34 +0000 | [diff] [blame] | 2190 | cachegrind/cg_diff |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 2191 | callgrind/Makefile |
| 2192 | callgrind/callgrind_annotate |
| 2193 | callgrind/callgrind_control |
| 2194 | callgrind/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2195 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 2196 | helgrind/tests/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 2197 | massif/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 2198 | massif/tests/Makefile |
njn | d5a8d24 | 2007-11-02 20:44:57 +0000 | [diff] [blame] | 2199 | massif/ms_print |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2200 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 2201 | lackey/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2202 | none/Makefile |
| 2203 | none/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2204 | none/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 2205 | none/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 2206 | none/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2207 | none/tests/x86/Makefile |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 2208 | none/tests/arm/Makefile |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 2209 | none/tests/s390x/Makefile |
njn | 0458a12 | 2009-02-13 06:23:46 +0000 | [diff] [blame] | 2210 | none/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 2211 | none/tests/darwin/Makefile |
njn | 06ca332 | 2009-04-15 23:10:04 +0000 | [diff] [blame] | 2212 | none/tests/x86-linux/Makefile |
sewardj | d2f95a0 | 2011-05-11 16:04:28 +0000 | [diff] [blame] | 2213 | exp-sgcheck/Makefile |
| 2214 | exp-sgcheck/tests/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 2215 | drd/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 2216 | drd/scripts/download-and-build-splash2 |
| 2217 | drd/tests/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 2218 | exp-bbv/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 2219 | exp-bbv/tests/Makefile |
| 2220 | exp-bbv/tests/x86/Makefile |
| 2221 | exp-bbv/tests/x86-linux/Makefile |
| 2222 | exp-bbv/tests/amd64-linux/Makefile |
| 2223 | exp-bbv/tests/ppc32-linux/Makefile |
vince | 226e078 | 2010-01-06 15:22:11 +0000 | [diff] [blame] | 2224 | exp-bbv/tests/arm-linux/Makefile |
sewardj | 4d7d8f5 | 2010-10-12 10:09:15 +0000 | [diff] [blame] | 2225 | exp-dhat/Makefile |
| 2226 | exp-dhat/tests/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2227 | ]) |
sewardj | d364580 | 2010-06-13 22:13:58 +0000 | [diff] [blame] | 2228 | AC_CONFIG_FILES([coregrind/link_tool_exe_linux], |
| 2229 | [chmod +x coregrind/link_tool_exe_linux]) |
| 2230 | AC_CONFIG_FILES([coregrind/link_tool_exe_darwin], |
| 2231 | [chmod +x coregrind/link_tool_exe_darwin]) |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2232 | AC_OUTPUT |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 2233 | |
| 2234 | cat<<EOF |
| 2235 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 2236 | Maximum build arch: ${ARCH_MAX} |
| 2237 | Primary build arch: ${VGCONF_ARCH_PRI} |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 2238 | Secondary build arch: ${VGCONF_ARCH_SEC} |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 2239 | Build OS: ${VGCONF_OS} |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2240 | Primary build target: ${VGCONF_PLATFORM_PRI_CAPS} |
| 2241 | Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS} |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 2242 | Platform variant: ${VGCONF_PLATVARIANT} |
| 2243 | Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1 |
sewardj | e95d94f | 2008-09-19 09:02:19 +0000 | [diff] [blame] | 2244 | Default supp files: ${DEFAULT_SUPP} |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 2245 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 2246 | EOF |