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 # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
110 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
111 # OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
112 # Clang: clang version 2.9 (tags/RELEASE_29/final)
115 gcc_version=`${CC} -dumpversion 2>/dev/null`
116 if test "x$gcc_version" = x; then
117 gcc_version=`${CC} --version \
118 | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p' \
119 -e 's/[^ ]*clang version \([0-9.]*\).*$/\1/p'`
124 if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
128 case "${is_clang}-${gcc_version}" in
130 AC_MSG_RESULT([ok (${gcc_version})])
133 AC_MSG_RESULT([ok (${gcc_version})])
136 AC_MSG_RESULT([ok (clang-${gcc_version})])
139 AC_MSG_RESULT([no (${gcc_version})])
140 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
144 #----------------------------------------------------------------------------
145 # Arch/OS/platform tests.
146 #----------------------------------------------------------------------------
147 # We create a number of arch/OS/platform-related variables. We prefix them
148 # all with "VGCONF_" which indicates that they are defined at
149 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
150 # variables used when compiling C files.
154 AC_MSG_CHECKING([for a supported CPU])
156 # ARCH_MAX reflects the most that this CPU can do: for example if it
157 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
158 # Ditto for amd64. It is used for more configuration below, but is not used
160 case "${host_cpu}" in
162 AC_MSG_RESULT([ok (${host_cpu})])
167 AC_MSG_RESULT([ok (${host_cpu})])
172 AC_MSG_RESULT([ok (${host_cpu})])
177 # On Linux this means only a 32-bit capable CPU.
178 AC_MSG_RESULT([ok (${host_cpu})])
183 AC_MSG_RESULT([ok (${host_cpu})])
188 AC_MSG_RESULT([ok (${host_cpu})])
193 AC_MSG_RESULT([no (${host_cpu})])
194 AC_MSG_ERROR([Unsupported host architecture. Sorry])
198 #----------------------------------------------------------------------------
200 # Sometimes it's convenient to subvert the bi-arch build system and
201 # just have a single build even though the underlying platform is
202 # capable of both. Hence handle --enable-only64bit and
203 # --enable-only32bit. Complain if both are issued :-)
204 # [Actually, if either of these options are used, I think both get built,
205 # but only one gets installed. So if you use an in-place build, both can be
208 # Check if a 64-bit only build has been requested
209 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
210 [AC_ARG_ENABLE(only64bit,
211 [ --enable-only64bit do a 64-bit only build],
212 [vg_cv_only64bit=$enableval],
213 [vg_cv_only64bit=no])])
215 # Check if a 32-bit only build has been requested
216 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
217 [AC_ARG_ENABLE(only32bit,
218 [ --enable-only32bit do a 32-bit only build],
219 [vg_cv_only32bit=$enableval],
220 [vg_cv_only32bit=no])])
223 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
225 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
228 #----------------------------------------------------------------------------
230 # VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
231 # compilation of many C files via -VGO_$(VGCONF_OS) and
232 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
233 AC_MSG_CHECKING([for a supported OS])
240 AC_MSG_RESULT([ok (${host_os})])
243 # Ok, this is linux. Check the kernel version
244 AC_MSG_CHECKING([for the kernel version])
250 AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
251 AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
255 AC_MSG_RESULT([2.4 family (${kernel})])
256 AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x])
260 AC_MSG_RESULT([unsupported (${kernel})])
261 AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
268 AC_MSG_RESULT([ok (${host_os})])
270 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
271 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
272 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
274 AC_MSG_CHECKING([for the kernel version])
277 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
278 # has only one relevant version, the OS version. The `uname` check
279 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
280 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
281 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
282 # and we don't know of an macros similar to __GLIBC__ to get that info.
284 # XXX: `uname -r` won't do the right thing for cross-compiles, but
285 # that's not a problem yet.
287 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
288 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
289 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
290 # time support for 10.5 (the 9.* pattern just below), I'll leave it
291 # in for now, just in case anybody wants to give it a try. But I'm
292 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
295 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
296 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
297 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
298 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
301 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
302 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
303 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
304 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
307 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
308 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
309 # FIXME: change these to xx11.supp
310 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
311 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
314 AC_MSG_RESULT([unsupported (${kernel})])
315 AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)])
321 AC_MSG_RESULT([no (${host_os})])
322 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
326 #----------------------------------------------------------------------------
328 # If we are building on a 64 bit platform test to see if the system
329 # supports building 32 bit programs and disable 32 bit support if it
330 # does not support building 32 bit programs
332 case "$ARCH_MAX-$VGCONF_OS" in
333 amd64-linux|ppc64-linux)
334 AC_MSG_CHECKING([for 32 bit build support])
337 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
342 vg_cv_only64bit="yes"
345 CFLAGS=$safe_CFLAGS;;
348 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
350 [--enable-only32bit was specified but system does not support 32 bit builds])
353 #----------------------------------------------------------------------------
355 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
356 # default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
357 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
358 # above) will be "amd64" since that reflects the most that this cpu can do,
359 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
360 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
361 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
362 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
363 AC_SUBST(VGCONF_ARCH_PRI)
365 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
366 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
367 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
368 # It is empty if there is no secondary target.
369 AC_SUBST(VGCONF_ARCH_SEC)
371 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
372 # The entire system, including regression and performance tests, will be
373 # built for this target. The "_CAPS" indicates that the name is in capital
374 # letters, and it also uses '_' rather than '-' as a separator, because it's
375 # used to create various Makefile variables, which are all in caps by
376 # convention and cannot contain '-' characters. This is in contrast to
377 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
378 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
380 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
381 # Valgrind and tools will also be built for this target, but not the
382 # regression or performance tests.
384 # By default, the primary arch is the same as the "max" arch, as commented
385 # above (at the definition of ARCH_MAX). We may choose to downgrade it in
386 # the big case statement just below here, in the case where we're building
387 # on a 64 bit machine but have been requested only to do a 32 bit build.
388 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
390 AC_MSG_CHECKING([for a supported CPU/OS combination])
392 # NB. The load address for a given platform may be specified in more
393 # than one place, in some cases, depending on whether we're doing a biarch,
394 # 32-bit only or 64-bit only build. eg see case for amd64-linux below.
395 # Be careful to give consistent values in all subcases. Also, all four
396 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
397 # even if it is to "0xUNSET".
399 case "$ARCH_MAX-$VGCONF_OS" in
401 VGCONF_ARCH_PRI="x86"
403 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
404 VGCONF_PLATFORM_SEC_CAPS=""
405 valt_load_address_pri_norml="0x38000000"
406 valt_load_address_pri_inner="0x28000000"
407 valt_load_address_sec_norml="0xUNSET"
408 valt_load_address_sec_inner="0xUNSET"
409 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
412 valt_load_address_sec_norml="0xUNSET"
413 valt_load_address_sec_inner="0xUNSET"
414 if test x$vg_cv_only64bit = xyes; then
415 VGCONF_ARCH_PRI="amd64"
417 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
418 VGCONF_PLATFORM_SEC_CAPS=""
419 valt_load_address_pri_norml="0x38000000"
420 valt_load_address_pri_inner="0x28000000"
421 elif test x$vg_cv_only32bit = xyes; then
422 VGCONF_ARCH_PRI="x86"
424 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
425 VGCONF_PLATFORM_SEC_CAPS=""
426 valt_load_address_pri_norml="0x38000000"
427 valt_load_address_pri_inner="0x28000000"
429 VGCONF_ARCH_PRI="amd64"
430 VGCONF_ARCH_SEC="x86"
431 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
432 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
433 valt_load_address_pri_norml="0x38000000"
434 valt_load_address_pri_inner="0x28000000"
435 valt_load_address_sec_norml="0x38000000"
436 valt_load_address_sec_inner="0x28000000"
438 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
441 VGCONF_ARCH_PRI="ppc32"
443 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
444 VGCONF_PLATFORM_SEC_CAPS=""
445 valt_load_address_pri_norml="0x38000000"
446 valt_load_address_pri_inner="0x28000000"
447 valt_load_address_sec_norml="0xUNSET"
448 valt_load_address_sec_inner="0xUNSET"
449 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
452 valt_load_address_sec_norml="0xUNSET"
453 valt_load_address_sec_inner="0xUNSET"
454 if test x$vg_cv_only64bit = xyes; then
455 VGCONF_ARCH_PRI="ppc64"
457 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
458 VGCONF_PLATFORM_SEC_CAPS=""
459 valt_load_address_pri_norml="0x38000000"
460 valt_load_address_pri_inner="0x28000000"
461 elif test x$vg_cv_only32bit = xyes; then
462 VGCONF_ARCH_PRI="ppc32"
464 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
465 VGCONF_PLATFORM_SEC_CAPS=""
466 valt_load_address_pri_norml="0x38000000"
467 valt_load_address_pri_inner="0x28000000"
469 VGCONF_ARCH_PRI="ppc64"
470 VGCONF_ARCH_SEC="ppc32"
471 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
472 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
473 valt_load_address_pri_norml="0x38000000"
474 valt_load_address_pri_inner="0x28000000"
475 valt_load_address_sec_norml="0x38000000"
476 valt_load_address_sec_inner="0x28000000"
478 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
480 # Darwin gets identified as 32-bit even when it supports 64-bit.
481 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
482 # all Macs support both 32-bit and 64-bit, so we just build both. If
483 # someone has a really old 32-bit only machine they can (hopefully?)
484 # build with --enable-only32bit. See bug 243362.
485 x86-darwin|amd64-darwin)
487 valt_load_address_sec_norml="0xUNSET"
488 valt_load_address_sec_inner="0xUNSET"
489 if test x$vg_cv_only64bit = xyes; then
490 VGCONF_ARCH_PRI="amd64"
492 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
493 VGCONF_PLATFORM_SEC_CAPS=""
494 valt_load_address_pri_norml="0x138000000"
495 valt_load_address_pri_inner="0x128000000"
496 elif test x$vg_cv_only32bit = xyes; then
497 VGCONF_ARCH_PRI="x86"
499 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
500 VGCONF_PLATFORM_SEC_CAPS=""
501 VGCONF_ARCH_PRI_CAPS="x86"
502 valt_load_address_pri_norml="0x38000000"
503 valt_load_address_pri_inner="0x28000000"
505 VGCONF_ARCH_PRI="amd64"
506 VGCONF_ARCH_SEC="x86"
507 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
508 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
509 valt_load_address_pri_norml="0x138000000"
510 valt_load_address_pri_inner="0x128000000"
511 valt_load_address_sec_norml="0x38000000"
512 valt_load_address_sec_inner="0x28000000"
514 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
517 VGCONF_ARCH_PRI="arm"
518 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
519 VGCONF_PLATFORM_SEC_CAPS=""
520 valt_load_address_pri_norml="0x38000000"
521 valt_load_address_pri_inner="0x28000000"
522 valt_load_address_sec_norml="0xUNSET"
523 valt_load_address_sec_inner="0xUNSET"
524 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
527 VGCONF_ARCH_PRI="s390x"
529 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
530 VGCONF_PLATFORM_SEC_CAPS=""
531 # we want to have the generated code close to the dispatcher
532 valt_load_address_pri_norml="0x401000000"
533 valt_load_address_pri_inner="0x410000000"
534 valt_load_address_sec_norml="0xUNSET"
535 valt_load_address_sec_inner="0xUNSET"
536 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
539 VGCONF_ARCH_PRI="unknown"
540 VGCONF_ARCH_SEC="unknown"
541 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
542 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
543 valt_load_address_pri_norml="0xUNSET"
544 valt_load_address_pri_inner="0xUNSET"
545 valt_load_address_sec_norml="0xUNSET"
546 valt_load_address_sec_inner="0xUNSET"
547 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
548 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
552 #----------------------------------------------------------------------------
554 # Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
556 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
557 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
558 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
559 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
560 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN )
561 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
562 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
563 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN )
564 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
565 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
566 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
567 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
568 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
569 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
570 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
571 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
572 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
574 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
576 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
577 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
578 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
579 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
580 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
581 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
582 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
583 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
584 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX,
585 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
586 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
587 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
588 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
589 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
590 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
592 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
593 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
594 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
595 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
596 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
599 # Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
600 # Relies on the assumption that the primary and secondary targets are
601 # for the same OS, so therefore only necessary to test the primary.
602 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
603 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
604 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
605 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
606 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
607 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
608 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX)
609 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
610 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
611 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
614 # Sometimes, in the Makefile.am files, it's useful to know whether or not
615 # there is a secondary target.
616 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
617 test x$VGCONF_PLATFORM_SEC_CAPS != x)
620 #----------------------------------------------------------------------------
622 #----------------------------------------------------------------------------
624 # Check if this should be built as an inner Valgrind, to be run within
625 # another Valgrind. Choose the load address accordingly.
626 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
627 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
628 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
629 [AC_ARG_ENABLE(inner,
630 [ --enable-inner enables self-hosting],
631 [vg_cv_inner=$enableval],
633 if test "$vg_cv_inner" = yes; then
634 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
635 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
636 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
638 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
639 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
643 #----------------------------------------------------------------------------
644 # Extra fine-tuning of installation directories
645 #----------------------------------------------------------------------------
647 [ --with-tmpdir=PATH Specify path for temporary files],
650 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
653 #----------------------------------------------------------------------------
654 # Libc and suppressions
655 #----------------------------------------------------------------------------
656 # This variable will collect the suppression files to be used.
657 AC_SUBST(DEFAULT_SUPP)
659 AC_CHECK_HEADER([features.h])
661 if test x$ac_cv_header_features_h = xyes; then
662 rm -f conftest.$ac_ext
663 cat <<_ACEOF >conftest.$ac_ext
664 #include <features.h>
665 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
666 glibc version is: __GLIBC__ __GLIBC_MINOR__
669 GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
672 # not really a version check
673 AC_EGREP_CPP([DARWIN_LIBC], [
674 #include <sys/cdefs.h>
675 #if defined(__DARWIN_VERS_1050)
679 GLIBC_VERSION="darwin")
681 # not really a version check
682 AC_EGREP_CPP([BIONIC_LIBC], [
683 #if defined(__ANDROID__)
687 GLIBC_VERSION="bionic")
690 AC_MSG_CHECKING([the GLIBC_VERSION version])
692 case "${GLIBC_VERSION}" in
694 AC_MSG_RESULT(2.2 family)
695 AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
696 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
697 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
698 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
702 AC_MSG_RESULT(2.3 family)
703 AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
704 DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
705 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
706 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
710 AC_MSG_RESULT(2.4 family)
711 AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
712 DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
713 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
714 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
718 AC_MSG_RESULT(2.5 family)
719 AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
720 DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
721 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
722 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
725 AC_MSG_RESULT(2.6 family)
726 AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
727 DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
728 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
729 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
732 AC_MSG_RESULT(2.7 family)
733 AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
734 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
735 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
736 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
739 AC_MSG_RESULT(2.8 family)
740 AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
741 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
742 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
743 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
746 AC_MSG_RESULT(2.9 family)
747 AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
748 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
749 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
750 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
753 AC_MSG_RESULT(2.10 family)
754 AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
755 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
756 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
757 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
760 AC_MSG_RESULT(2.11 family)
761 AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
762 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
763 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
764 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
767 AC_MSG_RESULT(2.12 family)
768 AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
769 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
770 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
771 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
774 AC_MSG_RESULT(2.13 family)
775 AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
776 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
777 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
778 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
781 AC_MSG_RESULT(2.14 family)
782 AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
783 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
784 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
785 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
788 AC_MSG_RESULT(2.15 family)
789 AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x])
790 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
791 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
792 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
795 AC_MSG_RESULT(Darwin)
796 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
797 # DEFAULT_SUPP set by kernel version check above.
800 AC_MSG_RESULT(Bionic)
801 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
802 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
806 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
807 AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.15])
808 AC_MSG_ERROR([or Darwin libc])
812 AC_SUBST(GLIBC_VERSION)
815 # Add default suppressions for the X client libraries. Make no
816 # attempt to detect whether such libraries are installed on the
817 # build machine (or even if any X facilities are present); just
818 # add the suppressions antidisirregardless.
819 DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
820 DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
822 # Add glibc and X11 suppressions for exp-sgcheck
823 DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
826 #----------------------------------------------------------------------------
828 #----------------------------------------------------------------------------
830 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
831 # But there are times where we need a bit more control. The motivating
832 # and currently only case is Android: this is almost identical to arm-linux,
833 # but not quite. So this introduces the concept of platform variant tags,
834 # which get passed in the compile as -DVGPV_<arch>_<os>_<variant> along
835 # with the main -DVGP_<arch>_<os> definition.
837 # In almost all cases, the <variant> bit is "vanilla". But for Android
838 # it is "android" instead.
840 # Consequently (eg), plain arm-linux would build with
842 # -DVGP_arm_linux -DVGPV_arm_linux_vanilla
844 # whilst an Android build would have
846 # -DVGP_arm_linux -DVGPV_arm_linux_android
848 # The setup of the platform variant is pushed relatively far down this
849 # file in order that we can inspect any of the variables set above.
851 # In the normal case ..
852 VGCONF_PLATVARIANT="vanilla"
855 if test "$VGCONF_ARCH_PRI-$VGCONF_OS" = "arm-linux" \
856 -a "$GLIBC_VERSION" = "bionic";
858 VGCONF_PLATVARIANT="android"
861 AC_SUBST(VGCONF_PLATVARIANT)
864 # FIXME: do we also want to define automake variables
865 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
866 # VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
867 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
868 # do that. Problem is that we can't do and-ing in Makefile.am's, but
869 # that's what we'd need to do to use this, since what we'd want to write
872 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
874 # Hmm. Can't think of a nice clean solution to this.
876 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
877 test x$VGCONF_PLATVARIANT = xvanilla)
878 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
879 test x$VGCONF_PLATVARIANT = xandroid)
882 #----------------------------------------------------------------------------
883 # Checking for various library functions and other definitions
884 #----------------------------------------------------------------------------
886 # Check for CLOCK_MONOTONIC
888 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
890 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
894 clock_gettime(CLOCK_MONOTONIC, &t);
898 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
899 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
905 # Check for PTHREAD_RWLOCK_T
907 AC_MSG_CHECKING([for pthread_rwlock_t])
909 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
913 pthread_rwlock_t rwl;
916 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
917 [Define to 1 if you have the `pthread_rwlock_t' type.])
923 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
925 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
927 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
931 return (PTHREAD_MUTEX_ADAPTIVE_NP);
934 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
935 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
941 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
943 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
945 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
949 return (PTHREAD_MUTEX_ERRORCHECK_NP);
952 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
953 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
959 # Check for PTHREAD_MUTEX_RECURSIVE_NP
961 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
963 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
967 return (PTHREAD_MUTEX_RECURSIVE_NP);
970 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
971 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
977 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
979 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
985 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
989 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
990 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
996 # Check whether pthread_mutex_t has a member called __m_kind.
998 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
999 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1001 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1004 [#include <pthread.h>])
1007 # Check whether pthread_mutex_t has a member called __data.__kind.
1009 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1010 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1012 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1015 [#include <pthread.h>])
1018 # does this compiler support -maltivec and does it have the include file
1021 AC_MSG_CHECKING([for Altivec])
1026 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1027 #include <altivec.h>
1029 vector unsigned int v;
1032 AC_MSG_RESULT([yes])
1033 AC_DEFINE([HAS_ALTIVEC], 1,
1034 [Define to 1 if gcc/as can do Altivec.])
1041 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
1044 # Check that both: the compiler supports -mvsx and that the assembler
1045 # understands VSX instructions. If either of those doesn't work,
1046 # conclude that we can't do VSX. NOTE: basically this is a kludge
1047 # in that it conflates two things that should be separate -- whether
1048 # the compiler understands the flag vs whether the assembler
1049 # understands the opcodes. This really ought to be cleaned up
1050 # and done properly, like it is for x86/x86_64.
1052 AC_MSG_CHECKING([for VSX])
1057 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1058 #include <altivec.h>
1060 vector unsigned int v;
1061 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1064 AC_MSG_RESULT([yes])
1071 AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
1073 AC_MSG_CHECKING([that assembler knows DFP])
1075 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1077 __asm__ __volatile__("dadd 1, 2, 3");
1080 AC_MSG_RESULT([yes])
1086 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1089 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1091 __asm__ __volatile__("dadd 1, 2, 3");
1094 AC_MSG_RESULT([yes])
1102 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes -a x$ac_gcc_have_dfp = xyes)
1104 # Check for pthread_create@GLIBC2.0
1105 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1109 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1110 extern int pthread_create_glibc_2_0(void*, const void*,
1111 void *(*)(void*), void*);
1112 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1116 * Apparently on PowerPC linking this program succeeds and generates an
1117 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1119 #error This test does not work properly on PowerPC.
1121 pthread_create_glibc_2_0(0, 0, 0, 0);
1125 ac_have_pthread_create_glibc_2_0=yes
1126 AC_MSG_RESULT([yes])
1127 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1128 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1130 ac_have_pthread_create_glibc_2_0=no
1135 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1136 test x$ac_have_pthread_create_glibc_2_0 = xyes)
1139 # Check for eventfd_t, eventfd() and eventfd_read()
1140 AC_MSG_CHECKING([for eventfd()])
1142 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1143 #include <sys/eventfd.h>
1149 eventfd_read(fd, &ev);
1152 AC_MSG_RESULT([yes])
1153 AC_DEFINE([HAVE_EVENTFD], 1,
1154 [Define to 1 if you have the `eventfd' function.])
1155 AC_DEFINE([HAVE_EVENTFD_READ], 1,
1156 [Define to 1 if you have the `eventfd_read' function.])
1162 #----------------------------------------------------------------------------
1163 # Checking for supported compiler flags.
1164 #----------------------------------------------------------------------------
1166 # does this compiler support -m32 ?
1167 AC_MSG_CHECKING([if gcc accepts -m32])
1172 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1176 AC_MSG_RESULT([yes])
1186 # does this compiler support -m64 ?
1187 AC_MSG_CHECKING([if gcc accepts -m64])
1192 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1196 AC_MSG_RESULT([yes])
1206 # does this compiler support -mmmx ?
1207 AC_MSG_CHECKING([if gcc accepts -mmmx])
1212 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1216 AC_MSG_RESULT([yes])
1226 # does this compiler support -msse ?
1227 AC_MSG_CHECKING([if gcc accepts -msse])
1232 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1236 AC_MSG_RESULT([yes])
1246 # does this compiler support -mpreferred-stack-boundary=2 ?
1247 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
1250 CFLAGS="-mpreferred-stack-boundary=2"
1252 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1255 PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2"
1256 AC_MSG_RESULT([yes])
1258 PREFERRED_STACK_BOUNDARY=""
1263 AC_SUBST(PREFERRED_STACK_BOUNDARY)
1266 # does this compiler support -Wno-pointer-sign ?
1267 AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign])
1270 CFLAGS="-Wno-pointer-sign"
1272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1276 AC_MSG_RESULT([yes])
1283 if test x$no_pointer_sign = xyes; then
1284 CFLAGS="$CFLAGS -Wno-pointer-sign"
1288 # does this compiler support -Wno-empty-body ?
1290 AC_MSG_CHECKING([if gcc accepts -Wno-empty-body])
1293 CFLAGS="-Wno-empty-body"
1295 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1298 AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body])
1299 AC_MSG_RESULT([yes])
1301 AC_SUBST([FLAG_W_NO_EMPTY_BODY], [])
1307 # does this compiler support -Wno-format-zero-length ?
1309 AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
1312 CFLAGS="-Wno-format-zero-length"
1314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1317 AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
1318 AC_MSG_RESULT([yes])
1320 AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
1326 # does this compiler support -Wno-nonnull ?
1328 AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
1331 CFLAGS="-Wno-nonnull"
1333 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1336 AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
1337 AC_MSG_RESULT([yes])
1339 AC_SUBST([FLAG_W_NO_NONNULL], [])
1345 # does this compiler support -Wno-overflow ?
1347 AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
1350 CFLAGS="-Wno-overflow"
1352 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1355 AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
1356 AC_MSG_RESULT([yes])
1358 AC_SUBST([FLAG_W_NO_OVERFLOW], [])
1364 # does this compiler support -Wno-uninitialized ?
1366 AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
1369 CFLAGS="-Wno-uninitialized"
1371 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1374 AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized])
1375 AC_MSG_RESULT([yes])
1377 AC_SUBST([FLAG_W_NO_UNINITIALIZED], [])
1383 # does this compiler support -Wextra or the older -W ?
1385 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1393 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1394 AC_MSG_RESULT([-Wextra])
1397 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1400 AC_SUBST([FLAG_W_EXTRA], [-W])
1403 AC_SUBST([FLAG_W_EXTRA], [])
1404 AC_MSG_RESULT([not supported])
1410 # does this compiler support -fno-stack-protector ?
1411 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
1414 CFLAGS="-fno-stack-protector"
1416 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1419 no_stack_protector=yes
1420 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1421 AC_MSG_RESULT([yes])
1423 no_stack_protector=no
1424 FLAG_FNO_STACK_PROTECTOR=""
1429 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1431 if test x$no_stack_protector = xyes; then
1432 CFLAGS="$CFLAGS -fno-stack-protector"
1436 # does this compiler support --param inline-unit-growth=... ?
1438 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
1441 CFLAGS="--param inline-unit-growth=900"
1443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1446 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
1447 ["--param inline-unit-growth=900"])
1448 AC_MSG_RESULT([yes])
1450 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
1456 # does this compiler support -gdwarf-4 -fdebug-types-section ?
1458 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
1461 CFLAGS="-gdwarf-4 -fdebug-types-section"
1463 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1467 AC_MSG_RESULT([yes])
1472 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
1476 # does the linker support -Wl,--build-id=none ? Note, it's
1477 # important that we test indirectly via whichever C compiler
1478 # is selected, rather than testing /usr/bin/ld or whatever
1481 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
1484 CFLAGS="-Wl,--build-id=none"
1487 [AC_LANG_PROGRAM([ ], [return 0;])],
1489 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
1490 AC_MSG_RESULT([yes])
1492 AC_SUBST([FLAG_NO_BUILD_ID], [""])
1498 # does the ppc assembler support "mtocrf" et al?
1499 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
1501 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1502 __asm__ __volatile__("mtocrf 4,0");
1503 __asm__ __volatile__("mfocrf 0,4");
1505 ac_have_as_ppc_mftocrf=yes
1506 AC_MSG_RESULT([yes])
1508 ac_have_as_ppc_mftocrf=no
1511 if test x$ac_have_as_ppc_mftocrf = xyes ; then
1512 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
1518 # does the x86/amd64 assembler understand SSE3 instructions?
1519 # Note, this doesn't generate a C-level symbol. It generates a
1520 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
1521 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
1523 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1524 do { long long int x;
1525 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
1529 AC_MSG_RESULT([yes])
1535 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
1538 # Ditto for SSSE3 instructions (note extra S)
1539 # Note, this doesn't generate a C-level symbol. It generates a
1540 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
1541 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
1543 save_CFLAGS="$CFLAGS"
1544 CFLAGS="$CFLAGS -msse"
1545 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1546 do { long long int x;
1547 __asm__ __volatile__(
1548 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
1551 ac_have_as_ssse3=yes
1552 AC_MSG_RESULT([yes])
1557 CFLAGS="$save_CFLAGS"
1559 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
1562 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
1563 # Note, this doesn't generate a C-level symbol. It generates a
1564 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
1565 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
1566 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1568 __asm__ __volatile__(
1569 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
1572 ac_have_as_pclmulqdq=yes
1573 AC_MSG_RESULT([yes])
1575 ac_have_as_pclmulqdq=no
1579 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
1582 # does the x86/amd64 assembler understand the LZCNT instruction?
1583 # Note, this doesn't generate a C-level symbol. It generates a
1584 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
1585 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
1587 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1589 __asm__ __volatile__("lzcnt %rax,%rax");
1592 ac_have_as_lzcnt=yes
1593 AC_MSG_RESULT([yes])
1599 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
1602 # does the x86/amd64 assembler understand SSE 4.2 instructions?
1603 # Note, this doesn't generate a C-level symbol. It generates a
1604 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
1605 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
1607 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1608 do { long long int x;
1609 __asm__ __volatile__(
1610 "crc32q %%r15,%%r15" : : : "r15" );
1611 __asm__ __volatile__(
1612 "pblendvb (%rcx), %xmm11"); }
1615 ac_have_as_sse42=yes
1616 AC_MSG_RESULT([yes])
1622 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
1625 # XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
1626 # when building the tool executables. I think we should get rid of it.
1628 # Check for TLS support in the compiler and linker
1629 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1631 [vg_cv_linktime_tls=yes],
1632 [vg_cv_linktime_tls=no])
1633 # Native compilation: check whether running a program using TLS succeeds.
1634 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
1635 # succeeds but running programs using TLS fails.
1636 # Cross-compiling: check whether linking a program using TLS succeeds.
1637 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
1638 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
1639 [vg_cv_tls=$enableval],
1640 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1644 [vg_cv_tls=$vg_cv_linktime_tls])])])
1646 if test "$vg_cv_tls" = yes; then
1647 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
1651 #----------------------------------------------------------------------------
1652 # Checks for C header files.
1653 #----------------------------------------------------------------------------
1656 AC_CHECK_HEADERS([ \
1672 # Verify whether the <linux/futex.h> header is usable.
1673 AC_MSG_CHECKING([if <linux/futex.h> is usable])
1675 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1676 #include <linux/futex.h>
1680 ac_have_usable_linux_futex_h=yes
1681 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
1682 [Define to 1 if you have a usable <linux/futex.h> header file.])
1683 AC_MSG_RESULT([yes])
1685 ac_have_usable_linux_futex_h=no
1689 #----------------------------------------------------------------------------
1690 # Checks for typedefs, structures, and compiler characteristics.
1691 #----------------------------------------------------------------------------
1698 #----------------------------------------------------------------------------
1699 # Checks for library functions.
1700 #----------------------------------------------------------------------------
1704 AC_CHECK_LIB([pthread], [pthread_create])
1705 AC_CHECK_LIB([rt], [clock_gettime])
1718 pthread_barrier_init \
1719 pthread_condattr_setclock \
1720 pthread_mutex_timedlock \
1721 pthread_rwlock_timedrdlock \
1722 pthread_rwlock_timedwrlock \
1740 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
1741 # libraries with any shared object and/or executable. This is NOT what we
1742 # want for e.g. vgpreload_core-x86-linux.so
1745 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
1746 [test x$ac_cv_func_pthread_barrier_init = xyes])
1747 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
1748 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
1749 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
1750 [test x$ac_cv_func_pthread_spin_lock = xyes])
1753 #----------------------------------------------------------------------------
1755 #----------------------------------------------------------------------------
1756 # Do we have a useable MPI setup on the primary and/or secondary targets?
1757 # On Linux, by default, assumes mpicc and -m32/-m64
1758 # Note: this is a kludge in that it assumes the specified mpicc
1759 # understands -m32/-m64 regardless of what is specified using
1764 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1765 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1766 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX ; then
1767 mflag_primary=$FLAG_M32
1768 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1769 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
1770 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
1771 mflag_primary=$FLAG_M64
1775 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1776 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then
1777 mflag_secondary=$FLAG_M32
1782 [ --with-mpicc= Specify name of MPI2-ised C compiler],
1787 ## See if MPI_CC works for the primary target
1789 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
1791 saved_CFLAGS=$CFLAGS
1793 CFLAGS=$mflag_primary
1794 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1798 int r = MPI_Init(NULL,NULL);
1799 r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1802 ac_have_mpi2_pri=yes
1803 AC_MSG_RESULT([yes, $MPI_CC])
1809 CFLAGS=$saved_CFLAGS
1810 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
1812 ## See if MPI_CC works for the secondary target. Complication: what if
1813 ## there is no secondary target? We need this to then fail.
1814 ## Kludge this by making MPI_CC something which will surely fail in
1817 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
1819 saved_CFLAGS=$CFLAGS
1820 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
1821 CC="$MPI_CC this will surely fail"
1825 CFLAGS=$mflag_secondary
1826 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1830 int r = MPI_Init(NULL,NULL);
1831 r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1834 ac_have_mpi2_sec=yes
1835 AC_MSG_RESULT([yes, $MPI_CC])
1841 CFLAGS=$saved_CFLAGS
1842 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
1845 #----------------------------------------------------------------------------
1846 # Other library checks
1847 #----------------------------------------------------------------------------
1848 # There now follow some tests for Boost, and OpenMP. These
1849 # tests are present because Drd has some regression tests that use
1850 # these packages. All regression test programs all compiled only
1851 # for the primary target. And so it is important that the configure
1852 # checks that follow, use the correct -m32 or -m64 flag for the
1853 # primary target (called $mflag_primary). Otherwise, we can end up
1854 # in a situation (eg) where, on amd64-linux, the test for Boost checks
1855 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
1856 # only build (meaning, the primary target is x86-linux), the build
1857 # of the regtest programs that use Boost fails, because they are
1858 # build as 32-bit (IN THIS EXAMPLE).
1860 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
1861 # NEEDED BY THE REGRESSION TEST PROGRAMS.
1864 # Check whether the boost library 1.35 or later has been installed.
1865 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
1867 AC_MSG_CHECKING([for boost])
1870 safe_CXXFLAGS=$CXXFLAGS
1871 CXXFLAGS="-lboost_thread-mt $mflag_primary"
1873 AC_LINK_IFELSE([AC_LANG_SOURCE([
1874 #include <boost/thread.hpp>
1875 static void thread_func(void)
1877 int main(int argc, char** argv)
1879 boost::thread t(thread_func);
1884 ac_have_boost_1_35=yes
1885 AC_SUBST([BOOST_CFLAGS], [])
1886 AC_SUBST([BOOST_LIBS], ["${CXXFLAGS}"])
1887 AC_MSG_RESULT([yes])
1889 ac_have_boost_1_35=no
1893 CXXFLAGS=$safe_CXXFLAGS
1896 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
1899 # does this compiler support -fopenmp, does it have the include file
1900 # <omp.h> and does it have libgomp ?
1902 AC_MSG_CHECKING([for OpenMP])
1905 CFLAGS="-fopenmp $mflag_primary"
1907 AC_LINK_IFELSE([AC_LANG_SOURCE([
1909 int main(int argc, char** argv)
1917 AC_MSG_RESULT([yes])
1924 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
1927 # does this compiler have built-in functions for atomic memory access for the
1929 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
1932 CFLAGS="$mflag_primary"
1934 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1936 return (__sync_bool_compare_and_swap(&variable, 1, 2)
1937 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
1939 ac_have_builtin_atomic_primary=yes
1940 AC_MSG_RESULT([yes])
1941 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])
1943 ac_have_builtin_atomic_primary=no
1949 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
1950 [test x$ac_have_builtin_atomic_primary = xyes])
1953 # does this compiler have built-in functions for atomic memory access for the
1954 # secondary target ?
1956 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
1958 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
1961 CFLAGS="$mflag_secondary"
1963 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1965 return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
1967 ac_have_builtin_atomic_secondary=yes
1968 AC_MSG_RESULT([yes])
1970 ac_have_builtin_atomic_secondary=no
1978 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
1979 [test x$ac_have_builtin_atomic_secondary = xyes])
1981 # does this compiler have built-in functions for atomic memory access on
1982 # 64-bit integers for all targets ?
1984 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
1986 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1989 uint64_t variable = 1;
1990 return __sync_add_and_fetch(&variable, 1)
1992 ac_have_builtin_atomic64_primary=yes
1994 ac_have_builtin_atomic64_primary=no
1997 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
2000 CFLAGS="$mflag_secondary"
2002 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2005 uint64_t variable = 1;
2006 return __sync_add_and_fetch(&variable, 1)
2008 ac_have_builtin_atomic64_secondary=yes
2010 ac_have_builtin_atomic64_secondary=no
2017 if test x$ac_have_builtin_atomic64_primary = xyes && \
2018 test x$VGCONF_PLATFORM_SEC_CAPS = x \
2019 -o x$ac_have_builtin_atomic64_secondary = xyes; then
2020 AC_MSG_RESULT([yes])
2021 ac_have_builtin_atomic64=yes
2024 ac_have_builtin_atomic64=no
2027 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
2028 [test x$ac_have_builtin_atomic64 = xyes])
2031 # does g++ have built-in functions for atomic memory access ?
2032 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
2034 safe_CXXFLAGS=$CXXFLAGS
2035 CXXFLAGS="$mflag_primary"
2038 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2040 return (__sync_bool_compare_and_swap(&variable, 1, 2)
2041 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
2043 ac_have_builtin_atomic_cxx=yes
2044 AC_MSG_RESULT([yes])
2045 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
2047 ac_have_builtin_atomic_cxx=no
2052 CXXFLAGS=$safe_CXXFLAGS
2054 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
2057 if test x$ac_have_usable_linux_futex_h = xyes \
2058 -a x$ac_have_builtin_atomic_primary = xyes; then
2059 ac_enable_linux_ticket_lock_primary=yes
2061 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
2062 [test x$ac_enable_linux_ticket_lock_primary = xyes])
2064 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
2065 -a x$ac_have_usable_linux_futex_h = xyes \
2066 -a x$ac_have_builtin_atomic_secondary = xyes; then
2067 ac_enable_linux_ticket_lock_secondary=yes
2069 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
2070 [test x$ac_enable_linux_ticket_lock_secondary = xyes])
2073 # does libstdc++ support annotating shared pointers ?
2074 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
2076 safe_CXXFLAGS=$CFLAGS
2077 CXXFLAGS="-std=c++0x"
2080 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2083 std::shared_ptr<int> p
2085 ac_have_shared_ptr=yes
2087 ac_have_shared_ptr=no
2089 if test x$ac_have_shared_ptr = xyes; then
2090 # If compilation of the program below fails because of a syntax error
2091 # triggered by substituting one of the annotation macros then that
2092 # means that libstdc++ supports these macros.
2093 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2094 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
2095 #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
2098 std::shared_ptr<int> p
2100 ac_have_shared_pointer_annotation=no
2103 ac_have_shared_pointer_annotation=yes
2104 AC_MSG_RESULT([yes])
2105 AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
2106 [Define to 1 if libstd++ supports annotating shared pointers])
2109 ac_have_shared_pointer_annotation=no
2114 CXXFLAGS=$safe_CXXFLAGS
2116 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
2117 [test x$ac_have_shared_pointer_annotation = xyes])
2120 #----------------------------------------------------------------------------
2121 # Ok. We're done checking.
2122 #----------------------------------------------------------------------------
2124 # Nb: VEX/Makefile is generated from Makefile.vex.in.
2127 VEX/Makefile:Makefile.vex.in
2136 gdbserver_tests/Makefile
2142 memcheck/tests/Makefile
2143 memcheck/tests/amd64/Makefile
2144 memcheck/tests/x86/Makefile
2145 memcheck/tests/linux/Makefile
2146 memcheck/tests/darwin/Makefile
2147 memcheck/tests/amd64-linux/Makefile
2148 memcheck/tests/x86-linux/Makefile
2149 memcheck/tests/ppc32/Makefile
2150 memcheck/tests/ppc64/Makefile
2152 cachegrind/tests/Makefile
2153 cachegrind/tests/x86/Makefile
2154 cachegrind/cg_annotate
2157 callgrind/callgrind_annotate
2158 callgrind/callgrind_control
2159 callgrind/tests/Makefile
2161 helgrind/tests/Makefile
2163 massif/tests/Makefile
2166 lackey/tests/Makefile
2169 none/tests/amd64/Makefile
2170 none/tests/ppc32/Makefile
2171 none/tests/ppc64/Makefile
2172 none/tests/x86/Makefile
2173 none/tests/arm/Makefile
2174 none/tests/s390x/Makefile
2175 none/tests/linux/Makefile
2176 none/tests/darwin/Makefile
2177 none/tests/x86-linux/Makefile
2178 exp-sgcheck/Makefile
2179 exp-sgcheck/tests/Makefile
2181 drd/scripts/download-and-build-splash2
2184 exp-bbv/tests/Makefile
2185 exp-bbv/tests/x86/Makefile
2186 exp-bbv/tests/x86-linux/Makefile
2187 exp-bbv/tests/amd64-linux/Makefile
2188 exp-bbv/tests/ppc32-linux/Makefile
2189 exp-bbv/tests/arm-linux/Makefile
2191 exp-dhat/tests/Makefile
2193 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
2194 [chmod +x coregrind/link_tool_exe_linux])
2195 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
2196 [chmod +x coregrind/link_tool_exe_darwin])
2201 Maximum build arch: ${ARCH_MAX}
2202 Primary build arch: ${VGCONF_ARCH_PRI}
2203 Secondary build arch: ${VGCONF_ARCH_SEC}
2204 Build OS: ${VGCONF_OS}
2205 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
2206 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
2207 Platform variant: ${VGCONF_PLATVARIANT}
2208 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
2209 Default supp files: ${DEFAULT_SUPP}