aboutsummaryrefslogtreecommitdiff
path: root/am
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-03 17:49:29 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-03 21:23:21 +0300
commit3d679b3df641f59fb81ca1651799f4e2965ed67e (patch)
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')
-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
@@ -46,33 +46,35 @@ AC_DEFUN([_GRECS_OPTION_SWITCH],
# _GRECS_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Grecs options.
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
# given.
#
# If neither std-pp-setup option, nor pp-setup-file argument are supplied,
# no preprocessor setup file is installed.
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
# **********************
_GRECS_IF_OPTION_SET([no-preproc],
[use_ext_pp=no],
[AC_ARG_WITH([preprocessor],
@@ -101,13 +103,13 @@ AC_DEFUN([GRECS_SETUP],[
AC_PATH_PROG(PPBIN, $DEFAULT_PREPROCESSOR)
DEFAULT_PREPROCESSOR=$PPBIN
if test -n "$DEFAULT_PREPROCESSOR"; then
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],
[AC_ARG_WITH([pp-setup-file],
AC_HELP_STRING([--with-pp-setup-file],
[install the default pp-setup file]),
@@ -124,8 +126,17 @@ AC_DEFUN([GRECS_SETUP],[
fi
PATH=$save_PATH
DEFAULT_PREPROCESSOR="\\\"$DEFAULT_PREPROCESSOR\\\""
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.