summaryrefslogtreecommitdiffabout
path: root/am
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-03 14:49:29 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-05-03 18:23:21 (GMT)
commit3d679b3df641f59fb81ca1651799f4e2965ed67e (patch) (side-by-side diff)
tree5a614ee25cff44d015ee9e6f6920e2ba19379bba /am
parent24ec67c9f6375d34d88e79981ed8abbe15a78169 (diff)
downloadgrecs-3d679b3df641f59fb81ca1651799f4e2965ed67e.tar.gz
grecs-3d679b3df641f59fb81ca1651799f4e2965ed67e.tar.bz2
Switch to the two-layer model. Add testsuite.
The configuration file parser creates a syntax tree. This step does not require any knowledge about which keywords are allowed. The user can then either use that tree directly, or post-process it using parser tables. The latter approach is equivalent to previous versions of grecs.
Diffstat (limited to 'am') (more/less context) (ignore whitespace changes)
-rw-r--r--am/grecs.m421
1 files changed, 16 insertions, 5 deletions
diff --git a/am/grecs.m4 b/am/grecs.m4
index 47c9867..5fc1819 100644
--- a/am/grecs.m4
+++ b/am/grecs.m4
@@ -49,14 +49,15 @@ AC_DEFUN([_GRECS_OPTION_SWITCH],
AC_DEFUN([_GRECS_SET_OPTIONS],
[m4_foreach_w([_GRECS_Option], [$1], [_GRECS_SET_OPTION(_GRECS_Option)])])
-# GRECS_SETUP([OPTIONS],[pp-setup-file])
-#
-# Options are:
+# GRECS_SETUP([dir],[OPTIONS],[pp-setup-file])
+# dir - Directory in the source tree where grecs has been cloned.
+# OPTIONS are:
# no-preproc Disable the use of preprocessor.
# std-pp-setup Install standard pp-setup file.
# pp-setup-option Add the --with-pp-setup-file option to the
# configuration file. The option allows user to
# control whether the pp-setup file is installed.
+# tests Build tests.
#
# The pp-setup-file argument supplies the pathname of the preprocessor
# setup file in the source tree. It is ignored if std-pp-setup option is
@@ -69,7 +70,8 @@ AC_DEFUN([GRECS_SETUP],[
AC_PROG_YACC
AM_PROG_LEX
- _GRECS_SET_OPTIONS([$1])
+ AC_SUBST([GRECS_SUBDIR],m4_if([$1],,grecs,$1))
+ _GRECS_SET_OPTIONS([$2])
# **********************
# Preprocessor
# **********************
@@ -104,7 +106,7 @@ AC_DEFUN([GRECS_SETUP],[
DEFAULT_PREPROCESSOR="$DEFAULT_PREPROCESSOR $PREPROC_OPTIONS"
_GRECS_IF_OPTION_SET([std-pp-setup],
[PP_SETUP_FILE='pp-setup'],
- [m4_if([$2],,[PP_SETUP_FILE=],[PP_SETUP_FILE='$2'])])
+ [m4_if([$3],,[PP_SETUP_FILE=],[PP_SETUP_FILE='$3'])])
AC_SUBST(PP_SETUP_FILE)
if test -n "$PP_SETUP_FILE"; then
_GRECS_IF_OPTION_SET([pp-setup-option],
@@ -127,5 +129,14 @@ AC_DEFUN([GRECS_SETUP],[
else
DEFAULT_PREPROCESSOR=NULL
fi
+ _GRECS_IF_OPTION_SET([tests],
+ [m4_pushdef([TESTDIR],m4_if([$1],,grecs,$1)/tests)
+ AC_CONFIG_TESTDIR(TESTDIR)
+ AC_CONFIG_FILES(TESTDIR/Makefile TESTDIR/atlocal)
+ m4_popdef([TESTDIR])
+ AM_MISSING_PROG([AUTOM4TE], [autom4te])
+ GRECS_TESTDIR=tests
+ ])
AC_SUBST([GRECS_INCLUDES])
+ AC_SUBST([GRECS_TESTDIR])
])

Return to:

Send suggestions and report system problems to the System administrator.