sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1 | |
| 2 | ##------------------------------------------------------------## |
| 3 | # |
| 4 | # The multiple-architecture stuff in this file is pretty |
| 5 | # cryptic. Read docs/internals/multiple-architectures.txt |
| 6 | # for at least a partial explanation of what is going on. |
| 7 | # |
| 8 | ##------------------------------------------------------------## |
| 9 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 10 | # Process this file with autoconf to produce a configure script. |
sewardj | a19c818 | 2014-09-12 09:31:13 +0000 | [diff] [blame] | 11 | AC_INIT([Valgrind],[3.11.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]) |
sewardj | f9a698e | 2013-09-02 12:44:52 +0000 | [diff] [blame] | 14 | AM_INIT_AUTOMAKE([foreign subdir-objects]) |
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 | #---------------------------------------------------------------------------- |
florian | 26a790a | 2014-12-03 22:53:00 +0000 | [diff] [blame] | 19 | # Do NOT modify these flags here. Except in feature tests in which case |
| 20 | # the original values must be properly restored. |
| 21 | #---------------------------------------------------------------------------- |
| 22 | CFLAGS="$CFLAGS" |
| 23 | CXXFLAGS="$CXXFLAGS" |
| 24 | |
| 25 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 26 | # Checks for various programs. |
| 27 | #---------------------------------------------------------------------------- |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 28 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 29 | AC_PROG_LN_S |
| 30 | AC_PROG_CC |
bart | 0affa49 | 2008-03-18 17:53:09 +0000 | [diff] [blame] | 31 | AM_PROG_CC_C_O |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 32 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 33 | AC_PROG_CXX |
njn | 629a5ec | 2009-07-14 01:29:39 +0000 | [diff] [blame] | 34 | # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with |
| 35 | # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code |
| 36 | # base (eg. most likely as Darwin-specific tests) we'll need one of the |
| 37 | # following: |
njn | 0cd2689 | 2009-07-12 23:07:13 +0000 | [diff] [blame] | 38 | # - put AC_PROG_OBJC in a Darwin-specific part of this file |
| 39 | # - Use AC_PROG_OBJC here and up the minimum autoconf version |
| 40 | # - Use the following, which is apparently equivalent: |
| 41 | # m4_ifdef([AC_PROG_OBJC], |
| 42 | # [AC_PROG_OBJC], |
| 43 | # [AC_CHECK_TOOL([OBJC], [gcc]) |
| 44 | # AC_SUBST([OBJC]) |
| 45 | # AC_SUBST([OBJCFLAGS]) |
| 46 | # ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 47 | AC_PROG_RANLIB |
bart | 07de2c9 | 2010-05-29 06:44:28 +0000 | [diff] [blame] | 48 | # provide a very basic definition for AC_PROG_SED if it's not provided by |
| 49 | # autoconf (as e.g. in autoconf 2.59). |
| 50 | m4_ifndef([AC_PROG_SED], |
| 51 | [AC_DEFUN([AC_PROG_SED], |
| 52 | [AC_ARG_VAR([SED]) |
| 53 | AC_CHECK_PROGS([SED],[gsed sed])])]) |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 54 | AC_PROG_SED |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 55 | |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 56 | # If no AR variable was specified, look up the name of the archiver. Otherwise |
| 57 | # do not touch the AR variable. |
| 58 | if test "x$AR" = "x"; then |
bart | 07de2c9 | 2010-05-29 06:44:28 +0000 | [diff] [blame] | 59 | AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar]) |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 60 | fi |
| 61 | AC_ARG_VAR([AR],[Archiver command]) |
| 62 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 63 | # Check for the compiler support |
| 64 | if test "${GCC}" != "yes" ; then |
| 65 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 66 | fi |
| 67 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 68 | # figure out where perl lives |
| 69 | AC_PATH_PROG(PERL, perl) |
| 70 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 71 | # figure out where gdb lives |
sewardj | f8722ca | 2008-11-17 00:20:45 +0000 | [diff] [blame] | 72 | AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time") |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 73 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB]) |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 74 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 75 | # some older automake's don't have it so try something on our own |
| 76 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 77 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 78 | AS="${CC}" |
| 79 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 80 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 81 | ASFLAGS="" |
| 82 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 83 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 84 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 85 | |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 86 | # Check if 'diff' supports -u (universal diffs) and use it if possible. |
| 87 | |
| 88 | AC_MSG_CHECKING([for diff -u]) |
| 89 | AC_SUBST(DIFF) |
| 90 | |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 91 | # Comparing two identical files results in 0. |
njn | 31f665e | 2009-02-26 21:25:50 +0000 | [diff] [blame] | 92 | tmpfile="tmp-xxx-yyy-zzz" |
| 93 | touch $tmpfile; |
| 94 | if diff -u $tmpfile $tmpfile ; then |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 95 | AC_MSG_RESULT([yes]) |
| 96 | DIFF="diff -u" |
| 97 | else |
| 98 | AC_MSG_RESULT([no]) |
| 99 | DIFF="diff" |
| 100 | fi |
njn | 31f665e | 2009-02-26 21:25:50 +0000 | [diff] [blame] | 101 | rm $tmpfile |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 102 | |
| 103 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 104 | # We don't want gcc < 3.0 |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 105 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 106 | |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 107 | # Obtain the compiler version. |
sewardj | a8ca2c5 | 2011-09-29 18:18:37 +0000 | [diff] [blame] | 108 | # |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 109 | # A few examples of how the ${CC} --version output looks like: |
| 110 | # |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 111 | # ######## gcc variants ######## |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 112 | # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2 |
| 113 | # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2 |
| 114 | # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585] |
| 115 | # Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2 |
bart | c521406 | 2012-01-11 11:34:23 +0000 | [diff] [blame] | 116 | # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3 |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 117 | # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) |
| 118 | # OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 119 | # |
| 120 | # ######## clang variants ######## |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 121 | # Clang: clang version 2.9 (tags/RELEASE_29/final) |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 122 | # Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) |
| 123 | # FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 |
sewardj | a8ca2c5 | 2011-09-29 18:18:37 +0000 | [diff] [blame] | 124 | # |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 125 | # ######## Apple LLVM variants ######## |
| 126 | # Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) |
| 127 | # Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) |
| 128 | # |
bart | c521406 | 2012-01-11 11:34:23 +0000 | [diff] [blame] | 129 | [ |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 130 | if test "x`${CC} --version | $SED -n -e 's/.*\Apple \(LLVM\) version.*clang.*/\1/p'`" = "xLLVM" ; |
| 131 | then |
| 132 | is_clang="applellvm" |
| 133 | gcc_version=`${CC} --version | $SED -n -e 's/.*LLVM version \([0-9.]*\).*$/\1/p'` |
| 134 | elif test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ; |
| 135 | then |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 136 | is_clang="clang" |
| 137 | # Don't use -dumpversion with clang: it will always produce "4.2.1". |
| 138 | gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'` |
florian | 31556c3 | 2015-01-05 14:28:46 +0000 | [diff] [blame] | 139 | elif test "x`${CC} --version | $SED -n -e 's/icc.*\(ICC\).*/\1/p'`" = "xICC" ; |
| 140 | then |
florian | 4e94bda | 2014-10-29 13:57:49 +0000 | [diff] [blame] | 141 | is_clang="icc" |
florian | 31556c3 | 2015-01-05 14:28:46 +0000 | [diff] [blame] | 142 | gcc_version=`${CC} -dumpversion 2>/dev/null` |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 143 | else |
| 144 | is_clang="notclang" |
| 145 | gcc_version=`${CC} -dumpversion 2>/dev/null` |
| 146 | if test "x$gcc_version" = x; then |
| 147 | gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'` |
| 148 | fi |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 149 | fi |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 150 | ] |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 151 | AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm) |
florian | 4e94bda | 2014-10-29 13:57:49 +0000 | [diff] [blame] | 152 | AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc) |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 153 | |
bart | fec2447 | 2014-09-13 09:42:29 +0000 | [diff] [blame] | 154 | # Note: m4 arguments are quoted with [ and ] so square brackets in shell |
| 155 | # statements have to be quoted. |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 156 | case "${is_clang}-${gcc_version}" in |
rhyskidd | 9090d2f | 2015-07-08 13:46:57 +0000 | [diff] [blame] | 157 | applellvm-5.1|applellvm-6.*|applellvm-7.*) |
sewardj | c754e68 | 2014-10-13 13:03:50 +0000 | [diff] [blame] | 158 | AC_MSG_RESULT([ok (Apple LLVM version ${gcc_version})]) |
| 159 | ;; |
florian | 31556c3 | 2015-01-05 14:28:46 +0000 | [diff] [blame] | 160 | icc-1[[3-9]].*) |
florian | 4e94bda | 2014-10-29 13:57:49 +0000 | [diff] [blame] | 161 | AC_MSG_RESULT([ok (ICC version ${gcc_version})]) |
| 162 | ;; |
bart | fec2447 | 2014-09-13 09:42:29 +0000 | [diff] [blame] | 163 | notclang-[[3-9]].*|notclang-[[1-9][0-9]]*) |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 164 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 165 | ;; |
bart | fec2447 | 2014-09-13 09:42:29 +0000 | [diff] [blame] | 166 | clang-2.9|clang-[[3-9]].*|clang-[[1-9][0-9]]*) |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 167 | AC_MSG_RESULT([ok (clang-${gcc_version})]) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 168 | ;; |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 169 | *) |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 170 | AC_MSG_RESULT([no (${gcc_version})]) |
florian | 4e94bda | 2014-10-29 13:57:49 +0000 | [diff] [blame] | 171 | AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0]) |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 172 | ;; |
| 173 | esac |
| 174 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 175 | #---------------------------------------------------------------------------- |
| 176 | # Arch/OS/platform tests. |
| 177 | #---------------------------------------------------------------------------- |
| 178 | # We create a number of arch/OS/platform-related variables. We prefix them |
| 179 | # all with "VGCONF_" which indicates that they are defined at |
| 180 | # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_* |
| 181 | # variables used when compiling C files. |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 182 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 183 | AC_CANONICAL_HOST |
| 184 | |
| 185 | AC_MSG_CHECKING([for a supported CPU]) |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 186 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 187 | # ARCH_MAX reflects the most that this CPU can do: for example if it |
| 188 | # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32. |
| 189 | # Ditto for amd64. It is used for more configuration below, but is not used |
| 190 | # outside this file. |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 191 | # |
| 192 | # Power PC returns powerpc for Big Endian. This was not changed when Little |
| 193 | # Endian support was added to the 64-bit architecture. The 64-bit Little |
| 194 | # Endian systems explicitly state le in the host_cpu. For clarity in the |
| 195 | # Valgrind code, the ARCH_MAX name will state LE or BE for the endianess of |
| 196 | # the 64-bit system. Big Endian is the only mode supported on 32-bit Power PC. |
| 197 | # The abreviation PPC or ppc refers to 32-bit and 64-bit systems with either |
| 198 | # Endianess. The name PPC64 or ppc64 to 64-bit systems of either Endianess. |
| 199 | # The names ppc64be or PPC64BE refer to only 64-bit systems that are Big |
| 200 | # Endian. Similarly, ppc64le or PPC64LE refer to only 64-bit systems that are |
| 201 | # Little Endian. |
| 202 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 203 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 204 | i?86) |
| 205 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 206 | ARCH_MAX="x86" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 207 | ;; |
| 208 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 209 | x86_64) |
| 210 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 211 | ARCH_MAX="amd64" |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 212 | ;; |
| 213 | |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 214 | powerpc64) |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 215 | # this only referrs to 64-bit Big Endian |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 216 | AC_MSG_RESULT([ok (${host_cpu})]) |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 217 | ARCH_MAX="ppc64be" |
| 218 | ;; |
| 219 | |
| 220 | powerpc64le) |
| 221 | # this only referrs to 64-bit Little Endian |
| 222 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 223 | ARCH_MAX="ppc64le" |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 224 | ;; |
| 225 | |
| 226 | powerpc) |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 227 | # On Linux this means only a 32-bit capable CPU. |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 228 | AC_MSG_RESULT([ok (${host_cpu})]) |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 229 | ARCH_MAX="ppc32" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 230 | ;; |
| 231 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 232 | s390x) |
| 233 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 234 | ARCH_MAX="s390x" |
| 235 | ;; |
| 236 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 237 | armv7*) |
| 238 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 239 | ARCH_MAX="arm" |
| 240 | ;; |
| 241 | |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 242 | aarch64*) |
| 243 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 244 | ARCH_MAX="arm64" |
| 245 | ;; |
| 246 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 247 | mips) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 248 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 249 | ARCH_MAX="mips32" |
| 250 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 251 | |
| 252 | mipsel) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 253 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 254 | ARCH_MAX="mips32" |
| 255 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 256 | |
| 257 | mipsisa32r2) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 258 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 259 | ARCH_MAX="mips32" |
| 260 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 261 | |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 262 | mips64*) |
| 263 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 264 | ARCH_MAX="mips64" |
| 265 | ;; |
| 266 | |
| 267 | mipsisa64*) |
| 268 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 269 | ARCH_MAX="mips64" |
| 270 | ;; |
sewardj | 112711a | 2015-04-10 12:30:09 +0000 | [diff] [blame] | 271 | |
| 272 | tilegx) |
| 273 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 274 | ARCH_MAX="tilegx" |
| 275 | ;; |
| 276 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 277 | *) |
| 278 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 279 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 280 | ;; |
| 281 | esac |
| 282 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 283 | #---------------------------------------------------------------------------- |
| 284 | |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 285 | # Sometimes it's convenient to subvert the bi-arch build system and |
| 286 | # just have a single build even though the underlying platform is |
| 287 | # capable of both. Hence handle --enable-only64bit and |
| 288 | # --enable-only32bit. Complain if both are issued :-) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 289 | # [Actually, if either of these options are used, I think both get built, |
| 290 | # but only one gets installed. So if you use an in-place build, both can be |
| 291 | # used. --njn] |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 292 | |
| 293 | # Check if a 64-bit only build has been requested |
| 294 | AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, |
| 295 | [AC_ARG_ENABLE(only64bit, |
| 296 | [ --enable-only64bit do a 64-bit only build], |
| 297 | [vg_cv_only64bit=$enableval], |
| 298 | [vg_cv_only64bit=no])]) |
| 299 | |
| 300 | # Check if a 32-bit only build has been requested |
| 301 | AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit, |
| 302 | [AC_ARG_ENABLE(only32bit, |
| 303 | [ --enable-only32bit do a 32-bit only build], |
| 304 | [vg_cv_only32bit=$enableval], |
| 305 | [vg_cv_only32bit=no])]) |
| 306 | |
| 307 | # Stay sane |
| 308 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 309 | AC_MSG_ERROR( |
| 310 | [Nonsensical: both --enable-only64bit and --enable-only32bit.]) |
| 311 | fi |
| 312 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 313 | #---------------------------------------------------------------------------- |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 314 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 315 | # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to |
| 316 | # compilation of many C files via -VGO_$(VGCONF_OS) and |
| 317 | # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 318 | AC_MSG_CHECKING([for a supported OS]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 319 | AC_SUBST(VGCONF_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 320 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 321 | DEFAULT_SUPP="" |
| 322 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 323 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 324 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 325 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 326 | VGCONF_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 327 | |
| 328 | # Ok, this is linux. Check the kernel version |
| 329 | AC_MSG_CHECKING([for the kernel version]) |
| 330 | |
| 331 | kernel=`uname -r` |
| 332 | |
| 333 | case "${kernel}" in |
cborntra | 0e8dd91 | 2015-02-23 20:19:03 +0000 | [diff] [blame] | 334 | 0.*|1.*|2.0.*|2.1.*|2.2.*|2.3.*|2.4.*|2.5.*) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 335 | AC_MSG_RESULT([unsupported (${kernel})]) |
cborntra | 0e8dd91 | 2015-02-23 20:19:03 +0000 | [diff] [blame] | 336 | AC_MSG_ERROR([Valgrind needs a Linux kernel >= 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 337 | ;; |
cborntra | 0e8dd91 | 2015-02-23 20:19:03 +0000 | [diff] [blame] | 338 | |
| 339 | *) |
| 340 | AC_MSG_RESULT([2.6 or later (${kernel})]) |
| 341 | ;; |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 342 | esac |
| 343 | |
| 344 | ;; |
| 345 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 346 | *darwin*) |
| 347 | AC_MSG_RESULT([ok (${host_os})]) |
| 348 | VGCONF_OS="darwin" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 349 | AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5]) |
| 350 | AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6]) |
| 351 | AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7]) |
sewardj | ae284e5 | 2012-08-02 18:25:04 +0000 | [diff] [blame] | 352 | AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8]) |
sewardj | ec66ad5 | 2014-06-20 11:48:38 +0000 | [diff] [blame] | 353 | AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9]) |
sewardj | ac3afbd | 2014-11-06 20:16:05 +0000 | [diff] [blame] | 354 | AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10]) |
rhyskidd | 9090d2f | 2015-07-08 13:46:57 +0000 | [diff] [blame] | 355 | AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 356 | |
| 357 | AC_MSG_CHECKING([for the kernel version]) |
| 358 | kernel=`uname -r` |
| 359 | |
| 360 | # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin |
| 361 | # has only one relevant version, the OS version. The `uname` check |
| 362 | # 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] | 363 | # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard, |
| 364 | # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion), |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 365 | # 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] | 366 | # |
| 367 | # XXX: `uname -r` won't do the right thing for cross-compiles, but |
| 368 | # that's not a problem yet. |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 369 | # |
| 370 | # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work |
| 371 | # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0 |
| 372 | # on 10.6.8 and 10.7.1. Although tempted to delete the configure |
| 373 | # time support for 10.5 (the 9.* pattern just below), I'll leave it |
| 374 | # in for now, just in case anybody wants to give it a try. But I'm |
| 375 | # assuming that 3.7.0 is a Snow Leopard and Lion-only release. |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 376 | case "${kernel}" in |
| 377 | 9.*) |
| 378 | AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard]) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 379 | AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 380 | DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}" |
bart | 6ccda14 | 2009-07-23 07:37:32 +0000 | [diff] [blame] | 381 | DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 382 | ;; |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 383 | 10.*) |
| 384 | AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard]) |
| 385 | AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version]) |
| 386 | DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}" |
| 387 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 388 | ;; |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 389 | 11.*) |
| 390 | AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion]) |
| 391 | AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version]) |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 392 | DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}" |
| 393 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 394 | ;; |
sewardj | ae284e5 | 2012-08-02 18:25:04 +0000 | [diff] [blame] | 395 | 12.*) |
| 396 | AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion]) |
| 397 | AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version]) |
| 398 | DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}" |
| 399 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 400 | ;; |
sewardj | ec66ad5 | 2014-06-20 11:48:38 +0000 | [diff] [blame] | 401 | 13.*) |
| 402 | AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks]) |
| 403 | AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version]) |
| 404 | DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}" |
| 405 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 406 | ;; |
sewardj | ac3afbd | 2014-11-06 20:16:05 +0000 | [diff] [blame] | 407 | 14.*) |
| 408 | AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite]) |
| 409 | AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version]) |
| 410 | DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}" |
| 411 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 412 | ;; |
rhyskidd | 9090d2f | 2015-07-08 13:46:57 +0000 | [diff] [blame] | 413 | 15.*) |
| 414 | AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan]) |
| 415 | AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version]) |
| 416 | DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}" |
| 417 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 418 | ;; |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 419 | *) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 420 | AC_MSG_RESULT([unsupported (${kernel})]) |
rhyskidd | 9090d2f | 2015-07-08 13:46:57 +0000 | [diff] [blame] | 421 | AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x and 15.x (Mac OS X 10.6/7/8/9/10/11)]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 422 | ;; |
| 423 | esac |
| 424 | ;; |
| 425 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 426 | solaris2.11*) |
| 427 | AC_MSG_RESULT([ok (${host_os})]) |
| 428 | VGCONF_OS="solaris" |
| 429 | DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}" |
| 430 | ;; |
| 431 | |
| 432 | solaris2.12*) |
| 433 | AC_MSG_RESULT([ok (${host_os})]) |
| 434 | VGCONF_OS="solaris" |
| 435 | DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}" |
| 436 | ;; |
| 437 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 438 | *) |
| 439 | AC_MSG_RESULT([no (${host_os})]) |
njn | cc58cea | 2010-07-05 07:21:22 +0000 | [diff] [blame] | 440 | AC_MSG_ERROR([Valgrind is operating system specific. Sorry.]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 441 | ;; |
| 442 | esac |
| 443 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 444 | #---------------------------------------------------------------------------- |
| 445 | |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 446 | # If we are building on a 64 bit platform test to see if the system |
| 447 | # supports building 32 bit programs and disable 32 bit support if it |
| 448 | # does not support building 32 bit programs |
| 449 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 450 | case "$ARCH_MAX-$VGCONF_OS" in |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 451 | amd64-linux|ppc64be-linux|arm64-linux|amd64-solaris) |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 452 | AC_MSG_CHECKING([for 32 bit build support]) |
| 453 | safe_CFLAGS=$CFLAGS |
| 454 | CFLAGS="-m32" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 455 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 456 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 457 | ]])], [ |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 458 | AC_MSG_RESULT([yes]) |
| 459 | ], [ |
| 460 | vg_cv_only64bit="yes" |
| 461 | AC_MSG_RESULT([no]) |
| 462 | ]) |
| 463 | CFLAGS=$safe_CFLAGS;; |
| 464 | esac |
| 465 | |
| 466 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 467 | AC_MSG_ERROR( |
| 468 | [--enable-only32bit was specified but system does not support 32 bit builds]) |
| 469 | fi |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 470 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 471 | #---------------------------------------------------------------------------- |
| 472 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 473 | # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By |
| 474 | # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64 |
| 475 | # machine, but --enable-only32bit has been requested, then ARCH_MAX (see |
| 476 | # above) will be "amd64" since that reflects the most that this cpu can do, |
| 477 | # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the |
| 478 | # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 479 | # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and |
| 480 | # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). |
| 481 | AC_SUBST(VGCONF_ARCH_PRI) |
| 482 | |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 483 | # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86". |
| 484 | # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC) |
| 485 | # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target. |
| 486 | # It is empty if there is no secondary target. |
| 487 | AC_SUBST(VGCONF_ARCH_SEC) |
| 488 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 489 | # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX". |
| 490 | # The entire system, including regression and performance tests, will be |
| 491 | # built for this target. The "_CAPS" indicates that the name is in capital |
| 492 | # letters, and it also uses '_' rather than '-' as a separator, because it's |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 493 | # used to create various Makefile variables, which are all in caps by |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 494 | # convention and cannot contain '-' characters. This is in contrast to |
| 495 | # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 496 | AC_SUBST(VGCONF_PLATFORM_PRI_CAPS) |
| 497 | |
| 498 | # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one. |
| 499 | # Valgrind and tools will also be built for this target, but not the |
| 500 | # regression or performance tests. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 501 | # |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 502 | # By default, the primary arch is the same as the "max" arch, as commented |
| 503 | # above (at the definition of ARCH_MAX). We may choose to downgrade it in |
| 504 | # the big case statement just below here, in the case where we're building |
| 505 | # on a 64 bit machine but have been requested only to do a 32 bit build. |
| 506 | AC_SUBST(VGCONF_PLATFORM_SEC_CAPS) |
| 507 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 508 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 509 | |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 510 | # NB. The load address for a given platform may be specified in more |
| 511 | # than one place, in some cases, depending on whether we're doing a biarch, |
| 512 | # 32-bit only or 64-bit only build. eg see case for amd64-linux below. |
| 513 | # Be careful to give consistent values in all subcases. Also, all four |
| 514 | # valt_load_addres_{pri,sec}_{norml,inner} values must always be set, |
| 515 | # even if it is to "0xUNSET". |
| 516 | # |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 517 | case "$ARCH_MAX-$VGCONF_OS" in |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 518 | x86-linux) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 519 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 520 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 521 | VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" |
| 522 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 523 | valt_load_address_pri_norml="0x38000000" |
| 524 | valt_load_address_pri_inner="0x28000000" |
| 525 | valt_load_address_sec_norml="0xUNSET" |
| 526 | valt_load_address_sec_inner="0xUNSET" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 527 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 528 | ;; |
| 529 | amd64-linux) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 530 | valt_load_address_sec_norml="0xUNSET" |
| 531 | valt_load_address_sec_inner="0xUNSET" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 532 | if test x$vg_cv_only64bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 533 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 534 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 535 | VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" |
| 536 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 537 | valt_load_address_pri_norml="0x38000000" |
| 538 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 539 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 540 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 541 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 542 | VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" |
| 543 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 544 | valt_load_address_pri_norml="0x38000000" |
| 545 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 546 | else |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 547 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 548 | VGCONF_ARCH_SEC="x86" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 549 | VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" |
| 550 | VGCONF_PLATFORM_SEC_CAPS="X86_LINUX" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 551 | valt_load_address_pri_norml="0x38000000" |
| 552 | valt_load_address_pri_inner="0x28000000" |
| 553 | valt_load_address_sec_norml="0x38000000" |
| 554 | valt_load_address_sec_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 555 | fi |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 556 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 557 | ;; |
| 558 | ppc32-linux) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 559 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 560 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 561 | VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" |
| 562 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 563 | valt_load_address_pri_norml="0x38000000" |
| 564 | valt_load_address_pri_inner="0x28000000" |
| 565 | valt_load_address_sec_norml="0xUNSET" |
| 566 | valt_load_address_sec_inner="0xUNSET" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 567 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 568 | ;; |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 569 | ppc64be-linux) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 570 | valt_load_address_sec_norml="0xUNSET" |
| 571 | valt_load_address_sec_inner="0xUNSET" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 572 | if test x$vg_cv_only64bit = xyes; then |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 573 | VGCONF_ARCH_PRI="ppc64be" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 574 | VGCONF_ARCH_SEC="" |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 575 | VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 576 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 577 | valt_load_address_pri_norml="0x38000000" |
| 578 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 579 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 580 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 581 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 582 | VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" |
| 583 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 584 | valt_load_address_pri_norml="0x38000000" |
| 585 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 586 | else |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 587 | VGCONF_ARCH_PRI="ppc64be" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 588 | VGCONF_ARCH_SEC="ppc32" |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 589 | VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 590 | VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 591 | valt_load_address_pri_norml="0x38000000" |
| 592 | valt_load_address_pri_inner="0x28000000" |
| 593 | valt_load_address_sec_norml="0x38000000" |
| 594 | valt_load_address_sec_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 595 | fi |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 596 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 597 | ;; |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 598 | ppc64le-linux) |
| 599 | # Little Endian is only supported on PPC64 |
| 600 | valt_load_address_sec_norml="0xUNSET" |
| 601 | valt_load_address_sec_inner="0xUNSET" |
| 602 | VGCONF_ARCH_PRI="ppc64le" |
| 603 | VGCONF_ARCH_SEC="" |
| 604 | VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX" |
| 605 | VGCONF_PLATFORM_SEC_CAPS="" |
| 606 | valt_load_address_pri_norml="0x38000000" |
| 607 | valt_load_address_pri_inner="0x28000000" |
| 608 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 609 | ;; |
njn | cc58cea | 2010-07-05 07:21:22 +0000 | [diff] [blame] | 610 | # Darwin gets identified as 32-bit even when it supports 64-bit. |
| 611 | # (Not sure why, possibly because 'uname' returns "i386"?) Just about |
| 612 | # all Macs support both 32-bit and 64-bit, so we just build both. If |
| 613 | # someone has a really old 32-bit only machine they can (hopefully?) |
| 614 | # build with --enable-only32bit. See bug 243362. |
| 615 | x86-darwin|amd64-darwin) |
| 616 | ARCH_MAX="amd64" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 617 | valt_load_address_sec_norml="0xUNSET" |
| 618 | valt_load_address_sec_inner="0xUNSET" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 619 | if test x$vg_cv_only64bit = xyes; then |
| 620 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 621 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 622 | VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN" |
| 623 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 624 | valt_load_address_pri_norml="0x138000000" |
| 625 | valt_load_address_pri_inner="0x128000000" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 626 | elif test x$vg_cv_only32bit = xyes; then |
| 627 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 628 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 629 | VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN" |
| 630 | VGCONF_PLATFORM_SEC_CAPS="" |
| 631 | VGCONF_ARCH_PRI_CAPS="x86" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 632 | valt_load_address_pri_norml="0x38000000" |
| 633 | valt_load_address_pri_inner="0x28000000" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 634 | else |
| 635 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 636 | VGCONF_ARCH_SEC="x86" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 637 | VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN" |
| 638 | VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 639 | valt_load_address_pri_norml="0x138000000" |
| 640 | valt_load_address_pri_inner="0x128000000" |
| 641 | valt_load_address_sec_norml="0x38000000" |
| 642 | valt_load_address_sec_inner="0x28000000" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 643 | fi |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 644 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 645 | ;; |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 646 | arm-linux) |
| 647 | VGCONF_ARCH_PRI="arm" |
| 648 | VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX" |
| 649 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 650 | valt_load_address_pri_norml="0x38000000" |
| 651 | valt_load_address_pri_inner="0x28000000" |
| 652 | valt_load_address_sec_norml="0xUNSET" |
| 653 | valt_load_address_sec_inner="0xUNSET" |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 654 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 655 | ;; |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 656 | arm64-linux) |
| 657 | valt_load_address_sec_norml="0xUNSET" |
| 658 | valt_load_address_sec_inner="0xUNSET" |
| 659 | if test x$vg_cv_only64bit = xyes; then |
| 660 | VGCONF_ARCH_PRI="arm64" |
| 661 | VGCONF_ARCH_SEC="" |
| 662 | VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX" |
| 663 | VGCONF_PLATFORM_SEC_CAPS="" |
| 664 | valt_load_address_pri_norml="0x38000000" |
| 665 | valt_load_address_pri_inner="0x28000000" |
| 666 | elif test x$vg_cv_only32bit = xyes; then |
| 667 | VGCONF_ARCH_PRI="arm" |
| 668 | VGCONF_ARCH_SEC="" |
| 669 | VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX" |
| 670 | VGCONF_PLATFORM_SEC_CAPS="" |
| 671 | valt_load_address_pri_norml="0x38000000" |
| 672 | valt_load_address_pri_inner="0x28000000" |
| 673 | else |
| 674 | VGCONF_ARCH_PRI="arm64" |
| 675 | VGCONF_ARCH_SEC="arm" |
| 676 | VGCONF_PLATFORM_PRI_CAPS="ARM64_LINUX" |
| 677 | VGCONF_PLATFORM_SEC_CAPS="ARM_LINUX" |
| 678 | valt_load_address_pri_norml="0x38000000" |
| 679 | valt_load_address_pri_inner="0x28000000" |
| 680 | valt_load_address_sec_norml="0x38000000" |
| 681 | valt_load_address_sec_inner="0x28000000" |
| 682 | fi |
| 683 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 684 | ;; |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 685 | s390x-linux) |
| 686 | VGCONF_ARCH_PRI="s390x" |
| 687 | VGCONF_ARCH_SEC="" |
| 688 | VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX" |
| 689 | VGCONF_PLATFORM_SEC_CAPS="" |
cborntra | f4c4690 | 2013-10-23 16:23:30 +0000 | [diff] [blame] | 690 | # To improve branch prediction hit rate we want to have |
| 691 | # the generated code close to valgrind (host) code |
| 692 | valt_load_address_pri_norml="0x800000000" |
| 693 | valt_load_address_pri_inner="0x810000000" |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 694 | valt_load_address_sec_norml="0xUNSET" |
| 695 | valt_load_address_sec_inner="0xUNSET" |
| 696 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 697 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 698 | mips32-linux) |
| 699 | VGCONF_ARCH_PRI="mips32" |
| 700 | VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX" |
| 701 | VGCONF_PLATFORM_SEC_CAPS="" |
| 702 | valt_load_address_pri_norml="0x38000000" |
| 703 | valt_load_address_pri_inner="0x28000000" |
| 704 | valt_load_address_sec_norml="0xUNSET" |
| 705 | valt_load_address_sec_inner="0xUNSET" |
| 706 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 707 | ;; |
| 708 | mips64-linux) |
| 709 | VGCONF_ARCH_PRI="mips64" |
| 710 | VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX" |
| 711 | VGCONF_PLATFORM_SEC_CAPS="" |
| 712 | valt_load_address_pri_norml="0x38000000" |
| 713 | valt_load_address_pri_inner="0x28000000" |
| 714 | valt_load_address_sec_norml="0xUNSET" |
| 715 | valt_load_address_sec_inner="0xUNSET" |
| 716 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 717 | ;; |
sewardj | 112711a | 2015-04-10 12:30:09 +0000 | [diff] [blame] | 718 | tilegx-linux) |
| 719 | VGCONF_ARCH_PRI="tilegx" |
| 720 | VGCONF_ARCH_SEC="" |
| 721 | VGCONF_PLATFORM_PRI_CAPS="TILEGX_LINUX" |
| 722 | VGCONF_PLATFORM_SEC_CAPS="" |
| 723 | valt_load_address_pri_norml="0x38000000" |
| 724 | valt_load_address_pri_inner="0x28000000" |
| 725 | valt_load_address_sec_norml="0xUNSET" |
| 726 | valt_load_address_sec_inner="0xUNSET" |
| 727 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 728 | ;; |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 729 | x86-solaris) |
| 730 | VGCONF_ARCH_PRI="x86" |
| 731 | VGCONF_ARCH_SEC="" |
| 732 | VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS" |
| 733 | VGCONF_PLATFORM_SEC_CAPS="" |
| 734 | valt_load_address_pri_norml="0x38000000" |
| 735 | valt_load_address_pri_inner="0x28000000" |
| 736 | valt_load_address_sec_norml="0xUNSET" |
| 737 | valt_load_address_sec_inner="0xUNSET" |
| 738 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 739 | ;; |
| 740 | amd64-solaris) |
| 741 | valt_load_address_sec_norml="0xUNSET" |
| 742 | valt_load_address_sec_inner="0xUNSET" |
| 743 | if test x$vg_cv_only64bit = xyes; then |
| 744 | VGCONF_ARCH_PRI="amd64" |
| 745 | VGCONF_ARCH_SEC="" |
| 746 | VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS" |
| 747 | VGCONF_PLATFORM_SEC_CAPS="" |
| 748 | valt_load_address_pri_norml="0x38000000" |
| 749 | valt_load_address_pri_inner="0x28000000" |
| 750 | elif test x$vg_cv_only32bit = xyes; then |
| 751 | VGCONF_ARCH_PRI="x86" |
| 752 | VGCONF_ARCH_SEC="" |
| 753 | VGCONF_PLATFORM_PRI_CAPS="X86_SOLARIS" |
| 754 | VGCONF_PLATFORM_SEC_CAPS="" |
| 755 | valt_load_address_pri_norml="0x38000000" |
| 756 | valt_load_address_pri_inner="0x28000000" |
| 757 | else |
| 758 | VGCONF_ARCH_PRI="amd64" |
| 759 | VGCONF_ARCH_SEC="x86" |
| 760 | VGCONF_PLATFORM_PRI_CAPS="AMD64_SOLARIS" |
| 761 | VGCONF_PLATFORM_SEC_CAPS="X86_SOLARIS" |
| 762 | valt_load_address_pri_norml="0x38000000" |
| 763 | valt_load_address_pri_inner="0x28000000" |
| 764 | valt_load_address_sec_norml="0x38000000" |
| 765 | valt_load_address_sec_inner="0x28000000" |
| 766 | fi |
| 767 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 768 | ;; |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 769 | *) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 770 | VGCONF_ARCH_PRI="unknown" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 771 | VGCONF_ARCH_SEC="unknown" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 772 | VGCONF_PLATFORM_PRI_CAPS="UNKNOWN" |
| 773 | VGCONF_PLATFORM_SEC_CAPS="UNKNOWN" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 774 | valt_load_address_pri_norml="0xUNSET" |
| 775 | valt_load_address_pri_inner="0xUNSET" |
| 776 | valt_load_address_sec_norml="0xUNSET" |
| 777 | valt_load_address_sec_inner="0xUNSET" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 778 | AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 779 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 780 | ;; |
| 781 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 782 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 783 | #---------------------------------------------------------------------------- |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 784 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 785 | # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become |
| 786 | # defined. |
| 787 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86, |
| 788 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 789 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
| 790 | -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 791 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN \ |
| 792 | -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \ |
| 793 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 794 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 795 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 796 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN \ |
| 797 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 798 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, |
| 799 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 800 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 801 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64, |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 802 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \ |
| 803 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX ) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 804 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM, |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 805 | test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ |
| 806 | -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX ) |
| 807 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM64, |
| 808 | test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX ) |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 809 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X, |
| 810 | test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 811 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32, |
| 812 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX ) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 813 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64, |
| 814 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ) |
sewardj | 112711a | 2015-04-10 12:30:09 +0000 | [diff] [blame] | 815 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_TILEGX, |
| 816 | test x$VGCONF_PLATFORM_PRI_CAPS = xTILEGX_LINUX ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 817 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 818 | # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these |
| 819 | # become defined. |
| 820 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX, |
| 821 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 822 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX) |
| 823 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX, |
| 824 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX) |
| 825 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX, |
| 826 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
| 827 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX) |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 828 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX, |
| 829 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX) |
| 830 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX, |
| 831 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 832 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX, |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 833 | test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ |
| 834 | -o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX) |
| 835 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM64_LINUX, |
| 836 | test x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX) |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 837 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX, |
| 838 | test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \ |
| 839 | -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 840 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX, |
| 841 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 842 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX, |
| 843 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX) |
sewardj | 112711a | 2015-04-10 12:30:09 +0000 | [diff] [blame] | 844 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_TILEGX_LINUX, |
| 845 | test x$VGCONF_PLATFORM_PRI_CAPS = xTILEGX_LINUX) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 846 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN, |
| 847 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 848 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN) |
| 849 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN, |
| 850 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 851 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_SOLARIS, |
| 852 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \ |
| 853 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS) |
| 854 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_SOLARIS, |
| 855 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 856 | |
| 857 | |
sewardj | 72a2d80 | 2010-07-29 05:24:20 +0000 | [diff] [blame] | 858 | # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined. |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 859 | # Relies on the assumption that the primary and secondary targets are |
| 860 | # for the same OS, so therefore only necessary to test the primary. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 861 | AM_CONDITIONAL(VGCONF_OS_IS_LINUX, |
| 862 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 863 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
| 864 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
carll | cae0cc2 | 2014-08-07 23:17:29 +0000 | [diff] [blame] | 865 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \ |
| 866 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \ |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 867 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 868 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \ |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 869 | -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \ |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 870 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ |
sewardj | 112711a | 2015-04-10 12:30:09 +0000 | [diff] [blame] | 871 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \ |
| 872 | -o x$VGCONF_PLATFORM_PRI_CAPS = xTILEGX_LINUX) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 873 | AM_CONDITIONAL(VGCONF_OS_IS_DARWIN, |
| 874 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 875 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 876 | AM_CONDITIONAL(VGCONF_OS_IS_SOLARIS, |
| 877 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \ |
| 878 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 879 | |
| 880 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 881 | # Sometimes, in the Makefile.am files, it's useful to know whether or not |
| 882 | # there is a secondary target. |
njn | ee0c66a | 2009-06-01 23:59:20 +0000 | [diff] [blame] | 883 | AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC, |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 884 | test x$VGCONF_PLATFORM_SEC_CAPS != x) |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 885 | |
philippe | f32cbe8 | 2012-05-18 16:48:20 +0000 | [diff] [blame] | 886 | dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a |
| 887 | dnl fallback definition |
| 888 | dnl The macro is courtesy of Dave Hart: |
| 889 | dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html |
| 890 | m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [ |
| 891 | if test -z "$$1_TRUE"; then : |
| 892 | m4_n([$2])[]dnl |
| 893 | m4_ifval([$3], |
| 894 | [else |
| 895 | $3 |
| 896 | ])dnl |
| 897 | fi[]dnl |
| 898 | ])]) |
tom | b637bad | 2005-11-08 12:28:35 +0000 | [diff] [blame] | 899 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 900 | #---------------------------------------------------------------------------- |
| 901 | # Inner Valgrind? |
| 902 | #---------------------------------------------------------------------------- |
| 903 | |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 904 | # Check if this should be built as an inner Valgrind, to be run within |
| 905 | # another Valgrind. Choose the load address accordingly. |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 906 | AC_SUBST(VALT_LOAD_ADDRESS_PRI) |
| 907 | AC_SUBST(VALT_LOAD_ADDRESS_SEC) |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 908 | AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, |
| 909 | [AC_ARG_ENABLE(inner, |
| 910 | [ --enable-inner enables self-hosting], |
| 911 | [vg_cv_inner=$enableval], |
| 912 | [vg_cv_inner=no])]) |
| 913 | if test "$vg_cv_inner" = yes; then |
| 914 | AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind]) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 915 | VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner |
| 916 | VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 917 | else |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 918 | VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml |
| 919 | VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 920 | fi |
| 921 | |
florian | bb1a787 | 2015-03-10 16:13:59 +0000 | [diff] [blame] | 922 | #---------------------------------------------------------------------------- |
| 923 | # Undefined behaviour sanitiser |
| 924 | #---------------------------------------------------------------------------- |
| 925 | # Check whether we should build with the undefined beahviour sanitiser. |
| 926 | |
| 927 | AC_CACHE_CHECK([for using the undefined behaviour sanitiser], vg_cv_ubsan, |
| 928 | [AC_ARG_ENABLE(ubsan, |
| 929 | [ --enable-ubsan enables the undefined behaviour sanitiser], |
| 930 | [vg_cv_ubsan=$enableval], |
| 931 | [vg_cv_ubsan=no])]) |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 932 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 933 | #---------------------------------------------------------------------------- |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 934 | # Define MIPS_PAGE_SHIFT (--with-pagesize) |
| 935 | #---------------------------------------------------------------------------- |
| 936 | AC_ARG_WITH(pagesize, |
| 937 | [ --with-pagesize= override detected page size (4, 16 or 64)], |
| 938 | [psize=$withval], |
| 939 | [psize=0] |
| 940 | ) |
| 941 | |
| 942 | if test "$psize" = "0"; then |
| 943 | psizer=`getconf PAGESIZE` |
florian | 62477d2 | 2014-02-22 13:24:15 +0000 | [diff] [blame] | 944 | psize=$((${psizer}/1024)) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 945 | fi |
| 946 | |
| 947 | if test "$psize" = "4"; then |
| 948 | AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured page size 4k]) |
| 949 | elif test "$psize" = "16"; then |
| 950 | AC_DEFINE([MIPS_PAGE_SHIFT], 14, [configured page size 16k]) |
| 951 | elif test "$psize" = "64"; then |
| 952 | AC_DEFINE([MIPS_PAGE_SHIFT], 16, [configured page size 64k]) |
| 953 | else |
| 954 | AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured default page size 4k]) |
| 955 | fi |
| 956 | AC_MSG_RESULT([checking for Pagesize... ${psize}k]) |
| 957 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 958 | |
| 959 | #---------------------------------------------------------------------------- |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 960 | # Extra fine-tuning of installation directories |
| 961 | #---------------------------------------------------------------------------- |
| 962 | AC_ARG_WITH(tmpdir, |
| 963 | [ --with-tmpdir=PATH Specify path for temporary files], |
| 964 | tmpdir="$withval", |
| 965 | tmpdir="/tmp") |
| 966 | AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory]) |
florian | 7fd2ec3 | 2014-06-21 20:25:30 +0000 | [diff] [blame] | 967 | AC_SUBST(VG_TMPDIR, [$tmpdir]) |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 968 | |
sewardj | 0ba37c9 | 2011-07-12 11:46:24 +0000 | [diff] [blame] | 969 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 970 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 971 | # Libc and suppressions |
| 972 | #---------------------------------------------------------------------------- |
| 973 | # This variable will collect the suppression files to be used. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 974 | AC_SUBST(DEFAULT_SUPP) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 975 | |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 976 | AC_CHECK_HEADER([features.h]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 977 | |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 978 | if test x$ac_cv_header_features_h = xyes; then |
| 979 | rm -f conftest.$ac_ext |
| 980 | cat <<_ACEOF >conftest.$ac_ext |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 981 | #include <features.h> |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 982 | #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) |
| 983 | glibc version is: __GLIBC__ __GLIBC_MINOR__ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 984 | #endif |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 985 | _ACEOF |
mjw | a384c3f | 2014-09-10 00:52:30 +0000 | [diff] [blame] | 986 | GLIBC_VERSION="`$CPP -P conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`" |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 987 | fi |
bart | b7c3f08 | 2010-05-13 06:32:36 +0000 | [diff] [blame] | 988 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 989 | # not really a version check |
| 990 | AC_EGREP_CPP([DARWIN_LIBC], [ |
| 991 | #include <sys/cdefs.h> |
| 992 | #if defined(__DARWIN_VERS_1050) |
| 993 | DARWIN_LIBC |
| 994 | #endif |
| 995 | ], |
| 996 | GLIBC_VERSION="darwin") |
| 997 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 998 | # not really a version check |
| 999 | AC_EGREP_CPP([BIONIC_LIBC], [ |
| 1000 | #if defined(__ANDROID__) |
| 1001 | BIONIC_LIBC |
| 1002 | #endif |
| 1003 | ], |
| 1004 | GLIBC_VERSION="bionic") |
| 1005 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 1006 | # there is only one version of libc on Solaris |
| 1007 | if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS \ |
| 1008 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_SOLARIS; then |
| 1009 | GLIBC_VERSION="solaris" |
| 1010 | fi |
| 1011 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1012 | |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1013 | AC_MSG_CHECKING([the glibc version]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 1014 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 1015 | case "${GLIBC_VERSION}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1016 | 2.2) |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1017 | AC_MSG_RESULT(${GLIBC_VERSION} family) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 1018 | DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" |
| 1019 | DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 1020 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1021 | ;; |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1022 | 2.[[3-6]]) |
| 1023 | AC_MSG_RESULT(${GLIBC_VERSION} family) |
| 1024 | DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 1025 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 1026 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 1027 | ;; |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1028 | 2.[[7-9]]) |
| 1029 | AC_MSG_RESULT(${GLIBC_VERSION} family) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 1030 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 1031 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 1032 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 1033 | ;; |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1034 | 2.10|2.11) |
| 1035 | AC_MSG_RESULT(${GLIBC_VERSION} family) |
| 1036 | AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1, |
| 1037 | [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)]) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 1038 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 1039 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 1040 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 1041 | ;; |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1042 | 2.*) |
| 1043 | AC_MSG_RESULT(${GLIBC_VERSION} family) |
| 1044 | AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1, |
| 1045 | [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)]) |
| 1046 | AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1, |
| 1047 | [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)]) |
mjw | edd3033 | 2014-09-08 23:41:31 +0000 | [diff] [blame] | 1048 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 1049 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 1050 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 1051 | ;; |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 1052 | darwin) |
| 1053 | AC_MSG_RESULT(Darwin) |
| 1054 | AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) |
| 1055 | # DEFAULT_SUPP set by kernel version check above. |
| 1056 | ;; |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1057 | bionic) |
| 1058 | AC_MSG_RESULT(Bionic) |
| 1059 | AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic]) |
| 1060 | DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}" |
| 1061 | ;; |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 1062 | solaris) |
| 1063 | AC_MSG_RESULT(Solaris) |
| 1064 | # DEFAULT_SUPP set in host_os switch-case above. |
| 1065 | # No other suppression file is used. |
| 1066 | ;; |
bart | 8219bff | 2014-09-13 10:53:00 +0000 | [diff] [blame] | 1067 | 2.0|2.1|*) |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 1068 | AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 1069 | AC_MSG_ERROR([Valgrind requires glibc version 2.2 or later,]) |
| 1070 | AC_MSG_ERROR([Darwin libc, Bionic libc or Solaris libc]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1071 | ;; |
| 1072 | esac |
| 1073 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 1074 | AC_SUBST(GLIBC_VERSION) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1075 | |
sewardj | 414f358 | 2008-07-18 20:46:00 +0000 | [diff] [blame] | 1076 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 1077 | if test "$VGCONF_OS" != "solaris"; then |
| 1078 | # Add default suppressions for the X client libraries. Make no |
| 1079 | # attempt to detect whether such libraries are installed on the |
| 1080 | # build machine (or even if any X facilities are present); just |
| 1081 | # add the suppressions antidisirregardless. |
| 1082 | DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" |
| 1083 | DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 1084 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 1085 | # Add glibc and X11 suppressions for exp-sgcheck |
| 1086 | DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}" |
| 1087 | fi |
sewardj | 5744c02 | 2008-10-19 18:58:13 +0000 | [diff] [blame] | 1088 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 1089 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1090 | #---------------------------------------------------------------------------- |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1091 | # Platform variants? |
| 1092 | #---------------------------------------------------------------------------- |
| 1093 | |
| 1094 | # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough. |
| 1095 | # But there are times where we need a bit more control. The motivating |
philippe | 5d5dd8e | 2012-08-05 00:08:25 +0000 | [diff] [blame] | 1096 | # and currently only case is Android: this is almost identical to |
dejanj | 9c6b05d | 2013-12-27 09:06:55 +0000 | [diff] [blame] | 1097 | # {x86,arm,mips}-linux, but not quite. So this introduces the concept of |
| 1098 | # platform variant tags, which get passed in the compile as |
| 1099 | # -DVGPV_<arch>_<os>_<variant> along with the main -DVGP_<arch>_<os> definition. |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1100 | # |
| 1101 | # In almost all cases, the <variant> bit is "vanilla". But for Android |
| 1102 | # it is "android" instead. |
| 1103 | # |
| 1104 | # Consequently (eg), plain arm-linux would build with |
| 1105 | # |
| 1106 | # -DVGP_arm_linux -DVGPV_arm_linux_vanilla |
| 1107 | # |
| 1108 | # whilst an Android build would have |
| 1109 | # |
| 1110 | # -DVGP_arm_linux -DVGPV_arm_linux_android |
| 1111 | # |
philippe | 5d5dd8e | 2012-08-05 00:08:25 +0000 | [diff] [blame] | 1112 | # Same for x86. The setup of the platform variant is pushed relatively far |
| 1113 | # down this file in order that we can inspect any of the variables set above. |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1114 | |
| 1115 | # In the normal case .. |
| 1116 | VGCONF_PLATVARIANT="vanilla" |
| 1117 | |
philippe | 5d5dd8e | 2012-08-05 00:08:25 +0000 | [diff] [blame] | 1118 | # Android ? |
| 1119 | if test "$GLIBC_VERSION" = "bionic"; |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1120 | then |
| 1121 | VGCONF_PLATVARIANT="android" |
| 1122 | fi |
| 1123 | |
| 1124 | AC_SUBST(VGCONF_PLATVARIANT) |
| 1125 | |
| 1126 | |
| 1127 | # FIXME: do we also want to define automake variables |
| 1128 | # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently) |
| 1129 | # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE, |
| 1130 | # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough |
| 1131 | # do that. Problem is that we can't do and-ing in Makefile.am's, but |
| 1132 | # that's what we'd need to do to use this, since what we'd want to write |
| 1133 | # is something like |
| 1134 | # |
| 1135 | # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID |
| 1136 | # |
sewardj | 0ba37c9 | 2011-07-12 11:46:24 +0000 | [diff] [blame] | 1137 | # Hmm. Can't think of a nice clean solution to this. |
| 1138 | |
| 1139 | AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA, |
| 1140 | test x$VGCONF_PLATVARIANT = xvanilla) |
| 1141 | AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID, |
| 1142 | test x$VGCONF_PLATVARIANT = xandroid) |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1143 | |
| 1144 | |
| 1145 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1146 | # Checking for various library functions and other definitions |
| 1147 | #---------------------------------------------------------------------------- |
| 1148 | |
florian | 28db75c | 2012-12-08 19:26:03 +0000 | [diff] [blame] | 1149 | # Check for AT_FDCWD |
| 1150 | |
| 1151 | AC_MSG_CHECKING([for AT_FDCWD]) |
| 1152 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1153 | #define _GNU_SOURCE |
| 1154 | #include <fcntl.h> |
| 1155 | #include <unistd.h> |
| 1156 | ]], [[ |
| 1157 | int a = AT_FDCWD; |
| 1158 | ]])], [ |
| 1159 | ac_have_at_fdcwd=yes |
| 1160 | AC_MSG_RESULT([yes]) |
| 1161 | ], [ |
| 1162 | ac_have_at_fdcwd=no |
florian | 28db75c | 2012-12-08 19:26:03 +0000 | [diff] [blame] | 1163 | AC_MSG_RESULT([no]) |
| 1164 | ]) |
| 1165 | |
| 1166 | AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes]) |
| 1167 | |
sewardj | 24cf8df | 2012-12-14 10:30:57 +0000 | [diff] [blame] | 1168 | # Check for stpncpy function definition in string.h |
| 1169 | # This explicitly checks with _GNU_SOURCE defined since that is also |
| 1170 | # used in the test case (some systems might define it without anyway |
| 1171 | # since stpncpy is part of The Open Group Base Specifications Issue 7 |
| 1172 | # IEEE Std 1003.1-2008. |
| 1173 | AC_MSG_CHECKING([for stpncpy]) |
| 1174 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 1175 | #define _GNU_SOURCE |
| 1176 | #include <string.h> |
| 1177 | ]], [[ |
| 1178 | char *d; |
| 1179 | char *s; |
| 1180 | size_t n = 0; |
| 1181 | char *r = stpncpy(d, s, n); |
| 1182 | ]])], [ |
| 1183 | ac_have_gnu_stpncpy=yes |
| 1184 | AC_MSG_RESULT([yes]) |
| 1185 | ], [ |
| 1186 | ac_have_gnu_stpncpy=no |
| 1187 | AC_MSG_RESULT([no]) |
| 1188 | ]) |
| 1189 | |
| 1190 | AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes]) |
florian | 28db75c | 2012-12-08 19:26:03 +0000 | [diff] [blame] | 1191 | |
philippe | 4e98f7c | 2013-08-03 20:34:58 +0000 | [diff] [blame] | 1192 | # Check for PTRACE_GETREGS |
| 1193 | |
| 1194 | AC_MSG_CHECKING([for PTRACE_GETREGS]) |
| 1195 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
philippe | dc1757e | 2015-02-02 22:40:54 +0000 | [diff] [blame] | 1196 | #include <stdlib.h> |
philippe | 4e98f7c | 2013-08-03 20:34:58 +0000 | [diff] [blame] | 1197 | #include <stddef.h> |
| 1198 | #include <sys/ptrace.h> |
| 1199 | #include <sys/user.h> |
| 1200 | ]], [[ |
| 1201 | void *p; |
| 1202 | long res = ptrace (PTRACE_GETREGS, 0, p, p); |
| 1203 | ]])], [ |
| 1204 | AC_MSG_RESULT([yes]) |
| 1205 | AC_DEFINE([HAVE_PTRACE_GETREGS], 1, |
| 1206 | [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.]) |
| 1207 | ], [ |
| 1208 | AC_MSG_RESULT([no]) |
| 1209 | ]) |
| 1210 | |
| 1211 | |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1212 | # Check for CLOCK_MONOTONIC |
| 1213 | |
| 1214 | AC_MSG_CHECKING([for CLOCK_MONOTONIC]) |
| 1215 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1216 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1217 | #include <time.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1218 | ]], [[ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1219 | struct timespec t; |
| 1220 | clock_gettime(CLOCK_MONOTONIC, &t); |
| 1221 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1222 | ]])], [ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1223 | AC_MSG_RESULT([yes]) |
| 1224 | AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, |
| 1225 | [Define to 1 if you have the `CLOCK_MONOTONIC' constant.]) |
| 1226 | ], [ |
| 1227 | AC_MSG_RESULT([no]) |
| 1228 | ]) |
| 1229 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1230 | |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1231 | # Check for PTHREAD_RWLOCK_T |
| 1232 | |
| 1233 | AC_MSG_CHECKING([for pthread_rwlock_t]) |
| 1234 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1235 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1236 | #define _GNU_SOURCE |
| 1237 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1238 | ]], [[ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1239 | pthread_rwlock_t rwl; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1240 | ]])], [ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1241 | AC_MSG_RESULT([yes]) |
| 1242 | AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1, |
| 1243 | [Define to 1 if you have the `pthread_rwlock_t' type.]) |
| 1244 | ], [ |
| 1245 | AC_MSG_RESULT([no]) |
| 1246 | ]) |
| 1247 | |
| 1248 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1249 | # Check for PTHREAD_MUTEX_ADAPTIVE_NP |
| 1250 | |
| 1251 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP]) |
| 1252 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1253 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1254 | #define _GNU_SOURCE |
| 1255 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1256 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1257 | return (PTHREAD_MUTEX_ADAPTIVE_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1258 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1259 | AC_MSG_RESULT([yes]) |
| 1260 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, |
| 1261 | [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.]) |
| 1262 | ], [ |
| 1263 | AC_MSG_RESULT([no]) |
| 1264 | ]) |
| 1265 | |
| 1266 | |
| 1267 | # Check for PTHREAD_MUTEX_ERRORCHECK_NP |
| 1268 | |
| 1269 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP]) |
| 1270 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1271 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1272 | #define _GNU_SOURCE |
| 1273 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1274 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1275 | return (PTHREAD_MUTEX_ERRORCHECK_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1276 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1277 | AC_MSG_RESULT([yes]) |
| 1278 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1, |
| 1279 | [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.]) |
| 1280 | ], [ |
| 1281 | AC_MSG_RESULT([no]) |
| 1282 | ]) |
| 1283 | |
| 1284 | |
| 1285 | # Check for PTHREAD_MUTEX_RECURSIVE_NP |
| 1286 | |
| 1287 | AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP]) |
| 1288 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1289 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1290 | #define _GNU_SOURCE |
| 1291 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1292 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1293 | return (PTHREAD_MUTEX_RECURSIVE_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1294 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1295 | AC_MSG_RESULT([yes]) |
| 1296 | AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, |
| 1297 | [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.]) |
| 1298 | ], [ |
| 1299 | AC_MSG_RESULT([no]) |
| 1300 | ]) |
| 1301 | |
| 1302 | |
| 1303 | # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
| 1304 | |
| 1305 | AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP]) |
| 1306 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1307 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1308 | #define _GNU_SOURCE |
| 1309 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1310 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1311 | pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; |
| 1312 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1313 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1314 | AC_MSG_RESULT([yes]) |
| 1315 | AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1, |
| 1316 | [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.]) |
| 1317 | ], [ |
| 1318 | AC_MSG_RESULT([no]) |
| 1319 | ]) |
| 1320 | |
| 1321 | |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1322 | # Check whether pthread_mutex_t has a member called __m_kind. |
| 1323 | |
bart | b11355c | 2010-04-29 16:37:26 +0000 | [diff] [blame] | 1324 | AC_CHECK_MEMBER([pthread_mutex_t.__m_kind], |
| 1325 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND], |
| 1326 | 1, |
| 1327 | [Define to 1 if pthread_mutex_t has a member called __m_kind.]) |
| 1328 | ], |
| 1329 | [], |
| 1330 | [#include <pthread.h>]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1331 | |
| 1332 | |
| 1333 | # Check whether pthread_mutex_t has a member called __data.__kind. |
| 1334 | |
bart | b11355c | 2010-04-29 16:37:26 +0000 | [diff] [blame] | 1335 | AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind], |
| 1336 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND], |
| 1337 | 1, |
| 1338 | [Define to 1 if pthread_mutex_t has a member __data.__kind.]) |
| 1339 | ], |
| 1340 | [], |
| 1341 | [#include <pthread.h>]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1342 | |
carll | 5bd4f6d | 2015-07-20 21:25:32 +0000 | [diff] [blame] | 1343 | # Convenience function. Set flags based on the existing HWCAP entries. |
| 1344 | # The AT_HWCAP entries are generated by glibc, and are based on |
| 1345 | # functions supported by the hardware/system/libc. |
| 1346 | # Subsequent support for whether the capability will actually be utilized |
| 1347 | # will also be checked against the compiler capabilities. |
| 1348 | # called as |
| 1349 | # AC_HWCAP_CONTAINS_FLAG[hwcap_string_to_match],[VARIABLE_TO_SET] |
| 1350 | AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[ |
| 1351 | AUXV_CHECK_FOR=$1 |
| 1352 | AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator]) |
| 1353 | if `LD_SHOW_AUXV=1 /bin/true | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}` |
| 1354 | then |
| 1355 | AC_MSG_RESULT([yes]) |
| 1356 | AC_SUBST([$2],[yes]) |
| 1357 | else |
| 1358 | AC_MSG_RESULT([no]) |
| 1359 | AC_SUBST([$2],[]) |
| 1360 | fi |
| 1361 | ]) |
| 1362 | |
| 1363 | # gather hardware capabilities. (hardware/kernel/libc) |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1364 | AC_HWCAP_CONTAINS_FLAG([altivec],[HWCAP_HAS_ALTIVEC]) |
| 1365 | AC_HWCAP_CONTAINS_FLAG([vsx],[HWCAP_HAS_VSX]) |
| 1366 | AC_HWCAP_CONTAINS_FLAG([dfp],[HWCAP_HAS_DFP]) |
| 1367 | AC_HWCAP_CONTAINS_FLAG([arch_2_05],[HWCAP_HAS_ISA_2_05]) |
| 1368 | AC_HWCAP_CONTAINS_FLAG([arch_2_06],[HWCAP_HAS_ISA_2_06]) |
| 1369 | AC_HWCAP_CONTAINS_FLAG([arch_2_07],[HWCAP_HAS_ISA_2_07]) |
carll | 5bd4f6d | 2015-07-20 21:25:32 +0000 | [diff] [blame] | 1370 | AC_HWCAP_CONTAINS_FLAG([htm],[HWCAP_HAS_HTM]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1371 | |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1372 | # ISA Levels |
| 1373 | AM_CONDITIONAL(HAS_ISA_2_05, [test x$HWCAP_HAS_ISA_2_05 = xyes]) |
| 1374 | AM_CONDITIONAL(HAS_ISA_2_06, [test x$HWCAP_HAS_ISA_2_06 = xyes]) |
| 1375 | # compiler support for isa 2.07 level instructions |
| 1376 | AC_MSG_CHECKING([that assembler knows ISA 2.07 instructions ]) |
| 1377 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1378 | ]], [[ |
| 1379 | __asm__ __volatile__("mtvsrd 1,2 "); |
| 1380 | ]])], [ |
| 1381 | ac_asm_have_isa_2_07=yes |
| 1382 | AC_MSG_RESULT([yes]) |
| 1383 | ], [ |
| 1384 | ac_asm_have_isa_2_07=no |
| 1385 | AC_MSG_RESULT([no]) |
| 1386 | ]) |
| 1387 | AM_CONDITIONAL(HAS_ISA_2_07, [test x$ac_asm_have_isa_2_07 = xyes \ |
| 1388 | -a x$HWCAP_HAS_ISA_2_07 = xyes]) |
| 1389 | |
| 1390 | # altivec (vsx) support. |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1391 | # does this compiler support -maltivec and does it have the include file |
| 1392 | # <altivec.h> ? |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1393 | AC_MSG_CHECKING([for Altivec support in the compiler ]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1394 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1395 | CFLAGS="-maltivec -Werror" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1396 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1397 | #include <altivec.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1398 | ]], [[ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1399 | vector unsigned int v; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1400 | ]])], [ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1401 | ac_have_altivec=yes |
| 1402 | AC_MSG_RESULT([yes]) |
sewardj | f9fe602 | 2010-09-03 14:36:50 +0000 | [diff] [blame] | 1403 | AC_DEFINE([HAS_ALTIVEC], 1, |
sewardj | 6467a15 | 2010-09-03 14:02:22 +0000 | [diff] [blame] | 1404 | [Define to 1 if gcc/as can do Altivec.]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1405 | ], [ |
| 1406 | ac_have_altivec=no |
| 1407 | AC_MSG_RESULT([no]) |
| 1408 | ]) |
| 1409 | CFLAGS=$safe_CFLAGS |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1410 | AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes \ |
| 1411 | -a x$HWCAP_HAS_ALTIVEC = xyes]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1412 | |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1413 | # Check that both: the compiler supports -mvsx and that the assembler |
| 1414 | # understands VSX instructions. If either of those doesn't work, |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1415 | # conclude that we can't do VSX. |
| 1416 | AC_MSG_CHECKING([for VSX compiler flag support]) |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1417 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1418 | CFLAGS="-mvsx -Werror" |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1419 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1420 | ]], [[ |
| 1421 | ]])], [ |
| 1422 | ac_compiler_supports_vsx_flag=yes |
| 1423 | AC_MSG_RESULT([yes]) |
| 1424 | ], [ |
| 1425 | ac_compiler_supports_vsx_flag=no |
| 1426 | AC_MSG_RESULT([no]) |
| 1427 | ]) |
| 1428 | CFLAGS=$safe_CFLAGS |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1429 | |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1430 | AC_MSG_CHECKING([for VSX support in the assembler ]) |
| 1431 | safe_CFLAGS=$CFLAGS |
| 1432 | CFLAGS="-mvsx -Werror" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1433 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1434 | #include <altivec.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1435 | ]], [[ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1436 | vector unsigned int v; |
sewardj | 9b80ebb | 2011-04-15 21:16:00 +0000 | [diff] [blame] | 1437 | __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1438 | ]])], [ |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1439 | ac_compiler_supports_vsx=yes |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1440 | AC_MSG_RESULT([yes]) |
| 1441 | ], [ |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1442 | ac_compiler_supports_vsx=no |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1443 | AC_MSG_RESULT([no]) |
| 1444 | ]) |
| 1445 | CFLAGS=$safe_CFLAGS |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1446 | AM_CONDITIONAL([HAS_VSX], [test x$ac_compiler_supports_vsx_flag = xyes \ |
| 1447 | -a x$ac_compiler_supports_vsx = xyes \ |
| 1448 | -a x$HWCAP_HAS_VSX = xyes ]) |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1449 | |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1450 | # DFP (Decimal Float) |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1451 | AC_MSG_CHECKING([that assembler knows DFP]) |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1452 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1453 | ]], [[ |
| 1454 | __asm__ __volatile__("dadd 1, 2, 3"); |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1455 | __asm__ __volatile__("dcffix 1, 2"); |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1456 | ]])], [ |
| 1457 | ac_asm_have_dfp=yes |
| 1458 | AC_MSG_RESULT([yes]) |
| 1459 | ], [ |
| 1460 | ac_asm_have_dfp=no |
| 1461 | AC_MSG_RESULT([no]) |
| 1462 | ]) |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1463 | AC_MSG_CHECKING([that compiler knows -mhard-dfp switch]) |
| 1464 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1465 | CFLAGS="-mhard-dfp -Werror" |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1466 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1467 | ]], [[ |
| 1468 | __asm__ __volatile__("dadd 1, 2, 3"); |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1469 | __asm__ __volatile__("dcffix 1, 2"); |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1470 | ]])], [ |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1471 | ac_compiler_have_dfp=yes |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1472 | AC_MSG_RESULT([yes]) |
| 1473 | ], [ |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1474 | ac_compiler_have_dfp=no |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1475 | AC_MSG_RESULT([no]) |
| 1476 | ]) |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1477 | CFLAGS=$safe_CFLAGS |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1478 | AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes \ |
| 1479 | -a x$ac_compiler_have_dfp = xyes \ |
| 1480 | -a x$HWCAP_HAS_DFP = xyes ) |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1481 | |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1482 | AC_MSG_CHECKING([that compiler knows DFP datatypes]) |
| 1483 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1484 | ]], [[ |
| 1485 | _Decimal64 x = 0.0DD; |
| 1486 | ]])], [ |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1487 | ac_compiler_have_dfp_type=yes |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1488 | AC_MSG_RESULT([yes]) |
| 1489 | ], [ |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1490 | ac_compiler_have_dfp_type=no |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1491 | AC_MSG_RESULT([no]) |
| 1492 | ]) |
carll | 56f7989 | 2015-07-20 21:57:21 +0000 | [diff] [blame] | 1493 | AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_compiler_have_dfp_type = xyes \ |
| 1494 | -a xHWCAP_$HAS_DFP = xyes ) |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1495 | |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1496 | |
carll | 5bd4f6d | 2015-07-20 21:25:32 +0000 | [diff] [blame] | 1497 | # HTM (Hardware Transactional Memory) |
| 1498 | AC_MSG_CHECKING([if compiler accepts the -mhtm flag]) |
| 1499 | safe_CFLAGS=$CFLAGS |
| 1500 | CFLAGS="-mhtm -Werror" |
| 1501 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1502 | ]], [[ |
| 1503 | return 0; |
| 1504 | ]])], [ |
| 1505 | AC_MSG_RESULT([yes]) |
| 1506 | ac_compiler_supports_htm=yes |
| 1507 | ], [ |
| 1508 | AC_MSG_RESULT([no]) |
| 1509 | ac_compiler_supports_htm=no |
| 1510 | ]) |
| 1511 | CFLAGS=$safe_CFLAGS |
| 1512 | |
| 1513 | AC_MSG_CHECKING([if compiler can find the htm builtins]) |
| 1514 | safe_CFLAGS=$CFLAGS |
| 1515 | CFLAGS="-mhtm -Werror" |
| 1516 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1517 | ]], [[ |
| 1518 | if (__builtin_tbegin (0)) |
| 1519 | __builtin_tend (0); |
| 1520 | ]])], [ |
| 1521 | AC_MSG_RESULT([yes]) |
| 1522 | ac_compiler_sees_htm_builtins=yes |
| 1523 | ], [ |
| 1524 | AC_MSG_RESULT([no]) |
| 1525 | ac_compiler_sees_htm_builtins=no |
| 1526 | ]) |
| 1527 | CFLAGS=$safe_CFLAGS |
| 1528 | |
| 1529 | AM_CONDITIONAL(SUPPORTS_HTM, test x$ac_compiler_supports_htm = xyes \ |
| 1530 | -a x$ac_compiler_sees_htm_builtins = xyes \ |
| 1531 | -a x$HWCAP_HAS_HTM = xyes ) |
| 1532 | |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1533 | # Check for pthread_create@GLIBC2.0 |
| 1534 | AC_MSG_CHECKING([for pthread_create@GLIBC2.0()]) |
| 1535 | |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1536 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1537 | CFLAGS="-lpthread -Werror" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1538 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1539 | extern int pthread_create_glibc_2_0(void*, const void*, |
| 1540 | void *(*)(void*), void*); |
| 1541 | __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1542 | ]], [[ |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 1543 | #ifdef __powerpc__ |
| 1544 | /* |
| 1545 | * Apparently on PowerPC linking this program succeeds and generates an |
| 1546 | * executable with the undefined symbol pthread_create@GLIBC_2.0. |
| 1547 | */ |
| 1548 | #error This test does not work properly on PowerPC. |
| 1549 | #else |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1550 | pthread_create_glibc_2_0(0, 0, 0, 0); |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 1551 | #endif |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1552 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1553 | ]])], [ |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1554 | ac_have_pthread_create_glibc_2_0=yes |
| 1555 | AC_MSG_RESULT([yes]) |
| 1556 | AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1, |
| 1557 | [Define to 1 if you have the `pthread_create@glibc2.0' function.]) |
| 1558 | ], [ |
| 1559 | ac_have_pthread_create_glibc_2_0=no |
| 1560 | AC_MSG_RESULT([no]) |
| 1561 | ]) |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1562 | CFLAGS=$safe_CFLAGS |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1563 | |
| 1564 | AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0, |
bart | 24f5390 | 2009-04-26 11:29:02 +0000 | [diff] [blame] | 1565 | test x$ac_have_pthread_create_glibc_2_0 = xyes) |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1566 | |
| 1567 | |
philippe | 1670b05 | 2014-08-15 10:27:52 +0000 | [diff] [blame] | 1568 | # Check for dlinfo RTLD_DI_TLS_MODID |
| 1569 | AC_MSG_CHECKING([for dlinfo RTLD_DI_TLS_MODID]) |
| 1570 | |
| 1571 | safe_LIBS="$LIBS" |
| 1572 | LIBS="-ldl" |
| 1573 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 1574 | #ifndef _GNU_SOURCE |
| 1575 | #define _GNU_SOURCE |
| 1576 | #endif |
| 1577 | #include <link.h> |
| 1578 | #include <dlfcn.h> |
| 1579 | ]], [[ |
| 1580 | size_t sizes[10000]; |
| 1581 | size_t modid_offset; |
| 1582 | (void) dlinfo ((void*)sizes, RTLD_DI_TLS_MODID, &modid_offset); |
| 1583 | return 0; |
| 1584 | ]])], [ |
| 1585 | ac_have_dlinfo_rtld_di_tls_modid=yes |
| 1586 | AC_MSG_RESULT([yes]) |
| 1587 | AC_DEFINE([HAVE_DLINFO_RTLD_DI_TLS_MODID], 1, |
| 1588 | [Define to 1 if you have a dlinfo that can do RTLD_DI_TLS_MODID.]) |
| 1589 | ], [ |
| 1590 | ac_have_dlinfo_rtld_di_tls_modid=no |
| 1591 | AC_MSG_RESULT([no]) |
| 1592 | ]) |
| 1593 | LIBS=$safe_LIBS |
| 1594 | |
| 1595 | AM_CONDITIONAL(HAVE_DLINFO_RTLD_DI_TLS_MODID, |
| 1596 | test x$ac_have_dlinfo_rtld_di_tls_modid = xyes) |
| 1597 | |
| 1598 | |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1599 | # Check for eventfd_t, eventfd() and eventfd_read() |
| 1600 | AC_MSG_CHECKING([for eventfd()]) |
| 1601 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1602 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1603 | #include <sys/eventfd.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1604 | ]], [[ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1605 | eventfd_t ev; |
| 1606 | int fd; |
| 1607 | |
| 1608 | fd = eventfd(5, 0); |
| 1609 | eventfd_read(fd, &ev); |
| 1610 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1611 | ]])], [ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1612 | AC_MSG_RESULT([yes]) |
| 1613 | AC_DEFINE([HAVE_EVENTFD], 1, |
| 1614 | [Define to 1 if you have the `eventfd' function.]) |
| 1615 | AC_DEFINE([HAVE_EVENTFD_READ], 1, |
| 1616 | [Define to 1 if you have the `eventfd_read' function.]) |
| 1617 | ], [ |
| 1618 | AC_MSG_RESULT([no]) |
| 1619 | ]) |
| 1620 | |
florian | 24fefb6 | 2013-10-08 13:04:00 +0000 | [diff] [blame] | 1621 | # Check whether compiler can process #include <thread> without errors |
| 1622 | # clang 3.3 cannot process <thread> from e.g. |
| 1623 | # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 |
| 1624 | |
| 1625 | AC_MSG_CHECKING([that C++ compiler can include <thread> header file]) |
| 1626 | AC_LANG(C++) |
| 1627 | safe_CXXFLAGS=$CXXFLAGS |
| 1628 | CXXFLAGS=-std=c++0x |
| 1629 | |
| 1630 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
| 1631 | #include <thread> |
| 1632 | ])], |
| 1633 | [ |
| 1634 | ac_cxx_can_include_thread_header=yes |
| 1635 | AC_MSG_RESULT([yes]) |
| 1636 | ], [ |
| 1637 | ac_cxx_can_include_thread_header=no |
| 1638 | AC_MSG_RESULT([no]) |
| 1639 | ]) |
| 1640 | CXXFLAGS=$safe_CXXFLAGS |
| 1641 | AC_LANG(C) |
| 1642 | |
| 1643 | AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes) |
| 1644 | |
mjw | 2a429f5 | 2014-07-18 20:45:37 +0000 | [diff] [blame] | 1645 | |
| 1646 | # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead |
| 1647 | # of the user_regs_struct from sys/user.h. They are structurally the same |
| 1648 | # but we get either one or the other. |
| 1649 | |
| 1650 | AC_CHECK_TYPE([struct user_regs_struct], |
| 1651 | [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no], |
| 1652 | [[#include <sys/ptrace.h>] |
| 1653 | [#include <sys/time.h>] |
| 1654 | [#include <sys/user.h>]]) |
| 1655 | if test "$sys_user_has_user_regs" = "yes"; then |
| 1656 | AC_DEFINE(HAVE_SYS_USER_REGS, 1, |
| 1657 | [Define to 1 if <sys/user.h> defines struct user_regs_struct]) |
| 1658 | fi |
| 1659 | |
| 1660 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1661 | #---------------------------------------------------------------------------- |
| 1662 | # Checking for supported compiler flags. |
| 1663 | #---------------------------------------------------------------------------- |
| 1664 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1665 | # does this compiler support -m32 ? |
| 1666 | AC_MSG_CHECKING([if gcc accepts -m32]) |
| 1667 | |
| 1668 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1669 | CFLAGS="-m32 -Werror" |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1670 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1671 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1672 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1673 | ]])], [ |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1674 | FLAG_M32="-m32" |
| 1675 | AC_MSG_RESULT([yes]) |
| 1676 | ], [ |
| 1677 | FLAG_M32="" |
| 1678 | AC_MSG_RESULT([no]) |
| 1679 | ]) |
| 1680 | CFLAGS=$safe_CFLAGS |
| 1681 | |
| 1682 | AC_SUBST(FLAG_M32) |
| 1683 | |
| 1684 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1685 | # does this compiler support -m64 ? |
| 1686 | AC_MSG_CHECKING([if gcc accepts -m64]) |
| 1687 | |
| 1688 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1689 | CFLAGS="-m64 -Werror" |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1690 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1691 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1692 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1693 | ]])], [ |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1694 | FLAG_M64="-m64" |
| 1695 | AC_MSG_RESULT([yes]) |
| 1696 | ], [ |
| 1697 | FLAG_M64="" |
| 1698 | AC_MSG_RESULT([no]) |
| 1699 | ]) |
| 1700 | CFLAGS=$safe_CFLAGS |
| 1701 | |
| 1702 | AC_SUBST(FLAG_M64) |
| 1703 | |
| 1704 | |
dejanj | f674e38 | 2014-02-18 16:40:25 +0000 | [diff] [blame] | 1705 | # does this compiler support -march=mips32 (mips32 default) ? |
| 1706 | AC_MSG_CHECKING([if gcc accepts -march=mips32]) |
| 1707 | |
| 1708 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1709 | CFLAGS="$CFLAGS -march=mips32 -Werror" |
dejanj | f674e38 | 2014-02-18 16:40:25 +0000 | [diff] [blame] | 1710 | |
| 1711 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1712 | return 0; |
| 1713 | ]])], [ |
| 1714 | FLAG_MIPS32="-march=mips32" |
| 1715 | AC_MSG_RESULT([yes]) |
| 1716 | ], [ |
| 1717 | FLAG_MIPS32="" |
| 1718 | AC_MSG_RESULT([no]) |
| 1719 | ]) |
| 1720 | CFLAGS=$safe_CFLAGS |
| 1721 | |
| 1722 | AC_SUBST(FLAG_MIPS32) |
| 1723 | |
| 1724 | |
| 1725 | # does this compiler support -march=mips64 (mips64 default) ? |
| 1726 | AC_MSG_CHECKING([if gcc accepts -march=mips64]) |
| 1727 | |
| 1728 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1729 | CFLAGS="$CFLAGS -march=mips64 -Werror" |
dejanj | f674e38 | 2014-02-18 16:40:25 +0000 | [diff] [blame] | 1730 | |
| 1731 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1732 | return 0; |
| 1733 | ]])], [ |
| 1734 | FLAG_MIPS64="-march=mips64" |
| 1735 | AC_MSG_RESULT([yes]) |
| 1736 | ], [ |
| 1737 | FLAG_MIPS64="" |
| 1738 | AC_MSG_RESULT([no]) |
| 1739 | ]) |
| 1740 | CFLAGS=$safe_CFLAGS |
| 1741 | |
| 1742 | AC_SUBST(FLAG_MIPS64) |
| 1743 | |
| 1744 | |
petarj | 1546c7a | 2014-01-29 18:08:50 +0000 | [diff] [blame] | 1745 | # does this compiler support -march=octeon (Cavium OCTEON I Specific) ? |
| 1746 | AC_MSG_CHECKING([if gcc accepts -march=octeon]) |
| 1747 | |
| 1748 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1749 | CFLAGS="$CFLAGS -march=octeon -Werror" |
petarj | 1546c7a | 2014-01-29 18:08:50 +0000 | [diff] [blame] | 1750 | |
| 1751 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1752 | return 0; |
| 1753 | ]])], [ |
| 1754 | FLAG_OCTEON="-march=octeon" |
| 1755 | AC_MSG_RESULT([yes]) |
| 1756 | ], [ |
| 1757 | FLAG_OCTEON="" |
| 1758 | AC_MSG_RESULT([no]) |
| 1759 | ]) |
| 1760 | CFLAGS=$safe_CFLAGS |
| 1761 | |
| 1762 | AC_SUBST(FLAG_OCTEON) |
| 1763 | |
dejanj | f674e38 | 2014-02-18 16:40:25 +0000 | [diff] [blame] | 1764 | |
petarj | 1546c7a | 2014-01-29 18:08:50 +0000 | [diff] [blame] | 1765 | # does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ? |
| 1766 | AC_MSG_CHECKING([if gcc accepts -march=octeon2]) |
| 1767 | |
| 1768 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1769 | CFLAGS="$CFLAGS -march=octeon2 -Werror" |
petarj | 1546c7a | 2014-01-29 18:08:50 +0000 | [diff] [blame] | 1770 | |
| 1771 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1772 | return 0; |
| 1773 | ]])], [ |
| 1774 | FLAG_OCTEON2="-march=octeon2" |
| 1775 | AC_MSG_RESULT([yes]) |
| 1776 | ], [ |
| 1777 | FLAG_OCTEON2="" |
| 1778 | AC_MSG_RESULT([no]) |
| 1779 | ]) |
| 1780 | CFLAGS=$safe_CFLAGS |
| 1781 | |
| 1782 | AC_SUBST(FLAG_OCTEON2) |
| 1783 | |
| 1784 | |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1785 | # does this compiler support -mmmx ? |
| 1786 | AC_MSG_CHECKING([if gcc accepts -mmmx]) |
| 1787 | |
| 1788 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1789 | CFLAGS="-mmmx -Werror" |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1790 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1791 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1792 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1793 | ]])], [ |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1794 | FLAG_MMMX="-mmmx" |
| 1795 | AC_MSG_RESULT([yes]) |
| 1796 | ], [ |
| 1797 | FLAG_MMMX="" |
| 1798 | AC_MSG_RESULT([no]) |
| 1799 | ]) |
| 1800 | CFLAGS=$safe_CFLAGS |
| 1801 | |
| 1802 | AC_SUBST(FLAG_MMMX) |
| 1803 | |
| 1804 | |
| 1805 | # does this compiler support -msse ? |
| 1806 | AC_MSG_CHECKING([if gcc accepts -msse]) |
| 1807 | |
| 1808 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1809 | CFLAGS="-msse -Werror" |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1810 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1811 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1812 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1813 | ]])], [ |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1814 | FLAG_MSSE="-msse" |
| 1815 | AC_MSG_RESULT([yes]) |
| 1816 | ], [ |
| 1817 | FLAG_MSSE="" |
| 1818 | AC_MSG_RESULT([no]) |
| 1819 | ]) |
| 1820 | CFLAGS=$safe_CFLAGS |
| 1821 | |
| 1822 | AC_SUBST(FLAG_MSSE) |
| 1823 | |
| 1824 | |
sewardj | 98977e0 | 2014-09-05 20:00:22 +0000 | [diff] [blame] | 1825 | # does this compiler support -mpreferred-stack-boundary=2 when |
| 1826 | # generating code for a 32-bit target? Note that we only care about |
| 1827 | # this when generating code for (32-bit) x86, so if the compiler |
| 1828 | # doesn't recognise -m32 it's no big deal. We'll just get code for |
| 1829 | # the Memcheck and other helper functions, that is a bit slower than |
| 1830 | # it could be, on x86; and no difference at all on any other platform. |
| 1831 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1832 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1833 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1834 | CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror" |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1835 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1836 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1837 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1838 | ]])], [ |
sewardj | 98977e0 | 2014-09-05 20:00:22 +0000 | [diff] [blame] | 1839 | PREFERRED_STACK_BOUNDARY_2="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1840 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1841 | ], [ |
sewardj | 98977e0 | 2014-09-05 20:00:22 +0000 | [diff] [blame] | 1842 | PREFERRED_STACK_BOUNDARY_2="" |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1843 | AC_MSG_RESULT([no]) |
| 1844 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1845 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1846 | |
sewardj | 98977e0 | 2014-09-05 20:00:22 +0000 | [diff] [blame] | 1847 | AC_SUBST(PREFERRED_STACK_BOUNDARY_2) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1848 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1849 | |
mjw | ab69b4a | 2014-08-20 16:11:53 +0000 | [diff] [blame] | 1850 | # Convenience function to check whether GCC supports a particular |
florian | 3d53d08 | 2015-06-05 17:09:57 +0000 | [diff] [blame] | 1851 | # warning option. Takes two arguments, |
mjw | ab69b4a | 2014-08-20 16:11:53 +0000 | [diff] [blame] | 1852 | # first the warning flag name to check (without -W), then the |
| 1853 | # substitution name to set with -Wno-warning-flag if the flag exists, |
| 1854 | # or the empty string if the compiler doesn't accept the flag. Note |
| 1855 | # that checking is done against the warning flag itself, but the |
| 1856 | # substitution is then done to cancel the warning flag. |
| 1857 | AC_DEFUN([AC_GCC_WARNING_SUBST_NO],[ |
sewardj | a3a27fe | 2014-09-01 21:16:02 +0000 | [diff] [blame] | 1858 | AC_MSG_CHECKING([if gcc accepts -W$1]) |
| 1859 | safe_CFLAGS=$CFLAGS |
florian | 02ffb77 | 2015-06-05 21:19:06 +0000 | [diff] [blame] | 1860 | CFLAGS="-W$1 -Werror" |
sewardj | a3a27fe | 2014-09-01 21:16:02 +0000 | [diff] [blame] | 1861 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [ |
| 1862 | AC_SUBST([$2], [-Wno-$1]) |
| 1863 | AC_MSG_RESULT([yes])], [ |
| 1864 | AC_SUBST([$2], []) |
| 1865 | AC_MSG_RESULT([no])]) |
| 1866 | CFLAGS=$safe_CFLAGS |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1867 | ]) |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1868 | |
florian | 26a790a | 2014-12-03 22:53:00 +0000 | [diff] [blame] | 1869 | # Convenience function. Like AC_GCC_WARNING_SUBST_NO, except it substitutes |
| 1870 | # -W$1 (instead of -Wno-$1). |
| 1871 | AC_DEFUN([AC_GCC_WARNING_SUBST],[ |
| 1872 | AC_MSG_CHECKING([if gcc accepts -W$1]) |
| 1873 | safe_CFLAGS=$CFLAGS |
florian | 02ffb77 | 2015-06-05 21:19:06 +0000 | [diff] [blame] | 1874 | CFLAGS="-W$1 -Werror" |
florian | 26a790a | 2014-12-03 22:53:00 +0000 | [diff] [blame] | 1875 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [ |
| 1876 | AC_SUBST([$2], [-W$1]) |
| 1877 | AC_MSG_RESULT([yes])], [ |
| 1878 | AC_SUBST([$2], []) |
| 1879 | AC_MSG_RESULT([no])]) |
| 1880 | CFLAGS=$safe_CFLAGS |
| 1881 | ]) |
| 1882 | |
mjw | ab69b4a | 2014-08-20 16:11:53 +0000 | [diff] [blame] | 1883 | AC_GCC_WARNING_SUBST_NO([nonnull], [FLAG_W_NO_NONNULL]) |
| 1884 | AC_GCC_WARNING_SUBST_NO([overflow], [FLAG_W_NO_OVERFLOW]) |
florian | 3d53d08 | 2015-06-05 17:09:57 +0000 | [diff] [blame] | 1885 | AC_GCC_WARNING_SUBST_NO([pointer-sign], [FLAG_W_NO_POINTER_SIGN]) |
mjw | ab69b4a | 2014-08-20 16:11:53 +0000 | [diff] [blame] | 1886 | AC_GCC_WARNING_SUBST_NO([uninitialized], [FLAG_W_NO_UNINITIALIZED]) |
florian | 807c454 | 2014-09-05 18:30:05 +0000 | [diff] [blame] | 1887 | AC_GCC_WARNING_SUBST_NO([unused-function], [FLAG_W_NO_UNUSED_FUNCTION]) |
| 1888 | AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INLINE]) |
florian | 26a790a | 2014-12-03 22:53:00 +0000 | [diff] [blame] | 1889 | AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS]) |
florian | 54681bf | 2015-06-05 16:26:14 +0000 | [diff] [blame] | 1890 | AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY]) |
florian | 26a790a | 2014-12-03 22:53:00 +0000 | [diff] [blame] | 1891 | AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT]) |
florian | 26a790a | 2014-12-03 22:53:00 +0000 | [diff] [blame] | 1892 | AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL]) |
florian | 9069406 | 2015-05-16 16:17:52 +0000 | [diff] [blame] | 1893 | AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION]) |
| 1894 | AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS]) |
| 1895 | AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE]) |
sewardj | a3a27fe | 2014-09-01 21:16:02 +0000 | [diff] [blame] | 1896 | |
florian | e1988aa | 2015-06-09 21:44:58 +0000 | [diff] [blame] | 1897 | # Does this compiler support -Wformat-security ? |
| 1898 | # Special handling is needed, because certain GCC versions require -Wformat |
| 1899 | # being present if -Wformat-security is given. Otherwise a warning is issued. |
| 1900 | # However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale). |
| 1901 | # And with that the warning will be turned into an error with the result |
| 1902 | # that -Wformat-security is believed to be unsupported when in fact it is. |
| 1903 | AC_MSG_CHECKING([if gcc accepts -Wformat-security]) |
| 1904 | safe_CFLAGS=$CFLAGS |
| 1905 | CFLAGS="-Wformat -Wformat-security -Werror" |
| 1906 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [ |
| 1907 | AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security]) |
| 1908 | AC_MSG_RESULT([yes])], [ |
| 1909 | AC_SUBST([FLAG_W_FORMAT_SECURITY], []) |
| 1910 | AC_MSG_RESULT([no])]) |
| 1911 | CFLAGS=$safe_CFLAGS |
| 1912 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1913 | # does this compiler support -Wextra or the older -W ? |
| 1914 | |
| 1915 | AC_MSG_CHECKING([if gcc accepts -Wextra or -W]) |
| 1916 | |
| 1917 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1918 | CFLAGS="-Wextra -Werror" |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1919 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1920 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1921 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1922 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1923 | AC_SUBST([FLAG_W_EXTRA], [-Wextra]) |
| 1924 | AC_MSG_RESULT([-Wextra]) |
| 1925 | ], [ |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1926 | CFLAGS="-W -Werror" |
sewardj | 9bdf2a6 | 2011-10-27 06:22:23 +0000 | [diff] [blame] | 1927 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1928 | return 0; |
sewardj | 9bdf2a6 | 2011-10-27 06:22:23 +0000 | [diff] [blame] | 1929 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1930 | AC_SUBST([FLAG_W_EXTRA], [-W]) |
| 1931 | AC_MSG_RESULT([-W]) |
| 1932 | ], [ |
| 1933 | AC_SUBST([FLAG_W_EXTRA], []) |
| 1934 | AC_MSG_RESULT([not supported]) |
| 1935 | ]) |
| 1936 | ]) |
| 1937 | CFLAGS=$safe_CFLAGS |
| 1938 | |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1939 | # does this compiler support -fno-stack-protector ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1940 | AC_MSG_CHECKING([if gcc accepts -fno-stack-protector]) |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1941 | |
| 1942 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1943 | CFLAGS="-fno-stack-protector -Werror" |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1944 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1945 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1946 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1947 | ]])], [ |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1948 | no_stack_protector=yes |
| 1949 | FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector" |
| 1950 | AC_MSG_RESULT([yes]) |
| 1951 | ], [ |
| 1952 | no_stack_protector=no |
| 1953 | FLAG_FNO_STACK_PROTECTOR="" |
| 1954 | AC_MSG_RESULT([no]) |
| 1955 | ]) |
| 1956 | CFLAGS=$safe_CFLAGS |
| 1957 | |
| 1958 | AC_SUBST(FLAG_FNO_STACK_PROTECTOR) |
| 1959 | |
mjw | 3791507 | 2015-06-02 20:23:06 +0000 | [diff] [blame] | 1960 | # Does GCC support disabling Identical Code Folding? |
| 1961 | # We want to disabled Identical Code Folding for the |
| 1962 | # tools preload shared objects to get better backraces. |
| 1963 | # For GCC 5.1+ -fipa-icf is enabled by default at -O2. |
| 1964 | # "The optimization reduces code size and may disturb |
| 1965 | # unwind stacks by replacing a function by equivalent |
| 1966 | # one with a different name." |
| 1967 | AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf]) |
| 1968 | |
| 1969 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 1970 | CFLAGS="-fno-ipa-icf -Werror" |
mjw | 3791507 | 2015-06-02 20:23:06 +0000 | [diff] [blame] | 1971 | |
| 1972 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1973 | return 0; |
| 1974 | ]])], [ |
| 1975 | no_ipa_icf=yes |
| 1976 | FLAG_FNO_IPA_ICF="-fno-ipa-icf" |
| 1977 | AC_MSG_RESULT([yes]) |
| 1978 | ], [ |
| 1979 | no_ipa_icf=no |
| 1980 | FLAG_FNO_IPA_ICF="" |
| 1981 | AC_MSG_RESULT([no]) |
| 1982 | ]) |
| 1983 | CFLAGS=$safe_CFLAGS |
| 1984 | |
| 1985 | AC_SUBST(FLAG_FNO_IPA_ICF) |
| 1986 | |
florian | bb1a787 | 2015-03-10 16:13:59 +0000 | [diff] [blame] | 1987 | |
florian | 3878e16 | 2015-06-23 20:31:52 +0000 | [diff] [blame] | 1988 | # Does this compiler support -fsanitize=undefined. This is true for |
| 1989 | # GCC 4.9 and newer. However, the undefined behaviour sanitiser in GCC 5.1 |
| 1990 | # also checks for alignment violations on memory accesses which the valgrind |
| 1991 | # code base is sprinkled (if not littered) with. As those alignment issues |
| 1992 | # don't pose a problem we want to suppress warnings about them. |
| 1993 | # In GCC 5.1 this can be done by passing -fno-sanitize=alignment. Earlier |
| 1994 | # GCCs do not support that. |
| 1995 | # |
florian | bb1a787 | 2015-03-10 16:13:59 +0000 | [diff] [blame] | 1996 | # Only checked for if --enable-ubsan was given. |
| 1997 | if test "x${vg_cv_ubsan}" = "xyes"; then |
florian | 3878e16 | 2015-06-23 20:31:52 +0000 | [diff] [blame] | 1998 | AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined -fno-sanitize=alignment]) |
florian | bb1a787 | 2015-03-10 16:13:59 +0000 | [diff] [blame] | 1999 | safe_CFLAGS=$CFLAGS |
florian | 3878e16 | 2015-06-23 20:31:52 +0000 | [diff] [blame] | 2000 | CFLAGS="-fsanitize=undefined -fno-sanitize=alignment -Werror" |
| 2001 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2002 | return 0; |
| 2003 | ]])], [ |
| 2004 | FLAG_FSANITIZE="-fsanitize=undefined -fno-sanitize=alignment" |
| 2005 | LIB_UBSAN="-static-libubsan" |
| 2006 | AC_MSG_RESULT([yes]) |
| 2007 | ], [ |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 2008 | CFLAGS="-fsanitize=undefined -Werror" |
florian | bb1a787 | 2015-03-10 16:13:59 +0000 | [diff] [blame] | 2009 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2010 | return 0; |
| 2011 | ]])], [ |
| 2012 | FLAG_FSANITIZE="-fsanitize=undefined" |
| 2013 | LIB_UBSAN="-static-libubsan" |
| 2014 | AC_MSG_RESULT([yes]) |
| 2015 | ], [ |
| 2016 | FLAG_FSANITIZE="" |
| 2017 | LIB_UBSAN="" |
| 2018 | AC_MSG_RESULT([no]) |
| 2019 | ]) |
florian | 3878e16 | 2015-06-23 20:31:52 +0000 | [diff] [blame] | 2020 | ]) |
florian | bb1a787 | 2015-03-10 16:13:59 +0000 | [diff] [blame] | 2021 | CFLAGS=$safe_CFLAGS |
| 2022 | AC_SUBST(FLAG_FSANITIZE) |
| 2023 | AC_SUBST(LIB_UBSAN) |
| 2024 | fi |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 2025 | # does this compiler support --param inline-unit-growth=... ? |
| 2026 | |
| 2027 | AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth]) |
| 2028 | |
| 2029 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 2030 | CFLAGS="--param inline-unit-growth=900 -Werror" |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 2031 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2032 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 2033 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2034 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 2035 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], |
| 2036 | ["--param inline-unit-growth=900"]) |
| 2037 | AC_MSG_RESULT([yes]) |
| 2038 | ], [ |
| 2039 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""]) |
| 2040 | AC_MSG_RESULT([no]) |
| 2041 | ]) |
| 2042 | CFLAGS=$safe_CFLAGS |
| 2043 | |
| 2044 | |
sewardj | d935068 | 2012-04-05 07:55:47 +0000 | [diff] [blame] | 2045 | # does this compiler support -gdwarf-4 -fdebug-types-section ? |
| 2046 | |
| 2047 | AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section]) |
| 2048 | |
| 2049 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 2050 | CFLAGS="-gdwarf-4 -fdebug-types-section -Werror" |
sewardj | d935068 | 2012-04-05 07:55:47 +0000 | [diff] [blame] | 2051 | |
| 2052 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
| 2053 | return 0; |
| 2054 | ]])], [ |
| 2055 | ac_have_dwarf4=yes |
| 2056 | AC_MSG_RESULT([yes]) |
| 2057 | ], [ |
| 2058 | ac_have_dwarf4=no |
| 2059 | AC_MSG_RESULT([no]) |
| 2060 | ]) |
| 2061 | AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes) |
| 2062 | CFLAGS=$safe_CFLAGS |
| 2063 | |
| 2064 | |
florian | 3df0211 | 2013-10-04 11:35:50 +0000 | [diff] [blame] | 2065 | # does this compiler support nested functions ? |
| 2066 | |
| 2067 | AC_MSG_CHECKING([if gcc accepts nested functions]) |
| 2068 | |
| 2069 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2070 | int foo() { return 1; } |
| 2071 | return foo(); |
| 2072 | ]])], [ |
| 2073 | ac_have_nested_functions=yes |
| 2074 | AC_MSG_RESULT([yes]) |
| 2075 | ], [ |
| 2076 | ac_have_nested_functions=no |
| 2077 | AC_MSG_RESULT([no]) |
| 2078 | ]) |
| 2079 | AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes]) |
| 2080 | |
| 2081 | |
| 2082 | # does this compiler support the 'p' constraint in ASM statements ? |
| 2083 | |
| 2084 | AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements]) |
| 2085 | |
| 2086 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2087 | char *p; |
| 2088 | __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p)); |
| 2089 | ]])], [ |
| 2090 | ac_have_asm_constraint_p=yes |
| 2091 | AC_MSG_RESULT([yes]) |
| 2092 | ], [ |
| 2093 | ac_have_asm_constraint_p=no |
| 2094 | AC_MSG_RESULT([no]) |
| 2095 | ]) |
| 2096 | AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes]) |
| 2097 | |
| 2098 | |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 2099 | # We want to use use the -Ttext-segment option to the linker. |
| 2100 | # GNU (bfd) ld supports this directly. Newer GNU gold linkers |
| 2101 | # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext |
| 2102 | # semantics are NOT what we want (GNU gold -Ttext is fine). |
| 2103 | # |
| 2104 | # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers |
| 2105 | # will reside. -Ttext aligns just the .text section start (but not any |
| 2106 | # other section). |
| 2107 | # |
| 2108 | # So test for -Ttext-segment which is supported by all bfd ld versions |
| 2109 | # and use that if it exists. If it doesn't exist it must be an older |
| 2110 | # version of gold and we can fall back to using -Ttext which has the |
| 2111 | # right semantics. |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2112 | |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 2113 | AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2114 | |
| 2115 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 2116 | CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror" |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2117 | |
bart | 8508c75 | 2010-06-10 06:26:21 +0000 | [diff] [blame] | 2118 | AC_LINK_IFELSE( |
mjw | 941277a | 2013-04-17 19:11:05 +0000 | [diff] [blame] | 2119 | [AC_LANG_SOURCE([int _start () { return 0; }])], |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2120 | [ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 2121 | linker_using_t_text="no" |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 2122 | AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2123 | AC_MSG_RESULT([yes]) |
| 2124 | ], [ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 2125 | linker_using_t_text="yes" |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 2126 | AC_SUBST([FLAG_T_TEXT], ["-Ttext"]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2127 | AC_MSG_RESULT([no]) |
| 2128 | ]) |
| 2129 | CFLAGS=$safe_CFLAGS |
| 2130 | |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 2131 | # If the linker only supports -Ttext (not -Ttext-segment) then we will |
| 2132 | # have to strip any build-id ELF NOTEs from the staticly linked tools. |
| 2133 | # Otherwise the build-id NOTE might end up at the default load address. |
| 2134 | # (Pedantically if the linker is gold then -Ttext is fine, but newer |
| 2135 | # gold versions also support -Ttext-segment. So just assume that unless |
| 2136 | # we can use -Ttext-segment we need to strip the build-id NOTEs. |
florian | 51b14ee | 2014-02-22 18:38:32 +0000 | [diff] [blame] | 2137 | if test "x${linker_using_t_text}" = "xyes"; then |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 2138 | AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.]) |
| 2139 | # does the linker support -Wl,--build-id=none ? Note, it's |
| 2140 | # important that we test indirectly via whichever C compiler |
| 2141 | # is selected, rather than testing /usr/bin/ld or whatever |
| 2142 | # directly. |
| 2143 | AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none]) |
| 2144 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 2145 | CFLAGS="-Wl,--build-id=none -Werror" |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 2146 | |
| 2147 | AC_LINK_IFELSE( |
| 2148 | [AC_LANG_PROGRAM([ ], [return 0;])], |
| 2149 | [ |
| 2150 | AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"]) |
| 2151 | AC_MSG_RESULT([yes]) |
| 2152 | ], [ |
| 2153 | AC_SUBST([FLAG_NO_BUILD_ID], [""]) |
| 2154 | AC_MSG_RESULT([no]) |
| 2155 | ]) |
| 2156 | else |
| 2157 | AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.]) |
| 2158 | AC_SUBST([FLAG_NO_BUILD_ID], [""]) |
| 2159 | fi |
| 2160 | CFLAGS=$safe_CFLAGS |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 2161 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 2162 | # does the ppc assembler support "mtocrf" et al? |
| 2163 | AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) |
| 2164 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2165 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | dd4cbe1 | 2006-03-12 17:27:44 +0000 | [diff] [blame] | 2166 | __asm__ __volatile__("mtocrf 4,0"); |
| 2167 | __asm__ __volatile__("mfocrf 0,4"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2168 | ]])], [ |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 2169 | ac_have_as_ppc_mftocrf=yes |
| 2170 | AC_MSG_RESULT([yes]) |
| 2171 | ], [ |
| 2172 | ac_have_as_ppc_mftocrf=no |
| 2173 | AC_MSG_RESULT([no]) |
| 2174 | ]) |
| 2175 | if test x$ac_have_as_ppc_mftocrf = xyes ; then |
| 2176 | AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.]) |
| 2177 | fi |
| 2178 | |
| 2179 | |
carll | 1e5fa2f | 2013-08-09 21:55:45 +0000 | [diff] [blame] | 2180 | # does the ppc assembler support "lfdp" and other phased out floating point insns? |
| 2181 | AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions]) |
| 2182 | |
| 2183 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2184 | do { typedef struct { |
| 2185 | double hi; |
| 2186 | double lo; |
| 2187 | } dbl_pair_t; |
| 2188 | dbl_pair_t dbl_pair[3]; |
| 2189 | __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0])); |
| 2190 | } while (0) |
| 2191 | ]])], [ |
| 2192 | ac_have_as_ppc_fpPO=yes |
| 2193 | AC_MSG_RESULT([yes]) |
| 2194 | ], [ |
| 2195 | ac_have_as_ppc_fpPO=no |
| 2196 | AC_MSG_RESULT([no]) |
| 2197 | ]) |
| 2198 | if test x$ac_have_as_ppc_fpPO = xyes ; then |
| 2199 | AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.]) |
| 2200 | fi |
| 2201 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 2202 | |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 2203 | # does the x86/amd64 assembler understand SSE3 instructions? |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 2204 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2205 | # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 2206 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3]) |
| 2207 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2208 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 2209 | do { long long int x; |
| 2210 | __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); } |
| 2211 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2212 | ]])], [ |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 2213 | ac_have_as_sse3=yes |
| 2214 | AC_MSG_RESULT([yes]) |
| 2215 | ], [ |
| 2216 | ac_have_as_sse3=no |
| 2217 | AC_MSG_RESULT([no]) |
| 2218 | ]) |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 2219 | |
| 2220 | AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes) |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 2221 | |
| 2222 | |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 2223 | # Ditto for SSSE3 instructions (note extra S) |
| 2224 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2225 | # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's |
| 2226 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3]) |
| 2227 | |
florian | c443b96 | 2011-10-28 21:37:19 +0000 | [diff] [blame] | 2228 | save_CFLAGS="$CFLAGS" |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 2229 | CFLAGS="$CFLAGS -msse -Werror" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2230 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 2231 | do { long long int x; |
| 2232 | __asm__ __volatile__( |
| 2233 | "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); } |
| 2234 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2235 | ]])], [ |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 2236 | ac_have_as_ssse3=yes |
| 2237 | AC_MSG_RESULT([yes]) |
| 2238 | ], [ |
| 2239 | ac_have_as_ssse3=no |
| 2240 | AC_MSG_RESULT([no]) |
| 2241 | ]) |
florian | c443b96 | 2011-10-28 21:37:19 +0000 | [diff] [blame] | 2242 | CFLAGS="$save_CFLAGS" |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 2243 | |
| 2244 | AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) |
| 2245 | |
| 2246 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2247 | # does the x86/amd64 assembler understand the PCLMULQDQ instruction? |
| 2248 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2249 | # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 2250 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq']) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2251 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 2252 | do { |
| 2253 | __asm__ __volatile__( |
| 2254 | "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); } |
| 2255 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2256 | ]])], [ |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 2257 | ac_have_as_pclmulqdq=yes |
| 2258 | AC_MSG_RESULT([yes]) |
| 2259 | ], [ |
| 2260 | ac_have_as_pclmulqdq=no |
| 2261 | AC_MSG_RESULT([no]) |
| 2262 | ]) |
| 2263 | |
| 2264 | AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes) |
| 2265 | |
| 2266 | |
bart | 9bbe2bb | 2012-08-03 19:37:02 +0000 | [diff] [blame] | 2267 | # does the x86/amd64 assembler understand the VPCLMULQDQ instruction? |
| 2268 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2269 | # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's |
| 2270 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq']) |
| 2271 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2272 | do { |
| 2273 | /* |
| 2274 | * Carry-less multiplication of xmm1 with xmm2 and store the result in |
| 2275 | * xmm3. The immediate is used to determine which quadwords of xmm1 and |
| 2276 | * xmm2 should be used. |
| 2277 | */ |
| 2278 | __asm__ __volatile__( |
| 2279 | "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : ); |
| 2280 | } while (0) |
| 2281 | ]])], [ |
| 2282 | ac_have_as_vpclmulqdq=yes |
| 2283 | AC_MSG_RESULT([yes]) |
| 2284 | ], [ |
| 2285 | ac_have_as_vpclmulqdq=no |
| 2286 | AC_MSG_RESULT([no]) |
| 2287 | ]) |
| 2288 | |
| 2289 | AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes) |
| 2290 | |
| 2291 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2292 | # does the x86/amd64 assembler understand the LZCNT instruction? |
| 2293 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2294 | # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 2295 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt']) |
| 2296 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2297 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 2298 | do { |
sewardj | c62291c | 2012-07-22 11:10:08 +0000 | [diff] [blame] | 2299 | __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax"); |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 2300 | } while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2301 | ]])], [ |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 2302 | ac_have_as_lzcnt=yes |
| 2303 | AC_MSG_RESULT([yes]) |
| 2304 | ], [ |
| 2305 | ac_have_as_lzcnt=no |
| 2306 | AC_MSG_RESULT([no]) |
| 2307 | ]) |
| 2308 | |
| 2309 | AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes]) |
| 2310 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2311 | |
florian | 3df0211 | 2013-10-04 11:35:50 +0000 | [diff] [blame] | 2312 | # does the x86/amd64 assembler understand the LOOPNEL instruction? |
| 2313 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2314 | # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's |
| 2315 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel']) |
| 2316 | |
| 2317 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2318 | do { |
| 2319 | __asm__ __volatile__("1: loopnel 1b\n"); |
| 2320 | } while (0) |
| 2321 | ]])], [ |
| 2322 | ac_have_as_loopnel=yes |
| 2323 | AC_MSG_RESULT([yes]) |
| 2324 | ], [ |
| 2325 | ac_have_as_loopnel=no |
| 2326 | AC_MSG_RESULT([no]) |
| 2327 | ]) |
| 2328 | |
| 2329 | AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes]) |
| 2330 | |
| 2331 | |
| 2332 | # does the x86/amd64 assembler understand ADDR32 ? |
| 2333 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2334 | # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's |
| 2335 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32']) |
| 2336 | |
| 2337 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2338 | do { |
| 2339 | asm volatile ("addr32 rep movsb"); |
| 2340 | } while (0) |
| 2341 | ]])], [ |
| 2342 | ac_have_as_addr32=yes |
| 2343 | AC_MSG_RESULT([yes]) |
| 2344 | ], [ |
| 2345 | ac_have_as_addr32=no |
| 2346 | AC_MSG_RESULT([no]) |
| 2347 | ]) |
| 2348 | |
| 2349 | AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes]) |
| 2350 | |
| 2351 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2352 | # does the x86/amd64 assembler understand SSE 4.2 instructions? |
| 2353 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2354 | # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's |
| 2355 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2]) |
| 2356 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2357 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2358 | do { long long int x; |
| 2359 | __asm__ __volatile__( |
florian | fdfca22 | 2012-01-17 13:16:50 +0000 | [diff] [blame] | 2360 | "crc32q %%r15,%%r15" : : : "r15" ); |
| 2361 | __asm__ __volatile__( |
sewardj | c62291c | 2012-07-22 11:10:08 +0000 | [diff] [blame] | 2362 | "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11"); |
| 2363 | __asm__ __volatile__( |
| 2364 | "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); } |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2365 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2366 | ]])], [ |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2367 | ac_have_as_sse42=yes |
| 2368 | AC_MSG_RESULT([yes]) |
| 2369 | ], [ |
| 2370 | ac_have_as_sse42=no |
| 2371 | AC_MSG_RESULT([no]) |
| 2372 | ]) |
| 2373 | |
| 2374 | AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes) |
| 2375 | |
| 2376 | |
sewardj | 9fb31ca | 2012-06-05 00:31:49 +0000 | [diff] [blame] | 2377 | # does the x86/amd64 assembler understand AVX instructions? |
| 2378 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2379 | # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's |
| 2380 | AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX]) |
| 2381 | |
| 2382 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2383 | do { long long int x; |
| 2384 | __asm__ __volatile__( |
| 2385 | "vmovupd (%%rsp), %%ymm7" : : : "xmm7" ); |
| 2386 | __asm__ __volatile__( |
| 2387 | "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); } |
| 2388 | while (0) |
| 2389 | ]])], [ |
| 2390 | ac_have_as_avx=yes |
| 2391 | AC_MSG_RESULT([yes]) |
| 2392 | ], [ |
| 2393 | ac_have_as_avx=no |
| 2394 | AC_MSG_RESULT([no]) |
| 2395 | ]) |
| 2396 | |
| 2397 | AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes) |
| 2398 | |
| 2399 | |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2400 | # does the x86/amd64 assembler understand AVX2 instructions? |
| 2401 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2402 | # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's |
| 2403 | AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2]) |
| 2404 | |
| 2405 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2406 | do { long long int x; |
| 2407 | __asm__ __volatile__( |
| 2408 | "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" ); |
| 2409 | __asm__ __volatile__( |
| 2410 | "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); } |
| 2411 | while (0) |
| 2412 | ]])], [ |
| 2413 | ac_have_as_avx2=yes |
| 2414 | AC_MSG_RESULT([yes]) |
| 2415 | ], [ |
| 2416 | ac_have_as_avx2=no |
| 2417 | AC_MSG_RESULT([no]) |
| 2418 | ]) |
| 2419 | |
| 2420 | AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes) |
| 2421 | |
| 2422 | |
sewardj | 9ea080b | 2013-10-16 08:53:07 +0000 | [diff] [blame] | 2423 | # does the x86/amd64 assembler understand TSX instructions and |
| 2424 | # the XACQUIRE/XRELEASE prefixes? |
florian | 364c365 | 2013-09-30 16:32:53 +0000 | [diff] [blame] | 2425 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2426 | # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's |
| 2427 | AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX]) |
| 2428 | |
| 2429 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2430 | do { |
| 2431 | __asm__ __volatile__( |
| 2432 | " xbegin Lfoo \n\t" |
sewardj | 9ea080b | 2013-10-16 08:53:07 +0000 | [diff] [blame] | 2433 | "Lfoo: xend \n\t" |
| 2434 | " xacquire lock incq 0(%rsp) \n\t" |
| 2435 | " xrelease lock incq 0(%rsp) \n" |
| 2436 | ); |
florian | 364c365 | 2013-09-30 16:32:53 +0000 | [diff] [blame] | 2437 | } while (0) |
| 2438 | ]])], [ |
| 2439 | ac_have_as_tsx=yes |
| 2440 | AC_MSG_RESULT([yes]) |
| 2441 | ], [ |
| 2442 | ac_have_as_tsx=no |
| 2443 | AC_MSG_RESULT([no]) |
| 2444 | ]) |
| 2445 | |
| 2446 | AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes) |
| 2447 | |
| 2448 | |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2449 | # does the x86/amd64 assembler understand BMI1 and BMI2 instructions? |
| 2450 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2451 | # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's |
| 2452 | AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2]) |
| 2453 | |
| 2454 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2455 | do { unsigned int h, l; |
florian | 4e94bda | 2014-10-29 13:57:49 +0000 | [diff] [blame] | 2456 | __asm__ __volatile__( "mulx %rax,%rcx,%r8" ); |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2457 | __asm__ __volatile__( |
sewardj | e222efc | 2013-03-27 21:59:21 +0000 | [diff] [blame] | 2458 | "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) ); |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2459 | __asm__ __volatile__( |
sewardj | e222efc | 2013-03-27 21:59:21 +0000 | [diff] [blame] | 2460 | "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); } |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2461 | while (0) |
| 2462 | ]])], [ |
| 2463 | ac_have_as_bmi=yes |
| 2464 | AC_MSG_RESULT([yes]) |
| 2465 | ], [ |
| 2466 | ac_have_as_bmi=no |
| 2467 | AC_MSG_RESULT([no]) |
| 2468 | ]) |
| 2469 | |
| 2470 | AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes) |
| 2471 | |
| 2472 | |
| 2473 | # does the x86/amd64 assembler understand FMA instructions? |
| 2474 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2475 | # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's |
| 2476 | AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA]) |
| 2477 | |
| 2478 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2479 | do { unsigned int h, l; |
| 2480 | __asm__ __volatile__( |
| 2481 | "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" ); |
| 2482 | __asm__ __volatile__( |
| 2483 | "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); |
| 2484 | __asm__ __volatile__( |
| 2485 | "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); } |
| 2486 | while (0) |
| 2487 | ]])], [ |
| 2488 | ac_have_as_fma=yes |
| 2489 | AC_MSG_RESULT([yes]) |
| 2490 | ], [ |
| 2491 | ac_have_as_fma=no |
| 2492 | AC_MSG_RESULT([no]) |
| 2493 | ]) |
| 2494 | |
| 2495 | AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes) |
| 2496 | |
| 2497 | |
mjw | 20bafc2 | 2014-05-09 11:41:46 +0000 | [diff] [blame] | 2498 | # does the amd64 assembler understand MPX instructions? |
| 2499 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2500 | # automake-level symbol (BUILD_MPX_TESTS), used in test Makefile.am's |
| 2501 | AC_MSG_CHECKING([if amd64 assembler knows the MPX instructions]) |
| 2502 | |
| 2503 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
florian | 404c0c7 | 2014-12-12 17:44:36 +0000 | [diff] [blame] | 2504 | do { |
| 2505 | asm ("bndmov %bnd0,(%rsp)"); |
| 2506 | asm ("bndldx 3(%rbx,%rdx), %bnd2"); |
| 2507 | } while (0) |
mjw | 20bafc2 | 2014-05-09 11:41:46 +0000 | [diff] [blame] | 2508 | ]])], [ |
| 2509 | ac_have_as_mpx=yes |
| 2510 | AC_MSG_RESULT([yes]) |
| 2511 | ], [ |
| 2512 | ac_have_as_mpx=no |
| 2513 | AC_MSG_RESULT([no]) |
| 2514 | ]) |
| 2515 | |
| 2516 | AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes) |
| 2517 | |
| 2518 | |
| 2519 | # Does the C compiler support the "ifunc" attribute |
| 2520 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2521 | # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's |
sewardj | b08d84d | 2012-07-16 08:23:26 +0000 | [diff] [blame] | 2522 | # does the x86/amd64 assembler understand MOVBE? |
| 2523 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2524 | # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's |
| 2525 | AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn]) |
| 2526 | |
| 2527 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2528 | do { long long int x; |
| 2529 | __asm__ __volatile__( |
sewardj | c62291c | 2012-07-22 11:10:08 +0000 | [diff] [blame] | 2530 | "movbe (%%rsp), %%r15" : : : "memory", "r15" ); } |
sewardj | b08d84d | 2012-07-16 08:23:26 +0000 | [diff] [blame] | 2531 | while (0) |
| 2532 | ]])], [ |
| 2533 | ac_have_as_movbe=yes |
| 2534 | AC_MSG_RESULT([yes]) |
| 2535 | ], [ |
| 2536 | ac_have_as_movbe=no |
| 2537 | AC_MSG_RESULT([no]) |
| 2538 | ]) |
| 2539 | |
| 2540 | AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes) |
| 2541 | |
| 2542 | |
florian | 251c2f9 | 2012-07-05 21:21:37 +0000 | [diff] [blame] | 2543 | # Does the C compiler support the "ifunc" attribute |
| 2544 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2545 | # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's |
| 2546 | AC_MSG_CHECKING([if gcc supports the ifunc attribute]) |
| 2547 | |
florian | f78a503 | 2012-07-06 09:17:29 +0000 | [diff] [blame] | 2548 | AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
| 2549 | static void mytest(void) {} |
| 2550 | |
| 2551 | static void (*resolve_test(void))(void) |
| 2552 | { |
| 2553 | return (void (*)(void))&mytest; |
| 2554 | } |
| 2555 | |
| 2556 | void test(void) __attribute__((ifunc("resolve_test"))); |
| 2557 | |
| 2558 | int main() |
| 2559 | { |
| 2560 | test(); |
| 2561 | return 0; |
| 2562 | } |
florian | 251c2f9 | 2012-07-05 21:21:37 +0000 | [diff] [blame] | 2563 | ]])], [ |
| 2564 | ac_have_ifunc_attr=yes |
| 2565 | AC_MSG_RESULT([yes]) |
| 2566 | ], [ |
| 2567 | ac_have_ifunc_attr=no |
| 2568 | AC_MSG_RESULT([no]) |
| 2569 | ]) |
| 2570 | |
| 2571 | AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes) |
| 2572 | |
| 2573 | |
sewardj | e089f01 | 2010-10-13 21:47:29 +0000 | [diff] [blame] | 2574 | # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this |
| 2575 | # when building the tool executables. I think we should get rid of it. |
| 2576 | # |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 2577 | # Check for TLS support in the compiler and linker |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 2578 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 2579 | [[return foo;]])], |
| 2580 | [vg_cv_linktime_tls=yes], |
| 2581 | [vg_cv_linktime_tls=no]) |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 2582 | # Native compilation: check whether running a program using TLS succeeds. |
| 2583 | # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs |
| 2584 | # succeeds but running programs using TLS fails. |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 2585 | # Cross-compiling: check whether linking a program using TLS succeeds. |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 2586 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 2587 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 2588 | [vg_cv_tls=$enableval], |
| 2589 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 2590 | [[return foo;]])], |
| 2591 | [vg_cv_tls=yes], |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 2592 | [vg_cv_tls=no], |
| 2593 | [vg_cv_tls=$vg_cv_linktime_tls])])]) |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 2594 | |
rhyskidd | 34cba1b | 2015-06-08 08:56:33 +0000 | [diff] [blame] | 2595 | if test "$vg_cv_tls" = yes -a $is_clang != applellvm; then |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 2596 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 2597 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 2598 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 2599 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2600 | #---------------------------------------------------------------------------- |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 2601 | # Solaris-specific checks. |
| 2602 | #---------------------------------------------------------------------------- |
| 2603 | |
| 2604 | if test "$VGCONF_OS" = "solaris" ; then |
| 2605 | # Solaris-specific check determining if the Sun Studio Assembler is used to |
| 2606 | # build Valgrind. The test checks if the x86/amd64 assembler understands the |
| 2607 | # cmovl.l instruction, if yes then it's Sun Assembler. |
| 2608 | # |
| 2609 | # C-level symbol: none |
| 2610 | # Automake-level symbol: SOLARIS_SUN_STUDIO_AS |
| 2611 | # |
| 2612 | AC_MSG_CHECKING([if x86/amd64 assembler speaks cmovl.l (Solaris-specific)]) |
| 2613 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2614 | ]], [[ |
| 2615 | __asm__ __volatile__("cmovl.l %edx, %eax"); |
| 2616 | ]])], [ |
| 2617 | solaris_have_sun_studio_as=yes |
| 2618 | AC_MSG_RESULT([yes]) |
| 2619 | ], [ |
| 2620 | solaris_have_sun_studio_as=no |
| 2621 | AC_MSG_RESULT([no]) |
| 2622 | ]) |
| 2623 | AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes) |
| 2624 | |
| 2625 | # Solaris-specific check determining if symbols __xpg4 and __xpg6 |
| 2626 | # are present in linked elfs when gcc is invoked with -std=gnu99. |
| 2627 | # See solaris/vgpreload-solaris.mapfile for details. |
| 2628 | # gcc on Solaris instructs linker to include these symbols, |
| 2629 | # gcc on illumos does not. |
| 2630 | # |
| 2631 | # C-level symbol: none |
| 2632 | # Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT |
| 2633 | # |
| 2634 | save_CFLAGS="$CFLAGS" |
| 2635 | CFLAGS="$CFLAGS -std=gnu99" |
| 2636 | AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)]) |
| 2637 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
| 2638 | #include <limits.h> |
| 2639 | #include <stdio.h> |
| 2640 | #include <stdlib.h> |
| 2641 | |
| 2642 | int main(int argc, const char *argv[]) { |
| 2643 | char command[PATH_MAX + 50]; |
| 2644 | snprintf(command, sizeof(command), "nm %s | egrep '__xpg[4,6]'", argv[0]); |
| 2645 | |
| 2646 | FILE *output = popen(command, "r"); |
| 2647 | if (output == NULL) return -1; |
| 2648 | |
| 2649 | char buf[100]; |
| 2650 | if (fgets(buf, sizeof(buf), output) != NULL) { |
| 2651 | pclose(output); |
| 2652 | return 0; |
| 2653 | } else { |
| 2654 | pclose(output); |
| 2655 | return 1; |
| 2656 | } |
| 2657 | } |
| 2658 | ]])], [ |
| 2659 | solaris_xpg_symbols_present=yes |
| 2660 | AC_MSG_RESULT([yes]) |
| 2661 | ], [ |
| 2662 | solaris_xpg_symbols_present=no |
| 2663 | AC_MSG_RESULT([no]) |
| 2664 | ]) |
| 2665 | AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes) |
| 2666 | CFLAGS="$save_CFLAGS" |
| 2667 | |
| 2668 | |
| 2669 | # Solaris-specific check determining default platform for the Valgrind launcher. |
| 2670 | # Used in case the launcher cannot select platform by looking at the client |
| 2671 | # image (for example because the executable is a shell script). |
| 2672 | # |
| 2673 | # C-level symbol: SOLARIS_LAUNCHER_DEFAULT_PLATFORM |
| 2674 | # Automake-level symbol: none |
| 2675 | # |
| 2676 | AC_MSG_CHECKING([for default platform of Valgrind launcher (Solaris-specific)]) |
| 2677 | # Get the ELF class of /bin/sh first. |
| 2678 | if ! test -f /bin/sh; then |
| 2679 | AC_MSG_ERROR([Shell interpreter `/bin/sh' not found.]) |
| 2680 | fi |
| 2681 | elf_class=$( /usr/bin/file /bin/sh | sed -n 's/.*ELF \(..\)-bit.*/\1/p' ) |
| 2682 | case "$elf_class" in |
| 2683 | 64) |
| 2684 | default_arch="$VGCONF_ARCH_PRI"; |
| 2685 | ;; |
| 2686 | 32) |
| 2687 | if test "x$VGCONF_ARCH_SEC" != "x"; then |
| 2688 | default_arch="$VGCONF_ARCH_SEC" |
| 2689 | else |
| 2690 | default_arch="$VGCONF_ARCH_PRI"; |
| 2691 | fi |
| 2692 | ;; |
| 2693 | *) |
| 2694 | AC_MSG_ERROR([Cannot determine ELF class of `/bin/sh'.]) |
| 2695 | ;; |
| 2696 | esac |
| 2697 | default_platform="$default_arch-$VGCONF_OS" |
| 2698 | AC_MSG_RESULT([$default_platform]) |
| 2699 | AC_DEFINE_UNQUOTED([SOLARIS_LAUNCHER_DEFAULT_PLATFORM], ["$default_platform"], |
| 2700 | [Default platform for Valgrind launcher.]) |
| 2701 | |
| 2702 | |
| 2703 | # Solaris-specific check determining if the old syscalls are available. |
| 2704 | # |
| 2705 | # C-level symbol: SOLARIS_OLD_SYSCALLS |
| 2706 | # Automake-level symbol: SOLARIS_OLD_SYSCALLS |
| 2707 | # |
| 2708 | AC_MSG_CHECKING([for the old Solaris syscalls (Solaris-specific)]) |
| 2709 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2710 | #include <sys/syscall.h> |
| 2711 | ]], [[ |
| 2712 | return !SYS_open; |
| 2713 | ]])], [ |
| 2714 | solaris_old_syscalls=yes |
| 2715 | AC_MSG_RESULT([yes]) |
| 2716 | AC_DEFINE([SOLARIS_OLD_SYSCALLS], 1, |
| 2717 | [Define to 1 if you have the old Solaris syscalls.]) |
| 2718 | ], [ |
| 2719 | solaris_old_syscalls=no |
| 2720 | AC_MSG_RESULT([no]) |
| 2721 | ]) |
| 2722 | AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, test x$solaris_old_syscalls = xyes) |
| 2723 | |
| 2724 | |
| 2725 | # Solaris-specific check determining if the new accept() syscall is available. |
| 2726 | # |
| 2727 | # Old syscall: |
| 2728 | # int accept(int sock, struct sockaddr *name, socklen_t *namelenp, |
| 2729 | # int version); |
| 2730 | # |
| 2731 | # New syscall (available on illumos): |
| 2732 | # int accept(int sock, struct sockaddr *name, socklen_t *namelenp, |
| 2733 | # int version, int flags); |
| 2734 | # |
| 2735 | # If the old syscall is present then the following syscall will fail with |
| 2736 | # ENOTSOCK (because file descriptor 0 is not a socket), if the new syscall is |
| 2737 | # available then it will fail with EINVAL (because the flags parameter is |
| 2738 | # invalid). |
| 2739 | # |
| 2740 | # C-level symbol: SOLARIS_NEW_ACCEPT_SYSCALL |
| 2741 | # Automake-level symbol: none |
| 2742 | # |
| 2743 | AC_MSG_CHECKING([for the new `accept' syscall (Solaris-specific)]) |
| 2744 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 2745 | #include <sys/syscall.h> |
| 2746 | #include <errno.h> |
| 2747 | ]], [[ |
| 2748 | errno = 0; |
| 2749 | syscall(SYS_accept, 0, 0, 0, 0, -1); |
| 2750 | return !(errno == EINVAL); |
| 2751 | ]])], [ |
| 2752 | AC_MSG_RESULT([yes]) |
| 2753 | AC_DEFINE([SOLARIS_NEW_ACCEPT_SYSCALL], 1, |
| 2754 | [Define to 1 if you have the new `accept' syscall.]) |
| 2755 | ], [ |
| 2756 | AC_MSG_RESULT([no]) |
| 2757 | ]) |
| 2758 | |
| 2759 | |
| 2760 | # Solaris-specific check determining if the new illumos pipe() syscall is |
| 2761 | # available. |
| 2762 | # |
| 2763 | # Old syscall: |
| 2764 | # longlong_t pipe(); |
| 2765 | # |
| 2766 | # New syscall (available on illumos): |
| 2767 | # int pipe(intptr_t arg, int flags); |
| 2768 | # |
| 2769 | # If the old syscall is present then the following call will succeed, if the |
| 2770 | # new syscall is available then it will fail with EFAULT (because address 0 |
| 2771 | # cannot be accessed). |
| 2772 | # |
| 2773 | # C-level symbol: SOLARIS_NEW_PIPE_SYSCALL |
| 2774 | # Automake-level symbol: none |
| 2775 | # |
| 2776 | AC_MSG_CHECKING([for the new `pipe' syscall (Solaris-specific)]) |
| 2777 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 2778 | #include <sys/syscall.h> |
| 2779 | #include <errno.h> |
| 2780 | ]], [[ |
| 2781 | errno = 0; |
| 2782 | syscall(SYS_pipe, 0, 0); |
| 2783 | return !(errno == EFAULT); |
| 2784 | ]])], [ |
| 2785 | AC_MSG_RESULT([yes]) |
| 2786 | AC_DEFINE([SOLARIS_NEW_PIPE_SYSCALL], 1, |
| 2787 | [Define to 1 if you have the new `pipe' syscall.]) |
| 2788 | ], [ |
| 2789 | AC_MSG_RESULT([no]) |
| 2790 | ]) |
| 2791 | |
| 2792 | |
| 2793 | # Solaris-specific check determining if the new lwp_sigqueue() syscall is |
| 2794 | # available. |
| 2795 | # |
| 2796 | # Old syscall: |
| 2797 | # int lwp_kill(id_t lwpid, int sig); |
| 2798 | # |
| 2799 | # New syscall (available on Solaris 11): |
| 2800 | # int lwp_sigqueue(id_t lwpid, int sig, void *value, |
| 2801 | # int si_code, timespec_t *timeout); |
| 2802 | # |
| 2803 | # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL |
| 2804 | # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL |
| 2805 | # |
| 2806 | AC_MSG_CHECKING([for the new `lwp_sigqueue' syscall (Solaris-specific)]) |
| 2807 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2808 | #include <sys/syscall.h> |
| 2809 | ]], [[ |
| 2810 | return !SYS_lwp_sigqueue; |
| 2811 | ]])], [ |
| 2812 | solaris_lwp_sigqueue_syscall=yes |
| 2813 | AC_MSG_RESULT([yes]) |
| 2814 | AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL], 1, |
| 2815 | [Define to 1 if you have the new `lwp_sigqueue' syscall.]) |
| 2816 | ], [ |
| 2817 | solaris_lwp_sigqueue_syscall=no |
| 2818 | AC_MSG_RESULT([no]) |
| 2819 | ]) |
| 2820 | AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, test x$solaris_lwp_sigqueue_syscall = xyes) |
| 2821 | |
| 2822 | |
| 2823 | # Solaris-specific check determining if the lwp_sigqueue() syscall |
| 2824 | # takes both pid and thread id arguments or just thread id. |
| 2825 | # |
| 2826 | # Old syscall (available on Solaris 11.x): |
| 2827 | # int lwp_sigqueue(id_t lwpid, int sig, void *value, |
| 2828 | # int si_code, timespec_t *timeout); |
| 2829 | # |
| 2830 | # New syscall (available on Solaris 12): |
| 2831 | # int lwp_sigqueue(pid_t pid, id_t lwpid, int sig, void *value, |
| 2832 | # int si_code, timespec_t *timeout); |
| 2833 | # |
| 2834 | # If the old syscall is present then the following syscall will fail with |
| 2835 | # EINVAL (because signal is out of range); if the new syscall is available |
| 2836 | # then it will fail with ESRCH (because it would not find such thread in the |
| 2837 | # current process). |
| 2838 | # |
| 2839 | # C-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID |
| 2840 | # Automake-level symbol: SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID |
| 2841 | # |
| 2842 | AM_COND_IF(SOLARIS_LWP_SIGQUEUE_SYSCALL, |
| 2843 | AC_MSG_CHECKING([if the `lwp_sigqueue' syscall accepts pid (Solaris-specific)]) |
| 2844 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 2845 | #include <sys/syscall.h> |
| 2846 | #include <errno.h> |
| 2847 | ]], [[ |
| 2848 | errno = 0; |
| 2849 | syscall(SYS_lwp_sigqueue, 0, 101, 0, 0, 0, 0); |
| 2850 | return !(errno == ESRCH); |
| 2851 | ]])], [ |
| 2852 | solaris_lwp_sigqueue_syscall_takes_pid=yes |
| 2853 | AC_MSG_RESULT([yes]) |
| 2854 | AC_DEFINE([SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID], 1, |
| 2855 | [Define to 1 if you have the new `lwp_sigqueue' syscall which accepts pid.]) |
| 2856 | ], [ |
| 2857 | solaris_lwp_sigqueue_syscall_takes_pid=no |
| 2858 | AC_MSG_RESULT([no]) |
| 2859 | ]) |
| 2860 | AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, |
| 2861 | test x$solaris_lwp_sigqueue_syscall_takes_pid = xyes) |
| 2862 | , |
| 2863 | AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, test x = y) |
| 2864 | ) |
| 2865 | |
| 2866 | |
| 2867 | # Solaris-specific check determining if the new lwp_name() syscall is |
| 2868 | # available. |
| 2869 | # |
| 2870 | # New syscall (available on Solaris 11): |
| 2871 | # int lwp_name(int opcode, id_t lwpid, char *name, size_t len); |
| 2872 | # |
| 2873 | # C-level symbol: SOLARIS_LWP_NAME_SYSCALL |
| 2874 | # Automake-level symbol: SOLARIS_LWP_NAME_SYSCALL |
| 2875 | # |
| 2876 | AC_MSG_CHECKING([for the new `lwp_name' syscall (Solaris-specific)]) |
| 2877 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2878 | #include <sys/syscall.h> |
| 2879 | ]], [[ |
| 2880 | return !SYS_lwp_name; |
| 2881 | ]])], [ |
| 2882 | solaris_lwp_name_syscall=yes |
| 2883 | AC_MSG_RESULT([yes]) |
| 2884 | AC_DEFINE([SOLARIS_LWP_NAME_SYSCALL], 1, |
| 2885 | [Define to 1 if you have the new `lwp_name' syscall.]) |
| 2886 | ], [ |
| 2887 | solaris_lwp_name_syscall=no |
| 2888 | AC_MSG_RESULT([no]) |
| 2889 | ]) |
| 2890 | AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, test x$solaris_lwp_name_syscall = xyes) |
| 2891 | |
| 2892 | |
| 2893 | # Solaris-specific check determining if the new zone() syscall subcodes |
| 2894 | # ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT are available. These subcodes |
| 2895 | # were added in Solaris 11 but are missing on illumos. |
| 2896 | # |
| 2897 | # C-level symbol: SOLARIS_ZONE_DEFUNCT |
| 2898 | # Automake-level symbol: SOLARIS_ZONE_DEFUNCT |
| 2899 | # |
| 2900 | AC_MSG_CHECKING([for ZONE_LIST_DEFUNCT and ZONE_GETATTR_DEFUNCT (Solaris-specific)]) |
| 2901 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2902 | #include <sys/zone.h> |
| 2903 | ]], [[ |
| 2904 | return !(ZONE_LIST_DEFUNCT && ZONE_GETATTR_DEFUNCT); |
| 2905 | ]])], [ |
| 2906 | solaris_zone_defunct=yes |
| 2907 | AC_MSG_RESULT([yes]) |
| 2908 | AC_DEFINE([SOLARIS_ZONE_DEFUNCT], 1, |
| 2909 | [Define to 1 if you have the `ZONE_LIST_DEFUNCT' and `ZONE_GETATTR_DEFUNC' constants.]) |
| 2910 | ], [ |
| 2911 | solaris_zone_defunct=no |
| 2912 | AC_MSG_RESULT([no]) |
| 2913 | ]) |
| 2914 | AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, test x$solaris_zone_defunct = xyes) |
| 2915 | |
| 2916 | |
| 2917 | # Solaris-specific check determining if the new shmsys() syscall subcodes |
| 2918 | # IPC_XSTAT64, SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM are available. |
| 2919 | # These subcodes were added in Solaris 11 but are missing on illumos. |
| 2920 | # |
| 2921 | # C-level symbol: SOLARIS_SHM_NEW |
| 2922 | # Automake-level symbol: SOLARIS_SHM_NEW |
| 2923 | # |
| 2924 | AC_MSG_CHECKING([for SHMADV, SHM_ADV_GET, SHM_ADV_SET and SHMGET_OSM (Solaris-specific)]) |
| 2925 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2926 | #include <sys/ipc_impl.h> |
| 2927 | #include <sys/shm.h> |
| 2928 | #include <sys/shm_impl.h> |
| 2929 | ]], [[ |
| 2930 | return !(IPC_XSTAT64 && SHMADV && SHM_ADV_GET && SHM_ADV_SET && SHMGET_OSM); |
| 2931 | ]])], [ |
| 2932 | solaris_shm_new=yes |
| 2933 | AC_MSG_RESULT([yes]) |
| 2934 | AC_DEFINE([SOLARIS_SHM_NEW], 1, |
| 2935 | [Define to 1 if you have the `IPC_XSTAT64', `SHMADV', `SHM_ADV_GET', `SHM_ADV_SET' and `SHMGET_OSM' constants.]) |
| 2936 | ], [ |
| 2937 | solaris_shm_new=no |
| 2938 | AC_MSG_RESULT([no]) |
| 2939 | ]) |
| 2940 | AM_CONDITIONAL(SOLARIS_SHM_NEW, test x$solaris_shm_new = xyes) |
| 2941 | |
| 2942 | |
| 2943 | # Solaris-specific check determining if prxregset_t is available. Illumos |
| 2944 | # currently does not define it on the x86 platform. |
| 2945 | # |
| 2946 | # C-level symbol: SOLARIS_PRXREGSET_T |
| 2947 | # Automake-level symbol: SOLARIS_PRXREGSET_T |
| 2948 | # |
| 2949 | AC_MSG_CHECKING([for the `prxregset_t' type (Solaris-specific)]) |
| 2950 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2951 | #include <sys/procfs_isa.h> |
| 2952 | ]], [[ |
| 2953 | return !sizeof(prxregset_t); |
| 2954 | ]])], [ |
| 2955 | solaris_prxregset_t=yes |
| 2956 | AC_MSG_RESULT([yes]) |
| 2957 | AC_DEFINE([SOLARIS_PRXREGSET_T], 1, |
| 2958 | [Define to 1 if you have the `prxregset_t' type.]) |
| 2959 | ], [ |
| 2960 | solaris_prxregset_t=no |
| 2961 | AC_MSG_RESULT([no]) |
| 2962 | ]) |
| 2963 | AM_CONDITIONAL(SOLARIS_PRXREGSET_T, test x$solaris_prxregset_t = xyes) |
| 2964 | |
| 2965 | |
| 2966 | # Solaris-specific check determining if the new frealpathat() syscall is |
| 2967 | # available. |
| 2968 | # |
| 2969 | # New syscall (available on Solaris 11.1): |
| 2970 | # int frealpathat(int fd, char *path, char *buf, size_t buflen); |
| 2971 | # |
| 2972 | # C-level symbol: SOLARIS_FREALPATHAT_SYSCALL |
| 2973 | # Automake-level symbol: SOLARIS_FREALPATHAT_SYSCALL |
| 2974 | # |
| 2975 | AC_MSG_CHECKING([for the new `frealpathat' syscall (Solaris-specific)]) |
| 2976 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 2977 | #include <sys/syscall.h> |
| 2978 | ]], [[ |
| 2979 | return !SYS_frealpathat; |
| 2980 | ]])], [ |
| 2981 | solaris_frealpathat_syscall=yes |
| 2982 | AC_MSG_RESULT([yes]) |
| 2983 | AC_DEFINE([SOLARIS_FREALPATHAT_SYSCALL], 1, |
| 2984 | [Define to 1 if you have the new `frealpathat' syscall.]) |
| 2985 | ], [ |
| 2986 | solaris_frealpathat_syscall=no |
| 2987 | AC_MSG_RESULT([no]) |
| 2988 | ]) |
| 2989 | AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, test x$solaris_frealpathat_syscall = xyes) |
| 2990 | |
| 2991 | |
| 2992 | # Solaris-specific check determining if the new uuidsys() syscall is |
| 2993 | # available. |
| 2994 | # |
| 2995 | # New syscall (available on newer Solaris): |
| 2996 | # int uuidsys(struct uuid *uuid); |
| 2997 | # |
| 2998 | # C-level symbol: SOLARIS_UUIDSYS_SYSCALL |
| 2999 | # Automake-level symbol: SOLARIS_UUIDSYS_SYSCALL |
| 3000 | # |
| 3001 | AC_MSG_CHECKING([for the new `uuidsys' syscall (Solaris-specific)]) |
| 3002 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3003 | #include <sys/syscall.h> |
| 3004 | ]], [[ |
| 3005 | return !SYS_uuidsys; |
| 3006 | ]])], [ |
| 3007 | solaris_uuidsys_syscall=yes |
| 3008 | AC_MSG_RESULT([yes]) |
| 3009 | AC_DEFINE([SOLARIS_UUIDSYS_SYSCALL], 1, |
| 3010 | [Define to 1 if you have the new `uuidsys' syscall.]) |
| 3011 | ], [ |
| 3012 | solaris_uuidsys_syscall=no |
| 3013 | AC_MSG_RESULT([no]) |
| 3014 | ]) |
| 3015 | AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, test x$solaris_uuidsys_syscall = xyes) |
| 3016 | |
| 3017 | |
| 3018 | # Solaris-specific check determining if the new labelsys() syscall subcode |
| 3019 | # TNDB_GET_TNIP is available. This subcode was added in Solaris 11 but is |
| 3020 | # missing on illumos. |
| 3021 | # |
| 3022 | # C-level symbol: SOLARIS_TNDB_GET_TNIP |
| 3023 | # Automake-level symbol: SOLARIS_TNDB_GET_TNIP |
| 3024 | # |
| 3025 | AC_MSG_CHECKING([for TNDB_GET_TNIP (Solaris-specific)]) |
| 3026 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3027 | #include <sys/tsol/tndb.h> |
| 3028 | ]], [[ |
| 3029 | return !TNDB_GET_TNIP; |
| 3030 | ]])], [ |
| 3031 | solaris_tndb_get_tnip=yes |
| 3032 | AC_MSG_RESULT([yes]) |
| 3033 | AC_DEFINE([SOLARIS_TNDB_GET_TNIP], 1, |
| 3034 | [Define to 1 if you have the `TNDB_GET_TNIP' constant.]) |
| 3035 | ], [ |
| 3036 | solaris_tndb_get_tnip=no |
| 3037 | AC_MSG_RESULT([no]) |
| 3038 | ]) |
| 3039 | AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, test x$solaris_tndb_get_tnip = xyes) |
| 3040 | |
| 3041 | |
| 3042 | # Solaris-specific check determining if the new labelsys() syscall opcodes |
| 3043 | # TSOL_GETCLEARANCE and TSOL_SETCLEARANCE are available. These opcodes were |
| 3044 | # added in Solaris 11 but are missing on illumos. |
| 3045 | # |
| 3046 | # C-level symbol: SOLARIS_TSOL_CLEARANCE |
| 3047 | # Automake-level symbol: SOLARIS_TSOL_CLEARANCE |
| 3048 | # |
| 3049 | AC_MSG_CHECKING([for TSOL_GETCLEARANCE and TSOL_SETCLEARANCE (Solaris-specific)]) |
| 3050 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3051 | #include <sys/tsol/tsyscall.h> |
| 3052 | ]], [[ |
| 3053 | return !(TSOL_GETCLEARANCE && TSOL_SETCLEARANCE); |
| 3054 | ]])], [ |
| 3055 | solaris_tsol_clearance=yes |
| 3056 | AC_MSG_RESULT([yes]) |
| 3057 | AC_DEFINE([SOLARIS_TSOL_CLEARANCE], 1, |
| 3058 | [Define to 1 if you have the `TSOL_GETCLEARANCE' and `TSOL_SETCLEARANCE' constants.]) |
| 3059 | ], [ |
| 3060 | solaris_tsol_clearance=no |
| 3061 | AC_MSG_RESULT([no]) |
| 3062 | ]) |
| 3063 | AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, test x$solaris_tsol_clearance = xyes) |
| 3064 | |
| 3065 | |
| 3066 | # Solaris-specific check determining if the utimesys() syscall is |
| 3067 | # available (on illumos and older Solaris). |
| 3068 | # |
| 3069 | # C-level symbol: SOLARIS_UTIMESYS_SYSCALL |
| 3070 | # Automake-level symbol: SOLARIS_UTIMESYS_SYSCALL |
| 3071 | # |
| 3072 | AC_MSG_CHECKING([for the `utimesys' syscall (Solaris-specific)]) |
| 3073 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3074 | #include <sys/syscall.h> |
| 3075 | ]], [[ |
| 3076 | return !SYS_utimesys; |
| 3077 | ]])], [ |
| 3078 | solaris_utimesys_syscall=yes |
| 3079 | AC_MSG_RESULT([yes]) |
| 3080 | AC_DEFINE([SOLARIS_UTIMESYS_SYSCALL], 1, |
| 3081 | [Define to 1 if you have the `utimesys' syscall.]) |
| 3082 | ], [ |
| 3083 | solaris_utimesys_syscall=no |
| 3084 | AC_MSG_RESULT([no]) |
| 3085 | ]) |
| 3086 | AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, test x$solaris_utimesys_syscall = xyes) |
| 3087 | |
| 3088 | |
| 3089 | # Solaris-specific check determining if the utimensat() syscall is |
| 3090 | # available (on newer Solaris). |
| 3091 | # |
| 3092 | # C-level symbol: SOLARIS_UTIMENSAT_SYSCALL |
| 3093 | # Automake-level symbol: SOLARIS_UTIMENSAT_SYSCALL |
| 3094 | # |
| 3095 | AC_MSG_CHECKING([for the `utimensat' syscall (Solaris-specific)]) |
| 3096 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3097 | #include <sys/syscall.h> |
| 3098 | ]], [[ |
| 3099 | return !SYS_utimensat; |
| 3100 | ]])], [ |
| 3101 | solaris_utimensat_syscall=yes |
| 3102 | AC_MSG_RESULT([yes]) |
| 3103 | AC_DEFINE([SOLARIS_UTIMENSAT_SYSCALL], 1, |
| 3104 | [Define to 1 if you have the `utimensat' syscall.]) |
| 3105 | ], [ |
| 3106 | solaris_utimensat_syscall=no |
| 3107 | AC_MSG_RESULT([no]) |
| 3108 | ]) |
| 3109 | AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, test x$solaris_utimensat_syscall = xyes) |
| 3110 | |
| 3111 | |
| 3112 | # Solaris-specific check determining if the spawn() syscall is available |
| 3113 | # (on newer Solaris). |
| 3114 | # |
| 3115 | # C-level symbol: SOLARIS_SPAWN_SYSCALL |
| 3116 | # Automake-level symbol: SOLARIS_SPAWN_SYSCALL |
| 3117 | # |
| 3118 | AC_MSG_CHECKING([for the `spawn' syscall (Solaris-specific)]) |
| 3119 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3120 | #include <sys/syscall.h> |
| 3121 | ]], [[ |
| 3122 | return !SYS_spawn; |
| 3123 | ]])], [ |
| 3124 | solaris_spawn_syscall=yes |
| 3125 | AC_MSG_RESULT([yes]) |
| 3126 | AC_DEFINE([SOLARIS_SPAWN_SYSCALL], 1, |
| 3127 | [Define to 1 if you have the `spawn' syscall.]) |
| 3128 | ], [ |
| 3129 | solaris_spawn_syscall=no |
| 3130 | AC_MSG_RESULT([no]) |
| 3131 | ]) |
| 3132 | AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, test x$solaris_spawn_syscall = xyes) |
| 3133 | |
| 3134 | |
| 3135 | # Solaris-specific check determining whether nscd (name switch cache daemon) |
| 3136 | # attaches its door at /system/volatile/name_service_door (Solaris) |
| 3137 | # or at /var/run/name_service_door (illumos). |
| 3138 | # |
| 3139 | # Note that /var/run is a symlink to /system/volatile on Solaris |
| 3140 | # but not vice versa on illumos. |
| 3141 | # |
| 3142 | # C-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE |
| 3143 | # Automake-level symbol: SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE |
| 3144 | # |
| 3145 | AC_MSG_CHECKING([for nscd door location (Solaris-specific)]) |
| 3146 | if test -e /system/volatile/name_service_door; then |
| 3147 | solaris_nscd_door_system_volatile=yes |
| 3148 | AC_MSG_RESULT([/system/volatile/name_service_door]) |
| 3149 | AC_DEFINE([SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE], 1, |
| 3150 | [Define to 1 if nscd attaches to /system/volatile/name_service_door.]) |
| 3151 | else |
| 3152 | solaris_nscd_door_system_volatile=no |
| 3153 | AC_MSG_RESULT([/var/run/name_service_door]) |
| 3154 | fi |
| 3155 | AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, test x$solaris_nscd_door_system_volatile = xyes) |
| 3156 | |
| 3157 | |
| 3158 | # Solaris-specific check determining if the new gethrt() fasttrap is available. |
| 3159 | # |
| 3160 | # New fasttrap (available on Solaris 11): |
| 3161 | # hrt_t *gethrt(void); |
| 3162 | # |
| 3163 | # C-level symbol: SOLARIS_GETHRT_FASTTRAP |
| 3164 | # Automake-level symbol: SOLARIS_GETHRT_FASTTRAP |
| 3165 | # |
| 3166 | AC_MSG_CHECKING([for the new `gethrt' fasttrap (Solaris-specific)]) |
| 3167 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3168 | #include <sys/trap.h> |
| 3169 | ]], [[ |
| 3170 | return !T_GETHRT; |
| 3171 | ]])], [ |
| 3172 | solaris_gethrt_fasttrap=yes |
| 3173 | AC_MSG_RESULT([yes]) |
| 3174 | AC_DEFINE([SOLARIS_GETHRT_FASTTRAP], 1, |
| 3175 | [Define to 1 if you have the new `gethrt' fasttrap.]) |
| 3176 | ], [ |
| 3177 | solaris_gethrt_fasttrap=no |
| 3178 | AC_MSG_RESULT([no]) |
| 3179 | ]) |
| 3180 | AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, test x$solaris_gethrt_fasttrap = xyes) |
| 3181 | |
| 3182 | |
| 3183 | # Solaris-specific check determining if the new get_zone_offset() fasttrap |
| 3184 | # is available. |
| 3185 | # |
| 3186 | # New fasttrap (available on Solaris 11): |
| 3187 | # zonehrtoffset_t *get_zone_offset(void); |
| 3188 | # |
| 3189 | # C-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP |
| 3190 | # Automake-level symbol: SOLARIS_GETZONEOFFSET_FASTTRAP |
| 3191 | # |
| 3192 | AC_MSG_CHECKING([for the new `get_zone_offset' fasttrap (Solaris-specific)]) |
| 3193 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3194 | #include <sys/trap.h> |
| 3195 | ]], [[ |
| 3196 | return !T_GETZONEOFFSET; |
| 3197 | ]])], [ |
| 3198 | solaris_getzoneoffset_fasttrap=yes |
| 3199 | AC_MSG_RESULT([yes]) |
| 3200 | AC_DEFINE([SOLARIS_GETZONEOFFSET_FASTTRAP], 1, |
| 3201 | [Define to 1 if you have the new `get_zone_offset' fasttrap.]) |
| 3202 | ], [ |
| 3203 | solaris_getzoneoffset_fasttrap=no |
| 3204 | AC_MSG_RESULT([no]) |
| 3205 | ]) |
| 3206 | AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, test x$solaris_getzoneoffset_fasttrap = xyes) |
| 3207 | |
| 3208 | |
| 3209 | # Solaris-specific check determining if the execve() syscall |
| 3210 | # takes fourth argument (flags) or not. |
| 3211 | # |
| 3212 | # Old syscall (available on illumos): |
| 3213 | # int execve(const char *fname, const char **argv, const char **envp); |
| 3214 | # |
| 3215 | # New syscall (available on Solaris): |
| 3216 | # int execve(uintptr_t file, const char **argv, const char **envp, int flags); |
| 3217 | # |
| 3218 | # If the new syscall is present then it will fail with EINVAL (because flags |
| 3219 | # are invalid); if the old syscall is available then it will fail with ENOENT |
| 3220 | # (because the file could not be found). |
| 3221 | # |
| 3222 | # C-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS |
| 3223 | # Automake-level symbol: SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS |
| 3224 | # |
| 3225 | AC_MSG_CHECKING([if the `execve' syscall accepts flags (Solaris-specific)]) |
| 3226 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 3227 | #include <sys/syscall.h> |
| 3228 | #include <errno.h> |
| 3229 | ]], [[ |
| 3230 | errno = 0; |
| 3231 | syscall(SYS_execve, "/no/existing/path", 0, 0, 0xdeadbeef, 0, 0); |
| 3232 | return !(errno == EINVAL); |
| 3233 | ]])], [ |
| 3234 | solaris_execve_syscall_takes_flags=yes |
| 3235 | AC_MSG_RESULT([yes]) |
| 3236 | AC_DEFINE([SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS], 1, |
| 3237 | [Define to 1 if you have the new `execve' syscall which accepts flags.]) |
| 3238 | ], [ |
| 3239 | solaris_execve_syscall_takes_flags=no |
| 3240 | AC_MSG_RESULT([no]) |
| 3241 | ]) |
| 3242 | AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, |
| 3243 | test x$solaris_execve_syscall_takes_flags = xyes) |
| 3244 | |
| 3245 | |
| 3246 | # Solaris-specific check determining version of the repository cache protocol. |
| 3247 | # Every Solaris version uses a different one, ranging from 21 to current 25. |
| 3248 | # The check is very ugly, though. |
| 3249 | # |
| 3250 | # C-level symbol: SOLARIS_REPCACHE_PROTOCOL_VERSION vv |
| 3251 | # Automake-level symbol: none |
| 3252 | # |
| 3253 | AC_PATH_PROG(DIS_PATH, dis, false) |
| 3254 | if test "x$DIS_PATH" = "xfalse"; then |
| 3255 | AC_MSG_FAILURE([Object code disassembler (`dis') not found.]) |
| 3256 | fi |
| 3257 | AC_CHECK_LIB(scf, scf_handle_bind, [], [ |
| 3258 | AC_MSG_WARN([Function `scf_handle_bind' was not found in `libscf'.]) |
| 3259 | AC_MSG_ERROR([Cannot determine version of the repository cache protocol.]) |
| 3260 | ]) |
| 3261 | |
| 3262 | AC_MSG_CHECKING([for version of the repository cache protocol (Solaris-specific)]) |
| 3263 | if test "X$VGCONF_ARCH_PRI" = "Xamd64"; then |
| 3264 | libscf=/usr/lib/64/libscf.so.1 |
| 3265 | else |
| 3266 | libscf=/usr/lib/libscf.so.1 |
| 3267 | fi |
| 3268 | if ! $DIS_PATH -F scf_handle_bind $libscf | grep -q 0x526570; then |
| 3269 | AC_MSG_WARN([Function `scf_handle_bind' does not contain repository cache protocol version.]) |
| 3270 | AC_MSG_ERROR([Cannot determine version of the repository cache protocol.]) |
| 3271 | fi |
| 3272 | hex=$( $DIS_PATH -F scf_handle_bind $libscf | sed -n 's/.*0x526570\(..\).*/\1/p' ) |
| 3273 | if test -z "$hex"; then |
| 3274 | AC_MSG_WARN([Version of the repository cache protocol is empty?!]) |
| 3275 | AC_MSG_ERROR([Cannot determine version of the repository cache protocol.]) |
| 3276 | fi |
| 3277 | version=$( printf "%d\n" 0x$hex ) |
| 3278 | AC_MSG_RESULT([$version]) |
| 3279 | AC_DEFINE_UNQUOTED([SOLARIS_REPCACHE_PROTOCOL_VERSION], [$version], |
| 3280 | [Version number of the repository door cache protocol.]) |
| 3281 | |
| 3282 | else |
| 3283 | AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false) |
| 3284 | AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false) |
| 3285 | AM_CONDITIONAL(SOLARIS_OLD_SYSCALLS, false) |
| 3286 | AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL, false) |
| 3287 | AM_CONDITIONAL(SOLARIS_LWP_SIGQUEUE_SYSCALL_TAKES_PID, false) |
| 3288 | AM_CONDITIONAL(SOLARIS_LWP_NAME_SYSCALL, false) |
| 3289 | AM_CONDITIONAL(SOLARIS_ZONE_DEFUNCT, false) |
| 3290 | AM_CONDITIONAL(SOLARIS_SHM_NEW, false) |
| 3291 | AM_CONDITIONAL(SOLARIS_PRXREGSET_T, false) |
| 3292 | AM_CONDITIONAL(SOLARIS_FREALPATHAT_SYSCALL, false) |
| 3293 | AM_CONDITIONAL(SOLARIS_UUIDSYS_SYSCALL, false) |
| 3294 | AM_CONDITIONAL(SOLARIS_TNDB_GET_TNIP, false) |
| 3295 | AM_CONDITIONAL(SOLARIS_TSOL_CLEARANCE, false) |
| 3296 | AM_CONDITIONAL(SOLARIS_UTIMESYS_SYSCALL, false) |
| 3297 | AM_CONDITIONAL(SOLARIS_UTIMENSAT_SYSCALL, false) |
| 3298 | AM_CONDITIONAL(SOLARIS_SPAWN_SYSCALL, false) |
| 3299 | AM_CONDITIONAL(SOLARIS_NSCD_DOOR_SYSTEM_VOLATILE, false) |
| 3300 | AM_CONDITIONAL(SOLARIS_GETHRT_FASTTRAP, false) |
| 3301 | AM_CONDITIONAL(SOLARIS_GETZONEOFFSET_FASTTRAP, false) |
| 3302 | AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false) |
| 3303 | fi # test "$VGCONF_OS" = "solaris" |
| 3304 | |
| 3305 | |
| 3306 | #---------------------------------------------------------------------------- |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 3307 | # Checks for C header files. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3308 | #---------------------------------------------------------------------------- |
| 3309 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3310 | AC_HEADER_STDC |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3311 | AC_CHECK_HEADERS([ \ |
bart | 1f2b143 | 2009-01-16 12:06:54 +0000 | [diff] [blame] | 3312 | asm/unistd.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3313 | endian.h \ |
| 3314 | mqueue.h \ |
| 3315 | sys/endian.h \ |
| 3316 | sys/epoll.h \ |
| 3317 | sys/eventfd.h \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 3318 | sys/klog.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3319 | sys/poll.h \ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3320 | sys/prctl.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 3321 | sys/signal.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3322 | sys/signalfd.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 3323 | sys/syscall.h \ |
| 3324 | sys/time.h \ |
| 3325 | sys/types.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3326 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3327 | |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 3328 | # Verify whether the <linux/futex.h> header is usable. |
| 3329 | AC_MSG_CHECKING([if <linux/futex.h> is usable]) |
| 3330 | |
sewardj | c12486b | 2012-12-17 14:46:48 +0000 | [diff] [blame] | 3331 | save_CFLAGS="$CFLAGS" |
| 3332 | CFLAGS="$CFLAGS -D__user=" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3333 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 3334 | #include <linux/futex.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3335 | ]], [[ |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 3336 | return FUTEX_WAIT; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3337 | ]])], [ |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3338 | ac_have_usable_linux_futex_h=yes |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 3339 | AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1, |
| 3340 | [Define to 1 if you have a usable <linux/futex.h> header file.]) |
| 3341 | AC_MSG_RESULT([yes]) |
| 3342 | ], [ |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3343 | ac_have_usable_linux_futex_h=no |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 3344 | AC_MSG_RESULT([no]) |
| 3345 | ]) |
sewardj | c12486b | 2012-12-17 14:46:48 +0000 | [diff] [blame] | 3346 | CFLAGS="$save_CFLAGS" |
| 3347 | |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 3348 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3349 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3350 | # Checks for typedefs, structures, and compiler characteristics. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3351 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3352 | AC_TYPE_UID_T |
| 3353 | AC_TYPE_OFF_T |
| 3354 | AC_TYPE_SIZE_T |
| 3355 | AC_HEADER_TIME |
| 3356 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 3357 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3358 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3359 | # Checks for library functions. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3360 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3361 | AC_FUNC_MEMCMP |
| 3362 | AC_FUNC_MMAP |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3363 | |
bart | 26288e4 | 2011-04-03 16:46:01 +0000 | [diff] [blame] | 3364 | AC_CHECK_LIB([pthread], [pthread_create]) |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 3365 | AC_CHECK_LIB([rt], [clock_gettime]) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 3366 | |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3367 | AC_CHECK_FUNCS([ \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 3368 | clock_gettime\ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3369 | epoll_create \ |
| 3370 | epoll_pwait \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 3371 | klogctl \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3372 | mallinfo \ |
| 3373 | memchr \ |
| 3374 | memset \ |
| 3375 | mkdir \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 3376 | mremap \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3377 | ppoll \ |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 3378 | pthread_barrier_init \ |
| 3379 | pthread_condattr_setclock \ |
| 3380 | pthread_mutex_timedlock \ |
| 3381 | pthread_rwlock_timedrdlock \ |
| 3382 | pthread_rwlock_timedwrlock \ |
| 3383 | pthread_spin_lock \ |
bart | a72a27b | 2010-04-29 06:22:17 +0000 | [diff] [blame] | 3384 | pthread_yield \ |
florian | c5325ef | 2013-09-17 20:15:36 +0000 | [diff] [blame] | 3385 | pthread_setname_np \ |
bart | d1f724c | 2009-08-26 18:11:18 +0000 | [diff] [blame] | 3386 | readlinkat \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3387 | semtimedop \ |
| 3388 | signalfd \ |
njn | 6cc2247 | 2009-03-16 03:46:48 +0000 | [diff] [blame] | 3389 | sigwaitinfo \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3390 | strchr \ |
| 3391 | strdup \ |
| 3392 | strpbrk \ |
| 3393 | strrchr \ |
| 3394 | strstr \ |
bart | a72a27b | 2010-04-29 06:22:17 +0000 | [diff] [blame] | 3395 | syscall \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3396 | utimensat \ |
tom | 9e4b636 | 2012-02-10 09:39:37 +0000 | [diff] [blame] | 3397 | process_vm_readv \ |
| 3398 | process_vm_writev \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 3399 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3400 | |
bart | 623eec3 | 2008-07-29 17:54:49 +0000 | [diff] [blame] | 3401 | # AC_CHECK_LIB adds any library found to the variable LIBS, and links these |
| 3402 | # libraries with any shared object and/or executable. This is NOT what we |
| 3403 | # want for e.g. vgpreload_core-x86-linux.so |
| 3404 | LIBS="" |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 3405 | |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 3406 | AM_CONDITIONAL([HAVE_PTHREAD_BARRIER], |
| 3407 | [test x$ac_cv_func_pthread_barrier_init = xyes]) |
bart | 2eaa8f2 | 2009-01-20 14:01:16 +0000 | [diff] [blame] | 3408 | AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK], |
| 3409 | [test x$ac_cv_func_pthread_mutex_timedlock = xyes]) |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 3410 | AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], |
| 3411 | [test x$ac_cv_func_pthread_spin_lock = xyes]) |
florian | c5325ef | 2013-09-17 20:15:36 +0000 | [diff] [blame] | 3412 | AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP], |
| 3413 | [test x$ac_cv_func_pthread_setname_np = xyes]) |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 3414 | |
petarj | c37cea6 | 2013-06-02 18:08:04 +0000 | [diff] [blame] | 3415 | if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ |
| 3416 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then |
petarj | 6d79b74 | 2012-12-20 18:56:57 +0000 | [diff] [blame] | 3417 | AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1, |
petarj | c37cea6 | 2013-06-02 18:08:04 +0000 | [diff] [blame] | 3418 | [Disable intercept pthread_spin_lock() on MIPS32 and MIPS64.]) |
petarj | 6d79b74 | 2012-12-20 18:56:57 +0000 | [diff] [blame] | 3419 | fi |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3420 | |
| 3421 | #---------------------------------------------------------------------------- |
| 3422 | # MPI checks |
| 3423 | #---------------------------------------------------------------------------- |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3424 | # Do we have a useable MPI setup on the primary and/or secondary targets? |
| 3425 | # On Linux, by default, assumes mpicc and -m32/-m64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 3426 | # Note: this is a kludge in that it assumes the specified mpicc |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 3427 | # understands -m32/-m64 regardless of what is specified using |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3428 | # --with-mpicc=. |
mjw | 46f2504 | 2014-08-21 10:04:04 +0000 | [diff] [blame] | 3429 | AC_PATH_PROG([MPI_CC], [mpicc], [mpicc], |
| 3430 | [$PATH:/usr/lib/openmpi/bin:/usr/lib64/openmpi/bin]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3431 | |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 3432 | mflag_primary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3433 | if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 3434 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 3435 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 3436 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3437 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \ |
| 3438 | -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_SOLARIS ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 3439 | mflag_primary=$FLAG_M32 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3440 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 3441 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ |
sewardj | f0c1250 | 2014-01-12 12:54:00 +0000 | [diff] [blame] | 3442 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \ |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 3443 | -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 3444 | mflag_primary=$FLAG_M64 |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3445 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then |
| 3446 | mflag_primary="$FLAG_M32 -arch i386" |
| 3447 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then |
| 3448 | mflag_primary="$FLAG_M64 -arch x86_64" |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 3449 | fi |
| 3450 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3451 | mflag_secondary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3452 | if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3453 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \ |
| 3454 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_SOLARIS ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3455 | mflag_secondary=$FLAG_M32 |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3456 | elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then |
| 3457 | mflag_secondary="$FLAG_M32 -arch i386" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3458 | fi |
| 3459 | |
| 3460 | |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 3461 | AC_ARG_WITH(mpicc, |
sewardj | b70a613 | 2006-05-27 21:14:09 +0000 | [diff] [blame] | 3462 | [ --with-mpicc= Specify name of MPI2-ised C compiler], |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 3463 | MPI_CC=$withval |
| 3464 | ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3465 | AC_SUBST(MPI_CC) |
| 3466 | |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3467 | ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can |
| 3468 | ## use these values in the check for a functioning mpicc. |
| 3469 | ## |
| 3470 | ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that |
| 3471 | ## mflag_primary/mflag_secondary are sufficient approximations of that behavior |
| 3472 | AM_COND_IF([VGCONF_OS_IS_LINUX], |
| 3473 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic" |
| 3474 | LDFLAGS_MPI="-fpic -shared"]) |
| 3475 | AM_COND_IF([VGCONF_OS_IS_DARWIN], |
| 3476 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic" |
| 3477 | LDFLAGS_MPI="-dynamic -dynamiclib -all_load"]) |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3478 | AM_COND_IF([VGCONF_OS_IS_SOLARIS], |
| 3479 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic" |
| 3480 | LDFLAGS_MPI="-fpic -shared"]) |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3481 | |
| 3482 | AC_SUBST([CFLAGS_MPI]) |
| 3483 | AC_SUBST([LDFLAGS_MPI]) |
| 3484 | |
| 3485 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3486 | ## See if MPI_CC works for the primary target |
| 3487 | ## |
| 3488 | 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] | 3489 | saved_CC=$CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 3490 | saved_CFLAGS=$CFLAGS |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 3491 | CC=$MPI_CC |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3492 | CFLAGS="$CFLAGS_MPI $mflag_primary" |
| 3493 | saved_LDFLAGS="$LDFLAGS" |
| 3494 | LDFLAGS="$LDFLAGS_MPI $mflag_primary" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3495 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 3496 | #include <mpi.h> |
| 3497 | #include <stdio.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3498 | ]], [[ |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3499 | int ni, na, nd, comb; |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 3500 | int r = MPI_Init(NULL,NULL); |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3501 | r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb ); |
| 3502 | r |= MPI_Finalize(); |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 3503 | return r; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3504 | ]])], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3505 | ac_have_mpi2_pri=yes |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 3506 | AC_MSG_RESULT([yes, $MPI_CC]) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 3507 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3508 | ac_have_mpi2_pri=no |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 3509 | AC_MSG_RESULT([no]) |
| 3510 | ]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 3511 | CC=$saved_CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 3512 | CFLAGS=$saved_CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3513 | LDFLAGS="$saved_LDFLAGS" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3514 | AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 3515 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3516 | ## See if MPI_CC works for the secondary target. Complication: what if |
| 3517 | ## there is no secondary target? We need this to then fail. |
| 3518 | ## Kludge this by making MPI_CC something which will surely fail in |
| 3519 | ## such a case. |
| 3520 | ## |
| 3521 | AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) |
| 3522 | saved_CC=$CC |
| 3523 | saved_CFLAGS=$CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3524 | saved_LDFLAGS="$LDFLAGS" |
| 3525 | LDFLAGS="$LDFLAGS_MPI $mflag_secondary" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3526 | if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3527 | CC="$MPI_CC this will surely fail" |
| 3528 | else |
| 3529 | CC=$MPI_CC |
| 3530 | fi |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3531 | CFLAGS="$CFLAGS_MPI $mflag_secondary" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3532 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3533 | #include <mpi.h> |
| 3534 | #include <stdio.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3535 | ]], [[ |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3536 | int ni, na, nd, comb; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3537 | int r = MPI_Init(NULL,NULL); |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3538 | r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb ); |
| 3539 | r |= MPI_Finalize(); |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3540 | return r; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3541 | ]])], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3542 | ac_have_mpi2_sec=yes |
| 3543 | AC_MSG_RESULT([yes, $MPI_CC]) |
| 3544 | ], [ |
| 3545 | ac_have_mpi2_sec=no |
| 3546 | AC_MSG_RESULT([no]) |
| 3547 | ]) |
| 3548 | CC=$saved_CC |
| 3549 | CFLAGS=$saved_CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 3550 | LDFLAGS="$saved_LDFLAGS" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 3551 | AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 3552 | |
| 3553 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3554 | #---------------------------------------------------------------------------- |
| 3555 | # Other library checks |
| 3556 | #---------------------------------------------------------------------------- |
bart | 2ef12d4 | 2010-10-18 16:32:11 +0000 | [diff] [blame] | 3557 | # There now follow some tests for Boost, and OpenMP. These |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3558 | # tests are present because Drd has some regression tests that use |
| 3559 | # these packages. All regression test programs all compiled only |
| 3560 | # for the primary target. And so it is important that the configure |
| 3561 | # checks that follow, use the correct -m32 or -m64 flag for the |
| 3562 | # primary target (called $mflag_primary). Otherwise, we can end up |
| 3563 | # in a situation (eg) where, on amd64-linux, the test for Boost checks |
| 3564 | # for usable 64-bit Boost facilities, but because we are doing a 32-bit |
| 3565 | # only build (meaning, the primary target is x86-linux), the build |
| 3566 | # of the regtest programs that use Boost fails, because they are |
| 3567 | # build as 32-bit (IN THIS EXAMPLE). |
| 3568 | # |
| 3569 | # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES |
| 3570 | # NEEDED BY THE REGRESSION TEST PROGRAMS. |
| 3571 | |
| 3572 | |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3573 | # Check whether the boost library 1.35 or later has been installed. |
| 3574 | # The Boost.Threads library has undergone a major rewrite in version 1.35.0. |
| 3575 | |
| 3576 | AC_MSG_CHECKING([for boost]) |
| 3577 | |
| 3578 | AC_LANG(C++) |
| 3579 | safe_CXXFLAGS=$CXXFLAGS |
bart | 7129c72 | 2012-04-18 18:34:22 +0000 | [diff] [blame] | 3580 | CXXFLAGS="$mflag_primary" |
| 3581 | safe_LIBS="$LIBS" |
bart | ce93f9e | 2014-06-12 07:45:23 +0000 | [diff] [blame] | 3582 | LIBS="-lboost_thread-mt -lboost_system-mt $LIBS" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3583 | |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 3584 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3585 | #include <boost/thread.hpp> |
| 3586 | static void thread_func(void) |
| 3587 | { } |
| 3588 | int main(int argc, char** argv) |
| 3589 | { |
| 3590 | boost::thread t(thread_func); |
| 3591 | return 0; |
| 3592 | } |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 3593 | ])], |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3594 | [ |
| 3595 | ac_have_boost_1_35=yes |
| 3596 | AC_SUBST([BOOST_CFLAGS], []) |
bart | ce93f9e | 2014-06-12 07:45:23 +0000 | [diff] [blame] | 3597 | AC_SUBST([BOOST_LIBS], ["-lboost_thread-mt -lboost_system-mt"]) |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3598 | AC_MSG_RESULT([yes]) |
| 3599 | ], [ |
| 3600 | ac_have_boost_1_35=no |
| 3601 | AC_MSG_RESULT([no]) |
| 3602 | ]) |
| 3603 | |
bart | 7129c72 | 2012-04-18 18:34:22 +0000 | [diff] [blame] | 3604 | LIBS="$safe_LIBS" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3605 | CXXFLAGS=$safe_CXXFLAGS |
| 3606 | AC_LANG(C) |
| 3607 | |
| 3608 | AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes]) |
| 3609 | |
| 3610 | |
| 3611 | # does this compiler support -fopenmp, does it have the include file |
| 3612 | # <omp.h> and does it have libgomp ? |
| 3613 | |
| 3614 | AC_MSG_CHECKING([for OpenMP]) |
| 3615 | |
| 3616 | safe_CFLAGS=$CFLAGS |
florian | 538cf30 | 2015-06-09 21:53:48 +0000 | [diff] [blame] | 3617 | CFLAGS="-fopenmp $mflag_primary -Werror" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3618 | |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 3619 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3620 | #include <omp.h> |
| 3621 | int main(int argc, char** argv) |
| 3622 | { |
| 3623 | omp_set_dynamic(0); |
| 3624 | return 0; |
| 3625 | } |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 3626 | ])], |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 3627 | [ |
| 3628 | ac_have_openmp=yes |
| 3629 | AC_MSG_RESULT([yes]) |
| 3630 | ], [ |
| 3631 | ac_have_openmp=no |
| 3632 | AC_MSG_RESULT([no]) |
| 3633 | ]) |
| 3634 | CFLAGS=$safe_CFLAGS |
| 3635 | |
| 3636 | AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) |
| 3637 | |
| 3638 | |
florian | 60637d2 | 2014-10-29 08:21:18 +0000 | [diff] [blame] | 3639 | # Check for __builtin_popcount |
| 3640 | AC_MSG_CHECKING([for __builtin_popcount()]) |
| 3641 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3642 | ]], [[ |
| 3643 | __builtin_popcount(2); |
| 3644 | return 0; |
| 3645 | ]])], [ |
| 3646 | AC_MSG_RESULT([yes]) |
| 3647 | AC_DEFINE([HAVE_BUILTIN_POPCOUT], 1, |
| 3648 | [Define to 1 if compiler provides __builtin_popcount().]) |
| 3649 | ], [ |
| 3650 | AC_MSG_RESULT([no]) |
| 3651 | ]) |
| 3652 | |
| 3653 | # Check for __builtin_clz |
| 3654 | AC_MSG_CHECKING([for __builtin_clz()]) |
| 3655 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3656 | ]], [[ |
| 3657 | __builtin_clz(2); |
| 3658 | return 0; |
| 3659 | ]])], [ |
| 3660 | AC_MSG_RESULT([yes]) |
| 3661 | AC_DEFINE([HAVE_BUILTIN_CLZ], 1, |
| 3662 | [Define to 1 if compiler provides __builtin_clz().]) |
| 3663 | ], [ |
| 3664 | AC_MSG_RESULT([no]) |
| 3665 | ]) |
| 3666 | |
| 3667 | # Check for __builtin_ctz |
| 3668 | AC_MSG_CHECKING([for __builtin_ctz()]) |
| 3669 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3670 | ]], [[ |
| 3671 | __builtin_ctz(2); |
| 3672 | return 0; |
| 3673 | ]])], [ |
| 3674 | AC_MSG_RESULT([yes]) |
| 3675 | AC_DEFINE([HAVE_BUILTIN_CTZ], 1, |
| 3676 | [Define to 1 if compiler provides __builtin_ctz().]) |
| 3677 | ], [ |
| 3678 | AC_MSG_RESULT([no]) |
| 3679 | ]) |
| 3680 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3681 | # does this compiler have built-in functions for atomic memory access for the |
| 3682 | # primary target ? |
| 3683 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target]) |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 3684 | |
| 3685 | safe_CFLAGS=$CFLAGS |
| 3686 | CFLAGS="$mflag_primary" |
| 3687 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3688 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 3689 | int variable = 1; |
| 3690 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 3691 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3692 | ]])], [ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 3693 | ac_have_builtin_atomic_primary=yes |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 3694 | AC_MSG_RESULT([yes]) |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3695 | AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() and __sync_add_and_fetch() for the primary target]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3696 | ], [ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 3697 | ac_have_builtin_atomic_primary=no |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 3698 | AC_MSG_RESULT([no]) |
| 3699 | ]) |
| 3700 | |
| 3701 | CFLAGS=$safe_CFLAGS |
| 3702 | |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 3703 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], |
| 3704 | [test x$ac_have_builtin_atomic_primary = xyes]) |
bart | c82d137 | 2009-05-31 16:21:23 +0000 | [diff] [blame] | 3705 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3706 | |
| 3707 | # does this compiler have built-in functions for atomic memory access for the |
| 3708 | # secondary target ? |
| 3709 | |
| 3710 | if test x$VGCONF_PLATFORM_SEC_CAPS != x; then |
| 3711 | |
| 3712 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target]) |
| 3713 | |
| 3714 | safe_CFLAGS=$CFLAGS |
| 3715 | CFLAGS="$mflag_secondary" |
| 3716 | |
| 3717 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 3718 | int variable = 1; |
| 3719 | return (__sync_add_and_fetch(&variable, 1) ? 1 : 0) |
| 3720 | ]])], [ |
| 3721 | ac_have_builtin_atomic_secondary=yes |
| 3722 | AC_MSG_RESULT([yes]) |
| 3723 | ], [ |
| 3724 | ac_have_builtin_atomic_secondary=no |
| 3725 | AC_MSG_RESULT([no]) |
| 3726 | ]) |
| 3727 | |
| 3728 | CFLAGS=$safe_CFLAGS |
| 3729 | |
| 3730 | fi |
| 3731 | |
| 3732 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY], |
| 3733 | [test x$ac_have_builtin_atomic_secondary = xyes]) |
| 3734 | |
bart | 1e856ea | 2011-12-17 12:53:23 +0000 | [diff] [blame] | 3735 | # does this compiler have built-in functions for atomic memory access on |
| 3736 | # 64-bit integers for all targets ? |
| 3737 | |
| 3738 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets]) |
| 3739 | |
| 3740 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3741 | #include <stdint.h> |
| 3742 | ]], [[ |
| 3743 | uint64_t variable = 1; |
| 3744 | return __sync_add_and_fetch(&variable, 1) |
| 3745 | ]])], [ |
| 3746 | ac_have_builtin_atomic64_primary=yes |
| 3747 | ], [ |
| 3748 | ac_have_builtin_atomic64_primary=no |
| 3749 | ]) |
| 3750 | |
| 3751 | if test x$VGCONF_PLATFORM_SEC_CAPS != x; then |
| 3752 | |
| 3753 | safe_CFLAGS=$CFLAGS |
| 3754 | CFLAGS="$mflag_secondary" |
| 3755 | |
| 3756 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3757 | #include <stdint.h> |
| 3758 | ]], [[ |
| 3759 | uint64_t variable = 1; |
| 3760 | return __sync_add_and_fetch(&variable, 1) |
| 3761 | ]])], [ |
| 3762 | ac_have_builtin_atomic64_secondary=yes |
| 3763 | ], [ |
| 3764 | ac_have_builtin_atomic64_secondary=no |
| 3765 | ]) |
| 3766 | |
| 3767 | CFLAGS=$safe_CFLAGS |
| 3768 | |
| 3769 | fi |
| 3770 | |
| 3771 | if test x$ac_have_builtin_atomic64_primary = xyes && \ |
| 3772 | test x$VGCONF_PLATFORM_SEC_CAPS = x \ |
| 3773 | -o x$ac_have_builtin_atomic64_secondary = xyes; then |
| 3774 | AC_MSG_RESULT([yes]) |
| 3775 | ac_have_builtin_atomic64=yes |
| 3776 | else |
| 3777 | AC_MSG_RESULT([no]) |
| 3778 | ac_have_builtin_atomic64=no |
| 3779 | fi |
| 3780 | |
| 3781 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64], |
| 3782 | [test x$ac_have_builtin_atomic64 = xyes]) |
| 3783 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3784 | |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 3785 | # does g++ have built-in functions for atomic memory access ? |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3786 | AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch]) |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 3787 | |
| 3788 | safe_CXXFLAGS=$CXXFLAGS |
| 3789 | CXXFLAGS="$mflag_primary" |
| 3790 | |
| 3791 | AC_LANG_PUSH(C++) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3792 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 3793 | int variable = 1; |
| 3794 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 3795 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 3796 | ]])], [ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 3797 | ac_have_builtin_atomic_cxx=yes |
| 3798 | AC_MSG_RESULT([yes]) |
| 3799 | 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] | 3800 | ], [ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 3801 | ac_have_builtin_atomic_cxx=no |
| 3802 | AC_MSG_RESULT([no]) |
| 3803 | ]) |
| 3804 | AC_LANG_POP(C++) |
| 3805 | |
| 3806 | CXXFLAGS=$safe_CXXFLAGS |
| 3807 | |
| 3808 | 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] | 3809 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3810 | |
| 3811 | if test x$ac_have_usable_linux_futex_h = xyes \ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 3812 | -a x$ac_have_builtin_atomic_primary = xyes; then |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 3813 | ac_enable_linux_ticket_lock_primary=yes |
| 3814 | fi |
| 3815 | AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY], |
| 3816 | [test x$ac_enable_linux_ticket_lock_primary = xyes]) |
| 3817 | |
| 3818 | if test x$VGCONF_PLATFORM_SEC_CAPS != x \ |
| 3819 | -a x$ac_have_usable_linux_futex_h = xyes \ |
| 3820 | -a x$ac_have_builtin_atomic_secondary = xyes; then |
| 3821 | ac_enable_linux_ticket_lock_secondary=yes |
| 3822 | fi |
| 3823 | AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY], |
| 3824 | [test x$ac_enable_linux_ticket_lock_secondary = xyes]) |
| 3825 | |
| 3826 | |
bart | f68af88 | 2011-12-10 19:42:05 +0000 | [diff] [blame] | 3827 | # does libstdc++ support annotating shared pointers ? |
| 3828 | AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers]) |
| 3829 | |
florian | d79b3bf | 2013-10-02 15:14:59 +0000 | [diff] [blame] | 3830 | safe_CXXFLAGS=$CXXFLAGS |
bart | f68af88 | 2011-12-10 19:42:05 +0000 | [diff] [blame] | 3831 | CXXFLAGS="-std=c++0x" |
| 3832 | |
| 3833 | AC_LANG_PUSH(C++) |
| 3834 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3835 | #include <memory> |
| 3836 | ]], [[ |
| 3837 | std::shared_ptr<int> p |
| 3838 | ]])], [ |
| 3839 | ac_have_shared_ptr=yes |
| 3840 | ], [ |
| 3841 | ac_have_shared_ptr=no |
| 3842 | ]) |
| 3843 | if test x$ac_have_shared_ptr = xyes; then |
| 3844 | # If compilation of the program below fails because of a syntax error |
| 3845 | # triggered by substituting one of the annotation macros then that |
| 3846 | # means that libstdc++ supports these macros. |
| 3847 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 3848 | #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)---- |
| 3849 | #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)---- |
| 3850 | #include <memory> |
| 3851 | ]], [[ |
| 3852 | std::shared_ptr<int> p |
| 3853 | ]])], [ |
| 3854 | ac_have_shared_pointer_annotation=no |
| 3855 | AC_MSG_RESULT([no]) |
| 3856 | ], [ |
| 3857 | ac_have_shared_pointer_annotation=yes |
| 3858 | AC_MSG_RESULT([yes]) |
| 3859 | AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1, |
| 3860 | [Define to 1 if libstd++ supports annotating shared pointers]) |
| 3861 | ]) |
| 3862 | else |
| 3863 | ac_have_shared_pointer_annotation=no |
| 3864 | AC_MSG_RESULT([no]) |
| 3865 | fi |
| 3866 | AC_LANG_POP(C++) |
| 3867 | |
| 3868 | CXXFLAGS=$safe_CXXFLAGS |
| 3869 | |
| 3870 | AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION], |
| 3871 | [test x$ac_have_shared_pointer_annotation = xyes]) |
| 3872 | |
| 3873 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3874 | #---------------------------------------------------------------------------- |
| 3875 | # Ok. We're done checking. |
| 3876 | #---------------------------------------------------------------------------- |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 3877 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 3878 | # Nb: VEX/Makefile is generated from Makefile.vex.in. |
| 3879 | AC_CONFIG_FILES([ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 3880 | Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 3881 | VEX/Makefile:Makefile.vex.in |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3882 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 3883 | valgrind.pc |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 3884 | glibc-2.X.supp |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 3885 | docs/Makefile |
| 3886 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 3887 | tests/vg_regtest |
njn | ec0c27a | 2005-12-10 23:11:28 +0000 | [diff] [blame] | 3888 | perf/Makefile |
| 3889 | perf/vg_perf |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 3890 | gdbserver_tests/Makefile |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3891 | gdbserver_tests/solaris/Makefile |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 3892 | include/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 3893 | auxprogs/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 3894 | mpi/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 3895 | coregrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3896 | memcheck/Makefile |
| 3897 | memcheck/tests/Makefile |
florian | e42cca5 | 2013-08-29 17:59:27 +0000 | [diff] [blame] | 3898 | memcheck/tests/common/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 3899 | memcheck/tests/amd64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 3900 | memcheck/tests/x86/Makefile |
njn | 3b3b76d | 2009-01-19 03:44:19 +0000 | [diff] [blame] | 3901 | memcheck/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 3902 | memcheck/tests/darwin/Makefile |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3903 | memcheck/tests/solaris/Makefile |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 3904 | memcheck/tests/amd64-linux/Makefile |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 3905 | memcheck/tests/x86-linux/Makefile |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3906 | memcheck/tests/amd64-solaris/Makefile |
| 3907 | memcheck/tests/x86-solaris/Makefile |
sewardj | 0e342a0 | 2010-09-03 23:49:33 +0000 | [diff] [blame] | 3908 | memcheck/tests/ppc32/Makefile |
| 3909 | memcheck/tests/ppc64/Makefile |
florian | 0bb707e | 2012-05-30 20:46:58 +0000 | [diff] [blame] | 3910 | memcheck/tests/s390x/Makefile |
florian | bb913cd | 2012-08-28 16:50:39 +0000 | [diff] [blame] | 3911 | memcheck/tests/vbit-test/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3912 | cachegrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3913 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 3914 | cachegrind/tests/x86/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 3915 | cachegrind/cg_annotate |
njn | 69d495d | 2010-06-30 05:23:34 +0000 | [diff] [blame] | 3916 | cachegrind/cg_diff |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 3917 | callgrind/Makefile |
| 3918 | callgrind/callgrind_annotate |
| 3919 | callgrind/callgrind_control |
| 3920 | callgrind/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3921 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 3922 | helgrind/tests/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 3923 | massif/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 3924 | massif/tests/Makefile |
njn | d5a8d24 | 2007-11-02 20:44:57 +0000 | [diff] [blame] | 3925 | massif/ms_print |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3926 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 3927 | lackey/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 3928 | none/Makefile |
| 3929 | none/tests/Makefile |
florian | 0a6d897 | 2015-04-03 15:47:19 +0000 | [diff] [blame] | 3930 | none/tests/scripts/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 3931 | none/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 3932 | none/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 3933 | none/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 3934 | none/tests/x86/Makefile |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 3935 | none/tests/arm/Makefile |
sewardj | f02d2ec | 2014-08-26 19:28:09 +0000 | [diff] [blame] | 3936 | none/tests/arm64/Makefile |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 3937 | none/tests/s390x/Makefile |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 3938 | none/tests/mips32/Makefile |
petarj | 8bea867 | 2013-05-10 13:14:54 +0000 | [diff] [blame] | 3939 | none/tests/mips64/Makefile |
sewardj | 112711a | 2015-04-10 12:30:09 +0000 | [diff] [blame] | 3940 | none/tests/tilegx/Makefile |
njn | 0458a12 | 2009-02-13 06:23:46 +0000 | [diff] [blame] | 3941 | none/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 3942 | none/tests/darwin/Makefile |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3943 | none/tests/solaris/Makefile |
florian | 7d4a28b | 2015-04-23 15:20:00 +0000 | [diff] [blame] | 3944 | none/tests/amd64-linux/Makefile |
njn | 06ca332 | 2009-04-15 23:10:04 +0000 | [diff] [blame] | 3945 | none/tests/x86-linux/Makefile |
rhyskidd | 0dc3526 | 2015-05-28 12:49:00 +0000 | [diff] [blame] | 3946 | none/tests/amd64-darwin/Makefile |
| 3947 | none/tests/x86-darwin/Makefile |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3948 | none/tests/amd64-solaris/Makefile |
| 3949 | none/tests/x86-solaris/Makefile |
sewardj | d2f95a0 | 2011-05-11 16:04:28 +0000 | [diff] [blame] | 3950 | exp-sgcheck/Makefile |
| 3951 | exp-sgcheck/tests/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 3952 | drd/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 3953 | drd/scripts/download-and-build-splash2 |
| 3954 | drd/tests/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 3955 | exp-bbv/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 3956 | exp-bbv/tests/Makefile |
| 3957 | exp-bbv/tests/x86/Makefile |
| 3958 | exp-bbv/tests/x86-linux/Makefile |
| 3959 | exp-bbv/tests/amd64-linux/Makefile |
| 3960 | exp-bbv/tests/ppc32-linux/Makefile |
vince | 226e078 | 2010-01-06 15:22:11 +0000 | [diff] [blame] | 3961 | exp-bbv/tests/arm-linux/Makefile |
sewardj | 4d7d8f5 | 2010-10-12 10:09:15 +0000 | [diff] [blame] | 3962 | exp-dhat/Makefile |
| 3963 | exp-dhat/tests/Makefile |
mjw | aeacd28 | 2014-03-11 19:30:32 +0000 | [diff] [blame] | 3964 | shared/Makefile |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3965 | solaris/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 3966 | ]) |
sewardj | d364580 | 2010-06-13 22:13:58 +0000 | [diff] [blame] | 3967 | AC_CONFIG_FILES([coregrind/link_tool_exe_linux], |
| 3968 | [chmod +x coregrind/link_tool_exe_linux]) |
| 3969 | AC_CONFIG_FILES([coregrind/link_tool_exe_darwin], |
| 3970 | [chmod +x coregrind/link_tool_exe_darwin]) |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 3971 | AC_CONFIG_FILES([coregrind/link_tool_exe_solaris], |
| 3972 | [chmod +x coregrind/link_tool_exe_solaris]) |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 3973 | AC_OUTPUT |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 3974 | |
| 3975 | cat<<EOF |
| 3976 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 3977 | Maximum build arch: ${ARCH_MAX} |
| 3978 | Primary build arch: ${VGCONF_ARCH_PRI} |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 3979 | Secondary build arch: ${VGCONF_ARCH_SEC} |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 3980 | Build OS: ${VGCONF_OS} |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 3981 | Primary build target: ${VGCONF_PLATFORM_PRI_CAPS} |
| 3982 | Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS} |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 3983 | Platform variant: ${VGCONF_PLATVARIANT} |
| 3984 | Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1 |
sewardj | e95d94f | 2008-09-19 09:02:19 +0000 | [diff] [blame] | 3985 | Default supp files: ${DEFAULT_SUPP} |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 3986 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 3987 | EOF |