blob: b3570cb44d2a1cb3dd4f22aa0b826f30e7bf10a3 [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"
gobrye721a522002-03-22 13:38:30 +000022
sewardjde4a1d02002-03-22 01:27:54 +000023AC_PROG_LN_S
24AC_PROG_CC
bart0affa492008-03-18 17:53:09 +000025AM_PROG_CC_C_O
sewardjde4a1d02002-03-22 01:27:54 +000026AC_PROG_CPP
njn25e49d8e72002-09-23 09:36:25 +000027AC_PROG_CXX
njn629a5ec2009-07-14 01:29:39 +000028# AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
29# autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
30# base (eg. most likely as Darwin-specific tests) we'll need one of the
31# following:
njn0cd26892009-07-12 23:07:13 +000032# - put AC_PROG_OBJC in a Darwin-specific part of this file
33# - Use AC_PROG_OBJC here and up the minimum autoconf version
34# - Use the following, which is apparently equivalent:
35# m4_ifdef([AC_PROG_OBJC],
36# [AC_PROG_OBJC],
37# [AC_CHECK_TOOL([OBJC], [gcc])
38# AC_SUBST([OBJC])
39# AC_SUBST([OBJCFLAGS])
40# ])
sewardjde4a1d02002-03-22 01:27:54 +000041AC_PROG_RANLIB
bart07de2c92010-05-29 06:44:28 +000042# provide a very basic definition for AC_PROG_SED if it's not provided by
43# autoconf (as e.g. in autoconf 2.59).
44m4_ifndef([AC_PROG_SED],
45 [AC_DEFUN([AC_PROG_SED],
46 [AC_ARG_VAR([SED])
47 AC_CHECK_PROGS([SED],[gsed sed])])])
bart12e91122010-05-15 08:37:24 +000048AC_PROG_SED
sewardjde4a1d02002-03-22 01:27:54 +000049
bartcddeaf52008-05-25 15:58:11 +000050# If no AR variable was specified, look up the name of the archiver. Otherwise
51# do not touch the AR variable.
52if test "x$AR" = "x"; then
bart07de2c92010-05-29 06:44:28 +000053 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
bartcddeaf52008-05-25 15:58:11 +000054fi
55AC_ARG_VAR([AR],[Archiver command])
56
gobrye721a522002-03-22 13:38:30 +000057# Check for the compiler support
58if test "${GCC}" != "yes" ; then
59 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
60fi
61
sewardj2f685952002-12-22 19:32:23 +000062# figure out where perl lives
63AC_PATH_PROG(PERL, perl)
64
njn9315df32003-04-16 20:50:50 +000065# figure out where gdb lives
sewardjf8722ca2008-11-17 00:20:45 +000066AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
njnfe408942004-11-23 17:52:24 +000067AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
njn9315df32003-04-16 20:50:50 +000068
daywalker48ccca52002-04-15 00:31:58 +000069# some older automake's don't have it so try something on our own
70ifdef([AM_PROG_AS],[AM_PROG_AS],
71[
gobry1be19852002-03-26 20:44:55 +000072AS="${CC}"
73AC_SUBST(AS)
gobry3b777892002-04-04 09:18:39 +000074
gobry1be19852002-03-26 20:44:55 +000075ASFLAGS=""
76AC_SUBST(ASFLAGS)
daywalker48ccca52002-04-15 00:31:58 +000077])
gobry3b777892002-04-04 09:18:39 +000078
gobry3b777892002-04-04 09:18:39 +000079
njn0d2e58f2009-02-25 04:57:56 +000080# Check if 'diff' supports -u (universal diffs) and use it if possible.
81
82AC_MSG_CHECKING([for diff -u])
83AC_SUBST(DIFF)
84
sewardj6e9de462011-06-28 07:25:29 +000085# Comparing two identical files results in 0.
njn31f665e2009-02-26 21:25:50 +000086tmpfile="tmp-xxx-yyy-zzz"
87touch $tmpfile;
88if diff -u $tmpfile $tmpfile ; then
njn0d2e58f2009-02-25 04:57:56 +000089 AC_MSG_RESULT([yes])
90 DIFF="diff -u"
91else
92 AC_MSG_RESULT([no])
93 DIFF="diff"
94fi
njn31f665e2009-02-26 21:25:50 +000095rm $tmpfile
njn0d2e58f2009-02-25 04:57:56 +000096
97
sewardj535c50f2005-06-04 23:14:53 +000098# We don't want gcc < 3.0
gobrye721a522002-03-22 13:38:30 +000099AC_MSG_CHECKING([for a supported version of gcc])
100
bart85037442011-11-22 14:41:31 +0000101# Obtain the compiler version.
sewardja8ca2c52011-09-29 18:18:37 +0000102#
bart85037442011-11-22 14:41:31 +0000103# A few examples of how the ${CC} --version output looks like:
104#
105# Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
106# Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
107# openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
108# Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
bartc5214062012-01-11 11:34:23 +0000109# MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
bart85037442011-11-22 14:41:31 +0000110# OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
111# OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
112# Clang: clang version 2.9 (tags/RELEASE_29/final)
bart048081f2012-06-17 05:53:02 +0000113# Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
114# FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
sewardja8ca2c52011-09-29 18:18:37 +0000115#
bartc5214062012-01-11 11:34:23 +0000116[
bart048081f2012-06-17 05:53:02 +0000117if test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ; then
118 is_clang="clang"
119 # Don't use -dumpversion with clang: it will always produce "4.2.1".
120 gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
121else
122 is_clang="notclang"
123 gcc_version=`${CC} -dumpversion 2>/dev/null`
124 if test "x$gcc_version" = x; then
125 gcc_version=`${CC} --version | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p'`
126 fi
sewardj3ab7b662011-09-29 17:30:13 +0000127fi
bart048081f2012-06-17 05:53:02 +0000128]
sewardj3ab7b662011-09-29 17:30:13 +0000129
130case "${is_clang}-${gcc_version}" in
131 notclang-3.*)
132 AC_MSG_RESULT([ok (${gcc_version})])
133 ;;
134 notclang-4.*)
135 AC_MSG_RESULT([ok (${gcc_version})])
136 ;;
sewardjae284e52012-08-02 18:25:04 +0000137 clang-2.9|clang-3.*|clang-4.*)
sewardj3ab7b662011-09-29 17:30:13 +0000138 AC_MSG_RESULT([ok (clang-${gcc_version})])
sewardj535c50f2005-06-04 23:14:53 +0000139 ;;
gobrye721a522002-03-22 13:38:30 +0000140 *)
sewardj3ab7b662011-09-29 17:30:13 +0000141 AC_MSG_RESULT([no (${gcc_version})])
142 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
gobrye721a522002-03-22 13:38:30 +0000143 ;;
144esac
145
njn7fd6d382009-01-22 21:56:32 +0000146#----------------------------------------------------------------------------
147# Arch/OS/platform tests.
148#----------------------------------------------------------------------------
149# We create a number of arch/OS/platform-related variables. We prefix them
150# all with "VGCONF_" which indicates that they are defined at
151# configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
152# variables used when compiling C files.
sewardj03d86f22006-10-17 00:57:24 +0000153
sewardjde4a1d02002-03-22 01:27:54 +0000154AC_CANONICAL_HOST
155
156AC_MSG_CHECKING([for a supported CPU])
sewardjbc692db2006-01-04 03:31:07 +0000157
njn7fd6d382009-01-22 21:56:32 +0000158# ARCH_MAX reflects the most that this CPU can do: for example if it
159# is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
160# Ditto for amd64. It is used for more configuration below, but is not used
161# outside this file.
gobrye721a522002-03-22 13:38:30 +0000162case "${host_cpu}" in
sewardjde4a1d02002-03-22 01:27:54 +0000163 i?86)
164 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000165 ARCH_MAX="x86"
sewardjde4a1d02002-03-22 01:27:54 +0000166 ;;
167
njnfe408942004-11-23 17:52:24 +0000168 x86_64)
169 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000170 ARCH_MAX="amd64"
njnfe408942004-11-23 17:52:24 +0000171 ;;
172
sewardj2c48c7b2005-11-29 13:05:56 +0000173 powerpc64)
174 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000175 ARCH_MAX="ppc64"
sewardj2c48c7b2005-11-29 13:05:56 +0000176 ;;
177
178 powerpc)
sewardj6e9de462011-06-28 07:25:29 +0000179 # On Linux this means only a 32-bit capable CPU.
cerion85665ca2005-06-20 15:51:07 +0000180 AC_MSG_RESULT([ok (${host_cpu})])
sewardj6e9de462011-06-28 07:25:29 +0000181 ARCH_MAX="ppc32"
nethercote9bcc9062004-10-13 13:50:01 +0000182 ;;
183
sewardjb5b87402011-03-07 16:05:35 +0000184 s390x)
185 AC_MSG_RESULT([ok (${host_cpu})])
186 ARCH_MAX="s390x"
187 ;;
188
sewardj59570ff2010-01-01 11:59:33 +0000189 armv7*)
190 AC_MSG_RESULT([ok (${host_cpu})])
191 ARCH_MAX="arm"
192 ;;
193
sewardj5db15402012-06-07 09:13:21 +0000194 mips)
petarj4df0bfc2013-02-27 23:17:33 +0000195 AC_MSG_RESULT([ok (${host_cpu})])
196 ARCH_MAX="mips32"
197 ;;
sewardj5db15402012-06-07 09:13:21 +0000198
199 mipsel)
petarj4df0bfc2013-02-27 23:17:33 +0000200 AC_MSG_RESULT([ok (${host_cpu})])
201 ARCH_MAX="mips32"
202 ;;
sewardj5db15402012-06-07 09:13:21 +0000203
204 mipsisa32r2)
petarj4df0bfc2013-02-27 23:17:33 +0000205 AC_MSG_RESULT([ok (${host_cpu})])
206 ARCH_MAX="mips32"
207 ;;
sewardj5db15402012-06-07 09:13:21 +0000208
petarj4df0bfc2013-02-27 23:17:33 +0000209 mips64*)
210 AC_MSG_RESULT([ok (${host_cpu})])
211 ARCH_MAX="mips64"
212 ;;
213
214 mipsisa64*)
215 AC_MSG_RESULT([ok (${host_cpu})])
216 ARCH_MAX="mips64"
217 ;;
sewardjde4a1d02002-03-22 01:27:54 +0000218 *)
219 AC_MSG_RESULT([no (${host_cpu})])
nethercote81d5c662004-10-13 13:18:51 +0000220 AC_MSG_ERROR([Unsupported host architecture. Sorry])
sewardjde4a1d02002-03-22 01:27:54 +0000221 ;;
222esac
223
njn7fd6d382009-01-22 21:56:32 +0000224#----------------------------------------------------------------------------
225
sewardj86e992f2006-01-28 18:39:09 +0000226# Sometimes it's convenient to subvert the bi-arch build system and
227# just have a single build even though the underlying platform is
228# capable of both. Hence handle --enable-only64bit and
229# --enable-only32bit. Complain if both are issued :-)
njn7fd6d382009-01-22 21:56:32 +0000230# [Actually, if either of these options are used, I think both get built,
231# but only one gets installed. So if you use an in-place build, both can be
232# used. --njn]
sewardj86e992f2006-01-28 18:39:09 +0000233
234# Check if a 64-bit only build has been requested
235AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
236 [AC_ARG_ENABLE(only64bit,
237 [ --enable-only64bit do a 64-bit only build],
238 [vg_cv_only64bit=$enableval],
239 [vg_cv_only64bit=no])])
240
241# Check if a 32-bit only build has been requested
242AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
243 [AC_ARG_ENABLE(only32bit,
244 [ --enable-only32bit do a 32-bit only build],
245 [vg_cv_only32bit=$enableval],
246 [vg_cv_only32bit=no])])
247
248# Stay sane
249if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
250 AC_MSG_ERROR(
251 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
252fi
253
njn7fd6d382009-01-22 21:56:32 +0000254#----------------------------------------------------------------------------
sewardj86e992f2006-01-28 18:39:09 +0000255
njn311303f2009-02-06 03:46:50 +0000256# VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
257# compilation of many C files via -VGO_$(VGCONF_OS) and
258# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
sewardjde4a1d02002-03-22 01:27:54 +0000259AC_MSG_CHECKING([for a supported OS])
njn7fd6d382009-01-22 21:56:32 +0000260AC_SUBST(VGCONF_OS)
sewardjde4a1d02002-03-22 01:27:54 +0000261
njnf76d27a2009-05-28 01:53:07 +0000262DEFAULT_SUPP=""
263
gobrye721a522002-03-22 13:38:30 +0000264case "${host_os}" in
mueller8c68e042004-01-03 15:21:14 +0000265 *linux*)
sewardjde4a1d02002-03-22 01:27:54 +0000266 AC_MSG_RESULT([ok (${host_os})])
njn7fd6d382009-01-22 21:56:32 +0000267 VGCONF_OS="linux"
mueller8c68e042004-01-03 15:21:14 +0000268
269 # Ok, this is linux. Check the kernel version
270 AC_MSG_CHECKING([for the kernel version])
271
272 kernel=`uname -r`
273
274 case "${kernel}" in
bart0419e512011-06-05 08:51:47 +0000275 2.6.*|3.*)
bart2d6e6e72011-06-05 10:01:48 +0000276 AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
277 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 +0000278 ;;
279
280 2.4.*)
281 AC_MSG_RESULT([2.4 family (${kernel})])
282 AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x])
283 ;;
284
mueller8c68e042004-01-03 15:21:14 +0000285 *)
286 AC_MSG_RESULT([unsupported (${kernel})])
nethercote4fa681f2004-11-08 17:51:39 +0000287 AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
mueller8c68e042004-01-03 15:21:14 +0000288 ;;
289 esac
290
291 ;;
292
njnf76d27a2009-05-28 01:53:07 +0000293 *darwin*)
294 AC_MSG_RESULT([ok (${host_os})])
295 VGCONF_OS="darwin"
njnea2d6fd2010-07-01 00:20:20 +0000296 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
297 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
298 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
sewardjae284e52012-08-02 18:25:04 +0000299 AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8])
njnf76d27a2009-05-28 01:53:07 +0000300
301 AC_MSG_CHECKING([for the kernel version])
302 kernel=`uname -r`
303
304 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
305 # has only one relevant version, the OS version. The `uname` check
306 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
sewardj731f9cf2011-09-21 08:43:08 +0000307 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
308 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
njnea2d6fd2010-07-01 00:20:20 +0000309 # and we don't know of an macros similar to __GLIBC__ to get that info.
njnf76d27a2009-05-28 01:53:07 +0000310 #
311 # XXX: `uname -r` won't do the right thing for cross-compiles, but
312 # that's not a problem yet.
sewardj731f9cf2011-09-21 08:43:08 +0000313 #
314 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
315 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
316 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
317 # time support for 10.5 (the 9.* pattern just below), I'll leave it
318 # in for now, just in case anybody wants to give it a try. But I'm
319 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
njnf76d27a2009-05-28 01:53:07 +0000320 case "${kernel}" in
321 9.*)
322 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
njnea2d6fd2010-07-01 00:20:20 +0000323 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
njnf76d27a2009-05-28 01:53:07 +0000324 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
bart6ccda142009-07-23 07:37:32 +0000325 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
njnf76d27a2009-05-28 01:53:07 +0000326 ;;
njnea2d6fd2010-07-01 00:20:20 +0000327 10.*)
328 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
329 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
330 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
331 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
332 ;;
sewardj731f9cf2011-09-21 08:43:08 +0000333 11.*)
334 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
335 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
sewardj731f9cf2011-09-21 08:43:08 +0000336 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
337 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
338 ;;
sewardjae284e52012-08-02 18:25:04 +0000339 12.*)
340 AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
341 AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
342 DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
343 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
344 ;;
sewardj731f9cf2011-09-21 08:43:08 +0000345 *)
njnf76d27a2009-05-28 01:53:07 +0000346 AC_MSG_RESULT([unsupported (${kernel})])
sewardj731f9cf2011-09-21 08:43:08 +0000347 AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)])
njnf76d27a2009-05-28 01:53:07 +0000348 ;;
349 esac
350 ;;
351
sewardjde4a1d02002-03-22 01:27:54 +0000352 *)
353 AC_MSG_RESULT([no (${host_os})])
njncc58cea2010-07-05 07:21:22 +0000354 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
sewardjde4a1d02002-03-22 01:27:54 +0000355 ;;
356esac
357
njn7fd6d382009-01-22 21:56:32 +0000358#----------------------------------------------------------------------------
359
tomd6398392006-06-07 17:44:36 +0000360# If we are building on a 64 bit platform test to see if the system
361# supports building 32 bit programs and disable 32 bit support if it
362# does not support building 32 bit programs
363
njn7fd6d382009-01-22 21:56:32 +0000364case "$ARCH_MAX-$VGCONF_OS" in
tomd6398392006-06-07 17:44:36 +0000365 amd64-linux|ppc64-linux)
366 AC_MSG_CHECKING([for 32 bit build support])
367 safe_CFLAGS=$CFLAGS
368 CFLAGS="-m32"
bart417cf3e2011-10-22 09:21:24 +0000369 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +0000370 return 0;
bart417cf3e2011-10-22 09:21:24 +0000371 ]])], [
tomd6398392006-06-07 17:44:36 +0000372 AC_MSG_RESULT([yes])
373 ], [
374 vg_cv_only64bit="yes"
375 AC_MSG_RESULT([no])
376 ])
377 CFLAGS=$safe_CFLAGS;;
378esac
379
380if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
381 AC_MSG_ERROR(
382 [--enable-only32bit was specified but system does not support 32 bit builds])
383fi
nethercote888ecb72004-08-23 14:54:40 +0000384
njn7fd6d382009-01-22 21:56:32 +0000385#----------------------------------------------------------------------------
386
njn311303f2009-02-06 03:46:50 +0000387# VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
388# default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
389# machine, but --enable-only32bit has been requested, then ARCH_MAX (see
390# above) will be "amd64" since that reflects the most that this cpu can do,
391# but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
392# arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
njn7fd6d382009-01-22 21:56:32 +0000393# passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
394# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
395AC_SUBST(VGCONF_ARCH_PRI)
396
njn3f8a6e92009-06-02 00:20:47 +0000397# VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
398# It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
399# and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
400# It is empty if there is no secondary target.
401AC_SUBST(VGCONF_ARCH_SEC)
402
njn311303f2009-02-06 03:46:50 +0000403# VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
404# The entire system, including regression and performance tests, will be
405# built for this target. The "_CAPS" indicates that the name is in capital
406# letters, and it also uses '_' rather than '-' as a separator, because it's
njn7fd6d382009-01-22 21:56:32 +0000407# used to create various Makefile variables, which are all in caps by
njn311303f2009-02-06 03:46:50 +0000408# convention and cannot contain '-' characters. This is in contrast to
409# VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
njn7fd6d382009-01-22 21:56:32 +0000410AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
411
412# VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
413# Valgrind and tools will also be built for this target, but not the
414# regression or performance tests.
sewardj01262142006-01-04 01:20:28 +0000415#
njn7fd6d382009-01-22 21:56:32 +0000416# By default, the primary arch is the same as the "max" arch, as commented
417# above (at the definition of ARCH_MAX). We may choose to downgrade it in
418# the big case statement just below here, in the case where we're building
419# on a 64 bit machine but have been requested only to do a 32 bit build.
420AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
421
sewardj01262142006-01-04 01:20:28 +0000422AC_MSG_CHECKING([for a supported CPU/OS combination])
nethercote888ecb72004-08-23 14:54:40 +0000423
njnea2d6fd2010-07-01 00:20:20 +0000424# NB. The load address for a given platform may be specified in more
425# than one place, in some cases, depending on whether we're doing a biarch,
426# 32-bit only or 64-bit only build. eg see case for amd64-linux below.
427# Be careful to give consistent values in all subcases. Also, all four
428# valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
429# even if it is to "0xUNSET".
430#
njn7fd6d382009-01-22 21:56:32 +0000431case "$ARCH_MAX-$VGCONF_OS" in
sewardj01262142006-01-04 01:20:28 +0000432 x86-linux)
njn7fd6d382009-01-22 21:56:32 +0000433 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000434 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000435 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
436 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000437 valt_load_address_pri_norml="0x38000000"
438 valt_load_address_pri_inner="0x28000000"
439 valt_load_address_sec_norml="0xUNSET"
440 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000441 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000442 ;;
443 amd64-linux)
njnea2d6fd2010-07-01 00:20:20 +0000444 valt_load_address_sec_norml="0xUNSET"
445 valt_load_address_sec_inner="0xUNSET"
sewardj86e992f2006-01-28 18:39:09 +0000446 if test x$vg_cv_only64bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000447 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000448 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000449 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
450 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000451 valt_load_address_pri_norml="0x38000000"
452 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000453 elif test x$vg_cv_only32bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000454 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000455 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000456 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
457 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000458 valt_load_address_pri_norml="0x38000000"
459 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000460 else
njn7fd6d382009-01-22 21:56:32 +0000461 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000462 VGCONF_ARCH_SEC="x86"
njn7fd6d382009-01-22 21:56:32 +0000463 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
464 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
njnea2d6fd2010-07-01 00:20:20 +0000465 valt_load_address_pri_norml="0x38000000"
466 valt_load_address_pri_inner="0x28000000"
467 valt_load_address_sec_norml="0x38000000"
468 valt_load_address_sec_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000469 fi
njn377c43f2009-05-19 07:39:22 +0000470 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000471 ;;
472 ppc32-linux)
njn7fd6d382009-01-22 21:56:32 +0000473 VGCONF_ARCH_PRI="ppc32"
njn3f8a6e92009-06-02 00:20:47 +0000474 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000475 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
476 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000477 valt_load_address_pri_norml="0x38000000"
478 valt_load_address_pri_inner="0x28000000"
479 valt_load_address_sec_norml="0xUNSET"
480 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000481 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000482 ;;
483 ppc64-linux)
njnea2d6fd2010-07-01 00:20:20 +0000484 valt_load_address_sec_norml="0xUNSET"
485 valt_load_address_sec_inner="0xUNSET"
sewardj86e992f2006-01-28 18:39:09 +0000486 if test x$vg_cv_only64bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000487 VGCONF_ARCH_PRI="ppc64"
njn3f8a6e92009-06-02 00:20:47 +0000488 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000489 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
490 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000491 valt_load_address_pri_norml="0x38000000"
492 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000493 elif test x$vg_cv_only32bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000494 VGCONF_ARCH_PRI="ppc32"
njn3f8a6e92009-06-02 00:20:47 +0000495 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000496 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
497 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000498 valt_load_address_pri_norml="0x38000000"
499 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000500 else
njn7fd6d382009-01-22 21:56:32 +0000501 VGCONF_ARCH_PRI="ppc64"
njn3f8a6e92009-06-02 00:20:47 +0000502 VGCONF_ARCH_SEC="ppc32"
njn7fd6d382009-01-22 21:56:32 +0000503 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
504 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
njnea2d6fd2010-07-01 00:20:20 +0000505 valt_load_address_pri_norml="0x38000000"
506 valt_load_address_pri_inner="0x28000000"
507 valt_load_address_sec_norml="0x38000000"
508 valt_load_address_sec_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000509 fi
njn377c43f2009-05-19 07:39:22 +0000510 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000511 ;;
njncc58cea2010-07-05 07:21:22 +0000512 # Darwin gets identified as 32-bit even when it supports 64-bit.
513 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
514 # all Macs support both 32-bit and 64-bit, so we just build both. If
515 # someone has a really old 32-bit only machine they can (hopefully?)
516 # build with --enable-only32bit. See bug 243362.
517 x86-darwin|amd64-darwin)
518 ARCH_MAX="amd64"
njnea2d6fd2010-07-01 00:20:20 +0000519 valt_load_address_sec_norml="0xUNSET"
520 valt_load_address_sec_inner="0xUNSET"
njnf76d27a2009-05-28 01:53:07 +0000521 if test x$vg_cv_only64bit = xyes; then
522 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000523 VGCONF_ARCH_SEC=""
njnf76d27a2009-05-28 01:53:07 +0000524 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
525 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000526 valt_load_address_pri_norml="0x138000000"
527 valt_load_address_pri_inner="0x128000000"
njnf76d27a2009-05-28 01:53:07 +0000528 elif test x$vg_cv_only32bit = xyes; then
529 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000530 VGCONF_ARCH_SEC=""
njnf76d27a2009-05-28 01:53:07 +0000531 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
532 VGCONF_PLATFORM_SEC_CAPS=""
533 VGCONF_ARCH_PRI_CAPS="x86"
njnea2d6fd2010-07-01 00:20:20 +0000534 valt_load_address_pri_norml="0x38000000"
535 valt_load_address_pri_inner="0x28000000"
njnf76d27a2009-05-28 01:53:07 +0000536 else
537 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000538 VGCONF_ARCH_SEC="x86"
njnf76d27a2009-05-28 01:53:07 +0000539 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
540 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
njnea2d6fd2010-07-01 00:20:20 +0000541 valt_load_address_pri_norml="0x138000000"
542 valt_load_address_pri_inner="0x128000000"
543 valt_load_address_sec_norml="0x38000000"
544 valt_load_address_sec_inner="0x28000000"
njnf76d27a2009-05-28 01:53:07 +0000545 fi
njnf76d27a2009-05-28 01:53:07 +0000546 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
547 ;;
sewardj59570ff2010-01-01 11:59:33 +0000548 arm-linux)
549 VGCONF_ARCH_PRI="arm"
550 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
551 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000552 valt_load_address_pri_norml="0x38000000"
553 valt_load_address_pri_inner="0x28000000"
554 valt_load_address_sec_norml="0xUNSET"
555 valt_load_address_sec_inner="0xUNSET"
sewardj59570ff2010-01-01 11:59:33 +0000556 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
557 ;;
sewardjb5b87402011-03-07 16:05:35 +0000558 s390x-linux)
559 VGCONF_ARCH_PRI="s390x"
560 VGCONF_ARCH_SEC=""
561 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
562 VGCONF_PLATFORM_SEC_CAPS=""
563 # we want to have the generated code close to the dispatcher
564 valt_load_address_pri_norml="0x401000000"
565 valt_load_address_pri_inner="0x410000000"
566 valt_load_address_sec_norml="0xUNSET"
567 valt_load_address_sec_inner="0xUNSET"
568 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
569 ;;
sewardj5db15402012-06-07 09:13:21 +0000570 mips32-linux)
571 VGCONF_ARCH_PRI="mips32"
572 VGCONF_PLATFORM_PRI_CAPS="MIPS32_LINUX"
573 VGCONF_PLATFORM_SEC_CAPS=""
574 valt_load_address_pri_norml="0x38000000"
575 valt_load_address_pri_inner="0x28000000"
576 valt_load_address_sec_norml="0xUNSET"
577 valt_load_address_sec_inner="0xUNSET"
578 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
petarj4df0bfc2013-02-27 23:17:33 +0000579 ;;
580 mips64-linux)
581 VGCONF_ARCH_PRI="mips64"
582 VGCONF_PLATFORM_PRI_CAPS="MIPS64_LINUX"
583 VGCONF_PLATFORM_SEC_CAPS=""
584 valt_load_address_pri_norml="0x38000000"
585 valt_load_address_pri_inner="0x28000000"
586 valt_load_address_sec_norml="0xUNSET"
587 valt_load_address_sec_inner="0xUNSET"
588 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj5db15402012-06-07 09:13:21 +0000589 ;;
nethercote888ecb72004-08-23 14:54:40 +0000590 *)
njn7fd6d382009-01-22 21:56:32 +0000591 VGCONF_ARCH_PRI="unknown"
njn3f8a6e92009-06-02 00:20:47 +0000592 VGCONF_ARCH_SEC="unknown"
njn7fd6d382009-01-22 21:56:32 +0000593 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
594 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
njnea2d6fd2010-07-01 00:20:20 +0000595 valt_load_address_pri_norml="0xUNSET"
596 valt_load_address_pri_inner="0xUNSET"
597 valt_load_address_sec_norml="0xUNSET"
598 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000599 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
sewardj3e38ce02004-11-23 01:17:29 +0000600 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
nethercote888ecb72004-08-23 14:54:40 +0000601 ;;
602esac
sewardjde4a1d02002-03-22 01:27:54 +0000603
njn7fd6d382009-01-22 21:56:32 +0000604#----------------------------------------------------------------------------
njna454ec02009-01-19 03:16:59 +0000605
njn7fd6d382009-01-22 21:56:32 +0000606# Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
607# defined.
608AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
609 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
njnf76d27a2009-05-28 01:53:07 +0000610 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
611 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
612 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN )
njn7fd6d382009-01-22 21:56:32 +0000613AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
njnf76d27a2009-05-28 01:53:07 +0000614 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
615 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN )
njn7fd6d382009-01-22 21:56:32 +0000616AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
617 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj6e9de462011-06-28 07:25:29 +0000618 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
njn7fd6d382009-01-22 21:56:32 +0000619AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
sewardj6e9de462011-06-28 07:25:29 +0000620 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
sewardj59570ff2010-01-01 11:59:33 +0000621AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
622 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
sewardjb5b87402011-03-07 16:05:35 +0000623AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
624 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
sewardj5db15402012-06-07 09:13:21 +0000625AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS32,
626 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX )
petarj4df0bfc2013-02-27 23:17:33 +0000627AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_MIPS64,
628 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX )
sewardj03d86f22006-10-17 00:57:24 +0000629
njn7fd6d382009-01-22 21:56:32 +0000630# Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
631# become defined.
632AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
633 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
634 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
635AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
636 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
637AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
638 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
639 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
640AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX,
641 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
sewardj59570ff2010-01-01 11:59:33 +0000642AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
643 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
sewardjb5b87402011-03-07 16:05:35 +0000644AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
645 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
646 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
sewardj5db15402012-06-07 09:13:21 +0000647AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX,
648 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX)
petarj4df0bfc2013-02-27 23:17:33 +0000649AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_MIPS64_LINUX,
650 test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
njnf76d27a2009-05-28 01:53:07 +0000651
njnf76d27a2009-05-28 01:53:07 +0000652AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
653 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
654 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
655AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
656 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
657
658
sewardj72a2d802010-07-29 05:24:20 +0000659# Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
sewardj03d86f22006-10-17 00:57:24 +0000660# Relies on the assumption that the primary and secondary targets are
661# for the same OS, so therefore only necessary to test the primary.
njn7fd6d382009-01-22 21:56:32 +0000662AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
663 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
664 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
665 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj59570ff2010-01-01 11:59:33 +0000666 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
sewardjb5b87402011-03-07 16:05:35 +0000667 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
sewardj5db15402012-06-07 09:13:21 +0000668 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
petarj4df0bfc2013-02-27 23:17:33 +0000669 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
670 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX)
njnf76d27a2009-05-28 01:53:07 +0000671AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
672 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
673 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
sewardj03d86f22006-10-17 00:57:24 +0000674
675
njn7fd6d382009-01-22 21:56:32 +0000676# Sometimes, in the Makefile.am files, it's useful to know whether or not
677# there is a secondary target.
njnee0c66a2009-06-01 23:59:20 +0000678AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
njn7fd6d382009-01-22 21:56:32 +0000679 test x$VGCONF_PLATFORM_SEC_CAPS != x)
tomfb7bcde2005-11-07 15:24:38 +0000680
philippef32cbe82012-05-18 16:48:20 +0000681dnl automake-1.10 does not have AM_COND_IF (added in 1.11), so we supply a
682dnl fallback definition
683dnl The macro is courtesy of Dave Hart:
684dnl https://lists.gnu.org/archive/html/automake/2010-12/msg00045.html
685m4_ifndef([AM_COND_IF], [AC_DEFUN([AM_COND_IF], [
686if test -z "$$1_TRUE"; then :
687 m4_n([$2])[]dnl
688m4_ifval([$3],
689[else
690 $3
691])dnl
692fi[]dnl
693])])
tomb637bad2005-11-08 12:28:35 +0000694
njn7fd6d382009-01-22 21:56:32 +0000695#----------------------------------------------------------------------------
696# Inner Valgrind?
697#----------------------------------------------------------------------------
698
njnd74b0ef2009-01-20 06:06:52 +0000699# Check if this should be built as an inner Valgrind, to be run within
700# another Valgrind. Choose the load address accordingly.
njnea2d6fd2010-07-01 00:20:20 +0000701AC_SUBST(VALT_LOAD_ADDRESS_PRI)
702AC_SUBST(VALT_LOAD_ADDRESS_SEC)
njnd74b0ef2009-01-20 06:06:52 +0000703AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
704 [AC_ARG_ENABLE(inner,
705 [ --enable-inner enables self-hosting],
706 [vg_cv_inner=$enableval],
707 [vg_cv_inner=no])])
708if test "$vg_cv_inner" = yes; then
709 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
njnea2d6fd2010-07-01 00:20:20 +0000710 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
711 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
njnd74b0ef2009-01-20 06:06:52 +0000712else
njnea2d6fd2010-07-01 00:20:20 +0000713 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
714 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
njnd74b0ef2009-01-20 06:06:52 +0000715fi
716
717
njn7fd6d382009-01-22 21:56:32 +0000718#----------------------------------------------------------------------------
sewardj5db15402012-06-07 09:13:21 +0000719# Define MIPS_PAGE_SHIFT (--with-pagesize)
720#----------------------------------------------------------------------------
721AC_ARG_WITH(pagesize,
722 [ --with-pagesize= override detected page size (4, 16 or 64)],
723 [psize=$withval],
724 [psize=0]
725)
726
727if test "$psize" = "0"; then
728 psizer=`getconf PAGESIZE`
729 let "psize=${psizer}/1024"
730fi
731
732if test "$psize" = "4"; then
733 AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured page size 4k])
734elif test "$psize" = "16"; then
735 AC_DEFINE([MIPS_PAGE_SHIFT], 14, [configured page size 16k])
736elif test "$psize" = "64"; then
737 AC_DEFINE([MIPS_PAGE_SHIFT], 16, [configured page size 64k])
738else
739 AC_DEFINE([MIPS_PAGE_SHIFT], 12, [configured default page size 4k])
740fi
741AC_MSG_RESULT([checking for Pagesize... ${psize}k])
742
sewardj5db15402012-06-07 09:13:21 +0000743
744#----------------------------------------------------------------------------
sewardjcb495c82011-07-11 20:42:34 +0000745# Extra fine-tuning of installation directories
746#----------------------------------------------------------------------------
747AC_ARG_WITH(tmpdir,
748 [ --with-tmpdir=PATH Specify path for temporary files],
749 tmpdir="$withval",
750 tmpdir="/tmp")
751AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
752
sewardj0ba37c92011-07-12 11:46:24 +0000753
sewardjcb495c82011-07-11 20:42:34 +0000754#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +0000755# Libc and suppressions
756#----------------------------------------------------------------------------
757# This variable will collect the suppression files to be used.
njn7fd6d382009-01-22 21:56:32 +0000758AC_SUBST(DEFAULT_SUPP)
sewardj01262142006-01-04 01:20:28 +0000759
bart12e91122010-05-15 08:37:24 +0000760AC_CHECK_HEADER([features.h])
sewardjde4a1d02002-03-22 01:27:54 +0000761
bart12e91122010-05-15 08:37:24 +0000762if test x$ac_cv_header_features_h = xyes; then
763 rm -f conftest.$ac_ext
764 cat <<_ACEOF >conftest.$ac_ext
sewardjde4a1d02002-03-22 01:27:54 +0000765#include <features.h>
bart12e91122010-05-15 08:37:24 +0000766#if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
767glibc version is: __GLIBC__ __GLIBC_MINOR__
sewardjde4a1d02002-03-22 01:27:54 +0000768#endif
bart12e91122010-05-15 08:37:24 +0000769_ACEOF
770 GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
771fi
bartb7c3f082010-05-13 06:32:36 +0000772
njnf76d27a2009-05-28 01:53:07 +0000773# not really a version check
774AC_EGREP_CPP([DARWIN_LIBC], [
775#include <sys/cdefs.h>
776#if defined(__DARWIN_VERS_1050)
777 DARWIN_LIBC
778#endif
779],
780GLIBC_VERSION="darwin")
781
sewardjcb495c82011-07-11 20:42:34 +0000782# not really a version check
783AC_EGREP_CPP([BIONIC_LIBC], [
784#if defined(__ANDROID__)
785 BIONIC_LIBC
786#endif
787],
788GLIBC_VERSION="bionic")
789
790
dirk07596a22008-04-25 11:33:30 +0000791AC_MSG_CHECKING([the GLIBC_VERSION version])
sewardj03d86f22006-10-17 00:57:24 +0000792
dirk07596a22008-04-25 11:33:30 +0000793case "${GLIBC_VERSION}" in
sewardjde4a1d02002-03-22 01:27:54 +0000794 2.2)
795 AC_MSG_RESULT(2.2 family)
daywalker418c7482002-10-16 13:09:26 +0000796 AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000797 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
798 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000799 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardjde4a1d02002-03-22 01:27:54 +0000800 ;;
801
sewardj08c7f012002-10-07 23:56:55 +0000802 2.3)
803 AC_MSG_RESULT(2.3 family)
daywalker418c7482002-10-16 13:09:26 +0000804 AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000805 DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000806 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000807 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardj08c7f012002-10-07 23:56:55 +0000808 ;;
809
njn781dba52005-06-30 04:06:38 +0000810 2.4)
811 AC_MSG_RESULT(2.4 family)
812 AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000813 DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000814 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000815 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
njn781dba52005-06-30 04:06:38 +0000816 ;;
817
dirkaece45c2006-10-12 08:17:49 +0000818 2.5)
819 AC_MSG_RESULT(2.5 family)
820 AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000821 DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000822 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000823 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
dirkaece45c2006-10-12 08:17:49 +0000824 ;;
dirkc8bd0c52007-05-23 17:39:08 +0000825 2.6)
826 AC_MSG_RESULT(2.6 family)
827 AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000828 DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000829 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000830 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000831 ;;
832 2.7)
833 AC_MSG_RESULT(2.7 family)
834 AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
dirk07596a22008-04-25 11:33:30 +0000835 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000836 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000837 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
dirkc8bd0c52007-05-23 17:39:08 +0000838 ;;
dirk07596a22008-04-25 11:33:30 +0000839 2.8)
840 AC_MSG_RESULT(2.8 family)
dirkeb939fc2008-04-27 20:38:47 +0000841 AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
dirk07596a22008-04-25 11:33:30 +0000842 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
843 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
844 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
845 ;;
dirkd2e31eb2008-11-19 23:58:36 +0000846 2.9)
847 AC_MSG_RESULT(2.9 family)
848 AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
849 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
850 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
851 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
852 ;;
sewardj5d425e82009-02-01 19:01:11 +0000853 2.10)
854 AC_MSG_RESULT(2.10 family)
855 AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
856 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
857 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
858 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
859 ;;
bart0fac7ff2009-11-15 19:11:19 +0000860 2.11)
861 AC_MSG_RESULT(2.11 family)
862 AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
863 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
864 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
865 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
bartb7c3f082010-05-13 06:32:36 +0000866 ;;
867 2.12)
868 AC_MSG_RESULT(2.12 family)
869 AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
870 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
871 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
872 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
bart0fac7ff2009-11-15 19:11:19 +0000873 ;;
tomebd619b2011-02-10 09:09:09 +0000874 2.13)
875 AC_MSG_RESULT(2.13 family)
876 AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
877 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
878 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
879 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
880 ;;
tomcc077412011-06-07 21:52:26 +0000881 2.14)
882 AC_MSG_RESULT(2.14 family)
883 AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
884 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
885 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
886 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
887 ;;
dirke75fdeb2011-12-29 08:24:55 +0000888 2.15)
889 AC_MSG_RESULT(2.15 family)
890 AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x])
891 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
892 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
893 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
894 ;;
sewardjc7188be2012-07-14 10:07:06 +0000895 2.16)
896 AC_MSG_RESULT(2.16 family)
897 AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x])
898 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
899 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
900 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
901 ;;
tom3781ac12013-01-14 09:48:49 +0000902 2.17)
903 AC_MSG_RESULT(2.17 family)
904 AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x])
905 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
906 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
907 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
908 ;;
mjw317f01b2013-08-21 14:47:52 +0000909 2.18)
910 AC_MSG_RESULT(2.18 family)
911 AC_DEFINE([GLIBC_2_18], 1, [Define to 1 if you're using glibc 2.18.x])
912 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
913 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
914 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
915 ;;
njnf76d27a2009-05-28 01:53:07 +0000916 darwin)
917 AC_MSG_RESULT(Darwin)
918 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
919 # DEFAULT_SUPP set by kernel version check above.
920 ;;
sewardjcb495c82011-07-11 20:42:34 +0000921 bionic)
922 AC_MSG_RESULT(Bionic)
923 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
924 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
925 ;;
dirkaece45c2006-10-12 08:17:49 +0000926
sewardjde4a1d02002-03-22 01:27:54 +0000927 *)
bart12e91122010-05-15 08:37:24 +0000928 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
tom3781ac12013-01-14 09:48:49 +0000929 AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17])
njnf76d27a2009-05-28 01:53:07 +0000930 AC_MSG_ERROR([or Darwin libc])
sewardjde4a1d02002-03-22 01:27:54 +0000931 ;;
932esac
933
dirk07596a22008-04-25 11:33:30 +0000934AC_SUBST(GLIBC_VERSION)
sewardj535c50f2005-06-04 23:14:53 +0000935
sewardj414f3582008-07-18 20:46:00 +0000936
937# Add default suppressions for the X client libraries. Make no
938# attempt to detect whether such libraries are installed on the
939# build machine (or even if any X facilities are present); just
940# add the suppressions antidisirregardless.
941DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
942DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
gobrye721a522002-03-22 13:38:30 +0000943
sewardjd2f95a02011-05-11 16:04:28 +0000944# Add glibc and X11 suppressions for exp-sgcheck
945DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
sewardj5744c022008-10-19 18:58:13 +0000946
sewardj2e10a682003-04-07 19:36:41 +0000947
njn7fd6d382009-01-22 21:56:32 +0000948#----------------------------------------------------------------------------
sewardjcb495c82011-07-11 20:42:34 +0000949# Platform variants?
950#----------------------------------------------------------------------------
951
952# Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
953# But there are times where we need a bit more control. The motivating
philippe5d5dd8e2012-08-05 00:08:25 +0000954# and currently only case is Android: this is almost identical to
955# {x86,arm}-linux, but not quite. So this introduces the concept of platform
956# variant tags, which get passed in the compile as -DVGPV_<arch>_<os>_<variant>
957# along with the main -DVGP_<arch>_<os> definition.
sewardjcb495c82011-07-11 20:42:34 +0000958#
959# In almost all cases, the <variant> bit is "vanilla". But for Android
960# it is "android" instead.
961#
962# Consequently (eg), plain arm-linux would build with
963#
964# -DVGP_arm_linux -DVGPV_arm_linux_vanilla
965#
966# whilst an Android build would have
967#
968# -DVGP_arm_linux -DVGPV_arm_linux_android
969#
philippe5d5dd8e2012-08-05 00:08:25 +0000970# Same for x86. The setup of the platform variant is pushed relatively far
971# down this file in order that we can inspect any of the variables set above.
sewardjcb495c82011-07-11 20:42:34 +0000972
973# In the normal case ..
974VGCONF_PLATVARIANT="vanilla"
975
philippe5d5dd8e2012-08-05 00:08:25 +0000976# Android ?
977if test "$GLIBC_VERSION" = "bionic";
sewardjcb495c82011-07-11 20:42:34 +0000978then
979 VGCONF_PLATVARIANT="android"
980fi
981
982AC_SUBST(VGCONF_PLATVARIANT)
983
984
985# FIXME: do we also want to define automake variables
986# VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
987# VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
988# VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
989# do that. Problem is that we can't do and-ing in Makefile.am's, but
990# that's what we'd need to do to use this, since what we'd want to write
991# is something like
992#
993# VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
994#
sewardj0ba37c92011-07-12 11:46:24 +0000995# Hmm. Can't think of a nice clean solution to this.
996
997AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
998 test x$VGCONF_PLATVARIANT = xvanilla)
999AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
1000 test x$VGCONF_PLATVARIANT = xandroid)
sewardjcb495c82011-07-11 20:42:34 +00001001
1002
1003#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +00001004# Checking for various library functions and other definitions
1005#----------------------------------------------------------------------------
1006
florian28db75c2012-12-08 19:26:03 +00001007# Check for AT_FDCWD
1008
1009AC_MSG_CHECKING([for AT_FDCWD])
1010AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1011#define _GNU_SOURCE
1012#include <fcntl.h>
1013#include <unistd.h>
1014]], [[
1015 int a = AT_FDCWD;
1016]])], [
1017ac_have_at_fdcwd=yes
1018AC_MSG_RESULT([yes])
1019], [
1020ac_have_at_fdcwd=no
florian28db75c2012-12-08 19:26:03 +00001021AC_MSG_RESULT([no])
1022])
1023
1024AM_CONDITIONAL([HAVE_AT_FDCWD], [test x$ac_have_at_fdcwd = xyes])
1025
sewardj24cf8df2012-12-14 10:30:57 +00001026# Check for stpncpy function definition in string.h
1027# This explicitly checks with _GNU_SOURCE defined since that is also
1028# used in the test case (some systems might define it without anyway
1029# since stpncpy is part of The Open Group Base Specifications Issue 7
1030# IEEE Std 1003.1-2008.
1031AC_MSG_CHECKING([for stpncpy])
1032AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1033#define _GNU_SOURCE
1034#include <string.h>
1035]], [[
1036 char *d;
1037 char *s;
1038 size_t n = 0;
1039 char *r = stpncpy(d, s, n);
1040]])], [
1041ac_have_gnu_stpncpy=yes
1042AC_MSG_RESULT([yes])
1043], [
1044ac_have_gnu_stpncpy=no
1045AC_MSG_RESULT([no])
1046])
1047
1048AM_CONDITIONAL([HAVE_GNU_STPNCPY], [test x$ac_have_gnu_stpncpy = xyes])
florian28db75c2012-12-08 19:26:03 +00001049
philippe4e98f7c2013-08-03 20:34:58 +00001050# Check for PTRACE_GETREGS
1051
1052AC_MSG_CHECKING([for PTRACE_GETREGS])
1053AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1054#include <stddef.h>
1055#include <sys/ptrace.h>
1056#include <sys/user.h>
1057]], [[
1058 void *p;
1059 long res = ptrace (PTRACE_GETREGS, 0, p, p);
1060]])], [
1061AC_MSG_RESULT([yes])
1062AC_DEFINE([HAVE_PTRACE_GETREGS], 1,
1063 [Define to 1 if you have the `PTRACE_GETREGS' ptrace request.])
1064], [
1065AC_MSG_RESULT([no])
1066])
1067
1068
bart59e2f182008-04-28 16:22:53 +00001069# Check for CLOCK_MONOTONIC
1070
1071AC_MSG_CHECKING([for CLOCK_MONOTONIC])
1072
bart417cf3e2011-10-22 09:21:24 +00001073AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart59e2f182008-04-28 16:22:53 +00001074#include <time.h>
bart417cf3e2011-10-22 09:21:24 +00001075]], [[
bart59e2f182008-04-28 16:22:53 +00001076 struct timespec t;
1077 clock_gettime(CLOCK_MONOTONIC, &t);
1078 return 0;
bart417cf3e2011-10-22 09:21:24 +00001079]])], [
bart59e2f182008-04-28 16:22:53 +00001080AC_MSG_RESULT([yes])
1081AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
1082 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
1083], [
1084AC_MSG_RESULT([no])
1085])
1086
bartfea06922008-05-03 09:12:15 +00001087
sewardj0c09bf02011-07-11 22:11:58 +00001088# Check for PTHREAD_RWLOCK_T
1089
1090AC_MSG_CHECKING([for pthread_rwlock_t])
1091
bart417cf3e2011-10-22 09:21:24 +00001092AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
sewardj0c09bf02011-07-11 22:11:58 +00001093#define _GNU_SOURCE
1094#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001095]], [[
sewardj0c09bf02011-07-11 22:11:58 +00001096 pthread_rwlock_t rwl;
bart417cf3e2011-10-22 09:21:24 +00001097]])], [
sewardj0c09bf02011-07-11 22:11:58 +00001098AC_MSG_RESULT([yes])
1099AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
1100 [Define to 1 if you have the `pthread_rwlock_t' type.])
1101], [
1102AC_MSG_RESULT([no])
1103])
1104
1105
bartfea06922008-05-03 09:12:15 +00001106# Check for PTHREAD_MUTEX_ADAPTIVE_NP
1107
1108AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
1109
bart417cf3e2011-10-22 09:21:24 +00001110AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001111#define _GNU_SOURCE
1112#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001113]], [[
bartfea06922008-05-03 09:12:15 +00001114 return (PTHREAD_MUTEX_ADAPTIVE_NP);
bart417cf3e2011-10-22 09:21:24 +00001115]])], [
bartfea06922008-05-03 09:12:15 +00001116AC_MSG_RESULT([yes])
1117AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
1118 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
1119], [
1120AC_MSG_RESULT([no])
1121])
1122
1123
1124# Check for PTHREAD_MUTEX_ERRORCHECK_NP
1125
1126AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
1127
bart417cf3e2011-10-22 09:21:24 +00001128AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001129#define _GNU_SOURCE
1130#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001131]], [[
bartfea06922008-05-03 09:12:15 +00001132 return (PTHREAD_MUTEX_ERRORCHECK_NP);
bart417cf3e2011-10-22 09:21:24 +00001133]])], [
bartfea06922008-05-03 09:12:15 +00001134AC_MSG_RESULT([yes])
1135AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
1136 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
1137], [
1138AC_MSG_RESULT([no])
1139])
1140
1141
1142# Check for PTHREAD_MUTEX_RECURSIVE_NP
1143
1144AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
1145
bart417cf3e2011-10-22 09:21:24 +00001146AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001147#define _GNU_SOURCE
1148#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001149]], [[
bartfea06922008-05-03 09:12:15 +00001150 return (PTHREAD_MUTEX_RECURSIVE_NP);
bart417cf3e2011-10-22 09:21:24 +00001151]])], [
bartfea06922008-05-03 09:12:15 +00001152AC_MSG_RESULT([yes])
1153AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
1154 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
1155], [
1156AC_MSG_RESULT([no])
1157])
1158
1159
1160# Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
1161
1162AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
1163
bart417cf3e2011-10-22 09:21:24 +00001164AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +00001165#define _GNU_SOURCE
1166#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +00001167]], [[
bartfea06922008-05-03 09:12:15 +00001168 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
1169 return 0;
bart417cf3e2011-10-22 09:21:24 +00001170]])], [
bartfea06922008-05-03 09:12:15 +00001171AC_MSG_RESULT([yes])
1172AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
1173 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
1174], [
1175AC_MSG_RESULT([no])
1176])
1177
1178
bart5e389f12008-04-05 12:53:15 +00001179# Check whether pthread_mutex_t has a member called __m_kind.
1180
bartb11355c2010-04-29 16:37:26 +00001181AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
1182 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1183 1,
1184 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1185 ],
1186 [],
1187 [#include <pthread.h>])
bart5e389f12008-04-05 12:53:15 +00001188
1189
1190# Check whether pthread_mutex_t has a member called __data.__kind.
1191
bartb11355c2010-04-29 16:37:26 +00001192AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1193 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1194 1,
1195 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1196 ],
1197 [],
1198 [#include <pthread.h>])
bart5e389f12008-04-05 12:53:15 +00001199
1200
bart62c370e2008-05-12 18:50:51 +00001201# does this compiler support -maltivec and does it have the include file
1202# <altivec.h> ?
1203
1204AC_MSG_CHECKING([for Altivec])
1205
1206safe_CFLAGS=$CFLAGS
1207CFLAGS="-maltivec"
1208
bart417cf3e2011-10-22 09:21:24 +00001209AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart62c370e2008-05-12 18:50:51 +00001210#include <altivec.h>
bart417cf3e2011-10-22 09:21:24 +00001211]], [[
bart62c370e2008-05-12 18:50:51 +00001212 vector unsigned int v;
bart417cf3e2011-10-22 09:21:24 +00001213]])], [
bart62c370e2008-05-12 18:50:51 +00001214ac_have_altivec=yes
1215AC_MSG_RESULT([yes])
sewardjf9fe6022010-09-03 14:36:50 +00001216AC_DEFINE([HAS_ALTIVEC], 1,
sewardj6467a152010-09-03 14:02:22 +00001217 [Define to 1 if gcc/as can do Altivec.])
bart62c370e2008-05-12 18:50:51 +00001218], [
1219ac_have_altivec=no
1220AC_MSG_RESULT([no])
1221])
1222CFLAGS=$safe_CFLAGS
1223
sewardj0e342a02010-09-03 23:49:33 +00001224AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
bart62c370e2008-05-12 18:50:51 +00001225
1226
sewardjf34eb492011-04-15 11:57:05 +00001227# Check that both: the compiler supports -mvsx and that the assembler
1228# understands VSX instructions. If either of those doesn't work,
1229# conclude that we can't do VSX. NOTE: basically this is a kludge
1230# in that it conflates two things that should be separate -- whether
1231# the compiler understands the flag vs whether the assembler
1232# understands the opcodes. This really ought to be cleaned up
1233# and done properly, like it is for x86/x86_64.
1234
1235AC_MSG_CHECKING([for VSX])
1236
1237safe_CFLAGS=$CFLAGS
1238CFLAGS="-mvsx"
1239
bart417cf3e2011-10-22 09:21:24 +00001240AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
sewardjf34eb492011-04-15 11:57:05 +00001241#include <altivec.h>
bart417cf3e2011-10-22 09:21:24 +00001242]], [[
sewardjf34eb492011-04-15 11:57:05 +00001243 vector unsigned int v;
sewardj9b80ebb2011-04-15 21:16:00 +00001244 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
bart417cf3e2011-10-22 09:21:24 +00001245]])], [
sewardjf34eb492011-04-15 11:57:05 +00001246ac_have_vsx=yes
1247AC_MSG_RESULT([yes])
1248], [
1249ac_have_vsx=no
1250AC_MSG_RESULT([no])
1251])
1252CFLAGS=$safe_CFLAGS
1253
1254AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
1255
sewardj4e1c1912012-08-08 22:22:26 +00001256
sewardjb0ccb4d2012-04-02 10:22:05 +00001257AC_MSG_CHECKING([that assembler knows DFP])
1258
1259AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1260]], [[
1261 __asm__ __volatile__("dadd 1, 2, 3");
sewardj4e1c1912012-08-08 22:22:26 +00001262 __asm__ __volatile__("dcffix 1, 2");
sewardjb0ccb4d2012-04-02 10:22:05 +00001263]])], [
1264ac_asm_have_dfp=yes
1265AC_MSG_RESULT([yes])
1266], [
1267ac_asm_have_dfp=no
1268AC_MSG_RESULT([no])
1269])
1270
sewardj4e1c1912012-08-08 22:22:26 +00001271
sewardjb0ccb4d2012-04-02 10:22:05 +00001272AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1273safe_CFLAGS=$CFLAGS
1274CFLAGS="-mhard-dfp"
1275AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1276]], [[
1277 __asm__ __volatile__("dadd 1, 2, 3");
sewardj4e1c1912012-08-08 22:22:26 +00001278 __asm__ __volatile__("dcffix 1, 2");
sewardjb0ccb4d2012-04-02 10:22:05 +00001279]])], [
1280ac_gcc_have_dfp=yes
1281AC_MSG_RESULT([yes])
1282], [
1283ac_gcc_have_dfp=no
1284AC_MSG_RESULT([no])
1285])
1286
sewardjb0ccb4d2012-04-02 10:22:05 +00001287CFLAGS=$safe_CFLAGS
1288
1289AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes -a x$ac_gcc_have_dfp = xyes)
sewardjf34eb492011-04-15 11:57:05 +00001290
sewardj4e1c1912012-08-08 22:22:26 +00001291
florian46825982012-11-10 22:35:24 +00001292AC_MSG_CHECKING([that compiler knows DFP datatypes])
1293AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1294]], [[
1295 _Decimal64 x = 0.0DD;
1296]])], [
1297ac_gcc_have_dfp_type=yes
1298AC_MSG_RESULT([yes])
1299], [
1300ac_gcc_have_dfp_type=no
1301AC_MSG_RESULT([no])
1302])
1303
1304AM_CONDITIONAL(BUILD_DFP_TESTS, test x$ac_gcc_have_dfp_type = xyes)
1305
carlldfbf2942013-08-12 18:04:22 +00001306# isa 2.07 checking
1307AC_MSG_CHECKING([that assembler knows ISA 2.07 ])
1308
1309AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1310]], [[
1311 __asm__ __volatile__("mtvsrd 1,2 ");
1312]])], [
1313ac_asm_have_isa_2_07=yes
1314AC_MSG_RESULT([yes])
1315], [
1316ac_asm_have_isa_2_07=no
1317AC_MSG_RESULT([no])
1318])
1319
1320AM_CONDITIONAL(HAS_ISA_2_07, test x$ac_asm_have_isa_2_07 = xyes)
florian46825982012-11-10 22:35:24 +00001321
bart36dd85a2009-04-26 07:11:48 +00001322# Check for pthread_create@GLIBC2.0
1323AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1324
bart16e1c5a2009-04-26 07:38:53 +00001325safe_CFLAGS=$CFLAGS
1326CFLAGS="-lpthread"
bart417cf3e2011-10-22 09:21:24 +00001327AC_LINK_IFELSE([AC_LANG_PROGRAM([[
bart36dd85a2009-04-26 07:11:48 +00001328extern int pthread_create_glibc_2_0(void*, const void*,
1329 void *(*)(void*), void*);
1330__asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
bart417cf3e2011-10-22 09:21:24 +00001331]], [[
bart276ed3a2009-05-10 15:41:45 +00001332#ifdef __powerpc__
1333/*
1334 * Apparently on PowerPC linking this program succeeds and generates an
1335 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1336 */
1337#error This test does not work properly on PowerPC.
1338#else
bart16e1c5a2009-04-26 07:38:53 +00001339 pthread_create_glibc_2_0(0, 0, 0, 0);
bart276ed3a2009-05-10 15:41:45 +00001340#endif
bart16e1c5a2009-04-26 07:38:53 +00001341 return 0;
bart417cf3e2011-10-22 09:21:24 +00001342]])], [
bart36dd85a2009-04-26 07:11:48 +00001343ac_have_pthread_create_glibc_2_0=yes
1344AC_MSG_RESULT([yes])
1345AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1346 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1347], [
1348ac_have_pthread_create_glibc_2_0=no
1349AC_MSG_RESULT([no])
1350])
bart16e1c5a2009-04-26 07:38:53 +00001351CFLAGS=$safe_CFLAGS
bart36dd85a2009-04-26 07:11:48 +00001352
1353AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
bart24f53902009-04-26 11:29:02 +00001354 test x$ac_have_pthread_create_glibc_2_0 = xyes)
bart36dd85a2009-04-26 07:11:48 +00001355
1356
barta50aa8a2008-04-27 06:06:57 +00001357# Check for eventfd_t, eventfd() and eventfd_read()
1358AC_MSG_CHECKING([for eventfd()])
1359
bart417cf3e2011-10-22 09:21:24 +00001360AC_LINK_IFELSE([AC_LANG_PROGRAM([[
barta50aa8a2008-04-27 06:06:57 +00001361#include <sys/eventfd.h>
bart417cf3e2011-10-22 09:21:24 +00001362]], [[
barta50aa8a2008-04-27 06:06:57 +00001363 eventfd_t ev;
1364 int fd;
1365
1366 fd = eventfd(5, 0);
1367 eventfd_read(fd, &ev);
1368 return 0;
bart417cf3e2011-10-22 09:21:24 +00001369]])], [
barta50aa8a2008-04-27 06:06:57 +00001370AC_MSG_RESULT([yes])
1371AC_DEFINE([HAVE_EVENTFD], 1,
1372 [Define to 1 if you have the `eventfd' function.])
1373AC_DEFINE([HAVE_EVENTFD_READ], 1,
1374 [Define to 1 if you have the `eventfd_read' function.])
1375], [
1376AC_MSG_RESULT([no])
1377])
1378
1379
njn7fd6d382009-01-22 21:56:32 +00001380#----------------------------------------------------------------------------
1381# Checking for supported compiler flags.
1382#----------------------------------------------------------------------------
1383
sewardj535c50f2005-06-04 23:14:53 +00001384# does this compiler support -m32 ?
1385AC_MSG_CHECKING([if gcc accepts -m32])
1386
1387safe_CFLAGS=$CFLAGS
1388CFLAGS="-m32"
1389
bart417cf3e2011-10-22 09:21:24 +00001390AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001391 return 0;
bart417cf3e2011-10-22 09:21:24 +00001392]])], [
sewardj535c50f2005-06-04 23:14:53 +00001393FLAG_M32="-m32"
1394AC_MSG_RESULT([yes])
1395], [
1396FLAG_M32=""
1397AC_MSG_RESULT([no])
1398])
1399CFLAGS=$safe_CFLAGS
1400
1401AC_SUBST(FLAG_M32)
1402
1403
sewardj01262142006-01-04 01:20:28 +00001404# does this compiler support -m64 ?
1405AC_MSG_CHECKING([if gcc accepts -m64])
1406
1407safe_CFLAGS=$CFLAGS
1408CFLAGS="-m64"
1409
bart417cf3e2011-10-22 09:21:24 +00001410AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001411 return 0;
bart417cf3e2011-10-22 09:21:24 +00001412]])], [
sewardj01262142006-01-04 01:20:28 +00001413FLAG_M64="-m64"
1414AC_MSG_RESULT([yes])
1415], [
1416FLAG_M64=""
1417AC_MSG_RESULT([no])
1418])
1419CFLAGS=$safe_CFLAGS
1420
1421AC_SUBST(FLAG_M64)
1422
1423
sewardj67f1fcc2005-07-03 10:41:02 +00001424# does this compiler support -mmmx ?
1425AC_MSG_CHECKING([if gcc accepts -mmmx])
1426
1427safe_CFLAGS=$CFLAGS
1428CFLAGS="-mmmx"
1429
bart417cf3e2011-10-22 09:21:24 +00001430AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001431 return 0;
bart417cf3e2011-10-22 09:21:24 +00001432]])], [
sewardj67f1fcc2005-07-03 10:41:02 +00001433FLAG_MMMX="-mmmx"
1434AC_MSG_RESULT([yes])
1435], [
1436FLAG_MMMX=""
1437AC_MSG_RESULT([no])
1438])
1439CFLAGS=$safe_CFLAGS
1440
1441AC_SUBST(FLAG_MMMX)
1442
1443
1444# does this compiler support -msse ?
1445AC_MSG_CHECKING([if gcc accepts -msse])
1446
1447safe_CFLAGS=$CFLAGS
1448CFLAGS="-msse"
1449
bart417cf3e2011-10-22 09:21:24 +00001450AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001451 return 0;
bart417cf3e2011-10-22 09:21:24 +00001452]])], [
sewardj67f1fcc2005-07-03 10:41:02 +00001453FLAG_MSSE="-msse"
1454AC_MSG_RESULT([yes])
1455], [
1456FLAG_MSSE=""
1457AC_MSG_RESULT([no])
1458])
1459CFLAGS=$safe_CFLAGS
1460
1461AC_SUBST(FLAG_MSSE)
1462
1463
sewardj5b754b42002-06-03 22:53:35 +00001464# does this compiler support -mpreferred-stack-boundary=2 ?
1465AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
1466
daywalker3664f562003-10-17 13:43:46 +00001467safe_CFLAGS=$CFLAGS
sewardj5b754b42002-06-03 22:53:35 +00001468CFLAGS="-mpreferred-stack-boundary=2"
1469
bart417cf3e2011-10-22 09:21:24 +00001470AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001471 return 0;
bart417cf3e2011-10-22 09:21:24 +00001472]])], [
sewardj5b754b42002-06-03 22:53:35 +00001473PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2"
daywalker3664f562003-10-17 13:43:46 +00001474AC_MSG_RESULT([yes])
sewardj5b754b42002-06-03 22:53:35 +00001475], [
1476PREFERRED_STACK_BOUNDARY=""
1477AC_MSG_RESULT([no])
1478])
daywalker3664f562003-10-17 13:43:46 +00001479CFLAGS=$safe_CFLAGS
sewardj5b754b42002-06-03 22:53:35 +00001480
1481AC_SUBST(PREFERRED_STACK_BOUNDARY)
1482
sewardj535c50f2005-06-04 23:14:53 +00001483
florianda8c1262012-11-18 14:39:11 +00001484# does this compiler support -Wno-pointer-sign ?
1485AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign])
1486
1487safe_CFLAGS=$CFLAGS
1488CFLAGS="-Wno-pointer-sign"
1489
1490AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1491 return 0;
1492]])], [
1493no_pointer_sign=yes
1494AC_MSG_RESULT([yes])
1495], [
1496no_pointer_sign=no
1497AC_MSG_RESULT([no])
1498])
1499CFLAGS=$safe_CFLAGS
1500
1501AM_CONDITIONAL(HAS_POINTER_SIGN_WARNING, test x$no_pointer_sign = xyes)
1502
1503
florian6bd9dc12012-11-23 16:17:43 +00001504# does this compiler support -Wno-write-strings ?
1505AC_MSG_CHECKING([if gcc accepts -Wwrite-strings])
1506
1507safe_CFLAGS=$CFLAGS
1508CFLAGS="-Wwrite-strings"
1509
1510AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1511 return 0;
1512]])], [
1513no_write_strings=yes
1514AC_MSG_RESULT([yes])
1515], [
1516no_write_strings=no
1517AC_MSG_RESULT([no])
1518])
1519CFLAGS=$safe_CFLAGS
1520
1521if test x$no_write_strings = xyes; then
1522 CFLAGS="$CFLAGS -Wwrite-strings"
1523fi
1524
1525AM_CONDITIONAL(HAS_WRITE_STRINGS_WARNING, test x$no_write_strings = xyes)
1526
barte026bd22009-07-04 12:17:07 +00001527# does this compiler support -Wno-empty-body ?
1528
1529AC_MSG_CHECKING([if gcc accepts -Wno-empty-body])
1530
1531safe_CFLAGS=$CFLAGS
1532CFLAGS="-Wno-empty-body"
1533
bart417cf3e2011-10-22 09:21:24 +00001534AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
barte026bd22009-07-04 12:17:07 +00001535 return 0;
bart417cf3e2011-10-22 09:21:24 +00001536]])], [
barte026bd22009-07-04 12:17:07 +00001537AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body])
1538AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001539], [
barte026bd22009-07-04 12:17:07 +00001540AC_SUBST([FLAG_W_NO_EMPTY_BODY], [])
1541AC_MSG_RESULT([no])
1542])
1543CFLAGS=$safe_CFLAGS
1544
1545
bart9d865fa2008-06-23 12:11:49 +00001546# does this compiler support -Wno-format-zero-length ?
1547
1548AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
1549
1550safe_CFLAGS=$CFLAGS
1551CFLAGS="-Wno-format-zero-length"
1552
bart417cf3e2011-10-22 09:21:24 +00001553AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart9d865fa2008-06-23 12:11:49 +00001554 return 0;
bart417cf3e2011-10-22 09:21:24 +00001555]])], [
bart9d865fa2008-06-23 12:11:49 +00001556AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
1557AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001558], [
bart9d865fa2008-06-23 12:11:49 +00001559AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
1560AC_MSG_RESULT([no])
1561])
1562CFLAGS=$safe_CFLAGS
1563
1564
bart8e216312011-05-15 17:05:36 +00001565# does this compiler support -Wno-nonnull ?
1566
1567AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
1568
1569safe_CFLAGS=$CFLAGS
1570CFLAGS="-Wno-nonnull"
1571
bart417cf3e2011-10-22 09:21:24 +00001572AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart8e216312011-05-15 17:05:36 +00001573 return 0;
bart417cf3e2011-10-22 09:21:24 +00001574]])], [
bart8e216312011-05-15 17:05:36 +00001575AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
1576AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001577], [
bart8e216312011-05-15 17:05:36 +00001578AC_SUBST([FLAG_W_NO_NONNULL], [])
1579AC_MSG_RESULT([no])
1580])
1581CFLAGS=$safe_CFLAGS
1582
1583
1584# does this compiler support -Wno-overflow ?
1585
1586AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
1587
1588safe_CFLAGS=$CFLAGS
1589CFLAGS="-Wno-overflow"
1590
bart417cf3e2011-10-22 09:21:24 +00001591AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart8e216312011-05-15 17:05:36 +00001592 return 0;
bart417cf3e2011-10-22 09:21:24 +00001593]])], [
bart8e216312011-05-15 17:05:36 +00001594AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
1595AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001596], [
bart8e216312011-05-15 17:05:36 +00001597AC_SUBST([FLAG_W_NO_OVERFLOW], [])
1598AC_MSG_RESULT([no])
1599])
1600CFLAGS=$safe_CFLAGS
1601
1602
bartbf9b85c2009-08-12 12:55:56 +00001603# does this compiler support -Wno-uninitialized ?
1604
1605AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
1606
1607safe_CFLAGS=$CFLAGS
1608CFLAGS="-Wno-uninitialized"
1609
bart417cf3e2011-10-22 09:21:24 +00001610AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bartbf9b85c2009-08-12 12:55:56 +00001611 return 0;
bart417cf3e2011-10-22 09:21:24 +00001612]])], [
bartbf9b85c2009-08-12 12:55:56 +00001613AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized])
1614AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001615], [
bartbf9b85c2009-08-12 12:55:56 +00001616AC_SUBST([FLAG_W_NO_UNINITIALIZED], [])
1617AC_MSG_RESULT([no])
1618])
1619CFLAGS=$safe_CFLAGS
1620
1621
bart56730cd2008-05-11 06:41:46 +00001622# does this compiler support -Wextra or the older -W ?
1623
1624AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1625
1626safe_CFLAGS=$CFLAGS
1627CFLAGS="-Wextra"
1628
bart417cf3e2011-10-22 09:21:24 +00001629AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001630 return 0;
bart417cf3e2011-10-22 09:21:24 +00001631]])], [
bart56730cd2008-05-11 06:41:46 +00001632AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1633AC_MSG_RESULT([-Wextra])
1634], [
1635 CFLAGS="-W"
sewardj9bdf2a62011-10-27 06:22:23 +00001636 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001637 return 0;
sewardj9bdf2a62011-10-27 06:22:23 +00001638 ]])], [
bart56730cd2008-05-11 06:41:46 +00001639 AC_SUBST([FLAG_W_EXTRA], [-W])
1640 AC_MSG_RESULT([-W])
1641 ], [
1642 AC_SUBST([FLAG_W_EXTRA], [])
1643 AC_MSG_RESULT([not supported])
1644 ])
1645])
1646CFLAGS=$safe_CFLAGS
1647
1648
sewardja72c26d2007-05-01 13:44:08 +00001649# does this compiler support -fno-stack-protector ?
bart56730cd2008-05-11 06:41:46 +00001650AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
sewardja72c26d2007-05-01 13:44:08 +00001651
1652safe_CFLAGS=$CFLAGS
1653CFLAGS="-fno-stack-protector"
1654
bart417cf3e2011-10-22 09:21:24 +00001655AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001656 return 0;
bart417cf3e2011-10-22 09:21:24 +00001657]])], [
sewardja72c26d2007-05-01 13:44:08 +00001658no_stack_protector=yes
1659FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1660AC_MSG_RESULT([yes])
1661], [
1662no_stack_protector=no
1663FLAG_FNO_STACK_PROTECTOR=""
1664AC_MSG_RESULT([no])
1665])
1666CFLAGS=$safe_CFLAGS
1667
1668AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1669
1670if test x$no_stack_protector = xyes; then
1671 CFLAGS="$CFLAGS -fno-stack-protector"
1672fi
1673
1674
bart56730cd2008-05-11 06:41:46 +00001675# does this compiler support --param inline-unit-growth=... ?
1676
1677AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
1678
1679safe_CFLAGS=$CFLAGS
1680CFLAGS="--param inline-unit-growth=900"
1681
bart417cf3e2011-10-22 09:21:24 +00001682AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001683 return 0;
bart417cf3e2011-10-22 09:21:24 +00001684]])], [
bart56730cd2008-05-11 06:41:46 +00001685AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
1686 ["--param inline-unit-growth=900"])
1687AC_MSG_RESULT([yes])
1688], [
1689AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
1690AC_MSG_RESULT([no])
1691])
1692CFLAGS=$safe_CFLAGS
1693
1694
sewardjd9350682012-04-05 07:55:47 +00001695# does this compiler support -gdwarf-4 -fdebug-types-section ?
1696
1697AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
1698
1699safe_CFLAGS=$CFLAGS
1700CFLAGS="-gdwarf-4 -fdebug-types-section"
1701
1702AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1703 return 0;
1704]])], [
1705ac_have_dwarf4=yes
1706AC_MSG_RESULT([yes])
1707], [
1708ac_have_dwarf4=no
1709AC_MSG_RESULT([no])
1710])
1711AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
1712CFLAGS=$safe_CFLAGS
1713
1714
sewardje4bc7032013-03-22 11:49:46 +00001715# We want to use use the -Ttext-segment option to the linker.
1716# GNU (bfd) ld supports this directly. Newer GNU gold linkers
1717# support it as an alias of -Ttext. Sadly GNU (bfd) ld's -Ttext
1718# semantics are NOT what we want (GNU gold -Ttext is fine).
1719#
1720# For GNU (bfd) ld -Ttext-segment chooses the base at which ELF headers
1721# will reside. -Ttext aligns just the .text section start (but not any
1722# other section).
1723#
1724# So test for -Ttext-segment which is supported by all bfd ld versions
1725# and use that if it exists. If it doesn't exist it must be an older
1726# version of gold and we can fall back to using -Ttext which has the
1727# right semantics.
bart699fbac2010-06-08 18:23:59 +00001728
sewardje4bc7032013-03-22 11:49:46 +00001729AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
bart699fbac2010-06-08 18:23:59 +00001730
1731safe_CFLAGS=$CFLAGS
mjw941277a2013-04-17 19:11:05 +00001732CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
bart699fbac2010-06-08 18:23:59 +00001733
bart8508c752010-06-10 06:26:21 +00001734AC_LINK_IFELSE(
mjw941277a2013-04-17 19:11:05 +00001735[AC_LANG_SOURCE([int _start () { return 0; }])],
bart699fbac2010-06-08 18:23:59 +00001736[
tom04ce9f52013-03-28 15:53:21 +00001737 linker_using_t_text="no"
sewardje4bc7032013-03-22 11:49:46 +00001738 AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
bart699fbac2010-06-08 18:23:59 +00001739 AC_MSG_RESULT([yes])
1740], [
tom04ce9f52013-03-28 15:53:21 +00001741 linker_using_t_text="yes"
sewardje4bc7032013-03-22 11:49:46 +00001742 AC_SUBST([FLAG_T_TEXT], ["-Ttext"])
bart699fbac2010-06-08 18:23:59 +00001743 AC_MSG_RESULT([no])
1744])
1745CFLAGS=$safe_CFLAGS
1746
tom04ce9f52013-03-28 15:53:21 +00001747# If the linker only supports -Ttext (not -Ttext-segment) then we will
1748# have to strip any build-id ELF NOTEs from the staticly linked tools.
1749# Otherwise the build-id NOTE might end up at the default load address.
1750# (Pedantically if the linker is gold then -Ttext is fine, but newer
1751# gold versions also support -Ttext-segment. So just assume that unless
1752# we can use -Ttext-segment we need to strip the build-id NOTEs.
1753if test "x${linker_using_t_text}" == "xyes"; then
1754AC_MSG_NOTICE([ld -Ttext used, need to strip build-id NOTEs.])
1755# does the linker support -Wl,--build-id=none ? Note, it's
1756# important that we test indirectly via whichever C compiler
1757# is selected, rather than testing /usr/bin/ld or whatever
1758# directly.
1759AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
1760safe_CFLAGS=$CFLAGS
1761CFLAGS="-Wl,--build-id=none"
1762
1763AC_LINK_IFELSE(
1764[AC_LANG_PROGRAM([ ], [return 0;])],
1765[
1766 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
1767 AC_MSG_RESULT([yes])
1768], [
1769 AC_SUBST([FLAG_NO_BUILD_ID], [""])
1770 AC_MSG_RESULT([no])
1771])
1772else
1773AC_MSG_NOTICE([ld -Ttext-segment used, no need to strip build-id NOTEs.])
1774AC_SUBST([FLAG_NO_BUILD_ID], [""])
1775fi
1776CFLAGS=$safe_CFLAGS
bart699fbac2010-06-08 18:23:59 +00001777
sewardj00f1e622006-03-12 16:47:10 +00001778# does the ppc assembler support "mtocrf" et al?
1779AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
1780
bart417cf3e2011-10-22 09:21:24 +00001781AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjdd4cbe12006-03-12 17:27:44 +00001782__asm__ __volatile__("mtocrf 4,0");
1783__asm__ __volatile__("mfocrf 0,4");
bart417cf3e2011-10-22 09:21:24 +00001784]])], [
sewardj00f1e622006-03-12 16:47:10 +00001785ac_have_as_ppc_mftocrf=yes
1786AC_MSG_RESULT([yes])
1787], [
1788ac_have_as_ppc_mftocrf=no
1789AC_MSG_RESULT([no])
1790])
1791if test x$ac_have_as_ppc_mftocrf = xyes ; then
1792 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
1793fi
1794
1795
carll1e5fa2f2013-08-09 21:55:45 +00001796# does the ppc assembler support "lfdp" and other phased out floating point insns?
1797AC_MSG_CHECKING([if ppc32/64 asm supports phased out floating point instructions])
1798
1799AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1800 do { typedef struct {
1801 double hi;
1802 double lo;
1803 } dbl_pair_t;
1804 dbl_pair_t dbl_pair[3];
1805 __asm__ volatile ("lfdp 10, %0"::"m" (dbl_pair[0]));
1806 } while (0)
1807]])], [
1808ac_have_as_ppc_fpPO=yes
1809AC_MSG_RESULT([yes])
1810], [
1811ac_have_as_ppc_fpPO=no
1812AC_MSG_RESULT([no])
1813])
1814if test x$ac_have_as_ppc_fpPO = xyes ; then
1815 AC_DEFINE(HAVE_AS_PPC_FPPO, 1, [Define to 1 if as supports floating point phased out category.])
1816fi
1817
sewardjb5b87402011-03-07 16:05:35 +00001818CFLAGS=$safe_CFLAGS
1819
sewardjf0aabf82007-03-22 00:24:21 +00001820# does the x86/amd64 assembler understand SSE3 instructions?
sewardjfa18a262007-03-22 12:13:13 +00001821# Note, this doesn't generate a C-level symbol. It generates a
1822# automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
sewardjf0aabf82007-03-22 00:24:21 +00001823AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
1824
bart417cf3e2011-10-22 09:21:24 +00001825AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjf0aabf82007-03-22 00:24:21 +00001826 do { long long int x;
1827 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
1828 while (0)
bart417cf3e2011-10-22 09:21:24 +00001829]])], [
sewardjf0aabf82007-03-22 00:24:21 +00001830ac_have_as_sse3=yes
1831AC_MSG_RESULT([yes])
1832], [
1833ac_have_as_sse3=no
1834AC_MSG_RESULT([no])
1835])
sewardjfa18a262007-03-22 12:13:13 +00001836
1837AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
sewardjf0aabf82007-03-22 00:24:21 +00001838
1839
sewardj6d6da5b2008-02-09 12:07:40 +00001840# Ditto for SSSE3 instructions (note extra S)
1841# Note, this doesn't generate a C-level symbol. It generates a
1842# automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
1843AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
1844
florianc443b962011-10-28 21:37:19 +00001845save_CFLAGS="$CFLAGS"
1846CFLAGS="$CFLAGS -msse"
bart417cf3e2011-10-22 09:21:24 +00001847AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardj6d6da5b2008-02-09 12:07:40 +00001848 do { long long int x;
1849 __asm__ __volatile__(
1850 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
1851 while (0)
bart417cf3e2011-10-22 09:21:24 +00001852]])], [
sewardj6d6da5b2008-02-09 12:07:40 +00001853ac_have_as_ssse3=yes
1854AC_MSG_RESULT([yes])
1855], [
1856ac_have_as_ssse3=no
1857AC_MSG_RESULT([no])
1858])
florianc443b962011-10-28 21:37:19 +00001859CFLAGS="$save_CFLAGS"
sewardj6d6da5b2008-02-09 12:07:40 +00001860
1861AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
1862
1863
sewardj27d176a2011-01-17 11:15:48 +00001864# does the x86/amd64 assembler understand the PCLMULQDQ instruction?
1865# Note, this doesn't generate a C-level symbol. It generates a
1866# automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
sewardje3ae8a32010-09-28 19:59:47 +00001867AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
bart417cf3e2011-10-22 09:21:24 +00001868AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardje3ae8a32010-09-28 19:59:47 +00001869 do {
1870 __asm__ __volatile__(
1871 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
1872 while (0)
bart417cf3e2011-10-22 09:21:24 +00001873]])], [
sewardje3ae8a32010-09-28 19:59:47 +00001874ac_have_as_pclmulqdq=yes
1875AC_MSG_RESULT([yes])
1876], [
1877ac_have_as_pclmulqdq=no
1878AC_MSG_RESULT([no])
1879])
1880
1881AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
1882
1883
bart9bbe2bb2012-08-03 19:37:02 +00001884# does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
1885# Note, this doesn't generate a C-level symbol. It generates a
1886# automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
1887AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
1888AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1889 do {
1890 /*
1891 * Carry-less multiplication of xmm1 with xmm2 and store the result in
1892 * xmm3. The immediate is used to determine which quadwords of xmm1 and
1893 * xmm2 should be used.
1894 */
1895 __asm__ __volatile__(
1896 "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
1897 } while (0)
1898]])], [
1899ac_have_as_vpclmulqdq=yes
1900AC_MSG_RESULT([yes])
1901], [
1902ac_have_as_vpclmulqdq=no
1903AC_MSG_RESULT([no])
1904])
1905
1906AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
1907
1908
sewardj27d176a2011-01-17 11:15:48 +00001909# does the x86/amd64 assembler understand the LZCNT instruction?
1910# Note, this doesn't generate a C-level symbol. It generates a
1911# automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
bart55e438b2010-09-14 10:53:57 +00001912AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
1913
bart417cf3e2011-10-22 09:21:24 +00001914AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
bart55e438b2010-09-14 10:53:57 +00001915 do {
sewardjc62291c2012-07-22 11:10:08 +00001916 __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
bart55e438b2010-09-14 10:53:57 +00001917 } while (0)
bart417cf3e2011-10-22 09:21:24 +00001918]])], [
bart55e438b2010-09-14 10:53:57 +00001919 ac_have_as_lzcnt=yes
1920 AC_MSG_RESULT([yes])
1921], [
1922 ac_have_as_lzcnt=no
1923 AC_MSG_RESULT([no])
1924])
1925
1926AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
1927
sewardj27d176a2011-01-17 11:15:48 +00001928
1929# does the x86/amd64 assembler understand SSE 4.2 instructions?
1930# Note, this doesn't generate a C-level symbol. It generates a
1931# automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
1932AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
1933
bart417cf3e2011-10-22 09:21:24 +00001934AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardj27d176a2011-01-17 11:15:48 +00001935 do { long long int x;
1936 __asm__ __volatile__(
florianfdfca222012-01-17 13:16:50 +00001937 "crc32q %%r15,%%r15" : : : "r15" );
1938 __asm__ __volatile__(
sewardjc62291c2012-07-22 11:10:08 +00001939 "pblendvb (%%rcx), %%xmm11" : : : "memory", "xmm11");
1940 __asm__ __volatile__(
1941 "aesdec %%xmm2, %%xmm1" : : : "xmm2", "xmm1"); }
sewardj27d176a2011-01-17 11:15:48 +00001942 while (0)
bart417cf3e2011-10-22 09:21:24 +00001943]])], [
sewardj27d176a2011-01-17 11:15:48 +00001944ac_have_as_sse42=yes
1945AC_MSG_RESULT([yes])
1946], [
1947ac_have_as_sse42=no
1948AC_MSG_RESULT([no])
1949])
1950
1951AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
1952
1953
sewardj9fb31ca2012-06-05 00:31:49 +00001954# does the x86/amd64 assembler understand AVX instructions?
1955# Note, this doesn't generate a C-level symbol. It generates a
1956# automake-level symbol (BUILD_AVX_TESTS), used in test Makefile.am's
1957AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX])
1958
1959AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1960 do { long long int x;
1961 __asm__ __volatile__(
1962 "vmovupd (%%rsp), %%ymm7" : : : "xmm7" );
1963 __asm__ __volatile__(
1964 "vaddpd %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
1965 while (0)
1966]])], [
1967ac_have_as_avx=yes
1968AC_MSG_RESULT([yes])
1969], [
1970ac_have_as_avx=no
1971AC_MSG_RESULT([no])
1972])
1973
1974AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
1975
1976
sewardjfda50af2013-03-27 11:43:20 +00001977# does the x86/amd64 assembler understand AVX2 instructions?
1978# Note, this doesn't generate a C-level symbol. It generates a
1979# automake-level symbol (BUILD_AVX2_TESTS), used in test Makefile.am's
1980AC_MSG_CHECKING([if x86/amd64 assembler speaks AVX2])
1981
1982AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1983 do { long long int x;
1984 __asm__ __volatile__(
1985 "vpsravd (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
1986 __asm__ __volatile__(
1987 "vpaddb %%ymm6,%%ymm7,%%ymm8" : : : "xmm6","xmm7","xmm8"); }
1988 while (0)
1989]])], [
1990ac_have_as_avx2=yes
1991AC_MSG_RESULT([yes])
1992], [
1993ac_have_as_avx2=no
1994AC_MSG_RESULT([no])
1995])
1996
1997AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
1998
1999
florian364c3652013-09-30 16:32:53 +00002000# does the x86/amd64 assembler understand TSX instructions?
2001# Note, this doesn't generate a C-level symbol. It generates a
2002# automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
2003AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
2004
2005AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2006 do {
2007 __asm__ __volatile__(
2008 " xbegin Lfoo \n\t"
2009 "Lfoo: xend \n\t");
2010 } while (0)
2011]])], [
2012ac_have_as_tsx=yes
2013AC_MSG_RESULT([yes])
2014], [
2015ac_have_as_tsx=no
2016AC_MSG_RESULT([no])
2017])
2018
2019AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
2020
2021
sewardjfda50af2013-03-27 11:43:20 +00002022# does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
2023# Note, this doesn't generate a C-level symbol. It generates a
2024# automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
2025AC_MSG_CHECKING([if x86/amd64 assembler speaks BMI1 and BMI2])
2026
2027AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2028 do { unsigned int h, l;
2029 __asm__ __volatile__(
sewardje222efc2013-03-27 21:59:21 +00002030 "andn %2, %1, %0" : "=r" (h) : "r" (0x1234567), "r" (0x7654321) );
sewardjfda50af2013-03-27 11:43:20 +00002031 __asm__ __volatile__(
sewardje222efc2013-03-27 21:59:21 +00002032 "movl %2, %%edx; mulx %3, %1, %0" : "=r" (h), "=r" (l) : "g" (0x1234567), "rm" (0x7654321) : "edx" ); }
sewardjfda50af2013-03-27 11:43:20 +00002033 while (0)
2034]])], [
2035ac_have_as_bmi=yes
2036AC_MSG_RESULT([yes])
2037], [
2038ac_have_as_bmi=no
2039AC_MSG_RESULT([no])
2040])
2041
2042AM_CONDITIONAL(BUILD_BMI_TESTS, test x$ac_have_as_bmi = xyes)
2043
2044
2045# does the x86/amd64 assembler understand FMA instructions?
2046# Note, this doesn't generate a C-level symbol. It generates a
2047# automake-level symbol (BUILD_FMA_TESTS), used in test Makefile.am's
2048AC_MSG_CHECKING([if x86/amd64 assembler speaks FMA])
2049
2050AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2051 do { unsigned int h, l;
2052 __asm__ __volatile__(
2053 "vfmadd132ps (%%rsp), %%ymm8, %%ymm7" : : : "xmm7", "xmm8" );
2054 __asm__ __volatile__(
2055 "vfnmsub231sd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" );
2056 __asm__ __volatile__(
2057 "vfmsubadd213pd (%%rsp), %%xmm8, %%xmm7" : : : "xmm7", "xmm8" ); }
2058 while (0)
2059]])], [
2060ac_have_as_fma=yes
2061AC_MSG_RESULT([yes])
2062], [
2063ac_have_as_fma=no
2064AC_MSG_RESULT([no])
2065])
2066
2067AM_CONDITIONAL(BUILD_FMA_TESTS, test x$ac_have_as_fma = xyes)
2068
2069
sewardjb08d84d2012-07-16 08:23:26 +00002070# does the x86/amd64 assembler understand MOVBE?
2071# Note, this doesn't generate a C-level symbol. It generates a
2072# automake-level symbol (BUILD_MOVBE_TESTS), used in test Makefile.am's
2073AC_MSG_CHECKING([if x86/amd64 assembler knows the MOVBE insn])
2074
2075AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
2076 do { long long int x;
2077 __asm__ __volatile__(
sewardjc62291c2012-07-22 11:10:08 +00002078 "movbe (%%rsp), %%r15" : : : "memory", "r15" ); }
sewardjb08d84d2012-07-16 08:23:26 +00002079 while (0)
2080]])], [
2081ac_have_as_movbe=yes
2082AC_MSG_RESULT([yes])
2083], [
2084ac_have_as_movbe=no
2085AC_MSG_RESULT([no])
2086])
2087
2088AM_CONDITIONAL(BUILD_MOVBE_TESTS, test x$ac_have_as_movbe = xyes)
2089
2090
florian251c2f92012-07-05 21:21:37 +00002091# Does the C compiler support the "ifunc" attribute
2092# Note, this doesn't generate a C-level symbol. It generates a
2093# automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
2094AC_MSG_CHECKING([if gcc supports the ifunc attribute])
2095
florianf78a5032012-07-06 09:17:29 +00002096AC_LINK_IFELSE([AC_LANG_SOURCE([[
2097static void mytest(void) {}
2098
2099static void (*resolve_test(void))(void)
2100{
2101 return (void (*)(void))&mytest;
2102}
2103
2104void test(void) __attribute__((ifunc("resolve_test")));
2105
2106int main()
2107{
2108 test();
2109 return 0;
2110}
florian251c2f92012-07-05 21:21:37 +00002111]])], [
2112ac_have_ifunc_attr=yes
2113AC_MSG_RESULT([yes])
2114], [
2115ac_have_ifunc_attr=no
2116AC_MSG_RESULT([no])
2117])
2118
2119AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
2120
2121
sewardje089f012010-10-13 21:47:29 +00002122# XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
2123# when building the tool executables. I think we should get rid of it.
2124#
sewardjb5f6f512005-03-10 23:59:00 +00002125# Check for TLS support in the compiler and linker
bart2bd9a682011-10-22 09:46:16 +00002126AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
2127 [[return foo;]])],
2128 [vg_cv_linktime_tls=yes],
2129 [vg_cv_linktime_tls=no])
bartca9f2ad2008-06-02 07:14:20 +00002130# Native compilation: check whether running a program using TLS succeeds.
2131# Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
2132# succeeds but running programs using TLS fails.
bart2bd9a682011-10-22 09:46:16 +00002133# Cross-compiling: check whether linking a program using TLS succeeds.
bartca9f2ad2008-06-02 07:14:20 +00002134AC_CACHE_CHECK([for TLS support], vg_cv_tls,
2135 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
2136 [vg_cv_tls=$enableval],
2137 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
2138 [[return foo;]])],
2139 [vg_cv_tls=yes],
bart2bd9a682011-10-22 09:46:16 +00002140 [vg_cv_tls=no],
2141 [vg_cv_tls=$vg_cv_linktime_tls])])])
sewardjb5f6f512005-03-10 23:59:00 +00002142
2143if test "$vg_cv_tls" = yes; then
2144AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
2145fi
sewardj5b754b42002-06-03 22:53:35 +00002146
sewardj535c50f2005-06-04 23:14:53 +00002147
njn7fd6d382009-01-22 21:56:32 +00002148#----------------------------------------------------------------------------
bart62f54e42008-07-28 11:35:10 +00002149# Checks for C header files.
njn7fd6d382009-01-22 21:56:32 +00002150#----------------------------------------------------------------------------
2151
sewardjde4a1d02002-03-22 01:27:54 +00002152AC_HEADER_STDC
bartf5ceec82008-04-26 07:45:10 +00002153AC_CHECK_HEADERS([ \
bart1f2b1432009-01-16 12:06:54 +00002154 asm/unistd.h \
bartf5ceec82008-04-26 07:45:10 +00002155 endian.h \
2156 mqueue.h \
2157 sys/endian.h \
2158 sys/epoll.h \
2159 sys/eventfd.h \
bartce48fa92008-04-26 10:59:46 +00002160 sys/klog.h \
bartf5ceec82008-04-26 07:45:10 +00002161 sys/poll.h \
bart71bad292008-04-27 11:43:23 +00002162 sys/signal.h \
bartf5ceec82008-04-26 07:45:10 +00002163 sys/signalfd.h \
bart71bad292008-04-27 11:43:23 +00002164 sys/syscall.h \
2165 sys/time.h \
2166 sys/types.h \
bartf5ceec82008-04-26 07:45:10 +00002167 ])
sewardjde4a1d02002-03-22 01:27:54 +00002168
bart818f17e2011-09-17 06:24:49 +00002169# Verify whether the <linux/futex.h> header is usable.
2170AC_MSG_CHECKING([if <linux/futex.h> is usable])
2171
sewardjc12486b2012-12-17 14:46:48 +00002172save_CFLAGS="$CFLAGS"
2173CFLAGS="$CFLAGS -D__user="
bart417cf3e2011-10-22 09:21:24 +00002174AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart818f17e2011-09-17 06:24:49 +00002175#include <linux/futex.h>
bart417cf3e2011-10-22 09:21:24 +00002176]], [[
bart818f17e2011-09-17 06:24:49 +00002177 return FUTEX_WAIT;
bart417cf3e2011-10-22 09:21:24 +00002178]])], [
bart78bfc712011-12-08 16:14:59 +00002179ac_have_usable_linux_futex_h=yes
bart818f17e2011-09-17 06:24:49 +00002180AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
2181 [Define to 1 if you have a usable <linux/futex.h> header file.])
2182AC_MSG_RESULT([yes])
2183], [
bart78bfc712011-12-08 16:14:59 +00002184ac_have_usable_linux_futex_h=no
bart818f17e2011-09-17 06:24:49 +00002185AC_MSG_RESULT([no])
2186])
sewardjc12486b2012-12-17 14:46:48 +00002187CFLAGS="$save_CFLAGS"
2188
bart818f17e2011-09-17 06:24:49 +00002189
njn7fd6d382009-01-22 21:56:32 +00002190#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002191# Checks for typedefs, structures, and compiler characteristics.
njn7fd6d382009-01-22 21:56:32 +00002192#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002193AC_TYPE_UID_T
2194AC_TYPE_OFF_T
2195AC_TYPE_SIZE_T
2196AC_HEADER_TIME
2197
sewardj535c50f2005-06-04 23:14:53 +00002198
njn7fd6d382009-01-22 21:56:32 +00002199#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002200# Checks for library functions.
njn7fd6d382009-01-22 21:56:32 +00002201#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00002202AC_FUNC_MEMCMP
2203AC_FUNC_MMAP
sewardjde4a1d02002-03-22 01:27:54 +00002204
bart26288e42011-04-03 16:46:01 +00002205AC_CHECK_LIB([pthread], [pthread_create])
bart71bad292008-04-27 11:43:23 +00002206AC_CHECK_LIB([rt], [clock_gettime])
bart41ac62a2008-07-07 16:58:03 +00002207
bartf5ceec82008-04-26 07:45:10 +00002208AC_CHECK_FUNCS([ \
bart71bad292008-04-27 11:43:23 +00002209 clock_gettime\
bartf5ceec82008-04-26 07:45:10 +00002210 epoll_create \
2211 epoll_pwait \
bartce48fa92008-04-26 10:59:46 +00002212 klogctl \
bartf5ceec82008-04-26 07:45:10 +00002213 mallinfo \
2214 memchr \
2215 memset \
2216 mkdir \
njnf76d27a2009-05-28 01:53:07 +00002217 mremap \
bartf5ceec82008-04-26 07:45:10 +00002218 ppoll \
bart6d45e922009-01-20 13:45:38 +00002219 pthread_barrier_init \
2220 pthread_condattr_setclock \
2221 pthread_mutex_timedlock \
2222 pthread_rwlock_timedrdlock \
2223 pthread_rwlock_timedwrlock \
2224 pthread_spin_lock \
barta72a27b2010-04-29 06:22:17 +00002225 pthread_yield \
florianc5325ef2013-09-17 20:15:36 +00002226 pthread_setname_np \
bartd1f724c2009-08-26 18:11:18 +00002227 readlinkat \
bartf5ceec82008-04-26 07:45:10 +00002228 semtimedop \
2229 signalfd \
njn6cc22472009-03-16 03:46:48 +00002230 sigwaitinfo \
bartf5ceec82008-04-26 07:45:10 +00002231 strchr \
2232 strdup \
2233 strpbrk \
2234 strrchr \
2235 strstr \
barta72a27b2010-04-29 06:22:17 +00002236 syscall \
bartf5ceec82008-04-26 07:45:10 +00002237 utimensat \
tom9e4b6362012-02-10 09:39:37 +00002238 process_vm_readv \
2239 process_vm_writev \
bartf5ceec82008-04-26 07:45:10 +00002240 ])
sewardjde4a1d02002-03-22 01:27:54 +00002241
bart623eec32008-07-29 17:54:49 +00002242# AC_CHECK_LIB adds any library found to the variable LIBS, and links these
2243# libraries with any shared object and/or executable. This is NOT what we
2244# want for e.g. vgpreload_core-x86-linux.so
2245LIBS=""
sewardj80637752006-03-02 13:48:21 +00002246
bart6d45e922009-01-20 13:45:38 +00002247AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
2248 [test x$ac_cv_func_pthread_barrier_init = xyes])
bart2eaa8f22009-01-20 14:01:16 +00002249AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
2250 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
bart6d45e922009-01-20 13:45:38 +00002251AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
2252 [test x$ac_cv_func_pthread_spin_lock = xyes])
florianc5325ef2013-09-17 20:15:36 +00002253AM_CONDITIONAL([HAVE_PTHREAD_SETNAME_NP],
2254 [test x$ac_cv_func_pthread_setname_np = xyes])
bart6d45e922009-01-20 13:45:38 +00002255
petarjc37cea62013-06-02 18:08:04 +00002256if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
2257 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then
petarj6d79b742012-12-20 18:56:57 +00002258 AC_DEFINE([DISABLE_PTHREAD_SPINLOCK_INTERCEPT], 1,
petarjc37cea62013-06-02 18:08:04 +00002259 [Disable intercept pthread_spin_lock() on MIPS32 and MIPS64.])
petarj6d79b742012-12-20 18:56:57 +00002260fi
njn7fd6d382009-01-22 21:56:32 +00002261
2262#----------------------------------------------------------------------------
2263# MPI checks
2264#----------------------------------------------------------------------------
sewardj03d86f22006-10-17 00:57:24 +00002265# Do we have a useable MPI setup on the primary and/or secondary targets?
2266# On Linux, by default, assumes mpicc and -m32/-m64
sewardje9fa5062006-03-12 18:29:18 +00002267# Note: this is a kludge in that it assumes the specified mpicc
sewardj6e9de462011-06-28 07:25:29 +00002268# understands -m32/-m64 regardless of what is specified using
sewardj03d86f22006-10-17 00:57:24 +00002269# --with-mpicc=.
sewardj0ad46092006-03-02 17:09:16 +00002270MPI_CC="mpicc"
sewardj03d86f22006-10-17 00:57:24 +00002271
sewardje9fa5062006-03-12 18:29:18 +00002272mflag_primary=
njn7fd6d382009-01-22 21:56:32 +00002273if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
sewardj6e9de462011-06-28 07:25:29 +00002274 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj5db15402012-06-07 09:13:21 +00002275 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
petarj4df0bfc2013-02-27 23:17:33 +00002276 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \
2277 -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX ; then
sewardje9fa5062006-03-12 18:29:18 +00002278 mflag_primary=$FLAG_M32
njn7fd6d382009-01-22 21:56:32 +00002279elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
sewardjb5b87402011-03-07 16:05:35 +00002280 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
2281 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
sewardje9fa5062006-03-12 18:29:18 +00002282 mflag_primary=$FLAG_M64
philippef7c54332012-05-17 15:32:54 +00002283elif test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN ; then
2284 mflag_primary="$FLAG_M32 -arch i386"
2285elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN ; then
2286 mflag_primary="$FLAG_M64 -arch x86_64"
sewardje9fa5062006-03-12 18:29:18 +00002287fi
2288
sewardj03d86f22006-10-17 00:57:24 +00002289mflag_secondary=
njn7fd6d382009-01-22 21:56:32 +00002290if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
2291 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then
sewardj03d86f22006-10-17 00:57:24 +00002292 mflag_secondary=$FLAG_M32
philippef7c54332012-05-17 15:32:54 +00002293elif test x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN ; then
2294 mflag_secondary="$FLAG_M32 -arch i386"
sewardj03d86f22006-10-17 00:57:24 +00002295fi
2296
2297
sewardj0ad46092006-03-02 17:09:16 +00002298AC_ARG_WITH(mpicc,
sewardjb70a6132006-05-27 21:14:09 +00002299 [ --with-mpicc= Specify name of MPI2-ised C compiler],
sewardj0ad46092006-03-02 17:09:16 +00002300 MPI_CC=$withval
2301)
sewardj03d86f22006-10-17 00:57:24 +00002302AC_SUBST(MPI_CC)
2303
philippef7c54332012-05-17 15:32:54 +00002304## We AM_COND_IF here instead of automake "if" in mpi/Makefile.am so that we can
2305## use these values in the check for a functioning mpicc.
2306##
2307## We leave the MPI_FLAG_M3264_ logic in mpi/Makefile.am and assume that
2308## mflag_primary/mflag_secondary are sufficient approximations of that behavior
2309AM_COND_IF([VGCONF_OS_IS_LINUX],
2310 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -fpic"
2311 LDFLAGS_MPI="-fpic -shared"])
2312AM_COND_IF([VGCONF_OS_IS_DARWIN],
2313 [CFLAGS_MPI="-g -O -fno-omit-frame-pointer -Wall -dynamic"
2314 LDFLAGS_MPI="-dynamic -dynamiclib -all_load"])
2315
2316AC_SUBST([CFLAGS_MPI])
2317AC_SUBST([LDFLAGS_MPI])
2318
2319
sewardj03d86f22006-10-17 00:57:24 +00002320## See if MPI_CC works for the primary target
2321##
2322AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
sewardj0ad46092006-03-02 17:09:16 +00002323saved_CC=$CC
sewardjde4f3842006-03-09 02:41:41 +00002324saved_CFLAGS=$CFLAGS
sewardj0ad46092006-03-02 17:09:16 +00002325CC=$MPI_CC
philippef7c54332012-05-17 15:32:54 +00002326CFLAGS="$CFLAGS_MPI $mflag_primary"
2327saved_LDFLAGS="$LDFLAGS"
2328LDFLAGS="$LDFLAGS_MPI $mflag_primary"
bart417cf3e2011-10-22 09:21:24 +00002329AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sewardj1a85e602006-03-08 15:26:10 +00002330#include <mpi.h>
2331#include <stdio.h>
bart417cf3e2011-10-22 09:21:24 +00002332]], [[
philippef7c54332012-05-17 15:32:54 +00002333 int ni, na, nd, comb;
sewardjde4f3842006-03-09 02:41:41 +00002334 int r = MPI_Init(NULL,NULL);
philippef7c54332012-05-17 15:32:54 +00002335 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
2336 r |= MPI_Finalize();
sewardjde4f3842006-03-09 02:41:41 +00002337 return r;
bart417cf3e2011-10-22 09:21:24 +00002338]])], [
sewardj03d86f22006-10-17 00:57:24 +00002339ac_have_mpi2_pri=yes
sewardj1a85e602006-03-08 15:26:10 +00002340AC_MSG_RESULT([yes, $MPI_CC])
sewardj80637752006-03-02 13:48:21 +00002341], [
sewardj03d86f22006-10-17 00:57:24 +00002342ac_have_mpi2_pri=no
sewardj80637752006-03-02 13:48:21 +00002343AC_MSG_RESULT([no])
2344])
sewardj0ad46092006-03-02 17:09:16 +00002345CC=$saved_CC
sewardjde4f3842006-03-09 02:41:41 +00002346CFLAGS=$saved_CFLAGS
philippef7c54332012-05-17 15:32:54 +00002347LDFLAGS="$saved_LDFLAGS"
sewardj03d86f22006-10-17 00:57:24 +00002348AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
sewardj80637752006-03-02 13:48:21 +00002349
sewardj03d86f22006-10-17 00:57:24 +00002350## See if MPI_CC works for the secondary target. Complication: what if
2351## there is no secondary target? We need this to then fail.
2352## Kludge this by making MPI_CC something which will surely fail in
2353## such a case.
2354##
2355AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
2356saved_CC=$CC
2357saved_CFLAGS=$CFLAGS
philippef7c54332012-05-17 15:32:54 +00002358saved_LDFLAGS="$LDFLAGS"
2359LDFLAGS="$LDFLAGS_MPI $mflag_secondary"
njn7fd6d382009-01-22 21:56:32 +00002360if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
sewardj03d86f22006-10-17 00:57:24 +00002361 CC="$MPI_CC this will surely fail"
2362else
2363 CC=$MPI_CC
2364fi
philippef7c54332012-05-17 15:32:54 +00002365CFLAGS="$CFLAGS_MPI $mflag_secondary"
bart417cf3e2011-10-22 09:21:24 +00002366AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sewardj03d86f22006-10-17 00:57:24 +00002367#include <mpi.h>
2368#include <stdio.h>
bart417cf3e2011-10-22 09:21:24 +00002369]], [[
philippef7c54332012-05-17 15:32:54 +00002370 int ni, na, nd, comb;
sewardj03d86f22006-10-17 00:57:24 +00002371 int r = MPI_Init(NULL,NULL);
philippef7c54332012-05-17 15:32:54 +00002372 r |= MPI_Type_get_envelope( MPI_INT, &ni, &na, &nd, &comb );
2373 r |= MPI_Finalize();
sewardj03d86f22006-10-17 00:57:24 +00002374 return r;
bart417cf3e2011-10-22 09:21:24 +00002375]])], [
sewardj03d86f22006-10-17 00:57:24 +00002376ac_have_mpi2_sec=yes
2377AC_MSG_RESULT([yes, $MPI_CC])
2378], [
2379ac_have_mpi2_sec=no
2380AC_MSG_RESULT([no])
2381])
2382CC=$saved_CC
2383CFLAGS=$saved_CFLAGS
philippef7c54332012-05-17 15:32:54 +00002384LDFLAGS="$saved_LDFLAGS"
sewardj03d86f22006-10-17 00:57:24 +00002385AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
sewardj80637752006-03-02 13:48:21 +00002386
2387
njn7fd6d382009-01-22 21:56:32 +00002388#----------------------------------------------------------------------------
2389# Other library checks
2390#----------------------------------------------------------------------------
bart2ef12d42010-10-18 16:32:11 +00002391# There now follow some tests for Boost, and OpenMP. These
sewardj493c4ef2008-12-13 16:45:19 +00002392# tests are present because Drd has some regression tests that use
2393# these packages. All regression test programs all compiled only
2394# for the primary target. And so it is important that the configure
2395# checks that follow, use the correct -m32 or -m64 flag for the
2396# primary target (called $mflag_primary). Otherwise, we can end up
2397# in a situation (eg) where, on amd64-linux, the test for Boost checks
2398# for usable 64-bit Boost facilities, but because we are doing a 32-bit
2399# only build (meaning, the primary target is x86-linux), the build
2400# of the regtest programs that use Boost fails, because they are
2401# build as 32-bit (IN THIS EXAMPLE).
2402#
2403# Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
2404# NEEDED BY THE REGRESSION TEST PROGRAMS.
2405
2406
sewardj493c4ef2008-12-13 16:45:19 +00002407# Check whether the boost library 1.35 or later has been installed.
2408# The Boost.Threads library has undergone a major rewrite in version 1.35.0.
2409
2410AC_MSG_CHECKING([for boost])
2411
2412AC_LANG(C++)
2413safe_CXXFLAGS=$CXXFLAGS
bart7129c722012-04-18 18:34:22 +00002414CXXFLAGS="$mflag_primary"
2415safe_LIBS="$LIBS"
2416LIBS="-lboost_thread-mt $LIBS"
sewardj493c4ef2008-12-13 16:45:19 +00002417
bart128fc522011-03-12 10:36:35 +00002418AC_LINK_IFELSE([AC_LANG_SOURCE([
sewardj493c4ef2008-12-13 16:45:19 +00002419#include <boost/thread.hpp>
2420static void thread_func(void)
2421{ }
2422int main(int argc, char** argv)
2423{
2424 boost::thread t(thread_func);
2425 return 0;
2426}
bart128fc522011-03-12 10:36:35 +00002427])],
sewardj493c4ef2008-12-13 16:45:19 +00002428[
2429ac_have_boost_1_35=yes
2430AC_SUBST([BOOST_CFLAGS], [])
bartbb31f2d2012-04-18 18:42:34 +00002431AC_SUBST([BOOST_LIBS], [-lboost_thread-mt])
sewardj493c4ef2008-12-13 16:45:19 +00002432AC_MSG_RESULT([yes])
2433], [
2434ac_have_boost_1_35=no
2435AC_MSG_RESULT([no])
2436])
2437
bart7129c722012-04-18 18:34:22 +00002438LIBS="$safe_LIBS"
sewardj493c4ef2008-12-13 16:45:19 +00002439CXXFLAGS=$safe_CXXFLAGS
2440AC_LANG(C)
2441
2442AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
2443
2444
2445# does this compiler support -fopenmp, does it have the include file
2446# <omp.h> and does it have libgomp ?
2447
2448AC_MSG_CHECKING([for OpenMP])
2449
2450safe_CFLAGS=$CFLAGS
sewardjc876a2f2009-01-22 22:44:30 +00002451CFLAGS="-fopenmp $mflag_primary"
sewardj493c4ef2008-12-13 16:45:19 +00002452
bart128fc522011-03-12 10:36:35 +00002453AC_LINK_IFELSE([AC_LANG_SOURCE([
sewardj493c4ef2008-12-13 16:45:19 +00002454#include <omp.h>
2455int main(int argc, char** argv)
2456{
2457 omp_set_dynamic(0);
2458 return 0;
2459}
bart128fc522011-03-12 10:36:35 +00002460])],
sewardj493c4ef2008-12-13 16:45:19 +00002461[
2462ac_have_openmp=yes
2463AC_MSG_RESULT([yes])
2464], [
2465ac_have_openmp=no
2466AC_MSG_RESULT([no])
2467])
2468CFLAGS=$safe_CFLAGS
2469
2470AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
2471
2472
bart78bfc712011-12-08 16:14:59 +00002473# does this compiler have built-in functions for atomic memory access for the
2474# primary target ?
2475AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
sewardjc876a2f2009-01-22 22:44:30 +00002476
2477safe_CFLAGS=$CFLAGS
2478CFLAGS="$mflag_primary"
2479
bart417cf3e2011-10-22 09:21:24 +00002480AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjc876a2f2009-01-22 22:44:30 +00002481 int variable = 1;
2482 return (__sync_bool_compare_and_swap(&variable, 1, 2)
2483 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
bart417cf3e2011-10-22 09:21:24 +00002484]])], [
bartb4ff7822011-12-10 19:48:04 +00002485 ac_have_builtin_atomic_primary=yes
sewardjc876a2f2009-01-22 22:44:30 +00002486 AC_MSG_RESULT([yes])
bart78bfc712011-12-08 16:14:59 +00002487 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 +00002488], [
bartb4ff7822011-12-10 19:48:04 +00002489 ac_have_builtin_atomic_primary=no
sewardjc876a2f2009-01-22 22:44:30 +00002490 AC_MSG_RESULT([no])
2491])
2492
2493CFLAGS=$safe_CFLAGS
2494
bartb4ff7822011-12-10 19:48:04 +00002495AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
2496 [test x$ac_have_builtin_atomic_primary = xyes])
bartc82d1372009-05-31 16:21:23 +00002497
bart78bfc712011-12-08 16:14:59 +00002498
2499# does this compiler have built-in functions for atomic memory access for the
2500# secondary target ?
2501
2502if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
2503
2504AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
2505
2506safe_CFLAGS=$CFLAGS
2507CFLAGS="$mflag_secondary"
2508
2509AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2510 int variable = 1;
2511 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
2512]])], [
2513 ac_have_builtin_atomic_secondary=yes
2514 AC_MSG_RESULT([yes])
2515], [
2516 ac_have_builtin_atomic_secondary=no
2517 AC_MSG_RESULT([no])
2518])
2519
2520CFLAGS=$safe_CFLAGS
2521
2522fi
2523
2524AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
2525 [test x$ac_have_builtin_atomic_secondary = xyes])
2526
bart1e856ea2011-12-17 12:53:23 +00002527# does this compiler have built-in functions for atomic memory access on
2528# 64-bit integers for all targets ?
2529
2530AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
2531
2532AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2533 #include <stdint.h>
2534]], [[
2535 uint64_t variable = 1;
2536 return __sync_add_and_fetch(&variable, 1)
2537]])], [
2538 ac_have_builtin_atomic64_primary=yes
2539], [
2540 ac_have_builtin_atomic64_primary=no
2541])
2542
2543if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
2544
2545safe_CFLAGS=$CFLAGS
2546CFLAGS="$mflag_secondary"
2547
2548AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2549 #include <stdint.h>
2550]], [[
2551 uint64_t variable = 1;
2552 return __sync_add_and_fetch(&variable, 1)
2553]])], [
2554 ac_have_builtin_atomic64_secondary=yes
2555], [
2556 ac_have_builtin_atomic64_secondary=no
2557])
2558
2559CFLAGS=$safe_CFLAGS
2560
2561fi
2562
2563if test x$ac_have_builtin_atomic64_primary = xyes && \
2564 test x$VGCONF_PLATFORM_SEC_CAPS = x \
2565 -o x$ac_have_builtin_atomic64_secondary = xyes; then
2566 AC_MSG_RESULT([yes])
2567 ac_have_builtin_atomic64=yes
2568else
2569 AC_MSG_RESULT([no])
2570 ac_have_builtin_atomic64=no
2571fi
2572
2573AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
2574 [test x$ac_have_builtin_atomic64 = xyes])
2575
bart78bfc712011-12-08 16:14:59 +00002576
barte8740422011-03-24 20:27:54 +00002577# does g++ have built-in functions for atomic memory access ?
bart78bfc712011-12-08 16:14:59 +00002578AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
barte8740422011-03-24 20:27:54 +00002579
2580safe_CXXFLAGS=$CXXFLAGS
2581CXXFLAGS="$mflag_primary"
2582
2583AC_LANG_PUSH(C++)
bart417cf3e2011-10-22 09:21:24 +00002584AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
barte8740422011-03-24 20:27:54 +00002585 int variable = 1;
2586 return (__sync_bool_compare_and_swap(&variable, 1, 2)
2587 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
bart417cf3e2011-10-22 09:21:24 +00002588]])], [
barte8740422011-03-24 20:27:54 +00002589 ac_have_builtin_atomic_cxx=yes
2590 AC_MSG_RESULT([yes])
2591 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 +00002592], [
barte8740422011-03-24 20:27:54 +00002593 ac_have_builtin_atomic_cxx=no
2594 AC_MSG_RESULT([no])
2595])
2596AC_LANG_POP(C++)
2597
2598CXXFLAGS=$safe_CXXFLAGS
2599
2600AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
sewardjc876a2f2009-01-22 22:44:30 +00002601
bart78bfc712011-12-08 16:14:59 +00002602
2603if test x$ac_have_usable_linux_futex_h = xyes \
bartb4ff7822011-12-10 19:48:04 +00002604 -a x$ac_have_builtin_atomic_primary = xyes; then
bart78bfc712011-12-08 16:14:59 +00002605 ac_enable_linux_ticket_lock_primary=yes
2606fi
2607AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
2608 [test x$ac_enable_linux_ticket_lock_primary = xyes])
2609
2610if test x$VGCONF_PLATFORM_SEC_CAPS != x \
2611 -a x$ac_have_usable_linux_futex_h = xyes \
2612 -a x$ac_have_builtin_atomic_secondary = xyes; then
2613 ac_enable_linux_ticket_lock_secondary=yes
2614fi
2615AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
2616 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
2617
2618
bartf68af882011-12-10 19:42:05 +00002619# does libstdc++ support annotating shared pointers ?
2620AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
2621
2622safe_CXXFLAGS=$CFLAGS
2623CXXFLAGS="-std=c++0x"
2624
2625AC_LANG_PUSH(C++)
2626AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2627 #include <memory>
2628]], [[
2629 std::shared_ptr<int> p
2630]])], [
2631 ac_have_shared_ptr=yes
2632], [
2633 ac_have_shared_ptr=no
2634])
2635if test x$ac_have_shared_ptr = xyes; then
2636 # If compilation of the program below fails because of a syntax error
2637 # triggered by substituting one of the annotation macros then that
2638 # means that libstdc++ supports these macros.
2639 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2640 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
2641 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
2642 #include <memory>
2643 ]], [[
2644 std::shared_ptr<int> p
2645 ]])], [
2646 ac_have_shared_pointer_annotation=no
2647 AC_MSG_RESULT([no])
2648 ], [
2649 ac_have_shared_pointer_annotation=yes
2650 AC_MSG_RESULT([yes])
2651 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
2652 [Define to 1 if libstd++ supports annotating shared pointers])
2653 ])
2654else
2655 ac_have_shared_pointer_annotation=no
2656 AC_MSG_RESULT([no])
2657fi
2658AC_LANG_POP(C++)
2659
2660CXXFLAGS=$safe_CXXFLAGS
2661
2662AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
2663 [test x$ac_have_shared_pointer_annotation = xyes])
2664
2665
njn7fd6d382009-01-22 21:56:32 +00002666#----------------------------------------------------------------------------
2667# Ok. We're done checking.
2668#----------------------------------------------------------------------------
sewardj80637752006-03-02 13:48:21 +00002669
njn8b68b642009-06-24 00:37:09 +00002670# Nb: VEX/Makefile is generated from Makefile.vex.in.
2671AC_CONFIG_FILES([
sewardjde4a1d02002-03-22 01:27:54 +00002672 Makefile
njn8b68b642009-06-24 00:37:09 +00002673 VEX/Makefile:Makefile.vex.in
njn25cac76cb2002-09-23 11:21:57 +00002674 valgrind.spec
muellerbddd6072003-11-19 21:50:07 +00002675 valgrind.pc
dirk07596a22008-04-25 11:33:30 +00002676 glibc-2.X.supp
njn254d542432002-09-23 16:09:39 +00002677 docs/Makefile
2678 tests/Makefile
njnc2e7f482002-09-27 08:44:17 +00002679 tests/vg_regtest
njnec0c27a2005-12-10 23:11:28 +00002680 perf/Makefile
2681 perf/vg_perf
sewardj3b290482011-05-06 21:02:55 +00002682 gdbserver_tests/Makefile
njn254d542432002-09-23 16:09:39 +00002683 include/Makefile
njn7a6e7462002-11-09 17:53:30 +00002684 auxprogs/Makefile
njn8b68b642009-06-24 00:37:09 +00002685 mpi/Makefile
njn25ab726032002-09-23 16:24:41 +00002686 coregrind/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002687 memcheck/Makefile
2688 memcheck/tests/Makefile
floriane42cca52013-08-29 17:59:27 +00002689 memcheck/tests/common/Makefile
njnc6168192004-11-29 13:54:10 +00002690 memcheck/tests/amd64/Makefile
njnc6168192004-11-29 13:54:10 +00002691 memcheck/tests/x86/Makefile
njn3b3b76d2009-01-19 03:44:19 +00002692 memcheck/tests/linux/Makefile
njnf76d27a2009-05-28 01:53:07 +00002693 memcheck/tests/darwin/Makefile
njnea2d6fd2010-07-01 00:20:20 +00002694 memcheck/tests/amd64-linux/Makefile
njna454ec02009-01-19 03:16:59 +00002695 memcheck/tests/x86-linux/Makefile
sewardj0e342a02010-09-03 23:49:33 +00002696 memcheck/tests/ppc32/Makefile
2697 memcheck/tests/ppc64/Makefile
florian0bb707e2012-05-30 20:46:58 +00002698 memcheck/tests/s390x/Makefile
florianbb913cd2012-08-28 16:50:39 +00002699 memcheck/tests/vbit-test/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002700 cachegrind/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002701 cachegrind/tests/Makefile
njnc6168192004-11-29 13:54:10 +00002702 cachegrind/tests/x86/Makefile
njnf2df9b52002-10-04 11:35:47 +00002703 cachegrind/cg_annotate
njn69d495d2010-06-30 05:23:34 +00002704 cachegrind/cg_diff
weidendoa17f2a32006-03-20 10:27:30 +00002705 callgrind/Makefile
2706 callgrind/callgrind_annotate
2707 callgrind/callgrind_control
2708 callgrind/tests/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002709 helgrind/Makefile
njnf2df9b52002-10-04 11:35:47 +00002710 helgrind/tests/Makefile
nethercotec9f36922004-02-14 16:40:02 +00002711 massif/Makefile
nethercotec9f36922004-02-14 16:40:02 +00002712 massif/tests/Makefile
njnd5a8d242007-11-02 20:44:57 +00002713 massif/ms_print
njn25cac76cb2002-09-23 11:21:57 +00002714 lackey/Makefile
njnf2df9b52002-10-04 11:35:47 +00002715 lackey/tests/Makefile
njn25cac76cb2002-09-23 11:21:57 +00002716 none/Makefile
2717 none/tests/Makefile
njnc6168192004-11-29 13:54:10 +00002718 none/tests/amd64/Makefile
cerion85665ca2005-06-20 15:51:07 +00002719 none/tests/ppc32/Makefile
sewardj2c48c7b2005-11-29 13:05:56 +00002720 none/tests/ppc64/Makefile
njnc6168192004-11-29 13:54:10 +00002721 none/tests/x86/Makefile
sewardj59570ff2010-01-01 11:59:33 +00002722 none/tests/arm/Makefile
sewardjb5b87402011-03-07 16:05:35 +00002723 none/tests/s390x/Makefile
sewardj5db15402012-06-07 09:13:21 +00002724 none/tests/mips32/Makefile
petarj8bea8672013-05-10 13:14:54 +00002725 none/tests/mips64/Makefile
njn0458a122009-02-13 06:23:46 +00002726 none/tests/linux/Makefile
njnf76d27a2009-05-28 01:53:07 +00002727 none/tests/darwin/Makefile
njn06ca3322009-04-15 23:10:04 +00002728 none/tests/x86-linux/Makefile
sewardjd2f95a02011-05-11 16:04:28 +00002729 exp-sgcheck/Makefile
2730 exp-sgcheck/tests/Makefile
bartccf17de2008-07-04 15:14:35 +00002731 drd/Makefile
bartccf17de2008-07-04 15:14:35 +00002732 drd/scripts/download-and-build-splash2
2733 drd/tests/Makefile
njndbebecc2009-07-14 01:39:54 +00002734 exp-bbv/Makefile
njndbebecc2009-07-14 01:39:54 +00002735 exp-bbv/tests/Makefile
2736 exp-bbv/tests/x86/Makefile
2737 exp-bbv/tests/x86-linux/Makefile
2738 exp-bbv/tests/amd64-linux/Makefile
2739 exp-bbv/tests/ppc32-linux/Makefile
vince226e0782010-01-06 15:22:11 +00002740 exp-bbv/tests/arm-linux/Makefile
sewardj4d7d8f52010-10-12 10:09:15 +00002741 exp-dhat/Makefile
2742 exp-dhat/tests/Makefile
njn8b68b642009-06-24 00:37:09 +00002743])
sewardjd3645802010-06-13 22:13:58 +00002744AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
2745 [chmod +x coregrind/link_tool_exe_linux])
2746AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
2747 [chmod +x coregrind/link_tool_exe_darwin])
njn8b68b642009-06-24 00:37:09 +00002748AC_OUTPUT
gobry3b777892002-04-04 09:18:39 +00002749
2750cat<<EOF
2751
njn311303f2009-02-06 03:46:50 +00002752 Maximum build arch: ${ARCH_MAX}
2753 Primary build arch: ${VGCONF_ARCH_PRI}
njn3f8a6e92009-06-02 00:20:47 +00002754 Secondary build arch: ${VGCONF_ARCH_SEC}
njn311303f2009-02-06 03:46:50 +00002755 Build OS: ${VGCONF_OS}
njn7fd6d382009-01-22 21:56:32 +00002756 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
2757 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
sewardjcb495c82011-07-11 20:42:34 +00002758 Platform variant: ${VGCONF_PLATVARIANT}
2759 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
sewardje95d94f2008-09-19 09:02:19 +00002760 Default supp files: ${DEFAULT_SUPP}
gobry3b777892002-04-04 09:18:39 +00002761
gobry3b777892002-04-04 09:18:39 +00002762EOF