public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
@ 2010-12-04 16:15 Tobias Burnus
  2010-12-04 16:20 ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2010-12-04 16:15 UTC (permalink / raw)
  To: gcc patches, gfortran, Ralf Wildenhues

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

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.

[-- Attachment #2: quad-disable.diff --]
[-- Type: text/x-patch, Size: 3615 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-04 16:15 [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support Tobias Burnus
@ 2010-12-04 16:20 ` H.J. Lu
  2010-12-04 16:31   ` Tobias Burnus
  0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 2010-12-04 16:20 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc patches, gfortran, Ralf Wildenhues

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?

> --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?
>

-- 
H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-04 16:20 ` H.J. Lu
@ 2010-12-04 16:31   ` Tobias Burnus
  2010-12-05 20:34     ` Tobias Burnus
  0 siblings, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2010-12-04 16:31 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc patches, gfortran, Ralf Wildenhues

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

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

[-- Attachment #2: quad-disable.diff --]
[-- Type: text/x-patch, Size: 4548 bytes --]

/
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-04 16:31   ` Tobias Burnus
@ 2010-12-05 20:34     ` Tobias Burnus
  2010-12-06  1:31       ` Matthias Klose
  2010-12-08 23:41       ` Tobias Burnus
  0 siblings, 2 replies; 8+ messages in thread
From: Tobias Burnus @ 2010-12-05 20:34 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc patches, gfortran, Ralf Wildenhues

[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]

Tobias Burnus wrote:
> 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?

Well, we also have: --enable-libada and --enable-libssp.

I have now used --with-system-libquadmath but I have to admit I find it 
much more misleading. --disable-libquadmath does that the option was 
stating: It does not build "libquadmath".

--with-system-libquadmath somehow implies that the system *has* to 
provide libquadmath - which is not (generally) true. It is just not 
build. -- Only if you build the Fortran front end on a system which 
supports __float128 and you did not disable the support using 
--disable-libquadmath-support, you have to provide libquadmath such that 
it is in the include ("-I") and library ("-L") path.

For the case you only build, e.g., C or C++ the option 
--without-system-libquadmath implies that the library is build and 
--with-system-libquadmath (default on systems supporting it) implies 
that the library is not build (note: a system library is not needed) -- 
which I find much more confusing. Or if I want to build on x86-64 
Fortran without quadmath support and without the library, the options 
you have to use are: --disable-libquadmath-support 
--with-system-libquadmath -- which somehow looks strange.


The attached patch has been a couple of times in different variants 
bootstrapped on x86-64-linux.
OK for the trunk?

(For the variant with --disable-libquadmath, cf. patch snippet below.)

Tobias

PS: I have included a patch for "gcc/doc/install.html" (describing 
--disable-libquadmath[-support]).

PPS: A variant would for --(disable|enable)-libquadmath:

+AC_ARG_ENABLE(libquadmath,
+[  --disable-libquadmath   do not build libquadmath directory],
+ENABLE_LIBQUADMATH=$enableval,
+ENABLE_LIBQUADMATH=yes)
+if test "${ENABLE_LIBQUADMATH}" = "no" ; then
+  noconfigdirs="$noconfigdirs target-libquadmath"
+fi
+
+


[-- Attachment #2: quad-disable-v2.diff --]
[-- Type: text/x-patch, Size: 4544 bytes --]

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

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

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

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

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

libgfortran/
2010-12-05  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..d47bbbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -458,6 +458,25 @@ case "${host}" in
 esac
 
 
+AC_ARG_WITH(system-libquadmath,
+[  --with-system-libquadmath   use the system instead of included libquadmath (default is no)],
+[SYSTEM_LIBQUADMATH=$withval],
+[SYSTEM_LIBQUADMATH=no])
+if test "${SYSTEM_LIBQUADMATH}" != "no" ; then
+  noconfigdirs="$noconfigdirs target-libquadmath"
+fi
+
+
+AC_ARG_ENABLE(libquadmath-support,
+[  --enable-libquadmath-support  enable libquadmath support for Fortran (default)],
+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

[-- Attachment #3: install.diff --]
[-- Type: text/x-patch, Size: 967 bytes --]

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

	PR fortran/46540
	* doc/install.texi: Document --disable-libquadmath an
	--disable-libquadmath-support

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index fbb2d4c..abe80aa 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1337,6 +1337,16 @@ do a @samp{make -C gcc gnatlib_and_tools}.
 Specify that the run-time libraries for stack smashing protection
 should not be built.
 
+@item --disable-libquadmath
+Specify that the GCC quad-precision math library should not be build.
+On some systems, the library is required to be linkable when building
+the Fortran front end, unless @option{--disable-libquadmath-support}
+is used.
+
+@item --disable-libquadmath-support
+Specify that the Fortran front end and @code{libgfortran} do not add
+support for @code{libquadmath} on systems supporting it.
+
 @item --disable-libgomp
 Specify that the run-time libraries used by GOMP should not be built.
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-05 20:34     ` Tobias Burnus
@ 2010-12-06  1:31       ` Matthias Klose
  2010-12-08 23:41       ` Tobias Burnus
  1 sibling, 0 replies; 8+ messages in thread
From: Matthias Klose @ 2010-12-06  1:31 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: H.J. Lu, gcc patches, gfortran, Ralf Wildenhues

On 05.12.2010 21:33, Tobias Burnus wrote:
> Tobias Burnus wrote:
>> 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?
>
> Well, we also have: --enable-libada and --enable-libssp.
>
> I have now used --with-system-libquadmath but I have to admit I find it much
> more misleading. --disable-libquadmath does that the option was stating: It does
> not build "libquadmath".

and --with-system-libquadmath implies that there is an externally available 
release of libquadmath, which I at least cannot find. I think the option 
renaming is misleading.

   Matthias

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-05 20:34     ` Tobias Burnus
  2010-12-06  1:31       ` Matthias Klose
@ 2010-12-08 23:41       ` Tobias Burnus
  2010-12-09 22:58         ` Ralf Wildenhues
  1 sibling, 1 reply; 8+ messages in thread
From: Tobias Burnus @ 2010-12-08 23:41 UTC (permalink / raw)
  Cc: gcc patches, gfortran, Ralf Wildenhues

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

Updated patch (relative to 
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00419.html).

Changes:
- Use (again!) --disable-libquadmath-support
- Use AS_HELP_STRING

OK for the trunk?

Tobias

[-- Attachment #2: quad-disable.diff --]
[-- Type: text/x-patch, Size: 6409 bytes --]

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

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

	PR fortran/46540
	* configure.ac: Handle --disable-libquadmath-support.
	* doc/install.texi: Document --disable-libquadmath and
	--disable-libquadmath-support
	* configure: Regenerate.
	* config.in: Regenerate.

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

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

libgfortran/
2010-12-09  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..03f15df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -458,6 +458,27 @@ case "${host}" in
 esac
 
 
+AC_ARG_ENABLE(libquadmath,
+AS_HELP_STRING([--disable-libquadmath],
+  [do not build libquadmath directory]),
+ENABLE_LIBQUADMATH=$enableval,
+ENABLE_LIBQUADMATH=yes)
+if test "${ENABLE_LIBQUADMATH}" = "no" ; then
+  noconfigdirs="$noconfigdirs target-libquadmath"
+fi
+
+
+AC_ARG_ENABLE(libquadmath-support,
+AS_HELP_STRING([--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 b2fd641..468e430 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4781,6 +4781,18 @@ if test x"$enable_plugin" = x"yes"; then
   AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
 fi
 
+
+AC_ARG_ENABLE(libquadmath-support,
+AS_HELP_STRING([--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/doc/install.texi b/gcc/doc/install.texi
index fbb2d4c..abe80aa 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1337,6 +1337,16 @@ do a @samp{make -C gcc gnatlib_and_tools}.
 Specify that the run-time libraries for stack smashing protection
 should not be built.
 
+@item --disable-libquadmath
+Specify that the GCC quad-precision math library should not be build.
+On some systems, the library is required to be linkable when building
+the Fortran front end, unless @option{--disable-libquadmath-support}
+is used.
+
+@item --disable-libquadmath-support
+Specify that the Fortran front end and @code{libgfortran} do not add
+support for @code{libquadmath} on systems supporting it.
+
 @item --disable-libgomp
 Specify that the run-time libraries used by GOMP should not be built.
 
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 4c3daf4..7b28f12 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -12,7 +12,8 @@ GCC_TOPLEV_SUBDIRS
 
 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
 AC_ARG_ENABLE(version-specific-runtime-libs,
-[  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
+AS_HELP_STRING([--enable-version-specific-runtime-libs],
+  [specify that runtime libraries should be installed in a compiler-specific directory]),
 [case "$enableval" in
  yes) version_specific_libs=yes ;;
  no)  version_specific_libs=no ;;
@@ -24,7 +25,7 @@ AC_MSG_RESULT($version_specific_libs)
 # Build with intermodule optimisations
 AC_MSG_CHECKING([for --enable-intermodule])
 AC_ARG_ENABLE(intermodule,
-[  --enable-intermodule    build the library in one step],
+AS_HELP_STRING([--enable-intermodule],[build the library in one step]),
 [case "$enable_intermodule" in
   yes) onestep="-onestep";;
     *) onestep="";;
@@ -463,7 +464,18 @@ 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,
+AS_HELP_STRING([--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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-08 23:41       ` Tobias Burnus
@ 2010-12-09 22:58         ` Ralf Wildenhues
  2010-12-10 13:16           ` Tobias Burnus
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Wildenhues @ 2010-12-09 22:58 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc patches, gfortran

* Tobias Burnus wrote on Thu, Dec 09, 2010 at 12:36:53AM CET:
> Updated patch (relative to
> http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00419.html).
> 
> Changes:
> - Use (again!) --disable-libquadmath-support
> - Use AS_HELP_STRING
> 
> OK for the trunk?

OK with nits addressed.

Thanks,
Ralf

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

This needs syncing to src.

> gcc/
> 2010-12-09  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/46540
> 	* configure.ac: Handle --disable-libquadmath-support.
> 	* doc/install.texi: Document --disable-libquadmath and
> 	--disable-libquadmath-support
> 	* configure: Regenerate.
> 	* config.in: Regenerate.
> 
> gcc/fortran/
> 2010-12-09  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/46540
> 	* trans-types.c (gfc_init_kinds): Handle
> 	--disable-libquadmath-support.
> 
> libgfortran/
> 2010-12-09  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.

> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -4781,6 +4781,18 @@ if test x"$enable_plugin" = x"yes"; then
>    AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
>  fi
>  
> +
> +AC_ARG_ENABLE(libquadmath-support,
> +AS_HELP_STRING([--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,

Is there a specific reason you don't use ENABLE_LIBQUADMATH_SUPPORT also
as the name of the define?  There is precedent.  (Your choice though.)
trans-types.c would need adjusting, of course.

> +            [Define to 1 to enable libquadmath support])
> +fi

> --- a/gcc/doc/install.texi
> +++ b/gcc/doc/install.texi
> @@ -1337,6 +1337,16 @@ do a @samp{make -C gcc gnatlib_and_tools}.
>  Specify that the run-time libraries for stack smashing protection
>  should not be built.
>  
> +@item --disable-libquadmath
> +Specify that the GCC quad-precision math library should not be build.

built

> +On some systems, the library is required to be linkable when building
> +the Fortran front end, unless @option{--disable-libquadmath-support}
> +is used.
> +
> +@item --disable-libquadmath-support
> +Specify that the Fortran front end and @code{libgfortran} do not add
> +support for @code{libquadmath} on systems supporting it.
> +

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
  2010-12-09 22:58         ` Ralf Wildenhues
@ 2010-12-10 13:16           ` Tobias Burnus
  0 siblings, 0 replies; 8+ messages in thread
From: Tobias Burnus @ 2010-12-10 13:16 UTC (permalink / raw)
  To: Ralf Wildenhues, gcc patches, gfortran

On 12/09/2010 11:33 PM, Ralf Wildenhues wrote:
> * Tobias Burnus wrote on Thu, Dec 09, 2010 at 12:36:53AM CET:
>> OK for the trunk?
> OK with nits addressed.

Thanks for the review. The committal to "src" was done by bonzini, who 
did it before I could even update my "src" checkout. (Anonymous "cvs up" 
failed with "Service temporarily unavailable" due to this morning's DoS 
attack.)

Tobias

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-10 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-04 16:15 [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support Tobias Burnus
2010-12-04 16:20 ` H.J. Lu
2010-12-04 16:31   ` Tobias Burnus
2010-12-05 20:34     ` Tobias Burnus
2010-12-06  1:31       ` Matthias Klose
2010-12-08 23:41       ` Tobias Burnus
2010-12-09 22:58         ` Ralf Wildenhues
2010-12-10 13:16           ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).