256 |
# Produce `calc.y'. |
# Produce `calc.y'. |
257 |
m4_define([AT_DATA_CALC_Y], |
m4_define([AT_DATA_CALC_Y], |
258 |
[_AT_DATA_CALC_Y($[1], $[2], $[3], |
[_AT_DATA_CALC_Y($[1], $[2], $[3], |
259 |
[m4_match([$1], [--yyerror-verbose], |
[m4_bmatch([$1], [--yyerror-verbose], |
260 |
[[#define YYERROR_VERBOSE]])])]) |
[[#define YYERROR_VERBOSE]])])]) |
261 |
|
|
262 |
|
|
263 |
|
|
273 |
]]) |
]]) |
274 |
AT_CHECK([calc input], 0, [], [stderr])dnl |
AT_CHECK([calc input], 0, [], [stderr])dnl |
275 |
AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, |
AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, |
276 |
[m4_match([$1], [--debug], |
[m4_bmatch([$1], [--debug], |
277 |
[$3], [0]) |
[$3], [0]) |
278 |
]) |
]) |
279 |
]) |
]) |
280 |
|
|
302 |
|
|
303 |
|
|
304 |
AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, |
AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, |
305 |
[m4_match([$1], [--debug], |
[m4_bmatch([$1], [--debug], |
306 |
[$3], [1]) |
[$3], [1]) |
307 |
]) |
]) |
308 |
|
|
309 |
egrep -v '^((Start|Enter|Read|Reduc|Shift)ing|state|Error:) ' stderr >at-stderr |
egrep -v '^((Start|Enter|Read|Reduc|Shift)ing|state|Error:) ' stderr >at-stderr |
310 |
mv at-stderr stderr |
mv at-stderr stderr |
311 |
|
|
312 |
AT_CHECK([cat stderr], 0, |
AT_CHECK([cat stderr], 0, |
313 |
[m4_match([$1], [--location], [$4: ])[]dnl |
[m4_bmatch([$1], [--location], [$4: ])[]dnl |
314 |
parse error[]dnl |
parse error[]dnl |
315 |
m4_match([$1], [--yyerror-verbose], [, $5])[]dnl |
m4_bmatch([$1], [--yyerror-verbose], [, $5])[]dnl |
316 |
|
|
317 |
]) |
]) |
318 |
|
|
330 |
AT_DATA_CALC_Y([$1]) |
AT_DATA_CALC_Y([$1]) |
331 |
|
|
332 |
# Specify the output files to avoid problems on different file systems. |
# Specify the output files to avoid problems on different file systems. |
333 |
AT_CHECK([bison calc.y -o calc.c m4_patsubst([$1], [--yyerror-verbose])], |
AT_CHECK([bison calc.y -o calc.c m4_bpatsubst([$1], [--yyerror-verbose])], |
334 |
[0], [], []) |
[0], [], []) |
335 |
AT_CHECK([$CC $CFLAGS $CPPFLAGS calc.c -o calc], 0, [], []) |
|
336 |
|
# Some compilers issue warnings we don't want to hear about. |
337 |
|
# Maybe some day we will have proper Autoconf macros to disable these |
338 |
|
# warnings, but this place is not the right one for that. |
339 |
|
# So let's keep only GCC warnings, which we know are sane. |
340 |
|
AT_CHECK([$CC $CFLAGS $CPPFLAGS calc.c -o calc], 0, [], [stderr]) |
341 |
|
AT_CHECK([test "$GCC" = yes && cat stderr]) |
342 |
|
|
343 |
# Test the priorities. |
# Test the priorities. |
344 |
_AT_CHECK_CALC([$1], |
_AT_CHECK_CALC([$1], |