From 3d679b3df641f59fb81ca1651799f4e2965ed67e Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 3 May 2011 17:49:29 +0300 Subject: 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. --- am/grecs.m4 | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'am') 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]) ]) -- cgit v1.2.1