}
+# warn_forbidden ($WHERE, $WORD, %FORBIDDEN)
+# ------------------------------------------
+# $WORD is forbidden. Warn with a dedicated error message if in
+# %FORBIDDEN, otherwise, a simple `error: possibly undefined macro'
+# will do.
+sub warn_forbidden ($$%)
+{
+ my ($where, $word, %forbidden) = @_;
+ my $message;
+
+ for my $re (sort keys %forbidden)
+ {
+ if ($word =~ $re)
+ {
+ $message = $forbidden{$re};
+ last;
+ }
+ }
+ $message ||= "possibly undefined macro: $word";
+ warn "$where: error: $message\n";
+}
+
+
# handle_output ($REQ, $OUTPUT)
# -----------------------------
# Run m4 on the input files, perform quadrigraphs substitution, check for
# Load the forbidden/allowed patterns.
handle_traces ($req, "$tmp/patterns",
- ('m4_pattern_forbid' => 'forbid:$1',
+ ('m4_pattern_forbid' => 'forbid:$1:$2',
'm4_pattern_allow' => 'allow:$1'));
my @patterns = new Autom4te::XFile ("$tmp/patterns")->getlines;
chomp @patterns;
- my $forbidden = join ('|', map { /^forbid:(.*)/ } @patterns) || "^\$";
- my $allowed = join ('|', map { /^allow:(.*)/ } @patterns) || "^\$";
+ my %forbidden =
+ map { /^forbid:([^:]+):.+$/ => /^forbid:[^:]+:(.+)$/ } @patterns;
+ my $forbidden = join ('|', map { /^forbid:([^:]+)/ } @patterns) || "^\$";
+ my $allowed = join ('|', map { /^allow:([^:]+)/ } @patterns) || "^\$";
verbose "forbidden tokens: $forbidden";
+ verbose "forbidden token : $_ => $forbidden{$_}"
+ foreach (sort keys %forbidden);
verbose "allowed tokens: $allowed";
# Read the (cached) raw M4 output, produce the actual result. We
# Complain once per word, but possibly several times per line.
while (/$prohibited/)
{
- warn "$ARGV[$#ARGV]:$.: error: possibly undefined macro: $1\n";
- delete $prohibited{$1};
+ my $word = $1;
+ warn_forbidden ("$ARGV[$#ARGV]:$.", $word, %forbidden);
+ delete $prohibited{$word};
# If we're done, exit.
return
if ! %prohibited;
$prohibited = '\b(' . join ('|', keys %prohibited) . ')\b';
}
}
- warn "$output:$prohibited{$_}: error: possibly undefined macro: $_\n"
+ warn_forbidden ("$output:$prohibited{$_}", $_, %forbidden)
foreach (sort { $prohibited{$a} <=> $prohibited{$b} } keys %prohibited);
}
as_expr=false
fi
+
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
{ $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
{ LC_MESSAGES=C; export LC_MESSAGES; }
+
# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
rm -f conftest.sh
fi
+
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
exit
}
+
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
# CDPATH.
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
test "$silent" = yes && exec 6>/dev/null
+
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
cat >&5 <<_ACEOF
+
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
+
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell meta-characters.
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ac_aux_dir=
for ac_dir in config $srcdir/config; do
if test -f $ac_dir/install-sh; then
ac_config_files="$ac_config_files config/Makefile"
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
esac
done
+
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
rm conftest.sed
+
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
AMDEPBACKSLASH='\'
fi
+
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
AMDEP_FALSE=
fi
+
+
+
rm -f .deps 2>/dev/null
mkdir .deps 2>/dev/null
if test -d .deps; then
fi
rmdir .deps 2>/dev/null
+
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
#define PACKAGE "$PACKAGE"
_ACEOF
+
cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF
+
# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
# the ones we care about.
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
+
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
+
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
AMTAR=${AMTAR-"${am_missing_run}tar"}
install_sh=${install_sh-"$am_aux_dir/install-sh"}
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
+
# Initialize the test suite and build position independent wrappers.
ac_config_commands="$ac_config_commands tests/package.m4"
+
ac_config_commands="$ac_config_commands tests/atconfig"
+
ac_config_files="$ac_config_files tests/Makefile tests/atlocal"
ac_config_files="$ac_config_files tests/autoconf:tests/wrapsh.in"
echo "${ECHO_T}no" >&6
fi
+
+
# We use a path for GNU m4 so even if users have another m4 first in
# their path, the installer can configure with a path that has GNU m4
# first and get that path embedded in the installed autoconf and
# This is needed because Automake does not seem to realize there is
# a AC-SUBST inside AC-PROG-GNU-M4. Grmph!
+
# Man pages.
ac_config_files="$ac_config_files man/Makefile"
+
HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
+
# We use a path for perl so the #! line in autoscan will work.
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
# Emacs modes.
ac_config_files="$ac_config_files lib/emacs/Makefile"
+
# Check whether --with-lispdir or --without-lispdir was given.
if test "${with_lispdir+set}" = set; then
withval="$with_lispdir"
fi;
+
+
# Automake can't see inner AC_SUBSTS (`aclocal' is bypassed), so we tag the
# AC_SUBSTS here too.
+
+
+
ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile lib/m4sugar/Makefile lib/autoconf/Makefile lib/autotest/Makefile bin/Makefile"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
rm -f confdef2opt.sed
+
+
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
{ LC_MESSAGES=C; export LC_MESSAGES; }
+
# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
rm -f conftest.sh
fi
+
as_lineno_1=$LINENO
as_lineno_2=$LINENO
as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
exit
}
+
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ECHO_T=' ' ;;
# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
PACKAGE_STRING='$PACKAGE_STRING'
PACKAGE_BUGREPORT='$PACKAGE_BUGREPORT'
+
_ACEOF
+
+
cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
ac_srcpath=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_top_srcpath=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
ac_srcpath=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_top_srcpath=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
{ echo "$as_me:$LINENO: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
case $ac_dest in
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
Below you will find information on the status of this version of Autoconf.
+
EOF
sed -n '/^\* Status/,$p' $srcdir/BUGS
+