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