aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf/configure.ac
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-04 04:32:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-04 04:32:50 +0000
commit1fce948ccbd67fff3fc7df954cd1c38f7991398d (patch)
treed63045d6979fb8adc0049d77931230a5b55e3201 /autoconf/configure.ac
parent9111c4fef5a963f6d091e0a2401346fc98b521da (diff)
downloadexternal_llvm-1fce948ccbd67fff3fc7df954cd1c38f7991398d.zip
external_llvm-1fce948ccbd67fff3fc7df954cd1c38f7991398d.tar.gz
external_llvm-1fce948ccbd67fff3fc7df954cd1c38f7991398d.tar.bz2
configure: Add --with-optimize-option, for setting the default value of
OPTIMIZE_OPTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf/configure.ac')
-rw-r--r--autoconf/configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 794326d..7d0a9bb 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -607,6 +607,23 @@ if test -n "$LLVMGXX" && test -z "$LLVMGCC"; then
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],