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