AD_ENABLE_DEPENDENCIES -> AD_DISABLE_DEPENDENCIES.
[autodist.git] / apps / autodist / doc / autodist.texi
index 8b797ab8de1074362859ff39f739642fff8140fb..3cc7f19d979f44bf6d5b2179e5bc76de4a100b4b 100644 (file)
@@ -427,7 +427,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 +445,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 +461,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 +500,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 +520,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 +531,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
@@ -568,13 +585,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 +605,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 specificly undefined in the inherited 
+distribution.  This means that if the inherited distribution specificly 
+undefines a distdefs but the inheriting distribution (one being prepared 
+or packaged) specificly 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 specificly 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>
 
@@ -639,14 +672,14 @@ distribution.  The following options are available.
 template
 @end example
 
-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.
+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, 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 +789,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 specificly 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> [...]
@@ -986,7 +1020,23 @@ 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 in 'Makefile.ad' 
+files.  If this macro is used, then after editing 'Makefile.ad' file the 
+Autodist must be run manually.  When dependencies are enabled editing 
+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' files, which are not delivered to distribution. 
+
+Current Autodist version does not support dependencies in 'configure.ad' 
+files, only in 'Makefile.ad' files.
 @end defmac
 
 @menu
@@ -1034,7 +1084,9 @@ 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.
+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
@@ -1106,7 +1158,7 @@ a compiler friendly format, defined below, should be used.
 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
+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
@@ -1167,6 +1219,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 */
@@ -1222,8 +1276,18 @@ 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 Invoking Autodist
 @chapter Invoking Autodist
@@ -1264,6 +1328,11 @@ Initializes Autodist environment.  Creates the default distribution
 directory 'distdir', 'autodist.conf' configuration file and the
 default distribution 'default', then exits.
 
+@item -p
+@itemx --process <src> <dst>
+process file <src> into <dst> for distribution, only non-source files can 
+be processed with -p.
+
 @item -m
 @itemx --makedist
 Creates and packages distribution
@@ -1343,6 +1412,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
@@ -1356,7 +1427,7 @@ 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
 by the Autodist.  Rest of the files in the distribution will be processed
@@ -1365,6 +1436,15 @@ 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
@@ -1400,16 +1480,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.
-
-For additional help, you may give:
+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.
 
-@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
@@ -1435,7 +1518,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
@@ -1510,7 +1593,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