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 | 704deb6 | 2012-08-09 15:51:55 +0000 | [diff] [blame] | 11 | AC_INIT([Valgrind],[3.9.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 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 19 | # Checks for various programs. |
| 20 | #---------------------------------------------------------------------------- |
bart | aca399a | 2010-08-15 18:54:15 +0000 | [diff] [blame] | 21 | CFLAGS="-Wno-long-long $CFLAGS" |
florian | d79b3bf | 2013-10-02 15:14:59 +0000 | [diff] [blame] | 22 | CXXFLAGS="-Wno-long-long $CXXFLAGS" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 23 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 24 | AC_PROG_LN_S |
| 25 | AC_PROG_CC |
bart | 0affa49 | 2008-03-18 17:53:09 +0000 | [diff] [blame] | 26 | AM_PROG_CC_C_O |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 27 | AC_PROG_CPP |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 28 | AC_PROG_CXX |
njn | 629a5ec | 2009-07-14 01:29:39 +0000 | [diff] [blame] | 29 | # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with |
| 30 | # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code |
| 31 | # base (eg. most likely as Darwin-specific tests) we'll need one of the |
| 32 | # following: |
njn | 0cd2689 | 2009-07-12 23:07:13 +0000 | [diff] [blame] | 33 | # - put AC_PROG_OBJC in a Darwin-specific part of this file |
| 34 | # - Use AC_PROG_OBJC here and up the minimum autoconf version |
| 35 | # - Use the following, which is apparently equivalent: |
| 36 | # m4_ifdef([AC_PROG_OBJC], |
| 37 | # [AC_PROG_OBJC], |
| 38 | # [AC_CHECK_TOOL([OBJC], [gcc]) |
| 39 | # AC_SUBST([OBJC]) |
| 40 | # AC_SUBST([OBJCFLAGS]) |
| 41 | # ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 42 | AC_PROG_RANLIB |
bart | 07de2c9 | 2010-05-29 06:44:28 +0000 | [diff] [blame] | 43 | # provide a very basic definition for AC_PROG_SED if it's not provided by |
| 44 | # autoconf (as e.g. in autoconf 2.59). |
| 45 | m4_ifndef([AC_PROG_SED], |
| 46 | [AC_DEFUN([AC_PROG_SED], |
| 47 | [AC_ARG_VAR([SED]) |
| 48 | AC_CHECK_PROGS([SED],[gsed sed])])]) |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 49 | AC_PROG_SED |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 50 | |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 51 | # If no AR variable was specified, look up the name of the archiver. Otherwise |
| 52 | # do not touch the AR variable. |
| 53 | if test "x$AR" = "x"; then |
bart | 07de2c9 | 2010-05-29 06:44:28 +0000 | [diff] [blame] | 54 | AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar]) |
bart | cddeaf5 | 2008-05-25 15:58:11 +0000 | [diff] [blame] | 55 | fi |
| 56 | AC_ARG_VAR([AR],[Archiver command]) |
| 57 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 58 | # Check for the compiler support |
| 59 | if test "${GCC}" != "yes" ; then |
| 60 | AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) |
| 61 | fi |
| 62 | |
sewardj | 2f68595 | 2002-12-22 19:32:23 +0000 | [diff] [blame] | 63 | # figure out where perl lives |
| 64 | AC_PATH_PROG(PERL, perl) |
| 65 | |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 66 | # figure out where gdb lives |
sewardj | f8722ca | 2008-11-17 00:20:45 +0000 | [diff] [blame] | 67 | AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time") |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 68 | AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB]) |
njn | 9315df3 | 2003-04-16 20:50:50 +0000 | [diff] [blame] | 69 | |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 70 | # some older automake's don't have it so try something on our own |
| 71 | ifdef([AM_PROG_AS],[AM_PROG_AS], |
| 72 | [ |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 73 | AS="${CC}" |
| 74 | AC_SUBST(AS) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 75 | |
gobry | 1be1985 | 2002-03-26 20:44:55 +0000 | [diff] [blame] | 76 | ASFLAGS="" |
| 77 | AC_SUBST(ASFLAGS) |
daywalker | 48ccca5 | 2002-04-15 00:31:58 +0000 | [diff] [blame] | 78 | ]) |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 79 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 80 | |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 81 | # Check if 'diff' supports -u (universal diffs) and use it if possible. |
| 82 | |
| 83 | AC_MSG_CHECKING([for diff -u]) |
| 84 | AC_SUBST(DIFF) |
| 85 | |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 86 | # Comparing two identical files results in 0. |
njn | 31f665e | 2009-02-26 21:25:50 +0000 | [diff] [blame] | 87 | tmpfile="tmp-xxx-yyy-zzz" |
| 88 | touch $tmpfile; |
| 89 | if diff -u $tmpfile $tmpfile ; then |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 90 | AC_MSG_RESULT([yes]) |
| 91 | DIFF="diff -u" |
| 92 | else |
| 93 | AC_MSG_RESULT([no]) |
| 94 | DIFF="diff" |
| 95 | fi |
njn | 31f665e | 2009-02-26 21:25:50 +0000 | [diff] [blame] | 96 | rm $tmpfile |
njn | 0d2e58f | 2009-02-25 04:57:56 +0000 | [diff] [blame] | 97 | |
| 98 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 99 | # We don't want gcc < 3.0 |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 100 | AC_MSG_CHECKING([for a supported version of gcc]) |
| 101 | |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 102 | # Obtain the compiler version. |
sewardj | a8ca2c5 | 2011-09-29 18:18:37 +0000 | [diff] [blame] | 103 | # |
bart | 8503744 | 2011-11-22 14:41:31 +0000 | [diff] [blame] | 104 | # A few examples of how the ${CC} --version output looks like: |
| 105 | # |
| 106 | # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2 |
| 107 | # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2 |
| 108 | # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585] |
| 109 | # 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] | 110 | # 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] | 111 | # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) |
| 112 | # 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) |
| 113 | # Clang: clang version 2.9 (tags/RELEASE_29/final) |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 114 | # Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) |
| 115 | # FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 |
sewardj | a8ca2c5 | 2011-09-29 18:18:37 +0000 | [diff] [blame] | 116 | # |
bart | c521406 | 2012-01-11 11:34:23 +0000 | [diff] [blame] | 117 | [ |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 118 | if test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ; then |
| 119 | is_clang="clang" |
| 120 | # Don't use -dumpversion with clang: it will always produce "4.2.1". |
| 121 | gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'` |
florian | 3d9368e | 2013-10-04 21:12:17 +0000 | [diff] [blame] | 122 | CFLAGS="$CFLAGS -Wno-tautological-compare -Wno-cast-align -Wno-self-assign" |
| 123 | CXXFLAGS="$CXXFLAGS -Wno-tautological-compare -Wno-cast-align -Wno-self-assign" |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 124 | else |
| 125 | is_clang="notclang" |
| 126 | gcc_version=`${CC} -dumpversion 2>/dev/null` |
| 127 | if test "x$gcc_version" = x; then |
| 128 | gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'` |
| 129 | fi |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 130 | fi |
bart | 048081f | 2012-06-17 05:53:02 +0000 | [diff] [blame] | 131 | ] |
florian | 3d9368e | 2013-10-04 21:12:17 +0000 | [diff] [blame] | 132 | AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang) |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 133 | |
| 134 | case "${is_clang}-${gcc_version}" in |
| 135 | notclang-3.*) |
| 136 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 137 | ;; |
| 138 | notclang-4.*) |
| 139 | AC_MSG_RESULT([ok (${gcc_version})]) |
| 140 | ;; |
sewardj | ae284e5 | 2012-08-02 18:25:04 +0000 | [diff] [blame] | 141 | clang-2.9|clang-3.*|clang-4.*) |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 142 | AC_MSG_RESULT([ok (clang-${gcc_version})]) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 143 | ;; |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 144 | *) |
sewardj | 3ab7b66 | 2011-09-29 17:30:13 +0000 | [diff] [blame] | 145 | AC_MSG_RESULT([no (${gcc_version})]) |
| 146 | AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9]) |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 147 | ;; |
| 148 | esac |
| 149 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 150 | #---------------------------------------------------------------------------- |
| 151 | # Arch/OS/platform tests. |
| 152 | #---------------------------------------------------------------------------- |
| 153 | # We create a number of arch/OS/platform-related variables. We prefix them |
| 154 | # all with "VGCONF_" which indicates that they are defined at |
| 155 | # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_* |
| 156 | # variables used when compiling C files. |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 157 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 158 | AC_CANONICAL_HOST |
| 159 | |
| 160 | AC_MSG_CHECKING([for a supported CPU]) |
sewardj | bc692db | 2006-01-04 03:31:07 +0000 | [diff] [blame] | 161 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 162 | # ARCH_MAX reflects the most that this CPU can do: for example if it |
| 163 | # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32. |
| 164 | # Ditto for amd64. It is used for more configuration below, but is not used |
| 165 | # outside this file. |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 166 | case "${host_cpu}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 167 | i?86) |
| 168 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 169 | ARCH_MAX="x86" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 170 | ;; |
| 171 | |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 172 | x86_64) |
| 173 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 174 | ARCH_MAX="amd64" |
njn | fe40894 | 2004-11-23 17:52:24 +0000 | [diff] [blame] | 175 | ;; |
| 176 | |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 177 | powerpc64) |
| 178 | AC_MSG_RESULT([ok (${host_cpu})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 179 | ARCH_MAX="ppc64" |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 180 | ;; |
| 181 | |
| 182 | powerpc) |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 183 | # On Linux this means only a 32-bit capable CPU. |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 184 | AC_MSG_RESULT([ok (${host_cpu})]) |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 185 | ARCH_MAX="ppc32" |
nethercote | 9bcc906 | 2004-10-13 13:50:01 +0000 | [diff] [blame] | 186 | ;; |
| 187 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 188 | s390x) |
| 189 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 190 | ARCH_MAX="s390x" |
| 191 | ;; |
| 192 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 193 | armv7*) |
| 194 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 195 | ARCH_MAX="arm" |
| 196 | ;; |
| 197 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 198 | mips) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 199 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 200 | ARCH_MAX="mips32" |
| 201 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 202 | |
| 203 | mipsel) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 204 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 205 | ARCH_MAX="mips32" |
| 206 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 207 | |
| 208 | mipsisa32r2) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 209 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 210 | ARCH_MAX="mips32" |
| 211 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 212 | |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 213 | mips64*) |
| 214 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 215 | ARCH_MAX="mips64" |
| 216 | ;; |
| 217 | |
| 218 | mipsisa64*) |
| 219 | AC_MSG_RESULT([ok (${host_cpu})]) |
| 220 | ARCH_MAX="mips64" |
| 221 | ;; |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 222 | *) |
| 223 | AC_MSG_RESULT([no (${host_cpu})]) |
nethercote | 81d5c66 | 2004-10-13 13:18:51 +0000 | [diff] [blame] | 224 | AC_MSG_ERROR([Unsupported host architecture. Sorry]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 225 | ;; |
| 226 | esac |
| 227 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 228 | #---------------------------------------------------------------------------- |
| 229 | |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 230 | # Sometimes it's convenient to subvert the bi-arch build system and |
| 231 | # just have a single build even though the underlying platform is |
| 232 | # capable of both. Hence handle --enable-only64bit and |
| 233 | # --enable-only32bit. Complain if both are issued :-) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 234 | # [Actually, if either of these options are used, I think both get built, |
| 235 | # but only one gets installed. So if you use an in-place build, both can be |
| 236 | # used. --njn] |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 237 | |
| 238 | # Check if a 64-bit only build has been requested |
| 239 | AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, |
| 240 | [AC_ARG_ENABLE(only64bit, |
| 241 | [ --enable-only64bit do a 64-bit only build], |
| 242 | [vg_cv_only64bit=$enableval], |
| 243 | [vg_cv_only64bit=no])]) |
| 244 | |
| 245 | # Check if a 32-bit only build has been requested |
| 246 | AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit, |
| 247 | [AC_ARG_ENABLE(only32bit, |
| 248 | [ --enable-only32bit do a 32-bit only build], |
| 249 | [vg_cv_only32bit=$enableval], |
| 250 | [vg_cv_only32bit=no])]) |
| 251 | |
| 252 | # Stay sane |
| 253 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 254 | AC_MSG_ERROR( |
| 255 | [Nonsensical: both --enable-only64bit and --enable-only32bit.]) |
| 256 | fi |
| 257 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 258 | #---------------------------------------------------------------------------- |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 259 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 260 | # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to |
| 261 | # compilation of many C files via -VGO_$(VGCONF_OS) and |
| 262 | # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 263 | AC_MSG_CHECKING([for a supported OS]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 264 | AC_SUBST(VGCONF_OS) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 265 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 266 | DEFAULT_SUPP="" |
| 267 | |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 268 | case "${host_os}" in |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 269 | *linux*) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 270 | AC_MSG_RESULT([ok (${host_os})]) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 271 | VGCONF_OS="linux" |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 272 | |
| 273 | # Ok, this is linux. Check the kernel version |
| 274 | AC_MSG_CHECKING([for the kernel version]) |
| 275 | |
| 276 | kernel=`uname -r` |
| 277 | |
| 278 | case "${kernel}" in |
bart | 0419e51 | 2011-06-05 08:51:47 +0000 | [diff] [blame] | 279 | 2.6.*|3.*) |
bart | 2d6e6e7 | 2011-06-05 10:01:48 +0000 | [diff] [blame] | 280 | AC_MSG_RESULT([2.6.x/3.x family (${kernel})]) |
| 281 | AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 282 | ;; |
| 283 | |
| 284 | 2.4.*) |
| 285 | AC_MSG_RESULT([2.4 family (${kernel})]) |
| 286 | AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) |
| 287 | ;; |
| 288 | |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 289 | *) |
| 290 | AC_MSG_RESULT([unsupported (${kernel})]) |
nethercote | 4fa681f | 2004-11-08 17:51:39 +0000 | [diff] [blame] | 291 | AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) |
mueller | 8c68e04 | 2004-01-03 15:21:14 +0000 | [diff] [blame] | 292 | ;; |
| 293 | esac |
| 294 | |
| 295 | ;; |
| 296 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 297 | *darwin*) |
| 298 | AC_MSG_RESULT([ok (${host_os})]) |
| 299 | VGCONF_OS="darwin" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 300 | AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5]) |
| 301 | AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6]) |
| 302 | 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] | 303 | AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 304 | |
| 305 | AC_MSG_CHECKING([for the kernel version]) |
| 306 | kernel=`uname -r` |
| 307 | |
| 308 | # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin |
| 309 | # has only one relevant version, the OS version. The `uname` check |
| 310 | # 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] | 311 | # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard, |
| 312 | # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion), |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 313 | # 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] | 314 | # |
| 315 | # XXX: `uname -r` won't do the right thing for cross-compiles, but |
| 316 | # that's not a problem yet. |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 317 | # |
| 318 | # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work |
| 319 | # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0 |
| 320 | # on 10.6.8 and 10.7.1. Although tempted to delete the configure |
| 321 | # time support for 10.5 (the 9.* pattern just below), I'll leave it |
| 322 | # in for now, just in case anybody wants to give it a try. But I'm |
| 323 | # assuming that 3.7.0 is a Snow Leopard and Lion-only release. |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 324 | case "${kernel}" in |
| 325 | 9.*) |
| 326 | AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard]) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 327 | AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 328 | DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}" |
bart | 6ccda14 | 2009-07-23 07:37:32 +0000 | [diff] [blame] | 329 | DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 330 | ;; |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 331 | 10.*) |
| 332 | AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard]) |
| 333 | AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version]) |
| 334 | DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}" |
| 335 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 336 | ;; |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 337 | 11.*) |
| 338 | AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion]) |
| 339 | AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version]) |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 340 | DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}" |
| 341 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 342 | ;; |
sewardj | ae284e5 | 2012-08-02 18:25:04 +0000 | [diff] [blame] | 343 | 12.*) |
| 344 | AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion]) |
| 345 | AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version]) |
| 346 | DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}" |
| 347 | DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" |
| 348 | ;; |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 349 | *) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 350 | AC_MSG_RESULT([unsupported (${kernel})]) |
sewardj | 731f9cf | 2011-09-21 08:43:08 +0000 | [diff] [blame] | 351 | AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 352 | ;; |
| 353 | esac |
| 354 | ;; |
| 355 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 356 | *) |
| 357 | AC_MSG_RESULT([no (${host_os})]) |
njn | cc58cea | 2010-07-05 07:21:22 +0000 | [diff] [blame] | 358 | AC_MSG_ERROR([Valgrind is operating system specific. Sorry.]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 359 | ;; |
| 360 | esac |
| 361 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 362 | #---------------------------------------------------------------------------- |
| 363 | |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 364 | # If we are building on a 64 bit platform test to see if the system |
| 365 | # supports building 32 bit programs and disable 32 bit support if it |
| 366 | # does not support building 32 bit programs |
| 367 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 368 | case "$ARCH_MAX-$VGCONF_OS" in |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 369 | amd64-linux|ppc64-linux) |
| 370 | AC_MSG_CHECKING([for 32 bit build support]) |
| 371 | safe_CFLAGS=$CFLAGS |
| 372 | CFLAGS="-m32" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 373 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 374 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 375 | ]])], [ |
tom | d639839 | 2006-06-07 17:44:36 +0000 | [diff] [blame] | 376 | AC_MSG_RESULT([yes]) |
| 377 | ], [ |
| 378 | vg_cv_only64bit="yes" |
| 379 | AC_MSG_RESULT([no]) |
| 380 | ]) |
| 381 | CFLAGS=$safe_CFLAGS;; |
| 382 | esac |
| 383 | |
| 384 | if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then |
| 385 | AC_MSG_ERROR( |
| 386 | [--enable-only32bit was specified but system does not support 32 bit builds]) |
| 387 | fi |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 388 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 389 | #---------------------------------------------------------------------------- |
| 390 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 391 | # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By |
| 392 | # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64 |
| 393 | # machine, but --enable-only32bit has been requested, then ARCH_MAX (see |
| 394 | # above) will be "amd64" since that reflects the most that this cpu can do, |
| 395 | # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the |
| 396 | # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 397 | # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and |
| 398 | # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). |
| 399 | AC_SUBST(VGCONF_ARCH_PRI) |
| 400 | |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 401 | # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86". |
| 402 | # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC) |
| 403 | # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target. |
| 404 | # It is empty if there is no secondary target. |
| 405 | AC_SUBST(VGCONF_ARCH_SEC) |
| 406 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 407 | # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX". |
| 408 | # The entire system, including regression and performance tests, will be |
| 409 | # built for this target. The "_CAPS" indicates that the name is in capital |
| 410 | # letters, and it also uses '_' rather than '-' as a separator, because it's |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 411 | # used to create various Makefile variables, which are all in caps by |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 412 | # convention and cannot contain '-' characters. This is in contrast to |
| 413 | # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 414 | AC_SUBST(VGCONF_PLATFORM_PRI_CAPS) |
| 415 | |
| 416 | # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one. |
| 417 | # Valgrind and tools will also be built for this target, but not the |
| 418 | # regression or performance tests. |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 419 | # |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 420 | # By default, the primary arch is the same as the "max" arch, as commented |
| 421 | # above (at the definition of ARCH_MAX). We may choose to downgrade it in |
| 422 | # the big case statement just below here, in the case where we're building |
| 423 | # on a 64 bit machine but have been requested only to do a 32 bit build. |
| 424 | AC_SUBST(VGCONF_PLATFORM_SEC_CAPS) |
| 425 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 426 | AC_MSG_CHECKING([for a supported CPU/OS combination]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 427 | |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 428 | # NB. The load address for a given platform may be specified in more |
| 429 | # than one place, in some cases, depending on whether we're doing a biarch, |
| 430 | # 32-bit only or 64-bit only build. eg see case for amd64-linux below. |
| 431 | # Be careful to give consistent values in all subcases. Also, all four |
| 432 | # valt_load_addres_{pri,sec}_{norml,inner} values must always be set, |
| 433 | # even if it is to "0xUNSET". |
| 434 | # |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 435 | case "$ARCH_MAX-$VGCONF_OS" in |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 436 | x86-linux) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 437 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 438 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 439 | VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" |
| 440 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 441 | valt_load_address_pri_norml="0x38000000" |
| 442 | valt_load_address_pri_inner="0x28000000" |
| 443 | valt_load_address_sec_norml="0xUNSET" |
| 444 | valt_load_address_sec_inner="0xUNSET" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 445 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 446 | ;; |
| 447 | amd64-linux) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 448 | valt_load_address_sec_norml="0xUNSET" |
| 449 | valt_load_address_sec_inner="0xUNSET" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 450 | if test x$vg_cv_only64bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 451 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 452 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 453 | VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" |
| 454 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 455 | valt_load_address_pri_norml="0x38000000" |
| 456 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 457 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 458 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 459 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 460 | VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" |
| 461 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 462 | valt_load_address_pri_norml="0x38000000" |
| 463 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 464 | else |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 465 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 466 | VGCONF_ARCH_SEC="x86" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 467 | VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" |
| 468 | VGCONF_PLATFORM_SEC_CAPS="X86_LINUX" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 469 | valt_load_address_pri_norml="0x38000000" |
| 470 | valt_load_address_pri_inner="0x28000000" |
| 471 | valt_load_address_sec_norml="0x38000000" |
| 472 | valt_load_address_sec_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 473 | fi |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 474 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 475 | ;; |
| 476 | ppc32-linux) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 477 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 478 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 479 | VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" |
| 480 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 481 | valt_load_address_pri_norml="0x38000000" |
| 482 | valt_load_address_pri_inner="0x28000000" |
| 483 | valt_load_address_sec_norml="0xUNSET" |
| 484 | valt_load_address_sec_inner="0xUNSET" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 485 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 486 | ;; |
| 487 | ppc64-linux) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 488 | valt_load_address_sec_norml="0xUNSET" |
| 489 | valt_load_address_sec_inner="0xUNSET" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 490 | if test x$vg_cv_only64bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 491 | VGCONF_ARCH_PRI="ppc64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 492 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 493 | VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" |
| 494 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 495 | valt_load_address_pri_norml="0x38000000" |
| 496 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 497 | elif test x$vg_cv_only32bit = xyes; then |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 498 | VGCONF_ARCH_PRI="ppc32" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 499 | VGCONF_ARCH_SEC="" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 500 | VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" |
| 501 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 502 | valt_load_address_pri_norml="0x38000000" |
| 503 | valt_load_address_pri_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 504 | else |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 505 | VGCONF_ARCH_PRI="ppc64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 506 | VGCONF_ARCH_SEC="ppc32" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 507 | VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" |
| 508 | VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 509 | valt_load_address_pri_norml="0x38000000" |
| 510 | valt_load_address_pri_inner="0x28000000" |
| 511 | valt_load_address_sec_norml="0x38000000" |
| 512 | valt_load_address_sec_inner="0x28000000" |
sewardj | 86e992f | 2006-01-28 18:39:09 +0000 | [diff] [blame] | 513 | fi |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 514 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 515 | ;; |
njn | cc58cea | 2010-07-05 07:21:22 +0000 | [diff] [blame] | 516 | # Darwin gets identified as 32-bit even when it supports 64-bit. |
| 517 | # (Not sure why, possibly because 'uname' returns "i386"?) Just about |
| 518 | # all Macs support both 32-bit and 64-bit, so we just build both. If |
| 519 | # someone has a really old 32-bit only machine they can (hopefully?) |
| 520 | # build with --enable-only32bit. See bug 243362. |
| 521 | x86-darwin|amd64-darwin) |
| 522 | ARCH_MAX="amd64" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 523 | valt_load_address_sec_norml="0xUNSET" |
| 524 | valt_load_address_sec_inner="0xUNSET" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 525 | if test x$vg_cv_only64bit = xyes; then |
| 526 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 527 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 528 | VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN" |
| 529 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 530 | valt_load_address_pri_norml="0x138000000" |
| 531 | valt_load_address_pri_inner="0x128000000" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 532 | elif test x$vg_cv_only32bit = xyes; then |
| 533 | VGCONF_ARCH_PRI="x86" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 534 | VGCONF_ARCH_SEC="" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 535 | VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN" |
| 536 | VGCONF_PLATFORM_SEC_CAPS="" |
| 537 | VGCONF_ARCH_PRI_CAPS="x86" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 538 | valt_load_address_pri_norml="0x38000000" |
| 539 | valt_load_address_pri_inner="0x28000000" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 540 | else |
| 541 | VGCONF_ARCH_PRI="amd64" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 542 | VGCONF_ARCH_SEC="x86" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 543 | VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN" |
| 544 | VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 545 | valt_load_address_pri_norml="0x138000000" |
| 546 | valt_load_address_pri_inner="0x128000000" |
| 547 | valt_load_address_sec_norml="0x38000000" |
| 548 | valt_load_address_sec_inner="0x28000000" |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 549 | fi |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 550 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 551 | ;; |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 552 | arm-linux) |
| 553 | VGCONF_ARCH_PRI="arm" |
| 554 | VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX" |
| 555 | VGCONF_PLATFORM_SEC_CAPS="" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 556 | valt_load_address_pri_norml="0x38000000" |
| 557 | valt_load_address_pri_inner="0x28000000" |
| 558 | valt_load_address_sec_norml="0xUNSET" |
| 559 | valt_load_address_sec_inner="0xUNSET" |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 560 | AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) |
| 561 | ;; |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 562 | s390x-linux) |
| 563 | VGCONF_ARCH_PRI="s390x" |
| 564 | VGCONF_ARCH_SEC="" |
| 565 | VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX" |
| 566 | VGCONF_PLATFORM_SEC_CAPS="" |
| 567 | # we want to have the generated code close to the dispatcher |
| 568 | valt_load_address_pri_norml="0x401000000" |
| 569 | valt_load_address_pri_inner="0x410000000" |
| 570 | valt_load_address_sec_norml="0xUNSET" |
| 571 | valt_load_address_sec_inner="0xUNSET" |
| 572 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
| 573 | ;; |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 574 | mips32-linux) |
| 575 | VGCONF_ARCH_PRI="mips32" |
| 576 | VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX" |
| 577 | VGCONF_PLATFORM_SEC_CAPS="" |
| 578 | valt_load_address_pri_norml="0x38000000" |
| 579 | valt_load_address_pri_inner="0x28000000" |
| 580 | valt_load_address_sec_norml="0xUNSET" |
| 581 | valt_load_address_sec_inner="0xUNSET" |
| 582 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 583 | ;; |
| 584 | mips64-linux) |
| 585 | VGCONF_ARCH_PRI="mips64" |
| 586 | VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX" |
| 587 | VGCONF_PLATFORM_SEC_CAPS="" |
| 588 | valt_load_address_pri_norml="0x38000000" |
| 589 | valt_load_address_pri_inner="0x28000000" |
| 590 | valt_load_address_sec_norml="0xUNSET" |
| 591 | valt_load_address_sec_inner="0xUNSET" |
| 592 | AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 593 | ;; |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 594 | *) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 595 | VGCONF_ARCH_PRI="unknown" |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 596 | VGCONF_ARCH_SEC="unknown" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 597 | VGCONF_PLATFORM_PRI_CAPS="UNKNOWN" |
| 598 | VGCONF_PLATFORM_SEC_CAPS="UNKNOWN" |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 599 | valt_load_address_pri_norml="0xUNSET" |
| 600 | valt_load_address_pri_inner="0xUNSET" |
| 601 | valt_load_address_sec_norml="0xUNSET" |
| 602 | valt_load_address_sec_inner="0xUNSET" |
njn | 377c43f | 2009-05-19 07:39:22 +0000 | [diff] [blame] | 603 | AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})]) |
sewardj | 3e38ce0 | 2004-11-23 01:17:29 +0000 | [diff] [blame] | 604 | AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) |
nethercote | 888ecb7 | 2004-08-23 14:54:40 +0000 | [diff] [blame] | 605 | ;; |
| 606 | esac |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 607 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 608 | #---------------------------------------------------------------------------- |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 609 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 610 | # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become |
| 611 | # defined. |
| 612 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86, |
| 613 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 614 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
| 615 | -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 616 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 617 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 618 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
| 619 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 620 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, |
| 621 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 622 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ) |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 623 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64, |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 624 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX ) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 625 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM, |
| 626 | test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX ) |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 627 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X, |
| 628 | test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 629 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32, |
| 630 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX ) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 631 | AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64, |
| 632 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 633 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 634 | # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these |
| 635 | # become defined. |
| 636 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX, |
| 637 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 638 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX) |
| 639 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX, |
| 640 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX) |
| 641 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX, |
| 642 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
| 643 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX) |
| 644 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX, |
| 645 | test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 646 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX, |
| 647 | test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX) |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 648 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX, |
| 649 | test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \ |
| 650 | -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX) |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 651 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX, |
| 652 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX) |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 653 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX, |
| 654 | test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 655 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 656 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN, |
| 657 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 658 | -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN) |
| 659 | AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN, |
| 660 | test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) |
| 661 | |
| 662 | |
sewardj | 72a2d80 | 2010-07-29 05:24:20 +0000 | [diff] [blame] | 663 | # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined. |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 664 | # Relies on the assumption that the primary and secondary targets are |
| 665 | # for the same OS, so therefore only necessary to test the primary. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 666 | AM_CONDITIONAL(VGCONF_OS_IS_LINUX, |
| 667 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
| 668 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
| 669 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 670 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 671 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 672 | -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \ |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 673 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ |
| 674 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 675 | AM_CONDITIONAL(VGCONF_OS_IS_DARWIN, |
| 676 | test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \ |
| 677 | -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 678 | |
| 679 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 680 | # Sometimes, in the Makefile.am files, it's useful to know whether or not |
| 681 | # there is a secondary target. |
njn | ee0c66a | 2009-06-01 23:59:20 +0000 | [diff] [blame] | 682 | AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC, |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 683 | test x$VGCONF_PLATFORM_SEC_CAPS != x) |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 684 | |
philippe | f32cbe8 | 2012-05-18 16:48:20 +0000 | [diff] [blame] | 685 | dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a |
| 686 | dnl fallback definition |
| 687 | dnl The macro is courtesy of Dave Hart: |
| 688 | dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html |
| 689 | m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [ |
| 690 | if test -z "$$1_TRUE"; then : |
| 691 | m4_n([$2])[]dnl |
| 692 | m4_ifval([$3], |
| 693 | [else |
| 694 | $3 |
| 695 | ])dnl |
| 696 | fi[]dnl |
| 697 | ])]) |
tom | b637bad | 2005-11-08 12:28:35 +0000 | [diff] [blame] | 698 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 699 | #---------------------------------------------------------------------------- |
| 700 | # Inner Valgrind? |
| 701 | #---------------------------------------------------------------------------- |
| 702 | |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 703 | # Check if this should be built as an inner Valgrind, to be run within |
| 704 | # another Valgrind. Choose the load address accordingly. |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 705 | AC_SUBST(VALT_LOAD_ADDRESS_PRI) |
| 706 | AC_SUBST(VALT_LOAD_ADDRESS_SEC) |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 707 | AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, |
| 708 | [AC_ARG_ENABLE(inner, |
| 709 | [ --enable-inner enables self-hosting], |
| 710 | [vg_cv_inner=$enableval], |
| 711 | [vg_cv_inner=no])]) |
| 712 | if test "$vg_cv_inner" = yes; then |
| 713 | AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind]) |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 714 | VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner |
| 715 | VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 716 | else |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 717 | VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml |
| 718 | VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml |
njn | d74b0ef | 2009-01-20 06:06:52 +0000 | [diff] [blame] | 719 | fi |
| 720 | |
| 721 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 722 | #---------------------------------------------------------------------------- |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 723 | # Define MIPS_PAGE_SHIFT (--with-pagesize) |
| 724 | #---------------------------------------------------------------------------- |
| 725 | AC_ARG_WITH(pagesize, |
| 726 | [ --with-pagesize= override detected page size (4, 16 or 64)], |
| 727 | [psize=$withval], |
| 728 | [psize=0] |
| 729 | ) |
| 730 | |
| 731 | if test "$psize" = "0"; then |
| 732 | psizer=`getconf PAGESIZE` |
| 733 | let "psize=${psizer}/1024" |
| 734 | fi |
| 735 | |
| 736 | if test "$psize" = "4"; then |
| 737 | AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured page size 4k]) |
| 738 | elif test "$psize" = "16"; then |
| 739 | AC_DEFINE([MIPS_PAGE_SHIFT], 14, [configured page size 16k]) |
| 740 | elif test "$psize" = "64"; then |
| 741 | AC_DEFINE([MIPS_PAGE_SHIFT], 16, [configured page size 64k]) |
| 742 | else |
| 743 | AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured default page size 4k]) |
| 744 | fi |
| 745 | AC_MSG_RESULT([checking for Pagesize... ${psize}k]) |
| 746 | |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 747 | |
| 748 | #---------------------------------------------------------------------------- |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 749 | # Extra fine-tuning of installation directories |
| 750 | #---------------------------------------------------------------------------- |
| 751 | AC_ARG_WITH(tmpdir, |
| 752 | [ --with-tmpdir=PATH Specify path for temporary files], |
| 753 | tmpdir="$withval", |
| 754 | tmpdir="/tmp") |
| 755 | AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory]) |
| 756 | |
sewardj | 0ba37c9 | 2011-07-12 11:46:24 +0000 | [diff] [blame] | 757 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 758 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 759 | # Libc and suppressions |
| 760 | #---------------------------------------------------------------------------- |
| 761 | # This variable will collect the suppression files to be used. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 762 | AC_SUBST(DEFAULT_SUPP) |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 763 | |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 764 | AC_CHECK_HEADER([features.h]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 765 | |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 766 | if test x$ac_cv_header_features_h = xyes; then |
| 767 | rm -f conftest.$ac_ext |
| 768 | cat <<_ACEOF >conftest.$ac_ext |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 769 | #include <features.h> |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 770 | #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) |
| 771 | glibc version is: __GLIBC__ __GLIBC_MINOR__ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 772 | #endif |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 773 | _ACEOF |
| 774 | GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`" |
| 775 | fi |
bart | b7c3f08 | 2010-05-13 06:32:36 +0000 | [diff] [blame] | 776 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 777 | # not really a version check |
| 778 | AC_EGREP_CPP([DARWIN_LIBC], [ |
| 779 | #include <sys/cdefs.h> |
| 780 | #if defined(__DARWIN_VERS_1050) |
| 781 | DARWIN_LIBC |
| 782 | #endif |
| 783 | ], |
| 784 | GLIBC_VERSION="darwin") |
| 785 | |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 786 | # not really a version check |
| 787 | AC_EGREP_CPP([BIONIC_LIBC], [ |
| 788 | #if defined(__ANDROID__) |
| 789 | BIONIC_LIBC |
| 790 | #endif |
| 791 | ], |
| 792 | GLIBC_VERSION="bionic") |
| 793 | |
| 794 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 795 | AC_MSG_CHECKING([the GLIBC_VERSION version]) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 796 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 797 | case "${GLIBC_VERSION}" in |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 798 | 2.2) |
| 799 | AC_MSG_RESULT(2.2 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 800 | AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 801 | DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" |
| 802 | DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 803 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 804 | ;; |
| 805 | |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 806 | 2.3) |
| 807 | AC_MSG_RESULT(2.3 family) |
daywalker | 418c748 | 2002-10-16 13:09:26 +0000 | [diff] [blame] | 808 | AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 809 | DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 810 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 811 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 08c7f01 | 2002-10-07 23:56:55 +0000 | [diff] [blame] | 812 | ;; |
| 813 | |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 814 | 2.4) |
| 815 | AC_MSG_RESULT(2.4 family) |
| 816 | AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 817 | DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 818 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 819 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
njn | 781dba5 | 2005-06-30 04:06:38 +0000 | [diff] [blame] | 820 | ;; |
| 821 | |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 822 | 2.5) |
| 823 | AC_MSG_RESULT(2.5 family) |
| 824 | AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 825 | DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 826 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 827 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 828 | ;; |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 829 | 2.6) |
| 830 | AC_MSG_RESULT(2.6 family) |
| 831 | AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x]) |
sewardj | 2c4f3dd | 2007-11-11 06:13:01 +0000 | [diff] [blame] | 832 | DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 833 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 834 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 835 | ;; |
| 836 | 2.7) |
| 837 | AC_MSG_RESULT(2.7 family) |
| 838 | AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x]) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 839 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
sewardj | 68c80c1 | 2007-11-18 14:40:02 +0000 | [diff] [blame] | 840 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
tom | 0a0fcee | 2008-01-05 00:12:45 +0000 | [diff] [blame] | 841 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
dirk | c8bd0c5 | 2007-05-23 17:39:08 +0000 | [diff] [blame] | 842 | ;; |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 843 | 2.8) |
| 844 | AC_MSG_RESULT(2.8 family) |
dirk | eb939fc | 2008-04-27 20:38:47 +0000 | [diff] [blame] | 845 | AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x]) |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 846 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 847 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 848 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 849 | ;; |
dirk | d2e31eb | 2008-11-19 23:58:36 +0000 | [diff] [blame] | 850 | 2.9) |
| 851 | AC_MSG_RESULT(2.9 family) |
| 852 | AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x]) |
| 853 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 854 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 855 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 856 | ;; |
sewardj | 5d425e8 | 2009-02-01 19:01:11 +0000 | [diff] [blame] | 857 | 2.10) |
| 858 | AC_MSG_RESULT(2.10 family) |
| 859 | AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x]) |
| 860 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 861 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 862 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 863 | ;; |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame] | 864 | 2.11) |
| 865 | AC_MSG_RESULT(2.11 family) |
| 866 | AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x]) |
| 867 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 868 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 869 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
bart | b7c3f08 | 2010-05-13 06:32:36 +0000 | [diff] [blame] | 870 | ;; |
| 871 | 2.12) |
| 872 | AC_MSG_RESULT(2.12 family) |
| 873 | AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x]) |
| 874 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 875 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 876 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
bart | 0fac7ff | 2009-11-15 19:11:19 +0000 | [diff] [blame] | 877 | ;; |
tom | ebd619b | 2011-02-10 09:09:09 +0000 | [diff] [blame] | 878 | 2.13) |
| 879 | AC_MSG_RESULT(2.13 family) |
| 880 | AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x]) |
| 881 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 882 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 883 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 884 | ;; |
tom | cc07741 | 2011-06-07 21:52:26 +0000 | [diff] [blame] | 885 | 2.14) |
| 886 | AC_MSG_RESULT(2.14 family) |
| 887 | AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x]) |
| 888 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 889 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 890 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 891 | ;; |
dirk | e75fdeb | 2011-12-29 08:24:55 +0000 | [diff] [blame] | 892 | 2.15) |
| 893 | AC_MSG_RESULT(2.15 family) |
| 894 | AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x]) |
| 895 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 896 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 897 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 898 | ;; |
sewardj | c7188be | 2012-07-14 10:07:06 +0000 | [diff] [blame] | 899 | 2.16) |
| 900 | AC_MSG_RESULT(2.16 family) |
| 901 | AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x]) |
| 902 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 903 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 904 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 905 | ;; |
tom | 3781ac1 | 2013-01-14 09:48:49 +0000 | [diff] [blame] | 906 | 2.17) |
| 907 | AC_MSG_RESULT(2.17 family) |
| 908 | AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x]) |
| 909 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 910 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 911 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 912 | ;; |
mjw | 317f01b | 2013-08-21 14:47:52 +0000 | [diff] [blame] | 913 | 2.18) |
| 914 | AC_MSG_RESULT(2.18 family) |
| 915 | AC_DEFINE([GLIBC_2_18], 1, [Define to 1 if you're using glibc 2.18.x]) |
| 916 | DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" |
| 917 | DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" |
| 918 | DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" |
| 919 | ;; |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 920 | darwin) |
| 921 | AC_MSG_RESULT(Darwin) |
| 922 | AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) |
| 923 | # DEFAULT_SUPP set by kernel version check above. |
| 924 | ;; |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 925 | bionic) |
| 926 | AC_MSG_RESULT(Bionic) |
| 927 | AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic]) |
| 928 | DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}" |
| 929 | ;; |
dirk | aece45c | 2006-10-12 08:17:49 +0000 | [diff] [blame] | 930 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 931 | *) |
bart | 12e9112 | 2010-05-15 08:37:24 +0000 | [diff] [blame] | 932 | AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) |
tom | 3781ac1 | 2013-01-14 09:48:49 +0000 | [diff] [blame] | 933 | AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17]) |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 934 | AC_MSG_ERROR([or Darwin libc]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 935 | ;; |
| 936 | esac |
| 937 | |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 938 | AC_SUBST(GLIBC_VERSION) |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 939 | |
sewardj | 414f358 | 2008-07-18 20:46:00 +0000 | [diff] [blame] | 940 | |
| 941 | # Add default suppressions for the X client libraries. Make no |
| 942 | # attempt to detect whether such libraries are installed on the |
| 943 | # build machine (or even if any X facilities are present); just |
| 944 | # add the suppressions antidisirregardless. |
| 945 | DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}" |
| 946 | DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" |
gobry | e721a52 | 2002-03-22 13:38:30 +0000 | [diff] [blame] | 947 | |
sewardj | d2f95a0 | 2011-05-11 16:04:28 +0000 | [diff] [blame] | 948 | # Add glibc and X11 suppressions for exp-sgcheck |
| 949 | DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}" |
sewardj | 5744c02 | 2008-10-19 18:58:13 +0000 | [diff] [blame] | 950 | |
sewardj | 2e10a68 | 2003-04-07 19:36:41 +0000 | [diff] [blame] | 951 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 952 | #---------------------------------------------------------------------------- |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 953 | # Platform variants? |
| 954 | #---------------------------------------------------------------------------- |
| 955 | |
| 956 | # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough. |
| 957 | # But there are times where we need a bit more control. The motivating |
philippe | 5d5dd8e | 2012-08-05 00:08:25 +0000 | [diff] [blame] | 958 | # and currently only case is Android: this is almost identical to |
| 959 | # {x86,arm}-linux, but not quite. So this introduces the concept of platform |
| 960 | # variant tags, which get passed in the compile as -DVGPV_<arch>_<os>_<variant> |
| 961 | # along with the main -DVGP_<arch>_<os> definition. |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 962 | # |
| 963 | # In almost all cases, the <variant> bit is "vanilla". But for Android |
| 964 | # it is "android" instead. |
| 965 | # |
| 966 | # Consequently (eg), plain arm-linux would build with |
| 967 | # |
| 968 | # -DVGP_arm_linux -DVGPV_arm_linux_vanilla |
| 969 | # |
| 970 | # whilst an Android build would have |
| 971 | # |
| 972 | # -DVGP_arm_linux -DVGPV_arm_linux_android |
| 973 | # |
philippe | 5d5dd8e | 2012-08-05 00:08:25 +0000 | [diff] [blame] | 974 | # Same for x86. The setup of the platform variant is pushed relatively far |
| 975 | # 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] | 976 | |
| 977 | # In the normal case .. |
| 978 | VGCONF_PLATVARIANT="vanilla" |
| 979 | |
philippe | 5d5dd8e | 2012-08-05 00:08:25 +0000 | [diff] [blame] | 980 | # Android ? |
| 981 | if test "$GLIBC_VERSION" = "bionic"; |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 982 | then |
| 983 | VGCONF_PLATVARIANT="android" |
| 984 | fi |
| 985 | |
| 986 | AC_SUBST(VGCONF_PLATVARIANT) |
| 987 | |
| 988 | |
| 989 | # FIXME: do we also want to define automake variables |
| 990 | # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently) |
| 991 | # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE, |
| 992 | # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough |
| 993 | # do that. Problem is that we can't do and-ing in Makefile.am's, but |
| 994 | # that's what we'd need to do to use this, since what we'd want to write |
| 995 | # is something like |
| 996 | # |
| 997 | # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID |
| 998 | # |
sewardj | 0ba37c9 | 2011-07-12 11:46:24 +0000 | [diff] [blame] | 999 | # Hmm. Can't think of a nice clean solution to this. |
| 1000 | |
| 1001 | AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA, |
| 1002 | test x$VGCONF_PLATVARIANT = xvanilla) |
| 1003 | AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID, |
| 1004 | test x$VGCONF_PLATVARIANT = xandroid) |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 1005 | |
| 1006 | |
| 1007 | #---------------------------------------------------------------------------- |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1008 | # Checking for various library functions and other definitions |
| 1009 | #---------------------------------------------------------------------------- |
| 1010 | |
florian | 28db75c | 2012-12-08 19:26:03 +0000 | [diff] [blame] | 1011 | # Check for AT_FDCWD |
| 1012 | |
| 1013 | AC_MSG_CHECKING([for AT_FDCWD]) |
| 1014 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1015 | #define _GNU_SOURCE |
| 1016 | #include <fcntl.h> |
| 1017 | #include <unistd.h> |
| 1018 | ]], [[ |
| 1019 | int a = AT_FDCWD; |
| 1020 | ]])], [ |
| 1021 | ac_have_at_fdcwd=yes |
| 1022 | AC_MSG_RESULT([yes]) |
| 1023 | ], [ |
| 1024 | ac_have_at_fdcwd=no |
florian | 28db75c | 2012-12-08 19:26:03 +0000 | [diff] [blame] | 1025 | AC_MSG_RESULT([no]) |
| 1026 | ]) |
| 1027 | |
| 1028 | AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes]) |
| 1029 | |
sewardj | 24cf8df | 2012-12-14 10:30:57 +0000 | [diff] [blame] | 1030 | # Check for stpncpy function definition in string.h |
| 1031 | # This explicitly checks with _GNU_SOURCE defined since that is also |
| 1032 | # used in the test case (some systems might define it without anyway |
| 1033 | # since stpncpy is part of The Open Group Base Specifications Issue 7 |
| 1034 | # IEEE Std 1003.1-2008. |
| 1035 | AC_MSG_CHECKING([for stpncpy]) |
| 1036 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 1037 | #define _GNU_SOURCE |
| 1038 | #include <string.h> |
| 1039 | ]], [[ |
| 1040 | char *d; |
| 1041 | char *s; |
| 1042 | size_t n = 0; |
| 1043 | char *r = stpncpy(d, s, n); |
| 1044 | ]])], [ |
| 1045 | ac_have_gnu_stpncpy=yes |
| 1046 | AC_MSG_RESULT([yes]) |
| 1047 | ], [ |
| 1048 | ac_have_gnu_stpncpy=no |
| 1049 | AC_MSG_RESULT([no]) |
| 1050 | ]) |
| 1051 | |
| 1052 | AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes]) |
florian | 28db75c | 2012-12-08 19:26:03 +0000 | [diff] [blame] | 1053 | |
philippe | 4e98f7c | 2013-08-03 20:34:58 +0000 | [diff] [blame] | 1054 | # Check for PTRACE_GETREGS |
| 1055 | |
| 1056 | AC_MSG_CHECKING([for PTRACE_GETREGS]) |
| 1057 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1058 | #include <stddef.h> |
| 1059 | #include <sys/ptrace.h> |
| 1060 | #include <sys/user.h> |
| 1061 | ]], [[ |
| 1062 | void *p; |
| 1063 | long res = ptrace (PTRACE_GETREGS, 0, p, p); |
| 1064 | ]])], [ |
| 1065 | AC_MSG_RESULT([yes]) |
| 1066 | AC_DEFINE([HAVE_PTRACE_GETREGS], 1, |
| 1067 | [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.]) |
| 1068 | ], [ |
| 1069 | AC_MSG_RESULT([no]) |
| 1070 | ]) |
| 1071 | |
| 1072 | |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1073 | # Check for CLOCK_MONOTONIC |
| 1074 | |
| 1075 | AC_MSG_CHECKING([for CLOCK_MONOTONIC]) |
| 1076 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1077 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1078 | #include <time.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1079 | ]], [[ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1080 | struct timespec t; |
| 1081 | clock_gettime(CLOCK_MONOTONIC, &t); |
| 1082 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1083 | ]])], [ |
bart | 59e2f18 | 2008-04-28 16:22:53 +0000 | [diff] [blame] | 1084 | AC_MSG_RESULT([yes]) |
| 1085 | AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, |
| 1086 | [Define to 1 if you have the `CLOCK_MONOTONIC' constant.]) |
| 1087 | ], [ |
| 1088 | AC_MSG_RESULT([no]) |
| 1089 | ]) |
| 1090 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1091 | |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1092 | # Check for PTHREAD_RWLOCK_T |
| 1093 | |
| 1094 | AC_MSG_CHECKING([for pthread_rwlock_t]) |
| 1095 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1096 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1097 | #define _GNU_SOURCE |
| 1098 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1099 | ]], [[ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1100 | pthread_rwlock_t rwl; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1101 | ]])], [ |
sewardj | 0c09bf0 | 2011-07-11 22:11:58 +0000 | [diff] [blame] | 1102 | AC_MSG_RESULT([yes]) |
| 1103 | AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1, |
| 1104 | [Define to 1 if you have the `pthread_rwlock_t' type.]) |
| 1105 | ], [ |
| 1106 | AC_MSG_RESULT([no]) |
| 1107 | ]) |
| 1108 | |
| 1109 | |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1110 | # Check for PTHREAD_MUTEX_ADAPTIVE_NP |
| 1111 | |
| 1112 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP]) |
| 1113 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1114 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1115 | #define _GNU_SOURCE |
| 1116 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1117 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1118 | return (PTHREAD_MUTEX_ADAPTIVE_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1119 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1120 | AC_MSG_RESULT([yes]) |
| 1121 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, |
| 1122 | [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.]) |
| 1123 | ], [ |
| 1124 | AC_MSG_RESULT([no]) |
| 1125 | ]) |
| 1126 | |
| 1127 | |
| 1128 | # Check for PTHREAD_MUTEX_ERRORCHECK_NP |
| 1129 | |
| 1130 | AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP]) |
| 1131 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1132 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1133 | #define _GNU_SOURCE |
| 1134 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1135 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1136 | return (PTHREAD_MUTEX_ERRORCHECK_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1137 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1138 | AC_MSG_RESULT([yes]) |
| 1139 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1, |
| 1140 | [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.]) |
| 1141 | ], [ |
| 1142 | AC_MSG_RESULT([no]) |
| 1143 | ]) |
| 1144 | |
| 1145 | |
| 1146 | # Check for PTHREAD_MUTEX_RECURSIVE_NP |
| 1147 | |
| 1148 | AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP]) |
| 1149 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1150 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1151 | #define _GNU_SOURCE |
| 1152 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1153 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1154 | return (PTHREAD_MUTEX_RECURSIVE_NP); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1155 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1156 | AC_MSG_RESULT([yes]) |
| 1157 | AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, |
| 1158 | [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.]) |
| 1159 | ], [ |
| 1160 | AC_MSG_RESULT([no]) |
| 1161 | ]) |
| 1162 | |
| 1163 | |
| 1164 | # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
| 1165 | |
| 1166 | AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP]) |
| 1167 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1168 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1169 | #define _GNU_SOURCE |
| 1170 | #include <pthread.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1171 | ]], [[ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1172 | pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; |
| 1173 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1174 | ]])], [ |
bart | fea0692 | 2008-05-03 09:12:15 +0000 | [diff] [blame] | 1175 | AC_MSG_RESULT([yes]) |
| 1176 | AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1, |
| 1177 | [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.]) |
| 1178 | ], [ |
| 1179 | AC_MSG_RESULT([no]) |
| 1180 | ]) |
| 1181 | |
| 1182 | |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1183 | # Check whether pthread_mutex_t has a member called __m_kind. |
| 1184 | |
bart | b11355c | 2010-04-29 16:37:26 +0000 | [diff] [blame] | 1185 | AC_CHECK_MEMBER([pthread_mutex_t.__m_kind], |
| 1186 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND], |
| 1187 | 1, |
| 1188 | [Define to 1 if pthread_mutex_t has a member called __m_kind.]) |
| 1189 | ], |
| 1190 | [], |
| 1191 | [#include <pthread.h>]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1192 | |
| 1193 | |
| 1194 | # Check whether pthread_mutex_t has a member called __data.__kind. |
| 1195 | |
bart | b11355c | 2010-04-29 16:37:26 +0000 | [diff] [blame] | 1196 | AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind], |
| 1197 | [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND], |
| 1198 | 1, |
| 1199 | [Define to 1 if pthread_mutex_t has a member __data.__kind.]) |
| 1200 | ], |
| 1201 | [], |
| 1202 | [#include <pthread.h>]) |
bart | 5e389f1 | 2008-04-05 12:53:15 +0000 | [diff] [blame] | 1203 | |
| 1204 | |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1205 | # does this compiler support -maltivec and does it have the include file |
| 1206 | # <altivec.h> ? |
| 1207 | |
| 1208 | AC_MSG_CHECKING([for Altivec]) |
| 1209 | |
| 1210 | safe_CFLAGS=$CFLAGS |
| 1211 | CFLAGS="-maltivec" |
| 1212 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1213 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1214 | #include <altivec.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1215 | ]], [[ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1216 | vector unsigned int v; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1217 | ]])], [ |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1218 | ac_have_altivec=yes |
| 1219 | AC_MSG_RESULT([yes]) |
sewardj | f9fe602 | 2010-09-03 14:36:50 +0000 | [diff] [blame] | 1220 | AC_DEFINE([HAS_ALTIVEC], 1, |
sewardj | 6467a15 | 2010-09-03 14:02:22 +0000 | [diff] [blame] | 1221 | [Define to 1 if gcc/as can do Altivec.]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1222 | ], [ |
| 1223 | ac_have_altivec=no |
| 1224 | AC_MSG_RESULT([no]) |
| 1225 | ]) |
| 1226 | CFLAGS=$safe_CFLAGS |
| 1227 | |
sewardj | 0e342a0 | 2010-09-03 23:49:33 +0000 | [diff] [blame] | 1228 | AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes]) |
bart | 62c370e | 2008-05-12 18:50:51 +0000 | [diff] [blame] | 1229 | |
| 1230 | |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1231 | # Check that both: the compiler supports -mvsx and that the assembler |
| 1232 | # understands VSX instructions. If either of those doesn't work, |
| 1233 | # conclude that we can't do VSX. NOTE: basically this is a kludge |
| 1234 | # in that it conflates two things that should be separate -- whether |
| 1235 | # the compiler understands the flag vs whether the assembler |
| 1236 | # understands the opcodes. This really ought to be cleaned up |
| 1237 | # and done properly, like it is for x86/x86_64. |
| 1238 | |
| 1239 | AC_MSG_CHECKING([for VSX]) |
| 1240 | |
| 1241 | safe_CFLAGS=$CFLAGS |
| 1242 | CFLAGS="-mvsx" |
| 1243 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1244 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1245 | #include <altivec.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1246 | ]], [[ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1247 | vector unsigned int v; |
sewardj | 9b80ebb | 2011-04-15 21:16:00 +0000 | [diff] [blame] | 1248 | __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1249 | ]])], [ |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1250 | ac_have_vsx=yes |
| 1251 | AC_MSG_RESULT([yes]) |
| 1252 | ], [ |
| 1253 | ac_have_vsx=no |
| 1254 | AC_MSG_RESULT([no]) |
| 1255 | ]) |
| 1256 | CFLAGS=$safe_CFLAGS |
| 1257 | |
| 1258 | AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes) |
| 1259 | |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1260 | |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1261 | AC_MSG_CHECKING([that assembler knows DFP]) |
| 1262 | |
| 1263 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1264 | ]], [[ |
| 1265 | __asm__ __volatile__("dadd 1, 2, 3"); |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1266 | __asm__ __volatile__("dcffix 1, 2"); |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1267 | ]])], [ |
| 1268 | ac_asm_have_dfp=yes |
| 1269 | AC_MSG_RESULT([yes]) |
| 1270 | ], [ |
| 1271 | ac_asm_have_dfp=no |
| 1272 | AC_MSG_RESULT([no]) |
| 1273 | ]) |
| 1274 | |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1275 | |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1276 | AC_MSG_CHECKING([that compiler knows -mhard-dfp switch]) |
| 1277 | safe_CFLAGS=$CFLAGS |
| 1278 | CFLAGS="-mhard-dfp" |
| 1279 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1280 | ]], [[ |
| 1281 | __asm__ __volatile__("dadd 1, 2, 3"); |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1282 | __asm__ __volatile__("dcffix 1, 2"); |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1283 | ]])], [ |
| 1284 | ac_gcc_have_dfp=yes |
| 1285 | AC_MSG_RESULT([yes]) |
| 1286 | ], [ |
| 1287 | ac_gcc_have_dfp=no |
| 1288 | AC_MSG_RESULT([no]) |
| 1289 | ]) |
| 1290 | |
sewardj | b0ccb4d | 2012-04-02 10:22:05 +0000 | [diff] [blame] | 1291 | CFLAGS=$safe_CFLAGS |
| 1292 | |
| 1293 | AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes -a x$ac_gcc_have_dfp = xyes) |
sewardj | f34eb49 | 2011-04-15 11:57:05 +0000 | [diff] [blame] | 1294 | |
sewardj | 4e1c191 | 2012-08-08 22:22:26 +0000 | [diff] [blame] | 1295 | |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1296 | AC_MSG_CHECKING([that compiler knows DFP datatypes]) |
| 1297 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1298 | ]], [[ |
| 1299 | _Decimal64 x = 0.0DD; |
| 1300 | ]])], [ |
| 1301 | ac_gcc_have_dfp_type=yes |
| 1302 | AC_MSG_RESULT([yes]) |
| 1303 | ], [ |
| 1304 | ac_gcc_have_dfp_type=no |
| 1305 | AC_MSG_RESULT([no]) |
| 1306 | ]) |
| 1307 | |
| 1308 | AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_gcc_have_dfp_type = xyes) |
| 1309 | |
carll | dfbf294 | 2013-08-12 18:04:22 +0000 | [diff] [blame] | 1310 | # isa 2.07 checking |
| 1311 | AC_MSG_CHECKING([that assembler knows ISA 2.07 ]) |
| 1312 | |
| 1313 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1314 | ]], [[ |
| 1315 | __asm__ __volatile__("mtvsrd 1,2 "); |
| 1316 | ]])], [ |
| 1317 | ac_asm_have_isa_2_07=yes |
| 1318 | AC_MSG_RESULT([yes]) |
| 1319 | ], [ |
| 1320 | ac_asm_have_isa_2_07=no |
| 1321 | AC_MSG_RESULT([no]) |
| 1322 | ]) |
| 1323 | |
| 1324 | AM_CONDITIONAL(HAS_ISA_2_07, test x$ac_asm_have_isa_2_07 = xyes) |
florian | 4682598 | 2012-11-10 22:35:24 +0000 | [diff] [blame] | 1325 | |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1326 | # Check for pthread_create@GLIBC2.0 |
| 1327 | AC_MSG_CHECKING([for pthread_create@GLIBC2.0()]) |
| 1328 | |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1329 | safe_CFLAGS=$CFLAGS |
| 1330 | CFLAGS="-lpthread" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1331 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1332 | extern int pthread_create_glibc_2_0(void*, const void*, |
| 1333 | void *(*)(void*), void*); |
| 1334 | __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1335 | ]], [[ |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 1336 | #ifdef __powerpc__ |
| 1337 | /* |
| 1338 | * Apparently on PowerPC linking this program succeeds and generates an |
| 1339 | * executable with the undefined symbol pthread_create@GLIBC_2.0. |
| 1340 | */ |
| 1341 | #error This test does not work properly on PowerPC. |
| 1342 | #else |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1343 | pthread_create_glibc_2_0(0, 0, 0, 0); |
bart | 276ed3a | 2009-05-10 15:41:45 +0000 | [diff] [blame] | 1344 | #endif |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1345 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1346 | ]])], [ |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1347 | ac_have_pthread_create_glibc_2_0=yes |
| 1348 | AC_MSG_RESULT([yes]) |
| 1349 | AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1, |
| 1350 | [Define to 1 if you have the `pthread_create@glibc2.0' function.]) |
| 1351 | ], [ |
| 1352 | ac_have_pthread_create_glibc_2_0=no |
| 1353 | AC_MSG_RESULT([no]) |
| 1354 | ]) |
bart | 16e1c5a | 2009-04-26 07:38:53 +0000 | [diff] [blame] | 1355 | CFLAGS=$safe_CFLAGS |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1356 | |
| 1357 | AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0, |
bart | 24f5390 | 2009-04-26 11:29:02 +0000 | [diff] [blame] | 1358 | test x$ac_have_pthread_create_glibc_2_0 = xyes) |
bart | 36dd85a | 2009-04-26 07:11:48 +0000 | [diff] [blame] | 1359 | |
| 1360 | |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1361 | # Check for eventfd_t, eventfd() and eventfd_read() |
| 1362 | AC_MSG_CHECKING([for eventfd()]) |
| 1363 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1364 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1365 | #include <sys/eventfd.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1366 | ]], [[ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1367 | eventfd_t ev; |
| 1368 | int fd; |
| 1369 | |
| 1370 | fd = eventfd(5, 0); |
| 1371 | eventfd_read(fd, &ev); |
| 1372 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1373 | ]])], [ |
bart | a50aa8a | 2008-04-27 06:06:57 +0000 | [diff] [blame] | 1374 | AC_MSG_RESULT([yes]) |
| 1375 | AC_DEFINE([HAVE_EVENTFD], 1, |
| 1376 | [Define to 1 if you have the `eventfd' function.]) |
| 1377 | AC_DEFINE([HAVE_EVENTFD_READ], 1, |
| 1378 | [Define to 1 if you have the `eventfd_read' function.]) |
| 1379 | ], [ |
| 1380 | AC_MSG_RESULT([no]) |
| 1381 | ]) |
| 1382 | |
| 1383 | |
florian | 24fefb6 | 2013-10-08 13:04:00 +0000 | [diff] [blame] | 1384 | # Check whether compiler can process #include <thread> without errors |
| 1385 | # clang 3.3 cannot process <thread> from e.g. |
| 1386 | # gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 |
| 1387 | |
| 1388 | AC_MSG_CHECKING([that C++ compiler can include <thread> header file]) |
| 1389 | AC_LANG(C++) |
| 1390 | safe_CXXFLAGS=$CXXFLAGS |
| 1391 | CXXFLAGS=-std=c++0x |
| 1392 | |
| 1393 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
| 1394 | #include <thread> |
| 1395 | ])], |
| 1396 | [ |
| 1397 | ac_cxx_can_include_thread_header=yes |
| 1398 | AC_MSG_RESULT([yes]) |
| 1399 | ], [ |
| 1400 | ac_cxx_can_include_thread_header=no |
| 1401 | AC_MSG_RESULT([no]) |
| 1402 | ]) |
| 1403 | CXXFLAGS=$safe_CXXFLAGS |
| 1404 | AC_LANG(C) |
| 1405 | |
| 1406 | AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes) |
| 1407 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 1408 | #---------------------------------------------------------------------------- |
| 1409 | # Checking for supported compiler flags. |
| 1410 | #---------------------------------------------------------------------------- |
| 1411 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1412 | # does this compiler support -m32 ? |
| 1413 | AC_MSG_CHECKING([if gcc accepts -m32]) |
| 1414 | |
| 1415 | safe_CFLAGS=$CFLAGS |
| 1416 | CFLAGS="-m32" |
| 1417 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1418 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1419 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1420 | ]])], [ |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1421 | FLAG_M32="-m32" |
| 1422 | AC_MSG_RESULT([yes]) |
| 1423 | ], [ |
| 1424 | FLAG_M32="" |
| 1425 | AC_MSG_RESULT([no]) |
| 1426 | ]) |
| 1427 | CFLAGS=$safe_CFLAGS |
| 1428 | |
| 1429 | AC_SUBST(FLAG_M32) |
| 1430 | |
| 1431 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1432 | # does this compiler support -m64 ? |
| 1433 | AC_MSG_CHECKING([if gcc accepts -m64]) |
| 1434 | |
| 1435 | safe_CFLAGS=$CFLAGS |
| 1436 | CFLAGS="-m64" |
| 1437 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1438 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1439 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1440 | ]])], [ |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1441 | FLAG_M64="-m64" |
| 1442 | AC_MSG_RESULT([yes]) |
| 1443 | ], [ |
| 1444 | FLAG_M64="" |
| 1445 | AC_MSG_RESULT([no]) |
| 1446 | ]) |
| 1447 | CFLAGS=$safe_CFLAGS |
| 1448 | |
| 1449 | AC_SUBST(FLAG_M64) |
| 1450 | |
| 1451 | |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1452 | # does this compiler support -mmmx ? |
| 1453 | AC_MSG_CHECKING([if gcc accepts -mmmx]) |
| 1454 | |
| 1455 | safe_CFLAGS=$CFLAGS |
| 1456 | CFLAGS="-mmmx" |
| 1457 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1458 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1459 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1460 | ]])], [ |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1461 | FLAG_MMMX="-mmmx" |
| 1462 | AC_MSG_RESULT([yes]) |
| 1463 | ], [ |
| 1464 | FLAG_MMMX="" |
| 1465 | AC_MSG_RESULT([no]) |
| 1466 | ]) |
| 1467 | CFLAGS=$safe_CFLAGS |
| 1468 | |
| 1469 | AC_SUBST(FLAG_MMMX) |
| 1470 | |
| 1471 | |
| 1472 | # does this compiler support -msse ? |
| 1473 | AC_MSG_CHECKING([if gcc accepts -msse]) |
| 1474 | |
| 1475 | safe_CFLAGS=$CFLAGS |
| 1476 | CFLAGS="-msse" |
| 1477 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1478 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1479 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1480 | ]])], [ |
sewardj | 67f1fcc | 2005-07-03 10:41:02 +0000 | [diff] [blame] | 1481 | FLAG_MSSE="-msse" |
| 1482 | AC_MSG_RESULT([yes]) |
| 1483 | ], [ |
| 1484 | FLAG_MSSE="" |
| 1485 | AC_MSG_RESULT([no]) |
| 1486 | ]) |
| 1487 | CFLAGS=$safe_CFLAGS |
| 1488 | |
| 1489 | AC_SUBST(FLAG_MSSE) |
| 1490 | |
| 1491 | |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1492 | # does this compiler support -mpreferred-stack-boundary=2 ? |
| 1493 | AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary]) |
| 1494 | |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1495 | safe_CFLAGS=$CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1496 | CFLAGS="-mpreferred-stack-boundary=2" |
| 1497 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1498 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1499 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1500 | ]])], [ |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1501 | PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2" |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1502 | AC_MSG_RESULT([yes]) |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1503 | ], [ |
| 1504 | PREFERRED_STACK_BOUNDARY="" |
| 1505 | AC_MSG_RESULT([no]) |
| 1506 | ]) |
daywalker | 3664f56 | 2003-10-17 13:43:46 +0000 | [diff] [blame] | 1507 | CFLAGS=$safe_CFLAGS |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 1508 | |
| 1509 | AC_SUBST(PREFERRED_STACK_BOUNDARY) |
| 1510 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 1511 | |
florian | da8c126 | 2012-11-18 14:39:11 +0000 | [diff] [blame] | 1512 | # does this compiler support -Wno-pointer-sign ? |
| 1513 | AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign]) |
| 1514 | |
| 1515 | safe_CFLAGS=$CFLAGS |
| 1516 | CFLAGS="-Wno-pointer-sign" |
| 1517 | |
| 1518 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1519 | return 0; |
| 1520 | ]])], [ |
| 1521 | no_pointer_sign=yes |
| 1522 | AC_MSG_RESULT([yes]) |
| 1523 | ], [ |
| 1524 | no_pointer_sign=no |
| 1525 | AC_MSG_RESULT([no]) |
| 1526 | ]) |
| 1527 | CFLAGS=$safe_CFLAGS |
| 1528 | |
| 1529 | AM_CONDITIONAL(HAS_POINTER_SIGN_WARNING, test x$no_pointer_sign = xyes) |
| 1530 | |
| 1531 | |
florian | 6bd9dc1 | 2012-11-23 16:17:43 +0000 | [diff] [blame] | 1532 | # does this compiler support -Wno-write-strings ? |
| 1533 | AC_MSG_CHECKING([if gcc accepts -Wwrite-strings]) |
| 1534 | |
| 1535 | safe_CFLAGS=$CFLAGS |
| 1536 | CFLAGS="-Wwrite-strings" |
| 1537 | |
| 1538 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1539 | return 0; |
| 1540 | ]])], [ |
| 1541 | no_write_strings=yes |
| 1542 | AC_MSG_RESULT([yes]) |
| 1543 | ], [ |
| 1544 | no_write_strings=no |
| 1545 | AC_MSG_RESULT([no]) |
| 1546 | ]) |
| 1547 | CFLAGS=$safe_CFLAGS |
| 1548 | |
| 1549 | if test x$no_write_strings = xyes; then |
| 1550 | CFLAGS="$CFLAGS -Wwrite-strings" |
florian | d79b3bf | 2013-10-02 15:14:59 +0000 | [diff] [blame] | 1551 | CXXFLAGS="$CXXFLAGS -Wwrite-strings" |
florian | 6bd9dc1 | 2012-11-23 16:17:43 +0000 | [diff] [blame] | 1552 | fi |
| 1553 | |
| 1554 | AM_CONDITIONAL(HAS_WRITE_STRINGS_WARNING, test x$no_write_strings = xyes) |
| 1555 | |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1556 | # does this compiler support -Wno-empty-body ? |
| 1557 | |
| 1558 | AC_MSG_CHECKING([if gcc accepts -Wno-empty-body]) |
| 1559 | |
| 1560 | safe_CFLAGS=$CFLAGS |
| 1561 | CFLAGS="-Wno-empty-body" |
| 1562 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1563 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1564 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1565 | ]])], [ |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1566 | AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body]) |
| 1567 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1568 | ], [ |
bart | e026bd2 | 2009-07-04 12:17:07 +0000 | [diff] [blame] | 1569 | AC_SUBST([FLAG_W_NO_EMPTY_BODY], []) |
| 1570 | AC_MSG_RESULT([no]) |
| 1571 | ]) |
| 1572 | CFLAGS=$safe_CFLAGS |
| 1573 | |
| 1574 | |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1575 | # does this compiler support -Wno-format-zero-length ? |
| 1576 | |
| 1577 | AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length]) |
| 1578 | |
| 1579 | safe_CFLAGS=$CFLAGS |
| 1580 | CFLAGS="-Wno-format-zero-length" |
| 1581 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1582 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1583 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1584 | ]])], [ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1585 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length]) |
| 1586 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1587 | ], [ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 1588 | AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], []) |
| 1589 | AC_MSG_RESULT([no]) |
| 1590 | ]) |
| 1591 | CFLAGS=$safe_CFLAGS |
| 1592 | |
| 1593 | |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1594 | # does this compiler support -Wno-nonnull ? |
| 1595 | |
| 1596 | AC_MSG_CHECKING([if gcc accepts -Wno-nonnull]) |
| 1597 | |
| 1598 | safe_CFLAGS=$CFLAGS |
| 1599 | CFLAGS="-Wno-nonnull" |
| 1600 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1601 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1602 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1603 | ]])], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1604 | AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull]) |
| 1605 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1606 | ], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1607 | AC_SUBST([FLAG_W_NO_NONNULL], []) |
| 1608 | AC_MSG_RESULT([no]) |
| 1609 | ]) |
| 1610 | CFLAGS=$safe_CFLAGS |
| 1611 | |
| 1612 | |
| 1613 | # does this compiler support -Wno-overflow ? |
| 1614 | |
| 1615 | AC_MSG_CHECKING([if gcc accepts -Wno-overflow]) |
| 1616 | |
| 1617 | safe_CFLAGS=$CFLAGS |
| 1618 | CFLAGS="-Wno-overflow" |
| 1619 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1620 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1621 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1622 | ]])], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1623 | AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow]) |
| 1624 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1625 | ], [ |
bart | 8e21631 | 2011-05-15 17:05:36 +0000 | [diff] [blame] | 1626 | AC_SUBST([FLAG_W_NO_OVERFLOW], []) |
| 1627 | AC_MSG_RESULT([no]) |
| 1628 | ]) |
| 1629 | CFLAGS=$safe_CFLAGS |
| 1630 | |
| 1631 | |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1632 | # does this compiler support -Wno-uninitialized ? |
| 1633 | |
| 1634 | AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized]) |
| 1635 | |
| 1636 | safe_CFLAGS=$CFLAGS |
| 1637 | CFLAGS="-Wno-uninitialized" |
| 1638 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1639 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1640 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1641 | ]])], [ |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1642 | AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized]) |
| 1643 | AC_MSG_RESULT([yes]) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1644 | ], [ |
bart | bf9b85c | 2009-08-12 12:55:56 +0000 | [diff] [blame] | 1645 | AC_SUBST([FLAG_W_NO_UNINITIALIZED], []) |
| 1646 | AC_MSG_RESULT([no]) |
| 1647 | ]) |
| 1648 | CFLAGS=$safe_CFLAGS |
| 1649 | |
| 1650 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1651 | # does this compiler support -Wextra or the older -W ? |
| 1652 | |
| 1653 | AC_MSG_CHECKING([if gcc accepts -Wextra or -W]) |
| 1654 | |
| 1655 | safe_CFLAGS=$CFLAGS |
| 1656 | CFLAGS="-Wextra" |
| 1657 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1658 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1659 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1660 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1661 | AC_SUBST([FLAG_W_EXTRA], [-Wextra]) |
| 1662 | AC_MSG_RESULT([-Wextra]) |
| 1663 | ], [ |
| 1664 | CFLAGS="-W" |
sewardj | 9bdf2a6 | 2011-10-27 06:22:23 +0000 | [diff] [blame] | 1665 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1666 | return 0; |
sewardj | 9bdf2a6 | 2011-10-27 06:22:23 +0000 | [diff] [blame] | 1667 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1668 | AC_SUBST([FLAG_W_EXTRA], [-W]) |
| 1669 | AC_MSG_RESULT([-W]) |
| 1670 | ], [ |
| 1671 | AC_SUBST([FLAG_W_EXTRA], []) |
| 1672 | AC_MSG_RESULT([not supported]) |
| 1673 | ]) |
| 1674 | ]) |
| 1675 | CFLAGS=$safe_CFLAGS |
| 1676 | |
| 1677 | |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1678 | # does this compiler support -fno-stack-protector ? |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1679 | AC_MSG_CHECKING([if gcc accepts -fno-stack-protector]) |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1680 | |
| 1681 | safe_CFLAGS=$CFLAGS |
| 1682 | CFLAGS="-fno-stack-protector" |
| 1683 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1684 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
njn | 9890ee1 | 2009-01-21 22:25:50 +0000 | [diff] [blame] | 1685 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1686 | ]])], [ |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1687 | no_stack_protector=yes |
| 1688 | FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector" |
| 1689 | AC_MSG_RESULT([yes]) |
| 1690 | ], [ |
| 1691 | no_stack_protector=no |
| 1692 | FLAG_FNO_STACK_PROTECTOR="" |
| 1693 | AC_MSG_RESULT([no]) |
| 1694 | ]) |
| 1695 | CFLAGS=$safe_CFLAGS |
| 1696 | |
| 1697 | AC_SUBST(FLAG_FNO_STACK_PROTECTOR) |
| 1698 | |
| 1699 | if test x$no_stack_protector = xyes; then |
| 1700 | CFLAGS="$CFLAGS -fno-stack-protector" |
florian | d79b3bf | 2013-10-02 15:14:59 +0000 | [diff] [blame] | 1701 | CXXFLAGS="$CXXFLAGS -fno-stack-protector" |
sewardj | a72c26d | 2007-05-01 13:44:08 +0000 | [diff] [blame] | 1702 | fi |
| 1703 | |
| 1704 | |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1705 | # does this compiler support --param inline-unit-growth=... ? |
| 1706 | |
| 1707 | AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth]) |
| 1708 | |
| 1709 | safe_CFLAGS=$CFLAGS |
| 1710 | CFLAGS="--param inline-unit-growth=900" |
| 1711 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1712 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1713 | return 0; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1714 | ]])], [ |
bart | 56730cd | 2008-05-11 06:41:46 +0000 | [diff] [blame] | 1715 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], |
| 1716 | ["--param inline-unit-growth=900"]) |
| 1717 | AC_MSG_RESULT([yes]) |
| 1718 | ], [ |
| 1719 | AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""]) |
| 1720 | AC_MSG_RESULT([no]) |
| 1721 | ]) |
| 1722 | CFLAGS=$safe_CFLAGS |
| 1723 | |
| 1724 | |
sewardj | d935068 | 2012-04-05 07:55:47 +0000 | [diff] [blame] | 1725 | # does this compiler support -gdwarf-4 -fdebug-types-section ? |
| 1726 | |
| 1727 | AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section]) |
| 1728 | |
| 1729 | safe_CFLAGS=$CFLAGS |
| 1730 | CFLAGS="-gdwarf-4 -fdebug-types-section" |
| 1731 | |
| 1732 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ |
| 1733 | return 0; |
| 1734 | ]])], [ |
| 1735 | ac_have_dwarf4=yes |
| 1736 | AC_MSG_RESULT([yes]) |
| 1737 | ], [ |
| 1738 | ac_have_dwarf4=no |
| 1739 | AC_MSG_RESULT([no]) |
| 1740 | ]) |
| 1741 | AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes) |
| 1742 | CFLAGS=$safe_CFLAGS |
| 1743 | |
| 1744 | |
florian | 3df0211 | 2013-10-04 11:35:50 +0000 | [diff] [blame] | 1745 | # does this compiler support -gstabs ? |
| 1746 | |
| 1747 | AC_MSG_CHECKING([if gcc accepts -gstabs]) |
| 1748 | |
| 1749 | safe_CFLAGS=$CFLAGS |
| 1750 | CFLAGS="-gstabs" |
| 1751 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1752 | return 0; |
| 1753 | ]])], [ |
| 1754 | ac_have_gstabs=yes |
| 1755 | AC_MSG_RESULT([yes]) |
| 1756 | ], [ |
| 1757 | ac_have_gstabs=no |
| 1758 | AC_MSG_RESULT([no]) |
| 1759 | ]) |
| 1760 | CFLAGS=$safe_CFLAGS |
| 1761 | AM_CONDITIONAL([HAVE_GSTABS], [test x$ac_have_gstabs = xyes]) |
| 1762 | |
| 1763 | |
| 1764 | # does this compiler support nested functions ? |
| 1765 | |
| 1766 | AC_MSG_CHECKING([if gcc accepts nested functions]) |
| 1767 | |
| 1768 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1769 | int foo() { return 1; } |
| 1770 | return foo(); |
| 1771 | ]])], [ |
| 1772 | ac_have_nested_functions=yes |
| 1773 | AC_MSG_RESULT([yes]) |
| 1774 | ], [ |
| 1775 | ac_have_nested_functions=no |
| 1776 | AC_MSG_RESULT([no]) |
| 1777 | ]) |
| 1778 | AM_CONDITIONAL([HAVE_NESTED_FUNCTIONS], [test x$ac_have_nested_functions = xyes]) |
| 1779 | |
| 1780 | |
| 1781 | # does this compiler support the 'p' constraint in ASM statements ? |
| 1782 | |
| 1783 | AC_MSG_CHECKING([if gcc accepts the 'p' constraint in asm statements]) |
| 1784 | |
| 1785 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1786 | char *p; |
| 1787 | __asm__ __volatile__ ("movdqa (%0),%%xmm6\n" : "=p" (p)); |
| 1788 | ]])], [ |
| 1789 | ac_have_asm_constraint_p=yes |
| 1790 | AC_MSG_RESULT([yes]) |
| 1791 | ], [ |
| 1792 | ac_have_asm_constraint_p=no |
| 1793 | AC_MSG_RESULT([no]) |
| 1794 | ]) |
| 1795 | AM_CONDITIONAL([HAVE_ASM_CONSTRAINT_P], [test x$ac_have_asm_constraint_p = xyes]) |
| 1796 | |
| 1797 | |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 1798 | # We want to use use the -Ttext-segment option to the linker. |
| 1799 | # GNU (bfd) ld supports this directly. Newer GNU gold linkers |
| 1800 | # support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext |
| 1801 | # semantics are NOT what we want (GNU gold -Ttext is fine). |
| 1802 | # |
| 1803 | # For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers |
| 1804 | # will reside. -Ttext aligns just the .text section start (but not any |
| 1805 | # other section). |
| 1806 | # |
| 1807 | # So test for -Ttext-segment which is supported by all bfd ld versions |
| 1808 | # and use that if it exists. If it doesn't exist it must be an older |
| 1809 | # version of gold and we can fall back to using -Ttext which has the |
| 1810 | # right semantics. |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1811 | |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 1812 | AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1813 | |
| 1814 | safe_CFLAGS=$CFLAGS |
mjw | 941277a | 2013-04-17 19:11:05 +0000 | [diff] [blame] | 1815 | CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml" |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1816 | |
bart | 8508c75 | 2010-06-10 06:26:21 +0000 | [diff] [blame] | 1817 | AC_LINK_IFELSE( |
mjw | 941277a | 2013-04-17 19:11:05 +0000 | [diff] [blame] | 1818 | [AC_LANG_SOURCE([int _start () { return 0; }])], |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1819 | [ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 1820 | linker_using_t_text="no" |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 1821 | AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1822 | AC_MSG_RESULT([yes]) |
| 1823 | ], [ |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 1824 | linker_using_t_text="yes" |
sewardj | e4bc703 | 2013-03-22 11:49:46 +0000 | [diff] [blame] | 1825 | AC_SUBST([FLAG_T_TEXT], ["-Ttext"]) |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1826 | AC_MSG_RESULT([no]) |
| 1827 | ]) |
| 1828 | CFLAGS=$safe_CFLAGS |
| 1829 | |
tom | 04ce9f5 | 2013-03-28 15:53:21 +0000 | [diff] [blame] | 1830 | # If the linker only supports -Ttext (not -Ttext-segment) then we will |
| 1831 | # have to strip any build-id ELF NOTEs from the staticly linked tools. |
| 1832 | # Otherwise the build-id NOTE might end up at the default load address. |
| 1833 | # (Pedantically if the linker is gold then -Ttext is fine, but newer |
| 1834 | # gold versions also support -Ttext-segment. So just assume that unless |
| 1835 | # we can use -Ttext-segment we need to strip the build-id NOTEs. |
| 1836 | if test "x${linker_using_t_text}" == "xyes"; then |
| 1837 | AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.]) |
| 1838 | # does the linker support -Wl,--build-id=none ? Note, it's |
| 1839 | # important that we test indirectly via whichever C compiler |
| 1840 | # is selected, rather than testing /usr/bin/ld or whatever |
| 1841 | # directly. |
| 1842 | AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none]) |
| 1843 | safe_CFLAGS=$CFLAGS |
| 1844 | CFLAGS="-Wl,--build-id=none" |
| 1845 | |
| 1846 | AC_LINK_IFELSE( |
| 1847 | [AC_LANG_PROGRAM([ ], [return 0;])], |
| 1848 | [ |
| 1849 | AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"]) |
| 1850 | AC_MSG_RESULT([yes]) |
| 1851 | ], [ |
| 1852 | AC_SUBST([FLAG_NO_BUILD_ID], [""]) |
| 1853 | AC_MSG_RESULT([no]) |
| 1854 | ]) |
| 1855 | else |
| 1856 | AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.]) |
| 1857 | AC_SUBST([FLAG_NO_BUILD_ID], [""]) |
| 1858 | fi |
| 1859 | CFLAGS=$safe_CFLAGS |
bart | 699fbac | 2010-06-08 18:23:59 +0000 | [diff] [blame] | 1860 | |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1861 | # does the ppc assembler support "mtocrf" et al? |
| 1862 | AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) |
| 1863 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1864 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | dd4cbe1 | 2006-03-12 17:27:44 +0000 | [diff] [blame] | 1865 | __asm__ __volatile__("mtocrf 4,0"); |
| 1866 | __asm__ __volatile__("mfocrf 0,4"); |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1867 | ]])], [ |
sewardj | 00f1e62 | 2006-03-12 16:47:10 +0000 | [diff] [blame] | 1868 | ac_have_as_ppc_mftocrf=yes |
| 1869 | AC_MSG_RESULT([yes]) |
| 1870 | ], [ |
| 1871 | ac_have_as_ppc_mftocrf=no |
| 1872 | AC_MSG_RESULT([no]) |
| 1873 | ]) |
| 1874 | if test x$ac_have_as_ppc_mftocrf = xyes ; then |
| 1875 | AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.]) |
| 1876 | fi |
| 1877 | |
| 1878 | |
carll | 1e5fa2f | 2013-08-09 21:55:45 +0000 | [diff] [blame] | 1879 | # does the ppc assembler support "lfdp" and other phased out floating point insns? |
| 1880 | AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions]) |
| 1881 | |
| 1882 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1883 | do { typedef struct { |
| 1884 | double hi; |
| 1885 | double lo; |
| 1886 | } dbl_pair_t; |
| 1887 | dbl_pair_t dbl_pair[3]; |
| 1888 | __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0])); |
| 1889 | } while (0) |
| 1890 | ]])], [ |
| 1891 | ac_have_as_ppc_fpPO=yes |
| 1892 | AC_MSG_RESULT([yes]) |
| 1893 | ], [ |
| 1894 | ac_have_as_ppc_fpPO=no |
| 1895 | AC_MSG_RESULT([no]) |
| 1896 | ]) |
| 1897 | if test x$ac_have_as_ppc_fpPO = xyes ; then |
| 1898 | AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.]) |
| 1899 | fi |
| 1900 | |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 1901 | CFLAGS=$safe_CFLAGS |
| 1902 | |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1903 | # does the x86/amd64 assembler understand SSE3 instructions? |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1904 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1905 | # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1906 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3]) |
| 1907 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1908 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1909 | do { long long int x; |
| 1910 | __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); } |
| 1911 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1912 | ]])], [ |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1913 | ac_have_as_sse3=yes |
| 1914 | AC_MSG_RESULT([yes]) |
| 1915 | ], [ |
| 1916 | ac_have_as_sse3=no |
| 1917 | AC_MSG_RESULT([no]) |
| 1918 | ]) |
sewardj | fa18a26 | 2007-03-22 12:13:13 +0000 | [diff] [blame] | 1919 | |
| 1920 | AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes) |
sewardj | f0aabf8 | 2007-03-22 00:24:21 +0000 | [diff] [blame] | 1921 | |
| 1922 | |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1923 | # Ditto for SSSE3 instructions (note extra S) |
| 1924 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1925 | # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's |
| 1926 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3]) |
| 1927 | |
florian | c443b96 | 2011-10-28 21:37:19 +0000 | [diff] [blame] | 1928 | save_CFLAGS="$CFLAGS" |
| 1929 | CFLAGS="$CFLAGS -msse" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1930 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1931 | do { long long int x; |
| 1932 | __asm__ __volatile__( |
| 1933 | "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); } |
| 1934 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1935 | ]])], [ |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1936 | ac_have_as_ssse3=yes |
| 1937 | AC_MSG_RESULT([yes]) |
| 1938 | ], [ |
| 1939 | ac_have_as_ssse3=no |
| 1940 | AC_MSG_RESULT([no]) |
| 1941 | ]) |
florian | c443b96 | 2011-10-28 21:37:19 +0000 | [diff] [blame] | 1942 | CFLAGS="$save_CFLAGS" |
sewardj | 6d6da5b | 2008-02-09 12:07:40 +0000 | [diff] [blame] | 1943 | |
| 1944 | AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) |
| 1945 | |
| 1946 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1947 | # does the x86/amd64 assembler understand the PCLMULQDQ instruction? |
| 1948 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1949 | # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 1950 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq']) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1951 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 1952 | do { |
| 1953 | __asm__ __volatile__( |
| 1954 | "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); } |
| 1955 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1956 | ]])], [ |
sewardj | e3ae8a3 | 2010-09-28 19:59:47 +0000 | [diff] [blame] | 1957 | ac_have_as_pclmulqdq=yes |
| 1958 | AC_MSG_RESULT([yes]) |
| 1959 | ], [ |
| 1960 | ac_have_as_pclmulqdq=no |
| 1961 | AC_MSG_RESULT([no]) |
| 1962 | ]) |
| 1963 | |
| 1964 | AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes) |
| 1965 | |
| 1966 | |
bart | 9bbe2bb | 2012-08-03 19:37:02 +0000 | [diff] [blame] | 1967 | # does the x86/amd64 assembler understand the VPCLMULQDQ instruction? |
| 1968 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1969 | # automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's |
| 1970 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq']) |
| 1971 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 1972 | do { |
| 1973 | /* |
| 1974 | * Carry-less multiplication of xmm1 with xmm2 and store the result in |
| 1975 | * xmm3. The immediate is used to determine which quadwords of xmm1 and |
| 1976 | * xmm2 should be used. |
| 1977 | */ |
| 1978 | __asm__ __volatile__( |
| 1979 | "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : ); |
| 1980 | } while (0) |
| 1981 | ]])], [ |
| 1982 | ac_have_as_vpclmulqdq=yes |
| 1983 | AC_MSG_RESULT([yes]) |
| 1984 | ], [ |
| 1985 | ac_have_as_vpclmulqdq=no |
| 1986 | AC_MSG_RESULT([no]) |
| 1987 | ]) |
| 1988 | |
| 1989 | AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes) |
| 1990 | |
| 1991 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 1992 | # does the x86/amd64 assembler understand the LZCNT instruction? |
| 1993 | # Note, this doesn't generate a C-level symbol. It generates a |
| 1994 | # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 1995 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt']) |
| 1996 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 1997 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 1998 | do { |
sewardj | c62291c | 2012-07-22 11:10:08 +0000 | [diff] [blame] | 1999 | __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax"); |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 2000 | } while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2001 | ]])], [ |
bart | 55e438b | 2010-09-14 10:53:57 +0000 | [diff] [blame] | 2002 | ac_have_as_lzcnt=yes |
| 2003 | AC_MSG_RESULT([yes]) |
| 2004 | ], [ |
| 2005 | ac_have_as_lzcnt=no |
| 2006 | AC_MSG_RESULT([no]) |
| 2007 | ]) |
| 2008 | |
| 2009 | AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes]) |
| 2010 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2011 | |
florian | 3df0211 | 2013-10-04 11:35:50 +0000 | [diff] [blame] | 2012 | # does the x86/amd64 assembler understand the LOOPNEL instruction? |
| 2013 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2014 | # automake-level symbol (BUILD_LOOPNEL_TESTS), used in test Makefile.am's |
| 2015 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'loopnel']) |
| 2016 | |
| 2017 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2018 | do { |
| 2019 | __asm__ __volatile__("1: loopnel 1b\n"); |
| 2020 | } while (0) |
| 2021 | ]])], [ |
| 2022 | ac_have_as_loopnel=yes |
| 2023 | AC_MSG_RESULT([yes]) |
| 2024 | ], [ |
| 2025 | ac_have_as_loopnel=no |
| 2026 | AC_MSG_RESULT([no]) |
| 2027 | ]) |
| 2028 | |
| 2029 | AM_CONDITIONAL([BUILD_LOOPNEL_TESTS], [test x$ac_have_as_loopnel = xyes]) |
| 2030 | |
| 2031 | |
| 2032 | # does the x86/amd64 assembler understand ADDR32 ? |
| 2033 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2034 | # automake-level symbol (BUILD_ADDR32_TESTS), used in test Makefile.am's |
| 2035 | AC_MSG_CHECKING([if x86/amd64 assembler supports 'addr32']) |
| 2036 | |
| 2037 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2038 | do { |
| 2039 | asm volatile ("addr32 rep movsb"); |
| 2040 | } while (0) |
| 2041 | ]])], [ |
| 2042 | ac_have_as_addr32=yes |
| 2043 | AC_MSG_RESULT([yes]) |
| 2044 | ], [ |
| 2045 | ac_have_as_addr32=no |
| 2046 | AC_MSG_RESULT([no]) |
| 2047 | ]) |
| 2048 | |
| 2049 | AM_CONDITIONAL([BUILD_ADDR32_TESTS], [test x$ac_have_as_addr32 = xyes]) |
| 2050 | |
| 2051 | |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2052 | # does the x86/amd64 assembler understand SSE 4.2 instructions? |
| 2053 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2054 | # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's |
| 2055 | AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2]) |
| 2056 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2057 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2058 | do { long long int x; |
| 2059 | __asm__ __volatile__( |
florian | fdfca22 | 2012-01-17 13:16:50 +0000 | [diff] [blame] | 2060 | "crc32q %%r15,%%r15" : : : "r15" ); |
| 2061 | __asm__ __volatile__( |
sewardj | c62291c | 2012-07-22 11:10:08 +0000 | [diff] [blame] | 2062 | "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11"); |
| 2063 | __asm__ __volatile__( |
| 2064 | "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); } |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2065 | while (0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2066 | ]])], [ |
sewardj | 27d176a | 2011-01-17 11:15:48 +0000 | [diff] [blame] | 2067 | ac_have_as_sse42=yes |
| 2068 | AC_MSG_RESULT([yes]) |
| 2069 | ], [ |
| 2070 | ac_have_as_sse42=no |
| 2071 | AC_MSG_RESULT([no]) |
| 2072 | ]) |
| 2073 | |
| 2074 | AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes) |
| 2075 | |
| 2076 | |
sewardj | 9fb31ca | 2012-06-05 00:31:49 +0000 | [diff] [blame] | 2077 | # does the x86/amd64 assembler understand AVX instructions? |
| 2078 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2079 | # automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's |
| 2080 | AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX]) |
| 2081 | |
| 2082 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2083 | do { long long int x; |
| 2084 | __asm__ __volatile__( |
| 2085 | "vmovupd (%%rsp), %%ymm7" : : : "xmm7" ); |
| 2086 | __asm__ __volatile__( |
| 2087 | "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); } |
| 2088 | while (0) |
| 2089 | ]])], [ |
| 2090 | ac_have_as_avx=yes |
| 2091 | AC_MSG_RESULT([yes]) |
| 2092 | ], [ |
| 2093 | ac_have_as_avx=no |
| 2094 | AC_MSG_RESULT([no]) |
| 2095 | ]) |
| 2096 | |
| 2097 | AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes) |
| 2098 | |
| 2099 | |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2100 | # does the x86/amd64 assembler understand AVX2 instructions? |
| 2101 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2102 | # automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's |
| 2103 | AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2]) |
| 2104 | |
| 2105 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2106 | do { long long int x; |
| 2107 | __asm__ __volatile__( |
| 2108 | "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" ); |
| 2109 | __asm__ __volatile__( |
| 2110 | "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); } |
| 2111 | while (0) |
| 2112 | ]])], [ |
| 2113 | ac_have_as_avx2=yes |
| 2114 | AC_MSG_RESULT([yes]) |
| 2115 | ], [ |
| 2116 | ac_have_as_avx2=no |
| 2117 | AC_MSG_RESULT([no]) |
| 2118 | ]) |
| 2119 | |
| 2120 | AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes) |
| 2121 | |
| 2122 | |
florian | 364c365 | 2013-09-30 16:32:53 +0000 | [diff] [blame] | 2123 | # does the x86/amd64 assembler understand TSX instructions? |
| 2124 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2125 | # automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's |
| 2126 | AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX]) |
| 2127 | |
| 2128 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2129 | do { |
| 2130 | __asm__ __volatile__( |
| 2131 | " xbegin Lfoo \n\t" |
| 2132 | "Lfoo: xend \n\t"); |
| 2133 | } while (0) |
| 2134 | ]])], [ |
| 2135 | ac_have_as_tsx=yes |
| 2136 | AC_MSG_RESULT([yes]) |
| 2137 | ], [ |
| 2138 | ac_have_as_tsx=no |
| 2139 | AC_MSG_RESULT([no]) |
| 2140 | ]) |
| 2141 | |
| 2142 | AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes) |
| 2143 | |
| 2144 | |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2145 | # does the x86/amd64 assembler understand BMI1 and BMI2 instructions? |
| 2146 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2147 | # automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's |
| 2148 | AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2]) |
| 2149 | |
| 2150 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2151 | do { unsigned int h, l; |
| 2152 | __asm__ __volatile__( |
sewardj | e222efc | 2013-03-27 21:59:21 +0000 | [diff] [blame] | 2153 | "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) ); |
sewardj | fda50af | 2013-03-27 11:43:20 +0000 | [diff] [blame] | 2154 | __asm__ __volatile__( |
sewardj | e222efc | 2013-03-27 21:59:21 +0000 | [diff] [blame] | 2155 | "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] | 2156 | while (0) |
| 2157 | ]])], [ |
| 2158 | ac_have_as_bmi=yes |
| 2159 | AC_MSG_RESULT([yes]) |
| 2160 | ], [ |
| 2161 | ac_have_as_bmi=no |
| 2162 | AC_MSG_RESULT([no]) |
| 2163 | ]) |
| 2164 | |
| 2165 | AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes) |
| 2166 | |
| 2167 | |
| 2168 | # does the x86/amd64 assembler understand FMA instructions? |
| 2169 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2170 | # automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's |
| 2171 | AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA]) |
| 2172 | |
| 2173 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2174 | do { unsigned int h, l; |
| 2175 | __asm__ __volatile__( |
| 2176 | "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" ); |
| 2177 | __asm__ __volatile__( |
| 2178 | "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); |
| 2179 | __asm__ __volatile__( |
| 2180 | "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); } |
| 2181 | while (0) |
| 2182 | ]])], [ |
| 2183 | ac_have_as_fma=yes |
| 2184 | AC_MSG_RESULT([yes]) |
| 2185 | ], [ |
| 2186 | ac_have_as_fma=no |
| 2187 | AC_MSG_RESULT([no]) |
| 2188 | ]) |
| 2189 | |
| 2190 | AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes) |
| 2191 | |
| 2192 | |
sewardj | b08d84d | 2012-07-16 08:23:26 +0000 | [diff] [blame] | 2193 | # does the x86/amd64 assembler understand MOVBE? |
| 2194 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2195 | # automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's |
| 2196 | AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn]) |
| 2197 | |
| 2198 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2199 | do { long long int x; |
| 2200 | __asm__ __volatile__( |
sewardj | c62291c | 2012-07-22 11:10:08 +0000 | [diff] [blame] | 2201 | "movbe (%%rsp), %%r15" : : : "memory", "r15" ); } |
sewardj | b08d84d | 2012-07-16 08:23:26 +0000 | [diff] [blame] | 2202 | while (0) |
| 2203 | ]])], [ |
| 2204 | ac_have_as_movbe=yes |
| 2205 | AC_MSG_RESULT([yes]) |
| 2206 | ], [ |
| 2207 | ac_have_as_movbe=no |
| 2208 | AC_MSG_RESULT([no]) |
| 2209 | ]) |
| 2210 | |
| 2211 | AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes) |
| 2212 | |
| 2213 | |
florian | 251c2f9 | 2012-07-05 21:21:37 +0000 | [diff] [blame] | 2214 | # Does the C compiler support the "ifunc" attribute |
| 2215 | # Note, this doesn't generate a C-level symbol. It generates a |
| 2216 | # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's |
| 2217 | AC_MSG_CHECKING([if gcc supports the ifunc attribute]) |
| 2218 | |
florian | f78a503 | 2012-07-06 09:17:29 +0000 | [diff] [blame] | 2219 | AC_LINK_IFELSE([AC_LANG_SOURCE([[ |
| 2220 | static void mytest(void) {} |
| 2221 | |
| 2222 | static void (*resolve_test(void))(void) |
| 2223 | { |
| 2224 | return (void (*)(void))&mytest; |
| 2225 | } |
| 2226 | |
| 2227 | void test(void) __attribute__((ifunc("resolve_test"))); |
| 2228 | |
| 2229 | int main() |
| 2230 | { |
| 2231 | test(); |
| 2232 | return 0; |
| 2233 | } |
florian | 251c2f9 | 2012-07-05 21:21:37 +0000 | [diff] [blame] | 2234 | ]])], [ |
| 2235 | ac_have_ifunc_attr=yes |
| 2236 | AC_MSG_RESULT([yes]) |
| 2237 | ], [ |
| 2238 | ac_have_ifunc_attr=no |
| 2239 | AC_MSG_RESULT([no]) |
| 2240 | ]) |
| 2241 | |
| 2242 | AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes) |
| 2243 | |
| 2244 | |
sewardj | e089f01 | 2010-10-13 21:47:29 +0000 | [diff] [blame] | 2245 | # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this |
| 2246 | # when building the tool executables. I think we should get rid of it. |
| 2247 | # |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 2248 | # Check for TLS support in the compiler and linker |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 2249 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 2250 | [[return foo;]])], |
| 2251 | [vg_cv_linktime_tls=yes], |
| 2252 | [vg_cv_linktime_tls=no]) |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 2253 | # Native compilation: check whether running a program using TLS succeeds. |
| 2254 | # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs |
| 2255 | # succeeds but running programs using TLS fails. |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 2256 | # Cross-compiling: check whether linking a program using TLS succeeds. |
bart | ca9f2ad | 2008-06-02 07:14:20 +0000 | [diff] [blame] | 2257 | AC_CACHE_CHECK([for TLS support], vg_cv_tls, |
| 2258 | [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], |
| 2259 | [vg_cv_tls=$enableval], |
| 2260 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]], |
| 2261 | [[return foo;]])], |
| 2262 | [vg_cv_tls=yes], |
bart | 2bd9a68 | 2011-10-22 09:46:16 +0000 | [diff] [blame] | 2263 | [vg_cv_tls=no], |
| 2264 | [vg_cv_tls=$vg_cv_linktime_tls])])]) |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 2265 | |
| 2266 | if test "$vg_cv_tls" = yes; then |
| 2267 | AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) |
| 2268 | fi |
sewardj | 5b754b4 | 2002-06-03 22:53:35 +0000 | [diff] [blame] | 2269 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 2270 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2271 | #---------------------------------------------------------------------------- |
bart | 62f54e4 | 2008-07-28 11:35:10 +0000 | [diff] [blame] | 2272 | # Checks for C header files. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2273 | #---------------------------------------------------------------------------- |
| 2274 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2275 | AC_HEADER_STDC |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2276 | AC_CHECK_HEADERS([ \ |
bart | 1f2b143 | 2009-01-16 12:06:54 +0000 | [diff] [blame] | 2277 | asm/unistd.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2278 | endian.h \ |
| 2279 | mqueue.h \ |
| 2280 | sys/endian.h \ |
| 2281 | sys/epoll.h \ |
| 2282 | sys/eventfd.h \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 2283 | sys/klog.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2284 | sys/poll.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 2285 | sys/signal.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2286 | sys/signalfd.h \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 2287 | sys/syscall.h \ |
| 2288 | sys/time.h \ |
| 2289 | sys/types.h \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2290 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2291 | |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 2292 | # Verify whether the <linux/futex.h> header is usable. |
| 2293 | AC_MSG_CHECKING([if <linux/futex.h> is usable]) |
| 2294 | |
sewardj | c12486b | 2012-12-17 14:46:48 +0000 | [diff] [blame] | 2295 | save_CFLAGS="$CFLAGS" |
| 2296 | CFLAGS="$CFLAGS -D__user=" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2297 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 2298 | #include <linux/futex.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2299 | ]], [[ |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 2300 | return FUTEX_WAIT; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2301 | ]])], [ |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2302 | ac_have_usable_linux_futex_h=yes |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 2303 | AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1, |
| 2304 | [Define to 1 if you have a usable <linux/futex.h> header file.]) |
| 2305 | AC_MSG_RESULT([yes]) |
| 2306 | ], [ |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2307 | ac_have_usable_linux_futex_h=no |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 2308 | AC_MSG_RESULT([no]) |
| 2309 | ]) |
sewardj | c12486b | 2012-12-17 14:46:48 +0000 | [diff] [blame] | 2310 | CFLAGS="$save_CFLAGS" |
| 2311 | |
bart | 818f17e | 2011-09-17 06:24:49 +0000 | [diff] [blame] | 2312 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2313 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2314 | # Checks for typedefs, structures, and compiler characteristics. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2315 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2316 | AC_TYPE_UID_T |
| 2317 | AC_TYPE_OFF_T |
| 2318 | AC_TYPE_SIZE_T |
| 2319 | AC_HEADER_TIME |
| 2320 | |
sewardj | 535c50f | 2005-06-04 23:14:53 +0000 | [diff] [blame] | 2321 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2322 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2323 | # Checks for library functions. |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2324 | #---------------------------------------------------------------------------- |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2325 | AC_FUNC_MEMCMP |
| 2326 | AC_FUNC_MMAP |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2327 | |
bart | 26288e4 | 2011-04-03 16:46:01 +0000 | [diff] [blame] | 2328 | AC_CHECK_LIB([pthread], [pthread_create]) |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 2329 | AC_CHECK_LIB([rt], [clock_gettime]) |
bart | 41ac62a | 2008-07-07 16:58:03 +0000 | [diff] [blame] | 2330 | |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2331 | AC_CHECK_FUNCS([ \ |
bart | 71bad29 | 2008-04-27 11:43:23 +0000 | [diff] [blame] | 2332 | clock_gettime\ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2333 | epoll_create \ |
| 2334 | epoll_pwait \ |
bart | ce48fa9 | 2008-04-26 10:59:46 +0000 | [diff] [blame] | 2335 | klogctl \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2336 | mallinfo \ |
| 2337 | memchr \ |
| 2338 | memset \ |
| 2339 | mkdir \ |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 2340 | mremap \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2341 | ppoll \ |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 2342 | pthread_barrier_init \ |
| 2343 | pthread_condattr_setclock \ |
| 2344 | pthread_mutex_timedlock \ |
| 2345 | pthread_rwlock_timedrdlock \ |
| 2346 | pthread_rwlock_timedwrlock \ |
| 2347 | pthread_spin_lock \ |
bart | a72a27b | 2010-04-29 06:22:17 +0000 | [diff] [blame] | 2348 | pthread_yield \ |
florian | c5325ef | 2013-09-17 20:15:36 +0000 | [diff] [blame] | 2349 | pthread_setname_np \ |
bart | d1f724c | 2009-08-26 18:11:18 +0000 | [diff] [blame] | 2350 | readlinkat \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2351 | semtimedop \ |
| 2352 | signalfd \ |
njn | 6cc2247 | 2009-03-16 03:46:48 +0000 | [diff] [blame] | 2353 | sigwaitinfo \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2354 | strchr \ |
| 2355 | strdup \ |
| 2356 | strpbrk \ |
| 2357 | strrchr \ |
| 2358 | strstr \ |
bart | a72a27b | 2010-04-29 06:22:17 +0000 | [diff] [blame] | 2359 | syscall \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2360 | utimensat \ |
tom | 9e4b636 | 2012-02-10 09:39:37 +0000 | [diff] [blame] | 2361 | process_vm_readv \ |
| 2362 | process_vm_writev \ |
bart | f5ceec8 | 2008-04-26 07:45:10 +0000 | [diff] [blame] | 2363 | ]) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2364 | |
bart | 623eec3 | 2008-07-29 17:54:49 +0000 | [diff] [blame] | 2365 | # AC_CHECK_LIB adds any library found to the variable LIBS, and links these |
| 2366 | # libraries with any shared object and/or executable. This is NOT what we |
| 2367 | # want for e.g. vgpreload_core-x86-linux.so |
| 2368 | LIBS="" |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2369 | |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 2370 | AM_CONDITIONAL([HAVE_PTHREAD_BARRIER], |
| 2371 | [test x$ac_cv_func_pthread_barrier_init = xyes]) |
bart | 2eaa8f2 | 2009-01-20 14:01:16 +0000 | [diff] [blame] | 2372 | AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK], |
| 2373 | [test x$ac_cv_func_pthread_mutex_timedlock = xyes]) |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 2374 | AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], |
| 2375 | [test x$ac_cv_func_pthread_spin_lock = xyes]) |
florian | c5325ef | 2013-09-17 20:15:36 +0000 | [diff] [blame] | 2376 | AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP], |
| 2377 | [test x$ac_cv_func_pthread_setname_np = xyes]) |
bart | 6d45e92 | 2009-01-20 13:45:38 +0000 | [diff] [blame] | 2378 | |
petarj | c37cea6 | 2013-06-02 18:08:04 +0000 | [diff] [blame] | 2379 | if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ |
| 2380 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then |
petarj | 6d79b74 | 2012-12-20 18:56:57 +0000 | [diff] [blame] | 2381 | AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1, |
petarj | c37cea6 | 2013-06-02 18:08:04 +0000 | [diff] [blame] | 2382 | [Disable intercept pthread_spin_lock() on MIPS32 and MIPS64.]) |
petarj | 6d79b74 | 2012-12-20 18:56:57 +0000 | [diff] [blame] | 2383 | fi |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2384 | |
| 2385 | #---------------------------------------------------------------------------- |
| 2386 | # MPI checks |
| 2387 | #---------------------------------------------------------------------------- |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2388 | # Do we have a useable MPI setup on the primary and/or secondary targets? |
| 2389 | # On Linux, by default, assumes mpicc and -m32/-m64 |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 2390 | # Note: this is a kludge in that it assumes the specified mpicc |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 2391 | # understands -m32/-m64 regardless of what is specified using |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2392 | # --with-mpicc=. |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 2393 | MPI_CC="mpicc" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2394 | |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 2395 | mflag_primary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2396 | if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ |
sewardj | 6e9de46 | 2011-06-28 07:25:29 +0000 | [diff] [blame] | 2397 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 2398 | -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \ |
petarj | 4df0bfc | 2013-02-27 23:17:33 +0000 | [diff] [blame] | 2399 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ |
| 2400 | -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 2401 | mflag_primary=$FLAG_M32 |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2402 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 2403 | -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ |
| 2404 | -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 2405 | mflag_primary=$FLAG_M64 |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2406 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then |
| 2407 | mflag_primary="$FLAG_M32 -arch i386" |
| 2408 | elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then |
| 2409 | mflag_primary="$FLAG_M64 -arch x86_64" |
sewardj | e9fa506 | 2006-03-12 18:29:18 +0000 | [diff] [blame] | 2410 | fi |
| 2411 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2412 | mflag_secondary= |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2413 | if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ |
| 2414 | -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2415 | mflag_secondary=$FLAG_M32 |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2416 | elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then |
| 2417 | mflag_secondary="$FLAG_M32 -arch i386" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2418 | fi |
| 2419 | |
| 2420 | |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 2421 | AC_ARG_WITH(mpicc, |
sewardj | b70a613 | 2006-05-27 21:14:09 +0000 | [diff] [blame] | 2422 | [ --with-mpicc= Specify name of MPI2-ised C compiler], |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 2423 | MPI_CC=$withval |
| 2424 | ) |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2425 | AC_SUBST(MPI_CC) |
| 2426 | |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2427 | ## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can |
| 2428 | ## use these values in the check for a functioning mpicc. |
| 2429 | ## |
| 2430 | ## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that |
| 2431 | ## mflag_primary/mflag_secondary are sufficient approximations of that behavior |
| 2432 | AM_COND_IF([VGCONF_OS_IS_LINUX], |
| 2433 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic" |
| 2434 | LDFLAGS_MPI="-fpic -shared"]) |
| 2435 | AM_COND_IF([VGCONF_OS_IS_DARWIN], |
| 2436 | [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic" |
| 2437 | LDFLAGS_MPI="-dynamic -dynamiclib -all_load"]) |
| 2438 | |
| 2439 | AC_SUBST([CFLAGS_MPI]) |
| 2440 | AC_SUBST([LDFLAGS_MPI]) |
| 2441 | |
| 2442 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2443 | ## See if MPI_CC works for the primary target |
| 2444 | ## |
| 2445 | 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] | 2446 | saved_CC=$CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 2447 | saved_CFLAGS=$CFLAGS |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 2448 | CC=$MPI_CC |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2449 | CFLAGS="$CFLAGS_MPI $mflag_primary" |
| 2450 | saved_LDFLAGS="$LDFLAGS" |
| 2451 | LDFLAGS="$LDFLAGS_MPI $mflag_primary" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2452 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 2453 | #include <mpi.h> |
| 2454 | #include <stdio.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2455 | ]], [[ |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2456 | int ni, na, nd, comb; |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 2457 | int r = MPI_Init(NULL,NULL); |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2458 | r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb ); |
| 2459 | r |= MPI_Finalize(); |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 2460 | return r; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2461 | ]])], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2462 | ac_have_mpi2_pri=yes |
sewardj | 1a85e60 | 2006-03-08 15:26:10 +0000 | [diff] [blame] | 2463 | AC_MSG_RESULT([yes, $MPI_CC]) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2464 | ], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2465 | ac_have_mpi2_pri=no |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2466 | AC_MSG_RESULT([no]) |
| 2467 | ]) |
sewardj | 0ad4609 | 2006-03-02 17:09:16 +0000 | [diff] [blame] | 2468 | CC=$saved_CC |
sewardj | de4f384 | 2006-03-09 02:41:41 +0000 | [diff] [blame] | 2469 | CFLAGS=$saved_CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2470 | LDFLAGS="$saved_LDFLAGS" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2471 | AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2472 | |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2473 | ## See if MPI_CC works for the secondary target. Complication: what if |
| 2474 | ## there is no secondary target? We need this to then fail. |
| 2475 | ## Kludge this by making MPI_CC something which will surely fail in |
| 2476 | ## such a case. |
| 2477 | ## |
| 2478 | AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) |
| 2479 | saved_CC=$CC |
| 2480 | saved_CFLAGS=$CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2481 | saved_LDFLAGS="$LDFLAGS" |
| 2482 | LDFLAGS="$LDFLAGS_MPI $mflag_secondary" |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2483 | if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2484 | CC="$MPI_CC this will surely fail" |
| 2485 | else |
| 2486 | CC=$MPI_CC |
| 2487 | fi |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2488 | CFLAGS="$CFLAGS_MPI $mflag_secondary" |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2489 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2490 | #include <mpi.h> |
| 2491 | #include <stdio.h> |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2492 | ]], [[ |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2493 | int ni, na, nd, comb; |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2494 | int r = MPI_Init(NULL,NULL); |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2495 | r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb ); |
| 2496 | r |= MPI_Finalize(); |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2497 | return r; |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2498 | ]])], [ |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2499 | ac_have_mpi2_sec=yes |
| 2500 | AC_MSG_RESULT([yes, $MPI_CC]) |
| 2501 | ], [ |
| 2502 | ac_have_mpi2_sec=no |
| 2503 | AC_MSG_RESULT([no]) |
| 2504 | ]) |
| 2505 | CC=$saved_CC |
| 2506 | CFLAGS=$saved_CFLAGS |
philippe | f7c5433 | 2012-05-17 15:32:54 +0000 | [diff] [blame] | 2507 | LDFLAGS="$saved_LDFLAGS" |
sewardj | 03d86f2 | 2006-10-17 00:57:24 +0000 | [diff] [blame] | 2508 | AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2509 | |
| 2510 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2511 | #---------------------------------------------------------------------------- |
| 2512 | # Other library checks |
| 2513 | #---------------------------------------------------------------------------- |
bart | 2ef12d4 | 2010-10-18 16:32:11 +0000 | [diff] [blame] | 2514 | # There now follow some tests for Boost, and OpenMP. These |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2515 | # tests are present because Drd has some regression tests that use |
| 2516 | # these packages. All regression test programs all compiled only |
| 2517 | # for the primary target. And so it is important that the configure |
| 2518 | # checks that follow, use the correct -m32 or -m64 flag for the |
| 2519 | # primary target (called $mflag_primary). Otherwise, we can end up |
| 2520 | # in a situation (eg) where, on amd64-linux, the test for Boost checks |
| 2521 | # for usable 64-bit Boost facilities, but because we are doing a 32-bit |
| 2522 | # only build (meaning, the primary target is x86-linux), the build |
| 2523 | # of the regtest programs that use Boost fails, because they are |
| 2524 | # build as 32-bit (IN THIS EXAMPLE). |
| 2525 | # |
| 2526 | # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES |
| 2527 | # NEEDED BY THE REGRESSION TEST PROGRAMS. |
| 2528 | |
| 2529 | |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2530 | # Check whether the boost library 1.35 or later has been installed. |
| 2531 | # The Boost.Threads library has undergone a major rewrite in version 1.35.0. |
| 2532 | |
| 2533 | AC_MSG_CHECKING([for boost]) |
| 2534 | |
| 2535 | AC_LANG(C++) |
| 2536 | safe_CXXFLAGS=$CXXFLAGS |
bart | 7129c72 | 2012-04-18 18:34:22 +0000 | [diff] [blame] | 2537 | CXXFLAGS="$mflag_primary" |
| 2538 | safe_LIBS="$LIBS" |
| 2539 | LIBS="-lboost_thread-mt $LIBS" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2540 | |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 2541 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2542 | #include <boost/thread.hpp> |
| 2543 | static void thread_func(void) |
| 2544 | { } |
| 2545 | int main(int argc, char** argv) |
| 2546 | { |
| 2547 | boost::thread t(thread_func); |
| 2548 | return 0; |
| 2549 | } |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 2550 | ])], |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2551 | [ |
| 2552 | ac_have_boost_1_35=yes |
| 2553 | AC_SUBST([BOOST_CFLAGS], []) |
bart | bb31f2d | 2012-04-18 18:42:34 +0000 | [diff] [blame] | 2554 | AC_SUBST([BOOST_LIBS], [-lboost_thread-mt]) |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2555 | AC_MSG_RESULT([yes]) |
| 2556 | ], [ |
| 2557 | ac_have_boost_1_35=no |
| 2558 | AC_MSG_RESULT([no]) |
| 2559 | ]) |
| 2560 | |
bart | 7129c72 | 2012-04-18 18:34:22 +0000 | [diff] [blame] | 2561 | LIBS="$safe_LIBS" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2562 | CXXFLAGS=$safe_CXXFLAGS |
| 2563 | AC_LANG(C) |
| 2564 | |
| 2565 | AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes]) |
| 2566 | |
| 2567 | |
| 2568 | # does this compiler support -fopenmp, does it have the include file |
| 2569 | # <omp.h> and does it have libgomp ? |
| 2570 | |
| 2571 | AC_MSG_CHECKING([for OpenMP]) |
| 2572 | |
| 2573 | safe_CFLAGS=$CFLAGS |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 2574 | CFLAGS="-fopenmp $mflag_primary" |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2575 | |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 2576 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2577 | #include <omp.h> |
| 2578 | int main(int argc, char** argv) |
| 2579 | { |
| 2580 | omp_set_dynamic(0); |
| 2581 | return 0; |
| 2582 | } |
bart | 128fc52 | 2011-03-12 10:36:35 +0000 | [diff] [blame] | 2583 | ])], |
sewardj | 493c4ef | 2008-12-13 16:45:19 +0000 | [diff] [blame] | 2584 | [ |
| 2585 | ac_have_openmp=yes |
| 2586 | AC_MSG_RESULT([yes]) |
| 2587 | ], [ |
| 2588 | ac_have_openmp=no |
| 2589 | AC_MSG_RESULT([no]) |
| 2590 | ]) |
| 2591 | CFLAGS=$safe_CFLAGS |
| 2592 | |
| 2593 | AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) |
| 2594 | |
| 2595 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2596 | # does this compiler have built-in functions for atomic memory access for the |
| 2597 | # primary target ? |
| 2598 | 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] | 2599 | |
| 2600 | safe_CFLAGS=$CFLAGS |
| 2601 | CFLAGS="$mflag_primary" |
| 2602 | |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2603 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 2604 | int variable = 1; |
| 2605 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 2606 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2607 | ]])], [ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 2608 | ac_have_builtin_atomic_primary=yes |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 2609 | AC_MSG_RESULT([yes]) |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2610 | 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] | 2611 | ], [ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 2612 | ac_have_builtin_atomic_primary=no |
sewardj | c876a2f | 2009-01-22 22:44:30 +0000 | [diff] [blame] | 2613 | AC_MSG_RESULT([no]) |
| 2614 | ]) |
| 2615 | |
| 2616 | CFLAGS=$safe_CFLAGS |
| 2617 | |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 2618 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], |
| 2619 | [test x$ac_have_builtin_atomic_primary = xyes]) |
bart | c82d137 | 2009-05-31 16:21:23 +0000 | [diff] [blame] | 2620 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2621 | |
| 2622 | # does this compiler have built-in functions for atomic memory access for the |
| 2623 | # secondary target ? |
| 2624 | |
| 2625 | if test x$VGCONF_PLATFORM_SEC_CAPS != x; then |
| 2626 | |
| 2627 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target]) |
| 2628 | |
| 2629 | safe_CFLAGS=$CFLAGS |
| 2630 | CFLAGS="$mflag_secondary" |
| 2631 | |
| 2632 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 2633 | int variable = 1; |
| 2634 | return (__sync_add_and_fetch(&variable, 1) ? 1 : 0) |
| 2635 | ]])], [ |
| 2636 | ac_have_builtin_atomic_secondary=yes |
| 2637 | AC_MSG_RESULT([yes]) |
| 2638 | ], [ |
| 2639 | ac_have_builtin_atomic_secondary=no |
| 2640 | AC_MSG_RESULT([no]) |
| 2641 | ]) |
| 2642 | |
| 2643 | CFLAGS=$safe_CFLAGS |
| 2644 | |
| 2645 | fi |
| 2646 | |
| 2647 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY], |
| 2648 | [test x$ac_have_builtin_atomic_secondary = xyes]) |
| 2649 | |
bart | 1e856ea | 2011-12-17 12:53:23 +0000 | [diff] [blame] | 2650 | # does this compiler have built-in functions for atomic memory access on |
| 2651 | # 64-bit integers for all targets ? |
| 2652 | |
| 2653 | AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets]) |
| 2654 | |
| 2655 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2656 | #include <stdint.h> |
| 2657 | ]], [[ |
| 2658 | uint64_t variable = 1; |
| 2659 | return __sync_add_and_fetch(&variable, 1) |
| 2660 | ]])], [ |
| 2661 | ac_have_builtin_atomic64_primary=yes |
| 2662 | ], [ |
| 2663 | ac_have_builtin_atomic64_primary=no |
| 2664 | ]) |
| 2665 | |
| 2666 | if test x$VGCONF_PLATFORM_SEC_CAPS != x; then |
| 2667 | |
| 2668 | safe_CFLAGS=$CFLAGS |
| 2669 | CFLAGS="$mflag_secondary" |
| 2670 | |
| 2671 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2672 | #include <stdint.h> |
| 2673 | ]], [[ |
| 2674 | uint64_t variable = 1; |
| 2675 | return __sync_add_and_fetch(&variable, 1) |
| 2676 | ]])], [ |
| 2677 | ac_have_builtin_atomic64_secondary=yes |
| 2678 | ], [ |
| 2679 | ac_have_builtin_atomic64_secondary=no |
| 2680 | ]) |
| 2681 | |
| 2682 | CFLAGS=$safe_CFLAGS |
| 2683 | |
| 2684 | fi |
| 2685 | |
| 2686 | if test x$ac_have_builtin_atomic64_primary = xyes && \ |
| 2687 | test x$VGCONF_PLATFORM_SEC_CAPS = x \ |
| 2688 | -o x$ac_have_builtin_atomic64_secondary = xyes; then |
| 2689 | AC_MSG_RESULT([yes]) |
| 2690 | ac_have_builtin_atomic64=yes |
| 2691 | else |
| 2692 | AC_MSG_RESULT([no]) |
| 2693 | ac_have_builtin_atomic64=no |
| 2694 | fi |
| 2695 | |
| 2696 | AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64], |
| 2697 | [test x$ac_have_builtin_atomic64 = xyes]) |
| 2698 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2699 | |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2700 | # does g++ have built-in functions for atomic memory access ? |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2701 | AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch]) |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2702 | |
| 2703 | safe_CXXFLAGS=$CXXFLAGS |
| 2704 | CXXFLAGS="$mflag_primary" |
| 2705 | |
| 2706 | AC_LANG_PUSH(C++) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2707 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2708 | int variable = 1; |
| 2709 | return (__sync_bool_compare_and_swap(&variable, 1, 2) |
| 2710 | && __sync_add_and_fetch(&variable, 1) ? 1 : 0) |
bart | 417cf3e | 2011-10-22 09:21:24 +0000 | [diff] [blame] | 2711 | ]])], [ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2712 | ac_have_builtin_atomic_cxx=yes |
| 2713 | AC_MSG_RESULT([yes]) |
| 2714 | 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] | 2715 | ], [ |
bart | e874042 | 2011-03-24 20:27:54 +0000 | [diff] [blame] | 2716 | ac_have_builtin_atomic_cxx=no |
| 2717 | AC_MSG_RESULT([no]) |
| 2718 | ]) |
| 2719 | AC_LANG_POP(C++) |
| 2720 | |
| 2721 | CXXFLAGS=$safe_CXXFLAGS |
| 2722 | |
| 2723 | 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] | 2724 | |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2725 | |
| 2726 | if test x$ac_have_usable_linux_futex_h = xyes \ |
bart | b4ff782 | 2011-12-10 19:48:04 +0000 | [diff] [blame] | 2727 | -a x$ac_have_builtin_atomic_primary = xyes; then |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 2728 | ac_enable_linux_ticket_lock_primary=yes |
| 2729 | fi |
| 2730 | AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY], |
| 2731 | [test x$ac_enable_linux_ticket_lock_primary = xyes]) |
| 2732 | |
| 2733 | if test x$VGCONF_PLATFORM_SEC_CAPS != x \ |
| 2734 | -a x$ac_have_usable_linux_futex_h = xyes \ |
| 2735 | -a x$ac_have_builtin_atomic_secondary = xyes; then |
| 2736 | ac_enable_linux_ticket_lock_secondary=yes |
| 2737 | fi |
| 2738 | AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY], |
| 2739 | [test x$ac_enable_linux_ticket_lock_secondary = xyes]) |
| 2740 | |
| 2741 | |
bart | f68af88 | 2011-12-10 19:42:05 +0000 | [diff] [blame] | 2742 | # does libstdc++ support annotating shared pointers ? |
| 2743 | AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers]) |
| 2744 | |
florian | d79b3bf | 2013-10-02 15:14:59 +0000 | [diff] [blame] | 2745 | safe_CXXFLAGS=$CXXFLAGS |
bart | f68af88 | 2011-12-10 19:42:05 +0000 | [diff] [blame] | 2746 | CXXFLAGS="-std=c++0x" |
| 2747 | |
| 2748 | AC_LANG_PUSH(C++) |
| 2749 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2750 | #include <memory> |
| 2751 | ]], [[ |
| 2752 | std::shared_ptr<int> p |
| 2753 | ]])], [ |
| 2754 | ac_have_shared_ptr=yes |
| 2755 | ], [ |
| 2756 | ac_have_shared_ptr=no |
| 2757 | ]) |
| 2758 | if test x$ac_have_shared_ptr = xyes; then |
| 2759 | # If compilation of the program below fails because of a syntax error |
| 2760 | # triggered by substituting one of the annotation macros then that |
| 2761 | # means that libstdc++ supports these macros. |
| 2762 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2763 | #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)---- |
| 2764 | #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)---- |
| 2765 | #include <memory> |
| 2766 | ]], [[ |
| 2767 | std::shared_ptr<int> p |
| 2768 | ]])], [ |
| 2769 | ac_have_shared_pointer_annotation=no |
| 2770 | AC_MSG_RESULT([no]) |
| 2771 | ], [ |
| 2772 | ac_have_shared_pointer_annotation=yes |
| 2773 | AC_MSG_RESULT([yes]) |
| 2774 | AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1, |
| 2775 | [Define to 1 if libstd++ supports annotating shared pointers]) |
| 2776 | ]) |
| 2777 | else |
| 2778 | ac_have_shared_pointer_annotation=no |
| 2779 | AC_MSG_RESULT([no]) |
| 2780 | fi |
| 2781 | AC_LANG_POP(C++) |
| 2782 | |
| 2783 | CXXFLAGS=$safe_CXXFLAGS |
| 2784 | |
| 2785 | AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION], |
| 2786 | [test x$ac_have_shared_pointer_annotation = xyes]) |
| 2787 | |
| 2788 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2789 | #---------------------------------------------------------------------------- |
| 2790 | # Ok. We're done checking. |
| 2791 | #---------------------------------------------------------------------------- |
sewardj | 8063775 | 2006-03-02 13:48:21 +0000 | [diff] [blame] | 2792 | |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2793 | # Nb: VEX/Makefile is generated from Makefile.vex.in. |
| 2794 | AC_CONFIG_FILES([ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 2795 | Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2796 | VEX/Makefile:Makefile.vex.in |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2797 | valgrind.spec |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 2798 | valgrind.pc |
dirk | 07596a2 | 2008-04-25 11:33:30 +0000 | [diff] [blame] | 2799 | glibc-2.X.supp |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 2800 | docs/Makefile |
| 2801 | tests/Makefile |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 2802 | tests/vg_regtest |
njn | ec0c27a | 2005-12-10 23:11:28 +0000 | [diff] [blame] | 2803 | perf/Makefile |
| 2804 | perf/vg_perf |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 2805 | gdbserver_tests/Makefile |
njn25 | 4d54243 | 2002-09-23 16:09:39 +0000 | [diff] [blame] | 2806 | include/Makefile |
njn | 7a6e746 | 2002-11-09 17:53:30 +0000 | [diff] [blame] | 2807 | auxprogs/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2808 | mpi/Makefile |
njn25 | ab72603 | 2002-09-23 16:24:41 +0000 | [diff] [blame] | 2809 | coregrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2810 | memcheck/Makefile |
| 2811 | memcheck/tests/Makefile |
florian | e42cca5 | 2013-08-29 17:59:27 +0000 | [diff] [blame] | 2812 | memcheck/tests/common/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2813 | memcheck/tests/amd64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2814 | memcheck/tests/x86/Makefile |
njn | 3b3b76d | 2009-01-19 03:44:19 +0000 | [diff] [blame] | 2815 | memcheck/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 2816 | memcheck/tests/darwin/Makefile |
njn | ea2d6fd | 2010-07-01 00:20:20 +0000 | [diff] [blame] | 2817 | memcheck/tests/amd64-linux/Makefile |
njn | a454ec0 | 2009-01-19 03:16:59 +0000 | [diff] [blame] | 2818 | memcheck/tests/x86-linux/Makefile |
sewardj | 0e342a0 | 2010-09-03 23:49:33 +0000 | [diff] [blame] | 2819 | memcheck/tests/ppc32/Makefile |
| 2820 | memcheck/tests/ppc64/Makefile |
florian | 0bb707e | 2012-05-30 20:46:58 +0000 | [diff] [blame] | 2821 | memcheck/tests/s390x/Makefile |
florian | bb913cd | 2012-08-28 16:50:39 +0000 | [diff] [blame] | 2822 | memcheck/tests/vbit-test/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2823 | cachegrind/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2824 | cachegrind/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2825 | cachegrind/tests/x86/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 2826 | cachegrind/cg_annotate |
njn | 69d495d | 2010-06-30 05:23:34 +0000 | [diff] [blame] | 2827 | cachegrind/cg_diff |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 2828 | callgrind/Makefile |
| 2829 | callgrind/callgrind_annotate |
| 2830 | callgrind/callgrind_control |
| 2831 | callgrind/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2832 | helgrind/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 2833 | helgrind/tests/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 2834 | massif/Makefile |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 2835 | massif/tests/Makefile |
njn | d5a8d24 | 2007-11-02 20:44:57 +0000 | [diff] [blame] | 2836 | massif/ms_print |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2837 | lackey/Makefile |
njn | f2df9b5 | 2002-10-04 11:35:47 +0000 | [diff] [blame] | 2838 | lackey/tests/Makefile |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 2839 | none/Makefile |
| 2840 | none/tests/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2841 | none/tests/amd64/Makefile |
cerion | 85665ca | 2005-06-20 15:51:07 +0000 | [diff] [blame] | 2842 | none/tests/ppc32/Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 2843 | none/tests/ppc64/Makefile |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 2844 | none/tests/x86/Makefile |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 2845 | none/tests/arm/Makefile |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame] | 2846 | none/tests/s390x/Makefile |
sewardj | 5db1540 | 2012-06-07 09:13:21 +0000 | [diff] [blame] | 2847 | none/tests/mips32/Makefile |
petarj | 8bea867 | 2013-05-10 13:14:54 +0000 | [diff] [blame] | 2848 | none/tests/mips64/Makefile |
njn | 0458a12 | 2009-02-13 06:23:46 +0000 | [diff] [blame] | 2849 | none/tests/linux/Makefile |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 2850 | none/tests/darwin/Makefile |
njn | 06ca332 | 2009-04-15 23:10:04 +0000 | [diff] [blame] | 2851 | none/tests/x86-linux/Makefile |
sewardj | d2f95a0 | 2011-05-11 16:04:28 +0000 | [diff] [blame] | 2852 | exp-sgcheck/Makefile |
| 2853 | exp-sgcheck/tests/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 2854 | drd/Makefile |
bart | ccf17de | 2008-07-04 15:14:35 +0000 | [diff] [blame] | 2855 | drd/scripts/download-and-build-splash2 |
| 2856 | drd/tests/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 2857 | exp-bbv/Makefile |
njn | dbebecc | 2009-07-14 01:39:54 +0000 | [diff] [blame] | 2858 | exp-bbv/tests/Makefile |
| 2859 | exp-bbv/tests/x86/Makefile |
| 2860 | exp-bbv/tests/x86-linux/Makefile |
| 2861 | exp-bbv/tests/amd64-linux/Makefile |
| 2862 | exp-bbv/tests/ppc32-linux/Makefile |
vince | 226e078 | 2010-01-06 15:22:11 +0000 | [diff] [blame] | 2863 | exp-bbv/tests/arm-linux/Makefile |
sewardj | 4d7d8f5 | 2010-10-12 10:09:15 +0000 | [diff] [blame] | 2864 | exp-dhat/Makefile |
| 2865 | exp-dhat/tests/Makefile |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2866 | ]) |
sewardj | d364580 | 2010-06-13 22:13:58 +0000 | [diff] [blame] | 2867 | AC_CONFIG_FILES([coregrind/link_tool_exe_linux], |
| 2868 | [chmod +x coregrind/link_tool_exe_linux]) |
| 2869 | AC_CONFIG_FILES([coregrind/link_tool_exe_darwin], |
| 2870 | [chmod +x coregrind/link_tool_exe_darwin]) |
njn | 8b68b64 | 2009-06-24 00:37:09 +0000 | [diff] [blame] | 2871 | AC_OUTPUT |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 2872 | |
| 2873 | cat<<EOF |
| 2874 | |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 2875 | Maximum build arch: ${ARCH_MAX} |
| 2876 | Primary build arch: ${VGCONF_ARCH_PRI} |
njn | 3f8a6e9 | 2009-06-02 00:20:47 +0000 | [diff] [blame] | 2877 | Secondary build arch: ${VGCONF_ARCH_SEC} |
njn | 311303f | 2009-02-06 03:46:50 +0000 | [diff] [blame] | 2878 | Build OS: ${VGCONF_OS} |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 2879 | Primary build target: ${VGCONF_PLATFORM_PRI_CAPS} |
| 2880 | Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS} |
sewardj | cb495c8 | 2011-07-11 20:42:34 +0000 | [diff] [blame] | 2881 | Platform variant: ${VGCONF_PLATVARIANT} |
| 2882 | Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1 |
sewardj | e95d94f | 2008-09-19 09:02:19 +0000 | [diff] [blame] | 2883 | Default supp files: ${DEFAULT_SUPP} |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 2884 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 2885 | EOF |