Make sure to default ${prefix} to /usr/local if the user didn't specify it.
[oota-llvm.git] / autoconf / configure.ac
index fee1c2c4becefd119cfbce131618d87bcaf55c86..f6bb7a5445ee9458458b1a8b4d738102e58da7a3 100644 (file)
@@ -31,7 +31,7 @@ dnl===
 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.
@@ -112,6 +112,9 @@ AC_CACHE_CHECK([type of operating system we're on],
   *-*-freebsd*) 
     llvm_cv_os_type="FreeBSD" 
     llvm_cv_platform_type="Unix" ;;
+  *-*-openbsd*) 
+    llvm_cv_os_type="OpenBSD" 
+    llvm_cv_platform_type="Unix" ;;
   *-*-hpux*) 
     llvm_cv_os_type="HP-UX" 
     llvm_cv_platform_type="Unix" ;;
@@ -193,12 +196,10 @@ dnl --enable-assertions below
 if test -d "CVS" -o -d "${srcdir}/CVS"; then
   cvsbuild="yes"
   optimize="no"
-  asserts="yes"
   AC_SUBST(CVSBUILD,[[CVSBUILD=1]])
 else
   cvsbuild="no"
   optimize="yes"
-  asserts="no"
 fi
 
 dnl===-----------------------------------------------------------------------===
@@ -218,11 +219,11 @@ 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 NO)]),, enableval=$asserts)
-if test ${enableval} = "no" ; then
-  AC_SUBST(ENABLE_ASSERTIONS,[[]])
+  [--enable-assertions,Compile with assertion checks enabled (default is YES)]),, enableval="yes")
+if test ${enableval} = "yes" ; then
+  AC_SUBST(DISABLE_ASSERTIONS,[[]])
 else
-  AC_SUBST(ENABLE_ASSERTIONS,[[ENABLE_ASSERTIONS=1]])
+  AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
 fi
 
 dnl --enable-debug-runtime : should runtime libraries have debug symbols?
@@ -284,12 +285,12 @@ AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-target],
     [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" ;;
+  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM" ;;
   host-only)
     case "$llvm_cv_target_arch" in
       x86)     TARGETS_TO_BUILD="X86" ;;
       x86_64)  TARGETS_TO_BUILD="X86" ;;
-      Sparc)   TARGETS_TO_BUILD="Sparc SparcV9" ;;
+      Sparc)   TARGETS_TO_BUILD="Sparc" ;;
       PowerPC) TARGETS_TO_BUILD="PowerPC" ;;
       Alpha)   TARGETS_TO_BUILD="Alpha" ;;
       IA64)    TARGETS_TO_BUILD="IA64" ;;
@@ -300,7 +301,7 @@ case "$enableval" in
       case "$a_target" in
         x86)     TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
         x86_64)  TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
-        sparc)   TARGETS_TO_BUILD="Sparc SparcV9 $TARGETS_TO_BUILD" ;;
+        sparc)   TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
         powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
         alpha)   TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;;
         ia64)    TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;;
@@ -380,17 +381,17 @@ 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],[true bzip2])
-AC_PATH_PROG(DOT,[dot],[true dot])
-AC_PATH_PROG(DOXYGEN,[doxygen],[true doxygen])
-AC_PATH_PROG(ETAGS,[etags],[true etags])
-AC_PATH_PROG(GROFF,[groff],[true groff])
-AC_PATH_PROG(GZIP,[gzip],[true gzip])
-AC_PATH_PROG(POD2HTML,[pod2html],[true pod2html])
-AC_PATH_PROG(POD2MAN,[pod2man],[true pod2man])
-AC_PATH_PROG(RUNTEST,[runtest],[true runtest])
+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"])
+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"])
 DJ_AC_PATH_TCLSH
-AC_PATH_PROG(ZIP,[zip],[true zip])
+AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not found"])
 
 dnl Determine if the linker supports the -R option.
 AC_LINK_USE_R
@@ -618,7 +619,7 @@ if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then
   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/'`]
+  llvmgccversion=[`"$LLVMGCC" -dumpversion 2>&1 | sed 's/^\([0-9.]*\).*/\1/'`]
   llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`]
   AC_SUBST(LLVMGCC_VERSION,$llvmgccversion)
   AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers)
@@ -631,6 +632,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";
@@ -699,7 +703,7 @@ 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])
+AC_CONFIG_FILES([tools/llvm-config/llvm-config.in])
 
 dnl Do special configuration of Makefiles
 AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])