Fixed distdef prefix handling and processing of non-source files
[autodist.git] / apps / autodist / doc / autodist.texi
index d0792a6707c5ef919bb2a7ec71a76084024d588c..3d8c29268d950f47ec207842b3966652dcdf1b23 100644 (file)
@@ -9,26 +9,13 @@
 
 @copying
 
-This manual is for SILC Autodist (version @value{VERSION},
-@value{UPDATED}), a program which is used to manage and create source
-distributions.
-
-Copyright @copyright{} 2004 - 2005 Pekka Riikonen, SILC Project
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the @acronym{GNU} Free Documentation License,
-Version 1.2 or any later version published by the Free Software
-Foundation; with no Invariant Sections, with the Front-Cover texts
-being ``A @acronym{GNU} Manual,'' and with the Back-Cover Texts as in
-(a) below.  A copy of the license is included in the section entitled
-``@acronym{GNU} Free Documentation License.''
-
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and
-modify this @acronym{GNU} Manual, like @acronym{GNU} software.  Copies
-published by the Free Software Foundation raise funds for
-@acronym{GNU} development.''
-@end quotation
+Autodist is a source distribution management system that allows powerful
+mechanisms to define what is included in and excluded from a distribution
+and what license is used. It is especially targeted at large software
+projects that create multiple distributions from a source tree. Autodist
+supports distribution management in directory, file, and file content
+level, and automatic relicensing of a distribution.
+
 @end copying
 
 @dircategory Software development
@@ -42,7 +29,7 @@ published by the Free Software Foundation raise funds for
 @end direntry
 
 @titlepage
-@title SILC Autodist
+@title Autodist
 @subtitle For version @value{VERSION}, @value{UPDATED}
 @author Pekka Riikonen
 @page
@@ -53,7 +40,7 @@ published by the Free Software Foundation raise funds for
 @ifnottex
 @node Top
 @comment  node-name,  next,  previous,  up
-@top SILC Autodist
+@top Autodist
 
 @insertcopying
 
@@ -62,10 +49,9 @@ published by the Free Software Foundation raise funds for
 * Integrating Autodist::        Integrating Autodist into your project
 * Invoking Autodist::           Running Autodist
 * Examples::                    Examples using Autodist
