From 78c915f65a648ea731fc0cee147c422c8cf4c369 Mon Sep 17 00:00:00 2001 From: Daria Phoebe Brashear Date: Thu, 19 Apr 2018 17:32:59 -0400 Subject: [PATCH] lex: %option not supported by solaris lex it turns out that we don't need to tell lex we don't plan to use unput; we can just.... not use unput. however, if we're flex, use the command line option if it's available, to avoid warnings --- configure.ac | 3 +++ lib/com_err/Makefile.am | 1 + lib/com_err/lex.l | 2 -- lib/sl/Makefile.am | 1 + lib/sl/slc-lex.l | 2 -- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 4ea9bfd01..f1e8d7b15 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,9 @@ fi dnl AC_KRB_PROG_YACC AC_PROG_YACC AM_PROG_LEX +AS_IF([$LEX --nounput -V > /dev/null 2>&1 && test $? -eq 0], + [AC_SUBST([FLEXNOUNPUTARGS], ["--nounput"])], + [AC_SUBST([FLEXNOUNPUTARGS], [""])]) dnl AC_PROG_RANLIB AC_PROG_AWK AC_KRB_PROG_LN_S diff --git a/lib/com_err/Makefile.am b/lib/com_err/Makefile.am index 7c06cf56f..8c027c74d 100644 --- a/lib/com_err/Makefile.am +++ b/lib/com_err/Makefile.am @@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.am.common YFLAGS = -d +LFLAGS = @FLEXNOUNPUTARGS@ lib_LTLIBRARIES = libcom_err.la libcom_err_la_LDFLAGS = -version-info 2:3:1 diff --git a/lib/com_err/lex.l b/lib/com_err/lex.l index 04a852205..e812b32df 100644 --- a/lib/com_err/lex.l +++ b/lib/com_err/lex.l @@ -53,8 +53,6 @@ static int getstring(void); %} -%option nounput - %% et { return ET; } error_table { return ET; } diff --git a/lib/sl/Makefile.am b/lib/sl/Makefile.am index e7be219fc..152b86a33 100644 --- a/lib/sl/Makefile.am +++ b/lib/sl/Makefile.am @@ -9,6 +9,7 @@ endif AM_CPPFLAGS += $(ROKEN_RENAME) YFLAGS = -d +LFLAGS = @FLEXNOUNPUTARGS@ include_HEADERS = sl.h diff --git a/lib/sl/slc-lex.l b/lib/sl/slc-lex.l index 1099ede32..50965bccd 100644 --- a/lib/sl/slc-lex.l +++ b/lib/sl/slc-lex.l @@ -53,8 +53,6 @@ static char * handle_string(void); %} -%option nounput - %% [A-Za-z][-A-Za-z0-9_]* { yylval.string = strdup ((const char *)yytext);