[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to extend automake?
How to extend automake?
Fri, 27 May 2005 13:29:44 +0200
How can I extend automake (other than submitting a patch and waiting for
automake-1.10 to be released)?
More precisely, when a recipe for a certain feature contains the following
1. In the top-level directory of your package, create a subdirectory
called `bison-po'. It will contain localization files borrowed
from the Bison installation.
$ mkdir bison-po
2. Into the `bison-po' directory, copy the `Makefile.am' file
installed by Bison under `share/bison/bison-po/Makefile.am' in
Bison's installation directory. For example, if the `bison'
program is installed as `/usr/local/bin/bison', you will find the
file under `/usr/local/share/bison/bison-po/Makefile.am'.
$ cp /usr/local/share/bison/bison-po/Makefile.am bison-po/Makefile.am
The other files in this directory will be created later,
3. Into the directory containing the GNU autoconf macros used by the
package - often called `m4/' - copy the `bison.m4' file installed
by Bison under `share/aclocal/bison.m4' in Bison's installation
$ cp /usr/local/share/aclocal/bison.m4 m4/bison.m4
4. In the top-level `Makefile.am', add `bison-po' to the SUBDIRS
variable and, if present, also to the DIST_SUBDIRS variable. It
should be mentioned after directories that contain .y files that
are processed by Bison, such as - usually - `src'. Example:
SUBDIRS = doc lib src po bison-po tests
5. In the top-level `configure.ac', add `bison-po/Makefile' to the
`AC_CONFIG_FILES' command that lists the autogenerated Makefiles.
AC_CONFIG_FILES([doc/Makefile lib/Makefile src/Makefile \
po/Makefile.in bison-po/Makefile tests/Makefile])
6. In the top-level `configure.ac', after the `AM_GNU_GETTEXT'
invocation, add an invocation of `BISON_I18N'. As argument, you
pass a space-separated list of parser code files generated by
The `BISON_I18N' macro is defined in `bison.m4' that you copied
earlier. It will cause `configure' to find the values of some
variables that are used by `bison-po/Makefile.am'.
8. Finally, invoke `autoreconf', to rebuild the autoconf/automake
generated build infrastructure.
Do you see how I could extend 'automake' to simplify this sequence of
What I want to do is to ship with bison (and similarly, other programs) an
autoconf macro and an automake extension, so that all packages which use
bison and a Makefile.am could use the extension by adding a single line to
|[Prev in Thread]
||[Next in Thread]|
- How to extend automake?,
Bruno Haible <=