This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

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


H.J. Lu wrote:
On Sat, Dec 4, 2010 at 8:15 AM, Tobias Burnus<burnus@net-b.de> wrote:
This patch adds two configure options:
--disable-libquadmath
    which disables the libquadmath build (e.g. to use the system's
libquadmath)
This isn't very clear.  We already have --with-system-zlib, why not
--with-system-libquadmath?

I think that's better - I will update the patch.


Additionally, I saw that I attached the wrong version of the patch (missed a file, the changelog and had a spurious addition). The correct one is attached.

Tobias
/
2010-12-04  Tobias Burnus  <burnus@net-b.de>

	PR fortran/46540
	* configure.ac: Add --disable-libquadmath and
	--disable-libquadmath-support.
	* configure: Regenerate.
gcc/
2010-12-04  Tobias Burnus  <burnus@net-b.de>

	PR fortran/46540
	* configure.ac: Handle --disable-libquadmath-support.
	* configure: Regenerate.

gcc/fortran/
2010-12-04  Tobias Burnus  <burnus@net-b.de>

	PR fortran/46540
	* trans-types.c (gfc_init_kinds): Handle
	--disable-libquadmath-support.

libgfortran/
2010-12-04  Tobias Burnus  <burnus@net-b.de>

	PR fortran/46540
	* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Honour
	--disable-libquadmath-support.
	* configure.ac: Handle --disable-libquadmath-support.
	* configure: Regenerate.

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..cbbfe10 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4775,6 +4775,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/acinclude.m4 b/libgfortran/acinclude.m4
index cb016f1..9873d9f 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -279,6 +279,9 @@ esac])
 dnl Check whether we have a __float128 type
 AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
   LIBQUADSPEC=
+
+  if test "x$enable_libquadmath_support" != xno; then
+
   AC_CACHE_CHECK([whether we have a usable __float128 type],
                  libgfor_cv_have_float128, [
     AC_TRY_LINK([
@@ -341,6 +344,12 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
       LIBQUADINCLUDE=
     fi
   fi
+  else
+    # for --disable-quadmath
+    LIBQUADLIB=
+    LIBQUADLIB_DEP=
+    LIBQUADINCLUDE=
+  fi
 
   dnl For the spec file
   AC_SUBST(LIBQUADSPEC)
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]