Added LLVM publications describing the LLVM compiler infrastructure.
[oota-llvm.git] / autoconf / configure.ac
index b29ce31f964db366a5b98d2adca6d6f2fc01392a..35b6988f852c90a0299aad38dac7202197e51d14 100644 (file)
@@ -69,6 +69,7 @@ do
       "CVS") ;;
       "sample")       AC_CONFIG_SUBDIRS([projects/sample])    ;;
       "Stacker")      AC_CONFIG_SUBDIRS([projects/Stacker])   ;;
+      "privbracket")  AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
       "llvm-test")    AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
       "llvm-reopt")   AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
       "llvm-gcc")     AC_CONFIG_SUBDIRS([projects/llvm-gcc])  ;;
@@ -320,7 +321,7 @@ AC_ARG_WITH(llvmgccdir,
     withval=default)
 case "$withval" in
   default) WITH_LLVMGCCDIR=default ;;
-  /*)      WITH_LLVMGCCDIR=$withval ;;
+  /* | [[A-Za-z]]:[[\\/]]*)      WITH_LLVMGCCDIR=$withval ;;
   *) AC_MSG_ERROR([Invalid path for --with-llvmgccdir. Provide full path]) ;;
 esac
 
@@ -352,18 +353,48 @@ AC_PROG_RANLIB
 AC_PATH_PROG(RM,   [rm],   [rm])
 AC_PATH_PROG(SED,  [sed],  [sed])
 AC_PATH_PROG(TAR,  [tar],  [gtar])
+
+dnl Looking for misc. graph plotting software
 AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz])
 if test "$GRAPHVIZ" != "echo Graphviz" ; then
   AC_DEFINE([HAVE_GRAPHVIZ],[1],[Define if the Graphviz program is available])
-  AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ",
+  dnl If we're targeting for mingw we should emit windows paths, not msys
+  if test "$llvm_cv_os_type" == "MingW" ; then
+    GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+  fi
+  AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ${EXEEXT}",
    [Define to path to Graphviz program if found or 'echo Graphviz' otherwise])
 fi
-AC_PATH_PROG(GV, [gv], [echo gv])
+AC_PATH_PROG(DOT, [dot], [echo dot])
+if test "$DOT" != "echo dot" ; then
+  AC_DEFINE([HAVE_DOT],[1],[Define if the dot program is available])
+  dnl If we're targeting for mingw we should emit windows paths, not msys
+  if test "$llvm_cv_os_type" == "MingW" ; then
+    DOT=`echo $DOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+  fi
+  AC_DEFINE_UNQUOTED([LLVM_PATH_DOT],"$DOT${EXEEXT}",
+   [Define to path to dot program if found or 'echo dot' otherwise])
+fi
+AC_PATH_PROGS(GV, [gv gsview32], [echo gv])
 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",
+  dnl If we're targeting for mingw we should emit windows paths, not msys
+  if test "$llvm_cv_os_type" == "MingW" ; then
+    GV=`echo $GV | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+  fi
+  AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV${EXEEXT}",
    [Define to path to gv program if found or 'echo gv' otherwise])
 fi
+AC_PATH_PROG(DOTTY, [dotty], [echo dotty])
+if test "$DOTTY" != "echo dotty" ; then
+  AC_DEFINE([HAVE_DOTTY],[1],[Define if the dotty program is available])
+  dnl If we're targeting for mingw we should emit windows paths, not msys
+  if test "$llvm_cv_os_type" == "MingW" ; then
+    DOTTY=`echo $DOTTY | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' `
+  fi
+  AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY${EXEEXT}",
+   [Define to path to dotty program if found or 'echo dotty' otherwise])
+fi
 
 dnl Look for a sufficiently recent version of Perl.
 LLVM_PROG_PERL([5.006])
@@ -382,7 +413,6 @@ dnl are not found then they are set to "true" which always succeeds but does
 dnl nothing. This just lets the build output show that we could have done 
 dnl something if the tool was available. 
 AC_PATH_PROG(BZIP2,[bzip2],[echo "Skipped: bzip2 not found"])
-AC_PATH_PROG(DOT,[dot],[echo "Skipped: dot not found"])
 AC_PATH_PROG(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"])
 AC_PATH_PROG(ETAGS,[etags],[echo "Skipped: etags not found"])
 AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"])
@@ -486,6 +516,10 @@ 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)
+if test "$llvm_cv_os_type" == "MingW" ; then
+  AC_CHECK_LIB(imagehlp, main)
+  AC_CHECK_LIB(psapi, main)
+fi
 
 dnl lt_dlopen may be required for plugin support.
 AC_SEARCH_LIBS(lt_dlopen,ltdl,AC_DEFINE([HAVE_LT_DLOPEN],[1],
@@ -529,9 +563,9 @@ 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 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([malloc.h setjmp.h signal.h stdint.h unistd.h utime.h])
+AC_CHECK_HEADERS([windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h])
+AC_CHECK_HEADERS([sys/types.h malloc/malloc.h])
 if test "$ENABLE_THREADS" -eq 1 ; then
   AC_CHECK_HEADERS(pthread.h)
 fi
@@ -561,6 +595,7 @@ AC_CHECK_FUNCS([backtrace ceilf floorf roundf rintf nearbyintf getcwd ])
 AC_CHECK_FUNCS([getpagesize getrusage gettimeofday isatty mkdtemp mkstemp ])
 AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup strerror strerror_r ])
 AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
+AC_CHECK_FUNCS([_setjmp _longjmp setjmp longjmp sigsetjmp siglongjmp])
 AC_C_PRINTF_A
 AC_FUNC_ALLOCA
 AC_FUNC_RAND48
@@ -632,6 +667,9 @@ AC_SUBST(SHLIBEXT,$libltdl_cv_shlibext)
 # Translate the various configuration directories and other basic
 # information into substitutions that will end up in Makefile.config.in 
 # that these configured values can be used by the makefiles
+if test "${prefix}" == "NONE" ; then
+  prefix="/usr/local"
+fi
 eval LLVM_PREFIX="${prefix}";
 eval LLVM_BINDIR="${prefix}/bin";
 eval LLVM_LIBDIR="${prefix}/lib";