+* Download::                   Download @url{http://silcnet.org/download/autodist/, Autodist @value{VERSION}}
 
 @detailmenu
- --- The Detailed Node Listing ---
-
 Introduction
 
 * Motivation::                  Reasons for using Autodist
@@ -80,6 +66,7 @@ Integrating Autodist
 * Makefile.ad files::           Makefile.ad for creating Makefile.am
 * Other .ad files::             Other files with .ad suffix
 * Distdefines::                 Using distdefs in files
+* Dependencies::                Autodist dependency support
 
 Invoking Autodist
 
@@ -116,7 +103,7 @@ The Autodist creates 'Makefile.am' files from 'Makefile.ad' files and
 ending with '.ad' suffix will also be processed.  The processed file will
 have the '.ad' suffix removed (@pxref{Preparing source tree, , , , }).
 Autodist also creates and packages the distribution using common GNU
-distribution creation process, specificly `make dist'.  Autodist, however,
+distribution creation process, specifically `make dist'.  Autodist, however,
 controls this process and during packaging phase the Autodist processes
 all files in the distribution (other than '*.ad' files, which has already
 been processed earlier by Autodist).  The resulted package is a processed
@@ -139,7 +126,7 @@ compile sources before they have been processed, and undefined lines
 are removed.  The distdefs are respected in source files by the
 preprocessor.
 
-Autodist is not a binary packaging system.  It is specificly used to
+Autodist is not a binary packaging system.  It is specifically used to
 create source distributions.  A binary packaging system, however can be
 hooked to the distribution creation process, if needed.
 
@@ -189,7 +176,7 @@ have had the need to create their own ad-hoc mechanisms to control
 distribution creation.  The Autodist attempts to provide a tool that any
 size software project can effectively use to manage their distributions.
 
-Without a tool like Autodist, large software projects usually has to be
+Without a tool like Autodist, large software projects usually have to be
 split into separate source trees, which may not always be possible because
 they may share large portions of common code (which may further make
 concurrent development of the applications hard), or multiple Autoconf and
@@ -240,6 +227,7 @@ as they may not exist yet.
 * Makefile.ad files::           Makefile.ad for creating Makefile.am
 * Other .ad files::             Other files with .ad suffix
 * Distdefines::                 Using distdefs in files
+* Dependencies::                Autodist dependency support
 @end menu
 
 
@@ -349,7 +337,7 @@ AUTOMAKE="automake -a -c"
 The 'AUTOMAKE' specifies the location of the 'automake' tool.  If
 Autodist should not run 'automake' this option may be removed or set
 to empty value.  User need to then run it manually.  By default, the
-'-a'  and '-c' options are given to 'automake' to add any missing required 
+'-a'  and '-c' options are given to 'automake' to add any missing required
 files.
 
 
@@ -427,7 +415,8 @@ and are ignored.
 
 The 'name' directive defines the name of the distribution.  It is optional
 directive, and if omitted the distribution name will be the name of the
-distfile.
+distfile.  The 'PACKAGE_NAME' define delivered by Autoconf will contain
+this name string.
 
 Example:
 @example
@@ -444,6 +433,8 @@ optional directive, and if omitted the distribution package name will
 be the name of the distribution, if defined, or if omitted, then the name
 of the distfile.  If this directive is omitted then normal GNU convention
 is used to decide the package name, derived from the distribution name.
+The 'PACKAGE_TARNAME' define delivered by Autoconf will contain this
+package name string.
 
 Example:
 @example
@@ -458,8 +449,8 @@ Will create distribution packages named, for example, as
 
 The 'bug-report' directive can be used to define the email address where
 the bug-reports for the distribution should be sent.  The directive is
-optional.  The 'bug-report' email address will be set for the Autoconf
-which will deliver it via AC_INIT macro.
+optional.  The 'PACKAGE_BUGREPORT' define delivered by Autoconf will
+contain this bug report string.
 
 
 @section Directive: license <filename>
@@ -497,6 +488,10 @@ Will replace all appearances of the license header in 'license/BSD-header'
 file to the license header in 'license/GPL-header' in any file in the
 distribution.  Note that, the header change will be performed when
 the distribution is packaged (@pxref{Creating distribution, , , , }).
+The 'makedist.log' file created by Autodist during distribution packaging
+will list all files that were not re-licensed.  The log file can be used
+to check that the distribution is re-licensed correctly, and fix any
+possible mistakes.
 
 With 'license-header' directive you may initially set your files in the
 source tree into what ever license you prefer.  However, if you need to
@@ -513,8 +508,8 @@ If the new header file has fewer lines that the current header file, all
 of the lines from the current header will not be replaced.  If the new header
 has fewer lines, empty lines must be added to it.  If the new header file
 has more lines than the current header file, the extra lines will not appear
-in the replaced header.  Basic rule is to always make sure the header file
-has equal amount of lines in them.
+in the replaced header.  Basic rule is to always make sure the header
+files have equal amount of lines in them.
 
 Second limitation is in indentation of the header files.  It is suggested,
 though not mandatory, that the header files have the same indentation as
@@ -524,6 +519,16 @@ the header file should start the license text at the second character also.
 If same indentation is not used the appearance of the replaced header
 may not be perfect.  While this is a cosmetic issue, one still to remember.
 
+Third limitation is that the distribution cannot be partially re-licensed.
+If the 'license-header' directive is used then all files that have the
+specified header will be replaced with the new header.  There are
+currently two ways to not re-license a file;  use different license header
+in the file than one specified in 'license-header', or specify the file or
+directory in 'noprocess' directive.  Using 'noprocess' is not possible if
+the file needs to be otherwise processed for the distribution.  Future
+versions of Autodist may provide a mechanism to re-license only part of
+the distribution.
+
 Example current header:
 @example
 --- Start example
@@ -554,12 +559,26 @@ Example new header:
 
 In this example, if the text in the current header file is found in any
 file in the distribution it will be replaced with the new header file.
-Notice that, both header files has same amount of lines (8 lines).
+Notice that, both header files have same amount of lines (8 lines).
 
-Note that, the current header must match exactly the header used in 
+Note that, the current header must match exactly the header used in
 files.  Otherwise the replacement will not be complete.
 
 
+@section Directive: prereq <version>
+
+The 'prereq' may be used to enforce the Autodist version.  If the Autodist
+version used to process the distribution is older than the version
+specified with 'prereq' the Autodist will fail.
+
+Example:
+@example
+prereq 1.3.2
+@end example
+
+Will require Autodist 1.3.2 or newer for this distribution.
+
+
 @section Directive: inherit <distfile>
 
 The Autodist provides inheritance of distributions.  The 'inherit'
@@ -568,13 +587,14 @@ into the distribution.  The <distfile> specifies the name of the
 inherited distribution.  If the distribution cannot be inherited Autodist
 will give an error.
 
-The 'inherit' will inherit the following information from the distribution:
-distdefs, undefines, includes, excludes and noprocess.  Other information
-will not be inherited.  If the inherited distribution inherits other
-distributions, they will also be inherited automatically.  User should be
-careful when inheriting distributions as it may be possible to create an
-infinite recursion.  The Autodist would allow for this and not detect this
-error.  Zero or more 'inherit' directives may be set for distribution.
+The 'inherit' will inherit the following information from the
+distribution: distdefs, undefines, includes, excludes and noprocesses.
+Other information will not be inherited.  If the inherited distribution
+inherits other distributions, they will also be inherited automatically.
+User should be careful when inheriting distributions as it may be possible
+to create an infinite recursion.  The Autodist would allow for this and
+not detect this error.  Zero or more 'inherit' directives may be set for
+distribution.
 
 Example:
 @example
@@ -587,6 +607,21 @@ Will inherit distributions 'common', 'client' and 'toolkit' into this
 distribution.  All distdefs, undefines, includes, excludes and noprocesses
 from these distributions are now also part this distribution.
 
+The distribution that is being prepared or packaged take precedence when
+defining distdefs that were specifically undefined in the inherited
+distribution.  This means that if the inherited distribution specifically
+undefines a distdefs but the inheriting distribution (one being prepared
+or packaged) specifically defines it, the distdef will be defined.
+Similarly, if the inherited distribution defines a distdef but the
+inheriting distribution undefines it, the distdef will be undefined.
+Note that, this precedence works only in the top distribution (the one
+being prepared or packaged).  If the inherited distribution inherits other
+distributions, all distdefs (defined and specifically undefined) will be
+inherited as is.  This means that if one inherited distribution defines a
+distdef that other inherited distribution distdef undefines, it will be
+undefined.  However, the top distribution can then override them if
+needed.
+
 
 @section Directive: define <symbol>
 
@@ -643,10 +678,10 @@ When set, the distribution is a template distribution.  Templates are
 special distributions which cannot be prepared or packaged with Autodist.
 Templates can only be inherited.  Usually, templates are used to define a
 common template distribution for other distributions.  Templates may set
-distdefs, undefines, includes and excludes.  A large software project
-could have several distributions that share a common base.  In this case
-defining the common base as a template distribution and then inheriting
-that distribution makes it easier to manage the distfiles.
+distdefs, undefines, includes, excludes and noprocesses.  A large software
+project could have several distributions that share a common base.  In
+this case defining the common base as a template distribution and then
+inheriting that distribution makes it easier to manage the distfiles.
 
 @example
 no-dist
@@ -756,24 +791,25 @@ This will exclude the file 'README' and anything that match 'doc/client*'.
 
 @section Directive: noprocess <filename> [...]
 
-The 'noprocess' directive can be used to tell Autodist specificly not to
-process a file.  The Autodist will not process the file during
-preparation or during distribution packaging.  This directive is optional.
-One or more file can be specified in the 'noprocess' directive.  Zero or
-more 'noprocess' directives can be used in distribution.  The <filename>
-can be a single file, a single directory or a regular expression that
-will match several files and/or directories.  If directory is specified
-then all files inside the directory will not be processed.
+The 'noprocess' directive can be used to tell Autodist specifically not to
+process files or directories.  The Autodist will not process the files
+during distribution packaging.  This directive is optional.  One or more
+files can be specified in the 'noprocess' directive.  Zero or more
+'noprocess' directives can be used in distribution.  The <filename> can be
+a single file, a single directory or a regular expression that will match
+several files and/or directories.
 
 Example:
 @example
 noprocess autodist.texi
+noprocess apps/foo/
 @end example
 
-Autodist will not process 'autodist.texi' file.
+Autodist will not process 'autodist.texi' file, and any files and
+directories under 'apps/foo/'.
 
-Note that, 'noprocess' directive cannot be used to disallow processing
-of any file with '.ad' suffix.
+Note that, 'noprocess' directive cannot be used to disallow
+processing of any file with '.ad' suffix.
 
 
 @section Directive: pre-hook <filename> [...]
@@ -785,9 +821,11 @@ Zero or more 'pre-hook' directives may be set for distribution.  The
 'pre-hook' hook will be run immediately after invoking Autodist to start
 preparing the source tree for configuration and compilation (@pxref{Preparing source tree, , , , }).
 
-The scripts will get three (3) command line arguments when Autodist
-executes the script: distribution name, distribution version and package
-name of distribution.  The script may use these arguments if it needs them.
+The scripts will get at least three (3) command line arguments when
+Autodist executes the script: distribution name, distribution version and
+package name of distribution.  The script may use these arguments if it
+needs them.  If user passed any extra parameters to autodist in the
+command line they will also be passed to the script as last arguments.
 
 
 @section Directive: post-hook <filename> [...]
@@ -800,42 +838,48 @@ Zero or more 'post-hook' directives may be set for distribution.  The
 preparing the source three for configuration and compilation (@pxref{Preparing source tree, , , , }).  The Autodist will exit after it has run the
 'post-hook' scripts.
 
-The scripts will get three (3) command line arguments when Autodist
-executes the script: distribution name, distribution version and package
-name of distribution.  The script may use these arguments if it needs them.
+The scripts will get at least three (3) command line arguments when
+Autodist executes the script: distribution name, distribution version and
+package name of distribution.  The script may use these arguments if it
+needs them.  If user passed any extra parameters to autodist in the
+command line they will also be passed to the script as last arguments.
 
 
 @section Directive: pre-process-dist-hook <filename> [...]
 
-The 'pre-process-dist-hook' directive can be used define additional 
+The 'pre-process-dist-hook' directive can be used define additional
 scripts that will be run when Autodist has started distribution creation.
-This directive is optional.  One or more scripts may be defined in one 
-'pre-process-dist-hook' directive.  Zero or more 'pre-process-dist-hook' 
-directives may be set for distribution.  The 'pre-process-dist-hook' hook 
-will be run immediately after the Autodist has created the distribution 
+This directive is optional.  One or more scripts may be defined in one
+'pre-process-dist-hook' directive.  Zero or more 'pre-process-dist-hook'
+directives may be set for distribution.  The 'pre-process-dist-hook' hook
+will be run immediately after the Autodist has created the distribution
 directory but has not yet started any distribution processing.
 
-The scripts will get four (4) command line arguments when Autodist
-executes the script: distribution name, distribution version, package
-name of distribution and destination distribution directory name.  The
-script may use these arguments if it needs them.
+The scripts will get at least four (4) command line arguments when
+Autodist executes the script: distribution name, distribution version,
+package name of distribution and destination distribution directory name.
+The script may use these arguments if it needs them.  If user passed any
+extra parameters to autodist in the command line they will also be passed
+to the script as last arguments.
 
 
 @section Directive: post-process-dist-hook <filename> [...]
 
-The 'post-process-dist-hook' directive can be used define additional 
-scripts that will be run when Autodist has finished distribution 
-processing.  This directive is optional.  One or more scripts may be 
-defined in one 'post-process-dist-hook' directive.  Zero or more 
-'post-process-dist-hook' directives may be set for distribution.  The 
-'post-process-dist-hook' hook will be run immediately after the Autodist 
-has finished processing the destination distribution directory but has not 
+The 'post-process-dist-hook' directive can be used define additional
+scripts that will be run when Autodist has finished distribution
+processing.  This directive is optional.  One or more scripts may be
+defined in one 'post-process-dist-hook' directive.  Zero or more
+'post-process-dist-hook' directives may be set for distribution.  The
+'post-process-dist-hook' hook will be run immediately after the Autodist
+has finished processing the destination distribution directory but has not
 yet created the distribution package.
 
-The scripts will get four (4) command line arguments when Autodist
-executes the script: distribution name, distribution version, package
-name of distribution and destination distribution directory name.  The
-script may use these arguments if it needs them.
+The scripts will get at least four (4) command line arguments when
+Autodist executes the script: distribution name, distribution version,
+package name of distribution and destination distribution directory name.
+The script may use these arguments if it needs them.  If user passed any
+extra parameters to autodist in the command line they will also be passed
+to the script as last arguments.
 
 
 @section Directive: pre-dist-hook <filename> [...]
@@ -848,26 +892,30 @@ distribution.  The 'pre-dist-hook' hook will be run immediately after
 the Autodist has started distribution creation, but has not yet created
 the distribution directory.  This hook is run before 'pre-process-dist-hook'.
 
-The scripts will get four (4) command line arguments when Autodist
-executes the script: distribution name, distribution version, package
-name of distribution and destination distribution directory name.  The
-script may use these arguments if it needs them.
+The scripts will get at least four (4) command line arguments when
+Autodist executes the script: distribution name, distribution version,
+package name of distribution and destination distribution directory name.
+The script may use these arguments if it needs them.  If user passed any
+extra parameters to autodist in the command line they will also be passed
+to the script as last arguments.
 
 
 @section Directive: post-dist-hook <filename> [...]
 
-The 'post-dist-hook' directive can be used define additional scripts that 
-will be run when Autodist has finished distribution creation.  This 
-directive is optional.  One or more scripts may be defined in one 
-'post-dist-hook' directive.  Zero or more 'post-dist-hook' directives may 
-be set for distribution.  The 'post-dist-hook' hook will be run 
+The 'post-dist-hook' directive can be used define additional scripts that
+will be run when Autodist has finished distribution creation.  This
+directive is optional.  One or more scripts may be defined in one
+'post-dist-hook' directive.  Zero or more 'post-dist-hook' directives may
+be set for distribution.  The 'post-dist-hook' hook will be run
 immediately after the Autodist has finished creating the distribution
 package.  This is the last hook Autodist runs.
 
-The scripts will get four (4) command line arguments when Autodist
-executes the script: distribution name, distribution version, package
-name of distribution and destination distribution directory name.  The
-script may use these arguments if it needs them.
+The scripts will get at least four (4) command line arguments when
+Autodist executes the script: distribution name, distribution version,
+package name of distribution and destination distribution directory name.
+The script may use these arguments if it needs them.  If user passed any
+extra parameters to autodist in the command line they will also be passed
+to the script as last arguments.
 
 
 @section Running hooks
@@ -875,17 +923,27 @@ script may use these arguments if it needs them.
 The Autodist runs the hooks in the following order:
 
 Preparing source tree for configuration and compilation:
+
 @example
+<...Autodist started...>
 pre-hook
+<...preparation...>
 post-hook
+<...Autodist exits...>
 @end example
 
 Creating distribution:
+
 @example
+<...Autodist started...>
 pre-dist-hook
+<...distribution directory created...>
 pre-process-dist-hook
+<...processing all files, processing excludes and includes...>
 post-process-dist-hook
+<...creating distribution package...>
 post-dist-hook
+<...Autodist exits...>
 @end example
 
 When creating distribution the 'pre-hook' and 'post-hook' are not run.
@@ -976,7 +1034,21 @@ macro 'AC_OUTPUT'.  This macro has no arguments.
 Note that, the 'configure.ad' fragments are not real full featured
 configure scripts.  They must not use 'AD_INIT', 'AD_INCLUDE_CONFIGURE',
 'AC_INIT' or any other initialization macros.
+@end defmac
+
+
+@defmac AD_DISABLE_DEPENDENCIES
 
+This macro is used to disable Autodist dependencies.  If this macro is
+used, then after editing 'Makefile.ad' and 'configure.ad' files the
+Autodist must be run manually.  When dependencies are enabled Autodist is
+run automatically when source is compiled with 'make'.  Dependencies make
+the development easier.  This macro has no arguments.
+
+Note that, the dependencies are enabled only in the prepared source tree.
+Depedencies are not delivered to distribution, as they would require the
+presence of 'Makefile.ad' and 'configure.ad' files, which are not
+delivered to distribution.
 @end defmac
 
 @menu
@@ -1023,6 +1095,11 @@ preparation.  They will be processed when creating the distribution package.
 If you need processed files during configuration or compilation then they
 need to have '.ad' suffix.
 
+Note that, the distdef format used in these files must be the non-source
+format, even if the file is source file.  This is because the distdefs
+are processed during source tree preparation, and the source file will
+have all distdefs removed when it is compiled.
+
 @menu
 * Distdefines::                 Using distdefs in files
 @end menu
@@ -1049,7 +1126,7 @@ configuration and compilation (@pxref{Preparing source tree, , , , }).
 By default the distdefs are named '_DIST_XXX', where 'XXX' is the name of
 distdef.  However, many projects will want to define their own prefix
 for distdefs in the 'autodist.conf' configuration file (@pxref{autodist.conf, , , , }).
-In the following examples a prefix 'SILC' is used, hence the prefix for 
+In the following examples a prefix 'SILC' is used, hence the prefix for
 the distdefs are 'SILC_DIST_'.
 
 The basic format for the distdefs are as follows:
@@ -1090,13 +1167,13 @@ a compiler friendly format, defined below, should be used.
 #endif /* SILC_DIST_DEFINE */
 @end example
 
-Note that, only the format defined above is supported.  Other more complex 
-use of the preprocessor directives such as using '&&' and '||' in the 
-'#ifdef' or '#ifndef' are not supported, and neither is '#elif'.  Also 
-note, that the name of the distdef in '#else' and '#ifdef' directives in 
-non-source format and in source format inside C comments (/* */), and the 
-use of '!' character in the '#else' branch of '#ifdef'" are mandatory.  
-Also note, that the distdef conditionals must be placed at the start of 
+Note that, only the format defined above is supported.  Other more complex
+use of the preprocessor directives such as using '&&' and '||' in the
+'#ifdef' or '#ifndef' are not supported, and neither is '#elif'.  Also
+note, that the name of the distdef in '#else' and '#endif' directives in
+non-source format and in source format inside C comments (/* */), and the
+use of '!' character in the '#else' branch of '#ifdef'" are mandatory.
+Also note, that the distdef conditionals must be placed at the start of
 the line, they must not be indented.
 
 The following example shows the use of non-source format:
@@ -1135,8 +1212,8 @@ SUBDIRS =                        \
        client                    \
 @end example
 
-The lines defined specificly for the SILC_DIST_TOOLKIT, which in our
-example was not defined, were removed.  Also lines that specificly
+The lines defined specifically for the SILC_DIST_TOOLKIT, which in our
+example was not defined, were removed.  Also lines that specifically
 expected certain distdefs not to be defined ('#ifndef') were removed.
 (Note the last remaining '\' in example above would be removed by the
 Autodist automatically to avoid errors with Automake.)
@@ -1154,6 +1231,8 @@ The following example shows the use of source code format:
 
 #ifndef SILC_DIST_FOOBAR
   foobar_replacement();
+  foobar_hack_init();
+  foobar_init();
 #else /* SILC_DIST_FOOBAR */
   real_foobar();
 #endif /* SILC_DIST_FOOBAR */
@@ -1170,21 +1249,21 @@ would be:
   real_foobar();
 @end example
 
-Even before processing the source files with Autodist, the preprocessor 
-will respect the preprocessor directives if the code use '#include' to 
-include the distdef header file created by the Autodist (see 
-'autodist.conf' (@pxref{autodist.conf, , , , })).  When the distribution 
-is packaged (@pxref{Creating distribution, , , , }) the Autodist will 
-process the files, and will remove any line not defined to be included.  
+Even before processing the source files with Autodist, the preprocessor
+will respect the preprocessor directives if the code use '#include' to
+include the distdef header file created by the Autodist (see
+'autodist.conf' (@pxref{autodist.conf, , , , })).  When the distribution
+is packaged (@pxref{Creating distribution, , , , }) the Autodist will
+process the files, and will remove any line not defined to be included.
 The preprocessor directives will also be removed.
 
-Because the software project includes the header file with '#include' the 
-distdef header file needs to be present in the distribution, unless it is 
+Because the software project includes the header file with '#include' the
+distdef header file needs to be present in the distribution, unless it is
 placed inside some other '#ifdef' conditional.  If the distribution is
 prepared but not compiled (it is packaged after preparation without
-compilation) then including the distdef header in the source is not 
+compilation) then including the distdef header in the source is not
 necessary.  Including it then in the distribution is not necessary either.
