[llvm-commits] [support] r40399 - in /support/trunk/autoconf: configure.ac m4/want_feature.m4
Reid Spencer
rspencer at reidspencer.com
Sun Jul 22 13:31:53 PDT 2007
Author: reid
Date: Sun Jul 22 15:31:53 2007
New Revision: 40399
URL: http://llvm.org/viewvc/llvm-project?rev=40399&view=rev
Log:
Implement an LLVM_WANT_LEVEL macro which is similar to WANT_FEATURE but
provides the option to specify a range of integer values instead of a strict
boolean. Use this for WANT_VERBOSE
Modified:
support/trunk/autoconf/configure.ac
support/trunk/autoconf/m4/want_feature.m4
Modified: support/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/support/trunk/autoconf/configure.ac?rev=40399&r1=40398&r2=40399&view=diff
==============================================================================
--- support/trunk/autoconf/configure.ac (original)
+++ support/trunk/autoconf/configure.ac Sun Jul 22 15:31:53 2007
@@ -231,8 +231,7 @@
LLVM_WANT_FEATURE(generate-pic,[Generate position independent code],no)
LLVM_WANT_FEATURE(stripped,[Strip symbols from libraries and executables],no)
LLVM_WANT_FEATURE(threads,[Use threads if available],yes)
-LLVM_WANT_FEATURE(tool-verbose,[Make the tools generate verbose output],no)
-LLVM_WANT_FEATURE(verbose,[Show each command executed while building],no)
+LLVM_WANT_LEVEL(verbose,[Show each command executed while building],0,0,3)
dnl Allow configuration of the llvm-top directory from which all llvm software
dnl can be found. Usually this corresponds to .., but weird things can happen
Modified: support/trunk/autoconf/m4/want_feature.m4
URL: http://llvm.org/viewvc/llvm-project/support/trunk/autoconf/m4/want_feature.m4?rev=40399&r1=40398&r2=40399&view=diff
==============================================================================
--- support/trunk/autoconf/m4/want_feature.m4 (original)
+++ support/trunk/autoconf/m4/want_feature.m4 Sun Jul 22 15:31:53 2007
@@ -22,3 +22,34 @@
AC_DEFINE_UNQUOTED($want_var,$enableval,[$2])
])
+dnl Make it easier to use the AC_ARG_ENABLE macro for certain numeric switches
+dnl that turn specify levels of support as integer values. The arguments are:
+dnl 1 - feature name
+dnl 2 - feature description
+dnl 3 - default value
+dnl 4 - min value (default 0)
+dnl 5 - max value (default 100)
+AC_DEFUN([LLVM_WANT_LEVEL],[
+ m4_define([allcapsname],translit($1,a-z-,A-Z_))
+ AC_ARG_ENABLE([$1],
+ AS_HELP_STRING([--enable-$1],[$2 ($3)]),,enableval="$3")
+ digits=`echo "$enableval" | sed 's/[^0-9]//'`
+ if test -z "$digits" ; then
+ AC_MSG_ERROR([Expected numeric value for --enable-$1.])
+ fi
+ min="$4"
+ max="$5"
+ if test -z "$min" ; then min="0" ; fi
+ if test -z "$max" ; then max="100" ; fi
+ if test "$enableval" -lt "$min" ; then
+ AC_MSG_ERROR(
+ [Value for --enable-$1 ($enableval) is less than minimum ($min)])
+ fi
+ if test "$enableval" -gt "$max" ; then
+ AC_MSG_ERROR(
+ [Value for --enable-$1 ($enableval) is greater than maximum ($max)])
+ fi
+ AC_SUBST([WANT_]allcapsname(),$enableval)
+ want_var=[WANT_]allcapsname()
+ AC_DEFINE_UNQUOTED($want_var,$enableval,[$2])
+])
More information about the llvm-commits
mailing list