No longer track value types for asm printer operands, and remove them as
[oota-llvm.git] / autoconf / configure.ac
index 153ddfe439d9bef3ee871b9f16a072da30fc2d12..981651c9fbf9eb3e10526434c958195c3c83a883 100644 (file)
@@ -31,12 +31,12 @@ dnl===
 dnl===-----------------------------------------------------------------------===
 dnl Initialize autoconf and define the package name, version number and
 dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[1.6cvs]],[llvmbugs@cs.uiuc.edu])
+AC_INIT([[llvm]],[[1.7cvs]],[llvmbugs@cs.uiuc.edu])
 
 dnl Provide a copyright substitution and ensure the copyright notice is included
 dnl in the output of --version option of the generated configure script.
 AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2005 University of Illinois at Urbana-Champaign."])
-AC_COPYRIGHT($LLVM_COPYRIGHT)
+AC_COPYRIGHT([Copyright (c) 2003-2005 University of Illinois at Urbana-Champaign.])
 
 dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we
 dnl use some autoconf macros only available in 2.59.
@@ -212,7 +212,7 @@ else
     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,[[]]) ;;
+    Alpha)   AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
     IA64)    AC_SUBST(JIT,[[]]) ;;
     *)       AC_SUBST(JIT,[[]]) ;;
   esac
@@ -230,6 +230,18 @@ case "$enableval" in
   *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;;
 esac
 
+dnl Allow disablement of threads
+AC_ARG_ENABLE(threads,
+              AS_HELP_STRING([--enable-threads],
+                             [Use threads if available (default is YES)]),,
+                             enableval=yes)
+case "$enableval" in
+  yes) AC_SUBST(ENABLE_THREADS,[1]) ;;
+  no)  AC_SUBST(ENABLE_THREADS,[0]) ;;
+  *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
+esac
+AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
+
 dnl Allow specific targets to be specified for building (or not)
 TARGETS_TO_BUILD=""
 AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-target],
@@ -311,7 +323,7 @@ if test "$GRAPHVIZ" != "echo Graphviz" ; then
    [Define to path to Graphviz program if found or 'echo Graphviz' otherwise])
 fi
 AC_PATH_PROG(GV, [gv], [echo gv])
-if test "$GRAPHVIZ" != "echo gv" ; then
+if test "$GV" != "echo gv" ; then
   AC_DEFINE([HAVE_GV],[1],[Define if the gv program is available])
   AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV",
    [Define to path to gv program if found or 'echo gv' otherwise])
@@ -404,7 +416,7 @@ fi
 dnl Verify that GCC is version 3.0 or higher
 if test "$GCC" = "yes"
 then
-  gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
+  gccmajor=`$CC --version | head -n 1 | sed 's/[[^0-9]]*\([[0-9.]]\).*/\1/'` 
   if test "$gccmajor" -lt "3"
   then
     AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
@@ -447,10 +459,12 @@ AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],
 
 dnl pthread locking functions are optional - but llvm will not be thread-safe
 dnl without locks.
-AC_CHECK_LIB(pthread,pthread_mutex_init)
-AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
-               AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
-                         [Have pthread_mutex_lock]))
+if test "$ENABLE_THREADS" -eq 1 ; then
+  AC_CHECK_LIB(pthread,pthread_mutex_init)
+  AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
+                 AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
+                           [Have pthread_mutex_lock]))
+fi
 
 dnl===-----------------------------------------------------------------------===
 dnl===
@@ -470,10 +484,13 @@ AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 
 AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
-AC_CHECK_HEADERS([malloc.h pthread.h signal.h stdint.h unistd.h utime.h])
-AC_CHECK_HEADERS([windows.h])
+AC_CHECK_HEADERS([malloc.h signal.h stdint.h unistd.h utime.h windows.h])
 AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h sys/types.h])
+AC_CHECK_HEADERS([malloc/malloc.h])
 AC_CHECK_HEADERS([rw/stdex/hash_map.h rw/stdex/hash_set.h])
+if test "$ENABLE_THREADS" -eq 1 ; then
+  AC_CHECK_HEADERS(pthread.h)
+fi
 
 dnl===-----------------------------------------------------------------------===
 dnl===
@@ -499,7 +516,7 @@ dnl===-----------------------------------------------------------------------===
 AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday ])
 AC_CHECK_FUNCS([isatty mkdtemp mkstemp mktemp ])
 AC_CHECK_FUNCS([realpath sbrk setrlimit strdup strerror strerror_r ])
-AC_CHECK_FUNCS([strtoll strtoq sysconf])
+AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
 AC_C_PRINTF_A
 AC_FUNC_ALLOCA
 AC_FUNC_RAND48
@@ -618,6 +635,10 @@ dnl===
 dnl===-----------------------------------------------------------------------===
 
 dnl Configure header files
+dnl WARNING: dnl If you add or remove any of the following config headers, then
+dnl you MUST also update Makefile.rules so that the variable FilesToConfig
+dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the
+dnl files can be updated automatically when their *.in sources change.
 AC_CONFIG_HEADERS([include/llvm/Config/config.h])
 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
 AC_CONFIG_HEADERS([include/llvm/ADT/hash_map])