+
 The software project should not use the same name space that distdef
 conditionals use for other than distribution usage.  The Autodist will
 process any line that uses the formats above and has the specified prefix
@@ -1209,8 +1288,40 @@ The following suffixes will be considered as source files by the Autodist:
     .hh
 @end example
 
+Also, any file that has '.in' suffix with any of the above source file
+suffixes, the format inside the file must follow the source code format.
 Using distdefs in any other file must follow the non-source format.
 
+Example:
+@example
+    .c.in
+    .h.in
+@end example
+
+In this example, in both of the files the source code format is used.
+
+
+@node Dependencies
+@section Autodist dependency support
+
+Autodist support dependencies for 'Makefile.ad' and 'configure.ad' files.
+When these files are edited, they are processed by Autodist automatically
+when the source tree is compiled with 'make'.  This makes development in
+the source tree easier, when Autodist does not have to be run manually.
+The dependencies can be disabled by using 'AD_DISABLE_DEPENDENCIES' macro
+in the 'configure.ad' file.
+
+When editing 'configure.ad' fragments the modifcation is detected when the
+source tree is compiled with 'make' from the top source directory.
+Giving 'make' in a subdirectory will not detect a change in 'configure.ad'
+fragment.
+
+Dependencies are present only in the prepared source tree.  They are not
+delivered to created distribution, as they depend on 'Makefile.ad' and
+'configure.ad' files which are not present in the created distribution.
+Autodist automatically removes the dependencies when the distribution is
+created.
+
 
 @node Invoking Autodist
 @chapter Invoking Autodist
