wiki:pm-base-config

Version 3 (modified by andreasw, 14 years ago) (diff)

fini

The Base Directory configure.ac File

The purpose of the configuration script in a package's base directory (Coin-Clp in the example) is to test what COIN project subdirectories are present and should be compiled, and then initiate the configuration in those subdirectories.

The beginning and the end of the file follow the basic structure of configure.ac files. The body for a base directory configure.ac file then looks like this:

.
.
.

#############################################################################
#     We only need automake to generate Makefiles for the distribution      #
#############################################################################

# Initialize automake
AC_COIN_INIT_AUTOMAKE

#############################################################################
#                  Check which subprojects are there                        #
#############################################################################

AC_COIN_MAIN_SUBDIRS(CoinUtils)
AC_COIN_MAIN_SUBDIRS(Data/Netlib)
AC_COIN_MAIN_SUBDIRS(Data/Sample)
AC_COIN_MAIN_SUBDIRS(Data/miplib3)
AC_COIN_MAIN_SUBDIRS(Clp)
AC_COIN_MAIN_SUBDIRS(Vol)
AC_COIN_MAIN_SUBDIRS(Osi)
AC_COIN_MAIN_SUBDIRS(Cgl)
AC_COIN_MAIN_SUBDIRS(Cbc)

.
.
.
  • The AC_COIN_INIT_AUTOMAKE macro initializes everything that is required to use Automake in connection with this configure.ac file. Since no compilation is done at this basic level, we don't need to check for any compiler or other things.
  • The AC_COIN_MAIN_SUBDIRS tell us the names of subdirectories with other COIN projects that should be compiled for this package. In each subdirectory should also be a configure.ac file. The final configure and Makefiles will recurse into those directories in the specified order, i.e., if there are interdependencies, e.g., between libraries, make sure that you list the project subdirectories in the right order. If during the run of configure by the user a subdirectory is not found, the configuration and make for that subdirectory is skipped.

Note that we also specify subdirectories for Data; those subdirectories contain data files required for running the unit tests or example programs.