This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support


This patch adds two configure options:

--disable-libquadmath
which disables the libquadmath build (e.g. to use the system's libquadmath)


--disable-libquadmath-support
which disables the __float128/libquadmath support in gcc/fortran and in libgfortran


I did some initial tests with the patch; I will do some more regtests.

OK for committal?

Tobias

PS: I will document the options in install.html after committal.
diff --git a/configure.ac b/configure.ac
index fcf5ba2..2abdf2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -458,6 +458,27 @@ case "${host}" in
 esac
 
 
+AC_ARG_ENABLE(libquadmath,
+[  --disable-libquadmath   do not build libquadmath directory],
+ENABLE_LIBQUADMATH=$enableval,
+ENABLE_LIBQUADMATH=yes)
+use_included_libquadmath=
+if test "${ENABLE_LIBQUADMATH}" = "no" ; then
+  noconfigdirs="$noconfigdirs libquadmath"
+  use_included_libquadmath=no
+fi
+
+
+AC_ARG_ENABLE(libquadmath-support,
+[  --disable-libquadmath-support  disable libquadmath support for Fortran],
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+  enable_libquadmath_support=no
+fi
+
+
 AC_ARG_ENABLE(libada,
 [  --enable-libada         build libada directory],
 ENABLE_LIBADA=$enableval,
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 98de035..6e0f0dc 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -117,6 +117,7 @@ if test x$local_prefix = x; then
 	local_prefix=/usr/local
 fi
 
+
 # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
 # passed in by the toplevel make and thus we'd get different behavior
 # depending on where we built the sources.
@@ -4495,6 +4496,10 @@ changequote([,])dnl
 	esac
 done
 
+AC_DEFINE(ENABLE_LTO, 1, [Define to enable LTO support.])
+	  enable_lto=yes
+	  AC_SUBST(enable_lto)
+
 # Pick up gtfiles for c
 gtfiles=
 . ${srcdir}/c-config-lang.in
@@ -4775,6 +4780,17 @@ if test x"$enable_plugin" = x"yes"; then
   AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
 fi
 
+
+AC_ARG_ENABLE(libquadmath-support,
+[  --disable-libquadmath-support  disable libquadmath support for Fortran],
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" != "no" ; then
+  AC_DEFINE(USE_LIBQUADMATH_SUPPORT, 1,
+            [Define to 1 to enable libquadmath support])
+fi
+
+
 # Configure the subdirectories
 # AC_CONFIG_SUBDIRS($subdirs)
 
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 771b582..c5aac3e 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -415,12 +415,11 @@ gfc_init_kinds (void)
 
       /* Only let float, double, long double and __float128 go through.
 	 Runtime support for others is not provided, so they would be
-	 useless.  TODO: TFmode support should be enabled once libgfortran
-	 support is done.  */
+	 useless.  */
 	if (mode != TYPE_MODE (float_type_node)
 	    && (mode != TYPE_MODE (double_type_node))
 	    && (mode != TYPE_MODE (long_double_type_node))
-#ifdef LIBGCC2_HAS_TF_MODE
+#if defined(LIBGCC2_HAS_TF_MODE) && defined(USE_LIBQUADMATH_SUPPORT)
 	    && (mode != TFmode)
 #endif
 	   )
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 47315d5..ba62ce8 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -462,7 +462,17 @@ LIBGFOR_CHECK_MINGW_SNPRINTF
 # Check for a broken powf implementation
 LIBGFOR_CHECK_FOR_BROKEN_POWF
 
-# Check whether we have a __float128 type
+# Check whether libquadmath should be used
+AC_ARG_ENABLE(libquadmath-support,
+[  --disable-libquadmath-support  disable libquadmath support for Fortran],
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+  enable_libquadmath_support=no
+fi
+
+# Check whether we have a __float128 type, depends on enable_libquadmath_support
 LIBGFOR_CHECK_FLOAT128
 
 # Check for GNU libc feenableexcept

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]