2 ##------------------------------------------------------------##
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.
8 ##------------------------------------------------------------##
10 # Process this file with autoconf to produce a configure script.
11 AC_INIT([Valgrind],[3.8.0.SVN],[valgrind-users@lists.sourceforge.net])
12 AC_CONFIG_SRCDIR(coregrind/m_main.c)
13 AC_CONFIG_HEADERS([config.h])
14 AM_INIT_AUTOMAKE([foreign])
18 #----------------------------------------------------------------------------
19 # Checks for various programs.
20 #----------------------------------------------------------------------------
21 CFLAGS="-Wno-long-long $CFLAGS"
28 # AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
29 # autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
30 # base (eg. most likely as Darwin-specific tests) we'll need one of the
32 # - put AC_PROG_OBJC in a Darwin-specific part of this file
33 # - Use AC_PROG_OBJC here and up the minimum autoconf version
34 # - Use the following, which is apparently equivalent:
35 # m4_ifdef([AC_PROG_OBJC],
37 # [AC_CHECK_TOOL([OBJC], [gcc])
39 # AC_SUBST([OBJCFLAGS])
42 # provide a very basic definition for AC_PROG_SED if it's not provided by
43 # autoconf (as e.g. in autoconf 2.59).
44 m4_ifndef([AC_PROG_SED],
45 [AC_DEFUN([AC_PROG_SED],
47 AC_CHECK_PROGS([SED],[gsed sed])])])
50 # If no AR variable was specified, look up the name of the archiver. Otherwise
51 # do not touch the AR variable.
52 if test "x$AR" = "x"; then
53 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
55 AC_ARG_VAR([AR],[Archiver command])
57 # Check for the compiler support
58 if test "${GCC}" != "yes" ; then
59 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
62 # figure out where perl lives
63 AC_PATH_PROG(PERL, perl)
65 # figure out where gdb lives
66 AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
67 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
69 # some older automake's don't have it so try something on our own
70 ifdef([AM_PROG_AS],[AM_PROG_AS],
80 # Check if 'diff' supports -u (universal diffs) and use it if possible.
82 AC_MSG_CHECKING([for diff -u])
85 # Comparing two identical files results in 0.
86 tmpfile="tmp-xxx-yyy-zzz"
88 if diff -u $tmpfile $tmpfile ; then
98 # We don't want gcc < 3.0
99 AC_MSG_CHECKING([for a supported version of gcc])
101 # Obtain the compiler version.
103 # A few examples of how the ${CC} --version output looks like:
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
109 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
110 # 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)
111 # Clang: clang version 2.9 (tags/RELEASE_29/final)
113 [gcc_version=`${CC} --version \
114 | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p' \
115 -e 's/[^ ]*clang version \([0-9.]*\).*$/\1/p'`]
118 if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
122 case "${is_clang}-${gcc_version}" in
124 AC_MSG_RESULT([ok (${gcc_version})])
127 AC_MSG_RESULT([ok (${gcc_version})])
130 AC_MSG_RESULT([ok (clang-${gcc_version})])
133 AC_MSG_RESULT([no (${gcc_version})])
134 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
138 #----------------------------------------------------------------------------
139 # Arch/OS/platform tests.
140 #----------------------------------------------------------------------------
141 # We create a number of arch/OS/platform-related variables. We prefix them
142 # all with "VGCONF_" which indicates that they are defined at
143 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
144 # variables used when compiling C files.
148 AC_MSG_CHECKING([for a supported CPU])
150 # ARCH_MAX reflects the most that this CPU can do: for example if it
151 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
152 # Ditto for amd64. It is used for more configuration below, but is not used
154 case "${host_cpu}" in
156 AC_MSG_RESULT([ok (${host_cpu})])
161 AC_MSG_RESULT([ok (${host_cpu})])
166 AC_MSG_RESULT([ok (${host_cpu})])
171 # On Linux this means only a 32-bit capable CPU.
172 AC_MSG_RESULT([ok (${host_cpu})])
177 AC_MSG_RESULT([ok (${host_cpu})])
182 AC_MSG_RESULT([ok (${host_cpu})])
187 AC_MSG_RESULT([no (${host_cpu})])
188 AC_MSG_ERROR([Unsupported host architecture. Sorry])
192 #----------------------------------------------------------------------------
194 # Sometimes it's convenient to subvert the bi-arch build system and
195 # just have a single build even though the underlying platform is
196 # capable of both. Hence handle --enable-only64bit and
197 # --enable-only32bit. Complain if both are issued :-)
198 # [Actually, if either of these options are used, I think both get built,
199 # but only one gets installed. So if you use an in-place build, both can be
202 # Check if a 64-bit only build has been requested
203 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
204 [AC_ARG_ENABLE(only64bit,
205 [ --enable-only64bit do a 64-bit only build],
206 [vg_cv_only64bit=$enableval],
207 [vg_cv_only64bit=no])])
209 # Check if a 32-bit only build has been requested
210 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
211 [AC_ARG_ENABLE(only32bit,
212 [ --enable-only32bit do a 32-bit only build],
213 [vg_cv_only32bit=$enableval],
214 [vg_cv_only32bit=no])])
217 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
219 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
222 #----------------------------------------------------------------------------
224 # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
225 # compilation of many C files via -VGO_$(VGCONF_OS) and
226 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
227 AC_MSG_CHECKING([for a supported OS])
234 AC_MSG_RESULT([ok (${host_os})])
237 # Ok, this is linux. Check the kernel version
238 AC_MSG_CHECKING([for the kernel version])
244 AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
245 AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
249 AC_MSG_RESULT([2.4 family (${kernel})])
250 AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x])
254 AC_MSG_RESULT([unsupported (${kernel})])
255 AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
262 AC_MSG_RESULT([ok (${host_os})])
264 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
265 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
266 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
268 AC_MSG_CHECKING([for the kernel version])
271 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
272 # has only one relevant version, the OS version. The `uname` check
273 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
274 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
275 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
276 # and we don't know of an macros similar to __GLIBC__ to get that info.
278 # XXX: `uname -r` won't do the right thing for cross-compiles, but
279 # that's not a problem yet.
281 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
282 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
283 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
284 # time support for 10.5 (the 9.* pattern just below), I'll leave it
285 # in for now, just in case anybody wants to give it a try. But I'm
286 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
289 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
290 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
291 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
292 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
295 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
296 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
297 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
298 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
301 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
302 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
303 # FIXME: change these to xx11.supp
304 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
305 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
308 AC_MSG_RESULT([unsupported (${kernel})])
309 AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)])
315 AC_MSG_RESULT([no (${host_os})])
316 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
320 #----------------------------------------------------------------------------
322 # If we are building on a 64 bit platform test to see if the system
323 # supports building 32 bit programs and disable 32 bit support if it
324 # does not support building 32 bit programs
326 case "$ARCH_MAX-$VGCONF_OS" in
327 amd64-linux|ppc64-linux)
328 AC_MSG_CHECKING([for 32 bit build support])
331 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
336 vg_cv_only64bit="yes"
339 CFLAGS=$safe_CFLAGS;;
342 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
344 [--enable-only32bit was specified but system does not support 32 bit builds])
347 #----------------------------------------------------------------------------
349 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
350 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
351 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
352 # above) will be "amd64" since that reflects the most that this cpu can do,
353 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
354 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
355 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
356 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
357 AC_SUBST(VGCONF_ARCH_PRI)
359 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
360 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
361 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
362 # It is empty if there is no secondary target.
363 AC_SUBST(VGCONF_ARCH_SEC)
365 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
366 # The entire system, including regression and performance tests, will be
367 # built for this target. The "_CAPS" indicates that the name is in capital
368 # letters, and it also uses '_' rather than '-' as a separator, because it's
369 # used to create various Makefile variables, which are all in caps by
370 # convention and cannot contain '-' characters. This is in contrast to
371 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
372 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
374 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
375 # Valgrind and tools will also be built for this target, but not the
376 # regression or performance tests.
378 # By default, the primary arch is the same as the "max" arch, as commented
379 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
380 # the big case statement just below here, in the case where we're building
381 # on a 64 bit machine but have been requested only to do a 32 bit build.
382 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
384 AC_MSG_CHECKING([for a supported CPU/OS combination])
386 # NB. The load address for a given platform may be specified in more
387 # than one place, in some cases, depending on whether we're doing a biarch,
388 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
389 # Be careful to give consistent values in all subcases. Also, all four
390 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
391 # even if it is to "0xUNSET".
393 case "$ARCH_MAX-$VGCONF_OS" in
395 VGCONF_ARCH_PRI="x86"
397 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
398 VGCONF_PLATFORM_SEC_CAPS=""
399 valt_load_address_pri_norml="0x38000000"
400 valt_load_address_pri_inner="0x28000000"
401 valt_load_address_sec_norml="0xUNSET"
402 valt_load_address_sec_inner="0xUNSET"
403 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
406 valt_load_address_sec_norml="0xUNSET"
407 valt_load_address_sec_inner="0xUNSET"
408 if test x$vg_cv_only64bit = xyes; then
409 VGCONF_ARCH_PRI="amd64"
411 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
412 VGCONF_PLATFORM_SEC_CAPS=""
413 valt_load_address_pri_norml="0x38000000"
414 valt_load_address_pri_inner="0x28000000"
415 elif test x$vg_cv_only32bit = xyes; then
416 VGCONF_ARCH_PRI="x86"
418 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
419 VGCONF_PLATFORM_SEC_CAPS=""
420 valt_load_address_pri_norml="0x38000000"
421 valt_load_address_pri_inner="0x28000000"
423 VGCONF_ARCH_PRI="amd64"
424 VGCONF_ARCH_SEC="x86"
425 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
426 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
427 valt_load_address_pri_norml="0x38000000"
428 valt_load_address_pri_inner="0x28000000"
429 valt_load_address_sec_norml="0x38000000"
430 valt_load_address_sec_inner="0x28000000"
432 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
435 VGCONF_ARCH_PRI="ppc32"
437 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
438 VGCONF_PLATFORM_SEC_CAPS=""
439 valt_load_address_pri_norml="0x38000000"
440 valt_load_address_pri_inner="0x28000000"
441 valt_load_address_sec_norml="0xUNSET"
442 valt_load_address_sec_inner="0xUNSET"
443 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
446 valt_load_address_sec_norml="0xUNSET"
447 valt_load_address_sec_inner="0xUNSET"
448 if test x$vg_cv_only64bit = xyes; then
449 VGCONF_ARCH_PRI="ppc64"
451 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
452 VGCONF_PLATFORM_SEC_CAPS=""
453 valt_load_address_pri_norml="0x38000000"
454 valt_load_address_pri_inner="0x28000000"
455 elif test x$vg_cv_only32bit = xyes; then
456 VGCONF_ARCH_PRI="ppc32"
458 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
459 VGCONF_PLATFORM_SEC_CAPS=""
460 valt_load_address_pri_norml="0x38000000"
461 valt_load_address_pri_inner="0x28000000"
463 VGCONF_ARCH_PRI="ppc64"
464 VGCONF_ARCH_SEC="ppc32"
465 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
466 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
467 valt_load_address_pri_norml="0x38000000"
468 valt_load_address_pri_inner="0x28000000"
469 valt_load_address_sec_norml="0x38000000"
470 valt_load_address_sec_inner="0x28000000"
472 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
474 # Darwin gets identified as 32-bit even when it supports 64-bit.
475 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
476 # all Macs support both 32-bit and 64-bit, so we just build both. If
477 # someone has a really old 32-bit only machine they can (hopefully?)
478 # build with --enable-only32bit. See bug 243362.
479 x86-darwin|amd64-darwin)
481 valt_load_address_sec_norml="0xUNSET"
482 valt_load_address_sec_inner="0xUNSET"
483 if test x$vg_cv_only64bit = xyes; then
484 VGCONF_ARCH_PRI="amd64"
486 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
487 VGCONF_PLATFORM_SEC_CAPS=""
488 valt_load_address_pri_norml="0x138000000"
489 valt_load_address_pri_inner="0x128000000"
490 elif test x$vg_cv_only32bit = xyes; then
491 VGCONF_ARCH_PRI="x86"
493 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
494 VGCONF_PLATFORM_SEC_CAPS=""
495 VGCONF_ARCH_PRI_CAPS="x86"
496 valt_load_address_pri_norml="0x38000000"
497 valt_load_address_pri_inner="0x28000000"
499 VGCONF_ARCH_PRI="amd64"
500 VGCONF_ARCH_SEC="x86"
501 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
502 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
503 valt_load_address_pri_norml="0x138000000"
504 valt_load_address_pri_inner="0x128000000"
505 valt_load_address_sec_norml="0x38000000"
506 valt_load_address_sec_inner="0x28000000"
508 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
511 VGCONF_ARCH_PRI="arm"
512 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
513 VGCONF_PLATFORM_SEC_CAPS=""
514 valt_load_address_pri_norml="0x38000000"
515 valt_load_address_pri_inner="0x28000000"
516 valt_load_address_sec_norml="0xUNSET"
517 valt_load_address_sec_inner="0xUNSET"
518 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
521 VGCONF_ARCH_PRI="s390x"
523 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
524 VGCONF_PLATFORM_SEC_CAPS=""
525 # we want to have the generated code close to the dispatcher
526 valt_load_address_pri_norml="0x401000000"
527 valt_load_address_pri_inner="0x410000000"
528 valt_load_address_sec_norml="0xUNSET"
529 valt_load_address_sec_inner="0xUNSET"
530 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
533 VGCONF_ARCH_PRI="unknown"
534 VGCONF_ARCH_SEC="unknown"
535 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
536 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
537 valt_load_address_pri_norml="0xUNSET"
538 valt_load_address_pri_inner="0xUNSET"
539 valt_load_address_sec_norml="0xUNSET"
540 valt_load_address_sec_inner="0xUNSET"
541 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
542 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
546 #----------------------------------------------------------------------------
548 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
550 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
551 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
552 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
553 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
554 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN )
555 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
556 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
557 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN )
558 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
559 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
560 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
561 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
562 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
563 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
564 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
565 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
566 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
568 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
570 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
571 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
572 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
573 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
574 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
575 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
576 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
577 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
578 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX,
579 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
580 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
581 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
582 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
583 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
584 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
586 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
587 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
588 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
589 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
590 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
593 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
594 # Relies on the assumption that the primary and secondary targets are
595 # for the same OS, so therefore only necessary to test the primary.
596 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
597 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
598 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
599 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
600 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
601 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
602 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX)
603 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
604 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
605 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
608 # Sometimes, in the Makefile.am files, it's useful to know whether or not
609 # there is a secondary target.
610 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
611 test x$VGCONF_PLATFORM_SEC_CAPS != x)
614 #----------------------------------------------------------------------------
616 #----------------------------------------------------------------------------
618 # Check if this should be built as an inner Valgrind, to be run within
619 # another Valgrind. Choose the load address accordingly.
620 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
621 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
622 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
623 [AC_ARG_ENABLE(inner,
624 [ --enable-inner enables self-hosting],
625 [vg_cv_inner=$enableval],
627 if test "$vg_cv_inner" = yes; then
628 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
629 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
630 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
632 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
633 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
637 #----------------------------------------------------------------------------
638 # Extra fine-tuning of installation directories
639 #----------------------------------------------------------------------------
641 [ --with-tmpdir=PATH Specify path for temporary files],
644 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
647 #----------------------------------------------------------------------------
648 # Libc and suppressions
649 #----------------------------------------------------------------------------
650 # This variable will collect the suppression files to be used.
651 AC_SUBST(DEFAULT_SUPP)
653 AC_CHECK_HEADER([features.h])
655 if test x$ac_cv_header_features_h = xyes; then
656 rm -f conftest.$ac_ext
657 cat <<_ACEOF >conftest.$ac_ext
658 #include <features.h>
659 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
660 glibc version is: __GLIBC__ __GLIBC_MINOR__
663 GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
666 # not really a version check
667 AC_EGREP_CPP([DARWIN_LIBC], [
668 #include <sys/cdefs.h>
669 #if defined(__DARWIN_VERS_1050)
673 GLIBC_VERSION="darwin")
675 # not really a version check
676 AC_EGREP_CPP([BIONIC_LIBC], [
677 #if defined(__ANDROID__)
681 GLIBC_VERSION="bionic")
684 AC_MSG_CHECKING([the GLIBC_VERSION version])
686 case "${GLIBC_VERSION}" in
688 AC_MSG_RESULT(2.2 family)
689 AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
690 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
691 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
692 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
696 AC_MSG_RESULT(2.3 family)
697 AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
698 DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
699 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
700 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
704 AC_MSG_RESULT(2.4 family)
705 AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
706 DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
707 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
708 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
712 AC_MSG_RESULT(2.5 family)
713 AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
714 DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
715 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
716 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
719 AC_MSG_RESULT(2.6 family)
720 AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
721 DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
722 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
723 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
726 AC_MSG_RESULT(2.7 family)
727 AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
728 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
729 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
730 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
733 AC_MSG_RESULT(2.8 family)
734 AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
735 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
736 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
737 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
740 AC_MSG_RESULT(2.9 family)
741 AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
742 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
743 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
744 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
747 AC_MSG_RESULT(2.10 family)
748 AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
749 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
750 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
751 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
754 AC_MSG_RESULT(2.11 family)
755 AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
756 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
757 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
758 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
761 AC_MSG_RESULT(2.12 family)
762 AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
763 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
764 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
765 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
768 AC_MSG_RESULT(2.13 family)
769 AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
770 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
771 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
772 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
775 AC_MSG_RESULT(2.14 family)
776 AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
777 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
778 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
779 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
782 AC_MSG_RESULT(Darwin)
783 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
784 # DEFAULT_SUPP set by kernel version check above.
787 AC_MSG_RESULT(Bionic)
788 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
789 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
793 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
794 AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14])
795 AC_MSG_ERROR([or Darwin libc])
799 AC_SUBST(GLIBC_VERSION)
802 # Add default suppressions for the X client libraries. Make no
803 # attempt to detect whether such libraries are installed on the
804 # build machine (or even if any X facilities are present); just
805 # add the suppressions antidisirregardless.
806 DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
807 DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
809 # Add glibc and X11 suppressions for exp-sgcheck
810 DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
813 #----------------------------------------------------------------------------
815 #----------------------------------------------------------------------------
817 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
818 # But there are times where we need a bit more control. The motivating
819 # and currently only case is Android: this is almost identical to arm-linux,
820 # but not quite. So this introduces the concept of platform variant tags,
821 # which get passed in the compile as -DVGPV_<arch>_<os>_<variant> along
822 # with the main -DVGP_<arch>_<os> definition.
824 # In almost all cases, the <variant> bit is "vanilla". But for Android
825 # it is "android" instead.
827 # Consequently (eg), plain arm-linux would build with
829 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
831 # whilst an Android build would have
833 # -DVGP_arm_linux -DVGPV_arm_linux_android
835 # The setup of the platform variant is pushed relatively far down this
836 # file in order that we can inspect any of the variables set above.
838 # In the normal case ..
839 VGCONF_PLATVARIANT="vanilla"
842 if test "$VGCONF_ARCH_PRI-$VGCONF_OS" = "arm-linux" \
843 -a "$GLIBC_VERSION" = "bionic";
845 VGCONF_PLATVARIANT="android"
848 AC_SUBST(VGCONF_PLATVARIANT)
851 # FIXME: do we also want to define automake variables
852 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
853 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
854 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
855 # do that. Problem is that we can't do and-ing in Makefile.am's, but
856 # that's what we'd need to do to use this, since what we'd want to write
859 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
861 # Hmm. Can't think of a nice clean solution to this.
863 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
864 test x$VGCONF_PLATVARIANT = xvanilla)
865 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
866 test x$VGCONF_PLATVARIANT = xandroid)
869 #----------------------------------------------------------------------------
870 # Checking for various library functions and other definitions
871 #----------------------------------------------------------------------------
873 # Check for CLOCK_MONOTONIC
875 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
877 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
881 clock_gettime(CLOCK_MONOTONIC, &t);
885 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
886 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
892 # Check for PTHREAD_RWLOCK_T
894 AC_MSG_CHECKING([for pthread_rwlock_t])
896 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
900 pthread_rwlock_t rwl;
903 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
904 [Define to 1 if you have the `pthread_rwlock_t' type.])
910 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
912 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
914 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
918 return (PTHREAD_MUTEX_ADAPTIVE_NP);
921 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
922 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
928 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
930 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
932 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
936 return (PTHREAD_MUTEX_ERRORCHECK_NP);
939 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
940 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
946 # Check for PTHREAD_MUTEX_RECURSIVE_NP
948 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
950 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
954 return (PTHREAD_MUTEX_RECURSIVE_NP);
957 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
958 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
964 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
966 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
968 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
972 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
976 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
977 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
983 # Check whether pthread_mutex_t has a member called __m_kind.
985 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
986 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
988 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
991 [#include <pthread.h>])
994 # Check whether pthread_mutex_t has a member called __data.__kind.
996 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
997 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
999 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1002 [#include <pthread.h>])
1005 # does this compiler support -maltivec and does it have the include file
1008 AC_MSG_CHECKING([for Altivec])
1013 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1014 #include <altivec.h>
1016 vector unsigned int v;
1019 AC_MSG_RESULT([yes])
1020 AC_DEFINE([HAS_ALTIVEC], 1,
1021 [Define to 1 if gcc/as can do Altivec.])
1028 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
1031 # Check that both: the compiler supports -mvsx and that the assembler
1032 # understands VSX instructions. If either of those doesn't work,
1033 # conclude that we can't do VSX. NOTE: basically this is a kludge
1034 # in that it conflates two things that should be separate -- whether
1035 # the compiler understands the flag vs whether the assembler
1036 # understands the opcodes. This really ought to be cleaned up
1037 # and done properly, like it is for x86/x86_64.
1039 AC_MSG_CHECKING([for VSX])
1044 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1045 #include <altivec.h>
1047 vector unsigned int v;
1048 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1051 AC_MSG_RESULT([yes])
1058 AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
1061 # Check for pthread_create@GLIBC2.0
1062 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1066 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1067 extern int pthread_create_glibc_2_0(void*, const void*,
1068 void *(*)(void*), void*);
1069 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1073 * Apparently on PowerPC linking this program succeeds and generates an
1074 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1076 #error This test does not work properly on PowerPC.
1078 pthread_create_glibc_2_0(0, 0, 0, 0);
1082 ac_have_pthread_create_glibc_2_0=yes
1083 AC_MSG_RESULT([yes])
1084 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1085 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1087 ac_have_pthread_create_glibc_2_0=no
1092 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1093 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1096 # Check for eventfd_t, eventfd() and eventfd_read()
1097 AC_MSG_CHECKING([for eventfd()])
1099 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1100 #include <sys/eventfd.h>
1106 eventfd_read(fd, &ev);
1109 AC_MSG_RESULT([yes])
1110 AC_DEFINE([HAVE_EVENTFD], 1,
1111 [Define to 1 if you have the `eventfd' function.])
1112 AC_DEFINE([HAVE_EVENTFD_READ], 1,
1113 [Define to 1 if you have the `eventfd_read' function.])
1119 #----------------------------------------------------------------------------
1120 # Checking for supported compiler flags.
1121 #----------------------------------------------------------------------------
1123 # does this compiler support -m32 ?
1124 AC_MSG_CHECKING([if gcc accepts -m32])
1129 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1133 AC_MSG_RESULT([yes])
1143 # does this compiler support -m64 ?
1144 AC_MSG_CHECKING([if gcc accepts -m64])
1149 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1153 AC_MSG_RESULT([yes])
1163 # does this compiler support -mmmx ?
1164 AC_MSG_CHECKING([if gcc accepts -mmmx])
1169 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1173 AC_MSG_RESULT([yes])
1183 # does this compiler support -msse ?
1184 AC_MSG_CHECKING([if gcc accepts -msse])
1189 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1193 AC_MSG_RESULT([yes])
1203 # does this compiler support -mpreferred-stack-boundary=2 ?
1204 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
1207 CFLAGS="-mpreferred-stack-boundary=2"
1209 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1212 PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2"
1213 AC_MSG_RESULT([yes])
1215 PREFERRED_STACK_BOUNDARY=""
1220 AC_SUBST(PREFERRED_STACK_BOUNDARY)
1223 # does this compiler support -Wno-pointer-sign ?
1224 AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign])
1227 CFLAGS="-Wno-pointer-sign"
1229 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1233 AC_MSG_RESULT([yes])
1240 if test x$no_pointer_sign = xyes; then
1241 CFLAGS="$CFLAGS -Wno-pointer-sign"
1245 # does this compiler support -Wno-empty-body ?
1247 AC_MSG_CHECKING([if gcc accepts -Wno-empty-body])
1250 CFLAGS="-Wno-empty-body"
1252 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1255 AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body])
1256 AC_MSG_RESULT([yes])
1258 AC_SUBST([FLAG_W_NO_EMPTY_BODY], [])
1264 # does this compiler support -Wno-format-zero-length ?
1266 AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
1269 CFLAGS="-Wno-format-zero-length"
1271 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1274 AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
1275 AC_MSG_RESULT([yes])
1277 AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
1283 # does this compiler support -Wno-nonnull ?
1285 AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
1288 CFLAGS="-Wno-nonnull"
1290 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1293 AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
1294 AC_MSG_RESULT([yes])
1296 AC_SUBST([FLAG_W_NO_NONNULL], [])
1302 # does this compiler support -Wno-overflow ?
1304 AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
1307 CFLAGS="-Wno-overflow"
1309 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1312 AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
1313 AC_MSG_RESULT([yes])
1315 AC_SUBST([FLAG_W_NO_OVERFLOW], [])
1321 # does this compiler support -Wno-uninitialized ?
1323 AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
1326 CFLAGS="-Wno-uninitialized"
1328 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1331 AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized])
1332 AC_MSG_RESULT([yes])
1334 AC_SUBST([FLAG_W_NO_UNINITIALIZED], [])
1340 # does this compiler support -Wextra or the older -W ?
1342 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1347 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1350 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1351 AC_MSG_RESULT([-Wextra])
1354 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1357 AC_SUBST([FLAG_W_EXTRA], [-W])
1360 AC_SUBST([FLAG_W_EXTRA], [])
1361 AC_MSG_RESULT([not supported])
1367 # does this compiler support -fno-stack-protector ?
1368 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
1371 CFLAGS="-fno-stack-protector"
1373 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1376 no_stack_protector=yes
1377 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1378 AC_MSG_RESULT([yes])
1380 no_stack_protector=no
1381 FLAG_FNO_STACK_PROTECTOR=""
1386 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1388 if test x$no_stack_protector = xyes; then
1389 CFLAGS="$CFLAGS -fno-stack-protector"
1393 # does this compiler support --param inline-unit-growth=... ?
1395 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
1398 CFLAGS="--param inline-unit-growth=900"
1400 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1403 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
1404 ["--param inline-unit-growth=900"])
1405 AC_MSG_RESULT([yes])
1407 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
1413 # does the linker support -Wl,--build-id=none ? Note, it's
1414 # important that we test indirectly via whichever C compiler
1415 # is selected, rather than testing /usr/bin/ld or whatever
1418 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
1421 CFLAGS="-Wl,--build-id=none"
1424 [AC_LANG_PROGRAM([ ], [return 0;])],
1426 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
1427 AC_MSG_RESULT([yes])
1429 AC_SUBST([FLAG_NO_BUILD_ID], [""])
1435 # does the ppc assembler support "mtocrf" et al?
1436 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
1438 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1439 __asm__ __volatile__("mtocrf 4,0");
1440 __asm__ __volatile__("mfocrf 0,4");
1442 ac_have_as_ppc_mftocrf=yes
1443 AC_MSG_RESULT([yes])
1445 ac_have_as_ppc_mftocrf=no
1448 if test x$ac_have_as_ppc_mftocrf = xyes ; then
1449 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
1455 # does the x86/amd64 assembler understand SSE3 instructions?
1456 # Note, this doesn't generate a C-level symbol. It generates a
1457 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
1458 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
1460 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1461 do { long long int x;
1462 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
1466 AC_MSG_RESULT([yes])
1472 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
1475 # Ditto for SSSE3 instructions (note extra S)
1476 # Note, this doesn't generate a C-level symbol. It generates a
1477 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
1478 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
1480 save_CFLAGS="$CFLAGS"
1481 CFLAGS="$CFLAGS -msse"
1482 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1483 do { long long int x;
1484 __asm__ __volatile__(
1485 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
1488 ac_have_as_ssse3=yes
1489 AC_MSG_RESULT([yes])
1494 CFLAGS="$save_CFLAGS"
1496 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
1499 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
1500 # Note, this doesn't generate a C-level symbol. It generates a
1501 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
1502 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
1503 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1505 __asm__ __volatile__(
1506 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
1509 ac_have_as_pclmulqdq=yes
1510 AC_MSG_RESULT([yes])
1512 ac_have_as_pclmulqdq=no
1516 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
1519 # does the x86/amd64 assembler understand the LZCNT instruction?
1520 # Note, this doesn't generate a C-level symbol. It generates a
1521 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
1522 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
1524 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1526 __asm__ __volatile__("lzcnt %rax,%rax");
1529 ac_have_as_lzcnt=yes
1530 AC_MSG_RESULT([yes])
1536 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
1539 # does the x86/amd64 assembler understand SSE 4.2 instructions?
1540 # Note, this doesn't generate a C-level symbol. It generates a
1541 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
1542 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
1544 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1545 do { long long int x;
1546 __asm__ __volatile__(
1547 "crc32q %%r15,%%r15" : : : "r15" ); }
1550 ac_have_as_sse42=yes
1551 AC_MSG_RESULT([yes])
1557 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
1560 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
1561 # when building the tool executables. I think we should get rid of it.
1563 # Check for TLS support in the compiler and linker
1564 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1566 [vg_cv_linktime_tls=yes],
1567 [vg_cv_linktime_tls=no])
1568 # Native compilation: check whether running a program using TLS succeeds.
1569 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
1570 # succeeds but running programs using TLS fails.
1571 # Cross-compiling: check whether linking a program using TLS succeeds.
1572 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
1573 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
1574 [vg_cv_tls=$enableval],
1575 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1579 [vg_cv_tls=$vg_cv_linktime_tls])])])
1581 if test "$vg_cv_tls" = yes; then
1582 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
1586 #----------------------------------------------------------------------------
1587 # Checks for C header files.
1588 #----------------------------------------------------------------------------
1591 AC_CHECK_HEADERS([ \
1607 # Verify whether the <linux/futex.h> header is usable.
1608 AC_MSG_CHECKING([if <linux/futex.h> is usable])
1610 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1611 #include <linux/futex.h>
1615 ac_have_usable_linux_futex_h=yes
1616 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
1617 [Define to 1 if you have a usable <linux/futex.h> header file.])
1618 AC_MSG_RESULT([yes])
1620 ac_have_usable_linux_futex_h=no
1624 #----------------------------------------------------------------------------
1625 # Checks for typedefs, structures, and compiler characteristics.
1626 #----------------------------------------------------------------------------
1633 #----------------------------------------------------------------------------
1634 # Checks for library functions.
1635 #----------------------------------------------------------------------------
1639 AC_CHECK_LIB([pthread], [pthread_create])
1640 AC_CHECK_LIB([rt], [clock_gettime])
1653 pthread_barrier_init \
1654 pthread_condattr_setclock \
1655 pthread_mutex_timedlock \
1656 pthread_rwlock_timedrdlock \
1657 pthread_rwlock_timedwrlock \
1673 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
1674 # libraries with any shared object and/or executable. This is NOT what we
1675 # want for e.g. vgpreload_core-x86-linux.so
1678 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
1679 [test x$ac_cv_func_pthread_barrier_init = xyes])
1680 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
1681 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
1682 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
1683 [test x$ac_cv_func_pthread_spin_lock = xyes])
1686 #----------------------------------------------------------------------------
1688 #----------------------------------------------------------------------------
1689 # Do we have a useable MPI setup on the primary and/or secondary targets?
1690 # On Linux, by default, assumes mpicc and -m32/-m64
1691 # Note: this is a kludge in that it assumes the specified mpicc
1692 # understands -m32/-m64 regardless of what is specified using
1697 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1698 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1699 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX ; then
1700 mflag_primary=$FLAG_M32
1701 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1702 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
1703 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
1704 mflag_primary=$FLAG_M64
1708 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1709 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then
1710 mflag_secondary=$FLAG_M32
1715 [ --with-mpicc= Specify name of MPI2-ised C compiler],
1720 ## See if MPI_CC works for the primary target
1722 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
1724 saved_CFLAGS=$CFLAGS
1726 CFLAGS=$mflag_primary
1727 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1731 int r = MPI_Init(NULL,NULL);
1732 r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1735 ac_have_mpi2_pri=yes
1736 AC_MSG_RESULT([yes, $MPI_CC])
1742 CFLAGS=$saved_CFLAGS
1743 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
1745 ## See if MPI_CC works for the secondary target. Complication: what if
1746 ## there is no secondary target? We need this to then fail.
1747 ## Kludge this by making MPI_CC something which will surely fail in
1750 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
1752 saved_CFLAGS=$CFLAGS
1753 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
1754 CC="$MPI_CC this will surely fail"
1758 CFLAGS=$mflag_secondary
1759 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1763 int r = MPI_Init(NULL,NULL);
1764 r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1767 ac_have_mpi2_sec=yes
1768 AC_MSG_RESULT([yes, $MPI_CC])
1774 CFLAGS=$saved_CFLAGS
1775 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
1778 #----------------------------------------------------------------------------
1779 # Other library checks
1780 #----------------------------------------------------------------------------
1781 # There now follow some tests for Boost, and OpenMP. These
1782 # tests are present because Drd has some regression tests that use
1783 # these packages. All regression test programs all compiled only
1784 # for the primary target. And so it is important that the configure
1785 # checks that follow, use the correct -m32 or -m64 flag for the
1786 # primary target (called $mflag_primary). Otherwise, we can end up
1787 # in a situation (eg) where, on amd64-linux, the test for Boost checks
1788 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
1789 # only build (meaning, the primary target is x86-linux), the build
1790 # of the regtest programs that use Boost fails, because they are
1791 # build as 32-bit (IN THIS EXAMPLE).
1793 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
1794 # NEEDED BY THE REGRESSION TEST PROGRAMS.
1797 # Check whether the boost library 1.35 or later has been installed.
1798 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
1800 AC_MSG_CHECKING([for boost])
1803 safe_CXXFLAGS=$CXXFLAGS
1804 CXXFLAGS="-lboost_thread-mt $mflag_primary"
1806 AC_LINK_IFELSE([AC_LANG_SOURCE([
1807 #include <boost/thread.hpp>
1808 static void thread_func(void)
1810 int main(int argc, char** argv)
1812 boost::thread t(thread_func);
1817 ac_have_boost_1_35=yes
1818 AC_SUBST([BOOST_CFLAGS], [])
1819 AC_SUBST([BOOST_LIBS], ["${CXXFLAGS}"])
1820 AC_MSG_RESULT([yes])
1822 ac_have_boost_1_35=no
1826 CXXFLAGS=$safe_CXXFLAGS
1829 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
1832 # does this compiler support -fopenmp, does it have the include file
1833 # <omp.h> and does it have libgomp ?
1835 AC_MSG_CHECKING([for OpenMP])
1838 CFLAGS="-fopenmp $mflag_primary"
1840 AC_LINK_IFELSE([AC_LANG_SOURCE([
1842 int main(int argc, char** argv)
1850 AC_MSG_RESULT([yes])
1857 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
1860 # does this compiler have built-in functions for atomic memory access for the
1862 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
1865 CFLAGS="$mflag_primary"
1867 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1869 return (__sync_bool_compare_and_swap(&variable, 1, 2)
1870 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
1872 ac_have_builtin_atomic_primary=yes
1873 AC_MSG_RESULT([yes])
1874 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])
1876 ac_have_builtin_atomic_primary=no
1882 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
1883 [test x$ac_have_builtin_atomic_primary = xyes])
1886 # does this compiler have built-in functions for atomic memory access for the
1887 # secondary target ?
1889 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
1891 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
1894 CFLAGS="$mflag_secondary"
1896 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1898 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
1900 ac_have_builtin_atomic_secondary=yes
1901 AC_MSG_RESULT([yes])
1903 ac_have_builtin_atomic_secondary=no
1911 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
1912 [test x$ac_have_builtin_atomic_secondary = xyes])
1914 # does this compiler have built-in functions for atomic memory access on
1915 # 64-bit integers for all targets ?
1917 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
1919 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1922 uint64_t variable = 1;
1923 return __sync_add_and_fetch(&variable, 1)
1925 ac_have_builtin_atomic64_primary=yes
1927 ac_have_builtin_atomic64_primary=no
1930 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
1933 CFLAGS="$mflag_secondary"
1935 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1938 uint64_t variable = 1;
1939 return __sync_add_and_fetch(&variable, 1)
1941 ac_have_builtin_atomic64_secondary=yes
1943 ac_have_builtin_atomic64_secondary=no
1950 if test x$ac_have_builtin_atomic64_primary = xyes && \
1951 test x$VGCONF_PLATFORM_SEC_CAPS = x \
1952 -o x$ac_have_builtin_atomic64_secondary = xyes; then
1953 AC_MSG_RESULT([yes])
1954 ac_have_builtin_atomic64=yes
1957 ac_have_builtin_atomic64=no
1960 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
1961 [test x$ac_have_builtin_atomic64 = xyes])
1964 # does g++ have built-in functions for atomic memory access ?
1965 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
1967 safe_CXXFLAGS=$CXXFLAGS
1968 CXXFLAGS="$mflag_primary"
1971 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1973 return (__sync_bool_compare_and_swap(&variable, 1, 2)
1974 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
1976 ac_have_builtin_atomic_cxx=yes
1977 AC_MSG_RESULT([yes])
1978 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
1980 ac_have_builtin_atomic_cxx=no
1985 CXXFLAGS=$safe_CXXFLAGS
1987 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
1990 if test x$ac_have_usable_linux_futex_h = xyes \
1991 -a x$ac_have_builtin_atomic_primary = xyes; then
1992 ac_enable_linux_ticket_lock_primary=yes
1994 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
1995 [test x$ac_enable_linux_ticket_lock_primary = xyes])
1997 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
1998 -a x$ac_have_usable_linux_futex_h = xyes \
1999 -a x$ac_have_builtin_atomic_secondary = xyes; then
2000 ac_enable_linux_ticket_lock_secondary=yes
2002 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
2003 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
2006 # does libstdc++ support annotating shared pointers ?
2007 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
2009 safe_CXXFLAGS=$CFLAGS
2010 CXXFLAGS="-std=c++0x"
2013 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2016 std::shared_ptr<int> p
2018 ac_have_shared_ptr=yes
2020 ac_have_shared_ptr=no
2022 if test x$ac_have_shared_ptr = xyes; then
2023 # If compilation of the program below fails because of a syntax error
2024 # triggered by substituting one of the annotation macros then that
2025 # means that libstdc++ supports these macros.
2026 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2027 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
2028 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
2031 std::shared_ptr<int> p
2033 ac_have_shared_pointer_annotation=no
2036 ac_have_shared_pointer_annotation=yes
2037 AC_MSG_RESULT([yes])
2038 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
2039 [Define to 1 if libstd++ supports annotating shared pointers])
2042 ac_have_shared_pointer_annotation=no
2047 CXXFLAGS=$safe_CXXFLAGS
2049 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
2050 [test x$ac_have_shared_pointer_annotation = xyes])
2053 #----------------------------------------------------------------------------
2054 # Ok. We're done checking.
2055 #----------------------------------------------------------------------------
2057 # Nb: VEX/Makefile is generated from Makefile.vex.in.
2060 VEX/Makefile:Makefile.vex.in
2069 gdbserver_tests/Makefile
2075 memcheck/tests/Makefile
2076 memcheck/tests/amd64/Makefile
2077 memcheck/tests/x86/Makefile
2078 memcheck/tests/linux/Makefile
2079 memcheck/tests/darwin/Makefile
2080 memcheck/tests/amd64-linux/Makefile
2081 memcheck/tests/x86-linux/Makefile
2082 memcheck/tests/ppc32/Makefile
2083 memcheck/tests/ppc64/Makefile
2085 cachegrind/tests/Makefile
2086 cachegrind/tests/x86/Makefile
2087 cachegrind/cg_annotate
2090 callgrind/callgrind_annotate
2091 callgrind/callgrind_control
2092 callgrind/tests/Makefile
2094 helgrind/tests/Makefile
2096 massif/tests/Makefile
2099 lackey/tests/Makefile
2102 none/tests/amd64/Makefile
2103 none/tests/ppc32/Makefile
2104 none/tests/ppc64/Makefile
2105 none/tests/x86/Makefile
2106 none/tests/arm/Makefile
2107 none/tests/s390x/Makefile
2108 none/tests/linux/Makefile
2109 none/tests/darwin/Makefile
2110 none/tests/x86-linux/Makefile
2111 exp-sgcheck/Makefile
2112 exp-sgcheck/tests/Makefile
2114 drd/scripts/download-and-build-splash2
2117 exp-bbv/tests/Makefile
2118 exp-bbv/tests/x86/Makefile
2119 exp-bbv/tests/x86-linux/Makefile
2120 exp-bbv/tests/amd64-linux/Makefile
2121 exp-bbv/tests/ppc32-linux/Makefile
2122 exp-bbv/tests/arm-linux/Makefile
2124 exp-dhat/tests/Makefile
2126 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
2127 [chmod +x coregrind/link_tool_exe_linux])
2128 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
2129 [chmod +x coregrind/link_tool_exe_darwin])
2134 Maximum build arch: ${ARCH_MAX}
2135 Primary build arch: ${VGCONF_ARCH_PRI}
2136 Secondary build arch: ${VGCONF_ARCH_SEC}
2137 Build OS: ${VGCONF_OS}
2138 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
2139 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
2140 Platform variant: ${VGCONF_PLATVARIANT}
2141 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
2142 Default supp files: ${DEFAULT_SUPP}