For PR1019:
[oota-llvm.git] / autoconf / configure.ac
index 65a1ce3956b3f12eeb95e8d018cc9b4bcf60818c..cc299e63d18c24d93335b84a1f69baccb38444de 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.9cvs]],[llvmbugs@cs.uiuc.edu])
+AC_INIT([[llvm]],[[2.0cvs]],[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.
@@ -313,10 +313,11 @@ dnl Allow disablement of threads
 AC_ARG_ENABLE(threads,
               AS_HELP_STRING([--enable-threads],
                              [Use threads if available (default is YES)]),,
-                             enableval=yes)
+                             enableval=default)
 case "$enableval" in
   yes) AC_SUBST(ENABLE_THREADS,[1]) ;;
   no)  AC_SUBST(ENABLE_THREADS,[0]) ;;
+  default) AC_SUBST(ENABLE_THREADS,[1]) ;;
   *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
 esac
 AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
@@ -355,6 +356,21 @@ esac
 TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD"
 AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
 
+dnl Prevent the CBackend from using printf("%a") for floating point so older
+dnl C compilers that cannot deal with the 0x0p+0 hex floating point format
+dnl can still compile the CBE's output
+AC_ARG_ENABLE([cbe-printf-a],AS_HELP_STRING([--enable-cbe-printf-a],
+  [Enable C Backend output with hex floating point via %a  (default is YES)]),,
+  enableval=default)
+case "$enableval" in
+  yes) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
+  no)  AC_SUBST(ENABLE_CBE_PRINTF_A,[0]) ;;
+  default)  AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
+  *) AC_MSG_ERROR([Invalid setting for --enable-cbe-printf-a. Use "yes" or "no"]) ;;
+esac
+AC_DEFINE_UNQUOTED([ENABLE_CBE_PRINTF_A],$ENABLE_CBE_PRINTF_A,
+                   [Define if CBE is enabled for printf %a output])
+
 dnl Allow a specific llvm-gcc/llvm-g++ pair to be used with this LLVM config.
 AC_ARG_WITH(llvmgccdir,
   AS_HELP_STRING([--with-llvmgccdir],
@@ -621,7 +637,11 @@ 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 mach/mach.h])
 if test "$ENABLE_THREADS" -eq 1 ; then
-  AC_CHECK_HEADERS(pthread.h)
+  AC_CHECK_HEADER(pthread.h,
+                  AC_SUBST(HAVE_PTHREAD, 1),
+                  AC_SUBST(HAVE_PTHREAD, 0))
+else
+  AC_SUBST(HAVE_PTHREAD, 0)
 fi
 
 dnl===-----------------------------------------------------------------------===
@@ -630,6 +650,7 @@ dnl=== SECTION 7: Check for types and structures
 dnl===
 dnl===-----------------------------------------------------------------------===
 
+AC_HUGE_VAL_CHECK
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_SIGNAL
@@ -816,7 +837,7 @@ AC_OUTPUT
 dnl Warn loudly if llvm-gcc was not obviously working
 if test "$llvm_cv_llvmgcc_sanity" = "no" ; then
  AC_MSG_WARN([***** llvm-gcc/llvm-g++ was not found, or does not appear to be ])
- AC_MSG_WARN([***** working. Please make sure you have llvmgcc and llvmg++ in])
+ AC_MSG_WARN([***** working. Please make sure you have llvm-gcc and llvm-g++ in])
  AC_MSG_WARN([***** your path before configuring LLVM. The runtime libraries])
  AC_MSG_WARN([***** (llvm/runtime) will not be built but you should be able to])
  AC_MSG_WARN([***** build the llvm tools.])