@@ -1251,6 +1362,12 @@ Initializes Autodist environment.  Creates the default distribution
 directory 'distdir', 'autodist.conf' configuration file and the
 default distribution 'default', then exits.
 
+@item -p
+@itemx --process <type> <src> <dst>
+Process file <src> into <dst> for distribution, <type> is 'makefile',
+'configure', 'non-source' or 'source' and defines the type of <src>,
+then exits.
+
 @item -m
 @itemx --makedist
 Creates and packages distribution
@@ -1287,14 +1404,14 @@ not using Autodist, then you would do this by running perhaps 'aclocal',
 this process is performed by Autodist, and running these tools manually
 or using 'autogen.sh' script is not necessary.
 
-By default the 'autodist.conf' (@pxref{autodist.conf, , , , }) has defined 
-the tools that will be run by the Autodist when preparing the source tree.  
-These are 'aclocal', 'autoheader', 'autoconf', 'automake' and 
-'libtoolize'.  If you do not wish that Autodist runs some or any of these 
-tools automatically, do not set them in the 'autodist.conf'.  You would 
-then need to run them manually. However, this is not recommended.  If you 
-need to run additional preparation scripts you may set your scripts either 
-in the 'pre-hook' and/or 'post-hook' where you can run what ever 
+By default the 'autodist.conf' (@pxref{autodist.conf, , , , }) has defined
+the tools that will be run by the Autodist when preparing the source tree.
+These are 'aclocal', 'autoheader', 'autoconf', 'automake' and
+'libtoolize'.  If you do not wish that Autodist runs some or any of these
+tools automatically, do not set them in the 'autodist.conf'.  You would
+then need to run them manually. However, this is not recommended.  If you
+need to run additional preparation scripts you may set your scripts either
+in the 'pre-hook' and/or 'post-hook' where you can run what ever
 additional processing you may need to prepare your source tree.
 
 By default the Autodist creates a 'default' distribution when you
