From 87e6d9dcaa2d39105bb0c2b621f9367bbb876f14 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 10 Dec 2010 11:55:56 +0100 Subject: [PATCH] re PR fortran/46540 (libquadmath: Implement --disable-libquadmath) / 2010-12-10 Tobias Burnus PR fortran/46540 * configure.ac: Add --disable-libquadmath and --disable-libquadmath-support. * configure: Regenerate. gcc/ 2010-12-10 Tobias Burnus 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-10 Tobias Burnus PR fortran/46540 * trans-types.c (gfc_init_kinds): Handle --disable-libquadmath-support. libgfortran/ 2010-12-10 Tobias Burnus PR fortran/46540 * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Honour --disable-libquadmath-support. * configure.ac: Handle --disable-libquadmath-support. * configure: Regenerate. From-SVN: r167684 --- ChangeLog | 7 +++++++ configure | 30 ++++++++++++++++++++++++++++++ configure.ac | 21 +++++++++++++++++++++ gcc/ChangeLog | 9 +++++++++ gcc/config.in | 6 ++++++ gcc/configure | 27 +++++++++++++++++++++++---- gcc/configure.ac | 16 ++++++++++++++-- gcc/doc/install.texi | 10 ++++++++++ gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-types.c | 5 ++--- libgfortran/ChangeLog | 8 ++++++++ libgfortran/acinclude.m4 | 9 +++++++++ libgfortran/configure | 35 +++++++++++++++++++++++++++++++---- libgfortran/configure.ac | 18 +++++++++++++++--- 14 files changed, 191 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1d756c0db3..20bab17fbab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-12-10 Tobias Burnus + + PR fortran/46540 + * configure.ac: Add --disable-libquadmath and + --disable-libquadmath-support. + * configure: Regenerate. + 2010-12-03 Ian Lance Taylor * MAINTAINERS: Add myself as libgo maintainer. diff --git a/configure b/configure index 6dde71a00d7..4280d9778da 100755 --- a/configure +++ b/configure @@ -742,6 +742,8 @@ enable_option_checking with_build_libsubdir enable_gold enable_ld +enable_libquadmath +enable_libquadmath_support enable_libada enable_libssp enable_build_with_cxx @@ -1453,6 +1455,9 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-ld[=ARG] build ld [ARG={default,yes,no}] + --disable-libquadmath do not build libquadmath directory + --disable-libquadmath-support + disable libquadmath support for Fortran --enable-libada build libada directory --enable-libssp build libssp directory --enable-build-with-cxx build with C++ compiler instead of C compiler @@ -2992,6 +2997,31 @@ case "${host}" in esac +# Check whether --enable-libquadmath was given. +if test "${enable_libquadmath+set}" = set; then : + enableval=$enable_libquadmath; ENABLE_LIBQUADMATH=$enableval +else + ENABLE_LIBQUADMATH=yes +fi + +if test "${ENABLE_LIBQUADMATH}" = "no" ; then + noconfigdirs="$noconfigdirs target-libquadmath" +fi + + +# Check whether --enable-libquadmath-support was given. +if test "${enable_libquadmath_support+set}" = set; then : + enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval +else + ENABLE_LIBQUADMATH_SUPPORT=yes +fi + +enable_libquadmath_support= +if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then + enable_libquadmath_support=no +fi + + # Check whether --enable-libada was given. if test "${enable_libada+set}" = set; then : enableval=$enable_libada; ENABLE_LIBADA=$enableval diff --git a/configure.ac b/configure.ac index fcf5ba2c7c8..03f15dfa8a5 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/ChangeLog b/gcc/ChangeLog index f07a6de8f03..fb6bbc81648 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-12-10 Tobias Burnus + + PR fortran/46540 + * configure.ac: Handle --disable-libquadmath-support. + * doc/install.texi: Document --disable-libquadmath and + --disable-libquadmath-support + * configure: Regenerate. + * config.in: Regenerate. + 2010-12-10 Jack Howarth Iain Sandoe diff --git a/gcc/config.in b/gcc/config.in index 89cb4664532..fff7f4d22b1 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -119,6 +119,12 @@ #endif +/* Define to 1 to enable libquadmath support */ +#ifndef USED_FOR_TARGET +#undef ENABLE_LIBQUADMATH_SUPPORT +#endif + + /* Define to enable LTO support. */ #ifndef USED_FOR_TARGET #undef ENABLE_LTO diff --git a/gcc/configure b/gcc/configure index 84c327cbf7b..9d76b4197f7 100755 --- a/gcc/configure +++ b/gcc/configure @@ -912,6 +912,7 @@ enable_maintainer_mode enable_version_specific_runtime_libs with_slibdir enable_plugin +enable_libquadmath_support ' ac_precious_vars='build_alias host_alias @@ -1610,8 +1611,9 @@ Optional Features: enable the use of the @gnu_indirect_function to glibc systems --enable-comdat enable COMDAT group support - --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on - glibc systems + --enable-gnu-unique-object + enable the use of the @gnu_unique_object ELF + extension on glibc systems --enable-linker-build-id compiler will always pass --build-id to linker --enable-maintainer-mode @@ -1621,6 +1623,8 @@ Optional Features: specify that runtime libraries should be installed in a compiler-specific directory --enable-plugin enable plugin support + --disable-libquadmath-support + disable libquadmath support for Fortran Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -17509,7 +17513,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17512 "configure" +#line 17516 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17615,7 +17619,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17618 "configure" +#line 17622 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -26289,6 +26293,21 @@ $as_echo "#define ENABLE_PLUGIN 1" >>confdefs.h fi + +# Check whether --enable-libquadmath-support was given. +if test "${enable_libquadmath_support+set}" = set; then : + enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval +else + ENABLE_LIBQUADMATH_SUPPORT=yes +fi + +if test "${ENABLE_LIBQUADMATH_SUPPORT}" != "no" ; then + +$as_echo "#define ENABLE_LIBQUADMATH_SUPPORT 1" >>confdefs.h + +fi + + # Configure the subdirectories # AC_CONFIG_SUBDIRS($subdirs) diff --git a/gcc/configure.ac b/gcc/configure.ac index b2fd6418fe9..166500e3110 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3873,8 +3873,8 @@ gcc_GAS_CHECK_FEATURE([.lcomm with alignment], gcc_cv_as_lcomm_with_alignment, [Define if your assembler supports .lcomm with an alignment field.])]) AC_ARG_ENABLE(gnu-unique-object, - [ --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on - glibc systems], + [AS_HELP_STRING([--enable-gnu-unique-object], + [enable the use of the @gnu_unique_object ELF extension on glibc systems])], [case $enable_gnu_unique_object in yes | no) ;; *) AC_MSG_ERROR(['$enable_gnu_unique_object' is an invalid value for --enable-gnu-unique-object. @@ -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(ENABLE_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 fbb2d4c04cf..17021c268e1 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 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. + @item --disable-libgomp Specify that the run-time libraries used by GOMP should not be built. diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0c1765f5c31..b2ddec020c7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-12-10 Tobias Burnus + + PR fortran/46540 + * trans-types.c (gfc_init_kinds): Handle + --disable-libquadmath-support. + 2010-12-09 Steven G. Kargl * check.c (gfc_check_sngl): Insert missing space in error message. diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 771b582c4f0..561261fd972 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(ENABLE_LIBQUADMATH_SUPPORT) && (mode != TFmode) #endif ) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 9ca794c5a67..4b8b486032f 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,11 @@ +2010-12-10 Tobias Burnus + + PR fortran/46540 + * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Honour + --disable-libquadmath-support. + * configure.ac: Handle --disable-libquadmath-support. + * configure: Regenerate. + 2010-12-06 Dave Korn PR target/40125 diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index cb016f188ac..9873d9f2392 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 b/libgfortran/configure index 57b620aa26a..b8f0a7174a9 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -764,6 +764,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_largefile +enable_libquadmath_support ' ac_precious_vars='build_alias host_alias @@ -1394,7 +1395,9 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory + --enable-version-specific-runtime-libs + specify that runtime libraries should be installed + in a compiler-specific directory --enable-intermodule build the library in one step --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer @@ -1407,6 +1410,8 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files + --disable-libquadmath-support + disable libquadmath support for Fortran Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -11373,7 +11378,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11376 "configure" +#line 11381 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11479,7 +11484,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11482 "configure" +#line 11487 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -24319,9 +24324,25 @@ $as_echo "#define HAVE_BROKEN_POWF 1" >>confdefs.h fi -# Check whether we have a __float128 type +# Check whether libquadmath should be used +# Check whether --enable-libquadmath-support was given. +if test "${enable_libquadmath_support+set}" = set; then : + enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval +else + ENABLE_LIBQUADMATH_SUPPORT=yes +fi + +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 LIBQUADSPEC= + + if test "x$enable_libquadmath_support" != xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a usable __float128 type" >&5 $as_echo_n "checking whether we have a usable __float128 type... " >&6; } if test "${libgfor_cv_have_float128+set}" = set; then : @@ -24428,6 +24449,12 @@ $as_echo "$libgfor_cv_have_as_needed" >&6; } LIBQUADINCLUDE= fi fi + else + # for --disable-quadmath + LIBQUADLIB= + LIBQUADLIB_DEP= + LIBQUADINCLUDE= + fi diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 4c3daf40acb..7b28f127433 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