diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-01-13 10:29:15 +0100 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-01-13 10:32:52 +0100 |
commit | 672f113f48209834926f649cdebf8e11dae64af0 (patch) | |
tree | eb8118b0db3256a0c58d8c6ea67ad22c48749bd4 /mimetypes/Makefile.am | |
parent | 8c68d2a748ce641209d4e4a142a14ca2b0477c5a (diff) | |
download | fileserv-672f113f48209834926f649cdebf8e11dae64af0.tar.gz fileserv-672f113f48209834926f649cdebf8e11dae64af0.tar.bz2 |
Various fixes in libmimetypes
* mimetypes/Makefile.am: Rename yy prefix in grammar and lexer.
* mimetypes/grammar.y (yyerror, yylex): Provide extern declarations.
* mimetypes/lexer.l (yylval, yylloc, yyerror): Provide defines to
compensate for --name-prefix in bison (see notes in Makefile.am).
Fix improper usage of yyerror.
Diffstat (limited to 'mimetypes/Makefile.am')
-rw-r--r-- | mimetypes/Makefile.am | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mimetypes/Makefile.am b/mimetypes/Makefile.am index cdcb0f1..3517a76 100644 --- a/mimetypes/Makefile.am +++ b/mimetypes/Makefile.am | |||
@@ -12,7 +12,18 @@ libmimetypes_a_SOURCES = \ | |||
12 | locus.h\ | 12 | locus.h\ |
13 | prloc.c\ | 13 | prloc.c\ |
14 | yyloc.h | 14 | yyloc.h |
15 | EXTRA_DIST=grammar.h | 15 | |
16 | AM_YFLAGS=-vtd | 16 | # Notes on prefix renaming: |
17 | AM_LEXFLAGS=-d | 17 | # 1) bison and flex are required |
18 | # 2) The following symbols must be renamed manually in lexer.l: | ||
19 | # yylval, yylloc, yyerror. We do so by inserting appropriate | ||
20 | # #defines immediately after the #include block. | ||
21 | # 3) flex --prefix also renames the output root, so LEX_OUTPUT_ROOT | ||
22 | # must be redefined to compensate for it. | ||
23 | # In general, all of the above is a terrible kludge. I'd be better off | ||
24 | # using gylwrap from GNU mailutils. | ||
25 | AM_YFLAGS=-v -t -d --name-prefix=yymt | ||
26 | AM_LFLAGS=-d --prefix=yymt | ||
27 | LEX_OUTPUT_ROOT=lex.yymt | ||
28 | |||
18 | SUBDIRS = . tests | 29 | SUBDIRS = . tests |