Apparently, Automakes prior to 1.10 do not automatically substitute the absolute path directory variables abs_srcdir abs_top_srcdir abs_builddir abs_top_builddir that Autoconf computes (since ca. 2003) into the Makefiles. This leads to a subtle error when OPM-Core is used in conjunction with dune-common's DUNE_CHECK_MODULES (or, more appropriately, our own OPM_CORE_CHECK_MODULES) macro that gets invoked through dunecontrol. The *_CHECK_MOUDLES macro contains an unconditional statement that uses 'abs_top_srcdir' to compute the absolute path to the current module's top source directory. When abs_top_srcdir is unset, the root becomes unset too, whence the subsequent existence and validity checks fail due to incorrect CPPFLAGS and/or LDFLAGS. It will also fail to locate the 'dune.module' dependency file. By explicitly substituting the above variables into the Makefiles, as was also done in revisions 5819 and 5845 of dune-common's Subversion repository, we're guarding against this particular failure mode. Tested on: CentOS 5.8 (Autoconf 2.59, Automake 1.9.6)
53 lines
1.3 KiB
Plaintext
53 lines
1.3 KiB
Plaintext
# -*- Autoconf -*-
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ([2.59])
|
|
AC_INIT([OPM Core Library], [0.1], [atgeirr@sintef.no],dnl
|
|
[opmcore], [https://public.ict.sintef.no/opm/hg/opmcore])
|
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
AC_CONFIG_SRCDIR([opm/core/grid.h])
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
# Checks for programs.
|
|
AC_PROG_CC
|
|
AM_PROG_CC_C_O
|
|
|
|
m4_ifdef([LT_INIT],
|
|
[LT_INIT[]dnl
|
|
LT_LANG([C++])dnl
|
|
LT_LANG([Fortran 77])dnl
|
|
LT_LANG([Fortran])dnl
|
|
],dnl
|
|
[AC_PROG_LIBTOOL[]dnl
|
|
AC_PROG_CXX[]dnl
|
|
AC_PROG_F77[]dnl
|
|
AC_PROG_FC[]dnl
|
|
])[]dnl
|
|
|
|
OPM_CORE_CHECKS
|
|
|
|
OPM_DYNLINK_BOOST_TEST
|
|
|
|
dnl Substitute Autoconf's abs_*dir variables into the Makefiles for the
|
|
dnl benefit of external code that uses these variables to derive
|
|
dnl locations (e.g., Dune's DUNE_CHECK_MODULES macro). Automakes prior
|
|
dnl to version 1.10 do not automatically substitute these variables into
|
|
dnl output files.
|
|
AC_SUBST([abs_srcdir])
|
|
AC_SUBST([abs_builddir])
|
|
AC_SUBST([abs_top_srcdir])
|
|
AC_SUBST([abs_top_builddir])
|
|
|
|
AC_CONFIG_FILES([
|
|
Makefile
|
|
tests/Makefile
|
|
examples/Makefile
|
|
tutorials/Makefile
|
|
])
|
|
|
|
AC_OUTPUT
|