2004-05-31 05:58:10 +08:00
|
|
|
# Process this file with autoconf to produce a configure script, like so:
|
|
|
|
# aclocal && autoconf && autoheader && automake
|
|
|
|
|
|
|
|
AC_PREREQ(2.59)
|
|
|
|
AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
|
|
|
|
# -------
|
|
|
|
# Options
|
|
|
|
# -------
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
|
|
|
AC_ARG_ENABLE(version-specific-runtime-libs,
|
|
|
|
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
|
|
|
|
[case "$enableval" in
|
|
|
|
yes) version_specific_libs=yes ;;
|
|
|
|
no) version_specific_libs=no ;;
|
|
|
|
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
|
|
|
esac],
|
|
|
|
[version_specific_libs=no])
|
|
|
|
AC_MSG_RESULT($version_specific_libs)
|
|
|
|
|
|
|
|
|
|
|
|
# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
|
|
|
|
#
|
|
|
|
# You will slowly go insane if you do not grok the following fact: when
|
|
|
|
# building this library, the top-level /target/ becomes the library's /host/.
|
|
|
|
#
|
|
|
|
# configure then causes --target to default to --host, exactly like any
|
|
|
|
# other package using autoconf. Therefore, 'target' and 'host' will
|
|
|
|
# always be the same. This makes sense both for native and cross compilers
|
|
|
|
# just think about it for a little while. :-)
|
|
|
|
#
|
|
|
|
# Also, if this library is being configured as part of a cross compiler, the
|
|
|
|
# top-level configure script will pass the "real" host as $with_cross_host.
|
|
|
|
#
|
|
|
|
# Do not delete or change the following two lines. For why, see
|
|
|
|
# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
target_alias=${target_alias-$host_alias}
|
|
|
|
|
|
|
|
# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
|
|
|
|
# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
|
|
|
|
# 1.8.2: minimum required version
|
|
|
|
# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
|
|
|
|
# of other PACKAGE_* variables will, however, and there's nothing
|
|
|
|
# we can do about that; they come from AC_INIT).
|
|
|
|
# foreign: we don't follow the normal rules for GNU packages (no COPYING
|
|
|
|
# file in the top srcdir, etc, etc), so stop complaining.
|
|
|
|
# no-dependencies: turns off auto dependency generation (just for now)
|
|
|
|
# -Wall: turns on all automake warnings...
|
|
|
|
# -Wno-portability: ...except this one, since GNU make is required.
|
|
|
|
AM_INIT_AUTOMAKE([1.8.2 no-define foreign no-dependencies -Wall -Wno-portability])
|
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
AM_ENABLE_MULTILIB(, ..)
|
|
|
|
|
|
|
|
# Handy for debugging:
|
|
|
|
#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
|
|
|
|
|
|
|
|
# Are we being configured with some form of cross compiler?
|
|
|
|
# NB: We don't actually need to know this just now, but when, say, a test
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Calculate toolexeclibdir
|
|
|
|
# Also toolexecdir, though it's only used in toolexeclibdir
|
|
|
|
case ${version_specific_libs} in
|
|
|
|
yes)
|
|
|
|
# Need the gcc compiler version to know where to install libraries
|
|
|
|
# and header files if --enable-version-specific-runtime-libs option
|
|
|
|
# is selected.
|
|
|
|
toolexecdir='$(libdir)/gcc/$(target_alias)'
|
2005-03-22 01:46:19 +08:00
|
|
|
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
2004-05-31 05:58:10 +08:00
|
|
|
;;
|
|
|
|
no)
|
|
|
|
if test -n "$with_cross_host" &&
|
|
|
|
test x"$with_cross_host" != x"no"; then
|
|
|
|
# Install a library built with a cross compiler in tooldir, not libdir.
|
|
|
|
toolexecdir='$(exec_prefix)/$(target_alias)'
|
|
|
|
toolexeclibdir='$(toolexecdir)/lib'
|
|
|
|
else
|
|
|
|
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
|
|
|
toolexeclibdir='$(libdir)'
|
|
|
|
fi
|
|
|
|
multi_os_directory=`$CC -print-multi-os-directory`
|
|
|
|
case $multi_os_directory in
|
|
|
|
.) ;; # Avoid trailing /.
|
|
|
|
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(toolexecdir)
|
|
|
|
AC_SUBST(toolexeclibdir)
|
|
|
|
|
|
|
|
# Check the compiler.
|
|
|
|
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
|
|
|
|
# We must force CC to /not/ be precious variables; otherwise
|
|
|
|
# the wrong, non-multilib-adjusted value will be used in multilibs.
|
|
|
|
# As a side effect, we have to subst CFLAGS ourselves.
|
|
|
|
|
|
|
|
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
|
|
|
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
|
|
|
AC_PROG_CC
|
|
|
|
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
|
|
|
|
|
|
|
# Add -Wall if we are using GCC.
|
|
|
|
if test "x$GCC" = "xyes"; then
|
2005-05-15 23:37:18 +08:00
|
|
|
AM_FCFLAGS="-Wall"
|
|
|
|
## We like to use C99 routines when available. This makes sure that
|
|
|
|
## __STDC_VERSION__ is set such that libc includes make them available.
|
2005-05-18 00:54:58 +08:00
|
|
|
AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
|
2004-05-31 05:58:10 +08:00
|
|
|
fi
|
2005-05-15 23:37:18 +08:00
|
|
|
AC_SUBST(AM_FCFLAGS)
|
|
|
|
AC_SUBST(AM_CFLAGS)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
|
|
# Find other programs we need.
|
|
|
|
AC_CHECK_TOOL(AS, as)
|
|
|
|
AC_CHECK_TOOL(AR, ar)
|
|
|
|
AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
# Configure libtool
|
|
|
|
#AC_MSG_NOTICE([====== Starting libtool configuration])
|
|
|
|
AC_LIBTOOL_DLOPEN
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
AC_SUBST(enable_shared)
|
|
|
|
AC_SUBST(enable_static)
|
|
|
|
#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
|
|
|
|
|
|
|
|
# We need gfortran to compile parts of the library
|
2004-11-05 20:50:53 +08:00
|
|
|
# We can't use AC_PROG_FC because it expects a fully working gfortran.
|
|
|
|
#AC_PROG_FC(gfortran)
|
|
|
|
FC="$GFORTRAN"
|
|
|
|
AC_PROG_FC(gfortran)
|
|
|
|
FCFLAGS="$FCFLAGS -Wall -fno-repack-arrays -fno-underscoring"
|
2004-05-31 05:58:10 +08:00
|
|
|
|
2005-04-08 05:06:27 +08:00
|
|
|
# extra LD Flags which are required for targets
|
|
|
|
case "${host}" in
|
|
|
|
*-darwin*)
|
|
|
|
# Darwin needs -single_module when linking libgfortran
|
|
|
|
extra_ldflags_libgfortran=-Wl,-single_module
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(extra_ldflags_libgfortran)
|
|
|
|
|
2004-07-18 20:46:39 +08:00
|
|
|
AC_SYS_LARGEFILE
|
2004-05-31 05:58:10 +08:00
|
|
|
AC_FUNC_MMAP
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
|
|
|
|
# check header files
|
|
|
|
AC_STDC_HEADERS
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-23 06:08:22 +08:00
|
|
|
AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h signal.h)
|
2004-05-31 05:58:10 +08:00
|
|
|
AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
|
2004-12-08 07:43:40 +08:00
|
|
|
AC_CHECK_HEADERS(sys/mman.h sys/types.h sys/stat.h ieeefp.h)
|
2004-05-31 05:58:10 +08:00
|
|
|
AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
|
|
|
|
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 12:10:26 +08:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_blksize])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_blocks])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_rdev])
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
# Check for complex math functions
|
|
|
|
AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
|
|
|
|
|
|
|
|
# Check for library functions.
|
2005-06-24 02:50:25 +08:00
|
|
|
AC_CHECK_FUNCS(getrusage times mkstemp strtof strtold snprintf ftruncate chsize)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-23 06:08:22 +08:00
|
|
|
AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
|
|
|
|
AC_CHECK_FUNCS(sleep time)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
2004-08-29 07:43:41 +08:00
|
|
|
# Check libc for getgid, getpid, getuid
|
|
|
|
AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
|
|
|
|
AC_CHECK_LIB([c],[getpid],[AC_DEFINE([HAVE_GETPID],[1],[libc includes getpid])])
|
|
|
|
AC_CHECK_LIB([c],[getuid],[AC_DEFINE([HAVE_GETUID],[1],[libc includes getuid])])
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
# Check for C99 (and other IEEE) math functions
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 23:58:16 +08:00
|
|
|
# ??? This list seems awful long. Is there a better way to test for these?
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
|
2005-06-25 07:07:13 +08:00
|
|
|
AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
|
2005-06-25 07:07:13 +08:00
|
|
|
AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
|
|
|
|
AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
|
2005-06-25 07:07:13 +08:00
|
|
|
AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[ceilf],[AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
|
|
|
|
AC_CHECK_LIB([m],[copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[libm includes copysignf])])
|
|
|
|
AC_CHECK_LIB([m],[cosf],[AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
|
|
|
|
AC_CHECK_LIB([m],[coshf],[AC_DEFINE([HAVE_COSHF],[1],[libm includes coshf])])
|
|
|
|
AC_CHECK_LIB([m],[expf],[AC_DEFINE([HAVE_EXPF],[1],[libm includes expf])])
|
2004-12-08 07:43:40 +08:00
|
|
|
AC_CHECK_LIB([m],[fabsf],[AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[floorf],[AC_DEFINE([HAVE_FLOORF],[1],[libm includes floorf])])
|
|
|
|
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])])
|
2005-06-24 02:50:25 +08:00
|
|
|
AC_CHECK_LIB([m],[log10l],[AC_DEFINE([HAVE_LOG10L],[1],[libm includes log10l])])
|
2004-06-14 06:58:30 +08:00
|
|
|
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])])
|
2004-09-26 22:52:04 +08:00
|
|
|
AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])])
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
|
|
|
|
AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
|
|
|
|
AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
|
2005-06-15 16:40:35 +08:00
|
|
|
AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
|
|
|
|
AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
|
|
|
|
AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
|
|
|
|
AC_CHECK_LIB([m],[tanf],[AC_DEFINE([HAVE_TANF],[1],[libm includes tanf])])
|
|
|
|
AC_CHECK_LIB([m],[tanhf],[AC_DEFINE([HAVE_TANHF],[1],[libm includes tanhf])])
|
2005-05-21 14:44:50 +08:00
|
|
|
AC_CHECK_LIB([m],[trunc],[AC_DEFINE([HAVE_TRUNC],[1],[libm includes trunc])])
|
|
|
|
AC_CHECK_LIB([m],[truncf],[AC_DEFINE([HAVE_TRUNCF],[1],[libm includes truncf])])
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 23:58:16 +08:00
|
|
|
AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])])
|
|
|
|
AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])])
|
|
|
|
AC_CHECK_LIB([m],[erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[libm includes erfcf])])
|
|
|
|
AC_CHECK_LIB([m],[erff],[AC_DEFINE([HAVE_ERFF],[1],[libm includes erff])])
|
|
|
|
AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
|
|
|
|
AC_CHECK_LIB([m],[j0f],[AC_DEFINE([HAVE_J0F],[1],[libm includes j0f])])
|
|
|
|
AC_CHECK_LIB([m],[j1],[AC_DEFINE([HAVE_J1],[1],[libm includes j1])])
|
|
|
|
AC_CHECK_LIB([m],[j1f],[AC_DEFINE([HAVE_J1F],[1],[libm includes j1f])])
|
|
|
|
AC_CHECK_LIB([m],[jn],[AC_DEFINE([HAVE_JN],[1],[libm includes jn])])
|
|
|
|
AC_CHECK_LIB([m],[jnf],[AC_DEFINE([HAVE_JNF],[1],[libm includes jnf])])
|
|
|
|
AC_CHECK_LIB([m],[y0],[AC_DEFINE([HAVE_Y0],[1],[libm includes y0])])
|
|
|
|
AC_CHECK_LIB([m],[y0f],[AC_DEFINE([HAVE_Y0F],[1],[libm includes y0f])])
|
|
|
|
AC_CHECK_LIB([m],[y1],[AC_DEFINE([HAVE_Y1],[1],[libm includes y1])])
|
|
|
|
AC_CHECK_LIB([m],[y1f],[AC_DEFINE([HAVE_Y1F],[1],[libm includes y1f])])
|
|
|
|
AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
|
|
|
|
AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
|
2004-06-13 01:59:30 +08:00
|
|
|
|
2004-11-23 10:02:38 +08:00
|
|
|
# Fallback in case isfinite is not available.
|
|
|
|
AC_CHECK_LIB([m],[finite],[AC_DEFINE([HAVE_FINITE],[1],[libm includes finite])])
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
# Let the user override this
|
|
|
|
AC_ARG_ENABLE(cmath,
|
|
|
|
AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
|
|
|
|
[need_math=$enableval])
|
|
|
|
if test "$need_math" = "yes"; then
|
|
|
|
AC_MSG_NOTICE([Including complex math functions in libgfor]);
|
|
|
|
extra_math_obj='$(gfor_cmath_obj)'
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST([MATH_OBJ],["$extra_math_obj"])
|
|
|
|
|
|
|
|
# The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check
|
|
|
|
# for struct timezone, as you might think. We also need to check how
|
|
|
|
# to call gettimeofday if we have it.
|
|
|
|
LIBGFOR_GETTIMEOFDAY
|
|
|
|
|
2004-11-20 21:15:17 +08:00
|
|
|
# Attempt to assert that the target is of common type in case we don't
|
|
|
|
# have C99 integer types at all.
|
|
|
|
LIBGFOR_TARGET_ILP32
|
|
|
|
|
acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
* acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
(LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New.
(LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New.
* configure.ac: Use them.
* configure, config.h.in, aclocal.m4: Rebuild.
* libgfortran.h (prefix): Remove.
(PREFIX, IPREFIX): New.
(sym_rename, sym_rename1, sym_rename2): New.
(internal_proto, export_proto, export_proto_np): New.
(iexport_proto, iexport): New.
(iexport_data_proto, iexport_data): New.
* intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c,
intrinsics/cpu_time.c, intrinsics/cshift0.c,
intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c,
intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c,
intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c,
intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c,
intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c,
intrinsics/reshape_generic.c, intrinsics/size.c,
intrinsics/spread_generic.c, intrinsics/stat.c,
intrinsics/string_intrinsics.c, intrinsics/system.c,
intrinsics/system_clock.c, intrinsics/transpose_generic.c,
intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c,
io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h,
io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, m4/cshift1.m4,
m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4,
m4/eoshift3.m4, m4/exponent.m4, m4/fraction.m4, m4/iforeach.m4,
m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4,
m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4,
m4/transpose.m4, runtime/environ.c, runtime/error.c,
runtime/in_pack_generic.c, runtime/in_unpack_generic.c,
runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c,
runtime/stop.c: Use them to mark symbols internal or external.
* generated/*: Rebuild.
From-SVN: r92045
2004-12-12 16:59:05 +08:00
|
|
|
# Check out attribute support.
|
|
|
|
LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
|
|
|
|
LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
|
|
|
|
LIBGFOR_CHECK_ATTRIBUTE_ALIAS
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
AC_CACHE_SAVE
|
|
|
|
|
|
|
|
if test ${multilib} = yes; then
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
else
|
|
|
|
multilib_arg=
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Write our Makefile.
|
|
|
|
AC_CONFIG_FILES(Makefile)
|
|
|
|
AC_OUTPUT
|