? autoconf.ma ? autoconf.mas Index: autoconf.texi =================================================================== RCS file: /cvs/autoconf/doc/autoconf.texi,v retrieving revision 1.758 diff -u -r1.758 autoconf.texi --- autoconf.texi 11 Sep 2003 07:06:57 -0000 1.758 +++ autoconf.texi 11 Sep 2003 21:36:22 -0000 @@ -249,7 +249,7 @@ @ifnottex address@hidden Top address@hidden Top, Introduction, (dir), (dir) @top Autoconf @insertcopying @end ifnottex @@ -387,7 +387,7 @@ * Generic Compiler Characteristics:: Language independent tests * C Compiler:: Checking its characteristics * C++ Compiler:: Likewise -* Fortran 77 Compiler:: Likewise +* Fortran Compiler:: Writing Tests @@ -581,7 +581,7 @@ @c ============================================================= Introduction. address@hidden Introduction address@hidden Introduction, The GNU Build System, Top, Top @chapter Introduction @flushright @@ -684,7 +684,7 @@ @c ================================================= The GNU Build System address@hidden The GNU Build System address@hidden The GNU Build System, Making configure Scripts, Introduction, Top @chapter The @acronym{GNU} Build System Autoconf solves an important problem---reliable discovery of @@ -703,7 +703,7 @@ * Pointers:: More info on the @acronym{GNU} build system @end menu address@hidden Automake address@hidden Automake, Libtool, The GNU Build System, The GNU Build System @section Automake The ubiquity of @command{make} means that a @file{Makefile} is almost the @@ -745,7 +745,7 @@ with subdirectories), but even for small programs the added convenience and portability can be substantial. And that's not address@hidden address@hidden Libtool address@hidden Libtool, Pointers, Automake, The GNU Build System @section Libtool Very often, one wants to build not only programs, but libraries, so that @@ -771,7 +771,7 @@ conjunction with Automake---there, Libtool is used automatically whenever shared libraries are needed, and you need not know its syntax. address@hidden Pointers address@hidden Pointers, , Libtool, The GNU Build System @section Pointers Developers who are used to the simplicity of @command{make} for small @@ -821,7 +821,7 @@ @c ================================================= Making configure Scripts. address@hidden Making configure Scripts address@hidden Making configure Scripts, Setup, The GNU Build System, Top @chapter Making @command{configure} Scripts @cindex @file{aclocal.m4} @cindex @command{configure} @@ -908,7 +908,7 @@ * autoreconf Invocation:: Remaking multiple @command{configure} scripts @end menu address@hidden Writing configure.ac address@hidden Writing configure.ac, autoscan Invocation, Making configure Scripts, Making configure Scripts @section Writing @file{configure.ac} To produce a @command{configure} script for a software package, create a @@ -936,7 +936,7 @@ * configure.ac Layout:: Standard organization of @file{configure.ac} @end menu address@hidden Shell Script Compiler address@hidden Shell Script Compiler, Autoconf Language, Writing configure.ac, Writing configure.ac @subsection A Shell Script Compiler Just as for any other computer language, in order to properly program @@ -981,7 +981,7 @@ as a set of M4 macros. address@hidden Autoconf Language address@hidden Autoconf Language, configure.ac Layout, Shell Script Compiler, Writing configure.ac @subsection The Autoconf Language @cindex quotation @@ -1112,7 +1112,7 @@ # Process this file with autoconf to produce a configure script. @end example address@hidden configure.ac Layout address@hidden configure.ac Layout, , Autoconf Language, Writing configure.ac @subsection Standard @file{configure.ac} Layout The order in which @file{configure.ac} calls the Autoconf macros is not @@ -1149,7 +1149,7 @@ @end display address@hidden autoscan Invocation address@hidden autoscan Invocation, ifnames Invocation, Writing configure.ac, Making configure Scripts @section Using @command{autoscan} to Create @file{configure.ac} @cindex @command{autoscan} @@ -1210,7 +1210,7 @@ Prepend @var{dir} to the include path. Multiple invocations accumulate. @end table address@hidden ifnames Invocation address@hidden ifnames Invocation, autoconf Invocation, autoscan Invocation, Making configure Scripts @section Using @command{ifnames} to List Conditionals @cindex @command{ifnames} @@ -1242,7 +1242,7 @@ Print the version number of Autoconf and exit. @end table address@hidden autoconf Invocation address@hidden autoconf Invocation, autoreconf Invocation, ifnames Invocation, Making configure Scripts @section Using @command{autoconf} to Create @command{configure} @cindex @command{autoconf} @@ -1423,7 +1423,7 @@ @end group @end example address@hidden autoreconf Invocation address@hidden autoreconf Invocation, , autoconf Invocation, Making configure Scripts @section Using @command{autoreconf} to Update @command{configure} Scripts @cindex @command{autoreconf} @@ -1549,7 +1549,7 @@ @c ========================================= Initialization and Output Files. address@hidden Setup address@hidden Setup, Existing Tests, Making configure Scripts, Top @chapter Initialization and Output Files Autoconf-generated @command{configure} scripts need some information about @@ -1572,7 +1572,7 @@ * Default Prefix:: Changing the default installation prefix @end menu address@hidden Initializing configure address@hidden Initializing configure, Notices, Setup, Setup @section Initializing @command{configure} Every @command{configure} script must call @code{AC_INIT} before doing @@ -1636,7 +1636,7 @@ @end defmac address@hidden Notices address@hidden Notices, Input, Initializing configure, Setup @section Notices in @command{configure} The following macros manage version numbers for @command{configure} @@ -1698,7 +1698,7 @@ @end defmac address@hidden Input address@hidden Input, Output, Notices, Setup @section Finding @command{configure} Input @@ -1759,7 +1759,7 @@ @end defmac address@hidden Output address@hidden Output, Configuration Actions, Input, Setup @section Outputting Files Every Autoconf script, e.g., @file{configure.ac}, should finish by @@ -1823,7 +1823,7 @@ address@hidden Configuration Actions address@hidden Configuration Actions, Configuration Files, Output, Setup @section Performing Configuration Actions @file{configure} is designed so that it appears to do everything itself, @@ -1964,7 +1964,7 @@ @var{tag}s, of course! address@hidden Configuration Files address@hidden Configuration Files, Makefile Substitutions, Configuration Actions, Setup @section Creating Configuration Files Be sure to read the previous section, @ref{Configuration Actions}. @@ -2007,7 +2007,7 @@ address@hidden Makefile Substitutions address@hidden Makefile Substitutions, Configuration Headers, Configuration Files, Setup @section Substitutions in Makefiles Each subdirectory in a distribution that contains something to be @@ -2041,7 +2041,7 @@ * Automatic Remaking:: Makefile rules for configuring @end menu address@hidden Preset Output Variables address@hidden Preset Output Variables, Installation Directory Variables, Makefile Substitutions, Makefile Substitutions @subsection Preset Output Variables Some output variables are preset by the Autoconf macros. Some of the @@ -2135,6 +2135,15 @@ want to use it. @end defvar address@hidden FCFLAGS address@hidden FCFLAGS +Debugging and optimization options for the Fortran compiler. If it +is not set in the environment when @command{configure} runs, the default +value is set when you call @code{AC_PROG_FC} (or empty if you don't). address@hidden uses this variable when compiling programs to test for +Fortran features. address@hidden defvar + @defvar FFLAGS @ovindex FFLAGS Debugging and optimization options for the Fortran 77 compiler. If it @@ -2151,7 +2160,7 @@ (@option{-l}) to the linker, use @code{LIBS} instead. If it is not set in the environment when @command{configure} runs, the default value is empty. @command{configure} uses this variable when linking programs to test for -C, C++ and Fortran 77 features. +C, C++, and Fortran features. @end defvar @defvar LIBS @@ -2160,7 +2169,7 @@ but some Autoconf macros may prepend extra libraries to this variable if those libraries are found and provide necessary functions, see @ref{Libraries}. @command{configure} uses this variable when linking -programs to test for C, C++ and Fortran 77 features. +programs to test for C, C++, and Fortran features. @end defvar @defvar builddir @@ -2206,7 +2215,7 @@ Absolute path of @code{top_srcdir}. @end defvar address@hidden Installation Directory Variables address@hidden Installation Directory Variables, Build Directories, Preset Output Variables, Makefile Substitutions @subsection Installation Directory Variables The following variables specify the directories where the package will @@ -2400,7 +2409,7 @@ @end table address@hidden Build Directories address@hidden Build Directories, Automatic Remaking, Installation Directory Variables, Makefile Substitutions @subsection Build Directories You can support compiling a software package for several architectures @@ -2443,7 +2452,7 @@ $(MAKEINFO) $(srcdir)/time.texinfo @end example address@hidden Automatic Remaking address@hidden Automatic Remaking, , Build Directories, Makefile Substitutions @subsection Automatic Remaking You can put rules like the following in the top-level @file{Makefile.in} @@ -2501,7 +2510,7 @@ @xref{config.status Invocation}, for more examples of handling configuration-related dependencies. address@hidden Configuration Headers address@hidden Configuration Headers, Configuration Commands, Makefile Substitutions, Setup @section Configuration Header Files @cindex Configuration Header @cindex @file{config.h} @@ -2564,7 +2573,7 @@ * Autoheader Macros:: How to specify CPP templates @end menu address@hidden Header Templates address@hidden Header Templates, autoheader Invocation, Configuration Headers, Configuration Headers @subsection Configuration Header Templates @cindex Configuration Header Template @cindex @file{config.h.in} @@ -2617,7 +2626,7 @@ use @command{autoheader} to generate it, see @ref{autoheader Invocation}. address@hidden autoheader Invocation address@hidden autoheader Invocation, Autoheader Macros, Header Templates, Configuration Headers @subsection Using @command{autoheader} to Create @file{config.h.in} @cindex @command{autoheader} @@ -2718,7 +2727,7 @@ address@hidden Autoheader Macros address@hidden Autoheader Macros, , autoheader Invocation, Configuration Headers @subsection Autoheader Macros @command{autoheader} scans @file{configure.ac} and figures out which C @@ -2792,7 +2801,7 @@ @end defmac address@hidden Configuration Commands address@hidden Configuration Commands, Configuration Links, Configuration Headers, Setup @section Running Arbitrary Configuration Commands You can execute arbitrary commands before, during, and after @@ -2837,7 +2846,7 @@ address@hidden Configuration Links address@hidden Configuration Links, Subdirectories, Configuration Commands, Setup @section Creating Configuration Links You may find it convenient to create links whose destinations depend upon @@ -2880,7 +2889,7 @@ address@hidden Subdirectories address@hidden Subdirectories, Default Prefix, Configuration Links, Setup @section Configuring Other Packages in Subdirectories In most situations, calling @code{AC_OUTPUT} is sufficient to produce @@ -2956,7 +2965,7 @@ This macro may be called multiple times. @end defmac address@hidden Default Prefix address@hidden Default Prefix, , Subdirectories, Setup @section Default Prefix By default, @command{configure} sets the prefix for files it installs to @@ -2996,7 +3005,7 @@ @c ======================================================== Existing tests address@hidden Existing Tests address@hidden Existing Tests, Writing Tests, Setup, Top @chapter Existing Tests These macros test for particular system features that packages might @@ -3030,7 +3039,7 @@ * UNIX Variants:: Special kludges for specific UNIX variants @end menu address@hidden Common Behavior address@hidden Common Behavior, Alternative Programs, Existing Tests, Existing Tests @section Common Behavior Much effort has been expended to make Autoconf easy to learn. The most @@ -3045,7 +3054,7 @@ * Default Includes:: Includes used by the generic macros @end menu address@hidden Standard Symbols address@hidden Standard Symbols, Default Includes, Common Behavior, Common Behavior @subsection Standard Symbols All the generic macros that @code{AC_DEFINE} a symbol as a result of @@ -3065,7 +3074,7 @@ succeeds. address@hidden Default Includes address@hidden Default Includes, , Standard Symbols, Common Behavior @subsection Default Includes @cindex Includes, default @@ -3149,7 +3158,7 @@ @code{HAVE_STRINGS_H} won't. @end defmac address@hidden Alternative Programs address@hidden Alternative Programs, Files, Common Behavior, Existing Tests @section Alternative Programs @cindex Programs, checking @@ -3165,7 +3174,7 @@ * Generic Programs:: How to find other programs @end menu address@hidden Particular Programs address@hidden Particular Programs, Generic Programs, Alternative Programs, Alternative Programs @subsection Particular Program Checks These macros check for particular programs---whether they exist, and @@ -3315,7 +3324,7 @@ @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}. @end defmac address@hidden Generic Programs address@hidden Generic Programs, , Particular Programs, Alternative Programs @subsection Generic Program and File Checks These macros are used to find programs not covered by the ``particular'' @@ -3407,7 +3416,7 @@ @end defmac address@hidden Files address@hidden Files, Libraries, Alternative Programs, Existing Tests @section Files @cindex File, checking @@ -3431,17 +3440,17 @@ @end defmac address@hidden Libraries address@hidden Libraries, Library Functions, Files, Existing Tests @section Library Files @cindex Library, checking The following macros check for the presence of certain C, C++, or Fortran -77 library archive files. +library archive files. @defmac AC_CHECK_LIB (@var{library}, @var{function}, @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{other-libraries}) @acindex{CHECK_LIB} Depending on the current language(@pxref{Language Choice}), try to -ensure that the C, C++, or Fortran 77 function @var{function} is +ensure that the C, C++, or Fortran function @var{function} is available by checking whether a test program can be linked with the library @var{library} to get the function. @var{library} is the base name of the library; e.g., to check for @option{-lmp}, use @samp{mp} as @@ -3491,7 +3500,7 @@ address@hidden Library Functions address@hidden Library Functions, Header Files, Libraries, Existing Tests @section Library Functions The following macros check for particular C library functions. @@ -3505,7 +3514,7 @@ * Generic Functions:: How to find other functions @end menu address@hidden Function Portability address@hidden Function Portability, Particular Functions, Library Functions, Library Functions @subsection Portability of C Functions Most usual functions can either be missing, or be buggy, or be limited @@ -3616,7 +3625,7 @@ @end table address@hidden Particular Functions address@hidden Particular Functions, Generic Functions, Function Portability, Library Functions @subsection Particular Function Checks @cindex Function, checking @@ -4159,7 +4168,7 @@ address@hidden Generic Functions address@hidden Generic Functions, , Particular Functions, Library Functions @subsection Generic Function Checks These macros are used to find functions not covered by the ``particular'' @@ -4283,7 +4292,7 @@ conflict. @end defmac address@hidden Header Files address@hidden Header Files, Declarations, Library Functions, Existing Tests @section Header Files @cindex Header, checking @@ -4298,7 +4307,7 @@ * Generic Headers:: How to find other headers @end menu address@hidden Header Portability address@hidden Header Portability, Particular Headers, Header Files, Header Files @subsection Portability of Headers This section tries to collect knowledge about common headers, and the @@ -4404,7 +4413,7 @@ @end table address@hidden Particular Headers address@hidden Particular Headers, Generic Headers, Header Portability, Header Files @subsection Particular Header Checks These macros check for particular system header files---whether they @@ -4697,7 +4706,7 @@ @end example @end defmac address@hidden Generic Headers address@hidden Generic Headers, , Particular Headers, Header Files @subsection Generic Header Checks These macros are used to find system header files not covered by the @@ -4756,7 +4765,7 @@ ]) @end verbatim address@hidden Declarations address@hidden Declarations, Structures, Header Files, Existing Tests @section Declarations @cindex Declaration, checking @@ -4771,12 +4780,12 @@ * Generic Declarations:: How to find other declarations @end menu address@hidden Particular Declarations address@hidden Particular Declarations, Generic Declarations, Declarations, Declarations @subsection Particular Declaration Checks There are no specific macros for declarations. address@hidden Generic Declarations address@hidden Generic Declarations, , Particular Declarations, Declarations @subsection Generic Declaration Checks These macros are used to find declarations not covered by the ``particular'' @@ -4842,7 +4851,7 @@ @end defmac address@hidden Structures address@hidden Structures, Types, Declarations, Existing Tests @section Structures @cindex Structure, checking @@ -4857,7 +4866,7 @@ * Generic Structures:: How to find other structure members @end menu address@hidden Particular Structures address@hidden Particular Structures, Generic Structures, Structures, Structures @subsection Particular Structure Checks The following macros check for certain structures or structure members. @@ -4922,7 +4931,7 @@ @code{tzname} is found, define @code{HAVE_TZNAME}. @end defmac address@hidden Generic Structures address@hidden Generic Structures, , Particular Structures, Structures @subsection Generic Structure Checks These macros are used to find structure members not covered by the @@ -4961,7 +4970,7 @@ @end defmac address@hidden Types address@hidden Types, Compilers and Preprocessors, Structures, Existing Tests @section Types The following macros check for C types, either builtin or typedefs. If @@ -4974,7 +4983,7 @@ * Generic Types:: How to find other types @end menu address@hidden Particular Types address@hidden Particular Types, Generic Types, Types, Types @subsection Particular Type Checks @hdrindex sys/types.h @@ -5051,7 +5060,7 @@ @code{gid_t} to be @code{int}. @end defmac address@hidden Generic Types address@hidden Generic Types, , Particular Types, Types @subsection Generic Type Checks These macros are used to check for types not covered by the ``particular'' @@ -5088,7 +5097,7 @@ @code{AC_CHECK_TYPE}, see @ref{Obsolete Macros}. address@hidden Compilers and Preprocessors address@hidden Compilers and Preprocessors, System Services, Types, Existing Tests @section Compilers and Preprocessors @ovindex EXEEXT @@ -5112,10 +5121,10 @@ * Generic Compiler Characteristics:: Language independent tests * C Compiler:: Checking its characteristics * C++ Compiler:: Likewise -* Fortran 77 Compiler:: Likewise +* Fortran Compiler:: @end menu address@hidden Specific Compiler Characteristics address@hidden Specific Compiler Characteristics, Generic Compiler Characteristics, Compilers and Preprocessors, Compilers and Preprocessors @subsection Specific Compiler Characteristics Some compilers exhibit different behaviors. @@ -5152,7 +5161,7 @@ @code{long} before comparing it. @end table address@hidden Generic Compiler Characteristics address@hidden Generic Compiler Characteristics, C Compiler, Specific Compiler Characteristics, Compilers and Preprocessors @subsection Generic Compiler Characteristics @defmac AC_CHECK_SIZEOF (@var{type}, @ovar{unused}, @dvar{includes, default-includes}) @@ -5177,7 +5186,7 @@ @end defmac address@hidden C Compiler address@hidden C Compiler, C++ Compiler, Generic Compiler Characteristics, Compilers and Preprocessors @subsection C Compiler Characteristics The following macros provide ways to find and exercise a C Compiler. @@ -5485,7 +5494,7 @@ @end defmac address@hidden C++ Compiler address@hidden C++ Compiler, Fortran Compiler, C Compiler, Compilers and Preprocessors @subsection C++ Compiler Characteristics @@ -5537,11 +5546,24 @@ address@hidden Fortran 77 Compiler address@hidden Fortran 77 Compiler Characteristics address@hidden Fortran Compiler, , C++ Compiler, Compilers and Preprocessors address@hidden Fortran Compiler Characteristics + +The autoconf Fortran support is divided into two categories: legacy +Fortran 77 macros (@code{F77}), and modern Fortran macros (@code{FC}). +The former are intended for traditional Fortran 77 code, and have output +variables like @code{F77}, @code{FFLAGS}, and @code{FLIBS}. The latter +are for newer programs that can (or must) compile under the newer +Fortran standards, and have output variables like @code{FC}, address@hidden, and @code{FCLIBS}. + +Except for two new macros @code{AC_FC_SRCEXT} and @code{AC_FC_FREEFORM} +(see below), the FC and F77 macros behave almost identically, and so +they are documented together in this section. + @defmac AC_PROG_F77 (@ovar{compiler-search-list}) address@hidden address@hidden @ovindex F77 @ovindex FFLAGS Determine a Fortran 77 compiler to use. If @code{F77} is not already @@ -5568,74 +5590,110 @@ @code{FFLAGS} to @option{-g} for all other Fortran 77 compilers. @end defmac address@hidden AC_PROG_F77_C_O address@hidden AC_PROG_FC (@ovar{compiler-search-list}, @ovar{dialect}) address@hidden address@hidden FC address@hidden FCFLAGS +Determine a Fortran compiler to use. If @code{FC} is not already set in +the environment, then @code{dialect} is a hint to indicate what Fortran +dialect to search for; the default is to search for the newest available +dialect. Set the output variable @code{FC} to the name of the compiler +found. + +By default, newer dialects are preferred over older dialects, but if address@hidden is specified then older dialects are preferred starting +with the specified dialect. @code{dialect} can currently be one of +Fortran 77, Fortran 90, or Fortran 95. However, this is only a hint of +which compiler @emph{name} to prefer (e.g. @code{f90} or @code{f95}), +and no attempt is made to guarantee that a particular language standard +is actually supported. + +This macro may, alternatively, be invoked with an optional first argument +which, if specified, must be a space separated list of Fortran +compilers to search for, just as in @code{AC_PROG_F77}. + +If the output variable @code{FCFLAGS} was not already set in the +environment, then set it to @option{-g -02} for GNU @code{g77} (or address@hidden where @code{g77} does not accept @option{-g}). Otherwise, +set @code{FCFLAGS} to @option{-g} for all other Fortran compilers. address@hidden defmac + address@hidden AC_PROG_F77_C_O/AC_PROG_FC_C_O @acindex{PROG_F77_C_O} address@hidden @cvindex F77_NO_MINUS_C_MINUS_O -Test if the Fortran 77 compiler accepts the options @option{-c} and address@hidden simultaneously, and define @code{F77_NO_MINUS_C_MINUS_O} if it -does not. address@hidden FC_NO_MINUS_C_MINUS_O +Test if the Fortran compiler accepts the options @option{-c} and address@hidden simultaneously, and define @code{F77_NO_MINUS_C_MINUS_O} or address@hidden, respectively, if it does not. @end defmac - -The following macros check for Fortran 77 compiler characteristics. To -check for characteristics not listed here, use @code{AC_COMPILE_IFELSE} -(@pxref{Running the Compiler}) or @code{AC_RUN_IFELSE} (@pxref{Run -Time}), making sure to first set the current language to Fortran 77 address@hidden(Fortran 77)} (@pxref{Language Choice}). +The following macros check for Fortran compiler characteristics. +To check for characteristics not listed here, use address@hidden (@pxref{Running the Compiler}) or address@hidden (@pxref{Run Time}), making sure to first set the +current language to Fortran 77 or Fortran via @code{AC_LANG(Fortran 77)} +or @code{AC_LANG(Fortran)} (@pxref{Language Choice}). address@hidden AC_F77_LIBRARY_LDFLAGS address@hidden AC_F77_LIBRARY_LDFLAGS/AC_FC_LIBRARY_LDFLAGS @acindex{F77_LIBRARY_LDFLAGS} @ovindex FLIBS address@hidden address@hidden FCLIBS Determine the linker flags (e.g., @option{-L} and @option{-l}) for the address@hidden 77 intrinsic and run-time libraries} that are required to -successfully link a Fortran 77 program or shared library. The output -variable @code{FLIBS} is set to these flags. address@hidden intrinsic and run-time libraries} that are required to +successfully link a Fortran program or shared library. The output +variable @code{FLIBS} or @code{FCLIBS} is set to these flags (which +should be include after @code{LIBS} when linking). This macro is intended to be used in those situations when it is -necessary to mix, e.g., C++ and Fortran 77 source code into a single +necessary to mix, e.g., C++ and Fortran source code in a single program or shared library (@pxref{Mixing Fortran 77 With C and C++,,, automake, @acronym{GNU} Automake}). -For example, if object files from a C++ and Fortran 77 compiler must be +For example, if object files from a C++ and Fortran compiler must be linked together, then the C++ compiler/linker must be used for linking (since special C++-ish things need to happen at link time like calling global constructors, instantiating templates, enabling exception support, etc.). -However, the Fortran 77 intrinsic and run-time libraries must be linked -in as well, but the C++ compiler/linker doesn't know by default how to -add these Fortran 77 libraries. Hence, the macro address@hidden was created to determine these Fortran 77 -libraries. +However, the Fortran intrinsic and run-time libraries must be linked in +as well, but the C++ compiler/linker doesn't know by default how to add +these Fortran 77 libraries. Hence, this macro was created to determine +these Fortran libraries. -The macro @code{AC_F77_DUMMY_MAIN} or @code{AC_F77_MAIN} will probably -also be necessary to link C/C++ with Fortran; see below. +The macros @code{AC_F77_DUMMY_MAIN}/@code{AC_FC_DUMMY_MAIN} or address@hidden/@code{AC_FC_MAIN} will probably also be necessary to +link C/C++ with Fortran; see below. @end defmac - address@hidden AC_F77_DUMMY_MAIN (@ovar{action-if-found}, @ovar{action-if-not-found}) address@hidden AC_F77_DUMMY_MAIN/AC_FC_DUMMY_MAIN (@ovar{action-if-found}, @ovar{action-if-not-found}) @acindex{F77_DUMMY_MAIN} @cvindex F77_DUMMY_MAIN With many compilers, the Fortran libraries detected by address@hidden provide their own @code{main} entry -function that initializes things like Fortran I/O, and which then calls -a user-provided entry function named (say) @code{MAIN__} to run the -user's program. The @code{AC_F77_DUMMY_MAIN} or @code{AC_F77_MAIN} -macro figures out how to deal with this interaction. - -When using Fortran for purely numerical functions (no I/O, etc.)@: often one -prefers to provide one's own @code{main} and skip the Fortran library -initializations. In this case, however, one may still need to provide a -dummy @code{MAIN__} routine in order to prevent linking errors on some -systems. @code{AC_F77_DUMMY_MAIN} detects whether any such routine is address@hidden for linking, and what its name is; the shell variable address@hidden holds this name, @code{unknown} when no solution address@hidden or @code{AC_FC_LIBRARY_LDFLAGS} provide +their own @code{main} entry function that initializes things like +Fortran I/O, and which then calls a user-provided entry function named +(say) @code{MAIN__} to run the user's program. The address@hidden/@code{AC_FC_DUMMY_MAIN} or address@hidden/@code{AC_FC_MAIN} macro figures out how to deal with +this interaction. + +When using Fortran for purely numerical functions (no I/O, etc.)@: often +one prefers to provide one's own @code{main} and skip the Fortran +library initializations. In this case, however, one may still need to +provide a dummy @code{MAIN__} routine in order to prevent linking errors +on some systems. @code{AC_F77_DUMMY_MAIN} or @code{AC_FC_DUMMY_MAIN} +detects whether any such routine is @emph{required} for linking, and +what its name is; the shell variable @code{F77_DUMMY_MAIN} or address@hidden holds this name, @code{unknown} when no solution was found, and @code{none} when no such dummy main is needed. -By default, @var{action-if-found} defines @code{F77_DUMMY_MAIN} to the -name of this routine (e.g., @code{MAIN__}) @emph{if} it is required. address@hidden defaults to exiting with an error. +By default, @var{action-if-found} defines @code{F77_DUMMY_MAIN} or address@hidden to the name of this routine (e.g., @code{MAIN__}) address@hidden it is required. @ovar{action-if-not-found} defaults to +exiting with an error. In order to link with Fortran routines, the user's C/C++ program should then include the following code to define the dummy main if it is @@ -5650,45 +5708,54 @@ #endif @end example -Note that @code{AC_F77_DUMMY_MAIN} is called automatically from address@hidden; there is generally no need to call it explicitly -unless one wants to change the default actions. +(Replace @code{F77} with @code{FC} for Fortran instead of Fortran 77.) + +Note that this macro is called automatically from @code{AC_F77_WRAPPERS} +or @code{AC_FC_WRAPPERS}; there is generally no need to call it +explicitly unless one wants to change the default actions. @end defmac address@hidden AC_F77_MAIN address@hidden AC_F77_MAIN/AC_FC_MAIN @acindex{F77_MAIN} @cvindex F77_MAIN -As discussed above for @code{AC_F77_DUMMY_MAIN}, many Fortran libraries -allow you to provide an entry point called (say) @code{MAIN__} instead of -the usual @code{main}, which is then called by a @code{main} function in -the Fortran libraries that initializes things like Fortran I/address@hidden The address@hidden macro detects whether it is @emph{possible} to -utilize such an alternate main function, and defines @code{F77_MAIN} to -the name of the function. (If no alternate main function name is found, address@hidden is simply defined to @code{main}.) address@hidden address@hidden FC_MAIN +As discussed above, many Fortran libraries allow you to provide an entry +point called (say) @code{MAIN__} instead of the usual @code{main}, which +is then called by a @code{main} function in the Fortran libraries that +initializes things like Fortran I/address@hidden The address@hidden/@code{AC_FC_MAIN} macro detects whether it is address@hidden to utilize such an alternate main function, and defines address@hidden/@code{FC_MAIN} to the name of the function. (If no +alternate main function name is found, @code{F77_MAIN}/@code{FC_MAIN} is +simply defined to @code{main}.) Thus, when calling Fortran routines from C that perform things like I/O, -one should use this macro and name the "main" function @code{F77_MAIN} -instead of @code{main}. +one should use this macro and name the "main" function address@hidden/@code{FC_MAIN} instead of @code{main}. @end defmac address@hidden AC_F77_WRAPPERS address@hidden AC_F77_WRAPPERS/AC_FC_WRAPPERS @acindex{F77_WRAPPERS} @cvindex F77_FUNC @cvindex F77_FUNC_ -Defines C macros @code{F77_FUNC(name,NAME)} and address@hidden(name,NAME)} to properly mangle the names of C/C++ -identifiers, and identifiers with underscores, respectively, so that -they match the name-mangling scheme used by the Fortran 77 compiler. - -Fortran 77 is case-insensitive, and in order to achieve this the Fortran -77 compiler converts all identifiers into a canonical case and format. -To call a Fortran 77 subroutine from C or to write a C function that is -callable from Fortran 77, the C program must explicitly use identifiers -in the format expected by the Fortran 77 compiler. In order to do this, -one simply wraps all C identifiers in one of the macros provided by address@hidden For example, suppose you have the following -Fortran 77 subroutine: address@hidden address@hidden FC_FUNC address@hidden FC_FUNC_ +Defines C macros @code{F77_FUNC(name,NAME)}/@code{FC_FUNC(name,NAME)} +and @code{F77_FUNC_(name,NAME)}/@code{FC_FUNC_(name,NAME)} to properly +mangle the names of C/C++ identifiers, and identifiers with underscores, +respectively, so that they match the name-mangling scheme used by the +Fortran compiler. + +Fortran is case-insensitive, and in order to achieve this the Fortran +compiler converts all identifiers into a canonical case and format. To +call a Fortran subroutine from C or to write a C function that is +callable from Fortran, the C program must explicitly use identifiers in +the format expected by the Fortran compiler. In order to do this, one +simply wraps all C identifiers in one of the macros provided by address@hidden or @code{AC_FC_WRAPPERS}. For example, suppose +you have the following Fortran 77 subroutine: @example subroutine foobar(x,y) @@ -5714,12 +5781,14 @@ pointers (@pxref{Mixing Fortran 77 With C and C++,,, automake, @acronym{GNU} Automake}). +(Replace @code{F77} with @code{FC} for Fortran instead of Fortran 77.) + Although Autoconf tries to be intelligent about detecting the -name-mangling scheme of the Fortran 77 compiler, there may be Fortran 77 +name-mangling scheme of the Fortran compiler, there may be Fortran compilers that it doesn't support yet. In this case, the above code will generate a compile-time error, but some other behavior (e.g., disabling Fortran-related features) can be induced by checking -whether the @code{F77_FUNC} macro is defined. +whether the @code{F77_FUNC}/@code{FC_FUNC} macro is defined. Now, to call that routine from a C program, we would do something like: @@ -5730,25 +5799,93 @@ @} @end example -If the Fortran 77 identifier contains an underscore -(e.g., @code{foo_bar}), you should use @code{F77_FUNC_} instead of address@hidden (with the same arguments). This is because some Fortran -77 compilers mangle names differently if they contain an underscore. +If the Fortran identifier contains an underscore (e.g., @code{foo_bar}), +you should use @code{F77_FUNC_}/@code{FC_FUNC_} instead of address@hidden/@code{FC_FUNC} (with the same arguments). This is +because some Fortran compilers mangle names differently if they contain +an underscore. @end defmac address@hidden AC_F77_FUNC (@var{name}, @ovar{shellvar}) address@hidden AC_F77_FUNC/AC_FC_FUNC (@var{name}, @ovar{shellvar}) @acindex{F77_FUNC} address@hidden Given an identifier @var{name}, set the shell variable @var{shellvar} to hold the mangled version @var{name} according to the rules of the -Fortran 77 linker (see also @code{AC_F77_WRAPPERS}). @var{shellvar} is -optional; if it is not supplied, the shell variable will be simply address@hidden The purpose of this macro is to give the caller a way to -access the name-mangling information other than through the C -preprocessor as above, for example, to call Fortran routines from some -language other than C/C++. +Fortran linker (see also @code{AC_F77_WRAPPERS} or address@hidden). @var{shellvar} is optional; if it is not +supplied, the shell variable will be simply @var{name}. The purpose of +this macro is to give the caller a way to access the name-mangling +information other than through the C preprocessor as above, for example, +to call Fortran routines from some language other than C/C++. address@hidden defmac + address@hidden AC_FC_SRCEXT (@var{ext}, @ovar{action-if-success}, @ovar{action-if-failure}) address@hidden +By default, the FC macros perform their tests using a @file{.f} +extension for source-code files. Some compilers, however, only enable +newer language features for appropriately named files, e.g. Fortran 90 +features only for @file{.f90} files. On the other hand, some other +compilers expect all source files to end in @file{.f} and require +special flags to support other filename extensions. The address@hidden macro deals with both of these issues. + +The @code{AC_FC_SRCEXT} tries to get the FC compiler to accept files +ending with the extension address@hidden (i.e. @var{ext} does @emph{not} +contain the dot). If any special compiler flags are needed for this, it +stores them in the output variable @address@hidden This +extension and these flags are then used for all subsequent FC tests +(until @code{AC_FC_SRCEXT} is called again). + +For example, you would use @code{AC_FC_SRCEXT(f90)} to employ the address@hidden extension in future tests, and it would set a address@hidden output variable with any extra flags that are needed +to compile such files. + +The @address@hidden can @emph{not} be simply absorbed into address@hidden, for two reasons based on the limitations of some +compilers. First, only one @address@hidden can be used at a +time, so files with different extensions must be compiled separately. +Second, @address@hidden must appear @emph{immediately} before +the source-code filename when compiling. So, continuing the example +above, you might compile a @file{foo.f90} file in your Makefile with the +command: + address@hidden +foo.o: foo.f90 + $(FC) -c $(FCFLAGS) $(FCFLAGS_f90) foo.f90 address@hidden example + +If @code{AC_FC_SRCEXT} succeeds in compiling files with the @var{ext} +extension, it calls @ovar{action-if-success} (defaults to nothing). If +it fails, and cannot find a way to make the FC compiler accept such +files, it calls @ovar{action-if-failure} (defaults to exiting with an +error message). + address@hidden defmac + address@hidden AC_FC_FREEFORM (@ovar{action-if-success}, @ovar{action-if-failure}) address@hidden + +The @code{AC_FC_FREEFORM} tries to ensure that the Fortran compiler +(@code{$FC}) allows free-format source code (as opposed to the older +fixed-format style from Fortran 77). If necessary, it may add some +additional flags to @code{FCFLAGS}. + +This macro is most important if you are using the default @file{.f} +extension, since many compilers interpret this extension as indicating +fixed-format source unless an additional flag is supplied. If you +specify a different extension with @code{AC_FC_SRCEXT}, such as address@hidden or @file{.f95}, then @code{AC_FC_FREEFORM} will ordinarily +succeed without modifying @code{FCFLAGS}. + +If @code{AC_FC_FREEFORM} succeeds in compiling free-form source, it +calls @ovar{action-if-success} (defaults to nothing). If it fails, it +calls @ovar{action-if-failure} (defaults to exiting with an error +message). + @end defmac address@hidden System Services address@hidden System Services, UNIX Variants, Compilers and Preprocessors, Existing Tests @section System Services The following macros check for operating system services or capabilities. @@ -5848,7 +5985,7 @@ @samp{yes}. If not, set the variable to @samp{no}. @end defmac address@hidden UNIX Variants address@hidden UNIX Variants, , System Services, Existing Tests @section UNIX Variants The following macros check for certain operating systems that need @@ -5898,7 +6035,7 @@ @c ========================================================= Writing Tests address@hidden Writing Tests address@hidden Writing Tests, Results, Existing Tests, Top @chapter Writing Tests If the existing feature tests don't do something you need, you have to @@ -5937,7 +6074,7 @@ * Multiple Cases:: Tests for several possible values @end menu address@hidden Language Choice address@hidden Language Choice, Writing Test Programs, Writing Tests, Writing Tests @section Language Choice @cindex Language @@ -5966,6 +6103,11 @@ @item Fortran 77 Do compilation tests using @code{F77} and use extension @file{.f} for test programs. + address@hidden Fortran +Do compilation tests using @code{FC} and use extension @file{.f} (or +whatever has been set by @code{AC_FC_SRCEXT}) for test programs. + @end table @end defmac @@ -6002,7 +6144,7 @@ @end defmac address@hidden Writing Test Programs address@hidden Writing Test Programs, Running the Preprocessor, Language Choice, Writing Tests @section Writing Test Programs Autoconf tests follow is common scheme: feeding some program with some @@ -6015,7 +6157,7 @@ * Generating Sources:: Source program boilerplate @end menu address@hidden Guidelines address@hidden Guidelines, Test Functions, Writing Test Programs, Writing Test Programs @subsection Guidelines for Test Programs The most important rule to follow when writing testing samples is: @@ -6063,7 +6205,7 @@ @command{configure} script cleans up by running @samp{rm -rf conftest*} after running test programs and if the script is interrupted. address@hidden Test Functions address@hidden Test Functions, Generating Sources, Guidelines, Writing Test Programs @subsection Test Functions Function declarations in test programs should have a prototype @@ -6106,7 +6248,7 @@ with a different return type (such as @code{char}). address@hidden Generating Sources address@hidden Generating Sources, , Test Functions, Writing Test Programs @subsection Generating Sources Autoconf provides a set of macros that can be used to generate test @@ -6235,7 +6377,7 @@ arguments). @end defmac address@hidden Running the Preprocessor address@hidden Running the Preprocessor, Running the Compiler, Writing Test Programs, Writing Tests @section Running the Preprocessor Sometimes one might need to run the preprocessor on some source file. @@ -6319,10 +6461,10 @@ address@hidden Running the Compiler address@hidden Running the Compiler, Running the Linker, Running the Preprocessor, Writing Tests @section Running the Compiler -To check for a syntax feature of the (C, C++, or Fortran 77) compiler, +To check for a syntax feature of the (C, C++, Fortran, or Fortran 77) compiler, such as whether it recognizes a certain keyword, or simply to try some library feature, use @code{AC_COMPILE_IFELSE} to try to compile a small program that uses that feature. @@ -6338,7 +6480,7 @@ This macro uses @code{CFLAGS} or @code{CXXFLAGS} if either C or C++ is the currently selected language, as well as @code{CPPFLAGS}, when compiling. If Fortran 77 is the currently selected language then address@hidden will be used when compiling. address@hidden will be used when compiling, or @code{FCFLAGS} for Fortran. It is customary to report unexpected failures with @code{AC_MSG_FAILURE}. This macro does not try to link; use @@ -6346,7 +6488,7 @@ Linker}). @end defmac address@hidden Running the Linker address@hidden Running the Linker, Run Time, Running the Compiler, Writing Tests @section Running the Linker To check for a library, a function, or a global variable, Autoconf @@ -6378,7 +6520,7 @@ This macro uses @code{CFLAGS} or @code{CXXFLAGS} if either C or C++ is the currently selected language, as well as @code{CPPFLAGS}, when compiling. If Fortran 77 is the currently selected language then address@hidden will be used when compiling. address@hidden will be used when compiling, or @code{FCFLAGS} for Fortran. It is customary to report unexpected failures with @code{AC_MSG_FAILURE}. This macro does not try to execute the program; @@ -6387,7 +6529,7 @@ address@hidden Run Time address@hidden Run Time, Systemology, Running the Linker, Writing Tests @section Checking Run Time Behavior Sometimes you need to find out how a system performs at run time, such @@ -6453,7 +6595,7 @@ of calling the macros. address@hidden Systemology address@hidden Systemology, Multiple Cases, Run Time, Writing Tests @section Systemology This section aims at presenting some systems and pointers to @@ -6505,7 +6647,7 @@ @end table address@hidden Multiple Cases address@hidden Multiple Cases, , Systemology, Writing Tests @section Multiple Cases Some operations are accomplished in several possible ways, depending on @@ -6542,7 +6684,7 @@ @c ====================================================== Results of Tests. address@hidden Results address@hidden Results, Programming in M4, Writing Tests, Top @chapter Results of Tests Once @command{configure} has determined whether a feature exists, what can @@ -6558,7 +6700,7 @@ * Printing Messages:: Notifying @command{configure} users @end menu address@hidden Defining Symbols address@hidden Defining Symbols, Setting Output Variables, Results, Results @section Defining C Preprocessor Symbols A common action to take in response to a feature test is to define a C @@ -6654,7 +6796,7 @@ AC_CHECK_HEADER(elf.h, [AC_DEFINE(SVR4); LIBS="$LIBS -lelf"]) @end example address@hidden Setting Output Variables address@hidden Setting Output Variables, Caching Results, Defining Symbols, Results @section Setting Output Variables Another way to record the results of tests is to set @dfn{output @@ -6778,7 +6920,7 @@ @end defmac address@hidden Caching Results address@hidden Caching Results, Printing Messages, Setting Output Variables, Results @section Caching Results @cindex Cache @@ -6871,7 +7013,7 @@ * Cache Checkpointing:: Loading and saving the cache file @end menu address@hidden Cache Variable Names address@hidden Cache Variable Names, Cache Files, Caching Results, Caching Results @subsection Cache Variable Names @cindex Cache variable @@ -6916,7 +7058,7 @@ Usually, their values will be Boolean (@samp{yes} or @samp{no}) or the names of files or functions; so this is not an important restriction. address@hidden Cache Files address@hidden Cache Files, Cache Checkpointing, Cache Variable Names, Caching Results @subsection Cache Files A cache file is a shell script that caches the results of configure @@ -6955,7 +7097,7 @@ however, if the system configuration (e.g., the installed libraries or compilers) changes and the stale cache file is not deleted. address@hidden Cache Checkpointing address@hidden Cache Checkpointing, , Cache Files, Caching Results @subsection Cache Checkpointing If your configure script, or a macro called from @file{configure.ac}, happens @@ -7006,7 +7148,7 @@ @r{ @dots{} AC_OUTPUT, etc. @dots{}} @end example address@hidden Printing Messages address@hidden Printing Messages, , Caching Results, Results @section Printing Messages @cindex Messages, from @command{configure} @@ -7101,7 +7243,7 @@ @c ====================================================== Programming in M4. address@hidden Programming in M4 address@hidden Programming in M4, Writing Autoconf Macros, Results, Top @chapter Programming in M4 Autoconf is written on top of two layers: @dfn{M4sugar}, which provides @@ -7119,7 +7261,7 @@ * Programming in M4sh:: Common shell Constructs @end menu address@hidden M4 Quotation address@hidden M4 Quotation, Using autom4te, Programming in M4, Programming in M4 @section M4 Quotation @cindex quotation @@ -7142,7 +7284,7 @@ * Quotation Rule Of Thumb:: One parenthesis, one quote @end menu address@hidden Active Characters address@hidden Active Characters, One Macro Call, M4 Quotation, M4 Quotation @subsection Active Characters To fully understand where proper quotation is important, you first need @@ -7191,7 +7333,7 @@ @code{defn}.}? address@hidden One Macro Call address@hidden One Macro Call, Quotation and Nested Macros, Active Characters, M4 Quotation @subsection One Macro Call Let's proceed on the interaction between active characters and macros @@ -7269,7 +7411,7 @@ address@hidden address@hidden Quotation and Nested Macros address@hidden Quotation and Nested Macros, Changequote is Evil, One Macro Call, M4 Quotation @subsection Quotation and Nested Macros The examples below use the following macros: @@ -7398,7 +7540,7 @@ Also, because @code{qar} behaves differently from the other macros, it's an exception that should be avoided in Autoconf. address@hidden Changequote is Evil address@hidden Changequote is Evil, Quadrigraphs, Quotation and Nested Macros, M4 Quotation @subsection @code{changequote} is Evil The temptation is often high to bypass proper quotation, in particular @@ -7451,7 +7593,7 @@ @c lost them all :( address@hidden Quadrigraphs address@hidden Quadrigraphs, Quotation Rule Of Thumb, Changequote is Evil, M4 Quotation @subsection Quadrigraphs @cindex quadrigraphs @cindex @samp{@@S|@@} @@ -7528,7 +7670,7 @@ Cambridge University computer lab at the time. @end quotation address@hidden Quotation Rule Of Thumb address@hidden Quotation Rule Of Thumb, , Quadrigraphs, M4 Quotation @subsection Quotation Rule Of Thumb To conclude, the quotation rule of thumb is: @@ -7620,7 +7762,7 @@ @c ---------------------------------------- Using autom4te address@hidden Using autom4te address@hidden Using autom4te, Programming in M4sugar, M4 Quotation, Programming in M4 @section Using @command{autom4te} The Autoconf suite, including M4sugar, M4sh, and Autotest, in addition @@ -7640,7 +7782,7 @@ * Customizing autom4te:: Customizing the Autoconf package @end menu address@hidden autom4te Invocation address@hidden autom4te Invocation, Customizing autom4te, Using autom4te, Using autom4te @subsection Invoking @command{autom4te} The command line arguments are modeled after M4's: @@ -7983,7 +8125,7 @@ m4sugar/m4sugar.m4f m4sugar/m4sh.m4f --mode 777 foo.m4}. The definition of the languages is stored in @file{autom4te.cfg}. address@hidden Customizing autom4te address@hidden Customizing autom4te, , autom4te Invocation, Using autom4te @subsection Customizing @command{autom4te} One can customize @command{autom4te} via @file{~/.autom4te.cfg} (i.e., @@ -8017,7 +8159,7 @@ @end verbatim address@hidden Programming in M4sugar address@hidden Programming in M4sugar, Programming in M4sh, Using autom4te, Programming in M4 @section Programming in M4sugar @cindex M4sugar @@ -8032,7 +8174,7 @@ * Forbidden Patterns:: Catching unexpanded macros @end menu address@hidden Redefined M4 Macros address@hidden Redefined M4 Macros, Evaluation Macros, Programming in M4sugar, Programming in M4sugar @subsection Redefined M4 Macros With a few exceptions, all the M4 native macros are moved in the @@ -8116,7 +8258,7 @@ @end example @end defmac address@hidden Evaluation Macros address@hidden Evaluation Macros, Forbidden Patterns, Redefined M4 Macros, Programming in M4sugar @subsection Evaluation Macros The following macros give some control over the order of the evaluation @@ -8154,7 +8296,7 @@ address@hidden Forbidden Patterns address@hidden Forbidden Patterns, , Evaluation Macros, Programming in M4sugar @subsection Forbidden Patterns M4sugar provides a means to define suspicious patterns, patterns @@ -8185,7 +8327,7 @@ @code{m4_pattern_forbid} pattern. @end defmac address@hidden Programming in M4sh address@hidden Programming in M4sh, , Programming in M4sugar, Programming in M4 @section Programming in M4sh @c FIXME: Eventually will become a chapter, as it is not related to @@ -8243,7 +8385,7 @@ @c=================================================== Writing Autoconf Macros. address@hidden Writing Autoconf Macros address@hidden Writing Autoconf Macros, Portable Shell, Programming in M4, Top @chapter Writing Autoconf Macros When you write a feature test that could be applicable to more than one @@ -8259,7 +8401,7 @@ * Coding Style:: Writing Autoconf macros @`a la Autoconf @end menu address@hidden Macro Definitions address@hidden Macro Definitions, Macro Names, Writing Autoconf Macros, Writing Autoconf Macros @section Macro Definitions @acindex{DEFUN} @@ -8309,7 +8451,7 @@ that produce no output, such as @code{AC_REQUIRE}. address@hidden Macro Names address@hidden Macro Names, Reporting Messages, Macro Definitions, Writing Autoconf Macros @section Macro Names All of the Autoconf macros have all-uppercase names starting with @@ -8375,7 +8517,7 @@ macro does. For example, @code{AC_PATH_X} has internal macros @code{_AC_PATH_X_XMKMF} and @code{_AC_PATH_X_DIRECT}. address@hidden Reporting Messages address@hidden Reporting Messages, Dependencies Between Macros, Macro Names, Writing Autoconf Macros @section Reporting Messages @cindex Messages, from @command{autoconf} @@ -8420,7 +8562,7 @@ @code{AC_DIAGNOSE} and @code{AC_WARNING} are reported as error, see @ref{autoconf Invocation}. address@hidden Dependencies Between Macros address@hidden Dependencies Between Macros, Obsoleting Macros, Reporting Messages, Writing Autoconf Macros @section Dependencies Between Macros Some Autoconf macros depend on other macros having been called first in @@ -8433,7 +8575,7 @@ * Suggested Ordering:: Warning about possible ordering problems @end menu address@hidden Prerequisite Macros address@hidden Prerequisite Macros, Suggested Ordering, Dependencies Between Macros, Dependencies Between Macros @subsection Prerequisite Macros A macro that you write might need to use values that have previously @@ -8531,7 +8673,7 @@ You are encouraged to put all @code{AC_REQUIRE}s at the beginning of a macro. You can use @code{dnl} to avoid the empty lines they leave. address@hidden Suggested Ordering address@hidden Suggested Ordering, , Prerequisite Macros, Dependencies Between Macros @subsection Suggested Ordering Some macros should be run before another macro if both are called, but @@ -8569,7 +8711,7 @@ that it has been called. @end defmac address@hidden Obsoleting Macros address@hidden Obsoleting Macros, Coding Style, Dependencies Between Macros, Writing Autoconf Macros @section Obsoleting Macros Configuration and portability technology has evolved over the years. @@ -8595,7 +8737,7 @@ @var{message} is then printed. @end defmac address@hidden Coding Style address@hidden Coding Style, , Obsoleting Macros, Writing Autoconf Macros @section Coding Style The Autoconf macros follow a strict coding style. You are encouraged to @@ -8805,7 +8947,7 @@ @c ============================================= Portable Shell Programming address@hidden Portable Shell address@hidden Portable Shell, Manual Configuration, Writing Autoconf Macros, Top @chapter Portable Shell Programming When writing your own checks, there are some shell-script programming @@ -8858,7 +9000,7 @@ * Limitations of Make:: Portable Makefiles @end menu address@hidden Shellology address@hidden Shellology, Here-Documents, Portable Shell, Portable Shell @section Shellology There are several families of shells, most prominently the Bourne family @@ -8968,7 +9110,7 @@ @acronym{POSIX} standard, the challenge is to find it. @end quotation address@hidden Here-Documents address@hidden Here-Documents, File Descriptors, Shellology, Portable Shell @section Here-Documents Don't rely on @samp{\} being preserved just because it has no special @@ -9044,7 +9186,7 @@ condition turned out to be false at run-time, and we end up not executing the macro at all. address@hidden File Descriptors address@hidden File Descriptors, File System Conventions, Here-Documents, Portable Shell @section File Descriptors Some file descriptors shall not be used, since some systems, admittedly @@ -9113,7 +9255,7 @@ Don't try to move/delete open files, such as in @samp{exec >foo; mv foo bar}; see @ref{Limitations of Builtins}, @command{mv} for more details. address@hidden File System Conventions address@hidden File System Conventions, Shell Substitutions, File Descriptors, Portable Shell @section File System Conventions While @command{autoconf} and friends will usually be run on some Unix @@ -9228,7 +9370,7 @@ include @samp{+}, @samp{,}, @samp{[} and @samp{]}. @end table address@hidden Shell Substitutions address@hidden Shell Substitutions, Assignments, File System Conventions, Portable Shell @section Shell Substitutions Contrary to a persistent urban legend, the Bourne shell does not @@ -9469,7 +9611,7 @@ @end table address@hidden Assignments address@hidden Assignments, Special Shell Variables, Shell Substitutions, Portable Shell @section Assignments When setting several variables in a row, be aware that the order of the @@ -9553,7 +9695,7 @@ for the rationale. address@hidden Special Shell Variables address@hidden Special Shell Variables, Limitations of Builtins, Assignments, Portable Shell @section Special Shell Variables Some shell variables should not be used, since they can have a deep @@ -9810,7 +9952,7 @@ @end table address@hidden Limitations of Builtins address@hidden Limitations of Builtins, Limitations of Usual Tools, Special Shell Variables, Portable Shell @section Limitations of Shell Builtins No, no, we are serious: some shells do have limitations! :) @@ -10373,7 +10515,7 @@ the case of environment variables. @end table address@hidden Limitations of Usual Tools address@hidden Limitations of Usual Tools, Limitations of Make, Limitations of Builtins, Portable Shell @section Limitations of Usual Tools The small set of tools you can expect to find on any machine can still @@ -11025,7 +11167,7 @@ @end table address@hidden Limitations of Make address@hidden Limitations of Make, , Limitations of Usual Tools, Portable Shell @section Limitations of Make @command{make} itself suffers a great number of limitations, only a few @@ -11747,7 +11889,7 @@ @c ================================================== Manual Configuration address@hidden Manual Configuration address@hidden Manual Configuration, Site Configuration, Portable Shell, Top @chapter Manual Configuration A few kinds of features can't be guessed automatically by running test @@ -11764,7 +11906,7 @@ * Using System Type:: What to do with the system type @end menu address@hidden Specifying Names address@hidden Specifying Names, Canonicalizing, Manual Configuration, Manual Configuration @section Specifying the System Type Like other @acronym{GNU} @command{configure} scripts, Autoconf-generated @@ -11829,7 +11971,7 @@ interface; see @ref{Hosts and Cross-Compilation}. address@hidden Canonicalizing address@hidden Canonicalizing, Using System Type, Specifying Names, Manual Configuration @section Getting the Canonical System Type The following macros make the system type available to @command{configure} @@ -11905,7 +12047,7 @@ Note that there can be artifacts due to the backward compatibility code. See @xref{Hosts and Cross-Compilation}, for more. address@hidden Using System Type address@hidden Using System Type, , Canonicalizing, Manual Configuration @section Using the System Type How do you use a canonical system type? Usually, you use it in one or @@ -11962,7 +12104,7 @@ @c ===================================================== Site Configuration. address@hidden Site Configuration address@hidden Site Configuration, Running configure Scripts, Manual Configuration, Top @chapter Site Configuration @command{configure} scripts support several kinds of local configuration @@ -11980,7 +12122,7 @@ * Site Defaults:: Giving @command{configure} local defaults @end menu address@hidden External Software address@hidden External Software, Package Options, Site Configuration, Site Configuration @section Working With External Software Some packages require, or can optionally use, other software packages @@ -12061,7 +12203,7 @@ support providing a help string. @end defmac address@hidden Package Options address@hidden Package Options, Pretty Help Strings, External Software, Site Configuration @section Choosing Package Options If a software package has optional compile-time features, the user can @@ -12130,7 +12272,7 @@ @end defmac address@hidden Pretty Help Strings address@hidden Pretty Help Strings, Site Details, Package Options, Site Configuration @section Making Your Help Strings Look Pretty Properly formatting the @samp{help strings} which are used in @@ -12181,7 +12323,7 @@ @end defmac address@hidden Site Details address@hidden Site Details, Transforming Names, Pretty Help Strings, Site Configuration @section Configuring Site Details Some software packages require complex site-specific information. Some @@ -12202,7 +12344,7 @@ Variables for Installation Directories, standards, @acronym{GNU} Coding Standards}, for more information on where to put data files. address@hidden Transforming Names address@hidden Transforming Names, Site Defaults, Site Details, Site Configuration @section Transforming Program Names When Installing Autoconf supports changing the names of programs when installing them. @@ -12228,7 +12370,7 @@ * Transformation Rules:: @file{Makefile} uses of transforming names @end menu address@hidden Transformation Options address@hidden Transformation Options, Transformation Examples, Transforming Names, Transforming Names @subsection Transformation Options You can specify name transformations by giving @command{configure} these @@ -12245,7 +12387,7 @@ perform @code{sed} substitution @var{expression} on the names. @end table address@hidden Transformation Examples address@hidden Transformation Examples, Transformation Rules, Transformation Options, Transforming Names @subsection Transformation Examples These transformations are useful with programs that can be part of a @@ -12283,7 +12425,7 @@ that only the binaries are renamed, therefore you'd have problems with the library files which might overlap. address@hidden Transformation Rules address@hidden Transformation Rules, , Transformation Examples, Transforming Names @subsection Transformation Rules Here is how to use the variable @code{program_transform_name} in a @@ -12323,7 +12465,7 @@ best to do name transformations on @code{man} pages but not on Texinfo manuals. address@hidden Site Defaults address@hidden Site Defaults, , Transforming Names, Site Configuration @section Setting Site Defaults Autoconf-generated @command{configure} scripts allow your site to provide @@ -12407,7 +12549,7 @@ @c ============================================== Running configure Scripts. address@hidden Running configure Scripts address@hidden Running configure Scripts, config.status Invocation, Site Configuration, Top @chapter Running @command{configure} Scripts @cindex @command{configure} @@ -12434,7 +12576,7 @@ @c ============================================== Recreating a Configuration address@hidden config.status Invocation address@hidden config.status Invocation, Obsolete Constructs, Running configure Scripts, Top @chapter Recreating a Configuration @cindex @command{config.status} @@ -12559,7 +12701,7 @@ @c =================================================== Obsolete Constructs address@hidden Obsolete Constructs address@hidden Obsolete Constructs, Using Autotest, config.status Invocation, Top @chapter Obsolete Constructs Autoconf changes, and throughout the years some constructs have been @@ -12580,7 +12722,7 @@ * Autoconf 2.13:: Some fresher tips @end menu address@hidden Obsolete config.status Use address@hidden Obsolete config.status Use, acconfig.h, Obsolete Constructs, Obsolete Constructs @section Obsolete @file{config.status} Invocation @file{config.status} now supports arguments to specify the files to @@ -12638,7 +12780,7 @@ for @code{CONFIG_COMMANDS} etc.) address@hidden acconfig.h address@hidden acconfig.h, autoupdate Invocation, Obsolete config.status Use, Obsolete Constructs @section @file{acconfig.h} @cindex @file{acconfig.h} @@ -12689,7 +12831,7 @@ self-contained, and should not depend upon @file{acconfig.h} etc. address@hidden autoupdate Invocation address@hidden autoupdate Invocation, Obsolete Macros, acconfig.h, Obsolete Constructs @section Using @command{autoupdate} to Modernize @file{configure.ac} @cindex @command{autoupdate} @@ -12741,7 +12883,7 @@ Directories are browsed from last to first. @end table address@hidden Obsolete Macros address@hidden Obsolete Macros, Autoconf 1, autoupdate Invocation, Obsolete Constructs @section Obsolete Macros Several macros are obsoleted in Autoconf, for various reasons (typically @@ -13460,11 +13602,11 @@ For C and C++, @var{includes} is any @code{#include} statements needed by the code in @var{function-body} (@var{includes} will be ignored if -the currently selected language is Fortran 77). This macro also uses address@hidden or @code{CXXFLAGS} if either C or C++ is the currently -selected language, as well as @code{CPPFLAGS}, when compiling. If -Fortran 77 is the currently selected language then @code{FFLAGS} will be -used when compiling. +the currently selected language is Fortran or Fortran 77). This macro +also uses @code{CFLAGS} or @code{CXXFLAGS} if either C or C++ is the +currently selected language, as well as @code{CPPFLAGS}, when compiling. +If Fortran 77 is the currently selected language then @code{FFLAGS} will +be used when compiling, or @code{FCFLAGS} for Fortran. @end defmac @defmac AC_TRY_CPP (@var{input}, @ovar{action-if-true}, @ovar{action-if-false}) @@ -13494,12 +13636,12 @@ For C and C++, @var{includes} is any @code{#include} statements needed by the code in @var{function-body} (@var{includes} will be ignored if -the currently selected language is Fortran 77). This macro also uses address@hidden or @code{CXXFLAGS} if either C or C++ is the currently -selected language, as well as @code{CPPFLAGS}, when compiling. If -Fortran 77 is the currently selected language then @code{FFLAGS} will be -used when compiling. However, both @code{LDFLAGS} and @code{LIBS} will -be used during linking in all cases. +the currently selected language is Fortran or Fortran 77). This macro +also uses @code{CFLAGS} or @code{CXXFLAGS} if either C or C++ is the +currently selected language, as well as @code{CPPFLAGS}, when compiling. +If Fortran 77 is the currently selected language then @code{FFLAGS} will +be used when compiling, or @code{FCFLAGS} for Fortran. However, both address@hidden and @code{LIBS} will be used during linking in all cases. @end defmac @defmac AC_TRY_LINK_FUNC (@var{function}, @ovar{action-if-found}, @ovar{action-if-not-found}) @@ -13603,7 +13745,7 @@ @code{AC_DECL_YYTEXT} @end defmac address@hidden Autoconf 1 address@hidden Autoconf 1, Autoconf 2.13, Obsolete Macros, Obsolete Constructs @section Upgrading From Version 1 Autoconf version 2 is mostly backward compatible with version 1. @@ -13624,7 +13766,7 @@ * Changed Macro Writing:: Better ways to write your own macros @end menu address@hidden Changed File Names address@hidden Changed File Names, Changed Makefiles, Autoconf 1, Autoconf 1 @subsection Changed File Names If you have an @file{aclocal.m4} installed with Autoconf (as opposed to @@ -13640,7 +13782,7 @@ @file{acconfig.h}, you still can, but you will have less clutter if you use the @code{AH_} macros. @xref{Autoheader Macros}. address@hidden Changed Makefiles address@hidden Changed Makefiles, Changed Macros, Changed File Names, Autoconf 1 @subsection Changed Makefiles Add @samp{@@CFLAGS@@}, @samp{@@CPPFLAGS@@}, and @samp{@@LDFLAGS@@} in @@ -13676,7 +13818,7 @@ The old behavior of replacing those variables without @samp{@@} characters around them has been removed. address@hidden Changed Macros address@hidden Changed Macros, Changed Results, Changed Makefiles, Autoconf 1 @subsection Changed Macros Many of the macros were renamed in Autoconf version 2. You can still @@ -13700,7 +13842,7 @@ address@hidden Changed Results address@hidden Changed Results, Changed Macro Writing, Changed Macros, Autoconf 1 @subsection Changed Results If you were checking the results of previous tests by examining the @@ -13758,7 +13900,7 @@ you were relying on a shell variable being set to something like 1 or @samp{t} for true, you need to change your tests. address@hidden Changed Macro Writing address@hidden Changed Macro Writing, , Changed Results, Autoconf 1 @subsection Changed Macro Writing When defining your own macros, you should now use @code{AC_DEFUN} @@ -13785,7 +13927,7 @@ encapsulate them into macros that you can share. address@hidden Autoconf 2.13 address@hidden Autoconf 2.13, , Autoconf 1, Obsolete Constructs @section Upgrading From Version 2.13 The introduction of the previous section (@pxref{Autoconf 1}) perfectly @@ -13811,7 +13953,7 @@ * AC_FOO_IFELSE vs AC_TRY_FOO:: A more generic scheme for testing sources @end menu address@hidden Changed Quotation address@hidden Changed Quotation, New Macros, Autoconf 2.13, Autoconf 2.13 @subsection Changed Quotation The most important changes are invisible to you: the implementation of @@ -13884,7 +14026,7 @@ @end example address@hidden New Macros address@hidden New Macros, Hosts and Cross-Compilation, Changed Quotation, Autoconf 2.13 @subsection New Macros @cindex undefined macro @@ -13939,7 +14081,7 @@ @end example address@hidden Hosts and Cross-Compilation address@hidden Hosts and Cross-Compilation, AC_LIBOBJ vs LIBOBJS, New Macros, Autoconf 2.13 @subsection Hosts and Cross-Compilation Based on the experience of compiler writers, and after long public @@ -14053,7 +14195,7 @@ @end example address@hidden AC_LIBOBJ vs LIBOBJS address@hidden AC_LIBOBJ vs LIBOBJS, AC_FOO_IFELSE vs AC_TRY_FOO, Hosts and Cross-Compilation, Autoconf 2.13 @subsection @code{AC_LIBOBJ} vs.@: @code{LIBOBJS} Up to Autoconf 2.13, the replacement of functions was triggered via the @@ -14135,7 +14277,7 @@ Note that @code{U} must not be used in your Makefiles. address@hidden AC_FOO_IFELSE vs AC_TRY_FOO address@hidden AC_FOO_IFELSE vs AC_TRY_FOO, , AC_LIBOBJ vs LIBOBJS, Autoconf 2.13 @subsection @code{AC_FOO_IFELSE} vs.@: @code{AC_TRY_FOO} Since Autoconf 2.50, internal codes uses @code{AC_PREPROC_IFELSE}, @@ -14202,7 +14344,7 @@ @c ============================= Generating Test Suites with Autotest address@hidden Using Autotest address@hidden Using Autotest, FAQ, Obsolete Constructs, Top @chapter Generating Test Suites with Autotest @cindex Autotest @@ -14253,7 +14395,7 @@ * Making testsuite Scripts:: Using autom4te to create @command{testsuite} @end menu address@hidden Using an Autotest Test Suite address@hidden Using an Autotest Test Suite, Writing testsuite.at, Using Autotest, Using Autotest @section Using an Autotest Test Suite @menu @@ -14261,7 +14403,7 @@ * Autotest Logs:: Their contents @end menu address@hidden testsuite Scripts address@hidden testsuite Scripts, Autotest Logs, Using an Autotest Test Suite, Using an Autotest Test Suite @subsection @command{testsuite} Scripts @cindex @command{testsuite} @@ -14371,7 +14513,7 @@ @end example address@hidden Autotest Logs address@hidden Autotest Logs, , testsuite Scripts, Using an Autotest Test Suite @subsection Autotest Logs When run, the test suite creates a log file named after itself, e.g., a @@ -14423,7 +14565,7 @@ @end table address@hidden Writing testsuite.at address@hidden Writing testsuite.at, testsuite Invocation, Using an Autotest Test Suite, Using Autotest @section Writing @file{testsuite.at} The @file{testsuite.at} is a Bourne shell script making use of special @@ -14533,7 +14675,7 @@ @end defmac address@hidden testsuite Invocation address@hidden testsuite Invocation, Making testsuite Scripts, Writing testsuite.at, Using Autotest @section Running @command{testsuite} Scripts @cindex @command{testsuite} @@ -14630,7 +14772,7 @@ @end table address@hidden Making testsuite Scripts address@hidden Making testsuite Scripts, , testsuite Invocation, Using Autotest @section Making @command{testsuite} Scripts For putting Autotest into movement, you need some configuration and @@ -14731,7 +14873,7 @@ @c =============================== Frequent Autoconf Questions, with answers address@hidden FAQ address@hidden FAQ, History, Using Autotest, Top @chapter Frequent Autoconf Questions, with answers Several questions about Autoconf come up occasionally. Here some of them @@ -14747,7 +14889,7 @@ * Present But Cannot Be Compiled:: Compiler and Preprocessor Disagree @end menu address@hidden Distributing address@hidden Distributing, Why GNU m4, FAQ, FAQ @section Distributing @command{configure} Scripts @display @@ -14770,7 +14912,7 @@ same terms as the rest of your package. @file{install-sh} is from the X Consortium and is not copyrighted. address@hidden Why GNU m4 address@hidden Why GNU m4, Bootstrapping, Distributing, FAQ @section Why Require @acronym{GNU} M4? @display @@ -14799,7 +14941,7 @@ other free software already have most of the @acronym{GNU} utilities installed, since they prefer them. address@hidden Bootstrapping address@hidden Bootstrapping, Why Not Imake, Why GNU m4, FAQ @section How Can I Bootstrap? @display @@ -14814,7 +14956,7 @@ required if you want to change the M4 @command{configure} script, which few people have to do (mainly its maintainer). address@hidden Why Not Imake address@hidden Why Not Imake, Defining Directories, Bootstrapping, FAQ @section Why Not Imake? @display @@ -14920,7 +15062,7 @@ @end quotation address@hidden Defining Directories address@hidden Defining Directories, autom4te.cache, Why Not Imake, FAQ @section How Do I @code{#define} Installation Directories? @display @@ -14989,7 +15131,7 @@ @end itemize address@hidden autom4te.cache address@hidden autom4te.cache, Present But Cannot Be Compiled, Defining Directories, FAQ @section What is @file{autom4te.cache}? @display @@ -15034,7 +15176,7 @@ @option{--force}. address@hidden Present But Cannot Be Compiled address@hidden Present But Cannot Be Compiled, , autom4te.cache, FAQ @section Header Present But Cannot Be Compiled The most important guideline to bear in mind when checking for @@ -15128,7 +15270,7 @@ @c ===================================================== History of Autoconf. address@hidden History address@hidden History, Copying This Manual, FAQ, Top @chapter History of Autoconf You may be wondering, Why was Autoconf originally written? How did it @@ -15145,7 +15287,7 @@ * Deuteronomy:: Approaching the promises of easy configuration @end menu address@hidden Genesis address@hidden Genesis, Exodus, History, History @section Genesis In June 1991 I was maintaining many of the @acronym{GNU} utilities for the @@ -15167,7 +15309,7 @@ adding @samp{+srcdir}, the first option (of many); and creating @file{config.status} files. address@hidden Exodus address@hidden Exodus, Leviticus, Genesis, History @section Exodus As I got feedback from users, I incorporated many improvements, using @@ -15221,7 +15363,7 @@ several programs, including @code{tvtwm}, and I was interested in trying out a new language. address@hidden Leviticus address@hidden Leviticus, Numbers, Exodus, History @section Leviticus Since my @command{configure} scripts determine the system's capabilities @@ -15248,7 +15390,7 @@ release to release. They all contributed many specific checks, great ideas, and bug fixes. address@hidden Numbers address@hidden Numbers, Deuteronomy, Leviticus, History @section Numbers In July 1992, after months of alpha testing, I released Autoconf 1.0, @@ -15282,7 +15424,7 @@ @code{AC_DEFINE} and fixed many bugs, especially when I got sick of dealing with portability problems from February through June, 1993. address@hidden Deuteronomy address@hidden Deuteronomy, , Numbers, History @section Deuteronomy A long wish list for major features had accumulated, and the effect of @@ -15334,7 +15476,7 @@ @c ========================================================== Appendices address@hidden Copying This Manual address@hidden Copying This Manual, Indices, History, Top @appendix Copying This Manual @menu @@ -15343,7 +15485,7 @@ @include fdl.texi address@hidden Indices address@hidden Indices, , Copying This Manual, Top @appendix Indices @menu @@ -15357,7 +15499,7 @@ * Concept Index:: General index @end menu address@hidden Environment Variable Index address@hidden Environment Variable Index, Output Variable Index, Indices, Indices @appendixsec Environment Variable Index This is an alphabetical list of the environment variables that Autoconf @@ -15365,7 +15507,7 @@ @printindex ev address@hidden Output Variable Index address@hidden Output Variable Index, Preprocessor Symbol Index, Environment Variable Index, Indices @appendixsec Output Variable Index This is an alphabetical list of the variables that Autoconf can @@ -15375,7 +15517,7 @@ @printindex ov address@hidden Preprocessor Symbol Index address@hidden Preprocessor Symbol Index, Autoconf Macro Index, Output Variable Index, Indices @appendixsec Preprocessor Symbol Index This is an alphabetical list of the C preprocessor symbols that the @@ -15384,7 +15526,7 @@ @printindex cv address@hidden Autoconf Macro Index address@hidden Autoconf Macro Index, M4 Macro Index, Preprocessor Symbol Index, Indices @appendixsec Autoconf Macro Index This is an alphabetical list of the Autoconf macros. @@ -15395,7 +15537,7 @@ @printindex AC address@hidden M4 Macro Index address@hidden M4 Macro Index, Autotest Macro Index, Autoconf Macro Index, Indices @appendixsec M4 Macro Index This is an alphabetical list of the M4, M4sugar, and M4sh macros. @@ -15406,7 +15548,7 @@ @printindex MS address@hidden Autotest Macro Index address@hidden Autotest Macro Index, Program & Function Index, M4 Macro Index, Indices @appendixsec Autotest Macro Index This is an alphabetical list of the Autotest macros. @@ -15417,7 +15559,7 @@ @printindex AT address@hidden Program & Function Index address@hidden Program & Function Index, Concept Index, Autotest Macro Index, Indices @appendixsec Program and Function Index This is an alphabetical list of the programs and functions which @@ -15425,7 +15567,7 @@ @printindex pr address@hidden Concept Index address@hidden Concept Index, , Program & Function Index, Indices @appendixsec Concept Index This is an alphabetical list of the files, tools, and concepts