Make sure that libm is used during config tests so that ceil, floor, and
[oota-llvm.git] / autoconf / configure.ac
index 0c184516e3dac33ebf3a4d8829e86c03008b5818..2573f7ee2d94ac09295fd6c8d2e3207fec0060aa 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.
@@ -75,6 +75,7 @@ do
       "llvm-java")    AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
       "llvm-tv")      AC_CONFIG_SUBDIRS([projects/llvm-tv])   ;;
       "llvm-poolalloc") AC_CONFIG_SUBDIRS([projects/llvm-poolalloc]) ;;
+      "llvm-kernel")  AC_CONFIG_SUBDIRS([projects/llvm-kernel]) ;;
       *)              
         AC_MSG_WARN([Unknown project (${i}) won't be configured automatically])
         ;;
@@ -198,6 +199,15 @@ else
   AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
 fi
 
+dnl --enable-debug-runtime : should runtime libraries have debug symbols?
+AC_ARG_ENABLE(debug-runtime,
+   AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no)
+if test ${enableval} = "no" ; then
+  AC_SUBST(DEBUG_RUNTIME,[[]])
+else
+  AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]])
+fi
+
 dnl --enable-jit: check whether they want to enable the jit
 AC_ARG_ENABLE(jit,
   AS_HELP_STRING(--enable-jit,
@@ -323,7 +333,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])
@@ -440,7 +450,7 @@ dnl===-----------------------------------------------------------------------===
 
 dnl libelf is for sparc only; we can ignore it if we don't have it
 AC_CHECK_LIB(elf, elf_begin)
-
+AC_CHECK_LIB(m,sin)
 
 dnl lt_dlopen may be required for plugin support.
 AC_SEARCH_LIBS(lt_dlopen,ltdl,AC_DEFINE([HAVE_LT_DLOPEN],[1],
@@ -486,6 +496,7 @@ AC_HEADER_TIME
 AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.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)
@@ -512,10 +523,10 @@ dnl=== SECTION 8: Check for specific functions needed
 dnl===
 dnl===-----------------------------------------------------------------------===
 
-AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday ])
-AC_CHECK_FUNCS([isatty mkdtemp mkstemp mktemp ])
+AC_CHECK_FUNCS([backtrace ceil ceilf floor floorf getcwd getpagesize getrusage])
+AC_CHECK_FUNCS([gettimeofday 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
@@ -634,6 +645,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])