Add Stacker directories.
[oota-llvm.git] / autoconf / configure.ac
index c57d62dda44b4f8c00f8211a2caa5f1c7e67ba56..0f71633dec2dbac102acd3bee1c9ed899d6bacc0 100644 (file)
@@ -30,6 +30,11 @@ then
        fi
 fi
 
+if test -d ${srcdir}/projects/sample
+then
+  AC_CONFIG_SUBDIRS(projects/sample)
+fi
+
 if test -d ${srcdir}/projects/reopt
 then
   AC_CONFIG_SUBDIRS(projects/reopt)
@@ -91,6 +96,7 @@ AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libutempter/Makefile)
 AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libutil/Makefile)
 AC_CONFIG_MAKEFILE(runtime/libdummy/Makefile)
 AC_CONFIG_MAKEFILE(runtime/libtrace/Makefile)
+AC_CONFIG_MAKEFILE(runtime/libprofile/Makefile)
 AC_CONFIG_MAKEFILE(test/Makefile)
 AC_CONFIG_MAKEFILE(test/Makefile.tests)
 AC_CONFIG_MAKEFILE(test/QMTest/llvm.py)
@@ -115,6 +121,7 @@ AC_CONFIG_MAKEFILE(test/Programs/External/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/177.mesa/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/179.art/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/183.equake/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/188.ammp/Makefile)
@@ -125,6 +132,8 @@ AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/176.gcc/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/181.mcf/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/186.crafty/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/197.parser/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/252.eon/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/254.gap/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/255.vortex/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/256.bzip2/Makefile)
@@ -138,6 +147,21 @@ AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Applications/aha/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Applications/sgefa/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Fhourstones/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile)
+AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/01-qbsort/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/03-testtrie/Makefile)
@@ -169,12 +193,6 @@ AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/ks/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/yacr2/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/llubenchmark/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/sim/Makefile)
-AC_CONFIG_MAKEFILE(test/Programs/NoSource/Makefile)
-AC_CONFIG_MAKEFILE(test/Programs/NoSource/Flex/Makefile)
-AC_CONFIG_MAKEFILE(test/Programs/NoSource/Larn/Makefile)
-AC_CONFIG_MAKEFILE(test/Programs/NoSource/Moria-5.5.2/Makefile)
-AC_CONFIG_MAKEFILE(test/Programs/NoSource/Povray31/Makefile)
-AC_CONFIG_MAKEFILE(test/Programs/NoSource/m4/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
 AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
 AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Gizmos/Makefile)
@@ -203,24 +221,26 @@ AC_CONFIG_MAKEFILE(tools/llvm-ar/Makefile)
 AC_CONFIG_MAKEFILE(tools/llvm-as/Makefile)
 AC_CONFIG_MAKEFILE(tools/llvm-dis/Makefile)
 AC_CONFIG_MAKEFILE(tools/llvm-link/Makefile)
+AC_CONFIG_MAKEFILE(tools/llvm-nm/Makefile)
+AC_CONFIG_MAKEFILE(tools/llvm-prof/Makefile)
 AC_CONFIG_MAKEFILE(tools/opt/Makefile)
 AC_CONFIG_MAKEFILE(utils/Makefile)
 AC_CONFIG_MAKEFILE(utils/Burg/Makefile)
 AC_CONFIG_MAKEFILE(utils/Burg/Doc/Makefile)
 AC_CONFIG_MAKEFILE(utils/TableGen/Makefile)
-AC_CONFIG_MAKEFILE(www/docs/Makefile)
 AC_CONFIG_MAKEFILE(projects/Makefile)
-AC_CONFIG_MAKEFILE(projects/sample/Makefile)
-AC_CONFIG_MAKEFILE(projects/sample/Makefile.common)
-AC_CONFIG_MAKEFILE(projects/sample/Makefile.config)
-AC_CONFIG_MAKEFILE(projects/sample/lib/Makefile)
-AC_CONFIG_MAKEFILE(projects/sample/lib/sample/Makefile)
-AC_CONFIG_MAKEFILE(projects/sample/tools/Makefile)
-AC_CONFIG_MAKEFILE(projects/sample/tools/sample/Makefile)
 AC_CONFIG_MAKEFILE(projects/ModuleMaker/Makefile)
 AC_CONFIG_MAKEFILE(projects/ModuleMaker/Makefile.common)
 AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/Makefile)
 AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/ModuleMaker/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/lib/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/lib/compiler/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/lib/runtime/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/tools/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/tools/stkrc/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/test/Makefile)
+AC_CONFIG_MAKEFILE(projects/Stacker/samples/Makefile)
 
 dnl **************************************************************************
 dnl * Determine which system we are building on
@@ -233,42 +253,52 @@ dnl Check which host for which we're compiling.  This will tell us which LLVM
 dnl compiler will be used for compiling SSA into object code.
 AC_CANONICAL_TARGET
 
-dnl
-dnl Now, for some of our own magic:
+dnl Set the "OS" Makefile variable based on the system we are building on.
 dnl We will use the build machine information to set some variables.
-dnl
 case $build in
-       *i*86*)  AC_SUBST(OS,[Linux])
-                AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
+       *-*-linux*)
+             AC_SUBST(OS,[Linux])
+                        if test -d /home/vadve/lattner/local/x86/llvm-gcc
+                        then
+                          AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
+                        fi
                 ;;
 
-       *sparc*) AC_SUBST(OS,[SunOS])
-                AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
+       *-*-solaris*)
+             AC_SUBST(OS,[SunOS])
+                        if test -d /home/vadve/lattner/local/sparc/llvm-gcc
+                        then
+                  AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
+                        fi
+                ;;
+
+       *-*-darwin*)
+             AC_SUBST(OS,[Darwin])
                 ;;
 
        *)       AC_SUBST(OS,[Unknown])
                 ;;
 esac
 
-dnl
 dnl If we are targetting a Sparc machine running Solaris, pretend that it is
 dnl V9, since that is all that we support at the moment, and autoconf will only
 dnl tell us we're a sparc.
-dnl
 case $target in
-       *sparc*solaris*)  AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
-                         ;;
+       sparc*-*-solaris*)  AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
+                           ;;
 esac
 
-dnl
 dnl Determine what our target architecture is and configure accordingly.
 dnl This will allow Makefiles to make a distinction between the hardware and
 dnl the OS.
-dnl
 case $target in
-       *i*86*)           AC_SUBST(ARCH,[x86])
+       i*86-*)           AC_SUBST(ARCH,[x86])
+                         ;;
+       sparc*-*)         AC_SUBST(ARCH,[Sparc])
                          ;;
-       *sparc*solaris*)  AC_SUBST(ARCH,[Sparc])
+       powerpc*-*)       AC_SUBST(ARCH,[PowerPC])
+                         ;;
+       *)                AC_SUBST(ARCH,[Unknown])
                          ;;
 esac
 
@@ -389,11 +419,11 @@ then
        then
                if test "$pyminor" -lt "2"
                then
-                       AC_MSG_ERROR([Python 2.2 or greater required])
+                       AC_MSG_WARN([Python 2.2 or greater required for qmtest])
                fi
        fi
 else
-       AC_MSG_ERROR([Python 2.2 or greater required])
+       AC_MSG_WARN([Python 2.2 or greater required for qmtest])
 fi
 
 dnl Verify that the source directory is valid
@@ -435,7 +465,7 @@ dnl Check for ANSI C/POSIX header files
 AC_CHECK_HEADERS(assert.h fcntl.h limits.h sys/time.h unistd.h errno.h signal.h math.h)
 
 dnl Check for system specific header files
-AC_CHECK_HEADERS(malloc.h strings.h sys/mman.h sys/resource.h)
+AC_CHECK_HEADERS(malloc.h sys/mman.h sys/resource.h)
 
 dnl Check for header files associated with dlopen and friends
 AC_CHECK_HEADERS(dlfcn.h link.h)
@@ -459,9 +489,12 @@ AC_CHECK_TYPES([uint64_t],,AC_MSG_ERROR([Type uint64_t required but not found]))
 AC_HEADER_TIME
 AC_STRUCT_TM
 
+dnl Check for various C features
+AC_C_PRINTF_A
+
 dnl Check for C++ extensions
-AC_CXX_HAVE_EXT_HASH_MAP
-AC_CXX_HAVE_EXT_HASH_SET
+AC_CXX_HAVE_HASH_MAP
+AC_CXX_HAVE_HASH_SET
 AC_CXX_HAVE_EXT_SLIST
 AC_CXX_HAVE_STD_ITERATOR
 AC_CXX_HAVE_BI_ITERATOR
@@ -481,11 +514,7 @@ then
 fi
 AC_HEADER_MMAP_ANONYMOUS
 AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd gettimeofday strcspn strdup strerror strspn strstr strtod strtol strtoq strtoll strsignal)
-AC_CHECK_DECLS([sys_siglist],[],[],[
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif])
+AC_CHECK_FUNCS(getcwd gettimeofday strcspn strdup strerror strspn strstr strtod strtol strtoq strtoll)
 
 dnl
 dnl Need to check mmap for MAP_PRIVATE, MAP_ANONYMOUS, MAP_ANON, MAP_FIXED
@@ -502,6 +531,9 @@ dnl these checks should go away.
 AC_CHECK_FUNC(mmap,,AC_MSG_ERROR([Function mmap() required but not found]))
 AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
 
+dnl Determine if the linker supports the -R option.
+AC_LINK_USE_R()
+
 dnl **************************************************************************
 dnl * Enable various compile-time options
 dnl **************************************************************************
@@ -592,6 +624,40 @@ dnl **************************************************************************
 dnl Location of the LLVM C front end
 AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval]))
 
+AC_MSG_CHECKING([for llvm-gcc])
+LLVM_GCC_CHECK=no
+if test -d "$LLVMGCCDIR"
+then
+       if test -x "$LLVMGCCDIR/bin/gcc"
+       then
+               LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
+       fi
+fi
+llvmgccwarn=no
+AC_MSG_RESULT($LLVM_GCC_CHECK)
+if test "$LLVM_GCC_CHECK" = "no"
+then
+    llvmgccwarn=yes
+fi
+
+AC_MSG_CHECKING([whether llvm-gcc is sane])
+LLVM_GCC_SANE=no
+if test -x "$LLVM_GCC_CHECK"
+then
+       cp /dev/null conftest.c
+    "$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
+       if test $? -eq 0
+       then
+               LLVM_GCC_SANE=yes
+       fi
+       rm conftest.c
+fi
+AC_MSG_RESULT($LLVM_GCC_SANE)
+if test "$LLVM_GCC_SANE" = "no"
+then
+       llvmgccwarn=yes
+fi
+
 dnl Location of the bytecode repository
 AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Repository]),AC_SUBST(BCR,[$withval]),AC_SUBST(BCR,[/home/vadve/lattner/LLVMPrograms]))
 
@@ -609,3 +675,13 @@ dnl **************************************************************************
 dnl * Create the output files
 dnl **************************************************************************
 AC_OUTPUT(Makefile.config)
+
+if test $llvmgccwarn = yes
+then
+       AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
+       AC_MSG_WARN([***** appear to be working.])
+       AC_MSG_WARN([***** ])
+       AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
+       AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
+       AC_MSG_WARN([***** but you should be able to build the llvm tools.])
+fi