1.2 Using the GNU Autotools

When we use the full GNU Autotools suite to organise a package’s infrastructure depending on MBFL, we should do the following:

  1. Include the GNU Autoconf macro file mbfl.m4 (distributed with MBFL) in the distribution and use it by adding the following to acinclude.m4:
    m4_include(path/to/mbfl.m4)
    
  2. In the template configure.ac we add the macro use, optionally specifying the minimum MBFL semantic version we need (see Semantic Versioning specification):
    MBFL_SETUP(v3.0.0)
    

    it will add to Makefile.in the following variable definitions:

    MBFLPP                  = @MBFLPP@
    MBFL_LIBDIR             = @MBFL_LIBDIR@
    MBFL_LIBMBFL            = @MBFL_LIBMBFL@
    MBFL_LIBMBFL_CORE       = @MBFL_LIBMBFL_CORE@
    MBFL_LIBMBFL_LINKER     = @MBFL_LIBMBFL_LINKER@
    MBFL_LIBMBFL_TESTS      = @MBFL_LIBMBFL_TESTS@
    MBFL_LIBMBFL_UTILS      = @MBFL_LIBMBFL_UTILS@
    MBFL_LIBMBFL_AT         = @MBFL_LIBMBFL_AT@
    MBFL_LIBMBFL_ARCH       = @MBFL_LIBMBFL_ARCH@
    MBFL_LIBMBFL_PASSWORDS  = @MBFL_LIBMBFL_PASSWORDS@
    MBFL_LIBMBFL_GIT        = @MBFL_LIBMBFL_GIT@
    MBFL_LIBMBFL_CONTAINRES = @MBFL_LIBMBFL_CONTAINERS
    

    holding the absolute file system pathnames of the preprocessor script, the libraries installation directory, and the libraries pathnames.

  3. In the template file Makefile.am we can use the MBFL_ variables to drive the loading or embedding of libraries into our scripts, libraries and test files.

This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.