From af84995d06bb792e77e84f9a04361e8b0268e800 Mon Sep 17 00:00:00 2001 From: Abdoulaye Walsimou Gaye Date: Thu, 3 Apr 2014 17:54:47 +0200 Subject: [Embtk] Give ability to specify default -mcpu Signed-off-by: Abdoulaye Walsimou Gaye --- autoconf/configure.ac | 8 ++++++++ configure | 18 +++++++++++++++++- include/llvm/Config/config.h.cmake | 3 +++ include/llvm/Config/config.h.in | 3 +++ include/llvm/Config/llvm-config.h.cmake | 3 +++ include/llvm/Config/llvm-config.h.in | 3 +++ include/llvm/Support/Host.h | 8 ++++++++ lib/Support/Unix/Host.inc | 8 ++++++++ lib/Support/Windows/Host.inc | 8 ++++++++ 9 files changed, 61 insertions(+), 1 deletion(-) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 7b4bae7e71..a44b228334 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -464,6 +464,14 @@ fi AC_SUBST(HOST_ARCH,$host_arch) +dnl Default cpu (-mcpu=cpu) to use to all compiler invocations +AC_ARG_WITH(default-cpu, + AS_HELP_STRING([--with-default-cpu], + [Add by default -mcpu=cpu to all compiler invocations.]),, + with_default_cpu="") +AC_DEFINE_UNQUOTED([LLVM_DEFAULT_TARGET_MCPU],"$with_default_cpu", + [Default cpu (-mcpu=cpu) to use to all compiler invocations.]) + dnl Check for the endianness of the target AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little])) diff --git a/configure b/configure index cbda923cc7..d8081ee6c8 100755 --- a/configure +++ b/configure @@ -1466,6 +1466,8 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-default-cpu Add by default -mcpu=cpu to all compiler + invocations. --with-optimize-option Select the compiler options to use for optimized builds --with-extra-options Specify additional options to compile LLVM with @@ -4103,6 +4105,20 @@ HOST_ARCH=$host_arch +# Check whether --with-default-cpu was given. +if test "${with_default_cpu+set}" = set; then + withval=$with_default_cpu; +else + with_default_cpu="" +fi + + +cat >>confdefs.h <<_ACEOF +#define LLVM_DEFAULT_TARGET_MCPU "$with_default_cpu" +_ACEOF + + + { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } @@ -10606,7 +10622,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <