From 63bda378a7eacfb02501ce2f1d996427f29b1336 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 29 Dec 2015 12:23:17 -0700 Subject: [PATCH] configure: check if lex requires/fails with -o for output Signed-off-by: Jens Axboe --- Makefile | 4 ++++ configure | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Makefile b/Makefile index 510e2570..1b5c9a6f 100644 --- a/Makefile +++ b/Makefile @@ -297,7 +297,11 @@ override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' ifdef CONFIG_ARITHMETIC lex.yy.c: exp/expression-parser.l +ifdef CONFIG_LEX_USE_O $(QUIET_LEX)$(LEX) -o $@ $< +else + $(QUIET_LEX)$(LEX) $< +endif lex.yy.o: lex.yy.c y.tab.h $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< diff --git a/configure b/configure index af26165e..a0d5a15f 100755 --- a/configure +++ b/configure @@ -1494,6 +1494,16 @@ fi fi fi +# Check if lex fails using -o +if test "$arith" = "yes" ; then +$LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null +if test "$?" = "0" ; then + lex_use_o="yes" +else + lex_use_o="no" +fi +fi + echo "lex/yacc for arithmetic $arith" ########################################## @@ -1756,6 +1766,9 @@ if test "$arith" = "yes" ; then else echo "YACC=$YACC" >> $config_host_mak fi + if test "$lex_use_o" = "yes" ; then + echo "CONFIG_LEX_USE_O=y" >> $config_host_mak + fi fi if test "$getmntent" = "yes" ; then output_sym "CONFIG_GETMNTENT" -- 2.25.1