diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-09-24 23:28:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-09-24 23:28:00 -0700 |
commit | 0b876b42caf102c20d595b343ae60a71b9048eb9 (patch) | |
tree | ebbb3e8455049ea20fe92d5f083015a8f6d94a4e | |
parent | 1d12e4169ffa4148ddaabc91e515850d341267ae (diff) | |
download | txr-0b876b42caf102c20d595b343ae60a71b9048eb9.tar.gz txr-0b876b42caf102c20d595b343ae60a71b9048eb9.tar.bz2 txr-0b876b42caf102c20d595b343ae60a71b9048eb9.zip |
configure: only detect lex in maintainer mode.
* Makefile (lex.yy.c): Move rule into maintainer conditional.
* configure: Describe maintainer variable in help text.
Move lex check into maintainer conditional.
* lex.yy.c.shipped: New file.
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | configure | 52 |
2 files changed, 32 insertions, 24 deletions
@@ -259,6 +259,8 @@ $(eval $(foreach item,lex.yy.o txr.o match.o parser.o,\ $(eval $(foreach item,y.tab.c y.tab.h lex.yy.c,\ $(call DEP,$(item),config.make config.h))) +ifeq ($(maintainer),y) + lex.yy.c: $(top_srcdir)parser.l $(call ABBREV,LEX) $(call SH,rm -f $@) @@ -271,8 +273,6 @@ lex.yy.c: $(top_srcdir)parser.l fi) $(call SH,chmod a-w $@) -ifeq ($(maintainer),y) - y.tab.h: y.tab.c $(call SH, \ if ! [ -e y.tab.h ] ; then \ @@ -288,7 +288,7 @@ Canonical: variable=value Defines the given variable as having the given value. variable= Defines the variable as having an empty value. - An empty value serves as boolean false. + An empty value serves as Boolean false. Long-option style: @@ -308,6 +308,14 @@ be used in paths. Default values are shown in [square brackets]. Variables are case-sensitive, but underscores and dashes are interchangeable. +maintainer [$maintainer] + + This a Boolean variable. If set to 'y', then it it specifies maintainer + mode, otherwise the build is configured for user mode. In maintainer mode, + the scanner and parser generator tools are expected to be available. + In user mode, the shipped parser and scanner are used. Changes to + the parser.l and parser.y files will have no effect. + prefix [$prefix] Specifies root directory where the software will ultimately be installed and @@ -1671,34 +1679,34 @@ fi # Lex and Yacc tests # -printf "Checking for lex ... " +if [ $maintainer ] ; then + printf "Checking for lex ... " -if [ -z "$lex_given" -a -z "$lexname_given" ] ; then - for lexname in '$(LEX)' "lex" "flex" "" ; do + if [ -z "$lex_given" -a -z "$lexname_given" ] ; then + for lexname in '$(LEX)' "lex" "flex" "" ; do + rm -f lex.yy.c + if make lexname="$lexname" lex.yy.c > /dev/null 2>&1; then + break; + fi + done + if [ -z "$lexname" ] ; then + printf "not found\n" + exit 1 + fi + else rm -f lex.yy.c - if make lexname="$lexname" lex.yy.c > /dev/null 2>&1; then - break; + if ! make lexname="$lexname" lex.yy.c > /dev/null 2>&1; then + printf "error\n\n" + printf 'values --lexname="%s" --lex="%s" are not working\n\n' "$lexname" "$lex" + printf 'A GNU Flex compatible lex is required\n\n' + exit 1 fi - done - if [ -z "$lexname" ] ; then - printf "not found\n" - exit 1 - fi -else - rm -f lex.yy.c - if ! make lexname="$lexname" lex.yy.c > /dev/null 2>&1; then - printf "error\n\n" - printf 'values --lexname="%s" --lex="%s" are not working\n\n' "$lexname" "$lex" - printf 'A GNU Flex compatible lex is required\n\n' - exit 1 fi -fi -rm -f lex.yy.c + rm -f lex.yy.c -printf '"%s"\n' "$lexname" + printf '"%s"\n' "$lexname" -if [ $maintainer ] ; then printf "Checking for yacc program ... " if [ -z "$yacc_given" -a -z "$yaccname_given" ] ; then |