##------------------------------------------------------------##
# Process this file with autoconf to produce a configure script.
-AC_INIT(Valgrind, 3.6.0.SVN, valgrind-users@lists.sourceforge.net)
+AC_INIT(Valgrind, 3.7.0.SVN, valgrind-users@lists.sourceforge.net)
AC_CONFIG_SRCDIR(coregrind/m_main.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([foreign])
#----------------------------------------------------------------------------
# Checks for various programs.
#----------------------------------------------------------------------------
-CFLAGS="-Wno-long-long"
+CFLAGS="-Wno-long-long $CFLAGS"
AC_PROG_LN_S
AC_PROG_CC
# AC_SUBST([OBJCFLAGS])
# ])
AC_PROG_RANLIB
+# provide a very basic definition for AC_PROG_SED if it's not provided by
+# autoconf (as e.g. in autoconf 2.59).
+m4_ifndef([AC_PROG_SED],
+ [AC_DEFUN([AC_PROG_SED],
+ [AC_ARG_VAR([SED])
+ AC_CHECK_PROGS([SED],[gsed sed])])])
+AC_PROG_SED
# If no AR variable was specified, look up the name of the archiver. Otherwise
# do not touch the AR variable.
if test "x$AR" = "x"; then
- AC_PATH_PROGS([AR], [`echo $LD | sed 's/ld$/ar/'` "ar"], [ar])
+ AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
fi
AC_ARG_VAR([AR],[Archiver command])
# We don't want gcc < 3.0
AC_MSG_CHECKING([for a supported version of gcc])
-[gcc_version=`${CC} --version | head -n 1 | sed 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
+[gcc_version=`${CC} --version | head -n 1 | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
case "${gcc_version}" in
2.*)
esac
;;
+ s390x)
+ AC_MSG_RESULT([ok (${host_cpu})])
+ ARCH_MAX="s390x"
+ ;;
+
armv7*)
AC_MSG_RESULT([ok (${host_cpu})])
ARCH_MAX="arm"
VGCONF_OS="aix5"
;;
- *freebsd*)
- AC_MSG_RESULT([ok (${host_os})])
- VGCONF_OS="freebsd"
- ;;
-
*l4re*)
AC_MSG_RESULT([ok (${host_os})])
VGCONF_OS="l4re"
*darwin*)
AC_MSG_RESULT([ok (${host_os})])
VGCONF_OS="darwin"
+ AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
+ AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
+ AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
AC_MSG_CHECKING([for the kernel version])
kernel=`uname -r`
# Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
# has only one relevant version, the OS version. The `uname` check
# is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
- # X 10.5.6, and "Darwin 10.x" would presumably be Mac OS X 10.6.x
- # Snow Leopard and darwin10.supp), and we don't know of an macros
- # similar to __GLIBC__ to get that info.
+ # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard),
+ # and we don't know of an macros similar to __GLIBC__ to get that info.
#
# XXX: `uname -r` won't do the right thing for cross-compiles, but
# that's not a problem yet.
case "${kernel}" in
9.*)
AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
;;
+ 10.*)
+ AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
+ DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
*)
AC_MSG_RESULT([unsupported (${kernel})])
- AC_MSG_ERROR([Valgrind works on Darwin 9.x (Mac OS X 10.5)])
+ AC_MSG_ERROR([Valgrind works on Darwin 9.x and 10.x (Mac OS X 10.5 and 10.6)])
;;
esac
;;
*)
AC_MSG_RESULT([no (${host_os})])
- AC_MSG_ERROR([Valgrind is operating system specific. Sorry. Please consider doing a port.])
+ AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
;;
esac
AC_MSG_CHECKING([for a supported CPU/OS combination])
+# NB. The load address for a given platform may be specified in more
+# than one place, in some cases, depending on whether we're doing a biarch,
+# 32-bit only or 64-bit only build. eg see case for amd64-linux below.
+# Be careful to give consistent values in all subcases. Also, all four
+# valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
+# even if it is to "0xUNSET".
+#
case "$ARCH_MAX-$VGCONF_OS" in
x86-linux)
- VGCONF_ARCH_PRI="x86"
- VGCONF_ARCH_SEC=""
- VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
- VGCONF_PLATFORM_SEC_CAPS=""
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
+ VGCONF_ARCH_PRI="x86"
+ VGCONF_ARCH_SEC=""
+ VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
+ VGCONF_PLATFORM_SEC_CAPS=""
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
amd64-linux)
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
if test x$vg_cv_only64bit = xyes; then
VGCONF_ARCH_PRI="amd64"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
VGCONF_PLATFORM_SEC_CAPS=""
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
elif test x$vg_cv_only32bit = xyes; then
VGCONF_ARCH_PRI="x86"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
VGCONF_PLATFORM_SEC_CAPS=""
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
else
VGCONF_ARCH_PRI="amd64"
VGCONF_ARCH_SEC="x86"
VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
+ valt_load_address_sec_norml="0x38000000"
+ valt_load_address_sec_inner="0x28000000"
fi
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
ppc32-linux)
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
VGCONF_PLATFORM_SEC_CAPS=""
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
ppc64-aix5)
+ valt_load_address_pri_norml="0xUNSET"
+ valt_load_address_pri_inner="0xUNSET"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
if test x$vg_cv_only64bit = xyes; then
VGCONF_ARCH_PRI="ppc64"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5"
VGCONF_PLATFORM_SEC_CAPS="PPC32_AIX5"
fi
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
ppc64-linux)
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
if test x$vg_cv_only64bit = xyes; then
VGCONF_ARCH_PRI="ppc64"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
VGCONF_PLATFORM_SEC_CAPS=""
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
elif test x$vg_cv_only32bit = xyes; then
VGCONF_ARCH_PRI="ppc32"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
VGCONF_PLATFORM_SEC_CAPS=""
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
else
VGCONF_ARCH_PRI="ppc64"
VGCONF_ARCH_SEC="ppc32"
VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
+ valt_load_address_sec_norml="0x38000000"
+ valt_load_address_sec_inner="0x28000000"
fi
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
x86-l4re)
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="X86_L4RE"
VGCONF_PLATFORM_SEC_CAPS=""
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
+ valt_load_address_sec_norml="0x38000000"
+ valt_load_address_sec_inner="0x28000000"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
- x86-darwin)
- VGCONF_ARCH_PRI="x86"
- VGCONF_ARCH_SEC=""
- VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
- VGCONF_PLATFORM_SEC_CAPS=""
- valt_load_address_normal="0x0"
- valt_load_address_inner="0x0"
- AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
- ;;
- amd64-darwin)
+ # Darwin gets identified as 32-bit even when it supports 64-bit.
+ # (Not sure why, possibly because 'uname' returns "i386"?) Just about
+ # all Macs support both 32-bit and 64-bit, so we just build both. If
+ # someone has a really old 32-bit only machine they can (hopefully?)
+ # build with --enable-only32bit. See bug 243362.
+ x86-darwin|amd64-darwin)
+ ARCH_MAX="amd64"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
if test x$vg_cv_only64bit = xyes; then
VGCONF_ARCH_PRI="amd64"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
VGCONF_PLATFORM_SEC_CAPS=""
+ valt_load_address_pri_norml="0x138000000"
+ valt_load_address_pri_inner="0x128000000"
elif test x$vg_cv_only32bit = xyes; then
VGCONF_ARCH_PRI="x86"
VGCONF_ARCH_SEC=""
VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
VGCONF_PLATFORM_SEC_CAPS=""
VGCONF_ARCH_PRI_CAPS="x86"
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
else
VGCONF_ARCH_PRI="amd64"
VGCONF_ARCH_SEC="x86"
VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
+ valt_load_address_pri_norml="0x138000000"
+ valt_load_address_pri_inner="0x128000000"
+ valt_load_address_sec_norml="0x38000000"
+ valt_load_address_sec_inner="0x28000000"
fi
- valt_load_address_normal="0x0"
- valt_load_address_inner="0x0"
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
;;
arm-linux)
VGCONF_ARCH_PRI="arm"
VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
VGCONF_PLATFORM_SEC_CAPS=""
- valt_load_address_normal="0x38000000"
- valt_load_address_inner="0x28000000"
+ valt_load_address_pri_norml="0x38000000"
+ valt_load_address_pri_inner="0x28000000"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
;;
+ s390x-linux)
+ VGCONF_ARCH_PRI="s390x"
+ VGCONF_ARCH_SEC=""
+ VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
+ VGCONF_PLATFORM_SEC_CAPS=""
+ # we want to have the generated code close to the dispatcher
+ valt_load_address_pri_norml="0x401000000"
+ valt_load_address_pri_inner="0x410000000"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
+ AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
+ ;;
*)
VGCONF_ARCH_PRI="unknown"
VGCONF_ARCH_SEC="unknown"
VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
+ valt_load_address_pri_norml="0xUNSET"
+ valt_load_address_pri_inner="0xUNSET"
+ valt_load_address_sec_norml="0xUNSET"
+ valt_load_address_sec_inner="0xUNSET"
AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
;;
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 )
AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
+AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
+ test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
# Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
# become defined.
test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
+AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
+ test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
+ -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5,
test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \
test x$VGCONF_PLATFORM_PRI_CAPS = xX86_L4RE)
-# Similarly, set up VGCONF_OF_IS_<os>. Exactly one of these becomes defined.
+# Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
# Relies on the assumption that the primary and secondary targets are
# for the same OS, so therefore only necessary to test the primary.
AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
-o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
- -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX)
AM_CONDITIONAL(VGCONF_OS_IS_AIX5,
test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5)
# Check if this should be built as an inner Valgrind, to be run within
# another Valgrind. Choose the load address accordingly.
-AC_SUBST(VALT_LOAD_ADDRESS)
+AC_SUBST(VALT_LOAD_ADDRESS_PRI)
+AC_SUBST(VALT_LOAD_ADDRESS_SEC)
AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
[AC_ARG_ENABLE(inner,
[ --enable-inner enables self-hosting],
[vg_cv_inner=no])])
if test "$vg_cv_inner" = yes; then
AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
- VALT_LOAD_ADDRESS=$valt_load_address_inner
+ VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
+ VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
else
- VALT_LOAD_ADDRESS=$valt_load_address_normal
+ VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
+ VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
fi
# glibcs >= 2.7)
AC_SUBST(GENERATED_SUPP)
-GLIBC_VERSION=""
+AC_CHECK_HEADER([features.h])
-AC_EGREP_CPP([GLIBC_22], [
+if test x$ac_cv_header_features_h = xyes; then
+ rm -f conftest.$ac_ext
+ cat <<_ACEOF >conftest.$ac_ext
#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2)
- GLIBC_22
- #endif
+#if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+glibc version is: __GLIBC__ __GLIBC_MINOR__
#endif
-],
-GLIBC_VERSION="2.2")
-
-AC_EGREP_CPP([GLIBC_23], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 3)
- GLIBC_23
- #endif
-#endif
-],
-GLIBC_VERSION="2.3")
-
-AC_EGREP_CPP([GLIBC_24], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 4)
- GLIBC_24
- #endif
-#endif
-],
-GLIBC_VERSION="2.4")
-
-AC_EGREP_CPP([GLIBC_25], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 5)
- GLIBC_25
- #endif
-#endif
-],
-GLIBC_VERSION="2.5")
-
-AC_EGREP_CPP([GLIBC_26], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 6)
- GLIBC_26
- #endif
-#endif
-],
-GLIBC_VERSION="2.6")
-
-AC_EGREP_CPP([GLIBC_27], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 7)
- GLIBC_27
- #endif
-#endif
-],
-GLIBC_VERSION="2.7")
-
-AC_EGREP_CPP([GLIBC_28], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 8)
- GLIBC_28
- #endif
-#endif
-],
-GLIBC_VERSION="2.8")
-
-AC_EGREP_CPP([GLIBC_29], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9)
- GLIBC_29
- #endif
-#endif
-],
-GLIBC_VERSION="2.9")
-
-AC_EGREP_CPP([GLIBC_210], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 10)
- GLIBC_210
- #endif
-#endif
-],
-GLIBC_VERSION="2.10")
-
-AC_EGREP_CPP([GLIBC_211], [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 11)
- GLIBC_211
- #endif
-#endif
-],
-GLIBC_VERSION="2.11")
+_ACEOF
+ GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
+fi
AC_EGREP_CPP([AIX5_LIBC], [
#include <standards.h>
GENERATED_SUPP="glibc-2.X.supp ${GENERATED_SUPP}"
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.12)
+ AC_MSG_RESULT(2.12 family)
+ AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
+ GENERATED_SUPP="glibc-2.X.supp ${GENERATED_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.13)
+ AC_MSG_RESULT(2.13 family)
+ AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
+ GENERATED_SUPP="glibc-2.X.supp ${GENERATED_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.13)
+ AC_MSG_RESULT(2.13 family)
+ AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
aix5)
AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3)
;;
*)
- AC_MSG_RESULT(unsupported version)
- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.11])
+ AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.13])
AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION])
AC_MSG_ERROR([or Darwin libc])
;;
DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
-# Add glibc and X11 suppressions for exp-ptrcheck
-DEFAULT_SUPP="exp-ptrcheck.supp ${DEFAULT_SUPP}"
+# Add glibc and X11 suppressions for exp-sgcheck
+DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
#----------------------------------------------------------------------------
[
ac_have_altivec=yes
AC_MSG_RESULT([yes])
+AC_DEFINE([HAS_ALTIVEC], 1,
+ [Define to 1 if gcc/as can do Altivec.])
], [
ac_have_altivec=no
AC_MSG_RESULT([no])
CFLAGS=$safe_CFLAGS
AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
-AM_CONDITIONAL([HAVE_ALTIVEC_H], [test x$ac_have_altivec = xyes])
+
+
+# Check that both: the compiler supports -mvsx and that the assembler
+# understands VSX instructions. If either of those doesn't work,
+# conclude that we can't do VSX. NOTE: basically this is a kludge
+# in that it conflates two things that should be separate -- whether
+# the compiler understands the flag vs whether the assembler
+# understands the opcodes. This really ought to be cleaned up
+# and done properly, like it is for x86/x86_64.
+
+AC_MSG_CHECKING([for VSX])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-mvsx"
+
+AC_TRY_COMPILE(
+[
+#include <altivec.h>
+], [
+ vector unsigned int v;
+ __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
+],
+[
+ac_have_vsx=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_vsx=no
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
# Check for pthread_create@GLIBC2.0
CFLAGS=$safe_CFLAGS
+# does this compiler support -Wno-nonnull ?
+
+AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-nonnull"
+
+AC_TRY_COMPILE(
+[ ],
+[
+ return 0;
+],
+[
+AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
+AC_MSG_RESULT([yes])
+],
+[
+AC_SUBST([FLAG_W_NO_NONNULL], [])
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
+# does this compiler support -Wno-overflow ?
+
+AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-overflow"
+
+AC_TRY_COMPILE(
+[ ],
+[
+ return 0;
+],
+[
+AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
+AC_MSG_RESULT([yes])
+],
+[
+AC_SUBST([FLAG_W_NO_OVERFLOW], [])
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
# does this compiler support -Wno-uninitialized ?
AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
CFLAGS=$safe_CFLAGS
+# does the linker support -Wl,--build-id=none ? Note, it's
+# important that we test indirectly via whichever C compiler
+# is selected, rather than testing /usr/bin/ld or whatever
+# directly.
+
+AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wl,--build-id=none"
+
+AC_LINK_IFELSE(
+[AC_LANG_PROGRAM([ ], [return 0;])],
+[
+ AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
+ AC_MSG_RESULT([yes])
+], [
+ AC_SUBST([FLAG_NO_BUILD_ID], [""])
+ AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
# does the ppc assembler support "mtocrf" et al?
AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
fi
+CFLAGS=$safe_CFLAGS
+
# does the x86/amd64 assembler understand SSE3 instructions?
# Note, this doesn't generate a C-level symbol. It generates a
# automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
+# does the x86/amd64 assembler understand the PCLMULQDQ instruction?
+# Note, this doesn't generate a C-level symbol. It generates a
+# automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
+AC_TRY_COMPILE(, [
+ do {
+ __asm__ __volatile__(
+ "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
+ while (0)
+],
+[
+ac_have_as_pclmulqdq=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_pclmulqdq=no
+AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
+
+
+# does the x86/amd64 assembler understand the LZCNT instruction?
+# Note, this doesn't generate a C-level symbol. It generates a
+# automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
+
+AC_TRY_COMPILE([], [
+ do {
+ __asm__ __volatile__("lzcnt %rax,%rax");
+ } while (0)
+],
+[
+ ac_have_as_lzcnt=yes
+ AC_MSG_RESULT([yes])
+], [
+ ac_have_as_lzcnt=no
+ AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
+
+
+# does the x86/amd64 assembler understand SSE 4.2 instructions?
+# Note, this doesn't generate a C-level symbol. It generates a
+# automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
+
+AC_TRY_COMPILE(, [
+ do { long long int x;
+ __asm__ __volatile__(
+ "crc32q %%r15,%%r15" : : : "r15" ); }
+ while (0)
+],
+[
+ac_have_as_sse42=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_sse42=no
+AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
+
+
+# XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
+# when building the tool executables. I think we should get rid of it.
+#
# Check for TLS support in the compiler and linker
if test "x${cross_compiling}" = "xno"; then
# Native compilation: check whether running a program using TLS succeeds.
AC_FUNC_MMAP
AC_TYPE_SIGNAL
+AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_FUNCS([ \
clock_gettime\
epoll_create \
epoll_pwait \
- floor \
klogctl \
mallinfo \
memchr \
semtimedop \
signalfd \
sigwaitinfo \
- syscall \
strchr \
strdup \
strpbrk \
strrchr \
strstr \
- timerfd \
+ syscall \
utimensat \
])
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX ; then
mflag_primary=$FLAG_M32
elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
- -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX ; then
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
mflag_primary=$FLAG_M64
elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 ; then
mflag_primary=-q32
#----------------------------------------------------------------------------
# Other library checks
#----------------------------------------------------------------------------
-# There now follow some tests for QtCore, Boost, and OpenMP. These
+# There now follow some tests for Boost, and OpenMP. These
# tests are present because Drd has some regression tests that use
# these packages. All regression test programs all compiled only
# for the primary target. And so it is important that the configure
# NEEDED BY THE REGRESSION TEST PROGRAMS.
-# The test below verifies whether the QtCore package been installed.
-# This test works as follows:
-# - If pkg-config was not installed at the time autogen.sh was run,
-# the definition of the PKG_CHECK_EXISTS() macro will not be found by
-# autogen.sh. Augogen.sh will generate a configure script that prints
-# a warning about pkg-config and proceeds as if Qt4 has not been installed.
-# - If pkg-config was installed at the time autogen.sh was run,
-# the generated configure script will try to detect the presence of the
-# Qt4 QtCore library by looking up compile and linker flags in the file
-# called QtCore.pc.
-# - pkg-config settings can be overridden via the configure variables
-# QTCORE_CFLAGS and QTCORE_LIBS (added by the pkg-config m4 macro's to the
-# configure script -- see also ./configure --help).
-# - The QTCORE_CFLAGS and QTCORE_LIBS configure variables can be used even if
-# the pkg-config executable is not present on the system on which the
-# configure script is run.
-
-ifdef(
- [PKG_CHECK_EXISTS],
- [PKG_CHECK_EXISTS(
- [QtCore],
- [
- PKG_CHECK_MODULES([QTCORE], [QtCore])
- # Paranoia: don't trust the result reported by pkg-config, but when
- # pkg-config reports that QtCore has been found, verify whether linking
- # programs with QtCore succeeds.
- AC_LANG(C++)
- safe_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${QTCORE_CFLAGS} ${QTCORE_LIBS} $mflag_primary"
- AC_TRY_LINK(
- [#include <QMutex>],
- [QMutex Mutex;],
- [ac_have_qtcore=yes],
- [
- AC_MSG_WARN([Although pkg-config detected Qt4, linking Qt4 programs fails. Skipping Qt4.])
- ac_have_qtcore=no
- ]
- )
- CXXFLAGS="${safe_CXXFLAGS}"
- ],
- [
- ac_have_qtcore=no
- ]
- )
- ],
- AC_MSG_WARN([pkg-config has not been installed or is too old.])
- AC_MSG_WARN([Detection of Qt4 will be skipped.])
- [ac_have_qtcore=no]
-)
-
-AM_CONDITIONAL([HAVE_QTCORE], [test x$ac_have_qtcore = xyes])
-
-
-# Test for QMutex::tryLock(int), which has been introduced in Qt 4.3.
-# See also http://doc.trolltech.com/4.3/qmutex.html.
-if test x$ac_have_qtcore = xyes; then
- AC_MSG_CHECKING([for Qt4 QMutex::tryLock(int)])
- AC_LANG(C++)
- safe_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${QTCORE_CFLAGS} $mflag_primary"
- AC_TRY_COMPILE([
- #include <QtCore/QMutex>
- ],
- [
- QMutex M;
- M.tryLock(1);
- M.unlock();
- return 0;
- ],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_QTCORE_QMUTEX_TRYLOCK_INT], [1], [Define to 1 if the installed version of Qt4 provides QMutex::tryLock(int).])
- ],
- [
- AC_MSG_RESULT([no])
- ])
- CXXFLAGS="${safe_CXXFLAGS}"
- AC_LANG(C)
-fi
-
-
-# Test for QAtomicInt, which has been introduced in Qt 4.4.
-# See also http://doc.trolltech.com/4.4/qatomicint.html.
-if test x$ac_have_qtcore = xyes; then
- AC_MSG_CHECKING([for Qt4 QAtomicInt])
- AC_LANG(C++)
- safe_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${QTCORE_CFLAGS} $mflag_primary"
- AC_TRY_COMPILE([
- #include <QtCore/QAtomicInt>
- ],
- [
- QAtomicInt I;
- I.testAndSetOrdered(0, 1);
- return 0;
- ],
- [
- ac_have_qtcore_qatomicint=yes
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_QTCORE_QATOMICINT], [1], [Define to 1 if the installed version of Qt4 provides QAtomicInt.])
- ],
- [
- ac_have_qtcore_qatomicint=no
- AC_MSG_RESULT([no])
- ])
- CXXFLAGS="${safe_CXXFLAGS}"
- AC_LANG(C)
-fi
-
-AM_CONDITIONAL([HAVE_QTCORE_QATOMICINT], [test x$ac_have_qtcore_qatomicint = xyes])
-
-
-
# Check whether the boost library 1.35 or later has been installed.
# The Boost.Threads library has undergone a major rewrite in version 1.35.0.
safe_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-lboost_thread-mt $mflag_primary"
-AC_LINK_IFELSE(
-[
+AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <boost/thread.hpp>
static void thread_func(void)
{ }
boost::thread t(thread_func);
return 0;
}
-],
+])],
[
ac_have_boost_1_35=yes
AC_SUBST([BOOST_CFLAGS], [])
safe_CFLAGS=$CFLAGS
CFLAGS="-fopenmp $mflag_primary"
-AC_LINK_IFELSE(
-[
+AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <omp.h>
int main(int argc, char** argv)
{
omp_set_dynamic(0);
return 0;
}
-],
+])],
[
ac_have_openmp=yes
AC_MSG_RESULT([yes])
[
ac_have_builtin_atomic=yes
AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.])
+ AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
],
[
ac_have_builtin_atomic=no
AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], [test x$ac_have_builtin_atomic = xyes])
+# does g++ have built-in functions for atomic memory access ?
+AC_MSG_CHECKING([if g++ supports __sync_bool_compare_and_swap])
+
+safe_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$mflag_primary"
+
+AC_LANG_PUSH(C++)
+AC_TRY_LINK(,
+[
+ int variable = 1;
+ return (__sync_bool_compare_and_swap(&variable, 1, 2)
+ && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
+],
+[
+ ac_have_builtin_atomic_cxx=yes
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
+],
+[
+ ac_have_builtin_atomic_cxx=no
+ AC_MSG_RESULT([no])
+])
+AC_LANG_POP(C++)
+
+CXXFLAGS=$safe_CXXFLAGS
+
+AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
#----------------------------------------------------------------------------
# Ok. We're done checking.
tests/vg_regtest
perf/Makefile
perf/vg_perf
+ gdbserver_tests/Makefile
include/Makefile
auxprogs/Makefile
mpi/Makefile
memcheck/tests/x86/Makefile
memcheck/tests/linux/Makefile
memcheck/tests/darwin/Makefile
+ memcheck/tests/amd64-linux/Makefile
memcheck/tests/x86-linux/Makefile
+ memcheck/tests/ppc32/Makefile
+ memcheck/tests/ppc64/Makefile
memcheck/perf/Makefile
cachegrind/Makefile
cachegrind/tests/Makefile
cachegrind/tests/x86/Makefile
cachegrind/cg_annotate
+ cachegrind/cg_diff
callgrind/Makefile
callgrind/callgrind_annotate
callgrind/callgrind_control
none/tests/ppc64/Makefile
none/tests/x86/Makefile
none/tests/arm/Makefile
+ none/tests/s390x/Makefile
none/tests/linux/Makefile
none/tests/darwin/Makefile
none/tests/x86-linux/Makefile
- exp-ptrcheck/Makefile
- exp-ptrcheck/tests/Makefile
+ exp-sgcheck/Makefile
+ exp-sgcheck/tests/Makefile
drd/Makefile
drd/scripts/download-and-build-splash2
drd/tests/Makefile
exp-bbv/tests/x86-linux/Makefile
exp-bbv/tests/amd64-linux/Makefile
exp-bbv/tests/ppc32-linux/Makefile
+ exp-dhat/Makefile
+ exp-dhat/tests/Makefile
])
+AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
+ [chmod +x coregrind/link_tool_exe_linux])
+AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
+ [chmod +x coregrind/link_tool_exe_darwin])
+AC_CONFIG_FILES([coregrind/link_tool_exe_aix5],
+ [chmod +x coregrind/link_tool_exe_aix5])
+AC_CONFIG_FILES([coregrind/link_tool_exe_l4re],
+ [chmod +x coregrind/link_tool_exe_l4re])
AC_OUTPUT
cat<<EOF