Add the RUNTEST autoconf onfiguration variable for Deja-gnu support. This
[oota-llvm.git] / autoconf / configure.ac
index 17ac33f83fbaa90b31f41cfe9919f00534965030..613c8a7feb4b02700475db3ab3c68dc53eff76be 100644 (file)
@@ -1,5 +1,5 @@
 dnl Initialize autoconf
-AC_INIT([[LLVM]],[[1.4]],[llvmbugs@cs.uiuc.edu])
+AC_INIT([[llvm]],[[1.4]],[llvmbugs@cs.uiuc.edu])
 
 dnl Place all of the extra autoconf files into the config subdirectory
 dnl Tell various tools where the m4 autoconf macros are
@@ -28,10 +28,13 @@ do
       "llvm-test")    AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
       "llvm-reopt")   AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
       "llvm-gcc")     AC_CONFIG_SUBDIRS([projects/llvm-gcc])  ;;
-      "llvm-java")    AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
+      "Java")         AC_CONFIG_SUBDIRS([projects/Java])      ;;
       "llvm-tv")      AC_CONFIG_SUBDIRS([projects/llvm-tv])   ;;
       "llvm-fefw")    AC_CONFIG_SUBDIRS([projects/llvm-fefw]) ;;
-      *)              AC_CONFIG_SUBDIRS(${i}) ;;
+      "poolalloc")    AC_CONFIG_SUBDIRS([projects/poolalloc]) ;;
+      *)              
+        AC_MSG_WARN([Unknown project (${i}) won't be configured automatically])
+        ;;
     esac
   fi
 done
@@ -40,12 +43,12 @@ dnl Configure header files
 AC_CONFIG_HEADERS(include/llvm/Config/config.h)
 
 dnl Configure other output file
-AC_CONFIG_FILES(Makefile.config
- include/llvm/Support/DataTypes.h
- include/llvm/Support/ThreadSupport.h
- include/llvm/ADT/hash_map
- include/llvm/ADT/hash_set
- include/llvm/ADT/iterator)
+AC_CONFIG_FILES(Makefile.config)
+AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
+AC_CONFIG_HEADERS([include/llvm/ADT/hash_map])
+AC_CONFIG_HEADERS([include/llvm/ADT/hash_set])
+AC_CONFIG_HEADERS([include/llvm/Support/ThreadSupport.h])
+AC_CONFIG_HEADERS([include/llvm/ADT/iterator])
 
 dnl Do special configuration of Makefiles
 AC_CONFIG_MAKEFILE(Makefile)
@@ -58,6 +61,7 @@ AC_CONFIG_MAKEFILE(test/Makefile.tests)
 AC_CONFIG_MAKEFILE(test/QMTest/llvm.py)
 AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py)
 AC_CONFIG_MAKEFILE(tools/Makefile)
+AC_CONFIG_MAKEFILE(tools/Makefile.JIT)
 AC_CONFIG_MAKEFILE(utils/Makefile)
 AC_CONFIG_MAKEFILE(projects/Makefile)
 
@@ -200,6 +204,7 @@ dnl Checks for other tools
 AC_PROG_FLEX
 AC_PROG_BISON
 AC_PROG_LIBTOOL
+AC_PATH_PROG(TAR,[tar],[gtar])
 
 dnl Checks for tools we can get away with not having:
 AC_PATH_PROG(DOT,[dot],[true dot])
@@ -213,15 +218,17 @@ case "$etags_version" in
 esac
 AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS)
 AC_PATH_PROG(PYTHON,[python],[true python])
-if test "$PYTHON" = "false"
-then
+if test "$PYTHON" = "false" ; then
        AC_MSG_WARN([Python is required for the test suite, but it was not found])
 fi
 AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
-if test "$QMTEST" = "false"
-then
+if test "$QMTEST" = "false" ; then
        AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
 fi
+AC_PATH_PROG(RUNTEST,[runtest],[true runtest])
+if test "$RUNTEST" = "false" ; then
+  AC_MSG_WARN([runtest (Deja-Gnu) is required for the test sute, but it was not found])
+fi
 
 dnl Verify that the version of python available is high enough for qmtest
 pyversion=`$PYTHON -V 2>&1 | cut -d\  -f2`
