dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[1.7cvs]],[llvmbugs@cs.uiuc.edu])
+AC_INIT([[llvm]],[[1.8cvs]],[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.
dnl Check for the endianness of the target
AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
+dnl Check to see if there's a "CVS" directory indicating that this build is
+dnl being done from a CVS checkout. This sets up several defaults for the
+dnl command line switches. When we build with a CVS directory, we get a
+dnl debug with assertions turned on. Without, we assume a source release and we
+dnl get an optimized build without assertions. See --enable-optimized and
+dnl --enable-assertions below
+if test -d "CVS" -o -d "${srcdir}/CVS"; then
+ cvsbuild="yes"
+ optimize="no"
+ AC_SUBST(CVSBUILD,[[CVSBUILD=1]])
+else
+ cvsbuild="no"
+ optimize="yes"
+fi
+
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 3: Command line arguments for the configure script.
dnl===-----------------------------------------------------------------------===
dnl --enable-optimized : check whether they want to do an optimized build:
-AC_ARG_ENABLE(optimized,
- AS_HELP_STRING([--enable-optimized,Compile with optimizations enabled (default is NO)]),,enableval=no)
+AC_ARG_ENABLE(optimized, AS_HELP_STRING(
+ [--enable-optimized,Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
if test ${enableval} = "no" ; then
AC_SUBST(ENABLE_OPTIMIZED,[[]])
else
AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
fi
+dnl --enable-assertions : check whether they want to turn on assertions or not:
+AC_ARG_ENABLE(assertions,AS_HELP_STRING(
+ [--enable-assertions,Compile with assertion checks enabled (default is YES)]),, enableval="yes")
+if test ${enableval} = "yes" ; then
+ AC_SUBST(DISABLE_ASSERTIONS,[[]])
+else
+ AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
+fi
+
dnl --enable-debug-runtime : should runtime libraries have debug symbols?
AC_ARG_ENABLE(debug-runtime,
AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no)
AC_SUBST(JIT,[[]])
else
case "$llvm_cv_target_arch" in
- x86) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
- Sparc) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
- PowerPC) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
- x86_64) AC_SUBST(JIT,[[]]) ;;
- Alpha) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;;
- IA64) AC_SUBST(JIT,[[]]) ;;
- *) AC_SUBST(JIT,[[]]) ;;
+ x86) AC_SUBST(TARGET_HAS_JIT,1) ;;
+ Sparc) AC_SUBST(TARGET_HAS_JIT,1) ;;
+ PowerPC) AC_SUBST(TARGET_HAS_JIT,1) ;;
+ x86_64) AC_SUBST(TARGET_HAS_JIT,0) ;;
+ Alpha) AC_SUBST(TARGET_HAS_JIT,1) ;;
+ IA64) AC_SUBST(TARGET_HAS_JIT,0) ;;
+ *) AC_SUBST(TARGET_HAS_JIT,0) ;;
esac
fi
[Build specific host targets: all,host-only,{target-name} (default=all)]),,
enableval=all)
case "$enableval" in
- all) TARGETS_TO_BUILD="X86 Sparc SparcV9 PowerPC Alpha IA64 Skeleton" ;;
+ all) TARGETS_TO_BUILD="X86 Sparc SparcV9 PowerPC Alpha IA64" ;;
host-only)
case "$llvm_cv_target_arch" in
x86) TARGETS_TO_BUILD="X86" ;;
powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
ia64) TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;;
- skeleton)TARGETS_TO_BUILD="Skeleton $TARGETS_TO_BUILD";;
*) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
esac
done
[Define to path to gv program if found or 'echo gv' otherwise])
fi
+dnl Look for a sufficiently recent version of Perl.
+LLVM_PROG_PERL([5.006])
+AC_SUBST(PERL)
+if test x"$PERL" = xnone; then
+ AC_SUBST(HAVE_PERL,0)
+else
+ AC_SUBST(HAVE_PERL,1)
+fi
+
dnl Find the install program
AC_PROG_INSTALL
;;
esac
+if test "$GCC" != "yes" && test "$ICC" != "yes"
+then
+ AC_MSG_ERROR([gcc|icc required but not found])
+fi
+
+dnl Ensure that compilation tools are GCC; we use GCC specific extensions
+if test "$GXX" != "yes" && test "$IXX" != "yes"
+then
+ AC_MSG_ERROR([g++|icc required but not found])
+fi
+
dnl Verify that GCC is version 3.0 or higher
if test "$GCC" = "yes"
then
[llvm_cv_llvmgcc_sanity="no"
if test -x "$LLVMGCC" ; then
cp /dev/null conftest.c
- "$LLVMGCC" -S -o - conftest.c | grep implementation > /dev/null 2>&1
+ "$LLVMGCC" -emit-llvm -S -o - conftest.c | grep implementation > /dev/null 2>&1
if test $? -eq 0 ; then
llvm_cv_llvmgcc_sanity="yes"
fi
AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'`
AC_SUBST(LLVMGCCDIR,$llvmgccdir)
+ llvmgccversion=[`"$LLVMGCC" -v 2>&1 | grep '^gcc version' | sed 's/^gcc version \([0-9.]*\).*/\1/'`]
+ llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`]
+ AC_SUBST(LLVMGCC_VERSION,$llvmgccversion)
+ AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers)
fi
dnl Propagate the shared library extension that the libltdl checks did to
dnl Configure doxygen's configuration file
AC_CONFIG_FILES([docs/doxygen.cfg])
+dnl Do the first stage of configuration for llvm-config.in.
+AC_CONFIG_FILES([utils/llvm-config/llvm-config.in])
+
dnl Do special configuration of Makefiles
AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])
AC_CONFIG_MAKEFILE(Makefile)