1
# @synopsis TAC_ARG_ENABLE_CAN_USE_PACKAGE(PACKAGE_NAME, OPTIONAL_DEPENDENCY_NAME, AC_DEFINE, AM_CONDITIONAL, DEFAULT_BUILD, ALLOW_IMPLICIT_ENABLE, HELP_STRING, IMPLICIT_HELP_STRING)
4
# Use this macro to facilitate definition of options related to other
5
# Trilinos packages that a package "can use" but does not depend on.
7
# This macro supports both explicit and implicit configure options.
8
# For example to build epetra support into nox (so that nox can call
9
# epetra) we can explicitly use the flag --enable-nox-epetra. This
10
# requires the user to enable both packages and the support between
11
# them: --enable-nox --enable-epetra --enable-nox-epetra.
13
# Some packages, to simplify build requirements, implicitly assume
14
# that epetra support in nox should be built if both --enable-nox and
15
# --enable-epetra are supplied. Users can override this by using the
16
# explicit command --enable-nox-epetra.
19
# TAC_ARG_ENABLE_CAN_USE_PACKAGE(PACKAGE_NAME,
20
# OPTIONAL_PACKAGE_DEPENDENCY_NAME,
23
# ALLOW_IMPLICIT_ENABLE,
25
# IMPLICIT_HELP_STRING)
28
# PACKAGE_NAME - Name of package currently being enabled.
29
# OPTIONAL_PACKAGE_DEPENDENCY_NAME - Name of optinal package support that
31
# AC_DEFINE - Name of define that will be put in the
32
# <PackageName>_ConfigDef.h file. Note that a "HAVE_"
33
# will be automatically prepended to the name.
34
# AM_CONDITIONAL - Variable that will be set in the makefiles by an
35
# AM_CONDITIONAL call.
36
# ALLOW_IMPLICIT_ENABLE - This can be used to turn off implicit enable
37
# support. Takes a "yes/no" argument.
38
# HELP_STRING - Help string for configure option:
39
# --enable-<PACKAGE_NAME>-<OPTIONAL_PACKAGE_DEPENDENCY_NAME>
40
# IMPLICIT_HELP_STRING - Help string for implicit configure option:
41
# --enable-<OPTIONAL_PACKAGE_DEPENDENCY_NAME>
43
# For example, to force explicit configuration of epetra support in nox:
45
# TAC_ARG_ENABLE_EXPLICIT_CAN_USE_PACKAGE(nox, epetra, NOX_EPETRA,
46
# NOX_USING_EPETRA, no,
47
# [Builds epetra support into nox.],
50
# To allow both implicit and explicit configuration of epetra support in nox:
52
# TAC_ARG_ENABLE_EXPLICIT_CAN_USE_PACKAGE(nox, epetra, NOX_EPETRA,
53
# NOX_USING_EPETRA, no, yes,
54
# [Builds epetra support in nox.],
55
# [Builds epetra support in nox. Can be overridden with --enable-nox-epetra.])
57
# Results of calling this file:
58
# 1. An AM_CONDITIONAL will be set for the AM_CONDITIONAL argument defined
60
# 2. An AC_DEFINE of the form: HAVE_<AC_DEFINE> where AC_DEFINE is the
61
# argument defined above.
63
# @author Roger Pawlowski <rppawlo@sandia.gov>
64
# Based on original verison by Jim Willenbring.
66
AC_DEFUN([TAC_ARG_ENABLE_CAN_USE_PACKAGE],
69
dnl Check for implicit enabling of optional package
71
AC_HELP_STRING([--enable-$2],[$7]),
72
ac_cv_implicit_use_$2=$enableval,
73
ac_cv_implicit_use_$2=no)
75
dnl If implicit enabling is used, set that as teh default
76
if test "X$5" != "Xno"; then
77
ac_cv_$1_using_$2_default=$ac_cv_implicit_use_$2
79
ac_cv_$1_using_$2_default=no
82
AC_ARG_ENABLE([$1-$2],
83
AC_HELP_STRING([--enable-$1-$2],[$6]),
84
ac_cv_use_$2=$enableval,
85
ac_cv_use_$2=$ac_cv_$1_using_$2_default)
87
AC_MSG_CHECKING(whether to build optional [$2] dependent code in [$1])
89
if test "X$ac_cv_use_$2" != "Xno"; then
91
AC_DEFINE([HAVE_$3],1,[Define if want to build with $1 enabled])
96
AM_CONDITIONAL($4, test "X$ac_cv_use_$2" = "Xyes")