llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
llvm_cv_os_type="SunOS"
llvm_cv_platform_type="Unix" ;;
+ *-*-auroraux*)
+ llvm_cv_link_all_option="-Wl,-z,allextract"
+ llvm_cv_link_all_option="-Wl,-z,defaultextract"
+ llvm_cv_os_type="AuroraUX"
+ llvm_cv_platform_type="Unix" ;;
*-*-win32*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="MingW"
llvm_cv_platform_type="Win32" ;;
+ *-*-haiku*)
+ llvm_cv_link_all_option="-Wl,--whole-archive"
+ llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
+ llvm_cv_os_type="Haiku"
+ llvm_cv_platform_type="Unix" ;;
*-unknown-eabi*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_target_os_type="Linux" ;;
*-*-solaris*)
llvm_cv_target_os_type="SunOS" ;;
+ *-*-auroraux*)
+ llvm_cv_target_os_type="AuroraUX" ;;
*-*-win32*)
llvm_cv_target_os_type="Win32" ;;
*-*-mingw*)
llvm_cv_target_os_type="MingW" ;;
+ *-*-haiku*)
+ llvm_cv_target_os_type="Haiku" ;;
*-unknown-eabi*)
llvm_cv_target_os_type="Freestanding" ;;
*)
AC_MSG_WARN([Configuring LLVM for an unknown target archicture])
fi
-dnl Handle 32-bit linux systems running a 64-bit kernel.
-if test "$llvm_cv_os_type" = "Linux" -a "$llvm_cv_target_arch" = "x86_64" ; then
- AC_IS_LINUX_MIXED
- if test "$llvm_cv_linux_mixed" = "yes"; then
- llvm_cv_target_arch="x86"
- fi
-fi
-
# Determine the LLVM native architecture for the target
case "$llvm_cv_target_arch" in
x86) LLVM_NATIVE_ARCH="X86" ;;
AC_MSG_ERROR([Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used]);
fi
+dnl Override the option to use for optimized builds.
+AC_ARG_WITH(optimize-option,
+ AS_HELP_STRING([--with-optimize-option],
+ [Select the compiler options to use for optimized builds]),,
+ withval=default)
+AC_MSG_CHECKING([optimization flags])
+case "$withval" in
+ default)
+ case "$llvm_cv_os_type" in
+ MingW) optimize_option=-O3 ;;
+ *) optimize_option=-O2 ;;
+ esac ;;
+ *) optimize_option="$withval" ;;
+esac
+AC_SUBST(OPTIMIZE_OPTION,$optimize_option)
+AC_MSG_RESULT([$optimize_option])
+
dnl Specify extra build options
AC_ARG_WITH(extra-options,
AS_HELP_STRING([--with-extra-options],
dnl Tool compatibility is okay if we make it here.
AC_MSG_RESULT([ok])
+dnl Check optional compiler flags.
+AC_MSG_CHECKING([optional compiler flags])
+CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
+CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
+AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS])
+
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 5: Check for libraries
dnl pthread locking functions are optional - but llvm will not be thread-safe
dnl without locks.
if test "$ENABLE_THREADS" -eq 1 ; then
- AC_CHECK_LIB(pthread,pthread_mutex_init)
+ AC_CHECK_LIB(pthread, pthread_mutex_init)
AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
[Have pthread_mutex_lock]))
AC_SUBST(USE_OPROFILE, [1])
case "$withval" in
/usr|yes) llvm_cv_oppath=/usr/lib/oprofile ;;
+ no) llvm_cv_oppath=
+ AC_SUBST(USE_OPROFILE, [0]) ;;
*) llvm_cv_oppath="${withval}/lib/oprofile"
CPPFLAGS="-I${withval}/include";;
esac
- LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}"
- AC_SEARCH_LIBS(op_open_agent, opagent, [], [
- echo "Error! You need to have libopagent around."
- exit -1
- ])
- AC_CHECK_HEADER([opagent.h], [], [
- echo "Error! You need to have opagent.h around."
- exit -1
- ])
+ if test -n "$llvm_cv_oppath" ; then
+ LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}"
+ dnl Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537744:
+ dnl libbfd is not included properly in libopagent in some Debian
+ dnl versions. If libbfd isn't found at all, we assume opagent works
+ dnl anyway.
+ AC_SEARCH_LIBS(bfd_init, bfd, [], [])
+ AC_SEARCH_LIBS(op_open_agent, opagent, [], [
+ echo "Error! You need to have libopagent around."
+ exit -1
+ ])
+ AC_CHECK_HEADER([opagent.h], [], [
+ echo "Error! You need to have opagent.h around."
+ exit -1
+ ])
+ fi
],
[
- llvm_cv_old_LIBS="$LIBS"
- LIBS="$LIBS -L/usr/lib/oprofile -Wl,-rpath,/usr/lib/oprofile"
- dnl If either the library or header aren't present, omit oprofile support.
- AC_SEARCH_LIBS(op_open_agent, opagent,
- [AC_SUBST(USE_OPROFILE, [1])],
- [LIBS="$llvm_cv_old_LIBS"
- AC_SUBST(USE_OPROFILE, [0])])
- AC_CHECK_HEADER([opagent.h], [], [
- LIBS="$llvm_cv_old_LIBS"
- AC_SUBST(USE_OPROFILE, [0])
- ])
+ AC_SUBST(USE_OPROFILE, [0])
])
AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE,
[Define if we have the oprofile JIT-support library])
dnl===
dnl===-----------------------------------------------------------------------===
+dnl Handle 32-bit linux systems running a 64-bit kernel.
+dnl This has to come after section 4 because it invokes the compiler.
+if test "$llvm_cv_os_type" = "Linux" -a "$llvm_cv_target_arch" = "x86_64" ; then
+ AC_IS_LINUX_MIXED
+ if test "$llvm_cv_linux_mixed" = "yes"; then
+ llvm_cv_target_arch="x86"
+ ARCH="x86"
+ fi
+fi
+
dnl Check, whether __dso_handle is present
AC_CHECK_FUNCS([__dso_handle])
AC_CONFIG_FILES([include/llvm/Config/Targets.def])
AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def])
AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def])
-AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
+AC_CONFIG_HEADERS([include/llvm/System/DataTypes.h])
dnl Configure the makefile's configuration data
AC_CONFIG_FILES([Makefile.config])