LIBGFOR_IS_NATIVE=true
fi
-# Process the option "--enable-version-specific-runtime-libs"
-gcc_version_trigger=${srcdir}/../gcc/version.c
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-AC_SUBST(gcc_version)
-
# Calculate toolexeclibdir
# Also toolexecdir, though it's only used in toolexeclibdir
case ${version_specific_libs} in
# and header files if --enable-version-specific-runtime-libs option
# is selected.
toolexecdir='$(libdir)/gcc/$(target_alias)'
- toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
;;
no)
if test -n "$with_cross_host" &&
AC_PROG_CC
m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
-AC_SUBST(CFLAGS)
-
# Add -Wall if we are using GCC.
if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -Wall"
+ 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.
+ AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings"
fi
+AC_SUBST(AM_FCFLAGS)
+AC_SUBST(AM_CFLAGS)
# Find other programs we need.
AC_CHECK_TOOL(AS, as)
AC_PROG_FC(gfortran)
FCFLAGS="$FCFLAGS -Wall -fno-repack-arrays -fno-underscoring"
+# 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)
+
AC_SYS_LARGEFILE
AC_FUNC_MMAP
AC_TYPE_OFF_T
# check header files
AC_STDC_HEADERS
-AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h)
+AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h signal.h)
AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
-AC_CHECK_HEADERS(sys/mman.h)
+AC_CHECK_HEADERS(sys/mman.h sys/types.h sys/stat.h ieeefp.h)
AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_CHECK_MEMBERS([struct stat.st_blocks])
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+
# Check for complex math functions
AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
# Check for library functions.
-AC_CHECK_FUNCS(getrusage times mkstemp)
+AC_CHECK_FUNCS(getrusage times mkstemp strtof snprintf ftruncate chsize)
+AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
+AC_CHECK_FUNCS(sleep time)
# Check libc for getgid, getpid, getuid
AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
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])])
+AC_CHECK_LIB([m],[fabsf],[AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
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],[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])])
+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])])
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],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
+# Fallback in case isfinite is not available.
+AC_CHECK_LIB([m],[finite],[AC_DEFINE([HAVE_FINITE],[1],[libm includes finite])])
+
# Let the user override this
AC_ARG_ENABLE(cmath,
AC_HELP_STRING([--enable-cmath],[Include complex math functions]),
# to call gettimeofday if we have it.
LIBGFOR_GETTIMEOFDAY
+# Attempt to assert that the target is of common type in case we don't
+# have C99 integer types at all.
+LIBGFOR_TARGET_ILP32
+
+# Check out attribute support.
+LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
+LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT
+LIBGFOR_CHECK_ATTRIBUTE_ALIAS
+
AC_CACHE_SAVE
if test ${multilib} = yes; then