diff options
author | Jan Maria Matejka <mq@ucw.cz> | 2018-07-17 15:30:59 +0200 |
---|---|---|
committer | Jan Maria Matejka <mq@ucw.cz> | 2018-08-14 14:01:39 +0200 |
commit | 86b9e8e39a0b42407c95921ca8262b0a75cad5f2 (patch) | |
tree | 3d874e8d8e225205ad364c7911485b3fdeb67b73 | |
parent | 1279a83103262950ab99e8a6fe3c6cc2da8d42a8 (diff) |
M4: generate synchronization lines
This also includes Bison version check. Versions before 3.0 don't
support them in a reliable way and we don't promise to work with
versions older than 2.4.
-rw-r--r-- | Makefile.in | 1 | ||||
-rw-r--r-- | aclocal.m4 | 19 | ||||
-rw-r--r-- | conf/Makefile | 2 | ||||
-rw-r--r-- | configure.ac | 9 |
4 files changed, 30 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index 8f6c0c8b..5665f1d3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,6 +9,7 @@ MAKEFLAGS += -r CPPFLAGS=-I$(objdir) -I$(srcdir) @CPPFLAGS@ CFLAGS=$(CPPFLAGS) @CFLAGS@ LDFLAGS=@LDFLAGS@ +M4FLAGS=@M4FLAGS@ LIBS=@LIBS@ DAEMON_LIBS=@DAEMON_LIBS@ CLIENT_LIBS=@CLIENT_LIBS@ @@ -175,3 +175,22 @@ AC_DEFUN([BIRD_CHECK_PROG_FLAVOR_GNU], ) esac ]) + +AC_DEFUN([BIRD_CHECK_BISON_VERSION], +[ + $1=`bison --version | ( read line; echo ${line##* } )` + case "$$1" in + 1.* | 2.0* | 2.1* | 2.2* | 2.3*) + AC_MSG_ERROR([Provided Bison version $$1 is too old, need at least 2.4]) + ;; + 2.*) + bird_bison_synclines=no + ;; + 3.* | 4.* | 5.* | 6.* | 7.* | 8.* | 9.*) + bird_bison_synclines=yes + ;; + *) + AC_MSG_ERROR([Couldn't parse Bison version $$1. Call the developers for help.]) + ;; + esac +]) diff --git a/conf/Makefile b/conf/Makefile index fb3dd052..47024d26 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -11,7 +11,7 @@ BISON_DEBUG=-t endif $(conf-y-targets): $(s)confbase.Y $(s)flowspec.Y - $(M4) -P $| $^ >$@ + $(M4) $(M4FLAGS) -P $| $^ >$@ $(o)cf-parse.y: | $(s)gen_parser.m4 $(o)keywords.h: | $(s)gen_keywords.m4 diff --git a/configure.ac b/configure.ac index 44184273..9a2e55e2 100644 --- a/configure.ac +++ b/configure.ac @@ -157,6 +157,15 @@ test -z "$FLEX" && AC_MSG_ERROR([Flex is missing.]) test -z "$BISON" && AC_MSG_ERROR([Bison is missing.]) test -z "$M4" && AC_MSG_ERROR([M4 is missing.]) +AC_MSG_CHECKING([bison version]) +BIRD_CHECK_BISON_VERSION(BISON_VERSION) +AC_MSG_RESULT([$BISON_VERSION]) +if test "$bird_bison_synclines" = yes; then + M4FLAGS="$M4FLAGS -s" +fi + +AC_SUBST([M4FLAGS]) + BIRD_CHECK_PROG_FLAVOR_GNU([$M4], [], [AC_MSG_ERROR([Provided M4 is not GNU M4.])] |