diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6250859ac8b..135b52835bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2005-06-23 Francois-Xavier Coudert + + * lib/target-supports.exp: Add + check_effective_target_fortran_large_real and + check_effective_target_fortran_large_int to check for + corresponding effective targets. + * gfortran.dg/large_integer_kind_1.f90: New test. + * gfortran.dg/large_real_kind_1.f90: New test. + 2005-06-23 Kazu Hirata PR tree-optimization/22117 diff --git a/gcc/testsuite/gfortran.dg/large_integer_kind_1.f90 b/gcc/testsuite/gfortran.dg/large_integer_kind_1.f90 new file mode 100644 index 00000000000..9511317901c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/large_integer_kind_1.f90 @@ -0,0 +1,38 @@ +! { dg-do run } +! { dg-require-effective-target fortran_large_int } + +module testmod + integer,parameter :: k = selected_int_kind (range (0_8) + 1) +contains + subroutine testoutput (a,b,length,f) + integer(kind=k),intent(in) :: a + integer(kind=8),intent(in) :: b + integer,intent(in) :: length + character(len=*),intent(in) :: f + + character(len=length) :: ca + character(len=length) :: cb + + write (ca,f) a + write (cb,f) b + if (ca /= cb) call abort + end subroutine testoutput +end module testmod + + +! Testing I/O of large integer kinds (larger than kind=8) +program test + use testmod + implicit none + + integer(kind=k) :: x + character(len=50) :: c1, c2 + + call testoutput (0_k,0_8,50,'(I50)') + call testoutput (1_k,1_8,50,'(I50)') + call testoutput (-1_k,-1_8,50,'(I50)') + x = huge(0_8) + call testoutput (x,huge(0_8),50,'(I50)') + x = -huge(0_8) + call testoutput (x,-huge(0_8),50,'(I50)') +end program test diff --git a/gcc/testsuite/gfortran.dg/large_real_kind_1.f90 b/gcc/testsuite/gfortran.dg/large_real_kind_1.f90 new file mode 100644 index 00000000000..705b51eeb09 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/large_real_kind_1.f90 @@ -0,0 +1,77 @@ +! { dg-do run } +! { dg-require-effective-target fortran_large_real } + +module testmod + integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) +contains + subroutine testoutput (a,b,length,f) + real(kind=k),intent(in) :: a + real(kind=8),intent(in) :: b + integer,intent(in) :: length + character(len=*),intent(in) :: f + + character(len=length) :: ca + character(len=length) :: cb + + write (ca,f) a + write (cb,f) b + if (ca /= cb) call abort + end subroutine testoutput + + subroutine outputstring (a,f,s) + real(kind=k),intent(in) :: a + character(len=*),intent(in) :: f + character(len=*),intent(in) :: s + + character(len=len(s)) :: c + + write (c,f) a + if (c /= s) call abort + end subroutine outputstring +end module testmod + + +! Testing I/O of large real kinds (larger than kind=8) +program test + use testmod + implicit none + + real(kind=k) :: x + character(len=20) :: c1, c2 + + call testoutput (0.0_k,0.0_8,40,'(F40.35)') + + call testoutput (1.0_k,1.0_8,40,'(F40.35)') + call testoutput (0.1_k,0.1_8,15,'(F15.10)') + call testoutput (1e10_k,1e10_8,15,'(F15.10)') + call testoutput (7.51e100_k,7.51e100_8,15,'(F15.10)') + call testoutput (1e-10_k,1e-10_8,15,'(F15.10)') + call testoutput (7.51e-100_k,7.51e-100_8,15,'(F15.10)') + + call testoutput (-1.0_k,-1.0_8,40,'(F40.35)') + call testoutput (-0.1_k,-0.1_8,15,'(F15.10)') + call testoutput (-1e10_k,-1e10_8,15,'(F15.10)') + call testoutput (-7.51e100_k,-7.51e100_8,15,'(F15.10)') + call testoutput (-1e-10_k,-1e-10_8,15,'(F15.10)') + call testoutput (-7.51e-100_k,-7.51e-100_8,15,'(F15.10)') + + x = huge(x) + call outputstring (2*x,'(F20.15)',' +Infinity') + call outputstring (-2*x,'(F20.15)',' -Infinity') + + write (c1,'(G20.10E5)') x + write (c2,'(G20.10E5)') -x + if (c2(1:1) /= '-') call abort + c2(1:1) = ' ' + if (c1 /= c2) call abort + + x = tiny(x) + call outputstring (x,'(F20.15)',' 0.000000000000000') + call outputstring (-x,'(F20.15)',' 0.000000000000000') + + write (c1,'(G20.10E5)') x + write (c2,'(G20.10E5)') -x + if (c2(1:1) /= '-') call abort + c2(1:1) = ' ' + if (c1 /= c2) call abort +end program test diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 03781699775..dfe7918cfb6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -410,6 +410,82 @@ proc check_named_sections_available { } { return $answer } +# Return 1 if the target supports Fortran real kinds larger than real(8), +# 0 otherwise. Cache the result. + +proc check_effective_target_fortran_large_real { } { + global et_fortran_large_real_saved + global tool + + if [info exists et_fortran_large_real_saved] { + verbose "check_effective_target_fortran_large_real returning saved $et_fortran_large_real_saved" 2 + } else { + set et_fortran_large_real_saved 0 + + # Set up, compile, and execute a test program using large real + # kinds. Include the current process ID in the file names to + # prevent conflicts with invocations for multiple testsuites. + set src real[pid].f90 + set exe real[pid].x + + set f [open $src "w"] + puts $f "integer,parameter :: k = &" + puts $f " selected_real_kind (precision (0.0_8) + 1)" + puts $f "real(kind=k) :: x" + puts $f "end" + close $f + + verbose "check_effective_target_fortran_large_real compiling testfile $src" 2 + set lines [${tool}_target_compile $src $exe executable ""] + file delete $src + + if [string match "" $lines] then { + # No error message, compilation succeeded. + set et_fortran_large_real_saved 1 + } + } + + return $et_fortran_large_real_saved +} + +# Return 1 if the target supports Fortran integer kinds larger than +# integer(8), 0 otherwise. Cache the result. + +proc check_effective_target_fortran_large_int { } { + global et_fortran_large_int_saved + global tool + + if [info exists et_fortran_large_int_saved] { + verbose "check_effective_target_fortran_large_int returning saved $et_fortran_large_int_saved" 2 + } else { + set et_fortran_large_int_saved 0 + + # Set up, compile, and execute a test program using large integer + # kinds. Include the current process ID in the file names to + # prevent conflicts with invocations for multiple testsuites. + set src int[pid].f90 + set exe int[pid].x + + set f [open $src "w"] + puts $f "integer,parameter :: k = &" + puts $f " selected_int_kind (range (0_8) + 1)" + puts $f "integer(kind=k) :: i" + puts $f "end" + close $f + + verbose "check_effective_target_fortran_large_int compiling testfile $src" 2 + set lines [${tool}_target_compile $src $exe executable ""] + file delete $src + + if [string match "" $lines] then { + # No error message, compilation succeeded. + set et_fortran_large_int_saved 1 + } + } + + return $et_fortran_large_int_saved +} + # Return 1 if the target supports executing AltiVec instructions, 0 # otherwise. Cache the result. diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index dceddf6d509..6f4de39a717 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,48 @@ +2005-06-23 Francois-Xavier Coudert + + * intrinsics/c99_functions.c (log10l): New log10l function for + systems where this is not available. + * c99_protos.h: Prototype for log10l function. + * libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*, + GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update + prototypes for gfc_itoa and xtoa. + * io/io.h: Update prototypes for set_integer and max_value. + * io/list_read.c (convert_integer): Use new + GFC_(INTEGER|REAL)_LARGEST type. + * io/read.c (set_integer): Likewise. + (max_value): Likewise. + (convert_real): Likewise. + (real_l): Likewise. + (next_char): Likewise. + (read_decimal): Likewise. + (read_radix): Likewise. + (read_f): Likewise. + * io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type. + (extract_real): Use new GFC_REAL_LARGEST type. + (calculate_exp): Likewise. + (calculate_G_format): Likewise. + (output_float): Likewise. Use log10l for long double values. + Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT. + (write_l): Use new GFC_INTEGER_LARGEST type. + (write_float): Use new GFC_REAL_LARGEST type. + (write_int): Remove useless special case for (len < 8). + (write_decimal): Use GFC_INTEGER_LARGEST. + (otoa): Use GFC_UINTEGER_LARGEST as argument. + (btoa): Use GFC_UINTEGER_LARGEST as argument. + * runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as + argument. + (xtoa): Use GFC_UINTEGER_LARGEST as argument. + * Makefile.am: Use mk-kinds-h.sh to generate header kinds.h + with all Fortran kinds available. + * configure.ac: Check for strtold and log10l. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * config.h.in: Regenerate. + * mk-kinds-h.sh: Configuration script for available integer + and real kinds. + + 2005-06-18 Janne Blomqvist * unix.c (stream_at_bof): Don't assume that all non-mmapped files diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am index 43fc9883001..0c06d3ab529 100644 --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -299,7 +299,7 @@ gfor_built_src= $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \ $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \ $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \ $(i_pow_c) \ - selected_int_kind.inc selected_real_kind.inc + selected_int_kind.inc selected_real_kind.inc kinds.h # We only use these if libm doesn't contain complex math functions. @@ -419,6 +419,9 @@ I_M4_DEPS=m4/iparm.m4 I_M4_DEPS0=$(I_M4_DEPS) m4/iforeach.m4 I_M4_DEPS1=$(I_M4_DEPS) m4/ifunction.m4 +kinds.h: $(srcdir)/mk-kinds-h.sh + $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@ + selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@ diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 9787c66df60..bbc59ef3acf 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -47,10 +47,8 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \ $(top_srcdir)/configure ChangeLog subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \ - $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -174,7 +172,7 @@ LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_FCFLAGS) $(FCFLAGS) FCLD = $(FC) -FCLINK = $(LIBTOOL) --mode=link $(FCLD) $(AM_FFLAGS) $(FCFLAGS) \ +FCLINK = $(LIBTOOL) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -593,7 +591,7 @@ gfor_built_src = $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \ $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \ $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \ $(i_pow_c) \ - selected_int_kind.inc selected_real_kind.inc + selected_int_kind.inc selected_real_kind.inc kinds.h # We only use these if libm doesn't contain complex math functions. @@ -1707,7 +1705,7 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/.. $(distdir)/../config $(distdir)/m4 + $(mkdir_p) $(distdir)/.. $(distdir)/m4 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -1935,6 +1933,9 @@ uninstall-am: uninstall-info-am uninstall-toolexeclibLTLIBRARIES uninstall-toolexeclibLTLIBRARIES +kinds.h: $(srcdir)/mk-kinds-h.sh + $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@ + selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@ diff --git a/libgfortran/aclocal.m4 b/libgfortran/aclocal.m4 index d6fd1920d26..0bf3204f07c 100644 --- a/libgfortran/aclocal.m4 +++ b/libgfortran/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.3 -*- Autoconf -*- +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,23 +11,11 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- @@ -40,26 +28,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.3])]) + [AM_AUTOMAKE_VERSION([1.9.5])]) -# AM_AUX_DIR_EXPAND +# AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to @@ -106,26 +83,16 @@ AC_PREREQ([2.50])dnl am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# AM_CONDITIONAL -*- Autoconf -*- +# AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 6 +# serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -149,30 +116,19 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Do all the work for Automake. -*- Autoconf -*- +# Do all the work for Automake. -*- Autoconf -*- -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# serial 12 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 11 +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) @@ -274,54 +230,52 @@ for _am_header in $config_headers :; do done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# Add --enable-maintainer-mode option to configure. +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 +# serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) @@ -340,27 +294,16 @@ AC_DEFUN([AM_MAINTAINER_MODE], AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) -# -*- Autoconf -*- +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 +# serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -386,27 +329,16 @@ else fi ]) +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). @@ -460,25 +392,14 @@ else fi AC_SUBST([mkdir_p])]) -# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 +# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 4 +# serial 5 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) # --------------------------------------------------- @@ -529,26 +450,15 @@ multi_basedir="$multi_basedir" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} CC="$CC"])])dnl -# Helper functions for option handling. -*- Autoconf -*- +# Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 +# serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -573,28 +483,16 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. # -# Check to make sure that the build environment is sane. -# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 +# serial 4 # AM_SANITY_CHECK # --------------- @@ -637,25 +535,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_INSTALL_STRIP - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip @@ -678,25 +565,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- @@ -784,6 +659,4 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../config/lead-dot.m4]) -m4_include([../config/no-executables.m4]) m4_include([acinclude.m4]) diff --git a/libgfortran/c99_protos.h b/libgfortran/c99_protos.h index 4deb25ceed1..b8cc7406ac2 100644 --- a/libgfortran/c99_protos.h +++ b/libgfortran/c99_protos.h @@ -141,5 +141,9 @@ extern double round(double); extern float roundf(float); #endif +#ifndef HAVE_LOG10L +extern long double log10l(long double); +#endif + #endif /* C99_PROTOS_H */ diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index aaf663ecd33..70700bbfc42 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -135,6 +135,9 @@ /* libm includes log10f */ #undef HAVE_LOG10F +/* libm includes log10l */ +#undef HAVE_LOG10L + /* libm includes logf */ #undef HAVE_LOGF @@ -216,6 +219,9 @@ /* Define to 1 if you have the `strtof' function. */ #undef HAVE_STRTOF +/* Define to 1 if you have the `strtold' function. */ +#undef HAVE_STRTOLD + /* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE diff --git a/libgfortran/configure b/libgfortran/configure index aaaf9f67ea5..65ccbce5ae3 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -1957,7 +1957,7 @@ fi # suite is included, we'll have to know. if test "$build" != "$host"; then LIBGFOR_IS_NATIVE=false - + GCC_NO_EXECUTABLES else LIBGFOR_IS_NATIVE=true fi @@ -2342,39 +2342,6 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} -_ACEOF -# FIXME: Cleanup? -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - gcc_no_link=no -else - gcc_no_link=yes -fi - -if test x$gcc_no_link = xyes; then - # Setting cross_compile will disable run tests; it will - # also disable AC_CHECK_FILE but that's generally - # correct if we can't link. - cross_compiling=yes - EXEEXT= -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - int main () { @@ -2519,7 +2486,6 @@ echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -fi echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then @@ -4123,7 +4089,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4126 "configure"' > conftest.$ac_ext + echo '#line 4092 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4241,12 +4207,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4514,7 +4475,7 @@ fi # Provide some information about the compiler. -echo "$as_me:4517:" \ +echo "$as_me:4478:" \ "checking for Fortran compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5032,13 +4993,7 @@ fi rm -f conftest* fi -if test x$gcc_no_link = xyes; then - if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then - ac_cv_func_mmap_fixed_mapped=no - fi -fi -if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then - ac_ext=c +ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -5686,12 +5641,7 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5959,7 +5909,6 @@ _ACEOF fi rm -f conftest.mmap -fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then @@ -7143,11 +7092,6 @@ if test "${ac_cv_lib_m_csin+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7220,7 +7164,8 @@ fi -for ac_func in getrusage times mkstemp strtof snprintf ftruncate chsize + +for ac_func in getrusage times mkstemp strtof strtold snprintf ftruncate chsize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7228,12 +7173,7 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7342,12 +7282,7 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7450,12 +7385,7 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7557,11 +7487,6 @@ if test "${ac_cv_lib_c_getgid+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7634,11 +7559,6 @@ if test "${ac_cv_lib_c_getpid+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7711,11 +7631,6 @@ if test "${ac_cv_lib_c_getuid+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7791,11 +7706,6 @@ if test "${ac_cv_lib_m_acosf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7868,11 +7778,6 @@ if test "${ac_cv_lib_m_asinf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7945,11 +7850,6 @@ if test "${ac_cv_lib_m_atan2f+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8022,11 +7922,6 @@ if test "${ac_cv_lib_m_atanf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8099,11 +7994,6 @@ if test "${ac_cv_lib_m_ceilf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8176,11 +8066,6 @@ if test "${ac_cv_lib_m_copysignf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8253,11 +8138,6 @@ if test "${ac_cv_lib_m_cosf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8330,11 +8210,6 @@ if test "${ac_cv_lib_m_coshf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8407,11 +8282,6 @@ if test "${ac_cv_lib_m_expf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8484,11 +8354,6 @@ if test "${ac_cv_lib_m_fabsf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8561,11 +8426,6 @@ if test "${ac_cv_lib_m_floorf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8638,11 +8498,6 @@ if test "${ac_cv_lib_m_frexpf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8715,11 +8570,6 @@ if test "${ac_cv_lib_m_hypotf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8792,11 +8642,6 @@ if test "${ac_cv_lib_m_logf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8869,11 +8714,6 @@ if test "${ac_cv_lib_m_log10f+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8939,6 +8779,78 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for log10l in -lm" >&5 +echo $ECHO_N "checking for log10l in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_log10l+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char log10l (); +int +main () +{ +log10l (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_log10l=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_log10l=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_log10l" >&5 +echo "${ECHO_T}$ac_cv_lib_m_log10l" >&6 +if test $ac_cv_lib_m_log10l = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LOG10L 1 +_ACEOF + +fi + echo "$as_me:$LINENO: checking for nextafter in -lm" >&5 echo $ECHO_N "checking for nextafter in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_nextafter+set}" = set; then @@ -8946,11 +8858,6 @@ if test "${ac_cv_lib_m_nextafter+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9023,11 +8930,6 @@ if test "${ac_cv_lib_m_nextafterf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9100,11 +9002,6 @@ if test "${ac_cv_lib_m_powf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9177,11 +9074,6 @@ if test "${ac_cv_lib_m_round+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9254,11 +9146,6 @@ if test "${ac_cv_lib_m_roundf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9331,11 +9218,6 @@ if test "${ac_cv_lib_m_scalbnf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9408,11 +9290,6 @@ if test "${ac_cv_lib_m_scalbn+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9485,11 +9362,6 @@ if test "${ac_cv_lib_m_sinf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9562,11 +9434,6 @@ if test "${ac_cv_lib_m_sinhf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9639,11 +9506,6 @@ if test "${ac_cv_lib_m_sqrtf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9716,11 +9578,6 @@ if test "${ac_cv_lib_m_tanf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9793,11 +9650,6 @@ if test "${ac_cv_lib_m_tanhf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9870,11 +9722,6 @@ if test "${ac_cv_lib_m_trunc+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9947,11 +9794,6 @@ if test "${ac_cv_lib_m_truncf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10024,11 +9866,6 @@ if test "${ac_cv_lib_m_erf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10101,11 +9938,6 @@ if test "${ac_cv_lib_m_erfc+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10178,11 +10010,6 @@ if test "${ac_cv_lib_m_erfcf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10255,11 +10082,6 @@ if test "${ac_cv_lib_m_erff+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10332,11 +10154,6 @@ if test "${ac_cv_lib_m_j0+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10409,11 +10226,6 @@ if test "${ac_cv_lib_m_j0f+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10486,11 +10298,6 @@ if test "${ac_cv_lib_m_j1+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10563,11 +10370,6 @@ if test "${ac_cv_lib_m_j1f+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10640,11 +10442,6 @@ if test "${ac_cv_lib_m_jn+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10717,11 +10514,6 @@ if test "${ac_cv_lib_m_jnf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10794,11 +10586,6 @@ if test "${ac_cv_lib_m_y0+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10871,11 +10658,6 @@ if test "${ac_cv_lib_m_y0f+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -10948,11 +10730,6 @@ if test "${ac_cv_lib_m_y1+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11025,11 +10802,6 @@ if test "${ac_cv_lib_m_y1f+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11102,11 +10874,6 @@ if test "${ac_cv_lib_m_yn+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11179,11 +10946,6 @@ if test "${ac_cv_lib_m_ynf+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11258,11 +11020,6 @@ if test "${ac_cv_lib_m_finite+set}" = set; then else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11422,12 +11179,7 @@ echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11641,12 +11393,7 @@ echo $ECHO_N "checking whether gettimeofday can accept two arguments... $ECHO_C" if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11734,12 +11481,7 @@ else save_CFLAGS="$CFLAGS" CFLAGS="-O2" - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11941,12 +11683,7 @@ if test "${have_attribute_alias+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test x$gcc_no_link = xyes; then - { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 -echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} - { (exit 1); exit 1; }; } -fi -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index c4c70fbc85c..ead10bbd29e 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -169,7 +169,7 @@ AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"]) # Check for library functions. -AC_CHECK_FUNCS(getrusage times mkstemp strtof snprintf ftruncate chsize) +AC_CHECK_FUNCS(getrusage times mkstemp strtof strtold snprintf ftruncate chsize) AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror) AC_CHECK_FUNCS(sleep time) @@ -195,6 +195,7 @@ AC_CHECK_LIB([m],[frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[libm includes frexpf])]) AC_CHECK_LIB([m],[hypotf],[AC_DEFINE([HAVE_HYPOTF],[1],[libm includes hypotf])]) AC_CHECK_LIB([m],[logf],[AC_DEFINE([HAVE_LOGF],[1],[libm includes logf])]) AC_CHECK_LIB([m],[log10f],[AC_DEFINE([HAVE_LOG10F],[1],[libm includes log10f])]) +AC_CHECK_LIB([m],[log10l],[AC_DEFINE([HAVE_LOG10L],[1],[libm includes log10l])]) AC_CHECK_LIB([m],[nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1],[libm includes nextafter])]) AC_CHECK_LIB([m],[nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1],[libm includes nextafterf])]) AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])]) diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c index dfdb71e7427..c4b57207f71 100644 --- a/libgfortran/intrinsics/c99_functions.c +++ b/libgfortran/intrinsics/c99_functions.c @@ -371,3 +371,41 @@ roundf(float x) } } #endif + +#ifndef HAVE_LOG10L +/* log10 function for long double variables. The version provided here + reduces the argument until it fits into a double, then use log10. */ +long double +log10l(long double x) +{ +#if LDBL_MAX_EXP > DBL_MAX_EXP + if (x > DBL_MAX) + { + double val; + int p2_result = 0; + if (x > 0x1p16383L) { p2_result += 16383; x /= 0x1p16383L; } + if (x > 0x1p8191L) { p2_result += 8191; x /= 0x1p8191L; } + if (x > 0x1p4095L) { p2_result += 4095; x /= 0x1p4095L; } + if (x > 0x1p2047L) { p2_result += 2047; x /= 0x1p2047L; } + if (x > 0x1p1023L) { p2_result += 1023; x /= 0x1p1023L; } + val = log10 ((double) x); + return (val + p2_result * .30102999566398119521373889472449302L); + } +#endif +#if LDBL_MIN_EXP < DBL_MIN_EXP + if (x < DBL_MIN) + { + double val; + int p2_result = 0; + if (x < 0x1p-16380L) { p2_result += 16380; x /= 0x1p-16380L; } + if (x < 0x1p-8189L) { p2_result += 8189; x /= 0x1p-8189L; } + if (x < 0x1p-4093L) { p2_result += 4093; x /= 0x1p-4093L; } + if (x < 0x1p-2045L) { p2_result += 2045; x /= 0x1p-2045L; } + if (x < 0x1p-1021L) { p2_result += 1021; x /= 0x1p-1021L; } + val = fabs(log10 ((double) x)); + return (- val - p2_result * .30102999566398119521373889472449302L); + } +#endif + return log10 (x); +} +#endif diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 62000f1ba3d..a301682a62c 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -562,10 +562,10 @@ internal_proto(next_record); /* read.c */ -extern void set_integer (void *, int64_t, int); +extern void set_integer (void *, GFC_INTEGER_LARGEST, int); internal_proto(set_integer); -extern uint64_t max_value (int, int); +extern GFC_UINTEGER_LARGEST max_value (int, int); internal_proto(max_value); extern int convert_real (void *, const char *, int); diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 0a75a982459..3d62d8c845e 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -339,7 +339,7 @@ convert_integer (int length, int negative) { char c, *buffer, message[100]; int m; - int64_t v, max, max10; + GFC_INTEGER_LARGEST v, max, max10; buffer = saved_string; v = 0; diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index 556e0af38b3..2eb68c84498 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -43,21 +43,26 @@ Boston, MA 02111-1307, USA. */ * actually place the value into memory. */ void -set_integer (void *dest, int64_t value, int length) +set_integer (void *dest, GFC_INTEGER_LARGEST value, int length) { switch (length) { +#ifdef HAVE_GFC_INTEGER_16 + case 16: + *((GFC_INTEGER_16 *) dest) = value; + break; +#endif case 8: - *((int64_t *) dest) = value; + *((GFC_INTEGER_8 *) dest) = value; break; case 4: - *((int32_t *) dest) = value; + *((GFC_INTEGER_4 *) dest) = value; break; case 2: - *((int16_t *) dest) = value; + *((GFC_INTEGER_2 *) dest) = value; break; case 1: - *((int8_t *) dest) = value; + *((GFC_INTEGER_1 *) dest) = value; break; default: internal_error ("Bad integer kind"); @@ -68,13 +73,24 @@ set_integer (void *dest, int64_t value, int length) /* max_value()-- Given a length (kind), return the maximum signed or * unsigned value */ -uint64_t +GFC_UINTEGER_LARGEST max_value (int length, int signed_flag) { - uint64_t value; + GFC_UINTEGER_LARGEST value; + int n; switch (length) { +#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10 + case 16: + case 10: + value = 1; + for (n = 1; n < 4 * length; n++) + value = (value << 2) + 3; + if (! signed_flag) + value = 2*value+1; + break; +#endif case 8: value = signed_flag ? 0x7fffffffffffffff : 0xffffffffffffffff; break; @@ -108,16 +124,26 @@ convert_real (void *dest, const char *buffer, int length) switch (length) { case 4: - *((float *) dest) = + *((GFC_REAL_4 *) dest) = #if defined(HAVE_STRTOF) strtof (buffer, NULL); #else - (float) strtod (buffer, NULL); + (GFC_REAL_4) strtod (buffer, NULL); #endif break; case 8: - *((double *) dest) = strtod (buffer, NULL); + *((GFC_REAL_8 *) dest) = strtod (buffer, NULL); break; +#if defined(HAVE_GFC_REAL_10) && defined (HAVE_STRTOLD) + case 10: + *((GFC_REAL_10 *) dest) = strtold (buffer, NULL); + break; +#endif +#if defined(HAVE_GFC_REAL_16) && defined (HAVE_STRTOLD) + case 16: + *((GFC_REAL_16 *) dest) = strtold (buffer, NULL); + break; +#endif default: internal_error ("Unsupported real kind during IO"); } @@ -164,11 +190,11 @@ read_l (fnode * f, char *dest, int length) { case 't': case 'T': - set_integer (dest, 1, length); + set_integer (dest, (GFC_INTEGER_LARGEST) 1, length); break; case 'f': case 'F': - set_integer (dest, 0, length); + set_integer (dest, (GFC_INTEGER_LARGEST) 0, length); break; default: bad: @@ -263,8 +289,9 @@ next_char (char **p, int *w) void read_decimal (fnode * f, char *dest, int length) { - unsigned value, maxv, maxv_10; - int v, w, negative; + GFC_UINTEGER_LARGEST value, maxv, maxv_10; + GFC_INTEGER_LARGEST v; + int w, negative; char c, *p; w = f->u.w; @@ -275,7 +302,7 @@ read_decimal (fnode * f, char *dest, int length) p = eat_leading_spaces (&w, p); if (w == 0) { - set_integer (dest, 0, length); + set_integer (dest, (GFC_INTEGER_LARGEST) 0, length); return; } @@ -324,7 +351,7 @@ read_decimal (fnode * f, char *dest, int length) value += c; } - v = (signed int) value; + v = value; if (negative) v = -v; @@ -350,8 +377,9 @@ read_decimal (fnode * f, char *dest, int length) void read_radix (fnode * f, char *dest, int length, int radix) { - unsigned value, maxv, maxv_r; - int v, w, negative; + GFC_UINTEGER_LARGEST value, maxv, maxv_r; + GFC_INTEGER_LARGEST v; + int w, negative; char c, *p; w = f->u.w; @@ -362,7 +390,7 @@ read_radix (fnode * f, char *dest, int length, int radix) p = eat_leading_spaces (&w, p); if (w == 0) { - set_integer (dest, 0, length); + set_integer (dest, (GFC_INTEGER_LARGEST) 0, length); return; } @@ -460,7 +488,7 @@ read_radix (fnode * f, char *dest, int length, int radix) value += c; } - v = (signed int) value; + v = value; if (negative) v = -v; @@ -594,13 +622,25 @@ read_f (fnode * f, char *dest, int length) switch (length) { case 4: - *((float *) dest) = 0.0f; + *((GFC_REAL_4 *) dest) = 0; break; case 8: - *((double *) dest) = 0.0; + *((GFC_REAL_8 *) dest) = 0; break; +#ifdef HAVE_GFC_REAL_10 + case 10: + *((GFC_REAL_10 *) dest) = 0; + break; +#endif + +#ifdef HAVE_GFC_REAL_16 + case 16: + *((GFC_REAL_16 *) dest) = 0; + break; +#endif + default: internal_error ("Unsupported real kind during IO"); } diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 793031a9375..0e2a3ac5ccd 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -37,7 +37,6 @@ Boston, MA 02111-1307, USA. */ #include "libgfortran.h" #include "io.h" - #define star_fill(p, n) memset(p, '*', n) @@ -69,10 +68,10 @@ write_a (fnode * f, const char *source, int len) } } -static int64_t +static GFC_INTEGER_LARGEST extract_int (const void *p, int len) { - int64_t i = 0; + GFC_INTEGER_LARGEST i = 0; if (p == NULL) return i; @@ -80,17 +79,22 @@ extract_int (const void *p, int len) switch (len) { case 1: - i = *((const int8_t *) p); + i = *((const GFC_INTEGER_1 *) p); break; case 2: - i = *((const int16_t *) p); + i = *((const GFC_INTEGER_2 *) p); break; case 4: - i = *((const int32_t *) p); + i = *((const GFC_INTEGER_4 *) p); break; case 8: - i = *((const int64_t *) p); + i = *((const GFC_INTEGER_8 *) p); break; +#ifdef HAVE_GFC_INTEGER_16 + case 16: + i = *((const GFC_INTEGER_16 *) p); + break; +#endif default: internal_error ("bad integer kind"); } @@ -98,23 +102,32 @@ extract_int (const void *p, int len) return i; } -static double +static GFC_REAL_LARGEST extract_real (const void *p, int len) { - double i = 0.0; + GFC_REAL_LARGEST i = 0; switch (len) { case 4: - i = *((const float *) p); + i = *((const GFC_REAL_4 *) p); break; case 8: - i = *((const double *) p); + i = *((const GFC_REAL_8 *) p); break; +#ifdef HAVE_GFC_REAL_10 + case 10: + i = *((const GFC_REAL_10 *) p); + break; +#endif +#ifdef HAVE_GFC_REAL_16 + case 16: + i = *((const GFC_REAL_16 *) p); + break; +#endif default: internal_error ("bad real kind"); } return i; - } @@ -148,11 +161,11 @@ calculate_sign (int negative_flag) /* Returns the value of 10**d. */ -static double +static GFC_REAL_LARGEST calculate_exp (int d) { int i; - double r = 1.0; + GFC_REAL_LARGEST r = 1.0; for (i = 0; i< (d >= 0 ? d : -d); i++) r *= 10; @@ -181,13 +194,13 @@ calculate_exp (int d) for Gw.dEe, n' ' means e+2 blanks */ static fnode * -calculate_G_format (fnode *f, double value, int *num_blank) +calculate_G_format (fnode *f, GFC_REAL_LARGEST value, int *num_blank) { int e = f->u.real.e; int d = f->u.real.d; int w = f->u.real.w; fnode *newf; - double m, exp_d; + GFC_REAL_LARGEST m, exp_d; int low, high, mid; int ubound, lbound; @@ -199,8 +212,7 @@ calculate_G_format (fnode *f, double value, int *num_blank) /* In case of the two data magnitude ranges, generate E editing, Ew.d[Ee]. */ exp_d = calculate_exp (d); - if ((m > 0.0 && m < 0.1 - 0.05 / (double) exp_d) - || (m >= (double) exp_d - 0.5 )) + if ((m > 0.0 && m < 0.1 - 0.05 / exp_d) || (m >= exp_d - 0.5 )) { newf->format = FMT_E; newf->u.real.w = w; @@ -219,7 +231,7 @@ calculate_G_format (fnode *f, double value, int *num_blank) while (low <= high) { - double temp; + GFC_REAL_LARGEST temp; mid = (low + high) / 2; /* 0.1 * 10**mid - 0.5 * 10**(mid-d-1) */ @@ -271,7 +283,7 @@ calculate_G_format (fnode *f, double value, int *num_blank) /* Output a real number according to its format which is FMT_G free. */ static void -output_float (fnode *f, double value) +output_float (fnode *f, GFC_REAL_LARGEST value) { /* This must be large enough to accurately hold any value. */ char buffer[32]; @@ -321,11 +333,15 @@ output_float (fnode *f, double value) edigits = 2; else { - abslog = fabs(log10 (value)); +#if defined(HAVE_GFC_REAL_10) || defined(HAVE_GFC_REAL_16) + abslog = fabs((double) log10l(value)); +#else + abslog = fabs(log10(value)); +#endif if (abslog < 100) edigits = 2; else - edigits = 1 + (int) log10 (abslog); + edigits = 1 + (int) log10(abslog); } if (ft == FMT_F || ft == FMT_EN @@ -346,7 +362,24 @@ output_float (fnode *f, double value) ndigits = 27 - edigits; } - sprintf (buffer, "%+-#31.*e", ndigits - 1, value); + /* # The result will always contain a decimal point, even if no + * digits follow it + * + * - The converted value is to be left adjusted on the field boundary + * + * + A sign (+ or -) always be placed before a number + * + * 31 minimum field width + * + * * (ndigits-1) is used as the precision + * + * e format: [-]d.ddde±dd where there is one digit before the + * decimal-point character and the number of digits after it is + * equal to the precision. The exponent always contains at least two + * digits; if the value is zero, the exponent is 00. + */ + sprintf (buffer, "%+-#31.*" GFC_REAL_LARGEST_FORMAT "e", + ndigits - 1, value); /* Check the resulting string has punctuation in the correct places. */ if (buffer[2] != '.' || buffer[ndigits + 2] != 'e') @@ -673,7 +706,7 @@ void write_l (fnode * f, char *source, int len) { char *p; - int64_t n; + GFC_INTEGER_LARGEST n; p = write_block (f->u.w); if (p == NULL) @@ -689,7 +722,7 @@ write_l (fnode * f, char *source, int len) static void write_float (fnode *f, const char *source, int len) { - double n; + GFC_REAL_LARGEST n; int nb =0, res, save_scale_factor; char * p, fin; fnode *f2 = NULL; @@ -698,7 +731,10 @@ write_float (fnode *f, const char *source, int len) if (f->format != FMT_B && f->format != FMT_O && f->format != FMT_Z) { - res = isfinite (n); + /* TODO: there are some systems where isfinite is not able to work + with long double variables. We should detect this case and + provide our own version for isfinite. */ + res = isfinite (n); if (res == 0) { nb = f->u.real.w; @@ -756,10 +792,10 @@ write_float (fnode *f, const char *source, int len) static void -write_int (fnode *f, const char *source, int len, char *(*conv) (uint64_t)) +write_int (fnode *f, const char *source, int len, + char *(*conv) (GFC_UINTEGER_LARGEST)) { - uint32_t ns =0; - uint64_t n = 0; + GFC_UINTEGER_LARGEST n = 0; int w, m, digits, nzero, nblank; char *p, *q; @@ -783,15 +819,7 @@ write_int (fnode *f, const char *source, int len, char *(*conv) (uint64_t)) goto done; } - - if (len < 8) - { - ns = n; - q = conv (ns); - } - else - q = conv (n); - + q = conv (n); digits = strlen (q); /* Select a width if none was specified. The idea here is to always @@ -842,9 +870,10 @@ write_int (fnode *f, const char *source, int len, char *(*conv) (uint64_t)) } static void -write_decimal (fnode *f, const char *source, int len, char *(*conv) (int64_t)) +write_decimal (fnode *f, const char *source, int len, + char *(*conv) (GFC_INTEGER_LARGEST)) { - int64_t n = 0; + GFC_INTEGER_LARGEST n = 0; int w, m, digits, nsign, nzero, nblank; char *p, *q; sign_t sign; @@ -930,7 +959,7 @@ write_decimal (fnode *f, const char *source, int len, char *(*conv) (int64_t)) /* Convert unsigned octal to ascii. */ static char * -otoa (uint64_t n) +otoa (GFC_UINTEGER_LARGEST n) { char *p; @@ -958,7 +987,7 @@ otoa (uint64_t n) /* Convert unsigned binary to ascii. */ static char * -btoa (uint64_t n) +btoa (GFC_UINTEGER_LARGEST n) { char *p; diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index e5485d1ba8b..0064edf68a0 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -197,20 +197,7 @@ isfinite (double x) #define IMAGPART(z) (__imag__(z)) #define COMPLEX_ASSIGN(z_, r_, i_) {__real__(z_) = (r_); __imag__(z_) = (i_);} -typedef int8_t GFC_INTEGER_1; -typedef int16_t GFC_INTEGER_2; -typedef int32_t GFC_INTEGER_4; -typedef int64_t GFC_INTEGER_8; -typedef uint8_t GFC_UINTEGER_1; -typedef uint16_t GFC_UINTEGER_2; -typedef uint32_t GFC_UINTEGER_4; -typedef uint64_t GFC_UINTEGER_8; -typedef GFC_INTEGER_4 GFC_LOGICAL_4; -typedef GFC_INTEGER_8 GFC_LOGICAL_8; -typedef float GFC_REAL_4; -typedef double GFC_REAL_8; -typedef complex float GFC_COMPLEX_4; -typedef complex double GFC_COMPLEX_8; +#include "kinds.h" /* The following two definitions must be consistent with the types used by the compiler. */ @@ -384,10 +371,10 @@ internal_proto(get_args); /* error.c */ -extern char *gfc_itoa (int64_t); +extern char *gfc_itoa (GFC_INTEGER_LARGEST); internal_proto(gfc_itoa); -extern char *xtoa (uint64_t); +extern char *xtoa (GFC_UINTEGER_LARGEST); internal_proto(xtoa); extern void os_error (const char *) __attribute__ ((noreturn)); diff --git a/libgfortran/mk-kinds-h.sh b/libgfortran/mk-kinds-h.sh new file mode 100755 index 00000000000..6f292bf48a8 --- /dev/null +++ b/libgfortran/mk-kinds-h.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +compile="$1" + +# Possible types must be listed in ascending order +possible_integer_kinds="1 2 4 8 16" +possible_real_kinds="4 8 10 16" + + +largest="" +for k in $possible_integer_kinds; do + echo " integer (kind=$k) :: i" > tmp$$.f90 + echo " end" >> tmp$$.f90 + if $compile -c tmp$$.f90 > /dev/null 2>&1; then + s=`expr 8 \* $k` + largest="$k" + + if [ $s -eq 128 ]; then + prefix="__" + else + prefix="" + fi + + echo "typedef ${prefix}int${s}_t GFC_INTEGER_${k};" + echo "typedef ${prefix}uint${s}_t GFC_UINTEGER_${k};" + echo "typedef GFC_INTEGER_${k} GFC_LOGICAL_${k};" + echo "#define HAVE_GFC_INTEGER_${k}" + fi + rm -f tmp$$.* +done + +echo "#define GFC_INTEGER_LARGEST GFC_INTEGER_${largest}" +echo "#define GFC_UINTEGER_LARGEST GFC_UINTEGER_${largest}" +echo "" + + +largest_ctype="" +for k in $possible_real_kinds; do + echo " real (kind=$k) :: x" > tmp$$.f90 + echo " end" >> tmp$$.f90 + if $compile -c tmp$$.f90 > /dev/null 2>&1; then + case $k in + 4) ctype="float" ;; + 8) ctype="double" ;; + 10) ctype="long double" ;; + 16) ctype="long double" ;; + *) echo "$0: Unknown type" >&2 ; exit 1 ;; + esac + largest_ctype="$ctype" + echo "typedef ${ctype} GFC_REAL_${k};" + echo "typedef complex ${ctype} GFC_COMPLEX_${k};" + echo "#define HAVE_GFC_REAL_${k}" + fi + rm -f tmp$$.* +done + +case $largest_ctype in + float) echo "#define GFC_REAL_LARGEST_FORMAT \"\"" ;; + double) echo "#define GFC_REAL_LARGEST_FORMAT \"l\"" ;; + "long double") echo "#define GFC_REAL_LARGEST_FORMAT \"L\"" ;; + *) echo "$0: Unknown type" >&2 ; exit 1 ;; +esac +echo "#define GFC_REAL_LARGEST $largest_ctype" + +exit 0 diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 5cb02aa8d5f..8b42041967a 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -69,11 +69,11 @@ static char buffer[32]; /* buffer for integer/ascii conversions */ /* Returns a pointer to a static buffer. */ char * -gfc_itoa (int64_t n) +gfc_itoa (GFC_INTEGER_LARGEST n) { int negative; char *p; - uint64_t t; + GFC_UINTEGER_LARGEST t; if (n == 0) { @@ -109,7 +109,7 @@ gfc_itoa (int64_t n) * static buffer. */ char * -xtoa (uint64_t n) +xtoa (GFC_UINTEGER_LARGEST n) { int digit; char *p;