@@ -1318,7 +1435,7 @@ The Autodist will prepare your source tree.  After that you may run
 './configure' and continue to compile with 'make'.
 
 If you do not wish to use the 'default' distribution, or you wish
-to do the development in a tree specificly prepared for some specific
+to do the development in a tree specifically prepared for some specific
 distribution, or you are preparing to create a new distribution package,
 you will need to run the Autodist with the distribution you wish to
 prepare.
@@ -1330,6 +1447,8 @@ prepare.
 This prepares your source tree for 'example-distribution' of version
 '1.0.3'.  After that you may run './configure' and continue to compile
 with 'make'.  If the version is omitted the version will be '0.0'.
+The 'PACKAGE_VERSION' define delivered by Autoconf will contain this
+version.
 
 Note that, running Autodist for preparation merely prepares your source
 tree for the distribution, it does not create an actual distribution
@@ -1343,15 +1462,24 @@ distribution.
 However, the source files, or any other file (except files ending with
 '.ad' suffix) are not processed by the Autodist.  When compiling
 your sources the preprocessor, however, will respect your distdef
-conditionals inside your source files if you include the distdef header
+conditionals inside your source files if you '#include' the distdef header
 file.  This way, even the compiled binaries will be compiled for that
-distribution, even though the source files has not yet been processed
+distribution, even though the source files have not yet been processed
 by the Autodist.  Rest of the files in the distribution will be processed
 when you create the actual distribution package.  It is guaranteed that
 the distribution you have prepared will behave in your source tree exactly
 the same way as if it was already packaged with Autodist (providing that
 you remember to include the distdef header file in your code).
 
