blob: 0223ee2075adadbe05c9d238e1c4ab525bb95360 [file] [log] [blame]
sewardj01262142006-01-04 01:20:28 +00001
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
sewardjde4a1d02002-03-22 01:27:54 +000010# Process this file with autoconf to produce a configure script.
sewardj704deb62012-08-09 15:51:55 +000011AC_INIT([Valgrind],[3.9.0.SVN],[valgrind-users@lists.sourceforge.net])
njn04e16982005-05-31 00:23:43 +000012AC_CONFIG_SRCDIR(coregrind/m_main.c)
bart417cf3e2011-10-22 09:21:24 +000013AC_CONFIG_HEADERS([config.h])
sewardjf9a698e2013-09-02 12:44:52 +000014AM_INIT_AUTOMAKE([foreign subdir-objects])
sewardjde4a1d02002-03-22 01:27:54 +000015
gobryb0ed4672002-03-27 20:58:58 +000016AM_MAINTAINER_MODE
17
njn7fd6d382009-01-22 21:56:32 +000018#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +000019# Checks for various programs.
20#----------------------------------------------------------------------------
bartaca399a2010-08-15 18:54:15 +000021CFLAGS="-Wno-long-long $CFLAGS"
floriand79b3bf2013-10-02 15:14:59 +000022CXXFLAGS="-Wno-long-long $CXXFLAGS"
gobrye721a522002-03-22 13:38:30 +000023
sewardjde4a1d02002-03-22 01:27:54 +000024AC_PROG_LN_S
25AC_PROG_CC
bart0affa492008-03-18 17:53:09 +000026AM_PROG_CC_C_O
sewardjde4a1d02002-03-22 01:27:54 +000027AC_PROG_CPP
njn25e49d8e72002-09-23 09:36:25 +000028AC_PROG_CXX
njn629a5ec2009-07-14 01:29:39 +000029# AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
30# autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
31# base (eg. most likely as Darwin-specific tests) we'll need one of the
32# following:
njn0cd26892009-07-12 23:07:13 +000033# - put AC_PROG_OBJC in a Darwin-specific part of this file
34# - Use AC_PROG_OBJC here and up the minimum autoconf version
35# - Use the following, which is apparently equivalent:
36# m4_ifdef([AC_PROG_OBJC],
37# [AC_PROG_OBJC],
38# [AC_CHECK_TOOL([OBJC], [gcc])
39# AC_SUBST([OBJC])
40# AC_SUBST([OBJCFLAGS])
41# ])
sewardjde4a1d02002-03-22 01:27:54 +000042AC_PROG_RANLIB
bart07de2c92010-05-29 06:44:28 +000043# provide a very basic definition for AC_PROG_SED if it's not provided by
44# autoconf (as e.g. in autoconf 2.59).
45m4_ifndef([AC_PROG_SED],
46 [AC_DEFUN([AC_PROG_SED],
47 [AC_ARG_VAR([SED])
48 AC_CHECK_PROGS([SED],[gsed sed])])])
bart12e91122010-05-15 08:37:24 +000049AC_PROG_SED
sewardjde4a1d02002-03-22 01:27:54 +000050
bartcddeaf52008-05-25 15:58:11 +000051# If no AR variable was specified, look up the name of the archiver. Otherwise
52# do not touch the AR variable.
53if test "x$AR" = "x"; then
bart07de2c92010-05-29 06:44:28 +000054 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
bartcddeaf52008-05-25 15:58:11 +000055fi
56AC_ARG_VAR([AR],[Archiver command])
57
gobrye721a522002-03-22 13:38:30 +000058# Check for the compiler support
59if test "${GCC}" != "yes" ; then
60 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
61fi
62
sewardj2f685952002-12-22 19:32:23 +000063# figure out where perl lives
64AC_PATH_PROG(PERL, perl)
65
njn9315df32003-04-16 20:50:50 +000066# figure out where gdb lives
sewardjf8722ca2008-11-17 00:20:45 +000067AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
njnfe408942004-11-23 17:52:24 +000068AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
njn9315df32003-04-16 20:50:50 +000069
daywalker48ccca52002-04-15 00:31:58 +000070# some older automake's don't have it so try something on our own
71ifdef([AM_PROG_AS],[AM_PROG_AS],
72[
gobry1be19852002-03-26 20:44:55 +000073AS="${CC}"
74AC_SUBST(AS)
gobry3b777892002-04-04 09:18:39 +000075
gobry1be19852002-03-26 20:44:55 +000076ASFLAGS=""
77AC_SUBST(ASFLAGS)
daywalker48ccca52002-04-15 00:31:58 +000078])
gobry3b777892002-04-04 09:18:39 +000079
gobry3b777892002-04-04 09:18:39 +000080
njn0d2e58f2009-02-25 04:57:56 +000081# Check if 'diff' supports -u (universal diffs) and use it if possible.
82
83AC_MSG_CHECKING([for diff -u])
84AC_SUBST(DIFF)
85
sewardj6e9de462011-06-28 07:25:29 +000086# Comparing two identical files results in 0.
njn31f665e2009-02-26 21:25:50 +000087tmpfile="tmp-xxx-yyy-zzz"
88touch $tmpfile;
89if diff -u $tmpfile $tmpfile ; then
njn0d2e58f2009-02-25 04:57:56 +000090 AC_MSG_RESULT([yes])
91 DIFF="diff -u"
92else
93 AC_MSG_RESULT([no])
94 DIFF="diff"
95fi
njn31f665e2009-02-26 21:25:50 +000096rm $tmpfile
njn0d2e58f2009-02-25 04:57:56 +000097
98
sewardj535c50f2005-06-04 23:14:53 +000099# We don't want gcc < 3.0
gobrye721a522002-03-22 13:38:30 +0000100AC_MSG_CHECKING([for a supported version of gcc])
101
bart85037442011-11-22 14:41:31 +0000102# Obtain the compiler version.
sewardja8ca2c52011-09-29 18:18:37 +0000103#
bart85037442011-11-22 14:41:31 +0000104# A few examples of how the ${CC} --version output looks like:
105#
106# Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
107# Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
108# openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
109# Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
bartc5214062012-01-11 11:34:23 +0000110# MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
bart85037442011-11-22 14:41:31 +0000111# OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
112# OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
113# Clang: clang version 2.9 (tags/RELEASE_29/final)
bart048081f2012-06-17 05:53:02 +0000114# Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
115# FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
sewardja8ca2c52011-09-29 18:18:37 +0000116#
bartc5214062012-01-11 11:34:23 +0000117[
bart048081f2012-06-17 05:53:02 +0000118if test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ; then
119 is_clang="clang"
120 # Don't use -dumpversion with clang: it will always produce "4.2.1".
121 gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
122else
123 is_clang="notclang"
124 gcc_version=`${CC} -dumpversion 2>/dev/null`
125 if test "x$gcc_version" = x; then
126 gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'`
127 fi
sewardj3ab7b662011-09-29 17:30:13 +0000128fi
bart048081f2012-06-17 05:53:02 +0000129]
sewardj3ab7b662011-09-29 17:30:13 +0000130
131case "${is_clang}-${gcc_version}" in
132 notclang-3.*)
133 AC_MSG_RESULT([ok (${gcc_version})])
134 ;;
135 notclang-4.*)
136 AC_MSG_RESULT([ok (${gcc_version})])
137 ;;
sewardjae284e52012-08-02 18:25:04 +0000138 clang-2.9|clang-3.*|clang-4.*)
sewardj3ab7b662011-09-29 17:30:13 +0000139 AC_MSG_RESULT([ok (clang-${gcc_version})])
sewardj535c50f2005-06-04 23:14:53 +0000140 ;;
gobrye721a522002-03-22 13:38:30 +0000141 *)
sewardj3ab7b662011-09-29 17:30:13 +0000142 AC_MSG_RESULT([no (${gcc_version})])
143 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
gobrye721a522002-03-22 13:38:30 +0000144 ;;
145esac
146
njn7fd6d382009-01-22 21:56:32 +0000147#----------------------------------------------------------------------------
148# Arch/OS/platform tests.
149#----------------------------------------------------------------------------
150# We create a number of arch/OS/platform-related variables. We prefix them
151# all with "VGCONF_" which indicates that they are defined at
152# configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
153# variables used when compiling C files.
sewardj03d86f22006-10-17 00:57:24 +0000154
sewardjde4a1d02002-03-22 01:27:54 +0000155AC_CANONICAL_HOST
156
157AC_MSG_CHECKING([for a supported CPU])
sewardjbc692db2006-01-04 03:31:07 +0000158
njn7fd6d382009-01-22 21:56:32 +0000159# ARCH_MAX reflects the most that this CPU can do: for example if it
160# is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
161# Ditto for amd64. It is used for more configuration below, but is not used
162# outside this file.
gobrye721a522002-03-22 13:38:30 +0000163case "${host_cpu}" in
sewardjde4a1d02002-03-22 01:27:54 +0000164 i?86)
165 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000166 ARCH_MAX="x86"
sewardjde4a1d02002-03-22 01:27:54 +0000167 ;;
168
njnfe408942004-11-23 17:52:24 +0000169 x86_64)
170 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000171 ARCH_MAX="amd64"
njnfe408942004-11-23 17:52:24 +0000172 ;;
173
sewardj2c48c7b2005-11-29 13:05:56 +0000174 powerpc64)
175 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000176 ARCH_MAX="ppc64"
sewardj2c48c7b2005-11-29 13:05:56 +0000177 ;;
178
179 powerpc)
sewardj6e9de462011-06-28 07:25:29 +0000180 # On Linux this means only a 32-bit capable CPU.
cerion85665ca2005-06-20 15:51:07 +0000181 AC_MSG_RESULT([ok (${host_cpu})])
sewardj6e9de462011-06-28 07:25:29 +0000182 ARCH_MAX="ppc32"
nethercote9bcc9062004-10-13 13:50:01 +0000183 ;;
184
sewardjb5b87402011-03-07 16:05:35 +0000185 s390x)
186 AC_MSG_RESULT([ok (${host_cpu})])
187 ARCH_MAX="s390x"
188 ;;
189
sewardj59570ff2010-01-01 11:59:33 +0000190 armv7*)
191 AC_MSG_RESULT([ok (${host_cpu})])
192 ARCH_MAX="arm"
193 ;;
194
sewardj5db15402012-06-07 09:13:21 +0000195 mips)
petarj4df0bfc2013-02-27 23:17:33 +0000196 AC_MSG_RESULT([ok (${host_cpu})])
197 ARCH_MAX="mips32"
198 ;;
sewardj5db15402012-06-07 09:13:21 +0000199
200 mipsel)
petarj4df0bfc2013-02-27 23:17:33 +0000201 AC_MSG_RESULT([ok (${host_cpu})])
202 ARCH_MAX="mips32"
203 ;;
sewardj5db15402012-06-07 09:13:21 +0000204
205 mipsisa32r2)
petarj4df0bfc2013-02-27 23:17:33 +0000206 AC_MSG_RESULT([ok (${host_cpu})])
207 ARCH_MAX="mips32"
208 ;;
sewardj5db15402012-06-07 09:13:21 +0000209
petarj4df0bfc2013-02-27 23:17:33 +0000210 mips64*)
211 AC_MSG_RESULT([ok (${host_cpu})])
212 ARCH_MAX="mips64"
213 ;;
214
215 mipsisa64*)
216 AC_MSG_RESULT([ok (${host_cpu})])
217 ARCH_MAX="mips64"
218 ;;
sewardjde4a1d02002-03-22 01:27:54 +0000219 *)
220 AC_MSG_RESULT([no (${host_cpu})])
nethercote81d5c662004-10-13 13:18:51 +0000221 AC_MSG_ERROR([Unsupported host architecture. Sorry])
sewardjde4a1d02002-03-22 01:27:54 +0000222 ;;
223esac
224
njn7fd6d382009-01-22 21:56:32 +0000225#----------------------------------------------------------------------------
226
sewardj86e992f2006-01-28 18:39:09 +0000227# Sometimes it's convenient to subvert the bi-arch build system and
228# just have a single build even though the underlying platform is
229# capable of both. Hence handle --enable-only64bit and
230# --enable-only32bit. Complain if both are issued :-)
njn7fd6d382009-01-22 21:56:32 +0000231# [Actually, if either of these options are used, I think both get built,
232# but only one gets installed. So if you use an in-place build, both can be
233# used. --njn]
sewardj86e992f2006-01-28 18:39:09 +0000234
235# Check if a 64-bit only build has been requested
236AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
237 [AC_ARG_ENABLE(only64bit,
238 [ --enable-only64bit do a 64-bit only build],
239 [vg_cv_only64bit=$enableval],
240 [vg_cv_only64bit=no])])
241
242# Check if a 32-bit only build has been requested
243AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
244 [AC_ARG_ENABLE(only32bit,
245 [ --enable-only32bit do a 32-bit only build],
246 [vg_cv_only32bit=$enableval],
247 [vg_cv_only32bit=no])])
248
249# Stay sane
250if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
251 AC_MSG_ERROR(
252 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
253fi
254
njn7fd6d382009-01-22 21:56:32 +0000255#----------------------------------------------------------------------------
sewardj86e992f2006-01-28 18:39:09 +0000256
njn311303f2009-02-06 03:46:50 +0000257# VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
258# compilation of many C files via -VGO_$(VGCONF_OS) and
259# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
sewardjde4a1d02002-03-22 01:27:54 +0000260AC_MSG_CHECKING([for a supported OS])
njn7fd6d382009-01-22 21:56:32 +0000261AC_SUBST(VGCONF_OS)
sewardjde4a1d02002-03-22 01:27:54 +0000262
njnf76d27a2009-05-28 01:53:07 +0000263DEFAULT_SUPP=""
264
gobrye721a522002-03-22 13:38:30 +0000265case "${host_os}" in
mueller8c68e042004-01-03 15:21:14 +0000266 *linux*)
sewardjde4a1d02002-03-22 01:27:54 +0000267 AC_MSG_RESULT([ok (${host_os})])
njn7fd6d382009-01-22 21:56:32 +0000268 VGCONF_OS="linux"
mueller8c68e042004-01-03 15:21:14 +0000269
270 # Ok, this is linux. Check the kernel version
271 AC_MSG_CHECKING([for the kernel version])
272
273 kernel=`uname -r`
274
275 case "${kernel}" in
bart0419e512011-06-05 08:51:47 +0000276 2.6.*|3.*)
bart2d6e6e72011-06-05 10:01:48 +0000277 AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
278 AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
mueller8c68e042004-01-03 15:21:14 +0000279 ;;
280
281 2.4.*)
282 AC_MSG_RESULT([2.4 family (${kernel})])
283 AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x])
284 ;;
285
mueller8c68e042004-01-03 15:21:14 +0000286 *)
287 AC_MSG_RESULT([unsupported (${kernel})])
nethercote4fa681f2004-11-08 17:51:39 +0000288 AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
mueller8c68e042004-01-03 15:21:14 +0000289 ;;
290 esac
291
292 ;;
293
njnf76d27a2009-05-28 01:53:07 +0000294 *darwin*)
295 AC_MSG_RESULT([ok (${host_os})])
296 VGCONF_OS="darwin"
njnea2d6fd2010-07-01 00:20:20 +0000297 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
298 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
299 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
sewardjae284e52012-08-02 18:25:04 +0000300 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
njnf76d27a2009-05-28 01:53:07 +0000301
302 AC_MSG_CHECKING([for the kernel version])
303 kernel=`uname -r`
304
305 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
306 # has only one relevant version, the OS version. The `uname` check
307 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
sewardj731f9cf2011-09-21 08:43:08 +0000308 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
309 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
njnea2d6fd2010-07-01 00:20:20 +0000310 # and we don't know of an macros similar to __GLIBC__ to get that info.
njnf76d27a2009-05-28 01:53:07 +0000311 #
312 # XXX: `uname -r` won't do the right thing for cross-compiles, but
313 # that's not a problem yet.
sewardj731f9cf2011-09-21 08:43:08 +0000314 #
315 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
316 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
317 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
318 # time support for 10.5 (the 9.* pattern just below), I'll leave it
319 # in for now, just in case anybody wants to give it a try. But I'm
320 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
njnf76d27a2009-05-28 01:53:07 +0000321 case "${kernel}" in
322 9.*)
323 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
njnea2d6fd2010-07-01 00:20:20 +0000324 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
njnf76d27a2009-05-28 01:53:07 +0000325 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
bart6ccda142009-07-23 07:37:32 +0000326 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
njnf76d27a2009-05-28 01:53:07 +0000327 ;;
njnea2d6fd2010-07-01 00:20:20 +0000328 10.*)
329 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
330 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
331 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
332 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
333 ;;
sewardj731f9cf2011-09-21 08:43:08 +0000334 11.*)
335 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
336 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
sewardj731f9cf2011-09-21 08:43:08 +0000337 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
338 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
339 ;;
sewardjae284e52012-08-02 18:25:04 +0000340 12.*)
341 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
342 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
343 DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
344 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
345 ;;
sewardj731f9cf2011-09-21 08:43:08 +0000346 *)
njnf76d27a2009-05-28 01:53:07 +0000347 AC_MSG_RESULT([unsupported (${kernel})])
sewardj731f9cf2011-09-21 08:43:08 +0000348 AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)])
njnf76d27a2009-05-28 01:53:07 +0000349 ;;
350 esac
351 ;;
352
sewardjde4a1d02002-03-22 01:27:54 +0000353 *)
354 AC_MSG_RESULT([no (${host_os})])
njncc58cea2010-07-05 07:21:22 +0000355 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
sewardjde4a1d02002-03-22 01:27:54 +0000356 ;;
357esac
358
njn7fd6d382009-01-22 21:56:32 +0000359#----------------------------------------------------------------------------
360
tomd6398392006-06-07 17:44:36 +0000361# If we are building on a 64 bit platform test to see if the system
362# supports building 32 bit programs and disable 32 bit support if it
363# does not support building 32 bit programs
364
njn7fd6d382009-01-22 21:56:32 +0000365case "$ARCH_MAX-$VGCONF_OS" in
tomd6398392006-06-07 17:44:36 +0000366 amd64-linux|ppc64-linux)
367 AC_MSG_CHECKING([for 32 bit build support])
368 safe_CFLAGS=$CFLAGS
369 CFLAGS="-m32"
bart417cf3e2011-10-22 09:21:24 +0000370 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +0000371 return 0;
bart417cf3e2011-10-22 09:21:24 +0000372 ]])], [
tomd6398392006-06-07 17:44:36 +0000373 AC_MSG_RESULT([yes])
374 ], [
375 vg_cv_only64bit="yes"
376 AC_MSG_RESULT([no])
377 ])
378 CFLAGS=$safe_CFLAGS;;
379esac
380
381if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
382 AC_MSG_ERROR(
383 [--enable-only32bit was specified but system does not support 32 bit builds])
384fi
nethercote888ecb72004-08-23 14:54:40 +0000385
njn7fd6d382009-01-22 21:56:32 +0000386#----------------------------------------------------------------------------
387
njn311303f2009-02-06 03:46:50 +0000388# VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
389# default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
390# machine, but --enable-only32bit has been requested, then ARCH_MAX (see
391# above) will be "amd64" since that reflects the most that this cpu can do,
392# but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
393# arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
njn7fd6d382009-01-22 21:56:32 +0000394# passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
395# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
396AC_SUBST(VGCONF_ARCH_PRI)
397
njn3f8a6e92009-06-02 00:20:47 +0000398# VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
399# It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
400# and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
401# It is empty if there is no secondary target.
402AC_SUBST(VGCONF_ARCH_SEC)
403
njn311303f2009-02-06 03:46:50 +0000404# VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
405# The entire system, including regression and performance tests, will be
406# built for this target. The "_CAPS" indicates that the name is in capital
407# letters, and it also uses '_' rather than '-' as a separator, because it's
njn7fd6d382009-01-22 21:56:32 +0000408# used to create various Makefile variables, which are all in caps by
njn311303f2009-02-06 03:46:50 +0000409# convention and cannot contain '-' characters. This is in contrast to
410# VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
njn7fd6d382009-01-22 21:56:32 +0000411AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
412
413# VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
414# Valgrind and tools will also be built for this target, but not the
415# regression or performance tests.
sewardj01262142006-01-04 01:20:28 +0000416#
njn7fd6d382009-01-22 21:56:32 +0000417# By default, the primary arch is the same as the "max" arch, as commented
418# above (at the definition of ARCH_MAX). We may choose to downgrade it in
419# the big case statement just below here, in the case where we're building
420# on a 64 bit machine but have been requested only to do a 32 bit build.
421AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
422
sewardj01262142006-01-04 01:20:28 +0000423AC_MSG_CHECKING([for a supported CPU/OS combination])
nethercote888ecb72004-08-23 14:54:40 +0000424
njnea2d6fd2010-07-01 00:20:20 +0000425# NB. The load address for a given platform may be specified in more
426# than one place, in some cases, depending on whether we're doing a biarch,
427# 32-bit only or 64-bit only build. eg see case for amd64-linux below.
428# Be careful to give consistent values in all subcases. Also, all four
429# valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
430# even if it is to "0xUNSET".
431#
njn7fd6d382009-01-22 21:56:32 +0000432case "$ARCH_MAX-$VGCONF_OS" in
sewardj01262142006-01-04 01:20:28 +0000433 x86-linux)
njn7fd6d382009-01-22 21:56:32 +0000434 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000435 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000436 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
437 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000438 valt_load_address_pri_norml="0x38000000"
439 valt_load_address_pri_inner="0x28000000"
440 valt_load_address_sec_norml="0xUNSET"
441 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000442 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000443 ;;
444 amd64-linux)
njnea2d6fd2010-07-01 00:20:20 +0000445 valt_load_address_sec_norml="0xUNSET"
446 valt_load_address_sec_inner="0xUNSET"
sewardj86e992f2006-01-28 18:39:09 +0000447 if test x$vg_cv_only64bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000448 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000449 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000450 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
451 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000452 valt_load_address_pri_norml="0x38000000"
453 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000454 elif test x$vg_cv_only32bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000455 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000456 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000457 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
458 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000459 valt_load_address_pri_norml="0x38000000"
460 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000461 else
njn7fd6d382009-01-22 21:56:32 +0000462 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000463 VGCONF_ARCH_SEC="x86"
njn7fd6d382009-01-22 21:56:32 +0000464 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
465 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
njnea2d6fd2010-07-01 00:20:20 +0000466 valt_load_address_pri_norml="0x38000000"
467 valt_load_address_pri_inner="0x28000000"
468 valt_load_address_sec_norml="0x38000000"
469 valt_load_address_sec_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000470 fi
njn377c43f2009-05-19 07:39:22 +0000471 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000472 ;;
473 ppc32-linux)
njn7fd6d382009-01-22 21:56:32 +0000474 VGCONF_ARCH_PRI="ppc32"
njn3f8a6e92009-06-02 00:20:47 +0000475 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000476 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
477 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000478 valt_load_address_pri_norml="0x38000000"
479 valt_load_address_pri_inner="0x28000000"
480 valt_load_address_sec_norml="0xUNSET"
481 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000482 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000483 ;;
484 ppc64-linux)
njnea2d6fd2010-07-01 00:20:20 +0000485 valt_load_address_sec_norml="0xUNSET"
486 valt_load_address_sec_inner="0xUNSET"
sewardj86e992f2006-01-28 18:39:09 +0000487 if test x$vg_cv_only64bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000488 VGCONF_ARCH_PRI="ppc64"
njn3f8a6e92009-06-02 00:20:47 +0000489 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000490 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
491 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000492 valt_load_address_pri_norml="0x38000000"
493 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000494 elif test x$vg_cv_only32bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000495 VGCONF_ARCH_PRI="ppc32"
njn3f8a6e92009-06-02 00:20:47 +0000496 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000497 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
498 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000499 valt_load_address_pri_norml="0x38000000"
500 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000501 else
njn7fd6d382009-01-22 21:56:32 +0000502 VGCONF_ARCH_PRI="ppc64"
njn3f8a6e92009-06-02 00:20:47 +0000503 VGCONF_ARCH_SEC="ppc32"
njn7fd6d382009-01-22 21:56:32 +0000504 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
505 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
njnea2d6fd2010-07-01 00:20:20 +0000506 valt_load_address_pri_norml="0x38000000"
507 valt_load_address_pri_inner="0x28000000"
508 valt_load_address_sec_norml="0x38000000"
509 valt_load_address_sec_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000510 fi
njn377c43f2009-05-19 07:39:22 +0000511 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000512 ;;
njncc58cea2010-07-05 07:21:22 +0000513 # Darwin gets identified as 32-bit even when it supports 64-bit.
514 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
515 # all Macs support both 32-bit and 64-bit, so we just build both. If
516 # someone has a really old 32-bit only machine they can (hopefully?)
517 # build with --enable-only32bit. See bug 243362.
518 x86-darwin|amd64-darwin)
519 ARCH_MAX="amd64"
njnea2d6fd2010-07-01 00:20:20 +0000520 valt_load_address_sec_norml="0xUNSET"
521 valt_load_address_sec_inner="0xUNSET"
njnf76d27a2009-05-28 01:53:07 +0000522 if test x$vg_cv_only64bit = xyes; then
523 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000524 VGCONF_ARCH_SEC=""
njnf76d27a2009-05-28 01:53:07 +0000525 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
526 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000527 valt_load_address_pri_norml="0x138000000"
528 valt_load_address_pri_inner="0x128000000"
njnf76d27a2009-05-28 01:53:07 +0000529 elif test x$vg_cv_only32bit = xyes; then
530 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000531 VGCONF_ARCH_SEC=""
njnf76d27a2009-05-28 01:53:07 +0000532 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
533 VGCONF_PLATFORM_SEC_CAPS=""
534 VGCONF_ARCH_PRI_CAPS="x86"
njnea2d6fd2010-07-01 00:20:20 +0000535 valt_load_address_pri_norml="0x38000000"
536 valt_load_address_pri_inner="0x28000000"
njnf76d27a2009-05-28 01:53:07 +0000537 else
538 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000539 VGCONF_ARCH_SEC="x86"
njnf76d27a2009-05-28 01:53:07 +0000540 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
541 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
njnea2d6fd2010-07-01 00:20:20 +0000542 valt_load_address_pri_norml="0x138000000"
543 valt_load_address_pri_inner="0x128000000"
544 valt_load_address_sec_norml="0x38000000"
545 valt_load_address_sec_inner="0x28000000"
njnf76d27a2009-05-28 01:53:07 +0000546 fi
njnf76d27a2009-05-28 01:53:07 +0000547 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
548 ;;
sewardj59570ff2010-01-01 11:59:33 +0000549 arm-linux)
550 VGCONF_ARCH_PRI="arm"
551 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
552 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000553 valt_load_address_pri_norml="0x38000000"
554 valt_load_address_pri_inner="0x28000000"
555 valt_load_address_sec_norml="0xUNSET"
556 valt_load_address_sec_inner="0xUNSET"
sewardj59570ff2010-01-01 11:59:33 +0000557 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
558 ;;
sewardjb5b87402011-03-07 16:05:35 +0000559 s390x-linux)
560 VGCONF_ARCH_PRI="s390x"
561 VGCONF_ARCH_SEC=""
562 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
563 VGCONF_PLATFORM_SEC_CAPS=""
564 # we want to have the generated code close to the dispatcher
565 valt_load_address_pri_norml="0x401000000"
566 valt_load_address_pri_inner="0x410000000"
567 valt_load_address_sec_norml="0xUNSET"
568 valt_load_address_sec_inner="0xUNSET"
569 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
570 ;;
sewardj5db15402012-06-07 09:13:21 +0000571 mips32-linux)
572 VGCONF_ARCH_PRI="mips32"
573 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
574 VGCONF_PLATFORM_SEC_CAPS=""
575 valt_load_address_pri_norml="0x38000000"
576 valt_load_address_pri_inner="0x28000000"
577 valt_load_address_sec_norml="0xUNSET"
578 valt_load_address_sec_inner="0xUNSET"
579 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
petarj4df0bfc2013-02-27 23:17:33 +0000580 ;;
581 mips64-linux)
582 VGCONF_ARCH_PRI="mips64"
583 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
584 VGCONF_PLATFORM_SEC_CAPS=""
585 valt_load_address_pri_norml="0x38000000"
586 valt_load_address_pri_inner="0x28000000"
587 valt_load_address_sec_norml="0xUNSET"
588 valt_load_address_sec_inner="0xUNSET"
589 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj5db15402012-06-07 09:13:21 +0000590 ;;
nethercote888ecb72004-08-23 14:54:40 +0000591 *)
njn7fd6d382009-01-22 21:56:32 +0000592 VGCONF_ARCH_PRI="unknown"
njn3f8a6e92009-06-02 00:20:47 +0000593 VGCONF_ARCH_SEC="unknown"
njn7fd6d382009-01-22 21:56:32 +0000594 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
595 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
njnea2d6fd2010-07-01 00:20:20 +0000596 valt_load_address_pri_norml="0xUNSET"
597 valt_load_address_pri_inner="0xUNSET"
598 valt_load_address_sec_norml="0xUNSET"
599 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000600 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
sewardj3e38ce02004-11-23 01:17:29 +0000601 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
nethercote888ecb72004-08-23 14:54:40 +0000602 ;;
603esac
sewardjde4a1d02002-03-22 01:27:54 +0000604
njn7fd6d382009-01-22 21:56:32 +0000605#----------------------------------------------------------------------------
njna454ec02009-01-19 03:16:59 +0000606
njn7fd6d382009-01-22 21:56:32 +0000607# Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
608# defined.
609AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
610 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
njnf76d27a2009-05-28 01:53:07 +0000611 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
612 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
613 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN )
njn7fd6d382009-01-22 21:56:32 +0000614AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
njnf76d27a2009-05-28 01:53:07 +0000615 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
616 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN )
njn7fd6d382009-01-22 21:56:32 +0000617AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
618 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj6e9de462011-06-28 07:25:29 +0000619 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
njn7fd6d382009-01-22 21:56:32 +0000620AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
sewardj6e9de462011-06-28 07:25:29 +0000621 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
sewardj59570ff2010-01-01 11:59:33 +0000622AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
623 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
sewardjb5b87402011-03-07 16:05:35 +0000624AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
625 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
sewardj5db15402012-06-07 09:13:21 +0000626AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
627 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX )
petarj4df0bfc2013-02-27 23:17:33 +0000628AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
629 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
sewardj03d86f22006-10-17 00:57:24 +0000630
njn7fd6d382009-01-22 21:56:32 +0000631# Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
632# become defined.
633AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
634 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
635 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
636AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
637 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
638AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
639 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
640 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
641AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX,
642 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
sewardj59570ff2010-01-01 11:59:33 +0000643AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
644 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
sewardjb5b87402011-03-07 16:05:35 +0000645AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
646 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
647 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
sewardj5db15402012-06-07 09:13:21 +0000648AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
649 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX)
petarj4df0bfc2013-02-27 23:17:33 +0000650AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
651 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
njnf76d27a2009-05-28 01:53:07 +0000652
njnf76d27a2009-05-28 01:53:07 +0000653AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
654 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
655 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
656AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
657 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
658
659
sewardj72a2d802010-07-29 05:24:20 +0000660# Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
sewardj03d86f22006-10-17 00:57:24 +0000661# Relies on the assumption that the primary and secondary targets are
662# for the same OS, so therefore only necessary to test the primary.
njn7fd6d382009-01-22 21:56:32 +0000663AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
664 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
665 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
666 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj59570ff2010-01-01 11:59:33 +0000667 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
sewardjb5b87402011-03-07 16:05:35 +0000668 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
sewardj5db15402012-06-07 09:13:21 +0000669 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
petarj4df0bfc2013-02-27 23:17:33 +0000670 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
671 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
njnf76d27a2009-05-28 01:53:07 +0000672AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
673 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
674 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
sewardj03d86f22006-10-17 00:57:24 +0000675
676
njn7fd6d382009-01-22 21:56:32 +0000677# Sometimes, in the Makefile.am files, it's useful to know whether or not
678# there is a secondary target.
njnee0c66a2009-06-01 23:59:20 +0000679AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
njn7fd6d382009-01-22 21:56:32 +0000680 test x$VGCONF_PLATFORM_SEC_CAPS != x)
tomfb7bcde2005-11-07 15:24:38 +0000681
philippef32cbe82012-05-18 16:48:20 +0000682dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
683dnl fallback definition
684dnl The macro is courtesy of Dave Hart:
685dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
686m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
687if test -z "$$1_TRUE"; then :
688 m4_n([$2])[]dnl
689m4_ifval([$3],
690[else
691 $3
692])dnl
693fi[]dnl
694])])
tomb637bad2005-11-08 12:28:35 +0000695
njn7fd6d382009-01-22 21:56:32 +0000696#----------------------------------------------------------------------------
697# Inner Valgrind?
698#----------------------------------------------------------------------------
699
njnd74b0ef2009-01-20 06:06:52 +0000700# Check if this should be built as an inner Valgrind, to be run within
701# another Valgrind. Choose the load address accordingly.
njnea2d6fd2010-07-01 00:20:20 +0000702AC_SUBST(VALT_LOAD_ADDRESS_PRI)
703AC_SUBST(VALT_LOAD_ADDRESS_SEC)
njnd74b0ef2009-01-20 06:06:52 +0000704AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
705 [AC_ARG_ENABLE(inner,
706 [ --enable-inner enables self-hosting],
707 [vg_cv_inner=$enableval],
708 [vg_cv_inner=no])])
709if test "$vg_cv_inner" = yes; then
710 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
njnea2d6fd2010-07-01 00:20:20 +0000711 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
712 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
njnd74b0ef2009-01-20 06:06:52 +0000713else
njnea2d6fd2010-07-01 00:20:20 +0000714 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
715 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
njnd74b0ef2009-01-20 06:06:52 +0000716fi
717
718
njn7fd6d382009-01-22 21:56:32 +0000719#----------------------------------------------------------------------------
sewardj5db15402012-06-07 09:13:21 +0000720# Define MIPS_PAGE_SHIFT (--with-pagesize)
721#----------------------------------------------------------------------------
722AC_ARG_WITH(pagesize,
723 [ --with-pagesize= override detected page size (4, 16 or 64)],
724 [psize=$withval],
725 [psize=0]
726)
727
728if test "$psize" = "0"; then
729 psizer=`getconf PAGESIZE`
730 let "psize=${psizer}/1024"
731fi
732
733if test "$psize" = "4"; then
734 AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured page size 4k])
735elif test "$psize" = "16"; then
736 AC_DEFINE([MIPS_PAGE_SHIFT], 14, [configured page size 16k])
737elif test "$psize" = "64"; then
738 AC_DEFINE([MIPS_PAGE_SHIFT], 16, [configured page size 64k])
739else
740 AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured default page size 4k])
741fi
742AC_MSG_RESULT([checking for Pagesize... ${psize}k])
743
sewardj5db15402012-06-07 09:13:21 +0000744
745#----------------------------------------------------------------------------
sewardjcb495c82011-07-11 20:42:34 +0000746# Extra fine-tuning of installation directories
747#----------------------------------------------------------------------------
748AC_ARG_WITH(tmpdir,
749 [ --with-tmpdir=PATH Specify path for temporary files],
750 tmpdir="$withval",
751 tmpdir="/tmp")
752AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
753
sewardj0ba37c92011-07-12 11:46:24 +0000754
sewardjcb495c82011-07-11 20:42:34 +0000755#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +0000756# Libc and suppressions
757#----------------------------------------------------------------------------
758# This variable will collect the suppression files to be used.
njn7fd6d382009-01-22 21:56:32 +0000759AC_SUBST(DEFAULT_SUPP)
sewardj01262142006-01-04 01:20:28 +0000760
bart12e91122010-05-15 08:37:24 +0000761AC_CHECK_HEADER([features.h])
sewardjde4a1d02002-03-22 01:27:54 +0000762
bart12e91122010-05-15 08:37:24 +0000763if test x$ac_cv_header_features_h = xyes; then
764 rm -f conftest.$ac_ext
765 cat <<_ACEOF >conftest.$ac_ext
sewardjde4a1d02002-03-22 01:27:54 +0000766#include <features.h>
bart12e91122010-05-15 08:37:24 +0000767#if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
768glibc version is: __GLIBC__ __GLIBC_MINOR__
sewardjde4a1d02002-03-22 01:27:54 +0000769#endif
bart12e91122010-05-15 08:37:24 +0000770_ACEOF
771 GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
772fi
bartb7c3f082010-05-13 06:32:36 +0000773
njnf76d27a2009-05-28 01:53:07 +0000774# not really a version check
775AC_EGREP_CPP([DARWIN_LIBC], [
776#include <sys/cdefs.h>
777#if defined(__DARWIN_VERS_1050)
778 DARWIN_LIBC
779#endif
780],
781GLIBC_VERSION="darwin")
782
sewardjcb495c82011-07-11 20:42:34 +0000783# not really a version check
784AC_EGREP_CPP([BIONIC_LIBC], [
785#if defined(__ANDROID__)
786 BIONIC_LIBC
787#endif
788],
789GLIBC_VERSION="bionic")
790
791
dirk07596a22008-04-25 11:33:30 +0000792AC_MSG_CHECKING([the GLIBC_VERSION version])
sewardj03d86f22006-10-17 00:57:24 +0000793
dirk07596a22008-04-25 11:33:30 +0000794case "${GLIBC_VERSION}" in
sewardjde4a1d02002-03-22 01:27:54 +0000795 2.2)
796 AC_MSG_RESULT(2.2 family)
daywalker418c7482002-10-16 13:09:26 +0000797 AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000798 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
799 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000800 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardjde4a1d02002-03-22 01:27:54 +0000801 ;;
802
sewardj08c7f012002-10-07 23:56:55 +0000803 2.3)
804 AC_MSG_RESULT(2.3 family)
daywalker418c7482002-10-16 13:09:26 +0000805 AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000806 DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000807 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000808 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardj08c7f012002-10-07 23:56:55 +0000809 ;;
810
njn781dba52005-06-30 04:06:38 +0000811 2.4)
812 AC_MSG_RESULT(2.4 family)
813 AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000814 DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000815 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000816 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
njn781dba52005-06-30 04:06:38 +0000817 ;;
818
dirkaece45c2006-10-12 08:17:49 +0000819 2.5)
820 AC_MSG_RESULT(2.5 family)
821 AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000822 DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000823 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000824 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
dirkaece45c2006-10-12 08:17:49 +0000825 ;;
dirkc8bd0c52007-05-23 17:39:08 +0000826 2.6)
827 AC_MSG_RESULT(2.6 family)
828 AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000829 DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000830 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000831 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000832 ;;
833 2.7)
834 AC_MSG_RESULT(2.7 family)
835 AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
dirk07596a22008-04-25 11:33:30 +0000836 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000837 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000838 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
dirkc8bd0c52007-05-23 17:39:08 +0000839 ;;
dirk07596a22008-04-25 11:33:30 +0000840 2.8)
841 AC_MSG_RESULT(2.8 family)
dirkeb939fc2008-04-27 20:38:47 +0000842 AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
dirk07596a22008-04-25 11:33:30 +0000843 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
844 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
845 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
846 ;;
dirkd2e31eb2008-11-19 23:58:36 +0000847 2.9)
848 AC_MSG_RESULT(2.9 family)
849 AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
850 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
851 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
852 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
853 ;;
sewardj5d425e82009-02-01 19:01:11 +0000854 2.10)
855 AC_MSG_RESULT(2.10 family)
856 AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
857 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
858 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
859 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
860 ;;
bart0fac7ff2009-11-15 19:11:19 +0000861 2.11)
862 AC_MSG_RESULT(2.11 family)
863 AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
864 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
865 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
866 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
bartb7c3f082010-05-13 06:32:36 +0000867 ;;
868 2.12)
869 AC_MSG_RESULT(2.12 family)
870 AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
871 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
872 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
873 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
bart0fac7ff2009-11-15 19:11:19 +0000874 ;;
tomebd619b2011-02-10 09:09:09 +0000875 2.13)
876 AC_MSG_RESULT(2.13 family)
877 AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
878 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
879 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
880 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
881 ;;
tomcc077412011-06-07 21:52:26 +0000882 2.14)
883 AC_MSG_RESULT(2.14 family)
884 AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
885 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
886 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
887 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
888 ;;
dirke75fdeb2011-12-29 08:24:55 +0000889 2.15)
890 AC_MSG_RESULT(2.15 family)
891 AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x])
892 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
893 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
894 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
895 ;;
sewardjc7188be2012-07-14 10:07:06 +0000896 2.16)
897 AC_MSG_RESULT(2.16 family)
898 AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x])
899 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
900 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
901 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
902 ;;
tom3781ac12013-01-14 09:48:49 +0000903 2.17)
904 AC_MSG_RESULT(2.17 family)
905 AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x])
906 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
907 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
908 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
909 ;;
mjw317f01b2013-08-21 14:47:52 +0000910 2.18)
911 AC_MSG_RESULT(2.18 family)
912 AC_DEFINE([GLIBC_2_18], 1, [Define to 1 if you're using glibc 2.18.x])
913 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
914 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
915 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
916 ;;
njnf76d27a2009-05-28 01:53:07 +0000917 darwin)
918 AC_MSG_RESULT(Darwin)
919 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
920 # DEFAULT_SUPP set by kernel version check above.
921 ;;
sewardjcb495c82011-07-11 20:42:34 +0000922 bionic)
923 AC_MSG_RESULT(Bionic)
924 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
925 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
926 ;;
dirkaece45c2006-10-12 08:17:49 +0000927
sewardjde4a1d02002-03-22 01:27:54 +0000928 *)
bart12e91122010-05-15 08:37:24 +0000929 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
tom3781ac12013-01-14 09:48:49 +0000930 AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17])
njnf76d27a2009-05-28 01:53:07 +0000931 AC_MSG_ERROR([or Darwin libc])
sewardjde4a1d02002-03-22 01:27:54 +0000932 ;;
933esac
934
dirk07596a22008-04-25 11:33:30 +0000935AC_SUBST(GLIBC_VERSION)
sewardj535c50f2005-06-04 23:14:53 +0000936
sewardj414f3582008-07-18 20:46:00 +0000937
938# Add default suppressions for the X client libraries. Make no
939# attempt to detect whether such libraries are installed on the
940# build machine (or even if any X facilities are present); just
941# add the suppressions antidisirregardless.
942DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
943DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
gobrye721a522002-03-22 13:38:30 +0000944
sewardjd2f95a02011-05-11 16:04:28 +0000945# Add glibc and X11 suppressions for exp-sgcheck
946DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
sewardj5744c022008-10-19 18:58:13 +0000947
sewardj2e10a682003-04-07 19:36:41 +0000948
njn7fd6d382009-01-22 21:56:32 +0000949#----------------------------------------------------------------------------
sewardjcb495c82011-07-11 20:42:34 +0000950# Platform variants?
951#----------------------------------------------------------------------------
952
953# Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
954# But there are times where we need a bit more control. The motivating
philippe5d5dd8e2012-08-05 00:08:25 +0000955# and currently only case is Android: this is almost identical to
956# {x86,arm}-linux, but not quite. So this introduces the concept of platform
957# variant tags, which get passed in the compile as -DVGPV_<arch>_<os>_<variant>
958# along with the main -DVGP_<arch>_<os> definition.
sewardjcb495c82011-07-11 20:42:34 +0000959#
960# In almost all cases, the <variant> bit is "vanilla". But for Android
961# it is "android" instead.
962#
963# Consequently (eg), plain arm-linux would build with
964#
965# -DVGP_arm_linux -DVGPV_arm_linux_vanilla
966#
967# whilst an Android build would have
968#
969# -DVGP_arm_linux -DVGPV_arm_linux_android
970#
philippe5d5dd8e2012-08-05 00:08:25 +0000971# Same for x86. The setup of the platform variant is pushed relatively far
972# down this file in order that we can inspect any of the variables set above.
sewardjcb495c82011-07-11 20:42:34 +0000973
974# In the normal case ..
975VGCONF_PLATVARIANT="vanilla"
976
philippe5d5dd8e2012-08-05 00:08:25 +0000977# Android ?
978if test "$GLIBC_VERSION" = "bionic";
sewardjcb495c82011-07-11 20:42:34 +0000979then
980 VGCONF_PLATVARIANT="android"
981fi
982
983AC_SUBST(VGCONF_PLATVARIANT)
984
985
986# FIXME: do we also want to define automake variables
987# VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
988# VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
989# VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
990# do that. Problem is that we can't do and-ing in Makefile.am's, but
991# that's what we'd need to do to use this, since what we'd want to write
992# is something like
993#
994# VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
995#
sewardj0ba37c92011-07-12 11:46:24 +0000996# Hmm. Can't think of a nice clean solution to this.
997
998AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
999 test x$VGCONF_PLATVARIANT = xvanilla)
1000AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1001 test x$VGCONF_PLATVARIANT = xandroid)
sewardjcb495c82011-07-11 20:42:34 +00001002
1003
1004#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +00001005# Checking for various library functions and other definitions
1006#----------------------------------------------------------------------------
1007
florian28db75c2012-12-08 19:26:03 +00001008# Check for AT_FDCWD
1009
1010AC_MSG_CHECKING([for AT_FDCWD])
1011AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1012#define _GNU_SOURCE
1013#include <fcntl.h>
1014#include <unistd.h>
1015]], [[
1016 int a = AT_FDCWD;
1017]])], [
1018ac_have_at_fdcwd=yes
1019AC_MSG_RESULT([yes])
1020], [
1021ac_have_at_fdcwd=no
florian28db75c2012-12-08 19:26:03 +00001022AC_MSG_RESULT([no])
1023])
1024
1025AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1026
sewardj24cf8df2012-12-14 10:30:57 +00001027# Check for stpncpy function definition in string.h
1028# This explicitly checks with _GNU_SOURCE defined since that is also
1029# used in the test case (some systems might define it without anyway
1030# since stpncpy is part of The Open Group Base Specifications Issue 7
1031# IEEE Std 1003.1-2008.
1032AC_MSG_CHECKING([for stpncpy])
1033AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1034#define _GNU_SOURCE
1035#include <string.h>
1036]], [[
1037 char *d;
1038 char *s;
1039 size_t n = 0;
1040 char *r = stpncpy(d, s, n);
1041]])], [
1042ac_have_gnu_stpncpy=yes
1043AC_MSG_RESULT([yes])
1044], [
1045ac_have_gnu_stpncpy=no
1046AC_MSG_RESULT([no])
1047])
1048
1049AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
florian28db75c2012-12-08 19:26:03 +00001050
philippe4e98f7c2013-08-03 20:34:58 +00001051# Check for PTRACE_GETREGS
1052
1053AC_MSG_CHECKING([for PTRACE_GETREGS])
1054AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1055#include <stddef.h>
1056#include <sys/ptrace.h>
1057#include <sys/user.h>
1058]], [[
1059 void *p;
1060 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1061]])], [
1062AC_MSG_RESULT([yes])
1063AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1064 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1065], [
1066AC_MSG_RESULT([no])
1067])
1068
1069
bart59e2f182008-04-28 16:22:53 +00001070# Check for CLOCK_MONOTONIC
1071
1072AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1073
bart417cf3e2011-10-22 09:21:24 +00001074AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart59e2f182008-04-28 16:22:53 +00001075#include <time.h>
bart417cf3e2011-10-22 09:21:24 +00001076]], [[
bart59e2f182008-04-28 16:22:53 +00001077 struct timespec t;
1078 clock_gettime(CLOCK_MONOTONIC, &t);
1079 return 0;
bart417cf3e2011-10-22 09:21:24 +00001080]])], [
bart59e2f182008-04-28 16:22:53 +00001081AC_MSG_RESULT([yes])
1082AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1083 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1084], [
1085AC_MSG_RESULT([no])
1086])
1087
bartfea06922008-05-03 09:12:15 +00001088
sewardj0c09bf02011-07-11 22:11:58 +00001089# Check for PTHREAD_RWLOCK_T
1090
1091AC_MSG_CHECKING([for pthread_rwlock_t])
1092
bart417cf3e2011-10-22 09:21:24 +00001093AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
sewardj0c09bf02011-07-11 22:11:58 +00001094#define _GNU_SOURCE
1095#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001096]], [[
sewardj0c09bf02011-07-11 22:11:58 +00001097 pthread_rwlock_t rwl;
bart417cf3e2011-10-22 09:21:24 +00001098]])], [
sewardj0c09bf02011-07-11 22:11:58 +00001099AC_MSG_RESULT([yes])
1100AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1101 [Define to 1 if you have the `pthread_rwlock_t' type.])
1102], [
1103AC_MSG_RESULT([no])
1104])
1105
1106
bartfea06922008-05-03 09:12:15 +00001107# Check for PTHREAD_MUTEX_ADAPTIVE_NP
1108
1109AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1110
bart417cf3e2011-10-22 09:21:24 +00001111AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001112#define _GNU_SOURCE
1113#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001114]], [[
bartfea06922008-05-03 09:12:15 +00001115 return (PTHREAD_MUTEX_ADAPTIVE_NP);
bart417cf3e2011-10-22 09:21:24 +00001116]])], [
bartfea06922008-05-03 09:12:15 +00001117AC_MSG_RESULT([yes])
1118AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1119 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1120], [
1121AC_MSG_RESULT([no])
1122])
1123
1124
1125# Check for PTHREAD_MUTEX_ERRORCHECK_NP
1126
1127AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1128
bart417cf3e2011-10-22 09:21:24 +00001129AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001130#define _GNU_SOURCE
1131#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001132]], [[
bartfea06922008-05-03 09:12:15 +00001133 return (PTHREAD_MUTEX_ERRORCHECK_NP);
bart417cf3e2011-10-22 09:21:24 +00001134]])], [
bartfea06922008-05-03 09:12:15 +00001135AC_MSG_RESULT([yes])
1136AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1137 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1138], [
1139AC_MSG_RESULT([no])
1140])
1141
1142
1143# Check for PTHREAD_MUTEX_RECURSIVE_NP
1144
1145AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1146
bart417cf3e2011-10-22 09:21:24 +00001147AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001148#define _GNU_SOURCE
1149#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001150]], [[
bartfea06922008-05-03 09:12:15 +00001151 return (PTHREAD_MUTEX_RECURSIVE_NP);
bart417cf3e2011-10-22 09:21:24 +00001152]])], [
bartfea06922008-05-03 09:12:15 +00001153AC_MSG_RESULT([yes])
1154AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1155 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1156], [
1157AC_MSG_RESULT([no])
1158])
1159
1160
1161# Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1162
1163AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1164
bart417cf3e2011-10-22 09:21:24 +00001165AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001166#define _GNU_SOURCE
1167#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001168]], [[
bartfea06922008-05-03 09:12:15 +00001169 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1170 return 0;
bart417cf3e2011-10-22 09:21:24 +00001171]])], [
bartfea06922008-05-03 09:12:15 +00001172AC_MSG_RESULT([yes])
1173AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1174 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1175], [
1176AC_MSG_RESULT([no])
1177])
1178
1179
bart5e389f12008-04-05 12:53:15 +00001180# Check whether pthread_mutex_t has a member called __m_kind.
1181
bartb11355c2010-04-29 16:37:26 +00001182AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1183 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1184 1,
1185 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1186 ],
1187 [],
1188 [#include <pthread.h>])
bart5e389f12008-04-05 12:53:15 +00001189
1190
1191# Check whether pthread_mutex_t has a member called __data.__kind.
1192
bartb11355c2010-04-29 16:37:26 +00001193AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1194 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1195 1,
1196 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1197 ],
1198 [],
1199 [#include <pthread.h>])
bart5e389f12008-04-05 12:53:15 +00001200
1201
bart62c370e2008-05-12 18:50:51 +00001202# does this compiler support -maltivec and does it have the include file
1203# <altivec.h> ?
1204
1205AC_MSG_CHECKING([for Altivec])
1206
1207safe_CFLAGS=$CFLAGS
1208CFLAGS="-maltivec"
1209
bart417cf3e2011-10-22 09:21:24 +00001210AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart62c370e2008-05-12 18:50:51 +00001211#include <altivec.h>
bart417cf3e2011-10-22 09:21:24 +00001212]], [[
bart62c370e2008-05-12 18:50:51 +00001213 vector unsigned int v;
bart417cf3e2011-10-22 09:21:24 +00001214]])], [
bart62c370e2008-05-12 18:50:51 +00001215ac_have_altivec=yes
1216AC_MSG_RESULT([yes])
sewardjf9fe6022010-09-03 14:36:50 +00001217AC_DEFINE([HAS_ALTIVEC], 1,
sewardj6467a152010-09-03 14:02:22 +00001218 [Define to 1 if gcc/as can do Altivec.])
bart62c370e2008-05-12 18:50:51 +00001219], [
1220ac_have_altivec=no
1221AC_MSG_RESULT([no])
1222])
1223CFLAGS=$safe_CFLAGS
1224
sewardj0e342a02010-09-03 23:49:33 +00001225AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
bart62c370e2008-05-12 18:50:51 +00001226
1227
sewardjf34eb492011-04-15 11:57:05 +00001228# Check that both: the compiler supports -mvsx and that the assembler
1229# understands VSX instructions. If either of those doesn't work,
1230# conclude that we can't do VSX. NOTE: basically this is a kludge
1231# in that it conflates two things that should be separate -- whether
1232# the compiler understands the flag vs whether the assembler
1233# understands the opcodes. This really ought to be cleaned up
1234# and done properly, like it is for x86/x86_64.
1235
1236AC_MSG_CHECKING([for VSX])
1237
1238safe_CFLAGS=$CFLAGS
1239CFLAGS="-mvsx"
1240
bart417cf3e2011-10-22 09:21:24 +00001241AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
sewardjf34eb492011-04-15 11:57:05 +00001242#include <altivec.h>
bart417cf3e2011-10-22 09:21:24 +00001243]], [[
sewardjf34eb492011-04-15 11:57:05 +00001244 vector unsigned int v;
sewardj9b80ebb2011-04-15 21:16:00 +00001245 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
bart417cf3e2011-10-22 09:21:24 +00001246]])], [
sewardjf34eb492011-04-15 11:57:05 +00001247ac_have_vsx=yes
1248AC_MSG_RESULT([yes])
1249], [
1250ac_have_vsx=no
1251AC_MSG_RESULT([no])
1252])
1253CFLAGS=$safe_CFLAGS
1254
1255AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
1256
sewardj4e1c1912012-08-08 22:22:26 +00001257
sewardjb0ccb4d2012-04-02 10:22:05 +00001258AC_MSG_CHECKING([that assembler knows DFP])
1259
1260AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1261]], [[
1262 __asm__ __volatile__("dadd 1, 2, 3");
sewardj4e1c1912012-08-08 22:22:26 +00001263 __asm__ __volatile__("dcffix 1, 2");
sewardjb0ccb4d2012-04-02 10:22:05 +00001264]])], [
1265ac_asm_have_dfp=yes
1266AC_MSG_RESULT([yes])
1267], [
1268ac_asm_have_dfp=no
1269AC_MSG_RESULT([no])
1270])
1271
sewardj4e1c1912012-08-08 22:22:26 +00001272
sewardjb0ccb4d2012-04-02 10:22:05 +00001273AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1274safe_CFLAGS=$CFLAGS
1275CFLAGS="-mhard-dfp"
1276AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1277]], [[
1278 __asm__ __volatile__("dadd 1, 2, 3");
sewardj4e1c1912012-08-08 22:22:26 +00001279 __asm__ __volatile__("dcffix 1, 2");
sewardjb0ccb4d2012-04-02 10:22:05 +00001280]])], [
1281ac_gcc_have_dfp=yes
1282AC_MSG_RESULT([yes])
1283], [
1284ac_gcc_have_dfp=no
1285AC_MSG_RESULT([no])
1286])
1287
sewardjb0ccb4d2012-04-02 10:22:05 +00001288CFLAGS=$safe_CFLAGS
1289
1290AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes -a x$ac_gcc_have_dfp = xyes)
sewardjf34eb492011-04-15 11:57:05 +00001291
sewardj4e1c1912012-08-08 22:22:26 +00001292
florian46825982012-11-10 22:35:24 +00001293AC_MSG_CHECKING([that compiler knows DFP datatypes])
1294AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1295]], [[
1296 _Decimal64 x = 0.0DD;
1297]])], [
1298ac_gcc_have_dfp_type=yes
1299AC_MSG_RESULT([yes])
1300], [
1301ac_gcc_have_dfp_type=no
1302AC_MSG_RESULT([no])
1303])
1304
1305AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_gcc_have_dfp_type = xyes)
1306
carlldfbf2942013-08-12 18:04:22 +00001307# isa 2.07 checking
1308AC_MSG_CHECKING([that assembler knows ISA 2.07 ])
1309
1310AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1311]], [[
1312 __asm__ __volatile__("mtvsrd 1,2 ");
1313]])], [
1314ac_asm_have_isa_2_07=yes
1315AC_MSG_RESULT([yes])
1316], [
1317ac_asm_have_isa_2_07=no
1318AC_MSG_RESULT([no])
1319])
1320
1321AM_CONDITIONAL(HAS_ISA_2_07, test x$ac_asm_have_isa_2_07 = xyes)
florian46825982012-11-10 22:35:24 +00001322
bart36dd85a2009-04-26 07:11:48 +00001323# Check for pthread_create@GLIBC2.0
1324AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1325
bart16e1c5a2009-04-26 07:38:53 +00001326safe_CFLAGS=$CFLAGS
1327CFLAGS="-lpthread"
bart417cf3e2011-10-22 09:21:24 +00001328AC_LINK_IFELSE([AC_LANG_PROGRAM([[
bart36dd85a2009-04-26 07:11:48 +00001329extern int pthread_create_glibc_2_0(void*, const void*,
1330 void *(*)(void*), void*);
1331__asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
bart417cf3e2011-10-22 09:21:24 +00001332]], [[
bart276ed3a2009-05-10 15:41:45 +00001333#ifdef __powerpc__
1334/*
1335 * Apparently on PowerPC linking this program succeeds and generates an
1336 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1337 */
1338#error This test does not work properly on PowerPC.
1339#else
bart16e1c5a2009-04-26 07:38:53 +00001340 pthread_create_glibc_2_0(0, 0, 0, 0);
bart276ed3a2009-05-10 15:41:45 +00001341#endif
bart16e1c5a2009-04-26 07:38:53 +00001342 return 0;
bart417cf3e2011-10-22 09:21:24 +00001343]])], [
bart36dd85a2009-04-26 07:11:48 +00001344ac_have_pthread_create_glibc_2_0=yes
1345AC_MSG_RESULT([yes])
1346AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1347 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1348], [
1349ac_have_pthread_create_glibc_2_0=no
1350AC_MSG_RESULT([no])
1351])
bart16e1c5a2009-04-26 07:38:53 +00001352CFLAGS=$safe_CFLAGS
bart36dd85a2009-04-26 07:11:48 +00001353
1354AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
bart24f53902009-04-26 11:29:02 +00001355 test x$ac_have_pthread_create_glibc_2_0 = xyes)
bart36dd85a2009-04-26 07:11:48 +00001356
1357
barta50aa8a2008-04-27 06:06:57 +00001358# Check for eventfd_t, eventfd() and eventfd_read()
1359AC_MSG_CHECKING([for eventfd()])
1360
bart417cf3e2011-10-22 09:21:24 +00001361AC_LINK_IFELSE([AC_LANG_PROGRAM([[
barta50aa8a2008-04-27 06:06:57 +00001362#include <sys/eventfd.h>
bart417cf3e2011-10-22 09:21:24 +00001363]], [[
barta50aa8a2008-04-27 06:06:57 +00001364 eventfd_t ev;
1365 int fd;
1366
1367 fd = eventfd(5, 0);
1368 eventfd_read(fd, &ev);
1369 return 0;
bart417cf3e2011-10-22 09:21:24 +00001370]])], [
barta50aa8a2008-04-27 06:06:57 +00001371AC_MSG_RESULT([yes])
1372AC_DEFINE([HAVE_EVENTFD], 1,
1373 [Define to 1 if you have the `eventfd' function.])
1374AC_DEFINE([HAVE_EVENTFD_READ], 1,
1375 [Define to 1 if you have the `eventfd_read' function.])
1376], [
1377AC_MSG_RESULT([no])
1378])
1379
1380
njn7fd6d382009-01-22 21:56:32 +00001381#----------------------------------------------------------------------------
1382# Checking for supported compiler flags.
1383#----------------------------------------------------------------------------
1384
sewardj535c50f2005-06-04 23:14:53 +00001385# does this compiler support -m32 ?
1386AC_MSG_CHECKING([if gcc accepts -m32])
1387
1388safe_CFLAGS=$CFLAGS
1389CFLAGS="-m32"
1390
bart417cf3e2011-10-22 09:21:24 +00001391AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001392 return 0;
bart417cf3e2011-10-22 09:21:24 +00001393]])], [
sewardj535c50f2005-06-04 23:14:53 +00001394FLAG_M32="-m32"
1395AC_MSG_RESULT([yes])
1396], [
1397FLAG_M32=""
1398AC_MSG_RESULT([no])
1399])
1400CFLAGS=$safe_CFLAGS
1401
1402AC_SUBST(FLAG_M32)
1403
1404
sewardj01262142006-01-04 01:20:28 +00001405# does this compiler support -m64 ?
1406AC_MSG_CHECKING([if gcc accepts -m64])
1407
1408safe_CFLAGS=$CFLAGS
1409CFLAGS="-m64"
1410
bart417cf3e2011-10-22 09:21:24 +00001411AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001412 return 0;
bart417cf3e2011-10-22 09:21:24 +00001413]])], [
sewardj01262142006-01-04 01:20:28 +00001414FLAG_M64="-m64"
1415AC_MSG_RESULT([yes])
1416], [
1417FLAG_M64=""
1418AC_MSG_RESULT([no])
1419])
1420CFLAGS=$safe_CFLAGS
1421
1422AC_SUBST(FLAG_M64)
1423
1424
sewardj67f1fcc2005-07-03 10:41:02 +00001425# does this compiler support -mmmx ?
1426AC_MSG_CHECKING([if gcc accepts -mmmx])
1427
1428safe_CFLAGS=$CFLAGS
1429CFLAGS="-mmmx"
1430
bart417cf3e2011-10-22 09:21:24 +00001431AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001432 return 0;
bart417cf3e2011-10-22 09:21:24 +00001433]])], [
sewardj67f1fcc2005-07-03 10:41:02 +00001434FLAG_MMMX="-mmmx"
1435AC_MSG_RESULT([yes])
1436], [
1437FLAG_MMMX=""
1438AC_MSG_RESULT([no])
1439])
1440CFLAGS=$safe_CFLAGS
1441
1442AC_SUBST(FLAG_MMMX)
1443
1444
1445# does this compiler support -msse ?
1446AC_MSG_CHECKING([if gcc accepts -msse])
1447
1448safe_CFLAGS=$CFLAGS
1449CFLAGS="-msse"
1450
bart417cf3e2011-10-22 09:21:24 +00001451AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001452 return 0;
bart417cf3e2011-10-22 09:21:24 +00001453]])], [
sewardj67f1fcc2005-07-03 10:41:02 +00001454FLAG_MSSE="-msse"
1455AC_MSG_RESULT([yes])
1456], [
1457FLAG_MSSE=""
1458AC_MSG_RESULT([no])
1459])
1460CFLAGS=$safe_CFLAGS
1461
1462AC_SUBST(FLAG_MSSE)
1463
1464
sewardj5b754b42002-06-03 22:53:35 +00001465# does this compiler support -mpreferred-stack-boundary=2 ?
1466AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
1467
daywalker3664f562003-10-17 13:43:46 +00001468safe_CFLAGS=$CFLAGS
sewardj5b754b42002-06-03 22:53:35 +00001469CFLAGS="-mpreferred-stack-boundary=2"
1470
bart417cf3e2011-10-22 09:21:24 +00001471AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001472 return 0;
bart417cf3e2011-10-22 09:21:24 +00001473]])], [
sewardj5b754b42002-06-03 22:53:35 +00001474PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2"
daywalker3664f562003-10-17 13:43:46 +00001475AC_MSG_RESULT([yes])
sewardj5b754b42002-06-03 22:53:35 +00001476], [
1477PREFERRED_STACK_BOUNDARY=""
1478AC_MSG_RESULT([no])
1479])
daywalker3664f562003-10-17 13:43:46 +00001480CFLAGS=$safe_CFLAGS
sewardj5b754b42002-06-03 22:53:35 +00001481
1482AC_SUBST(PREFERRED_STACK_BOUNDARY)
1483
sewardj535c50f2005-06-04 23:14:53 +00001484
florianda8c1262012-11-18 14:39:11 +00001485# does this compiler support -Wno-pointer-sign ?
1486AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign])
1487
1488safe_CFLAGS=$CFLAGS
1489CFLAGS="-Wno-pointer-sign"
1490
1491AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1492 return 0;
1493]])], [
1494no_pointer_sign=yes
1495AC_MSG_RESULT([yes])
1496], [
1497no_pointer_sign=no
1498AC_MSG_RESULT([no])
1499])
1500CFLAGS=$safe_CFLAGS
1501
1502AM_CONDITIONAL(HAS_POINTER_SIGN_WARNING, test x$no_pointer_sign = xyes)
1503
1504
florian6bd9dc12012-11-23 16:17:43 +00001505# does this compiler support -Wno-write-strings ?
1506AC_MSG_CHECKING([if gcc accepts -Wwrite-strings])
1507
1508safe_CFLAGS=$CFLAGS
1509CFLAGS="-Wwrite-strings"
1510
1511AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1512 return 0;
1513]])], [
1514no_write_strings=yes
1515AC_MSG_RESULT([yes])
1516], [
1517no_write_strings=no
1518AC_MSG_RESULT([no])
1519])
1520CFLAGS=$safe_CFLAGS
1521
1522if test x$no_write_strings = xyes; then
1523 CFLAGS="$CFLAGS -Wwrite-strings"
floriand79b3bf2013-10-02 15:14:59 +00001524 CXXFLAGS="$CXXFLAGS -Wwrite-strings"
florian6bd9dc12012-11-23 16:17:43 +00001525fi
1526
1527AM_CONDITIONAL(HAS_WRITE_STRINGS_WARNING, test x$no_write_strings = xyes)
1528
barte026bd22009-07-04 12:17:07 +00001529# does this compiler support -Wno-empty-body ?
1530
1531AC_MSG_CHECKING([if gcc accepts -Wno-empty-body])
1532
1533safe_CFLAGS=$CFLAGS
1534CFLAGS="-Wno-empty-body"
1535
bart417cf3e2011-10-22 09:21:24 +00001536AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
barte026bd22009-07-04 12:17:07 +00001537 return 0;
bart417cf3e2011-10-22 09:21:24 +00001538]])], [
barte026bd22009-07-04 12:17:07 +00001539AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body])
1540AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001541], [
barte026bd22009-07-04 12:17:07 +00001542AC_SUBST([FLAG_W_NO_EMPTY_BODY], [])
1543AC_MSG_RESULT([no])
1544])
1545CFLAGS=$safe_CFLAGS
1546
1547
bart9d865fa2008-06-23 12:11:49 +00001548# does this compiler support -Wno-format-zero-length ?
1549
1550AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
1551
1552safe_CFLAGS=$CFLAGS
1553CFLAGS="-Wno-format-zero-length"
1554
bart417cf3e2011-10-22 09:21:24 +00001555AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart9d865fa2008-06-23 12:11:49 +00001556 return 0;
bart417cf3e2011-10-22 09:21:24 +00001557]])], [
bart9d865fa2008-06-23 12:11:49 +00001558AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
1559AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001560], [
bart9d865fa2008-06-23 12:11:49 +00001561AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
1562AC_MSG_RESULT([no])
1563])
1564CFLAGS=$safe_CFLAGS
1565
1566
bart8e216312011-05-15 17:05:36 +00001567# does this compiler support -Wno-nonnull ?
1568
1569AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
1570
1571safe_CFLAGS=$CFLAGS
1572CFLAGS="-Wno-nonnull"
1573
bart417cf3e2011-10-22 09:21:24 +00001574AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart8e216312011-05-15 17:05:36 +00001575 return 0;
bart417cf3e2011-10-22 09:21:24 +00001576]])], [
bart8e216312011-05-15 17:05:36 +00001577AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
1578AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001579], [
bart8e216312011-05-15 17:05:36 +00001580AC_SUBST([FLAG_W_NO_NONNULL], [])
1581AC_MSG_RESULT([no])
1582])
1583CFLAGS=$safe_CFLAGS
1584
1585
1586# does this compiler support -Wno-overflow ?
1587
1588AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
1589
1590safe_CFLAGS=$CFLAGS
1591CFLAGS="-Wno-overflow"
1592
bart417cf3e2011-10-22 09:21:24 +00001593AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart8e216312011-05-15 17:05:36 +00001594 return 0;
bart417cf3e2011-10-22 09:21:24 +00001595]])], [
bart8e216312011-05-15 17:05:36 +00001596AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
1597AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001598], [
bart8e216312011-05-15 17:05:36 +00001599AC_SUBST([FLAG_W_NO_OVERFLOW], [])
1600AC_MSG_RESULT([no])
1601])
1602CFLAGS=$safe_CFLAGS
1603
1604
bartbf9b85c2009-08-12 12:55:56 +00001605# does this compiler support -Wno-uninitialized ?
1606
1607AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
1608
1609safe_CFLAGS=$CFLAGS
1610CFLAGS="-Wno-uninitialized"
1611
bart417cf3e2011-10-22 09:21:24 +00001612AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bartbf9b85c2009-08-12 12:55:56 +00001613 return 0;
bart417cf3e2011-10-22 09:21:24 +00001614]])], [
bartbf9b85c2009-08-12 12:55:56 +00001615AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized])
1616AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001617], [
bartbf9b85c2009-08-12 12:55:56 +00001618AC_SUBST([FLAG_W_NO_UNINITIALIZED], [])
1619AC_MSG_RESULT([no])
1620])
1621CFLAGS=$safe_CFLAGS
1622
1623
bart56730cd2008-05-11 06:41:46 +00001624# does this compiler support -Wextra or the older -W ?
1625
1626AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1627
1628safe_CFLAGS=$CFLAGS
1629CFLAGS="-Wextra"
1630
bart417cf3e2011-10-22 09:21:24 +00001631AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001632 return 0;
bart417cf3e2011-10-22 09:21:24 +00001633]])], [
bart56730cd2008-05-11 06:41:46 +00001634AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1635AC_MSG_RESULT([-Wextra])
1636], [
1637 CFLAGS="-W"
sewardj9bdf2a62011-10-27 06:22:23 +00001638 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001639 return 0;
sewardj9bdf2a62011-10-27 06:22:23 +00001640 ]])], [
bart56730cd2008-05-11 06:41:46 +00001641 AC_SUBST([FLAG_W_EXTRA], [-W])
1642 AC_MSG_RESULT([-W])
1643 ], [
1644 AC_SUBST([FLAG_W_EXTRA], [])
1645 AC_MSG_RESULT([not supported])
1646 ])
1647])
1648CFLAGS=$safe_CFLAGS
1649
1650
sewardja72c26d2007-05-01 13:44:08 +00001651# does this compiler support -fno-stack-protector ?
bart56730cd2008-05-11 06:41:46 +00001652AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
sewardja72c26d2007-05-01 13:44:08 +00001653
1654safe_CFLAGS=$CFLAGS
1655CFLAGS="-fno-stack-protector"
1656
bart417cf3e2011-10-22 09:21:24 +00001657AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001658 return 0;
bart417cf3e2011-10-22 09:21:24 +00001659]])], [
sewardja72c26d2007-05-01 13:44:08 +00001660no_stack_protector=yes
1661FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1662AC_MSG_RESULT([yes])
1663], [
1664no_stack_protector=no
1665FLAG_FNO_STACK_PROTECTOR=""
1666AC_MSG_RESULT([no])
1667])
1668CFLAGS=$safe_CFLAGS
1669
1670AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1671
1672if test x$no_stack_protector = xyes; then
1673 CFLAGS="$CFLAGS -fno-stack-protector"
floriand79b3bf2013-10-02 15:14:59 +00001674 CXXFLAGS="$CXXFLAGS -fno-stack-protector"
sewardja72c26d2007-05-01 13:44:08 +00001675fi
1676
1677
bart56730cd2008-05-11 06:41:46 +00001678# does this compiler support --param inline-unit-growth=... ?
1679
1680AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
1681
1682safe_CFLAGS=$CFLAGS
1683CFLAGS="--param inline-unit-growth=900"
1684
bart417cf3e2011-10-22 09:21:24 +00001685AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001686 return 0;
bart417cf3e2011-10-22 09:21:24 +00001687]])], [
bart56730cd2008-05-11 06:41:46 +00001688AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
1689 ["--param inline-unit-growth=900"])
1690AC_MSG_RESULT([yes])
1691], [
1692AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
1693AC_MSG_RESULT([no])
1694])
1695CFLAGS=$safe_CFLAGS
1696
1697
sewardjd9350682012-04-05 07:55:47 +00001698# does this compiler support -gdwarf-4 -fdebug-types-section ?
1699
1700AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
1701
1702safe_CFLAGS=$CFLAGS
1703CFLAGS="-gdwarf-4 -fdebug-types-section"
1704
1705AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1706 return 0;
1707]])], [
1708ac_have_dwarf4=yes
1709AC_MSG_RESULT([yes])
1710], [
1711ac_have_dwarf4=no
1712AC_MSG_RESULT([no])
1713])
1714AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
1715CFLAGS=$safe_CFLAGS
1716
1717
sewardje4bc7032013-03-22 11:49:46 +00001718# We want to use use the -Ttext-segment option to the linker.
1719# GNU (bfd) ld supports this directly. Newer GNU gold linkers
1720# support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
1721# semantics are NOT what we want (GNU gold -Ttext is fine).
1722#
1723# For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
1724# will reside. -Ttext aligns just the .text section start (but not any
1725# other section).
1726#
1727# So test for -Ttext-segment which is supported by all bfd ld versions
1728# and use that if it exists. If it doesn't exist it must be an older
1729# version of gold and we can fall back to using -Ttext which has the
1730# right semantics.
bart699fbac2010-06-08 18:23:59 +00001731
sewardje4bc7032013-03-22 11:49:46 +00001732AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
bart699fbac2010-06-08 18:23:59 +00001733
1734safe_CFLAGS=$CFLAGS
mjw941277a2013-04-17 19:11:05 +00001735CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
bart699fbac2010-06-08 18:23:59 +00001736
bart8508c752010-06-10 06:26:21 +00001737AC_LINK_IFELSE(
mjw941277a2013-04-17 19:11:05 +00001738[AC_LANG_SOURCE([int _start () { return 0; }])],
bart699fbac2010-06-08 18:23:59 +00001739[
tom04ce9f52013-03-28 15:53:21 +00001740 linker_using_t_text="no"
sewardje4bc7032013-03-22 11:49:46 +00001741 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
bart699fbac2010-06-08 18:23:59 +00001742 AC_MSG_RESULT([yes])
1743], [
tom04ce9f52013-03-28 15:53:21 +00001744 linker_using_t_text="yes"
sewardje4bc7032013-03-22 11:49:46 +00001745 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
bart699fbac2010-06-08 18:23:59 +00001746 AC_MSG_RESULT([no])
1747])
1748CFLAGS=$safe_CFLAGS
1749
tom04ce9f52013-03-28 15:53:21 +00001750# If the linker only supports -Ttext (not -Ttext-segment) then we will
1751# have to strip any build-id ELF NOTEs from the staticly linked tools.
1752# Otherwise the build-id NOTE might end up at the default load address.
1753# (Pedantically if the linker is gold then -Ttext is fine, but newer
1754# gold versions also support -Ttext-segment. So just assume that unless
1755# we can use -Ttext-segment we need to strip the build-id NOTEs.
1756if test "x${linker_using_t_text}" == "xyes"; then
1757AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
1758# does the linker support -Wl,--build-id=none ? Note, it's
1759# important that we test indirectly via whichever C compiler
1760# is selected, rather than testing /usr/bin/ld or whatever
1761# directly.
1762AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
1763safe_CFLAGS=$CFLAGS
1764CFLAGS="-Wl,--build-id=none"
1765
1766AC_LINK_IFELSE(
1767[AC_LANG_PROGRAM([ ], [return 0;])],
1768[
1769 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
1770 AC_MSG_RESULT([yes])
1771], [
1772 AC_SUBST([FLAG_NO_BUILD_ID], [""])
1773 AC_MSG_RESULT([no])
1774])
1775else
1776AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.])
1777AC_SUBST([FLAG_NO_BUILD_ID], [""])
1778fi
1779CFLAGS=$safe_CFLAGS
bart699fbac2010-06-08 18:23:59 +00001780
sewardj00f1e622006-03-12 16:47:10 +00001781# does the ppc assembler support "mtocrf" et al?
1782AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
1783
bart417cf3e2011-10-22 09:21:24 +00001784AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjdd4cbe12006-03-12 17:27:44 +00001785__asm__ __volatile__("mtocrf 4,0");
1786__asm__ __volatile__("mfocrf 0,4");
bart417cf3e2011-10-22 09:21:24 +00001787]])], [
sewardj00f1e622006-03-12 16:47:10 +00001788ac_have_as_ppc_mftocrf=yes
1789AC_MSG_RESULT([yes])
1790], [
1791ac_have_as_ppc_mftocrf=no
1792AC_MSG_RESULT([no])
1793])
1794if test x$ac_have_as_ppc_mftocrf = xyes ; then
1795 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
1796fi
1797
1798
carll1e5fa2f2013-08-09 21:55:45 +00001799# does the ppc assembler support "lfdp" and other phased out floating point insns?
1800AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
1801
1802AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1803 do { typedef struct {
1804 double hi;
1805 double lo;
1806 } dbl_pair_t;
1807 dbl_pair_t dbl_pair[3];
1808 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
1809 } while (0)
1810]])], [
1811ac_have_as_ppc_fpPO=yes
1812AC_MSG_RESULT([yes])
1813], [
1814ac_have_as_ppc_fpPO=no
1815AC_MSG_RESULT([no])
1816])
1817if test x$ac_have_as_ppc_fpPO = xyes ; then
1818 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
1819fi
1820
sewardjb5b87402011-03-07 16:05:35 +00001821CFLAGS=$safe_CFLAGS
1822
sewardjf0aabf82007-03-22 00:24:21 +00001823# does the x86/amd64 assembler understand SSE3 instructions?
sewardjfa18a262007-03-22 12:13:13 +00001824# Note, this doesn't generate a C-level symbol. It generates a
1825# automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
sewardjf0aabf82007-03-22 00:24:21 +00001826AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
1827
bart417cf3e2011-10-22 09:21:24 +00001828AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjf0aabf82007-03-22 00:24:21 +00001829 do { long long int x;
1830 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
1831 while (0)
bart417cf3e2011-10-22 09:21:24 +00001832]])], [
sewardjf0aabf82007-03-22 00:24:21 +00001833ac_have_as_sse3=yes
1834AC_MSG_RESULT([yes])
1835], [
1836ac_have_as_sse3=no
1837AC_MSG_RESULT([no])
1838])
sewardjfa18a262007-03-22 12:13:13 +00001839
1840AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
sewardjf0aabf82007-03-22 00:24:21 +00001841
1842
sewardj6d6da5b2008-02-09 12:07:40 +00001843# Ditto for SSSE3 instructions (note extra S)
1844# Note, this doesn't generate a C-level symbol. It generates a
1845# automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
1846AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
1847
florianc443b962011-10-28 21:37:19 +00001848save_CFLAGS="$CFLAGS"
1849CFLAGS="$CFLAGS -msse"
bart417cf3e2011-10-22 09:21:24 +00001850AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardj6d6da5b2008-02-09 12:07:40 +00001851 do { long long int x;
1852 __asm__ __volatile__(
1853 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
1854 while (0)
bart417cf3e2011-10-22 09:21:24 +00001855]])], [
sewardj6d6da5b2008-02-09 12:07:40 +00001856ac_have_as_ssse3=yes
1857AC_MSG_RESULT([yes])
1858], [
1859ac_have_as_ssse3=no
1860AC_MSG_RESULT([no])
1861])
florianc443b962011-10-28 21:37:19 +00001862CFLAGS="$save_CFLAGS"
sewardj6d6da5b2008-02-09 12:07:40 +00001863
1864AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
1865
1866
sewardj27d176a2011-01-17 11:15:48 +00001867# does the x86/amd64 assembler understand the PCLMULQDQ instruction?
1868# Note, this doesn't generate a C-level symbol. It generates a
1869# automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
sewardje3ae8a32010-09-28 19:59:47 +00001870AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
bart417cf3e2011-10-22 09:21:24 +00001871AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardje3ae8a32010-09-28 19:59:47 +00001872 do {
1873 __asm__ __volatile__(
1874 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
1875 while (0)
bart417cf3e2011-10-22 09:21:24 +00001876]])], [
sewardje3ae8a32010-09-28 19:59:47 +00001877ac_have_as_pclmulqdq=yes
1878AC_MSG_RESULT([yes])
1879], [
1880ac_have_as_pclmulqdq=no
1881AC_MSG_RESULT([no])
1882])
1883
1884AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
1885
1886
bart9bbe2bb2012-08-03 19:37:02 +00001887# does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
1888# Note, this doesn't generate a C-level symbol. It generates a
1889# automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
1890AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
1891AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1892 do {
1893 /*
1894 * Carry-less multiplication of xmm1 with xmm2 and store the result in
1895 * xmm3. The immediate is used to determine which quadwords of xmm1 and
1896 * xmm2 should be used.
1897 */
1898 __asm__ __volatile__(
1899 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
1900 } while (0)
1901]])], [
1902ac_have_as_vpclmulqdq=yes
1903AC_MSG_RESULT([yes])
1904], [
1905ac_have_as_vpclmulqdq=no
1906AC_MSG_RESULT([no])
1907])
1908
1909AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
1910
1911
sewardj27d176a2011-01-17 11:15:48 +00001912# does the x86/amd64 assembler understand the LZCNT instruction?
1913# Note, this doesn't generate a C-level symbol. It generates a
1914# automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
bart55e438b2010-09-14 10:53:57 +00001915AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
1916
bart417cf3e2011-10-22 09:21:24 +00001917AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
bart55e438b2010-09-14 10:53:57 +00001918 do {
sewardjc62291c2012-07-22 11:10:08 +00001919 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
bart55e438b2010-09-14 10:53:57 +00001920 } while (0)
bart417cf3e2011-10-22 09:21:24 +00001921]])], [
bart55e438b2010-09-14 10:53:57 +00001922 ac_have_as_lzcnt=yes
1923 AC_MSG_RESULT([yes])
1924], [
1925 ac_have_as_lzcnt=no
1926 AC_MSG_RESULT([no])
1927])
1928
1929AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
1930
sewardj27d176a2011-01-17 11:15:48 +00001931
1932# does the x86/amd64 assembler understand SSE 4.2 instructions?
1933# Note, this doesn't generate a C-level symbol. It generates a
1934# automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
1935AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
1936
bart417cf3e2011-10-22 09:21:24 +00001937AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardj27d176a2011-01-17 11:15:48 +00001938 do { long long int x;
1939 __asm__ __volatile__(
florianfdfca222012-01-17 13:16:50 +00001940 "crc32q %%r15,%%r15" : : : "r15" );
1941 __asm__ __volatile__(
sewardjc62291c2012-07-22 11:10:08 +00001942 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
1943 __asm__ __volatile__(
1944 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
sewardj27d176a2011-01-17 11:15:48 +00001945 while (0)
bart417cf3e2011-10-22 09:21:24 +00001946]])], [
sewardj27d176a2011-01-17 11:15:48 +00001947ac_have_as_sse42=yes
1948AC_MSG_RESULT([yes])
1949], [
1950ac_have_as_sse42=no
1951AC_MSG_RESULT([no])
1952])
1953
1954AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
1955
1956
sewardj9fb31ca2012-06-05 00:31:49 +00001957# does the x86/amd64 assembler understand AVX instructions?
1958# Note, this doesn't generate a C-level symbol. It generates a
1959# automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
1960AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
1961
1962AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1963 do { long long int x;
1964 __asm__ __volatile__(
1965 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
1966 __asm__ __volatile__(
1967 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
1968 while (0)
1969]])], [
1970ac_have_as_avx=yes
1971AC_MSG_RESULT([yes])
1972], [
1973ac_have_as_avx=no
1974AC_MSG_RESULT([no])
1975])
1976
1977AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
1978
1979
sewardjfda50af2013-03-27 11:43:20 +00001980# does the x86/amd64 assembler understand AVX2 instructions?
1981# Note, this doesn't generate a C-level symbol. It generates a
1982# automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
1983AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
1984
1985AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1986 do { long long int x;
1987 __asm__ __volatile__(
1988 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
1989 __asm__ __volatile__(
1990 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
1991 while (0)
1992]])], [
1993ac_have_as_avx2=yes
1994AC_MSG_RESULT([yes])
1995], [
1996ac_have_as_avx2=no
1997AC_MSG_RESULT([no])
1998])
1999
2000AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
2001
2002
florian364c3652013-09-30 16:32:53 +00002003# does the x86/amd64 assembler understand TSX instructions?
2004# Note, this doesn't generate a C-level symbol. It generates a
2005# automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
2006AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
2007
2008AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2009 do {
2010 __asm__ __volatile__(
2011 " xbegin Lfoo \n\t"
2012 "Lfoo: xend \n\t");
2013 } while (0)
2014]])], [
2015ac_have_as_tsx=yes
2016AC_MSG_RESULT([yes])
2017], [
2018ac_have_as_tsx=no
2019AC_MSG_RESULT([no])
2020])
2021
2022AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
2023
2024
sewardjfda50af2013-03-27 11:43:20 +00002025# does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
2026# Note, this doesn't generate a C-level symbol. It generates a
2027# automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
2028AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
2029
2030AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2031 do { unsigned int h, l;
2032 __asm__ __volatile__(
sewardje222efc2013-03-27 21:59:21 +00002033 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
sewardjfda50af2013-03-27 11:43:20 +00002034 __asm__ __volatile__(
sewardje222efc2013-03-27 21:59:21 +00002035 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
sewardjfda50af2013-03-27 11:43:20 +00002036 while (0)
2037]])], [
2038ac_have_as_bmi=yes
2039AC_MSG_RESULT([yes])
2040], [
2041ac_have_as_bmi=no
2042AC_MSG_RESULT([no])
2043])
2044
2045AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
2046
2047
2048# does the x86/amd64 assembler understand FMA instructions?
2049# Note, this doesn't generate a C-level symbol. It generates a
2050# automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
2051AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
2052
2053AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2054 do { unsigned int h, l;
2055 __asm__ __volatile__(
2056 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
2057 __asm__ __volatile__(
2058 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
2059 __asm__ __volatile__(
2060 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
2061 while (0)
2062]])], [
2063ac_have_as_fma=yes
2064AC_MSG_RESULT([yes])
2065], [
2066ac_have_as_fma=no
2067AC_MSG_RESULT([no])
2068])
2069
2070AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
2071
2072
sewardjb08d84d2012-07-16 08:23:26 +00002073# does the x86/amd64 assembler understand MOVBE?
2074# Note, this doesn't generate a C-level symbol. It generates a
2075# automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
2076AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
2077
2078AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2079 do { long long int x;
2080 __asm__ __volatile__(
sewardjc62291c2012-07-22 11:10:08 +00002081 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
sewardjb08d84d2012-07-16 08:23:26 +00002082 while (0)
2083]])], [
2084ac_have_as_movbe=yes
2085AC_MSG_RESULT([yes])
2086], [
2087ac_have_as_movbe=no
2088AC_MSG_RESULT([no])
2089])
2090
2091AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
2092
2093
florian251c2f92012-07-05 21:21:37 +00002094# Does the C compiler support the "ifunc" attribute
2095# Note, this doesn't generate a C-level symbol. It generates a
2096# automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
2097AC_MSG_CHECKING([if gcc supports the ifunc attribute])
2098
florianf78a5032012-07-06 09:17:29 +00002099AC_LINK_IFELSE([AC_LANG_SOURCE([[
2100static void mytest(void) {}
2101
2102static void (*resolve_test(void))(void)
2103{
2104 return (void (*)(void))&mytest;
2105}
2106
2107void test(void) __attribute__((ifunc("resolve_test")));
2108
2109int main()
2110{
2111 test();
2112 return 0;
2113}
florian251c2f92012-07-05 21:21:37 +00002114]])], [
2115ac_have_ifunc_attr=yes
2116AC_MSG_RESULT([yes])
2117], [
2118ac_have_ifunc_attr=no
2119AC_MSG_RESULT([no])
2120])
2121
2122AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
2123
2124
sewardje089f012010-10-13 21:47:29 +00002125# XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
2126# when building the tool executables. I think we should get rid of it.
2127#
sewardjb5f6f512005-03-10 23:59:00 +00002128# Check for TLS support in the compiler and linker
bart2bd9a682011-10-22 09:46:16 +00002129AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
2130 [[return foo;]])],
2131 [vg_cv_linktime_tls=yes],
2132 [vg_cv_linktime_tls=no])
bartca9f2ad2008-06-02 07:14:20 +00002133# Native compilation: check whether running a program using TLS succeeds.
2134# Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
2135# succeeds but running programs using TLS fails.
bart2bd9a682011-10-22 09:46:16 +00002136# Cross-compiling: check whether linking a program using TLS succeeds.
bartca9f2ad2008-06-02 07:14:20 +00002137AC_CACHE_CHECK([for TLS support], vg_cv_tls,
2138 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
2139 [vg_cv_tls=$enableval],
2140 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
2141 [[return foo;]])],
2142 [vg_cv_tls=yes],
bart2bd9a682011-10-22 09:46:16 +00002143 [vg_cv_tls=no],
2144 [vg_cv_tls=$vg_cv_linktime_tls])])])
sewardjb5f6f512005-03-10 23:59:00 +00002145
2146if test "$vg_cv_tls" = yes; then
2147AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
2148fi
sewardj5b754b42002-06-03 22:53:35 +00002149
sewardj535c50f2005-06-04 23:14:53 +00002150
njn7fd6d382009-01-22 21:56:32 +00002151#----------------------------------------------------------------------------
bart62f54e42008-07-28 11:35:10 +00002152# Checks for C header files.
njn7fd6d382009-01-22 21:56:32 +00002153#----------------------------------------------------------------------------
2154
sewardjde4a1d02002-03-22 01:27:54 +00002155AC_HEADER_STDC
bartf5ceec82008-04-26 07:45:10 +00002156AC_CHECK_HEADERS([ \
bart1f2b1432009-01-16 12:06:54 +00002157 asm/unistd.h \
bartf5ceec82008-04-26 07:45:10 +00002158 endian.h \
2159 mqueue.h \
2160 sys/endian.h \
2161 sys/epoll.h \
2162 sys/eventfd.h \
bartce48fa92008-04-26 10:59:46 +00002163 sys/klog.h \
bartf5ceec82008-04-26 07:45:10 +00002164 sys/poll.h \
bart71bad292008-04-27 11:43:23 +00002165 sys/signal.h \
bartf5ceec82008-04-26 07:45:10 +00002166 sys/signalfd.h \
bart71bad292008-04-27 11:43:23 +00002167 sys/syscall.h \
2168 sys/time.h \
2169 sys/types.h \
bartf5ceec82008-04-26 07:45:10 +00002170 ])
sewardjde4a1d02002-03-22 01:27:54 +00002171
bart818f17e2011-09-17 06:24:49 +00002172# Verify whether the <linux/futex.h> header is usable.
2173AC_MSG_CHECKING([if <linux/futex.h> is usable])
2174
sewardjc12486b2012-12-17 14:46:48 +00002175save_CFLAGS="$CFLAGS"
2176CFLAGS="$CFLAGS -D__user="
bart417cf3e2011-10-22 09:21:24 +00002177AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart818f17e2011-09-17 06:24:49 +00002178#include <linux/futex.h>
bart417cf3e2011-10-22 09:21:24 +00002179]], [[
bart818f17e2011-09-17 06:24:49 +00002180 return FUTEX_WAIT;
bart417cf3e2011-10-22 09:21:24 +00002181]])], [
bart78bfc712011-12-08 16:14:59 +00002182ac_have_usable_linux_futex_h=yes
bart818f17e2011-09-17 06:24:49 +00002183AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
2184 [Define to 1 if you have a usable <linux/futex.h> header file.])
2185AC_MSG_RESULT([yes])
2186], [
bart78bfc712011-12-08 16:14:59 +00002187ac_have_usable_linux_futex_h=no
bart818f17e2011-09-17 06:24:49 +00002188AC_MSG_RESULT([no])
2189])
sewardjc12486b2012-12-17 14:46:48 +00002190CFLAGS="$save_CFLAGS"
2191
bart818f17e2011-09-17 06:24:49 +00002192
njn7fd6d382009-01-22 21:56:32 +00002193#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002194# Checks for typedefs, structures, and compiler characteristics.
njn7fd6d382009-01-22 21:56:32 +00002195#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002196AC_TYPE_UID_T
2197AC_TYPE_OFF_T
2198AC_TYPE_SIZE_T
2199AC_HEADER_TIME
2200
sewardj535c50f2005-06-04 23:14:53 +00002201
njn7fd6d382009-01-22 21:56:32 +00002202#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002203# Checks for library functions.
njn7fd6d382009-01-22 21:56:32 +00002204#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002205AC_FUNC_MEMCMP
2206AC_FUNC_MMAP
sewardjde4a1d02002-03-22 01:27:54 +00002207
bart26288e42011-04-03 16:46:01 +00002208AC_CHECK_LIB([pthread], [pthread_create])
bart71bad292008-04-27 11:43:23 +00002209AC_CHECK_LIB([rt], [clock_gettime])
bart41ac62a2008-07-07 16:58:03 +00002210
bartf5ceec82008-04-26 07:45:10 +00002211AC_CHECK_FUNCS([ \
bart71bad292008-04-27 11:43:23 +00002212 clock_gettime\
bartf5ceec82008-04-26 07:45:10 +00002213 epoll_create \
2214 epoll_pwait \
bartce48fa92008-04-26 10:59:46 +00002215 klogctl \
bartf5ceec82008-04-26 07:45:10 +00002216 mallinfo \
2217 memchr \
2218 memset \
2219 mkdir \
njnf76d27a2009-05-28 01:53:07 +00002220 mremap \
bartf5ceec82008-04-26 07:45:10 +00002221 ppoll \
bart6d45e922009-01-20 13:45:38 +00002222 pthread_barrier_init \
2223 pthread_condattr_setclock \
2224 pthread_mutex_timedlock \
2225 pthread_rwlock_timedrdlock \
2226 pthread_rwlock_timedwrlock \
2227 pthread_spin_lock \
barta72a27b2010-04-29 06:22:17 +00002228 pthread_yield \
florianc5325ef2013-09-17 20:15:36 +00002229 pthread_setname_np \
bartd1f724c2009-08-26 18:11:18 +00002230 readlinkat \
bartf5ceec82008-04-26 07:45:10 +00002231 semtimedop \
2232 signalfd \
njn6cc22472009-03-16 03:46:48 +00002233 sigwaitinfo \
bartf5ceec82008-04-26 07:45:10 +00002234 strchr \
2235 strdup \
2236 strpbrk \
2237 strrchr \
2238 strstr \
barta72a27b2010-04-29 06:22:17 +00002239 syscall \
bartf5ceec82008-04-26 07:45:10 +00002240 utimensat \
tom9e4b6362012-02-10 09:39:37 +00002241 process_vm_readv \
2242 process_vm_writev \
bartf5ceec82008-04-26 07:45:10 +00002243 ])
sewardjde4a1d02002-03-22 01:27:54 +00002244
bart623eec32008-07-29 17:54:49 +00002245# AC_CHECK_LIB adds any library found to the variable LIBS, and links these
2246# libraries with any shared object and/or executable. This is NOT what we
2247# want for e.g. vgpreload_core-x86-linux.so
2248LIBS=""
sewardj80637752006-03-02 13:48:21 +00002249
bart6d45e922009-01-20 13:45:38 +00002250AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
2251 [test x$ac_cv_func_pthread_barrier_init = xyes])
bart2eaa8f22009-01-20 14:01:16 +00002252AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
2253 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
bart6d45e922009-01-20 13:45:38 +00002254AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
2255 [test x$ac_cv_func_pthread_spin_lock = xyes])
florianc5325ef2013-09-17 20:15:36 +00002256AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
2257 [test x$ac_cv_func_pthread_setname_np = xyes])
bart6d45e922009-01-20 13:45:38 +00002258
petarjc37cea62013-06-02 18:08:04 +00002259if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
2260 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then
petarj6d79b742012-12-20 18:56:57 +00002261 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
petarjc37cea62013-06-02 18:08:04 +00002262 [Disable intercept pthread_spin_lock() on MIPS32 and MIPS64.])
petarj6d79b742012-12-20 18:56:57 +00002263fi
njn7fd6d382009-01-22 21:56:32 +00002264
2265#----------------------------------------------------------------------------
2266# MPI checks
2267#----------------------------------------------------------------------------
sewardj03d86f22006-10-17 00:57:24 +00002268# Do we have a useable MPI setup on the primary and/or secondary targets?
2269# On Linux, by default, assumes mpicc and -m32/-m64
sewardje9fa5062006-03-12 18:29:18 +00002270# Note: this is a kludge in that it assumes the specified mpicc
sewardj6e9de462011-06-28 07:25:29 +00002271# understands -m32/-m64 regardless of what is specified using
sewardj03d86f22006-10-17 00:57:24 +00002272# --with-mpicc=.
sewardj0ad46092006-03-02 17:09:16 +00002273MPI_CC="mpicc"
sewardj03d86f22006-10-17 00:57:24 +00002274
sewardje9fa5062006-03-12 18:29:18 +00002275mflag_primary=
njn7fd6d382009-01-22 21:56:32 +00002276if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
sewardj6e9de462011-06-28 07:25:29 +00002277 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj5db15402012-06-07 09:13:21 +00002278 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
petarj4df0bfc2013-02-27 23:17:33 +00002279 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
2280 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then
sewardje9fa5062006-03-12 18:29:18 +00002281 mflag_primary=$FLAG_M32
njn7fd6d382009-01-22 21:56:32 +00002282elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
sewardjb5b87402011-03-07 16:05:35 +00002283 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
2284 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
sewardje9fa5062006-03-12 18:29:18 +00002285 mflag_primary=$FLAG_M64
philippef7c54332012-05-17 15:32:54 +00002286elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
2287 mflag_primary="$FLAG_M32 -arch i386"
2288elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
2289 mflag_primary="$FLAG_M64 -arch x86_64"
sewardje9fa5062006-03-12 18:29:18 +00002290fi
2291
sewardj03d86f22006-10-17 00:57:24 +00002292mflag_secondary=
njn7fd6d382009-01-22 21:56:32 +00002293if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
2294 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then
sewardj03d86f22006-10-17 00:57:24 +00002295 mflag_secondary=$FLAG_M32
philippef7c54332012-05-17 15:32:54 +00002296elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
2297 mflag_secondary="$FLAG_M32 -arch i386"
sewardj03d86f22006-10-17 00:57:24 +00002298fi
2299
2300
sewardj0ad46092006-03-02 17:09:16 +00002301AC_ARG_WITH(mpicc,
sewardjb70a6132006-05-27 21:14:09 +00002302 [ --with-mpicc= Specify name of MPI2-ised C compiler],
sewardj0ad46092006-03-02 17:09:16 +00002303 MPI_CC=$withval
2304)
sewardj03d86f22006-10-17 00:57:24 +00002305AC_SUBST(MPI_CC)
2306
philippef7c54332012-05-17 15:32:54 +00002307## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
2308## use these values in the check for a functioning mpicc.
2309##
2310## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
2311## mflag_primary/mflag_secondary are sufficient approximations of that behavior
2312AM_COND_IF([VGCONF_OS_IS_LINUX],
2313 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
2314 LDFLAGS_MPI="-fpic -shared"])
2315AM_COND_IF([VGCONF_OS_IS_DARWIN],
2316 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
2317 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
2318
2319AC_SUBST([CFLAGS_MPI])
2320AC_SUBST([LDFLAGS_MPI])
2321
2322
sewardj03d86f22006-10-17 00:57:24 +00002323## See if MPI_CC works for the primary target
2324##
2325AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
sewardj0ad46092006-03-02 17:09:16 +00002326saved_CC=$CC
sewardjde4f3842006-03-09 02:41:41 +00002327saved_CFLAGS=$CFLAGS
sewardj0ad46092006-03-02 17:09:16 +00002328CC=$MPI_CC
philippef7c54332012-05-17 15:32:54 +00002329CFLAGS="$CFLAGS_MPI $mflag_primary"
2330saved_LDFLAGS="$LDFLAGS"
2331LDFLAGS="$LDFLAGS_MPI $mflag_primary"
bart417cf3e2011-10-22 09:21:24 +00002332AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sewardj1a85e602006-03-08 15:26:10 +00002333#include <mpi.h>
2334#include <stdio.h>
bart417cf3e2011-10-22 09:21:24 +00002335]], [[
philippef7c54332012-05-17 15:32:54 +00002336 int ni, na, nd, comb;
sewardjde4f3842006-03-09 02:41:41 +00002337 int r = MPI_Init(NULL,NULL);
philippef7c54332012-05-17 15:32:54 +00002338 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
2339 r |= MPI_Finalize();
sewardjde4f3842006-03-09 02:41:41 +00002340 return r;
bart417cf3e2011-10-22 09:21:24 +00002341]])], [
sewardj03d86f22006-10-17 00:57:24 +00002342ac_have_mpi2_pri=yes
sewardj1a85e602006-03-08 15:26:10 +00002343AC_MSG_RESULT([yes, $MPI_CC])
sewardj80637752006-03-02 13:48:21 +00002344], [
sewardj03d86f22006-10-17 00:57:24 +00002345ac_have_mpi2_pri=no
sewardj80637752006-03-02 13:48:21 +00002346AC_MSG_RESULT([no])
2347])
sewardj0ad46092006-03-02 17:09:16 +00002348CC=$saved_CC
sewardjde4f3842006-03-09 02:41:41 +00002349CFLAGS=$saved_CFLAGS
philippef7c54332012-05-17 15:32:54 +00002350LDFLAGS="$saved_LDFLAGS"
sewardj03d86f22006-10-17 00:57:24 +00002351AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
sewardj80637752006-03-02 13:48:21 +00002352
sewardj03d86f22006-10-17 00:57:24 +00002353## See if MPI_CC works for the secondary target. Complication: what if
2354## there is no secondary target? We need this to then fail.
2355## Kludge this by making MPI_CC something which will surely fail in
2356## such a case.
2357##
2358AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
2359saved_CC=$CC
2360saved_CFLAGS=$CFLAGS
philippef7c54332012-05-17 15:32:54 +00002361saved_LDFLAGS="$LDFLAGS"
2362LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
njn7fd6d382009-01-22 21:56:32 +00002363if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
sewardj03d86f22006-10-17 00:57:24 +00002364 CC="$MPI_CC this will surely fail"
2365else
2366 CC=$MPI_CC
2367fi
philippef7c54332012-05-17 15:32:54 +00002368CFLAGS="$CFLAGS_MPI $mflag_secondary"
bart417cf3e2011-10-22 09:21:24 +00002369AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sewardj03d86f22006-10-17 00:57:24 +00002370#include <mpi.h>
2371#include <stdio.h>
bart417cf3e2011-10-22 09:21:24 +00002372]], [[
philippef7c54332012-05-17 15:32:54 +00002373 int ni, na, nd, comb;
sewardj03d86f22006-10-17 00:57:24 +00002374 int r = MPI_Init(NULL,NULL);
philippef7c54332012-05-17 15:32:54 +00002375 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
2376 r |= MPI_Finalize();
sewardj03d86f22006-10-17 00:57:24 +00002377 return r;
bart417cf3e2011-10-22 09:21:24 +00002378]])], [
sewardj03d86f22006-10-17 00:57:24 +00002379ac_have_mpi2_sec=yes
2380AC_MSG_RESULT([yes, $MPI_CC])
2381], [
2382ac_have_mpi2_sec=no
2383AC_MSG_RESULT([no])
2384])
2385CC=$saved_CC
2386CFLAGS=$saved_CFLAGS
philippef7c54332012-05-17 15:32:54 +00002387LDFLAGS="$saved_LDFLAGS"
sewardj03d86f22006-10-17 00:57:24 +00002388AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
sewardj80637752006-03-02 13:48:21 +00002389
2390
njn7fd6d382009-01-22 21:56:32 +00002391#----------------------------------------------------------------------------
2392# Other library checks
2393#----------------------------------------------------------------------------
bart2ef12d42010-10-18 16:32:11 +00002394# There now follow some tests for Boost, and OpenMP. These
sewardj493c4ef2008-12-13 16:45:19 +00002395# tests are present because Drd has some regression tests that use
2396# these packages. All regression test programs all compiled only
2397# for the primary target. And so it is important that the configure
2398# checks that follow, use the correct -m32 or -m64 flag for the
2399# primary target (called $mflag_primary). Otherwise, we can end up
2400# in a situation (eg) where, on amd64-linux, the test for Boost checks
2401# for usable 64-bit Boost facilities, but because we are doing a 32-bit
2402# only build (meaning, the primary target is x86-linux), the build
2403# of the regtest programs that use Boost fails, because they are
2404# build as 32-bit (IN THIS EXAMPLE).
2405#
2406# Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
2407# NEEDED BY THE REGRESSION TEST PROGRAMS.
2408
2409
sewardj493c4ef2008-12-13 16:45:19 +00002410# Check whether the boost library 1.35 or later has been installed.
2411# The Boost.Threads library has undergone a major rewrite in version 1.35.0.
2412
2413AC_MSG_CHECKING([for boost])
2414
2415AC_LANG(C++)
2416safe_CXXFLAGS=$CXXFLAGS
bart7129c722012-04-18 18:34:22 +00002417CXXFLAGS="$mflag_primary"
2418safe_LIBS="$LIBS"
2419LIBS="-lboost_thread-mt $LIBS"
sewardj493c4ef2008-12-13 16:45:19 +00002420
bart128fc522011-03-12 10:36:35 +00002421AC_LINK_IFELSE([AC_LANG_SOURCE([
sewardj493c4ef2008-12-13 16:45:19 +00002422#include <boost/thread.hpp>
2423static void thread_func(void)
2424{ }
2425int main(int argc, char** argv)
2426{
2427 boost::thread t(thread_func);
2428 return 0;
2429}
bart128fc522011-03-12 10:36:35 +00002430])],
sewardj493c4ef2008-12-13 16:45:19 +00002431[
2432ac_have_boost_1_35=yes
2433AC_SUBST([BOOST_CFLAGS], [])
bartbb31f2d2012-04-18 18:42:34 +00002434AC_SUBST([BOOST_LIBS], [-lboost_thread-mt])
sewardj493c4ef2008-12-13 16:45:19 +00002435AC_MSG_RESULT([yes])
2436], [
2437ac_have_boost_1_35=no
2438AC_MSG_RESULT([no])
2439])
2440
bart7129c722012-04-18 18:34:22 +00002441LIBS="$safe_LIBS"
sewardj493c4ef2008-12-13 16:45:19 +00002442CXXFLAGS=$safe_CXXFLAGS
2443AC_LANG(C)
2444
2445AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
2446
2447
2448# does this compiler support -fopenmp, does it have the include file
2449# <omp.h> and does it have libgomp ?
2450
2451AC_MSG_CHECKING([for OpenMP])
2452
2453safe_CFLAGS=$CFLAGS
sewardjc876a2f2009-01-22 22:44:30 +00002454CFLAGS="-fopenmp $mflag_primary"
sewardj493c4ef2008-12-13 16:45:19 +00002455
bart128fc522011-03-12 10:36:35 +00002456AC_LINK_IFELSE([AC_LANG_SOURCE([
sewardj493c4ef2008-12-13 16:45:19 +00002457#include <omp.h>
2458int main(int argc, char** argv)
2459{
2460 omp_set_dynamic(0);
2461 return 0;
2462}
bart128fc522011-03-12 10:36:35 +00002463])],
sewardj493c4ef2008-12-13 16:45:19 +00002464[
2465ac_have_openmp=yes
2466AC_MSG_RESULT([yes])
2467], [
2468ac_have_openmp=no
2469AC_MSG_RESULT([no])
2470])
2471CFLAGS=$safe_CFLAGS
2472
2473AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
2474
2475
bart78bfc712011-12-08 16:14:59 +00002476# does this compiler have built-in functions for atomic memory access for the
2477# primary target ?
2478AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
sewardjc876a2f2009-01-22 22:44:30 +00002479
2480safe_CFLAGS=$CFLAGS
2481CFLAGS="$mflag_primary"
2482
bart417cf3e2011-10-22 09:21:24 +00002483AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjc876a2f2009-01-22 22:44:30 +00002484 int variable = 1;
2485 return (__sync_bool_compare_and_swap(&variable, 1, 2)
2486 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
bart417cf3e2011-10-22 09:21:24 +00002487]])], [
bartb4ff7822011-12-10 19:48:04 +00002488 ac_have_builtin_atomic_primary=yes
sewardjc876a2f2009-01-22 22:44:30 +00002489 AC_MSG_RESULT([yes])
bart78bfc712011-12-08 16:14:59 +00002490 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])
bart417cf3e2011-10-22 09:21:24 +00002491], [
bartb4ff7822011-12-10 19:48:04 +00002492 ac_have_builtin_atomic_primary=no
sewardjc876a2f2009-01-22 22:44:30 +00002493 AC_MSG_RESULT([no])
2494])
2495
2496CFLAGS=$safe_CFLAGS
2497
bartb4ff7822011-12-10 19:48:04 +00002498AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
2499 [test x$ac_have_builtin_atomic_primary = xyes])
bartc82d1372009-05-31 16:21:23 +00002500
bart78bfc712011-12-08 16:14:59 +00002501
2502# does this compiler have built-in functions for atomic memory access for the
2503# secondary target ?
2504
2505if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
2506
2507AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
2508
2509safe_CFLAGS=$CFLAGS
2510CFLAGS="$mflag_secondary"
2511
2512AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2513 int variable = 1;
2514 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
2515]])], [
2516 ac_have_builtin_atomic_secondary=yes
2517 AC_MSG_RESULT([yes])
2518], [
2519 ac_have_builtin_atomic_secondary=no
2520 AC_MSG_RESULT([no])
2521])
2522
2523CFLAGS=$safe_CFLAGS
2524
2525fi
2526
2527AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
2528 [test x$ac_have_builtin_atomic_secondary = xyes])
2529
bart1e856ea2011-12-17 12:53:23 +00002530# does this compiler have built-in functions for atomic memory access on
2531# 64-bit integers for all targets ?
2532
2533AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
2534
2535AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2536 #include <stdint.h>
2537]], [[
2538 uint64_t variable = 1;
2539 return __sync_add_and_fetch(&variable, 1)
2540]])], [
2541 ac_have_builtin_atomic64_primary=yes
2542], [
2543 ac_have_builtin_atomic64_primary=no
2544])
2545
2546if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
2547
2548safe_CFLAGS=$CFLAGS
2549CFLAGS="$mflag_secondary"
2550
2551AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2552 #include <stdint.h>
2553]], [[
2554 uint64_t variable = 1;
2555 return __sync_add_and_fetch(&variable, 1)
2556]])], [
2557 ac_have_builtin_atomic64_secondary=yes
2558], [
2559 ac_have_builtin_atomic64_secondary=no
2560])
2561
2562CFLAGS=$safe_CFLAGS
2563
2564fi
2565
2566if test x$ac_have_builtin_atomic64_primary = xyes && \
2567 test x$VGCONF_PLATFORM_SEC_CAPS = x \
2568 -o x$ac_have_builtin_atomic64_secondary = xyes; then
2569 AC_MSG_RESULT([yes])
2570 ac_have_builtin_atomic64=yes
2571else
2572 AC_MSG_RESULT([no])
2573 ac_have_builtin_atomic64=no
2574fi
2575
2576AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
2577 [test x$ac_have_builtin_atomic64 = xyes])
2578
bart78bfc712011-12-08 16:14:59 +00002579
barte8740422011-03-24 20:27:54 +00002580# does g++ have built-in functions for atomic memory access ?
bart78bfc712011-12-08 16:14:59 +00002581AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
barte8740422011-03-24 20:27:54 +00002582
2583safe_CXXFLAGS=$CXXFLAGS
2584CXXFLAGS="$mflag_primary"
2585
2586AC_LANG_PUSH(C++)
bart417cf3e2011-10-22 09:21:24 +00002587AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
barte8740422011-03-24 20:27:54 +00002588 int variable = 1;
2589 return (__sync_bool_compare_and_swap(&variable, 1, 2)
2590 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
bart417cf3e2011-10-22 09:21:24 +00002591]])], [
barte8740422011-03-24 20:27:54 +00002592 ac_have_builtin_atomic_cxx=yes
2593 AC_MSG_RESULT([yes])
2594 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
bart417cf3e2011-10-22 09:21:24 +00002595], [
barte8740422011-03-24 20:27:54 +00002596 ac_have_builtin_atomic_cxx=no
2597 AC_MSG_RESULT([no])
2598])
2599AC_LANG_POP(C++)
2600
2601CXXFLAGS=$safe_CXXFLAGS
2602
2603AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
sewardjc876a2f2009-01-22 22:44:30 +00002604
bart78bfc712011-12-08 16:14:59 +00002605
2606if test x$ac_have_usable_linux_futex_h = xyes \
bartb4ff7822011-12-10 19:48:04 +00002607 -a x$ac_have_builtin_atomic_primary = xyes; then
bart78bfc712011-12-08 16:14:59 +00002608 ac_enable_linux_ticket_lock_primary=yes
2609fi
2610AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
2611 [test x$ac_enable_linux_ticket_lock_primary = xyes])
2612
2613if test x$VGCONF_PLATFORM_SEC_CAPS != x \
2614 -a x$ac_have_usable_linux_futex_h = xyes \
2615 -a x$ac_have_builtin_atomic_secondary = xyes; then
2616 ac_enable_linux_ticket_lock_secondary=yes
2617fi
2618AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
2619 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
2620
2621
bartf68af882011-12-10 19:42:05 +00002622# does libstdc++ support annotating shared pointers ?
2623AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
2624
floriand79b3bf2013-10-02 15:14:59 +00002625safe_CXXFLAGS=$CXXFLAGS
bartf68af882011-12-10 19:42:05 +00002626CXXFLAGS="-std=c++0x"
2627
2628AC_LANG_PUSH(C++)
2629AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2630 #include <memory>
2631]], [[
2632 std::shared_ptr<int> p
2633]])], [
2634 ac_have_shared_ptr=yes
2635], [
2636 ac_have_shared_ptr=no
2637])
2638if test x$ac_have_shared_ptr = xyes; then
2639 # If compilation of the program below fails because of a syntax error
2640 # triggered by substituting one of the annotation macros then that
2641 # means that libstdc++ supports these macros.
2642 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2643 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
2644 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
2645 #include <memory>
2646 ]], [[
2647 std::shared_ptr<int> p
2648 ]])], [
2649 ac_have_shared_pointer_annotation=no
2650 AC_MSG_RESULT([no])
2651 ], [
2652 ac_have_shared_pointer_annotation=yes
2653 AC_MSG_RESULT([yes])
2654 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
2655 [Define to 1 if libstd++ supports annotating shared pointers])
2656 ])
2657else
2658 ac_have_shared_pointer_annotation=no
2659 AC_MSG_RESULT([no])
2660fi
2661AC_LANG_POP(C++)
2662
2663CXXFLAGS=$safe_CXXFLAGS
2664
2665AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
2666 [test x$ac_have_shared_pointer_annotation = xyes])
2667
2668
njn7fd6d382009-01-22 21:56:32 +00002669#----------------------------------------------------------------------------
2670# Ok. We're done checking.
2671#----------------------------------------------------------------------------
sewardj80637752006-03-02 13:48:21 +00002672
njn8b68b642009-06-24 00:37:09 +00002673# Nb: VEX/Makefile is generated from Makefile.vex.in.
2674AC_CONFIG_FILES([
sewardjde4a1d02002-03-22 01:27:54 +00002675 Makefile
njn8b68b642009-06-24 00:37:09 +00002676 VEX/Makefile:Makefile.vex.in
njn25cac76cb2002-09-23 11:21:57 +00002677 valgrind.spec
muellerbddd6072003-11-19 21:50:07 +00002678 valgrind.pc
dirk07596a22008-04-25 11:33:30 +00002679 glibc-2.X.supp
njn254d542432002-09-23 16:09:39 +00002680 docs/Makefile
2681 tests/Makefile
njnc2e7f482002-09-27 08:44:17 +00002682 tests/vg_regtest
njnec0c27a2005-12-10 23:11:28 +00002683 perf/Makefile
2684 perf/vg_perf
sewardj3b290482011-05-06 21:02:55 +00002685 gdbserver_tests/Makefile
njn254d542432002-09-23 16:09:39 +00002686 include/Makefile
njn7a6e7462002-11-09 17:53:30 +00002687 auxprogs/Makefile
njn8b68b642009-06-24 00:37:09 +00002688 mpi/Makefile
njn25ab726032002-09-23 16:24:41 +00002689 coregrind/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002690 memcheck/Makefile
2691 memcheck/tests/Makefile
floriane42cca52013-08-29 17:59:27 +00002692 memcheck/tests/common/Makefile
njnc6168192004-11-29 13:54:10 +00002693 memcheck/tests/amd64/Makefile
njnc6168192004-11-29 13:54:10 +00002694 memcheck/tests/x86/Makefile
njn3b3b76d2009-01-19 03:44:19 +00002695 memcheck/tests/linux/Makefile
njnf76d27a2009-05-28 01:53:07 +00002696 memcheck/tests/darwin/Makefile
njnea2d6fd2010-07-01 00:20:20 +00002697 memcheck/tests/amd64-linux/Makefile
njna454ec02009-01-19 03:16:59 +00002698 memcheck/tests/x86-linux/Makefile
sewardj0e342a02010-09-03 23:49:33 +00002699 memcheck/tests/ppc32/Makefile
2700 memcheck/tests/ppc64/Makefile
florian0bb707e2012-05-30 20:46:58 +00002701 memcheck/tests/s390x/Makefile
florianbb913cd2012-08-28 16:50:39 +00002702 memcheck/tests/vbit-test/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002703 cachegrind/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002704 cachegrind/tests/Makefile
njnc6168192004-11-29 13:54:10 +00002705 cachegrind/tests/x86/Makefile
njnf2df9b52002-10-04 11:35:47 +00002706 cachegrind/cg_annotate
njn69d495d2010-06-30 05:23:34 +00002707 cachegrind/cg_diff
weidendoa17f2a32006-03-20 10:27:30 +00002708 callgrind/Makefile
2709 callgrind/callgrind_annotate
2710 callgrind/callgrind_control
2711 callgrind/tests/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002712 helgrind/Makefile
njnf2df9b52002-10-04 11:35:47 +00002713 helgrind/tests/Makefile
nethercotec9f36922004-02-14 16:40:02 +00002714 massif/Makefile
nethercotec9f36922004-02-14 16:40:02 +00002715 massif/tests/Makefile
njnd5a8d242007-11-02 20:44:57 +00002716 massif/ms_print
njn25cac76cb2002-09-23 11:21:57 +00002717 lackey/Makefile
njnf2df9b52002-10-04 11:35:47 +00002718 lackey/tests/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002719 none/Makefile
2720 none/tests/Makefile
njnc6168192004-11-29 13:54:10 +00002721 none/tests/amd64/Makefile
cerion85665ca2005-06-20 15:51:07 +00002722 none/tests/ppc32/Makefile
sewardj2c48c7b2005-11-29 13:05:56 +00002723 none/tests/ppc64/Makefile
njnc6168192004-11-29 13:54:10 +00002724 none/tests/x86/Makefile
sewardj59570ff2010-01-01 11:59:33 +00002725 none/tests/arm/Makefile
sewardjb5b87402011-03-07 16:05:35 +00002726 none/tests/s390x/Makefile
sewardj5db15402012-06-07 09:13:21 +00002727 none/tests/mips32/Makefile
petarj8bea8672013-05-10 13:14:54 +00002728 none/tests/mips64/Makefile
njn0458a122009-02-13 06:23:46 +00002729 none/tests/linux/Makefile
njnf76d27a2009-05-28 01:53:07 +00002730 none/tests/darwin/Makefile
njn06ca3322009-04-15 23:10:04 +00002731 none/tests/x86-linux/Makefile
sewardjd2f95a02011-05-11 16:04:28 +00002732 exp-sgcheck/Makefile
2733 exp-sgcheck/tests/Makefile
bartccf17de2008-07-04 15:14:35 +00002734 drd/Makefile
bartccf17de2008-07-04 15:14:35 +00002735 drd/scripts/download-and-build-splash2
2736 drd/tests/Makefile
njndbebecc2009-07-14 01:39:54 +00002737 exp-bbv/Makefile
njndbebecc2009-07-14 01:39:54 +00002738 exp-bbv/tests/Makefile
2739 exp-bbv/tests/x86/Makefile
2740 exp-bbv/tests/x86-linux/Makefile
2741 exp-bbv/tests/amd64-linux/Makefile
2742 exp-bbv/tests/ppc32-linux/Makefile
vince226e0782010-01-06 15:22:11 +00002743 exp-bbv/tests/arm-linux/Makefile
sewardj4d7d8f52010-10-12 10:09:15 +00002744 exp-dhat/Makefile
2745 exp-dhat/tests/Makefile
njn8b68b642009-06-24 00:37:09 +00002746])
sewardjd3645802010-06-13 22:13:58 +00002747AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
2748 [chmod +x coregrind/link_tool_exe_linux])
2749AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
2750 [chmod +x coregrind/link_tool_exe_darwin])
njn8b68b642009-06-24 00:37:09 +00002751AC_OUTPUT
gobry3b777892002-04-04 09:18:39 +00002752
2753cat<<EOF
2754
njn311303f2009-02-06 03:46:50 +00002755 Maximum build arch: ${ARCH_MAX}
2756 Primary build arch: ${VGCONF_ARCH_PRI}
njn3f8a6e92009-06-02 00:20:47 +00002757 Secondary build arch: ${VGCONF_ARCH_SEC}
njn311303f2009-02-06 03:46:50 +00002758 Build OS: ${VGCONF_OS}
njn7fd6d382009-01-22 21:56:32 +00002759 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
2760 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
sewardjcb495c82011-07-11 20:42:34 +00002761 Platform variant: ${VGCONF_PLATVARIANT}
2762 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
sewardje95d94f2008-09-19 09:02:19 +00002763 Default supp files: ${DEFAULT_SUPP}
gobry3b777892002-04-04 09:18:39 +00002764
gobry3b777892002-04-04 09:18:39 +00002765EOF