+2005-06-23 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * 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 <kazu@codesourcery.com>
PR tree-optimization/22117
--- /dev/null
+! { 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
--- /dev/null
+! { 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
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.
+2005-06-23 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * 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 <jblomqvi@cc.hut.fi>
* unix.c (stream_at_bof): Don't assume that all non-mmapped files
$(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.
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)' > $@
-# 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.
$(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 \
$(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)
$(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.
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 \
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)' > $@
-# 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.
# 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)
# ----------------------------
# 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
am_aux_dir=`cd $ac_aux_dir && pwd`
])
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+# AM_CONDITIONAL -*- Autoconf -*-
-# 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) 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.
-# serial 6
+# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
Usually this means the macro was only invoked conditionally.]])
fi])])
-# 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.
+# Do all the work for Automake. -*- Autoconf -*-
-# 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.
-
-# 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 12
-# 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])
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.
-# From Jim Meyering
+# 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.
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# serial 2
-# 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.
+# 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])])
-# 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.
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
-# 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) 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.
-# serial 3
+# serial 4
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-# -*- Autoconf -*-
-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# 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) 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.
-# serial 3
+# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
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).
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])
# ---------------------------------------------------
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.
-
-# 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, 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.
-# serial 2
+# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-#
-# Check to make sure that the build environment is sane.
-#
-
-# 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.
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# 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) 1996, 1997, 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.
-# serial 3
+# serial 4
# AM_SANITY_CHECK
# ---------------
fi
AC_MSG_RESULT(yes)])
-# 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.
+# 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
+# ---------------------
# 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
# 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)
# --------------------
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-m4_include([../config/lead-dot.m4])
-m4_include([../config/no-executables.m4])
m4_include([acinclude.m4])
extern float roundf(float);
#endif
+#ifndef HAVE_LOG10L
+extern long double log10l(long double);
+#endif
+
#endif /* C99_PROTOS_H */
/* libm includes log10f */
#undef HAVE_LOG10F
+/* libm includes log10l */
+#undef HAVE_LOG10L
+
/* libm includes logf */
#undef HAVE_LOGF
/* 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
# 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
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 ()
{
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
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=$?
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
# 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 </dev/null >&5\"") >&5
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'
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
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
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
-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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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])])
}
}
#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
/* 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);
{
char c, *buffer, message[100];
int m;
- int64_t v, max, max10;
+ GFC_INTEGER_LARGEST v, max, max10;
buffer = saved_string;
v = 0;
* 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");
/* 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;
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");
}
{
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:
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;
p = eat_leading_spaces (&w, p);
if (w == 0)
{
- set_integer (dest, 0, length);
+ set_integer (dest, (GFC_INTEGER_LARGEST) 0, length);
return;
}
value += c;
}
- v = (signed int) value;
+ v = value;
if (negative)
v = -v;
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;
p = eat_leading_spaces (&w, p);
if (w == 0)
{
- set_integer (dest, 0, length);
+ set_integer (dest, (GFC_INTEGER_LARGEST) 0, length);
return;
}
value += c;
}
- v = (signed int) value;
+ v = value;
if (negative)
v = -v;
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");
#include "libgfortran.h"
#include "io.h"
-
#define star_fill(p, n) memset(p, '*', n)
}
}
-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;
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");
}
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;
-
}
/* 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;
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;
/* 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;
while (low <= high)
{
- double temp;
+ GFC_REAL_LARGEST temp;
mid = (low + high) / 2;
/* 0.1 * 10**mid - 0.5 * 10**(mid-d-1) */
/* 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];
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
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')
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)
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;
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;
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;
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
}
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;
/* Convert unsigned octal to ascii. */
static char *
-otoa (uint64_t n)
+otoa (GFC_UINTEGER_LARGEST n)
{
char *p;
/* Convert unsigned binary to ascii. */
static char *
-btoa (uint64_t n)
+btoa (GFC_UINTEGER_LARGEST n)
{
char *p;
#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. */
/* 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));
--- /dev/null
+#!/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
/* 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)
{
* static buffer. */
char *
-xtoa (uint64_t n)
+xtoa (GFC_UINTEGER_LARGEST n)
{
int digit;
char *p;