comparison m4/acinclude.m4 @ 16174:39096b290a2f

check syntax used to enable bison push/pull parser * acinclude.m4 (OCTAVE_PROG_BISON): Check for syntax used to enable push/pull parser. * common.mk (BISON_PUSH_PULL_DECL_STYLE): New variable. * libinterp/Makefile.am (BUILT_DISTFILES): Include oct-parse.yy in the list. (EXTRA_DIST): Include oct-pase.in.yy in the list. (ULT_DIST_SRC): New variable. (SRC_DEF_FILES, TST_FILES_SRC): Use $(ULT_DIST_SRC) instead of $(DIST_SRC). * find-defun-files.sh: Transform .in.yy instead of .yy. * libinterp/parse-tree/module.mk (parse-tree/oct-parse.yy): New target and rule to substitute push-pull decl. * oct-parse.in.yy: Rename from oct-parse.yy Substitute %PUSH_PULL_DECL%.
author John W. Eaton <jwe@octave.org>
date Sat, 02 Mar 2013 12:26:42 -0500
parents b309a5da17f5
children 7ce484126bb2
comparison
equal deleted inserted replaced
16173:40a9a4e0d12a 16174:39096b290a2f
1401 dnl 1401 dnl
1402 dnl Check for bison. 1402 dnl Check for bison.
1403 dnl 1403 dnl
1404 AC_DEFUN([OCTAVE_PROG_BISON], [ 1404 AC_DEFUN([OCTAVE_PROG_BISON], [
1405 AC_PROG_YACC 1405 AC_PROG_YACC
1406 case "$YACC" in
1407 bison*)
1408 AC_CACHE_CHECK([syntax of bison push/pull declaration],
1409 [octave_cv_bison_push_pull_decl_style], [
1410 style="dash underscore"
1411 quote="noquote quote"
1412 for s in $style; do
1413 for q in $quote; do
1414 if test $s = "dash"; then
1415 def="%define api.push-pull"
1416 else
1417 def="%define api.push_pull"
1418 fi
1419 if test $q = "quote"; then
1420 def="$def \"both\""
1421 else
1422 def="$def both"
1423 fi
1424 cat << EOF > conftest.yy
1425 $def
1426 %start input
1427 %%
1428 input:;
1429 %%
1430 EOF
1431 $YACC conftest.yy > /dev/null 2>&1
1432 ac_status=$?
1433 if test $ac_status -eq 0; then
1434 if test $q = noquote; then
1435 q=
1436 fi
1437 octave_cv_bison_push_pull_decl_style="$s $q"
1438 break
1439 fi
1440 done
1441 if test $ac_status -eq 0; then
1442 break
1443 fi
1444 done
1445 rm -f conftest.yy y.tab.h
1446 ])
1447 ;;
1448 esac
1449
1450 AC_SUBST(BISON_PUSH_PULL_DECL_STYLE, $octave_cv_bison_push_pull_decl_style)
1451
1452 if test -z "$octave_cv_bison_push_pull_decl_style"; then
1453 YACC=
1454 warn_bison_push_pull_decl_style="
1455
1456 I wasn't able to find a suitable style for declaring a push-pull
1457 parser in a bison input file so I'm disabling bison.
1458 "
1459 OCTAVE_CONFIGURE_WARNING([warn_bison_push_pull_decl_style])
1460 fi
1461
1406 case "$YACC" in 1462 case "$YACC" in
1407 bison*) 1463 bison*)
1408 ;; 1464 ;;
1409 *) 1465 *)
1410 YACC='$(top_srcdir)/build-aux/missing bison' 1466 YACC='$(top_srcdir)/build-aux/missing bison'