summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-05 02:14:27 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2013-05-05 13:30:59 +0200
commitfa9f8b4eaa174deb5210de61f353a54202768cd5 (patch)
tree79a37dcc6c5a8440c34443072c49814bbd4009da
parent0f3b0d56e88a03d371d2e03ab715e44b2693c96f (diff)
downloadllvm-fa9f8b4eaa174deb5210de61f353a54202768cd5.tar.gz
llvm-fa9f8b4eaa174deb5210de61f353a54202768cd5.tar.bz2
llvm-fa9f8b4eaa174deb5210de61f353a54202768cd5.tar.xz
[Embtk] Give ability to specify default float abi to use at configure time
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r--autoconf/configure.ac8
-rwxr-xr-xconfigure18
-rw-r--r--include/llvm/Config/config.h.cmake3
-rw-r--r--include/llvm/Config/config.h.in3
-rw-r--r--include/llvm/Config/llvm-config.h.cmake3
-rw-r--r--include/llvm/Config/llvm-config.h.in3
-rw-r--r--include/llvm/Support/Host.h9
-rw-r--r--lib/Support/Unix/Host.inc8
-rw-r--r--lib/Support/Windows/Host.inc8
9 files changed, 62 insertions, 1 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 89b5169a93..39e1c558b5 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -452,6 +452,14 @@ AC_ARG_WITH(default-cpu,
AC_DEFINE_UNQUOTED([LLVM_DEFAULT_TARGET_MCPU],"$with_default_cpu",
[Default cpu (-mcpu=cpu) to use to all compiler invocations.])
+dnl Default float abi to use to all compiler invocations
+AC_ARG_WITH(default-float,
+ AS_HELP_STRING([--with-default-float],
+ [Default float abi to use to all compiler invocations.]),,
+ with_default_float="")
+AC_DEFINE_UNQUOTED([LLVM_DEFAULT_TARGET_FLOAT],"$with_default_float",
+ [Default float abi 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 b30ff29e4d..57c41de199 100755
--- a/configure
+++ b/configure
@@ -1457,6 +1457,8 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-default-cpu Add by default -mcpu=cpu to all compiler
invocations.
+ --with-default-float Default float abi to use 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
@@ -4084,6 +4086,20 @@ _ACEOF
+# Check whether --with-default-float was given.
+if test "${with_default_float+set}" = set; then
+ withval=$with_default_float;
+else
+ with_default_float=""
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define LLVM_DEFAULT_TARGET_FLOAT "$with_default_float"
+_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; }
@@ -10542,7 +10558,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10545 "configure"
+#line 10561 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index 93c2582ae2..0bc3a7bd56 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -570,6 +570,9 @@
/* Installation directory for data files */
#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
+/* Default float abi to use to all compiler invocations. */
+#cmakedefine LLVM_DEFAULT_TARGET_FLOAT "${LLVM_DEFAULT_TARGET_FLOAT}"
+
/* Target triple LLVM will generate code for by default */
#cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in
index 060e2f407d..9e92259122 100644
--- a/include/llvm/Config/config.h.in
+++ b/include/llvm/Config/config.h.in
@@ -575,6 +575,9 @@
/* Installation directory for data files */
#undef LLVM_DATADIR
+/* Default float abi to use to all compiler invocations. */
+#undef LLVM_DEFAULT_TARGET_FLOAT
+
/* Default cpu (-mcpu=cpu) to use to all compiler invocations. */
#undef LLVM_DEFAULT_TARGET_MCPU
diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake
index eda17ee4a6..e1b1237aec 100644
--- a/include/llvm/Config/llvm-config.h.cmake
+++ b/include/llvm/Config/llvm-config.h.cmake
@@ -25,6 +25,9 @@
/* Installation directory for data files */
#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
+/* Default float abi to use to all compiler invocations. */
+#cmakedefine LLVM_DEFAULT_TARGET_FLOAT "${LLVM_DEFAULT_TARGET_FLOAT}"
+
/* Target triple LLVM will generate code for by default */
#cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
diff --git a/include/llvm/Config/llvm-config.h.in b/include/llvm/Config/llvm-config.h.in
index af3a324855..a8e5b7e5b5 100644
--- a/include/llvm/Config/llvm-config.h.in
+++ b/include/llvm/Config/llvm-config.h.in
@@ -25,6 +25,9 @@
/* Installation directory for data files */
#undef LLVM_DATADIR
+/* Default float abi to use to all compiler invocations. */
+#undef LLVM_DEFAULT_TARGET_FLOAT
+
/* Target triple LLVM will generate code for by default */
#undef LLVM_DEFAULT_TARGET_TRIPLE
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index 748e5e2cdf..6cca3b2acd 100644
--- a/include/llvm/Support/Host.h
+++ b/include/llvm/Support/Host.h
@@ -54,6 +54,15 @@ namespace sys {
/// generate by default code for a given target cpu and false otherwise.
bool hasDefaultTargetCpu();
+ /// getDefaultTargetFloat() - Return the default target float abi for which
+ /// the compiler is configured to generate code for, or "" if empty.
+ std::string getDefaultTargetFloat();
+
+ /// hasDefaultTargetFloat() - Return true if the compiler was configured to
+ /// generate by default code for a given floating point abi and false
+ /// otherwise.
+ bool hasDefaultTargetFloat();
+
/// getProcessTriple() - Return an appropriate target triple for generating
/// code to be loaded into the current process, e.g. when using the JIT.
std::string getProcessTriple();
diff --git a/lib/Support/Unix/Host.inc b/lib/Support/Unix/Host.inc
index d272ac813d..261a495c1b 100644
--- a/lib/Support/Unix/Host.inc
+++ b/lib/Support/Unix/Host.inc
@@ -69,3 +69,11 @@ std::string sys::getDefaultTargetCpu() {
bool sys::hasDefaultTargetCpu() {
return getDefaultTargetCpu() != "";
}
+
+std::string sys::getDefaultTargetFloat() {
+ return LLVM_DEFAULT_TARGET_FLOAT;
+}
+
+bool sys::hasDefaultTargetFloat() {
+ return getDefaultTargetFloat() != "";
+}
diff --git a/lib/Support/Windows/Host.inc b/lib/Support/Windows/Host.inc
index 2e6d6f1903..77eec01ee1 100644
--- a/lib/Support/Windows/Host.inc
+++ b/lib/Support/Windows/Host.inc
@@ -20,3 +20,11 @@ using namespace llvm;
std::string sys::getDefaultTargetTriple() {
return LLVM_DEFAULT_TARGET_TRIPLE;
}
+
+std::string sys::getDefaultTargetFloat() {
+ return LLVM_DEFAULT_TARGET_FLOAT;
+}
+
+bool sys::hasDefaultTargetFloat() {
+ return getDefaultTargetFloat() != "";
+}