Add Stacker directories.
[oota-llvm.git] / autoconf / configure.ac
index 6912ce142629c70de3ad03d7d476bd73b264a2c0..0f71633dec2dbac102acd3bee1c9ed899d6bacc0 100644 (file)
@@ -96,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)
@@ -146,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)
@@ -206,6 +222,7 @@ 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)
@@ -216,6 +233,14 @@ 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
@@ -228,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
+                ;;
+
+       *-*-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
                 ;;
 
-       *sparc*) AC_SUBST(OS,[SunOS])
-                AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
+       *-*-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
 
@@ -384,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
@@ -458,8 +493,8 @@ 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
@@ -496,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 **************************************************************************
@@ -586,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]))
 
@@ -603,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