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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index cf78a90..a9b466d 100644
--- a/configure.in
+++ b/configure.in
@@ -159,10 +159,11 @@
# 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 @@
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 @@
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 @@
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})])
;;
*)