Changes between Version 5 and Version 6 of pm-structure-config


Ignore:
Timestamp:
Oct 18, 2006 1:53:31 PM (14 years ago)
Author:
lou
Comment:

Typos and readability.

Legend:

Unmodified
Added
Removed
Modified
  • pm-structure-config

    v5 v6  
    22
    33Make sure you read the [wiki:pm-autotools-intro introduction to the autotools] first.
    4 [http://www.gnu.org/software/autoconf/manual/ Here you can find the full Autoconf documentation].
     4[http://www.gnu.org/software/autoconf/manual/ Here you can find the full autoconf documentation].
    55
    66== General Concepts ==
    77
    8 Autoconf works by running the preprocessor program {{{m4}}}, using the {{{configure.ac}}} as input.  This input file containts '''preprocessor macros''', that are expanded (recursively), until in the end a pure shell script for {{{/bin/sh}}} is created.  The {{{configure.ac}}} input file can also contain '''/bin/sh commands''', which will appear literally in the final {{{configure}}} script.
     8Autoconf works by running the preprocessor program {{{m4}}}, using the {{{configure.ac}}} file as input.  This file contains '''preprocessor macros''' that are expanded (recursively) until, in the end, a pure shell script for {{{/bin/sh}}} is created.  The {{{configure.ac}}} input file can also contain '''/bin/sh commands''', which will appear literally in the final {{{configure}}} script.
    99
    1010Everything in a line following a "{{{#}}}" is a '''comment'''.  Comments are usually copied into the generated {{{configure}}} script, unless the line starts with at least two "{{{#}}}".
    1111
    12 By convention, macro names are capitalized, and they start with '''AC_''' if the macro is an Automake feature, or '''AM_''' if it corresponds to a macro in connection with Automake (such as {{{AM_CONDITIONAL}}}, which defines an Automake conditional that can be used for an "{{{if}}}" in the {{{Makefile.am}}} file).  We also provide additional custom macros for COIN configuration (in the {{{BuildTools/coin.m4}}} file), which start with '''AC_COIN_'''. [http://www.gnu.org/software/autoconf/manual/ In the Autoconf documentation you find a description of the predefined autoconf macros].
     12By convention, macro names are capitalized, and they start with '''AC_''' if the macro is an autoconf feature, or '''AM_''' if it corresponds to a macro in connection with automake (such as {{{AM_CONDITIONAL}}}, which defines an automake conditional that can be used for an "{{{if}}}" in the {{{Makefile.am}}} file).  We provide additional custom macros for COIN configuration (in the {{{BuildTools/coin.m4}}} file), which start with '''AC_COIN_'''. [http://www.gnu.org/software/autoconf/manual/ In the autoconf documentation] you can find a description of the predefined autoconf macros.
    1313
    14 Macros can be given arguments, depending on the macro.  Arguments are separated by commas.  If a macro takes, say, four arguments, but only two are provided, then the last two arguments are assumed to be unset.  The '''quotation symbols''' for Autoconf are the squared bracket "{{{[}}}" and "{{{]}}}".  Sometimes it is necessary to enclose arguments in those brackets, for example, when the argument itself contains a comma.  If in doubt, use quotation.
     14Macros can be given arguments, depending on the macro.  Arguments are separated by commas.  If a macro takes, say, four arguments, but only two are provided, then the last two arguments are assumed to be unset.  The '''quotation symbols''' for autoconf are the square brackets "{{{[}}}" and "{{{]}}}".  Sometimes it is necessary to enclose arguments in those brackets, for example, when the argument itself contains a comma.  If in doubt, use quotation.
    1515
    1616== Beginning of the configure.ac file ==
     
    5252}}}
    5353
    54  * The file should contain the '''copyright note''', information about the '''authors''', and state under what '''license''' the file is made available.  Note the '''$Id ...$''' string.  This is a subversion keyword, which is expanded to contain information about the file, such as revision number, author and date of the last submission etc, when the file is submitted (assuming that the {{{svn::keywords}}} property for this file contains "{{{Id}}}").
     54 * The file should contain the '''copyright notice''', information about the '''authors''', and state under what '''license''' the file is made available.  Note the '''$Id ...$''' string.  This is a subversion keyword, which is expanded to contain information about the file, such as revision number, author and date of the last submission etc, when the file is submitted (assuming that the {{{svn::keywords}}} property for this file contains "{{{Id}}}").
    5555
    56  * The '''AC_PREREQ''' macro specifies the version number of autoconf that is required to generated a {{{configure}}} script from this input file.  In COIN we ask people to [wiki:pm-get-autotools use exactly the same versions of all the GNU autotools], so that we can collectively take care of bug fixes, and can avoid that different versions of the autotools generate large difference of the resulting output files if two developers work on a project simultaneously.
     56 * The '''AC_PREREQ''' macro specifies the version number of autoconf that is required to generated a {{{configure}}} script from this input file.  In COIN we ask people to [wiki:pm-get-autotools use exactly the same versions of all the GNU autotools], so that we can collectively take care of bug fixes, and can avoid the situation where different versions of the autotools generate large differences in the generated configuration files when multiple developers work on a project simultaneously.
    5757
    58  * The '''AC_INIT''' macro takes as arguments the name of the project, its version number, and contact information in case a user wants to get in touch with the developers, e.g., in order to report a bug.  The name and version number determine the name of the tarball that can be created with {{{make dist}}}.
     58 * The '''AC_INIT''' macro takes as arguments the name of the project, its version number, and contact information in case a user wants to get in touch with the developers, ''e.g.'', in order to report a bug.  The name and version number determine the name of the tarball that can be created with {{{make dist}}}.
    5959
    60  * The argument of the '''AC_COPYRIGHT''' macro is copied as the copyright note into the generated {{{configure}}} script.
     60 * The argument of the '''AC_COPYRIGHT''' macro becomes the copyright notice in the generated {{{configure}}} script.
    6161
    62  * The '''AC_CONFIG_SRCDIR''' helps the {{{configure}}} script to do a sanity check. When executed, the {{{configure}}} script tests, if it is in the correct location with respect to the rest of the package.  As argument, one provides a file (such as a source file) that belongs to the package.
     62 * The '''AC_CONFIG_SRCDIR''' helps the {{{configure}}} script to do a sanity check. When executed, the {{{configure}}} script tests if it is in the correct location with respect to the rest of the package.  As argument, one provides a file (such as a source file) that belongs to the package.
    6363
    64  * The argument of the '''AC_PREFIX_DEFAULT''' determines where the products of the compilcation should be installed by a {{{make install}}}, unless this location is overwritten by a user by specifying the {{{--prefix}}} argument to configure.  In COIN, we decided to use as default location the directory where the {{{configure}}} script is run.
     64 * The argument of the '''AC_PREFIX_DEFAULT''' macro determines where the products of the compilation should be installed by a {{{make install}}}, unless this location is overwritten by the user specifying the {{{--prefix}}} argument to configure.  In COIN, we decided to use as the default location the directory where the {{{configure}}} script is run.
    6565
    66  As you can see in the invocation of this macro. it is '''possible to give a shell command as argument for the macro''' (in this case we tell autoconf to use the output of {{{pwd}}} during the configuration run).  Note, however, that it is not possible for all autoconf macros to specify arguments, whose value is determined when the final {{{configure}}} script is run by the user.
     66 As you can see in the invocation of this macro. it is '''possible to give a shell command as an argument for a macro'''. (In this case we tell autoconf to use the output of {{{pwd}}} that will be produced when the generated {{{configure}}} script is run.) But don't forget that autoconf and automake only perform macro expansion. Shell commands used as parameters to autoconf macros are just text strings to autoconf. They are not executed until the generated {{{configure}}} script is executed.
    6767
    6868== The Body of the configure.ac File ==
    6969
    70 After the initialization described above, the {{{configure.ac}}} usually contains a number of '''macros that will be translated into the tests''' that are to be run by the final {{{configure}}} script.
     70After the initialization described above, {{{configure.ac}}} usually contains a number of '''macros that will be translated into the tests''' that are to be run by the final {{{configure}}} script.
    7171
    7272 * Usually, one first checks for the '''availability and names of programs''' (such as compilers and other tools).