[llvm-commits] CVS: llvm/autoconf/configure.ac

Reid Spencer reid at x10sys.com
Fri Apr 22 00:27:40 PDT 2005



Changes in directory llvm/autoconf:

configure.ac updated: 1.171 -> 1.172
---
Log message:

First step in avoiding compilation/usage of non-relevant targets. New 
options have been added to the configure script that control which targets
will be used. The options are:

--enable-target-this (default=disabled)
  This will specify that the target corresponding to the build host is
  the target that will be compiled/used. You can't use this with any of 
  the other options (they'll be ignored). This is what most people want.

--disable-target-x86 (default=enabled)
  This will prevent the X86 target(s) from being compiled/used.

--disable-target-sparc (default=enabled)
  This will prevent both SparcV8 and SparcV9 from being compiled/used.

--disable-target-powerpc (default=enabled)
  This will prevent the PowerPC target from being compiled/used.

--disable-target-alpha (default=enabled)
  This will prevent the Alpha target from being compiled/used.

--disable-target-ia64 (default=enabled)
  This will prevent the IA64 target from being compiled/used.

Note that without any of these options, the default behavior is to build
all targets, as is the current practice.

All these options do is set up the substititution variable TARGETS_TO_BUILD
which contains the targets that should be compiled/used. The variable is
intended to be used in the makefiles. Those changes will come later.



---
Diffs of the changes:  (+50 -0)

 configure.ac |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+)


Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.171 llvm/autoconf/configure.ac:1.172
--- llvm/autoconf/configure.ac:1.171	Thu Mar 17 14:56:22 2005
+++ llvm/autoconf/configure.ac	Fri Apr 22 02:27:28 2005
@@ -218,6 +218,8 @@
     Sparc)   AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
     PowerPC) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
     x86_64)  AC_SUBST(JIT,[[]]) ;;
+    Alpha)   AC_SUBST(JIT,[[]]) ;;
+    IA64)    AC_SUBST(JIT,[[]]) ;;
     *)       AC_SUBST(JIT,[[]]) ;;
   esac
 fi
@@ -234,6 +236,53 @@
   *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;;
 esac
 
+dnl Allow specific targets to be specified for building (or not)
+TARGETS_TO_BUILD=""
+AC_ARG_ENABLE([target-this],AS_HELP_STRING([--enable-target-this],
+[Build only the current host's target (default is NO)]),,enable_target_this=no)
+AC_ARG_ENABLE([target-x86],AS_HELP_STRING([--enable-target-x86],
+[Build the x86 target (default is YES)]),,enable_target_x86=yes)
+AC_ARG_ENABLE([target-x86-64],AS_HELP_STRING([--enable-target-x86-64],
+[Build the x86_64 target (default is YES)]),,enable_target_x86_64=yes)
+AC_ARG_ENABLE([target-sparc],AS_HELP_STRING([--enable-target-sparc],
+[Build the Sparc target (default is YES)]),,enable_target_sparc=yes)
+AC_ARG_ENABLE([target-powerpc],AS_HELP_STRING([--enable-target-powerpc],
+[Build the PowerPC target (default is YES)]),,enable_target_powerpc=yes)
+AC_ARG_ENABLE([target-alpha],AS_HELP_STRING([--enable-target-alpha],
+[Build the Alpha target (default is YES)]),,enable_target_alpha=yes)
+AC_ARG_ENABLE(]target-ia64],AS_HELP_STRING([--enable-target-ia64],
+[Build the IA64 target (default is YES)]),,enable_target_ia64=yes)
+
+if test "$enable_target_this" = "yes" ; then
+  case "$llvm_cv_target_arch" in
+    x86)     TARGETS_TO_BUILD="X86" ;;
+    x86_64)  TARGETS_TO_BUILD="X86" ;;
+    Sparc)   TARGETS_TO_BUILD="SparcV8 SparcV9" ;;
+    PowerPC) TARGETS_TO_BUILD="PowerPC" ;;
+    Alpha)   TARGETS_TO_BUILD="Alpha" ;;
+    IA64)    TARGETS_TO_BUILD="IA64" ;;
+    *)       AC_MSG_ERROR([Can not set target to build]) ;;
+  esac
+else
+  if test "$enable_target_x86" = "yes" -o "$enable_target_x86_64" = "yes" ; then
+    TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD"
+  fi
+  if test "$enable_target_sparc" = "yes" ; then
+    TARGETS_TO_BUILD="SparcV8 SparcV9 $TARGETS_TO_BUILD"
+  fi
+  if test "$enable_target_powerpc" = "yes" ; then
+    TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD"
+  fi
+  if test "$enable_target_alpha" = "yes" ; then
+    TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD"
+  fi
+  if test "$enable_target_ia64" = "yes" ; then
+    TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD"
+  fi
+fi
+
+AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
+
 dnl Allow a specific llvm-gcc/llvm-g++ pair to be used with this LLVM config.
 AC_ARG_WITH(llvmgccdir,
   AS_HELP_STRING([--with-llvmgccdir],
@@ -245,6 +294,7 @@
   *) AC_MSG_ERROR([Invalid path for --with-llvmgccdir. Provide full path]) ;;
 esac
 
+
 dnl===-----------------------------------------------------------------------===
 dnl===
 dnl=== SECTION 4: Check for programs we need and that they are the right version






More information about the llvm-commits mailing list