diff options
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/Makefile.am | 15 |
2 files changed, 20 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 7d742c5..901339f 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,15 @@ AC_ARG_ENABLE([libfl], [], [enable_libfl=yes]) AM_CONDITIONAL([ENABLE_LIBFL], [test "x$enable_libfl" = xyes]) +# --disable-bootstrap is intended only to workaround problems with bootstrap +# (e.g. when cross-compiling flex or when bootstrapping has bugs). +# Ideally we should be able to bootstrap even when cross-compiling. +AC_ARG_ENABLE([bootstrap], + [AS_HELP_STRING([--disable-bootstrap], + [don't perform a bootstrap when building flex])], + [], [enable_bootstrap=yes]) +AM_CONDITIONAL([ENABLE_BOOTSTRAP], [test "x$enable_bootstrap" = xyes]) + AC_PATH_PROG([BISON], bison, no) AS_IF([test "$BISON" != no],[], [ AC_SUBST([BISON], [\${top_srcdir}/build-aux/missing bison]) diff --git a/src/Makefile.am b/src/Makefile.am index a4742fd..3b5e362 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,9 @@ LIBS = @LIBS@ m4 = @M4@ bin_PROGRAMS = flex +if ENABLE_BOOTSTRAP noinst_PROGRAMS = stage1flex +endif if ENABLE_LIBFL lib_LTLIBRARIES = libfl.la @@ -82,16 +84,21 @@ skel.c: flex.skl mkskel.sh flexint.h tables_shared.h tables_shared.c $(SHELL) $(srcdir)/mkskel.sh > $@.tmp mv $@.tmp $@ +if ENABLE_BOOTSTRAP stage1scan.c: scan.l stage1flex$(EXEEXT) ./stage1flex$(EXEEXT) $(AM_LFLAGS) $(LFLAGS) -o $@ $< +else +stage1scan.c: scan.c + sed 's|^\(#line .*\)"'`printf %s $< | sed 's|[][\\\\.*]|\\\\&|g'`'"|\1"$@"|g' $< > $@ +endif # make needs to be told to make parse.h so that parallelized runs will # not fail. -main.c : parse.h -scan.c : parse.h -stage1scan.c : parse.h -yylex.c : parse.h +main.c: parse.h +yylex.c: parse.h +stage1flex-scan.$(OBJEXT): parse.h +flex-stage1scan.$(OBJEXT): parse.h # Run GNU indent on sources. Don't run this unless all the sources compile cleanly. # |