[llvm-commits] CVS: llvm-test/autoconf/m4/external_benchmark.m4

Reid Spencer reid at x10sys.com
Thu Jan 18 14:12:58 PST 2007



Changes in directory llvm-test/autoconf/m4:

external_benchmark.m4 updated: 1.4 -> 1.5
---
Log message:

For PR919: http://llvm.org/PR919 :
1. Eliminate the --with options for individual external benchmarks. 
2. Implement directory checking for external benchmarks within the m4 macro,
   not in the mainline configure.ac.
3. Extend the EXTERNAL_BENCHMARK macro to accept a 3rd, optional, argument
   which specifies a file or directory that must exist in the benchmark's
   root directory in order for the check to succeed.
4. Specify that the CINT2000 directory must exist for SPEC CPU2000
5. Specify that the CPU2006 directory must exist for SPEC CPU2006


---
Diffs of the changes:  (+26 -30)

 external_benchmark.m4 |   56 +++++++++++++++++++++++---------------------------
 1 files changed, 26 insertions(+), 30 deletions(-)


Index: llvm-test/autoconf/m4/external_benchmark.m4
diff -u llvm-test/autoconf/m4/external_benchmark.m4:1.4 llvm-test/autoconf/m4/external_benchmark.m4:1.5
--- llvm-test/autoconf/m4/external_benchmark.m4:1.4	Tue Aug 15 01:53:55 2006
+++ llvm-test/autoconf/m4/external_benchmark.m4	Thu Jan 18 16:12:40 2007
@@ -3,42 +3,38 @@
 dnl arguments are:
 dnl   $1 short name of benchmark (e.g. spec95)
 dnl   $2 full path to benchmark source
-AC_DEFUN([EXTERNAL_BENCHMARK],
-[m4_define([allcapsname],translit($1,a-z,A-Z))
- AC_ARG_WITH($1,
- AS_HELP_STRING([--with-$1=DIR],[Use $1 as a benchmark (srcs in DIR)]),
- checkresult=$withval,
- checkresult=auto)
+dnl   $3 a file or directory name the benchmark must contain or
+dnl      blank to skip that check
+AC_DEFUN([EXTERNAL_BENCHMARK],[
+m4_define([allcapsname],translit($1,a-z,A-Z))
+m4_define([thepath],[$2])
+m4_define([checkdir],[$3])
 AC_MSG_CHECKING([for $1 benchmark sources])
-case "$checkresult" in
-auto|yes)
-  defaultdir=$2
-  if test -d "$defaultdir";  then
-    AC_SUBST(allcapsname()[_ROOT],[$defaultdir])
-    AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
-    checkresult="yes, found in $defaultdir"
+if test -d "thepath()" ; then
+  if test -n "checkdir()" ; then
+    if test -e "thepath()/checkdir()" ; then
+      AC_SUBST(allcapsname()[_ROOT],thepath())
+      AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
+      checkresult="yes, found in thepath()"  
+    else
+      checkresult="no"
+    fi
   else
-    checkresult=no
+    AC_SUBST(allcapsname()[_ROOT],thepath())
+    AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
+    checkresult="yes, found in thepath()"  
   fi
-  ;;
-no)
+else
+  checkresult="no"
+fi
+if test "$checkresult" = "no" ; then
   AC_SUBST(allcapsname()[_ROOT],[])
   AC_SUBST([USE_]allcapsname(),[])
-  checkresult=no
-  ;;
-*)
-  if test -d "$checkresult" ; then
-    AC_SUBST(allcapsname()[_ROOT],"$checkresult")
-    AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
-    checkresult="yes, in $checkresult"
-  else
-    AC_SUBST(allcapsname()[_ROOT],[])
-    AC_SUBST([USE_]allcapsname(),[])
-    checkresult="no, not found in $checkresult"
-  fi
-  ;;
-esac
+  checkresult="no, not found in thepath()"
+fi
 AC_MSG_RESULT($checkresult)
 m4_undefine([allcapsname])
+m4_undefine([thepath])
+m4_undefine([checkdir])
 ])
 






More information about the llvm-commits mailing list