From: Julian Seward Date: Sat, 28 Jan 2006 18:39:09 +0000 (+0000) Subject: Add configure flags --enable-only64bit and --enable-only32bit with X-Git-Tag: svn/VALGRIND_3_2_0~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8d296348a5d224c8a765c6259b0d42e93c5868b;p=thirdparty%2Fvalgrind.git Add configure flags --enable-only64bit and --enable-only32bit with subvert the biarch build system, something that is sometimes convenient to do. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5600 --- diff --git a/configure.in b/configure.in index cf78a90d20..a9b466d5b6 100644 --- a/configure.in +++ b/configure.in @@ -159,10 +159,11 @@ esac # Check if this should be built as an inner Valgrind, to be run within # another Valgrind. Choose the load address accordingly. -AC_CACHE_CHECK([enable use as an inner Valgrind], vg_cv_inner, - [AC_ARG_ENABLE(inner, [ --enable-inner enables self-hosting], - [vg_cv_inner=$enableval], - [vg_cv_inner=no])]) +AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner, + [AC_ARG_ENABLE(inner, + [ --enable-inner enables self-hosting], + [vg_cv_inner=$enableval], + [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 @@ -170,6 +171,33 @@ else VALT_LOAD_ADDRESS=$valt_load_address_normal fi +# 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 :-) + +# Check if a 64-bit only build has been requested +AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit, + [AC_ARG_ENABLE(only64bit, + [ --enable-only64bit do a 64-bit only build], + [vg_cv_only64bit=$enableval], + [vg_cv_only64bit=no])]) + +# Check if a 32-bit only build has been requested +AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit, + [AC_ARG_ENABLE(only32bit, + [ --enable-only32bit do a 32-bit only build], + [vg_cv_only32bit=$enableval], + [vg_cv_only32bit=no])]) + +# Stay sane +if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then + AC_MSG_ERROR( + [Nonsensical: both --enable-only64bit and --enable-only32bit.]) +fi + + + AC_MSG_CHECKING([for a supported OS]) AC_SUBST(VG_OS) @@ -234,8 +262,16 @@ case "$VG_ARCH-$VG_OS" in AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; amd64-linux) - VG_PLATFORM_PRI="AMD64_LINUX" - VG_PLATFORM_SEC="X86_LINUX" + if test x$vg_cv_only64bit = xyes; then + VG_PLATFORM_PRI="AMD64_LINUX" + VG_PLATFORM_SEC="" + elif test x$vg_cv_only32bit = xyes; then + VG_PLATFORM_PRI="X86_LINUX" + VG_PLATFORM_SEC="" + else + VG_PLATFORM_PRI="AMD64_LINUX" + VG_PLATFORM_SEC="X86_LINUX" + fi AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; ppc32-linux) @@ -244,8 +280,16 @@ case "$VG_ARCH-$VG_OS" in AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; ppc64-linux) - VG_PLATFORM_PRI="PPC64_LINUX" - VG_PLATFORM_SEC="PPC32_LINUX" + if test x$vg_cv_only64bit = xyes; then + VG_PLATFORM_PRI="PPC64_LINUX" + VG_PLATFORM_SEC="" + elif test x$vg_cv_only32bit = xyes; then + VG_PLATFORM_PRI="PPC32_LINUX" + VG_PLATFORM_SEC="" + else + VG_PLATFORM_PRI="PPC64_LINUX" + VG_PLATFORM_SEC="PPC32_LINUX" + fi AC_MSG_RESULT([ok (${host_cpu}-${host_os})]) ;; *) diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml index 2db084a8a3..490e09e5f5 100644 --- a/docs/xml/manual-core.xml +++ b/docs/xml/manual-core.xml @@ -1569,7 +1569,7 @@ ensure that it works on machines with kernel 2.4 or 2.6 and glibc with make regtest. -There are three options (in addition to the usual +There are five options (in addition to the usual which affect how Valgrind is built: @@ -1585,8 +1585,8 @@ with make regtest. TLS (Thread Local Storage) is a relatively new mechanism which - requires compiler, linker and kernel support. Valgrind - automatically test if TLS is supported and enable this option. + requires compiler, linker and kernel support. Valgrind tries to + automatically test if TLS is supported and if so enables this option. Sometimes it cannot test for TLS, so this option allows you to override the automatic test. @@ -1598,6 +1598,20 @@ with make regtest. the root of the source tree. + + + + + On 64-bit + platforms (amd64-linux, ppc64-linux), Valgrind is by default built + in such a way that both 32-bit and 64-bit executables can be run. + Sometimes this cleverness is a problem for a variety of reasons. + These two flags allow for single-target builds in this situation. + If you issue both, the configure script will complain. Note they + are ignored on 32-bit-only platforms (x86-linux, ppc32-linux). + + +