X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libgfortran%2Fconfigure.ac;h=74cfe441a7518b9223a3770b51cc0b7ba04d4065;hp=fc20a570739b92d32ef8631ca71d4432eeb3b650;hb=687d0767cda167b23de5943e4315b95212cf50f2;hpb=d245556583b36c672ae7a2129e97fd744be90e4f;ds=sidebyside diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index fc20a570739..74cfe441a75 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -1,9 +1,10 @@ # 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_PREREQ(2.64) +AC_INIT([GNU Fortran Runtime Library], 0.3,,[libgfortran]) AC_CONFIG_HEADER(config.h) +GCC_TOPLEV_SUBDIRS # ------- # Options @@ -11,7 +12,8 @@ AC_CONFIG_HEADER(config.h) AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) AC_ARG_ENABLE(version-specific-runtime-libs, -[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], +AS_HELP_STRING([--enable-version-specific-runtime-libs], + [specify that runtime libraries should be installed in a compiler-specific directory]), [case "$enableval" in yes) version_specific_libs=yes ;; no) version_specific_libs=no ;; @@ -20,6 +22,18 @@ AC_ARG_ENABLE(version-specific-runtime-libs, [version_specific_libs=no]) AC_MSG_RESULT($version_specific_libs) +# Build with intermodule optimisations +AC_MSG_CHECKING([for --enable-intermodule]) +AC_ARG_ENABLE(intermodule, +AS_HELP_STRING([--enable-intermodule],[build the library in one step]), +[case "$enable_intermodule" in + yes) onestep="-onestep";; + *) onestep="";; +esac], +[onestep=""]) +AC_MSG_RESULT($enable_intermodule) +AM_CONDITIONAL(onestep,[test x$onestep = x-onestep]) +AC_SUBST(onestep) # Gets build, host, target, *_vendor, *_cpu, *_os, etc. # @@ -41,16 +55,16 @@ 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 +# 1.9.6: 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) +# no-dist: we don't want 'dist' and related rules. # -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_INIT_AUTOMAKE([1.9.6 no-define foreign no-dist -Wall -Wno-portability]) AM_MAINTAINER_MODE AM_ENABLE_MULTILIB(, ..) @@ -68,11 +82,7 @@ else 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) +AC_USE_SYSTEM_EXTENSIONS # Calculate toolexeclibdir # Also toolexecdir, though it's only used in toolexeclibdir @@ -82,7 +92,7 @@ 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" && @@ -104,6 +114,9 @@ esac AC_SUBST(toolexecdir) AC_SUBST(toolexeclibdir) +# Create a spec file, so that compile/link tests don't fail +test -f libgfortran.spec || touch libgfortran.spec + # 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 @@ -113,14 +126,80 @@ AC_SUBST(toolexeclibdir) 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]) +m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) +# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC. +if test "x$GCC" = "xyes"; then + AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring" + ## 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" + ## Compile the following tests with the same system header contents + ## that we'll encounter when compiling our own source files. + CFLAGS="-std=gnu99 $CFLAGS" +fi +AC_SUBST(AM_FCFLAGS) +AC_SUBST(AM_CFLAGS) AC_SUBST(CFLAGS) -# Add -Wall if we are using GCC. -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -Wall" +# Check for symbol versioning (copied from libssp). +AC_MSG_CHECKING([whether symbol versioning is supported]) +AC_ARG_ENABLE(symvers, +AS_HELP_STRING([--disable-symvers], + [disable symbol versioning for libgfortran]), +gfortran_use_symver=$enableval, +gfortran_use_symver=yes) +if test "x$gfortran_use_symver" = xyes; then + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" + cat > conftest.map < conftest.map < +#include +#include ], [ + getpwuid_r(0, NULL, NULL, 0, NULL); + ])], [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])]) +fi +if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then + AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.]) +fi + + +# Check out attribute support. +LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY +LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT +LIBGFOR_CHECK_ATTRIBUTE_ALIAS + +# Check out sync builtins support. +LIBGFOR_CHECK_SYNC_FETCH_AND_ADD + +# Check out thread support. +LIBGFOR_CHECK_GTHR_DEFAULT + +# Check out #pragma weak. +LIBGFOR_GTHREAD_WEAK + +# Various other checks on target +LIBGFOR_CHECK_UNLINK_OPEN_FILE -# 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 +# Check whether line terminator is LF or CRLF +LIBGFOR_CHECK_CRLF AC_CACHE_SAVE @@ -233,6 +570,9 @@ else multilib_arg= fi -# Write our Makefile. -AC_CONFIG_FILES(Makefile) +# Write our Makefile and spec file. +AC_CONFIG_FILES([ +Makefile +libgfortran.spec +]) AC_OUTPUT