+When preparing the source tree Autodist will create a file 'autodist.dist'
+which will contain information on the prepared distribution.  When
+Creating the distribution that file will be read by the Autodist
+automatically.  That file should not be removed or the distribution
+cannot be packaged.
+
+Autodist also created a log file, 'autodist.log', that will include
+messages created by Autodist during preparation.
+
 @menu
 * Creating distribution::       Creating distribution with Autodist
 @end menu
@@ -1367,8 +1495,8 @@ Autodist package provides a simple helper script 'makedist' that may
 be used to create the distribution.  However, if you wish, you may
 run the Autodist yourself, as the 'makedist' will call Autodist anyway.
 
-To create a new distribution for the distribution you have prepared for
-run makedist.
+To create a new distribution for the distribution you have prepared for,
+run first './configure' and then 'makedist'.
 
 @example
   makedist
@@ -1387,16 +1515,19 @@ This example would create, in addition of 'tar.gz' package, also a
 'tar.bz2', 'tar.Z' and '.zip' packages.  Current version of Autodist does
 not support archiving with 'shar'.
 
-If you wish to run additional processing for your distributions when
-they are being packaged you may set 'pre-dist-hook' and/or 'post-dist-hook'
-in your distribution file.  Also note that any hooks provided by Automake
-in Makefiles will be run in normal manner.
+If you wish to run additional processing for your distributions when they
+are being packaged you may set 'pre-process-dist-hook',
+'post-process-dist-hook, 'pre-dist-hook' and/or 'post-dist-hook' in your
+distribution file.  Also note that any hooks provided by Automake in
+Makefiles will be run in normal manner.
 
