Adding ocamldoc generation.
[oota-llvm.git] / autoconf / configure.ac
index fe16b5073e4d96a1d7c87bec7f5cf4232d4fe710..86459b8f710d9b936db81f11bc9a23e63acffea5 100644 (file)
@@ -1,8 +1,8 @@
 dnl === configure.ac --------------------------------------------------------===
 dnl                     The LLVM Compiler Infrastructure
 dnl
-dnl This file was developed by the LLVM research group and is distributed under
-dnl the University of Illinois Open Source License. See LICENSE.TXT for details.
+dnl This file is distributed under the University of Illinois Open Source
+dnl License. See LICENSE.TXT for details.
 dnl
 dnl===-----------------------------------------------------------------------===
 dnl This is the LLVM configuration script. It is processed by the autoconf
@@ -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]],[[2.2svn]],[llvmbugs@cs.uiuc.edu])
+AC_INIT([[llvm]],[[2.3svn]],[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-2007 University of Illinois at Urbana-Champaign."])
-AC_COPYRIGHT([Copyright (c) 2003-2007 University of Illinois at Urbana-Champaign.])
+AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign."])
+AC_COPYRIGHT([Copyright (c) 2003-2008 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.
@@ -119,7 +119,7 @@ AC_CACHE_CHECK([type of operating system we're going to host on],
     llvm_cv_platform_type="Unix" ;;
   *-*-darwin*)
     llvm_cv_link_all_option="-Wl,-all_load"
-    llvm_cv_link_all_option="-Wl,-noall_load"
+    llvm_cv_no_link_all_option="-Wl,-noall_load"
     llvm_cv_os_type="Darwin"
     llvm_cv_platform_type="Unix" ;;
   *-*-freebsd*)
@@ -227,10 +227,7 @@ dnl Define a substitution, ARCH, for the target architecture
 AC_SUBST(ARCH,$llvm_cv_target_arch)
 
 dnl Check for the endianness of the target
-AC_C_BIGENDIAN([AC_SUBST([ENDIAN],[big]),
-                AC_DEFINE([MSB_FIRST], [1], [Define if this target is big endian])],
-               [AC_SUBST([ENDIAN],[little]),
-                AC_DEFINE([LSB_FIRST], [1], [Define if this target is little endian])])
+AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
 
 dnl Check for build platform executable suffix if we're crosscompiling
 if test "$cross_compiling" = yes; then
@@ -366,7 +363,7 @@ AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets],
     [Build specific host targets: all,host-only,{target-name} (default=all)]),,
     enableval=all)
 case "$enableval" in
-  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU" ;;
+  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL" ;;
   host-only)
     case "$llvm_cv_target_arch" in
       x86)     TARGETS_TO_BUILD="X86" ;;
@@ -392,12 +389,13 @@ case "$enableval" in
         arm)     TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
         mips)    TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
         spu)     TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
+        cbe)     TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
+        msil)    TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
         *) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
       esac
   done
   ;;
 esac
-TARGETS_TO_BUILD="CBackend MSIL $TARGETS_TO_BUILD"
 AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
 
 dnl Prevent the CBackend from using printf("%a") for floating point so older
@@ -582,18 +580,19 @@ dnl Checks for documentation and testing tools that we can do without. If these
 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(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"])
-AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"])
-AC_PATH_PROG(GZIP,[gzip],[echo "Skipped: gzip not found"])
-AC_PATH_PROG(POD2HTML,[pod2html],[echo "Skipped: pod2html not found"])
-AC_PATH_PROG(POD2MAN,[pod2man],[echo "Skipped: pod2man not found"])
-AC_PATH_PROG(RUNTEST,[runtest],[echo "Skipped: runtest not found"])
+AC_PATH_PROG(BZIP2, [bzip2])
+AC_PATH_PROG(DOXYGEN, [doxygen])
+AC_PATH_PROG(GROFF, [groff])
+AC_PATH_PROG(GZIP, [gzip])
+AC_PATH_PROG(POD2HTML, [pod2html])
+AC_PATH_PROG(POD2MAN, [pod2man])
+AC_PATH_PROG(RUNTEST, [runtest])
 DJ_AC_PATH_TCLSH
-AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
-AC_PATH_PROG(OCAMLC,[ocamlc],[echo "Skipped: ocamlc not found"])
-AC_PATH_PROG(OCAMLOPT,[ocamlopt],[echo "Skipped: ocamlopt not found"])
-AC_PATH_PROG(OCAMLDEP,[ocamldep],[echo "Skipped: ocamldep not found"])
+AC_PATH_PROG(ZIP, [zip])
+AC_PATH_PROGS(OCAMLC, [ocamlc.opt ocamlc])
+AC_PATH_PROGS(OCAMLOPT, [ocamlopt.opt ocamlopt])
+AC_PATH_PROGS(OCAMLDEP, [ocamldep.opt ocamldep])
+AC_PATH_PROGS(OCAMLDOC, [ocamldoc.opt ocamldoc])
 
 dnl Determine if the linker supports the -R option.
 AC_LINK_USE_R
@@ -658,11 +657,10 @@ fi
 dnl Verify that GCC is version 3.0 or higher
 if test "$GCC" = "yes"
 then
-  gccmajor=`$CC --version | head -n 1 | sed 's/[[^0-9]]*\([[0-9.]]\).*/\1/'`
-  if test "$gccmajor" -lt "3"
-  then
-    AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
-  fi
+  AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3
+#error Unsupported GCC version
+#endif
+]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])])
 fi
 
 dnl Check for GNU Make.  We use its extensions, so don't build without it
@@ -688,12 +686,6 @@ if test "$llvm_cv_os_type" = "MingW" ; then
   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],
-              [Define if lt_dlopen() is available on this platform]),
-              AC_MSG_WARN([lt_dlopen() not found - plugin support might
-                           not be available]))
-
 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.]),