]> git.draconx.ca Git - cdecl99.git/commitdiff
Give better errors when flex/bison are unavailable.
authorNick Bowler <nbowler@draconx.ca>
Wed, 24 Feb 2021 05:08:16 +0000 (00:08 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 3 Mar 2021 01:23:58 +0000 (20:23 -0500)
Makefile.am
configure.ac

index 6a8f1efe617e3960f51e8b6c35dae4f5e99b4fea..620b37bf1af4aee3c969819616b152422a73402f 100644 (file)
@@ -193,10 +193,19 @@ FLEX_V   = $(FLEX_V_@AM_V@)
 FLEX_V_  = $(FLEX_V_@AM_DEFAULT_V@)
 FLEX_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'FLEX    ' $<;
 
 FLEX_V_  = $(FLEX_V_@AM_DEFAULT_V@)
 FLEX_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'FLEX    ' $<;
 
-.y.c: ;
-.l.c: ;
+DEV_TOOL_ERROR = { \
+  echo "ERROR: *** $$tool is missing on your system."; \
+  echo "       *** Because of this, I cannot compile $$toolsrc, but"; \
+  echo "       *** (perhaps because you modified it) the sources appear out"; \
+  echo "       *** of date.  If $$tool is installed but was not detected by"; \
+  echo "       *** configure, consired setting $$toolvar and re-running configure."; \
+  echo "       *** See config.log for more details."; } >&2; false
 
 
+.y.c: ;
 .y.stamp:
 .y.stamp:
+if !HAVE_BISON
+       $(BISON_V)tool=bison toolvar=BISON toolsrc=$<; $(DEV_TOOL_ERROR)
+endif
        $(AM_V_at) touch $@.tmp
        $(BISON_V) $(BISON) $(BISON_COMPAT) -o $*.c --defines=$*.h.tmp $(BISONFLAGS) $<
        $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
        $(AM_V_at) touch $@.tmp
        $(BISON_V) $(BISON) $(BISON_COMPAT) -o $*.c --defines=$*.h.tmp $(BISONFLAGS) $<
        $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
@@ -206,7 +215,11 @@ FLEX_V_0 = @printf '  %$(DX_ALIGN_V)s %s\n' 'FLEX    ' $<;
        fi
        $(AM_V_at) mv -f $@.tmp $@
 
        fi
        $(AM_V_at) mv -f $@.tmp $@
 
+.l.c: ;
 .l.stamp:
 .l.stamp:
+if !HAVE_FLEX
+       $(FLEX_V)tool=flex toolvar=FLEX toolsrc=$<; $(DEV_TOOL_ERROR)
+endif
        $(AM_V_at) touch $@.tmp
        $(FLEX_V) $(FLEX) -o $*.c --header-file=$*.h.tmp $(FLEXFLAGS) $<
        $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
        $(AM_V_at) touch $@.tmp
        $(FLEX_V) $(FLEX) -o $*.c --header-file=$*.h.tmp $(FLEXFLAGS) $<
        $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
index e0a67aac01adaeb46911b4d676bc73a196a455a3..b30597aaa3c93798217d48e447458c2ed909c218 100644 (file)
@@ -48,8 +48,12 @@ m4_traceoff([AM_GNU_GETTEXT])
 AM_GNU_GETTEXT([external])
 DX_LINGUAS
 
 AM_GNU_GETTEXT([external])
 DX_LINGUAS
 
-DX_PROG_FLEX([], [], [FLEX=false])
-DX_PROG_BISON([], [], [BISON=false])
+DX_PROG_FLEX([], [have_flex=yes], [have_flex=no])
+AM_CONDITIONAL([HAVE_FLEX], [test x"$have_flex" = x"yes"])
+
+DX_PROG_BISON([], [have_bison=yes], [have_bison=no])
+AM_CONDITIONAL([HAVE_BISON], [test x"$have_bison" = x"yes"])
+
 DX_BISON_COMPAT
 BISON_I18N
 
 DX_BISON_COMPAT
 BISON_I18N