Changes between Version 11 and Version 12 of pm-autotools-intro
- Timestamp:
- Apr 16, 2007 7:35:44 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pm-autotools-intro
v11 v12 24 24 You '''don't have to create most template files'''; they are generated by the various autotools. For example, {{{automake}}} automatically generates {{{Makefile.in}}} from {{{Makefile.am}}} and {{{configure.ac}}}. 25 25 26 Another template file found in many COIN p ackages is the ''pkg''{{{_addlibs.txt.in}}} file, used to generate ''pkg''{{{_addlibs.txt}}}. The generated file includes the string that should be added to the link command to specify additional libraries required by the package. For example, the OSI packageuses the template file {{{osi_addlibs.txt.in}}}; it contains the single line26 Another template file found in many COIN projects is the ''prjct''{{{_addlibs.txt.in}}} file, used to generate ''prjct''{{{_addlibs.txt}}}. The generated file includes the string that should be added to the link command to specify additional libraries required by the project. For example, the OSI project uses the template file {{{osi_addlibs.txt.in}}}; it contains the single line 27 27 {{{ 28 28 @ADDLIBS@ … … 45 45 46 46 The {{{configure}}} script will place {{{#define}}} statements in the configuration header file. These can simply define a symbol or set a symbol to a specific value (such as the path to a default directory). In COIN, '''the convention is to 47 use the name {{{config_}}}''p kg''{{{.h}}} for the configuration header file for ''pkg''.''' However, to make it possible to compile the COIN code in environments which do not support autotools (''e.g.'', MS Developer Studio), this file should not be included directly in your source code. Instead, a '''"wrapper" header file ''Pkg''{{{Config.h}}} should be used'''. On UNIX-like machines this wrapper should include {{{config_}}}''pkg''{{{.h}}}. On other systems, it should include a system specific header file for platform dependencies, plus definitions for other symbols which may need to be changed by the user. Look to existing COIN projects for examples.47 use the name {{{config_}}}''prjct''{{{.h}}} for the configuration header file for ''Prjct''.''' However, to make it possible to compile the COIN code in environments which do not support autotools (''e.g.'', MS Developer Studio), this file should not be included directly in your source code. Instead, a '''"wrapper" header file ''Prjct''{{{Config.h}}} should be used'''. On UNIX-like machines this wrapper should include {{{config_}}}''prjct''{{{.h}}}. On other systems, it should include a system specific header file for platform dependencies, plus definitions for other symbols which may need to be changed by the user. Look to existing COIN projects for examples. 48 48 49 49 == {{{automake}}} == 50 50 51 Automake is a package that'''generates {{{Makefile.in}}} template files for {{{autoconf}}}'''. The generated makefiles are very powerful; for example, they support automatic header file dependency tracking, if this information can be somehow obtained from the compiler. The makefiles work with any UNIX {{{make}}}, they have targets like {{{install}}}, {{{uninstall}}}, {{{clean}}}, {{{distclean}}}, and {{{dist}}}.51 Automake '''generates {{{Makefile.in}}} template files for {{{autoconf}}}'''. The generated makefiles are very powerful; for example, they support automatic header file dependency tracking, if this information can be somehow obtained from the compiler. The makefiles work with any UNIX {{{make}}}, they have targets like {{{install}}}, {{{uninstall}}}, {{{clean}}}, {{{distclean}}}, and {{{dist}}}. 52 52 53 53 {{{Makefiles}}} generated by {{{automake}}} can '''work recursively''' and support parallel compilation (''e.g.'', with the {{{-j}}} flag of GNU {{{make}}}). Also, it is possible to specify conditional content in the {{{Makefile}}}, the activation of which depends on the output of a test performed by the {{{configure}}} script. This