From: Nicholas Nethercote Date: Thu, 22 Jan 2009 21:56:32 +0000 (+0000) Subject: Rename all the arch/OS/platform-related variables in configure.in to make it X-Git-Tag: svn/VALGRIND_3_5_0~1054 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed322feb84307371a17721dcc7b77d496a853a23;p=thirdparty%2Fvalgrind.git Rename all the arch/OS/platform-related variables in configure.in to make it clearer what they mean: - They all have VGCONF_ prefixes now, to indicate they come out of configure.in (and are clearly distinguished from the VGA_/VGO_/VGP_ #defines passed in to C files). - The ones that refer to the primary *or* secondary platform have _INCLUDES_ in them. - The ones that are in all-caps have a _CAPS suffix. So, for example, what was VGP_X86_LINUX is now VGCONF_PLATFORMS_INCLUDE_X86_LINUX, which is more verbose but also a lot clearer. The names of the #defines used in the C files (VGA_x86, VGO_linux, etc) are unchanged. cputest.c: changed to reflect the Valgrind installation's capabilities, rather than the machine's capabilities. In particular, if --enable-only32bit is used on a 64-bit machine, then this program will claim to only support 32-bits. Also use the VGA/VGO/VGP macros which are clearer than the __i386__ ones. (This is partially merged from the DARWIN branch.) configure.in: clean up the comments, distinguish different sections more clearly, and generally make it more readable. valgrind.pc.in: try to make this more accurate. I doubt anyone's using it. It doesn't appear to be set up to handle dual-architecture builds. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9031 --- diff --git a/Makefile.am b/Makefile.am index f9e57359fc..2b72c62ce7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,28 +42,28 @@ BUILT_SOURCES = default.supp valgrind.pc CLEANFILES = DISTCLEANFILES = default.supp -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX BUILT_SOURCES += valt_load_address_x86_linux.lds CLEANFILES += valt_load_address_x86_linux.lds endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX BUILT_SOURCES += valt_load_address_amd64_linux.lds CLEANFILES += valt_load_address_amd64_linux.lds endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX BUILT_SOURCES += valt_load_address_ppc32_linux.lds CLEANFILES += valt_load_address_ppc32_linux.lds endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX BUILT_SOURCES += valt_load_address_ppc64_linux.lds CLEANFILES += valt_load_address_ppc64_linux.lds endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 # No need to generate valt_load_address*.lds; the final executables # can be linked to be at any address. They will be relocated by # AIX kernel when they are loaded. endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 # Ditto endif diff --git a/Makefile.flags.am b/Makefile.flags.am index 1945177470..42a08513a4 100644 --- a/Makefile.flags.am +++ b/Makefile.flags.am @@ -51,13 +51,13 @@ AM_CCASFLAGS_PPC64_AIX5 = $(add_includes_ppc64_aix5) \ # regtests and performance tests. In fact, these must be used to # build anything which is built only once on a dual-arch build. # -AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VG_PLATFORM_PRI@) -AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VG_PLATFORM_PRI@) -AM_CFLAGS_PRI = $(AM_CFLAGS_@VG_PLATFORM_PRI@) -AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VG_PLATFORM_PRI@) +AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) +AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -if VGP_HAVE_SECONDARY - AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VG_PLATFORM_SEC@) +if VGCONF_HAVE_PLATFORM_SEC_CAPS + AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@) else AM_FLAG_M3264_SEC = endif diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 5395090e20..9e5fd1e1ef 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -43,7 +43,7 @@ valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI) # directly saying how to build libmpiwrap-*.so, instead of # using automake's standard gunk. # -if VGO_AIX5 +if VGCONF_OS_IS_AIX5 HACKY_FLAGS_PRI = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \ -qflag=w:w -qlanglvl=extended \ `echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g` @@ -62,18 +62,18 @@ endif ## noinst_PROGRAMS = if BUILD_MPIWRAP_PRI -noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_PRI@.so -libmpiwrap-@VG_PLATFORM_PRI@.so: libmpiwrap.c +noinst_PROGRAMS += libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so +libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so: libmpiwrap.c $(MPI_CC) $(HACKY_FLAGS_PRI) \ -I../include \ - -o libmpiwrap-@VG_PLATFORM_PRI@.so libmpiwrap.c + -o libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so libmpiwrap.c endif if BUILD_MPIWRAP_SEC -noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_SEC@.so -libmpiwrap-@VG_PLATFORM_SEC@.so: libmpiwrap.c +noinst_PROGRAMS += libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so +libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so: libmpiwrap.c $(MPI_CC) $(HACKY_FLAGS_SEC) \ -I../include \ - -o libmpiwrap-@VG_PLATFORM_SEC@.so libmpiwrap.c + -o libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so libmpiwrap.c endif @@ -87,19 +87,19 @@ install-exec-local: if BUILD_MPIWRAP_PRI # convert (eg) X86_LINUX to x86-linux # really should use sed here, rather than assume tr is available - pD=`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \ + pD=`echo @VGCONF_PLATFORM_PRI_CAPS@ | tr A-Z_ a-z-` ; \ $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so; \ - cp ./libmpiwrap-@VG_PLATFORM_PRI@.so ./libmpiwrap.so; \ + cp ./libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.so ./libmpiwrap.so; \ $(INSTALL_PROGRAM) ./libmpiwrap.so \ $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so endif if BUILD_MPIWRAP_SEC - pD=`echo @VG_PLATFORM_SEC@ | tr A-Z_ a-z-` ; \ + pD=`echo @VGCONF_PLATFORM_SEC_CAPS@ | tr A-Z_ a-z-` ; \ $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so; \ - cp ./libmpiwrap-@VG_PLATFORM_SEC@.so ./libmpiwrap.so; \ + cp ./libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.so ./libmpiwrap.so; \ $(INSTALL_PROGRAM) ./libmpiwrap.so \ $(DESTDIR)$(valdir)/$$pD; \ rm -f ./libmpiwrap.so @@ -110,27 +110,28 @@ endif ## It would seem that using nodist_SOURCES is the right fix, but ## I can't figure out how to do it. ## -#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_PRI@.c -#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_SEC@.c +#nodist_SOURCES = libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c +#nodist_SOURCES = libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c libmpiwrap-.c: rm -f libmpiwrap-.c touch libmpiwrap-.c -libmpiwrap-@VG_PLATFORM_PRI@.c: - rm -f libmpiwrap-@VG_PLATFORM_PRI@.c - touch libmpiwrap-@VG_PLATFORM_PRI@.c +libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c: + rm -f libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c + touch libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c -if VGP_HAVE_SECONDARY -libmpiwrap-@VG_PLATFORM_SEC@.c: - rm -f libmpiwrap-@VG_PLATFORM_SEC@.c - touch libmpiwrap-@VG_PLATFORM_SEC@.c +if VGCONF_HAVE_PLATFORM_SEC_CAPS +libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c: + rm -f libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c + touch libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c endif ## cleanery clean-local: rm -f libmpiwrap-.c \ - libmpiwrap-@VG_PLATFORM_PRI@.c libmpiwrap-@VG_PLATFORM_SEC@.c + libmpiwrap-@VGCONF_PLATFORM_PRI_CAPS@.c \ + libmpiwrap-@VGCONF_PLATFORM_SEC_CAPS@.c # #---------------------------------------------------------- diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am index 86eeed563d..eac282558b 100644 --- a/cachegrind/Makefile.am +++ b/cachegrind/Makefile.am @@ -5,22 +5,22 @@ bin_SCRIPTS = cg_annotate noinst_HEADERS = cg_arch.h cg_sim.c cg_branchpred.c noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += cachegrind-x86-linux endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += cachegrind-amd64-linux endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += cachegrind-ppc32-linux endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += cachegrind-ppc64-linux endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += cachegrind-ppc32-aix5 endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += cachegrind-ppc64-aix5 endif diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index 4b4806bdcf..0ffc4da6dc 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.flags.am SUBDIRS = . -if VGA_X86 +if VGCONF_ARCHS_INCLUDE_X86 SUBDIRS += x86 endif diff --git a/callgrind/Makefile.am b/callgrind/Makefile.am index dd15eb044c..ac1720c492 100644 --- a/callgrind/Makefile.am +++ b/callgrind/Makefile.am @@ -5,22 +5,22 @@ bin_SCRIPTS = callgrind_annotate callgrind_control noinst_HEADERS = global.h costs.h events.h noinst_PROGRAMS = -if VGP_X86_LINUX +if VGCONF_PLATFORMS_INCLUDE_X86_LINUX noinst_PROGRAMS += callgrind-x86-linux endif -if VGP_AMD64_LINUX +if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX noinst_PROGRAMS += callgrind-amd64-linux endif -if VGP_PPC32_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX noinst_PROGRAMS += callgrind-ppc32-linux endif -if VGP_PPC64_LINUX +if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX noinst_PROGRAMS += callgrind-ppc64-linux endif -if VGP_PPC32_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5 noinst_PROGRAMS += callgrind-ppc32-aix5 endif -if VGP_PPC64_AIX5 +if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5 noinst_PROGRAMS += callgrind-ppc64-aix5 endif diff --git a/configure.in b/configure.in index 4bb7d108f2..3ca0ef0ce1 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,9 @@ AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE +#---------------------------------------------------------------------------- # Where is VEX ? +#---------------------------------------------------------------------------- # Nb: For the 2nd arg, the help string, AS_HELP_STRING is the proper way, but # older autoconfs don't support it... here's what it would say: # @@ -50,7 +52,9 @@ AC_SUBST(VEX_DIR) # place. AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], [--with-vex=$VEX_DIR]) -# Checks for programs. +#---------------------------------------------------------------------------- +# Checks for various programs. +#---------------------------------------------------------------------------- CFLAGS="-Wno-long-long" AC_PROG_LN_S @@ -125,51 +129,49 @@ case "${gcc_version}" in ;; esac - -# Checks for the platform, with the aim of setting VG_ARCH_MAX. Note -# that VG_ARCH_MAX must be set to reflect the most that this CPU can -# do: for example if it is a 64-bit capable PowerPC, then it must be -# set to ppc64 and not ppc32. Ditto for amd64. -# -# We will later in this file set VG_ARCH_PRI, which is the arch for -# the primary target. For example, suppose we do a build on an amd64 -# machine, but --enable-only32bit has been requested. Then -# VG_ARCH_MAX will be "amd64" since that reflects the most that this -# cpu can do, but VG_ARCH_PRI will be "x86", since that reflects the -# arch corresponding to the primary build (VG_PLATFORM_PRI). +#---------------------------------------------------------------------------- +# Arch/OS/platform tests. +#---------------------------------------------------------------------------- +# We create a number of arch/OS/platform-related variables. We prefix them +# all with "VGCONF_" which indicates that they are defined at +# configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_* +# variables used when compiling C files. AC_CANONICAL_HOST AC_MSG_CHECKING([for a supported CPU]) -AC_SUBST(VG_ARCH_MAX) +# ARCH_MAX reflects the most that this CPU can do: for example if it +# is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32. +# Ditto for amd64. It is used for more configuration below, but is not used +# outside this file. case "${host_cpu}" in i?86) AC_MSG_RESULT([ok (${host_cpu})]) - VG_ARCH_MAX="x86" + ARCH_MAX="x86" ;; x86_64) AC_MSG_RESULT([ok (${host_cpu})]) - VG_ARCH_MAX="amd64" + ARCH_MAX="amd64" ;; powerpc64) -# This value can only happen on Linux, not on AIX + # This value can only happen on Linux, not on AIX AC_MSG_RESULT([ok (${host_cpu})]) - VG_ARCH_MAX="ppc64" + ARCH_MAX="ppc64" ;; powerpc) -# Complexity. 'powerpc' on AIX implies a 64-bit capable CPU. -# Whereas in Linux that means only a 32-bit capable CPU. + # Complexity. 'powerpc' on AIX implies a 64-bit capable CPU. + # Whereas in Linux that means only a 32-bit capable CPU. AC_MSG_RESULT([ok (${host_cpu})]) case "${host_os}" in aix5.*) - VG_ARCH_MAX="ppc64" + ARCH_MAX="ppc64" ;; *) - VG_ARCH_MAX="ppc32" + ARCH_MAX="ppc32" ;; esac ;; @@ -180,10 +182,15 @@ case "${host_cpu}" in ;; esac +#---------------------------------------------------------------------------- + # Sometimes it's convenient to subvert the bi-arch build system and # just have a single build even though the underlying platform is # capable of both. Hence handle --enable-only64bit and # --enable-only32bit. Complain if both are issued :-) +# [Actually, if either of these options are used, I think both get built, +# but only one gets installed. So if you use an in-place build, both can be +# used. --njn] # Check if a 64-bit only build has been requested AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, @@ -205,19 +212,17 @@ if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then [Nonsensical: both --enable-only64bit and --enable-only32bit.]) fi +#---------------------------------------------------------------------------- -# This variable will collect the individual suppression files -# depending on the results of autoconf -DEFAULT_SUPP="" -AC_SUBST(DEFAULT_SUPP) - +# VGCONF_OS is the primary build OS. It is passed in to compilation of many +# C files via -VGO_$(VGCONF_OS) and -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). AC_MSG_CHECKING([for a supported OS]) -AC_SUBST(VG_OS) +AC_SUBST(VGCONF_OS) case "${host_os}" in *linux*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="linux" + VGCONF_OS="linux" # Ok, this is linux. Check the kernel version AC_MSG_CHECKING([for the kernel version]) @@ -245,20 +250,20 @@ case "${host_os}" in aix5.1.*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="aix5" + VGCONF_OS="aix5" ;; aix5.2.*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="aix5" + VGCONF_OS="aix5" ;; aix5.3.*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="aix5" + VGCONF_OS="aix5" ;; *freebsd*) AC_MSG_RESULT([ok (${host_os})]) - VG_OS="freebsd" + VGCONF_OS="freebsd" ;; *) @@ -267,11 +272,13 @@ case "${host_os}" in ;; esac +#---------------------------------------------------------------------------- + # If we are building on a 64 bit platform test to see if the system # supports building 32 bit programs and disable 32 bit support if it # does not support building 32 bit programs -case "$VG_ARCH_MAX-$VG_OS" in +case "$ARCH_MAX-$VGCONF_OS" in amd64-linux|ppc64-linux) AC_MSG_CHECKING([for 32 bit build support]) safe_CFLAGS=$CFLAGS @@ -293,72 +300,86 @@ if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then [--enable-only32bit was specified but system does not support 32 bit builds]) fi -# Establish VG_PLATFORM_PRI. This is the primary build target. The -# entire system, including regression and performance tests, will be -# built for this target. +#---------------------------------------------------------------------------- + +# VGCONF_ARCH_PRI is the arch for the primary build target. By default it's +# the same as ARCH_MAX. But if, say, we do a build on an amd64 machine, but +# --enable-only32bit has been requested, then ARCH_MAX (see above) will be +# "amd64" since that reflects the most that this cpu can do, but +# VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the arch +# corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is +# passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and +# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS). +AC_SUBST(VGCONF_ARCH_PRI) + +# VGCONF_PLATFORM_PRI_CAPS is the primary build target. The entire system, +# including regression and performance tests, will be built for this target. +# The "_CAPS" indicates that the name is in capital letters, because it's +# used to create various Makefile variables, which are all in caps by +# convention. This is in contrast to VGCONF_ARCH_PRI and VGCONF_OS which +# are not in caps. +AC_SUBST(VGCONF_PLATFORM_PRI_CAPS) + +# VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one. +# Valgrind and tools will also be built for this target, but not the +# regression or performance tests. # -# Also establish VG_PLATFORM_SEC, the secondary build target, if -# possible. The system will also be built for this target, but not -# the regression or performance tests. -# -# Also establish VG_ARCH_PRI, which is the arch for the primary -# build target. The various makefiles building regression tests -# sometimes need to see this. -AC_MSG_CHECKING([for a supported CPU/OS combination]) - -AC_SUBST(VG_PLATFORM_PRI) -AC_SUBST(VG_PLATFORM_SEC) -AC_SUBST(VG_ARCH_PRI) +# By default, the primary arch is the same as the "max" arch, as commented +# above (at the definition of ARCH_MAX). We may choose to downgrade it in +# the big case statement just below here, in the case where we're building +# on a 64 bit machine but have been requested only to do a 32 bit build. +AC_SUBST(VGCONF_PLATFORM_SEC_CAPS) -# By default, the primary arch is the same as the "max" arch, as -# commented above (at the definition of VG_ARCH_MAX). We may choose -# to downgrade it in the big case statement just below here, in the -# case where we're building on a 64 bit machine but have been -# requested only to do a 32 bit build. -VG_ARCH_PRI=$VG_ARCH_MAX +AC_MSG_CHECKING([for a supported CPU/OS combination]) -case "$VG_ARCH_MAX-$VG_OS" in +case "$ARCH_MAX-$VGCONF_OS" in x86-linux) - VG_PLATFORM_PRI="X86_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="x86" + VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; amd64-linux) if test x$vg_cv_only64bit = xyes; then - VG_PLATFORM_PRI="AMD64_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="amd64" + VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" elif test x$vg_cv_only32bit = xyes; then - VG_PLATFORM_PRI="X86_LINUX" - VG_PLATFORM_SEC="" - VG_ARCH_PRI="x86" + VGCONF_ARCH_PRI="x86" + VGCONF_PLATFORM_PRI_CAPS="X86_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" else - VG_PLATFORM_PRI="AMD64_LINUX" - VG_PLATFORM_SEC="X86_LINUX" + VGCONF_ARCH_PRI="amd64" + VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="X86_LINUX" fi valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; ppc32-linux) - VG_PLATFORM_PRI="PPC32_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="ppc32" + VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; ppc64-aix5) if test x$vg_cv_only64bit = xyes; then - VG_PLATFORM_PRI="PPC64_AIX5" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5" + VGCONF_PLATFORM_SEC_CAPS="" elif test x$vg_cv_only32bit = xyes; then - VG_PLATFORM_PRI="PPC32_AIX5" - VG_PLATFORM_SEC="" - VG_ARCH_PRI="ppc32" + VGCONF_ARCH_PRI="ppc32" + VGCONF_PLATFORM_PRI_CAPS="PPC32_AIX5" + VGCONF_PLATFORM_SEC_CAPS="" else - VG_PLATFORM_PRI="PPC64_AIX5" - VG_PLATFORM_SEC="PPC32_AIX5" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_AIX5" + VGCONF_PLATFORM_SEC_CAPS="PPC32_AIX5" fi valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" @@ -366,82 +387,90 @@ case "$VG_ARCH_MAX-$VG_OS" in ;; ppc64-linux) if test x$vg_cv_only64bit = xyes; then - VG_PLATFORM_PRI="PPC64_LINUX" - VG_PLATFORM_SEC="" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" elif test x$vg_cv_only32bit = xyes; then - VG_PLATFORM_PRI="PPC32_LINUX" - VG_PLATFORM_SEC="" - VG_ARCH_PRI="ppc32" + VGCONF_ARCH_PRI="ppc32" + VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX" + VGCONF_PLATFORM_SEC_CAPS="" + VGCONF_ARCH_PRI="ppc32" else - VG_PLATFORM_PRI="PPC64_LINUX" - VG_PLATFORM_SEC="PPC32_LINUX" + VGCONF_ARCH_PRI="ppc64" + VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX" + VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX" fi valt_load_address_normal="0x38000000" valt_load_address_inner="0x28000000" AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; *) - VG_PLATFORM_PRI="unknown" - VG_PLATFORM_SEC="unknown" + VGCONF_ARCH_PRI="unknown" + VGCONF_PLATFORM_PRI_CAPS="UNKNOWN" + VGCONF_PLATFORM_SEC_CAPS="UNKNOWN" AC_MSG_RESULT([no (${host_cpu}-${host_os})]) AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.]) ;; esac -# Set up VGA_. Either one or two of these become defined. -# -AM_CONDITIONAL(VGA_X86, - test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_SEC = xX86_LINUX ) -AM_CONDITIONAL(VGA_AMD64, - test x$VG_PLATFORM_PRI = xAMD64_LINUX ) -AM_CONDITIONAL(VGA_PPC32, - test x$VG_PLATFORM_PRI = xPPC32_LINUX \ - -o x$VG_PLATFORM_SEC = xPPC32_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_SEC = xPPC32_AIX5 ) -AM_CONDITIONAL(VGA_PPC64, - test x$VG_PLATFORM_PRI = xPPC64_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC64_AIX5 ) - -# Set up VGP_. Either one or two of these become defined. -# -AM_CONDITIONAL(VGP_X86_LINUX, - test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_SEC = xX86_LINUX) -AM_CONDITIONAL(VGP_AMD64_LINUX, - test x$VG_PLATFORM_PRI = xAMD64_LINUX) -AM_CONDITIONAL(VGP_PPC32_LINUX, - test x$VG_PLATFORM_PRI = xPPC32_LINUX \ - -o x$VG_PLATFORM_SEC = xPPC32_LINUX) -AM_CONDITIONAL(VGP_PPC64_LINUX, - test x$VG_PLATFORM_PRI = xPPC64_LINUX) -AM_CONDITIONAL(VGP_PPC32_AIX5, - test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_SEC = xPPC32_AIX5) -AM_CONDITIONAL(VGP_PPC64_AIX5, - test x$VG_PLATFORM_PRI = xPPC64_AIX5) - -# Similarly, set up VGO_. Exactly one of these becomes defined. +#---------------------------------------------------------------------------- + +# Set up VGCONF_ARCHS_INCLUDE_. Either one or two of these become +# defined. +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX ) +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, + test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX ) +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5 ) +AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ) + +# Set up VGCONF_PLATFORMS_INCLUDE_. Either one or two of these +# become defined. +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5) +AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5) + +# Similarly, set up VGCONF_OF_IS_. 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(VGO_LINUX, - test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_PRI = xAMD64_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC32_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC64_LINUX) -AM_CONDITIONAL(VGO_AIX5, - test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_PRI = xPPC64_AIX5) - - -# Sometimes, in the Makefile.am-s, it's useful to know -# whether or not there is a secondary target. -# -AM_CONDITIONAL(VGP_HAVE_SECONDARY, - test x$VG_PLATFORM_SEC != x) +AM_CONDITIONAL(VGCONF_OS_IS_LINUX, + test x$VGCONF_PLATFORM_PRI_CAPS = xX86_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) +AM_CONDITIONAL(VGCONF_OS_IS_AIX5, + test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5) + +# Sometimes, in the Makefile.am files, it's useful to know whether or not +# there is a secondary target. +AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC_CAPS, + test x$VGCONF_PLATFORM_SEC_CAPS != x) + + +#---------------------------------------------------------------------------- +# Inner Valgrind? +#---------------------------------------------------------------------------- # Check if this should be built as an inner Valgrind, to be run within # another Valgrind. Choose the load address accordingly. @@ -459,7 +488,12 @@ else fi - +#---------------------------------------------------------------------------- +# Libc and suppressions +#---------------------------------------------------------------------------- +# This variable will collect the suppression files to be used. +DEFAULT_SUPP="" +AC_SUBST(DEFAULT_SUPP) GLIBC_VERSION="" @@ -640,6 +674,10 @@ DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="exp-ptrcheck.supp ${DEFAULT_SUPP}" +#---------------------------------------------------------------------------- +# Checking for various library functions and other definitions +#---------------------------------------------------------------------------- + # Check for CLOCK_MONOTONIC AC_MSG_CHECKING([for CLOCK_MONOTONIC]) @@ -852,6 +890,10 @@ AC_MSG_RESULT([no]) ]) +#---------------------------------------------------------------------------- +# Checking for supported compiler flags. +#---------------------------------------------------------------------------- + # does this compiler support -m32 ? AC_MSG_CHECKING([if gcc accepts -m32]) @@ -1281,7 +1323,10 @@ AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables]) fi +#---------------------------------------------------------------------------- # Checks for C header files. +#---------------------------------------------------------------------------- + AC_HEADER_STDC AC_CHECK_HEADERS([ \ asm/unistd.h \ @@ -1299,14 +1344,18 @@ AC_CHECK_HEADERS([ \ sys/types.h \ ]) +#---------------------------------------------------------------------------- # Checks for typedefs, structures, and compiler characteristics. +#---------------------------------------------------------------------------- AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME +#---------------------------------------------------------------------------- # Checks for library functions. +#---------------------------------------------------------------------------- AC_FUNC_MEMCMP AC_FUNC_MMAP AC_TYPE_SIGNAL @@ -1354,6 +1403,10 @@ AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK], AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], [test x$ac_cv_func_pthread_spin_lock = xyes]) + +#---------------------------------------------------------------------------- +# MPI checks +#---------------------------------------------------------------------------- # Do we have a useable MPI setup on the primary and/or secondary targets? # On Linux, by default, assumes mpicc and -m32/-m64 # On AIX, by default, assumes mpxlc and -q32/-q64 @@ -1361,29 +1414,29 @@ AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK], # understands -m32/-m64/-q32/-q64 regardless of what is specified using # --with-mpicc=. MPI_CC="mpicc" -if test x$VG_PLATFORM_PRI = xPPC32_AIX5 \ - -o x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then +if test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ; then MPI_CC="mpxlc" fi mflag_primary= -if test x$VG_PLATFORM_PRI = xX86_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC32_LINUX ; then +if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX ; then mflag_primary=$FLAG_M32 -elif test x$VG_PLATFORM_PRI = xAMD64_LINUX \ - -o x$VG_PLATFORM_PRI = xPPC64_LINUX ; then +elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \ + -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX ; then mflag_primary=$FLAG_M64 -elif test x$VG_PLATFORM_PRI = xPPC32_AIX5 ; then +elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_AIX5 ; then mflag_primary=-q32 -elif test x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then +elif test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_AIX5 ; then mflag_primary=-q64 fi mflag_secondary= -if test x$VG_PLATFORM_SEC = xX86_LINUX \ - -o x$VG_PLATFORM_SEC = xPPC32_LINUX ; then +if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \ + -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then mflag_secondary=$FLAG_M32 -elif test x$VG_PLATFORM_SEC = xPPC32_AIX5 ; then +elif test x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_AIX5 ; then mflag_secondary=-q32 fi @@ -1427,7 +1480,7 @@ AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes) AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h]) saved_CC=$CC saved_CFLAGS=$CFLAGS -if test x$VG_PLATFORM_SEC = x ; then +if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then CC="$MPI_CC this will surely fail" else CC=$MPI_CC @@ -1452,6 +1505,9 @@ CFLAGS=$saved_CFLAGS AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes) +#---------------------------------------------------------------------------- +# Other library checks +#---------------------------------------------------------------------------- # There now follow some tests for QtCore, Boost, and OpenMP. These # tests are present because Drd has some regression tests that use # these packages. All regression test programs all compiled only @@ -1614,7 +1670,9 @@ CFLAGS=$safe_CFLAGS AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) -# -------------------- ok. We're done. -------------------- +#---------------------------------------------------------------------------- +# Ok. We're done checking. +#---------------------------------------------------------------------------- AC_OUTPUT( Makefile @@ -1683,11 +1741,11 @@ AC_OUTPUT( cat< #include +// This file determines which architectures that this Valgrind installation +// supports, which depends on the machine's architecture. It also depends +// on the configuration options; for example, if Valgrind is installed on +// an AMD64 machine but has been configured with --enable-only32bit then +// this program will not match "amd64". +// // We return: // - 0 if the machine matches the asked-for cpu // - 1 if it didn't match, but did match the name of another arch // - 2 otherwise -// When updating this file for a new architecture, add the name to +// Nb: When updating this file for a new architecture, add the name to // 'all_archs' as well as adding go(). #define False 0 @@ -23,16 +29,22 @@ char* all_archs[] = { NULL }; -#if !defined(_AIX) && defined(__powerpc__) && !defined(__powerpc64__) +//----------------------------------------------------------------------------- +// ppc32-linux +//--------------------------------------------------------------------------- +#if defined(VGP_ppc32_linux) static Bool go(char* cpu) { if ( strcmp( cpu, "ppc32" ) == 0 ) return True; return False; } -#endif // __powerpc__ (32) +#endif // VGP_ppc32_linux -#if !defined(_AIX) && defined(__powerpc__) && defined(__powerpc64__) +//--------------------------------------------------------------------------- +// ppc64-linux +//--------------------------------------------------------------------------- +#if defined(VGP_ppc64_linux) static Bool go(char* cpu) { if ( strcmp( cpu, "ppc64" ) == 0 ) @@ -41,9 +53,12 @@ static Bool go(char* cpu) return True; return False; } -#endif // __powerpc__ (64) +#endif // VGP_ppc64_linux -#if defined(_AIX) +//--------------------------------------------------------------------------- +// ppc{32,64}-aix +//--------------------------------------------------------------------------- +#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5) static Bool go(char* cpu) { if (sizeof(void*) == 8) { @@ -58,9 +73,12 @@ static Bool go(char* cpu) } return False; } -#endif // _AIX +#endif // VGP_ppc32_aix5 || VGP_ppc64_aix5 -#if !defined(_AIX) && (defined(__i386__) || defined(__x86_64__)) +//--------------------------------------------------------------------------- +// {x86,amd64}-linux (part 1 of 2) +//--------------------------------------------------------------------------- +#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) static void cpuid ( unsigned int n, unsigned int* a, unsigned int* b, unsigned int* c, unsigned int* d ) @@ -71,7 +89,12 @@ static void cpuid ( unsigned int n, : "0" (n) /* input */ ); } +#endif // VGP_x86_linux || VGP_amd64_linux +//--------------------------------------------------------------------------- +// {x86,amd64}-{linux} (part 2 of 2) +//--------------------------------------------------------------------------- +#if defined(VGP_x86_linux) || defined(VGP_amd64_linux) static Bool go(char* cpu) { unsigned int level = 0, cmask = 0, dmask = 0, a, b, c, d; @@ -102,7 +125,7 @@ static Bool go(char* cpu) } else if ( strcmp( cpu, "x86-ssse3" ) == 0 ) { level = 1; cmask = 1 << 9; -#if defined(__x86_64__) +#if defined(VGA_amd64) } else if ( strcmp( cpu, "amd64" ) == 0 ) { return True; } else if ( strcmp( cpu, "amd64-sse3" ) == 0 ) { @@ -129,9 +152,12 @@ static Bool go(char* cpu) } return False; } -#endif // !_AIX && (__i386__ || __x86_64__) +#endif // VGP_x86_linux || VGP_amd64_linux +//--------------------------------------------------------------------------- +// main +//--------------------------------------------------------------------------- int main(int argc, char **argv) { int i; diff --git a/valgrind.pc.in b/valgrind.pc.in index 6246b923d6..34a2407fb6 100644 --- a/valgrind.pc.in +++ b/valgrind.pc.in @@ -2,15 +2,15 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/valgrind -arch=@VG_ARCH_PRI@ -os=@VG_OS@ -platform=@VG_PLATFORM_PRI@ +arch=@VGCONF_ARCH_PRI@ +os=@VGCONF_OS@ +platform=@VGCONF_ARCH_PRI@-@VGCONF_OS@ valt_load_address=@VALT_LOAD_ADDRESS@ Name: Valgrind Description: A dynamic binary instrumentation framework Version: @VERSION@ Requires: -Libs: -L${libdir}/valgrind/@VG_PLATFORM_PRI@ -lcoregrind -lvex -lgcc +Libs: -L${libdir}/valgrind/@VGCONF_ARCH_PRI@-@VGCONF_OS@ -lcoregrind -lvex -lgcc Cflags: -I${includedir}