📄 configure.ac
字号:
# Process this file with autoconf to produce a configure script, like so:# aclocal && autoconf && autoheader && automakeAC_PREREQ(2.59)AC_INIT([GNU Fortran Runtime Library], 0.2,,[libgfortran])AC_CONFIG_HEADER(config.h)GCC_TOPLEV_SUBDIRS# -------# 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.htmlAC_CANONICAL_SYSTEMtarget_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_MODEAM_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_EXECUTABLESelse LIBGFOR_IS_NATIVE=truefi# Calculate toolexeclibdir# Also toolexecdir, though it's only used in toolexeclibdircase ${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)' toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' ;; 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 ;;esacAC_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_CCm4_rename([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 -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"fiAC_SUBST(AM_FCFLAGS)AC_SUBST(AM_CFLAGS)# 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_SETAC_PROG_INSTALL# Configure libtool#AC_MSG_NOTICE([====== Starting libtool configuration])AC_LIBTOOL_DLOPENAM_PROG_LIBTOOLAC_SUBST(enable_shared)AC_SUBST(enable_static)#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10# We need gfortran to compile parts of the library#AC_PROG_FC(gfortran)FC="$GFORTRAN"AC_PROG_FC(gfortran)# extra LD Flags which are required for targetscase "${host}" in *-darwin*) # Darwin needs -single_module when linking libgfortran extra_ldflags_libgfortran=-Wl,-single_module ;;esacAC_SUBST(extra_ldflags_libgfortran)AC_SYS_LARGEFILEAC_FUNC_MMAPAC_TYPE_OFF_T# check header filesAC_STDC_HEADERSAC_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/types.h sys/stat.h floatingpoint.h ieeefp.h)AC_CHECK_HEADERS(fenv.h fptrap.h float.h)AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])GCC_HEADER_STDINT(gstdint.h)AC_CHECK_MEMBERS([struct stat.st_blksize])AC_CHECK_MEMBERS([struct stat.st_blocks])AC_CHECK_MEMBERS([struct stat.st_rdev])# Check for library functions.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 ttyname signal alarm ctime)# Check libc for getgid, getpid, getuidAC_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])])# Check for C99 (and other IEEE) math functions# ??? This list seems awful long. Is there a better way to test for these?AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])AC_CHECK_LIB([m],[acos],[AC_DEFINE([HAVE_ACOS],[1],[libm includes acos])])AC_CHECK_LIB([m],[acosl],[AC_DEFINE([HAVE_ACOSL],[1],[libm includes acosl])])AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])AC_CHECK_LIB([m],[acosh],[AC_DEFINE([HAVE_ACOSH],[1],[libm includes acosh])])AC_CHECK_LIB([m],[acoshl],[AC_DEFINE([HAVE_ACOSHL],[1],[libm includes acoshl])])AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])AC_CHECK_LIB([m],[asin],[AC_DEFINE([HAVE_ASIN],[1],[libm includes asin])])AC_CHECK_LIB([m],[asinl],[AC_DEFINE([HAVE_ASINL],[1],[libm includes asinl])])AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])AC_CHECK_LIB([m],[asinh],[AC_DEFINE([HAVE_ASINH],[1],[libm includes asinh])])AC_CHECK_LIB([m],[asinhl],[AC_DEFINE([HAVE_ASINHL],[1],[libm includes asinhl])])AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])AC_CHECK_LIB([m],[atan2],[AC_DEFINE([HAVE_ATAN2],[1],[libm includes atan2])])AC_CHECK_LIB([m],[atan2l],[AC_DEFINE([HAVE_ATAN2L],[1],[libm includes atan2l])])AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])AC_CHECK_LIB([m],[atan],[AC_DEFINE([HAVE_ATAN],[1],[libm includes atan])])AC_CHECK_LIB([m],[atanl],[AC_DEFINE([HAVE_ATANL],[1],[libm includes atanl])])AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])AC_CHECK_LIB([m],[atanh],[AC_DEFINE([HAVE_ATANH],[1],[libm includes atanh])])AC_CHECK_LIB([m],[atanhl],[AC_DEFINE([HAVE_ATANHL],[1],[libm includes atanhl])])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -