From 229cafca9fd9b44aa87f7f1bc97f71b9328961a8 Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE> Date: Fri, 28 Nov 2003 18:05:48 +0000 Subject: [PATCH] Initial revision. --- m4/alberta-dims.m4 | 36 ++++++++++++++++++++++++++++++++++++ m4/simple-enable-flag.m4 | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 m4/alberta-dims.m4 create mode 100644 m4/simple-enable-flag.m4 diff --git a/m4/alberta-dims.m4 b/m4/alberta-dims.m4 new file mode 100644 index 0000000..053d692 --- /dev/null +++ b/m4/alberta-dims.m4 @@ -0,0 +1,36 @@ +# +# enable building of $1$2 library (DIM/DIM_OF_WORLD) +# +AC_DEFUN([ALBERTA_DIMENSION_ENABLE], +[SIMPLE_ENABLE_FLAG([alberta-$1$2], +[enable building of an ALBERTA library for parametric Finite Elements +of dimension $1 where the surrounding space has dimension $2.], 0) +if test "$ALBERTA_$1$2" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$2_0/Makefile]) + if test "$DEBUG" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$2_1/Makefile]) + fi + if test "$EL_INDEX" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$2_01/Makefile]) + fi + if test "$DEBUG" -eq 1 -a "$EL_INDEX" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$2_11/Makefile]) + fi +fi +]) +AC_DEFUN([ALBERTA_DIMENSION_DISABLE], +[SIMPLE_ENABLE_FLAG([alberta-$1$1], +[disable building of an ALBERTA library for Finite Elements of dimension $1.], 1) +if test "$ALBERTA_$1$1" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$1_0/Makefile]) + if test "$DEBUG" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$1_1/Makefile]) + fi + if test "$EL_INDEX" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$1_01/Makefile]) + fi + if test "$DEBUG" -eq 1 -a "$EL_INDEX" -eq 1; then + AC_CONFIG_FILES([ALBERTA/src/ALBERTA$1$1_11/Makefile]) + fi +fi +]) diff --git a/m4/simple-enable-flag.m4 b/m4/simple-enable-flag.m4 new file mode 100644 index 0000000..5b5fcb2 --- /dev/null +++ b/m4/simple-enable-flag.m4 @@ -0,0 +1,34 @@ +# +# $1: name of the enable-switch (e.g. el-index) +# $2: help string +# $3: one of {0,1}, default value +# +# Results: declare proper AC_ARG_ENABLE(), define make-file +# subsitution (e.g. EL_INDEX), define automake conditional +# (e.g. EL_INDEX). +# +AC_DEFUN([SIMPLE_ENABLE_FLAG], +[m4_define([FLAGNAME], [m4_bpatsubst(m4_toupper([$1]),-,_)]) +m4_if([$3],[1], +[m4_define([NEGDEFAULT],[disable]) +m4_define([DEFAULT],[enabled])], +[m4_define([NEGDEFAULT],[enable]) +m4_define([DEFAULT],[disabled])]) +AC_ARG_ENABLE($1, + AC_HELP_STRING(--[]NEGDEFAULT[]-$1, + [$2 (default: DEFAULT)]), + [case "$enableval" in + yes) + FLAGNAME=1 + ;; + no) + FLAGNAME=0 + ;; + *) + AC_MSG_ERROR(["--[]NEGDEFAULT[]-$1" does not take an argument.]) + ;; + esac], + [FLAGNAME=$3]) +AC_SUBST(FLAGNAME) +AM_CONDITIONAL(FLAGNAME, [test "$[]FLAGNAME" -eq 1]) +]) -- GitLab