+# A 'lex' compatible LALR(1) scanner is required for SCM sourced builds,
+# or if the user modifies any 'lex' source. This AC_PROG_LEX compatible
+# macro set facilitates the handling of any situation where 'lex' is not
+# available, but is required to complete the build.
+#
+LEX = @LEX@
+LEX_COMMAND = $(LEX) $(LFLAGS) -t $< > $(LEX_OUTPUT)
+LEX_COMMAND_ABORT = { $(LEX_MISSING); rm -f $(LEX_OUTPUT); exit 2; }
+LEX_MISSING = (echo; echo $(LEX_MISSING_MESSAGE); echo) | $(FORMAT_MESSAGE)
+LEX_MISSING_MESSAGE = "I cannot find the program 'lex' on your system; \
+it is required because you either do not have the file '$@', or you appear \
+to have modified the file '$<'. If neither of these is the case, then you \
+may wish to update the time stamp of '$@', so that it appears to be newer \
+than '$<', before you run make again."
+LEX_OUTPUT = @LEX_OUTPUT_ROOT@.c
+
+# The following macro uses 'awk' to emulate a rudimentary 'nroff' filter,
+# for formatting notification messages, such as those which are emitted to
+# report the above "missing 'lex'" condition.
+#
+FORMAT_MESSAGE = awk '\
+ BEGIN { $(AWK_CLEAR_LINE_BUFFER) }\
+ /^\. *br$$/ { $(AWK_PRINT_AND_CLEAR_BUFFER) }\
+ NF == 0 { $(AWK_COLLECT_BLANK_LINE) }\
+ /^[^.]/ { $(AWK_COLLECT_MESSAGE) }\
+ END { $(AWK_FLUSH_LINE_BUFFER) }'
+
+# Establish a default line length for formatting messages.
+#
+MESSAGE_FOLD_WIDTH = 68