-For additional help, you may give:
-
-@example
-  makedist --help
-@end example
+When creating the distribution Autodist creates a log file,
+'makedist.log', that will include messages created by Autodist.  It is
+suggested that this file is checked after distribution is created.  For
+example, when the 'license-header' directive is used to re-license the
+distribution, the 'makedist.log' will include list of files that were not
+re-licensed.  The log file can be used to verify that the distribution was
+re-licensed correctly, and fix any possible mistakes.
 
 
 @node Examples
@@ -1422,7 +1553,7 @@ First, you create the default 'distdir' into your software package:
 
 Then, you create the 'configure.ad' file from your existing 'configure.ac'
 or 'configure.in' file.  If you don't have configure script written yet,
-please refer to the Autoconf manual.  In the 'autodist.ad' you add as
+please refer to the Autoconf manual.  In the 'configure.ad' you add as
 first macro in the file:
 
 @example
@@ -1497,7 +1628,7 @@ directory 'distdir':
 
 Then, you create the 'configure.ad' file from your existing 'configure.ac'
 or 'configure.in' file.  If you don't have configure script written yet,
-please refer to the Autoconf manual.  In the 'autodist.ad' you add as
+please refer to the Autoconf manual.  In the 'configure.ad' you add as
 first macro in the file:
 
 @example
