]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add configure flags --enable-only64bit and --enable-only32bit with
authorJulian Seward <jseward@acm.org>
Sat, 28 Jan 2006 18:39:09 +0000 (18:39 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 28 Jan 2006 18:39:09 +0000 (18:39 +0000)
subvert the biarch build system, something that is sometimes
convenient to do.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5600

configure.in
docs/xml/manual-core.xml

index cf78a90d20b9c19e2d4b0eba8c6859c79642ad65..a9b466d5b6d42ad31acc199d666c8cc4653049a1 100644 (file)
@@ -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})])
        ;;
     *)
index 2db084a8a347546a02258dea851e5fc38ff01010..490e09e5f5c21e2932019d4551508fe5a084e392 100644 (file)
@@ -1569,7 +1569,7 @@ ensure that it works on machines with kernel 2.4 or 2.6 and glibc
 with <computeroutput>make regtest</computeroutput>.
 </para>
 
-<para>There are three options (in addition to the usual
+<para>There are five options (in addition to the usual
 <option>--prefix=</option> which affect how Valgrind is built:
 <itemizedlist>
 
@@ -1585,8 +1585,8 @@ with <computeroutput>make regtest</computeroutput>.
   <listitem>
     <para><option>--enable-tls</option></para>
     <para>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.</para>
   </listitem>
@@ -1598,6 +1598,20 @@ with <computeroutput>make regtest</computeroutput>.
      the root of the source tree.
    </para>
   </listitem>
+
+  <listitem>
+    <para><option>--enable-only64bit</option></para>
+    <para><option>--enable-only32bit</option></para>
+    <para>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).
+   </para>
+  </listitem>
+
 </itemizedlist>
 </para>