@@ -245,6 +252,23 @@ dnl Checks for libraries:
 dnl libelf is for sparc only; we can ignore it if we don't have it
 AC_CHECK_LIB(elf, elf_begin)
 
+dnl Check for bzip2 and zlib compression libraries needed for archive reading/writing
+AC_CHECK_LIB(bz2,BZ2_bzCompressInit,[bzip2_found=1],[bzip2_found=0])
+AC_CHECK_HEADERS([bzlib.h],[bzlib_h_found=1],[bzlib_h_found=0],[])
+AC_CHECK_LIB(z,gzopen,[zlib_found=1],[zlib_found=0])
+AC_CHECK_HEADERS([zlib.h],[zlib_h_found=1],[zlib_h_found=0],[])
+if test $zlib_found -eq 1 -a $zlib_h_found -eq 1; then
+  AC_DEFINE([HAVE_ZLIB],[1],[Define if zlib library is available on this platform.])
+  AC_SUBST([HAVE_ZLIB],[1])
+else
+  AC_SUBST([HAVE_ZLIB],[0])
+fi
+if test $bzip2_found -eq 1 -a $bzlib_h_found -eq 1 ; then
+  AC_DEFINE([HAVE_BZIP2],[1],[Define if bzip2 library is available on this platform.])
+  AC_SUBST([HAVE_BZIP2],[1])
+else
+  AC_SUBST([HAVE_BZIP2],[0])
+fi
 dnl dlopen() is required for plugin support.
 AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],[Define if dlopen() is available on this platform.]),AC_MSG_WARN([dlopen() not found - disabling plugin support]))
 
@@ -253,8 +277,8 @@ AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo
 
 dnl pthread locking functions are optional - but llvm will not be thread-safe
 dnl without locks.
-AC_SEARCH_LIBS(pthread_mutex_lock,pthread,HAVE_PTHREAD_MUTEX_LOCK=1,HAVE_PTHREAD_MUTEX_LOCK=0)
-AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK)
+AC_SEARCH_LIBS(pthread_mutex_lock,pthread,AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],[Have pthread_mutex_lock]))
+dnl AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK)
 
 dnl Checks for header files.
 dnl We don't check for ancient stuff or things that are guaranteed to be there
@@ -268,19 +292,9 @@ AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/re
 dnl Check for things that need to be included in public headers, and so
 dnl for which we may not have access to a HAVE_* preprocessor #define.
 dnl (primarily used in DataTypes.h)
-AC_CHECK_HEADER([sys/types.h],
-                [INCLUDE_SYS_TYPES_H='#include <sys/types.h>'],
-                [INCLUDE_SYS_TYPES_H=''])
-AC_SUBST(INCLUDE_SYS_TYPES_H)
-AC_CHECK_HEADER([inttypes.h],
-                [INCLUDE_INTTYPES_H='#include <inttypes.h>'],
-                [INCLUDE_INTTYPES_H=''])
-AC_SUBST(INCLUDE_INTTYPES_H)
-AC_CHECK_HEADER([stdint.h],
-                [INCLUDE_STDINT_H='#include <stdint.h>'],
-                [INCLUDE_STDINT_H=''])
-AC_SUBST(INCLUDE_STDINT_H)
-
+AC_CHECK_HEADER([sys/types.h])
+AC_CHECK_HEADER([inttypes.h])
+AC_CHECK_HEADER([stdint.h])
 
 dnl Check for types
 AC_TYPE_PID_T
@@ -307,6 +321,7 @@ AC_CXX_HAVE_FWD_ITERATOR
 
 AC_FUNC_ISNAN
 AC_FUNC_ISINF
+AC_FUNC_RAND48
 
 dnl Checks for library functions.
 AC_FUNC_ALLOCA
@@ -443,6 +458,15 @@ AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", [Time at which LLVM was
 dnl Create the output files
 AC_OUTPUT
 
+dnl Warn if we don't have a compression library
+if test $bzip2_found -ne 1 ; then
+  if test $zlib_found -ne 1 ; then
+    AC_MSG_WARN([*** Neither zlib nor bzip2 compression libraries were found.])
+    AC_MSG_WARN([*** Bytecode archives will not support compression!])
+    AC_MSG_WARN([*** To correct, install the libraries and and re-run configure.])
+  fi
+fi
+
 dnl Warn loudly if llvm-gcc was not obviously working
 if test $llvmgccwarn = yes
 then