@@ -1535,6 +1666,7 @@ include doc/nomad
 define _DIST_NOMAD
 define _DIST_NOMAD_LIB
 undef _DIST_CRYPTO
+pre-dist-hook nomad-pre-dist-hook
 @end example
 
 @example
@@ -1569,7 +1701,7 @@ autodist
 This will prepare your source tree for configuration and compilation.  Since
 the 'default' distribution inherits all distributions your development
 source tree will have all of them included.  If you do not want to do this
-then don't inherit them in the 'default', but run the autodist specificly
+then don't inherit them in the 'default', but run the autodist specifically
 for the distributions, for example:
 
 @example
@@ -1578,7 +1710,7 @@ autodist foozbar
 
 Since all the distributions inherit the 'common' distribution they get
 all the distdefs that the 'common' defines.  In this example various distdefs
-has been defined.  You would use them in your code and in your makefiles
+have been defined.  You would use them in your code and in your makefiles
 to control various things.  For example, let's say the 'common' distdefs
 control what directories distributions have.  An example 'Makefile.ad'
 file:
@@ -1647,13 +1779,27 @@ Then you continue with libfoozbar and Nomad:
 @example
 autodist libfoozbar 1.0.5
 makedist
+@end example
+
+Nomad has also an RPM .spec file that you have written and a pre-dist-hook
+that will replace the RPM release version with sed tool with the one you
+give as extra parameter to autodist:
 
-autodist nomad 2.0
+@example
+autodist nomad 2.0 0.fc7
 makedist
 @end example
 
-The end results are: 'libfoozbar-1.0.5.tar.gz' and 'nomad-2.0.tar.gz'.
+The end results are: 'libfoozbar-1.0.5.tar.gz' and 'nomad-2.0.tar.gz', and
+the RPM will have a release version '0.fc7' when you compile the RPM.  Any
+extra parameter that you pass to autodist will be delivered to your hook
+scripts.
+
+@node Download
+@chapter Download
+
+Download latest version of Autodist at
+@url{http://silcnet.org/download/autodist/}
 
 @page
-@contents
 @bye