Next: , Previous: Distribution file format, Up: Integrating Autodist


2.26 configure.ad files

Autodist creates 'configure.ac' file from the 'configure.ad' file. The 'configure.ad' file is a rather normal 'configure.ac' except that it accepts also Autodist macros. Autodist also supports configure script fragments, also named as 'configure.ad'. Any 'configure.ad' file in the source tree can be incorporated into the the top 'configure.ad' file. Sometimes it may be useful to split a large configure script into smaller fragments. Especially in multi distribution system where certain libraries or features can be excluded from certain distributions it may be useful to handle their configuration from a configure fragment. If the library is excluded then also its configuration can be excluded.

If the software project already has a 'configure.ac' or 'configure.in' file, the 'configure.ad' can be created by simply renaming the current file to 'configure.ad'. In this case the current configure script must be edited to support Autodist. This is done by replacing the 'AC_INIT' to 'AD_INIT'. After specifying the 'AD_INIT' as the first macro in the 'configure.ad', the Autodist support has been fully integrated into the software project.

If your software project is going to use configure fragments, then also Autodist macro 'AD_INCLUDE_CONFIGURE' must be used. Autodist will automatically combine the fragments with the top 'configure.ac' script. To exclude a 'configure.ad' fragment from a distribution use the distdef conditionals inside the 'configure.ad' fragment file. If the distdef is not defined the fragment will be excluded automatically.

The following macros are available in current Autodist version.

— Macro: AD_INIT

The 'AD_INIT' macro is used in place of Autoconf macro 'AC_INIT'. The 'AD_INIT' must be the first macro in the 'configure.ad', just like the 'AC_INIT' macro in 'configure.ac'. The AD_INIT macro is used to deliver the distribution names, distribution version, package name and bug-report email address to the 'configure.ac' file that Autodist will create. The 'AC_INIT' macro must not be used in 'configure.ad' file.

This macro is mandatory and Autodist will exit with error if it is not specified in 'configure.ad'. This macro has no arguments.

— Macro: AD_INCLUDE_CONFIGURE

This macro is used to tell Autodist that it should include any other 'configure.ad' fragment that is found from the source tree into the top 'configure.ad' file. Note that, the 'configure.ad' fragments will be incorporated at the location where this macro is used in the 'configure.ad'. Usually this macro is placed just before the Autoconf 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.

— Macro: 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.