Enhance the "lemon" executable so that it ignores -f, -W, -O, and -I

command-line options.  This permits most of the same options that are passed
to the compiler to also be harmlessly passed to lemon, and thus
simplifies makefiles.

FossilOrigin-Name: da408d128b4301d9fc7a3a00f219dce7ed48bc60
This commit is contained in:
drh 2015-01-01 19:11:22 +00:00
parent 7203aed919
commit 0325d3962a
3 changed files with 17 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Fix\san\serror\sin\sthe\scomputation\sof\sthe\snumber\sof\shours\sof\sruntime\sfor\nindividual\stest\sruns\sin\sthe\sreleasetest.tcl\sscript. C Enhance\sthe\s"lemon"\sexecutable\sso\sthat\sit\signores\s-f,\s-W,\s-O,\sand\s-I\ncommand-line\soptions.\s\sThis\spermits\smost\sof\sthe\ssame\soptions\sthat\sare\spassed\nto\sthe\scompiler\sto\salso\sbe\sharmlessly\spassed\sto\slemon,\sand\sthus\nsimplifies\smakefiles.
D 2015-01-01T18:54:23.534 D 2015-01-01T19:11:22.522
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -1192,7 +1192,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
F tool/lemon.c 3ff0fec22f92dfb54e62eeb48772eddffdbeb0d6 F tool/lemon.c 20f3132a1a150d50b022aa0b1fa26bd46aebf7b5
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b F tool/mkautoconfamal.sh 5dc5010e2e748a9e1bba67baca5956a2c2deda7b
@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 30891c6b8ebe9dfc939f9695bb45a159fbaaf262 P e2b0ebe21cd8a63927decb645efd2db80bf88379
R ff7c096e1b65892104ff528c7034919c R 5d6dc81c5e6fc0ccf7a552bd6bb1dd01
U drh U drh
Z 2f878e885c01058106b8fb811cc67e19 Z c56b05defbbdeecd31b9d2ca5ed09dfe

View File

@ -1 +1 @@
e2b0ebe21cd8a63927decb645efd2db80bf88379 da408d128b4301d9fc7a3a00f219dce7ed48bc60

View File

@ -1497,10 +1497,12 @@ int main(int argc, char **argv)
{OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."}, {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."},
{OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."}, {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."},
{OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."}, {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."},
{OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, {OPT_FSTR, "f", 0, "Ignored. (Placeholder for -f compiler options.)"},
{OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."}, {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
{OPT_FSTR, "I", 0, "Ignored. (Placeholder for '-I' compiler options.)"},
{OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."}, {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."},
{OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."}, {OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."},
{OPT_FSTR, "O", 0, "Ignored. (Placeholder for '-O' compiler options.)"},
{OPT_FLAG, "p", (char*)&showPrecedenceConflict, {OPT_FLAG, "p", (char*)&showPrecedenceConflict,
"Show conflicts resolved by precedence rules"}, "Show conflicts resolved by precedence rules"},
{OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."}, {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
@ -1508,6 +1510,8 @@ int main(int argc, char **argv)
{OPT_FLAG, "s", (char*)&statistics, {OPT_FLAG, "s", (char*)&statistics,
"Print parser stats to standard output."}, "Print parser stats to standard output."},
{OPT_FLAG, "x", (char*)&version, "Print the version number."}, {OPT_FLAG, "x", (char*)&version, "Print the version number."},
{OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."},
{OPT_FSTR, "W", 0, "Ignored. (Placeholder for '-W' compiler options.)"},
{OPT_FLAG,0,0,0} {OPT_FLAG,0,0,0}
}; };
int i; int i;
@ -1812,6 +1816,8 @@ static int handleflags(int i, FILE *err)
errline(i,1,err); errline(i,1,err);
} }
errcnt++; errcnt++;
}else if( op[j].arg==0 ){
/* Ignore this option */
}else if( op[j].type==OPT_FLAG ){ }else if( op[j].type==OPT_FLAG ){
*((int*)op[j].arg) = v; *((int*)op[j].arg) = v;
}else if( op[j].type==OPT_FFLAG ){ }else if( op[j].type==OPT_FFLAG ){
@ -2001,17 +2007,17 @@ void OptPrint(){
break; break;
case OPT_INT: case OPT_INT:
case OPT_FINT: case OPT_FINT:
fprintf(errstream," %s=<integer>%*s %s\n",op[i].label, fprintf(errstream," -%s<integer>%*s %s\n",op[i].label,
(int)(max-lemonStrlen(op[i].label)-9),"",op[i].message); (int)(max-lemonStrlen(op[i].label)-9),"",op[i].message);
break; break;
case OPT_DBL: case OPT_DBL:
case OPT_FDBL: case OPT_FDBL:
fprintf(errstream," %s=<real>%*s %s\n",op[i].label, fprintf(errstream," -%s<real>%*s %s\n",op[i].label,
(int)(max-lemonStrlen(op[i].label)-6),"",op[i].message); (int)(max-lemonStrlen(op[i].label)-6),"",op[i].message);
break; break;
case OPT_STR: case OPT_STR:
case OPT_FSTR: case OPT_FSTR:
fprintf(errstream," %s=<string>%*s %s\n",op[i].label, fprintf(errstream," -%s<string>%*s %s\n",op[i].label,
(int)(max-lemonStrlen(op[i].label)-8),"",op[i].message); (int)(max-lemonStrlen(op[i].label)-8),"",op[i].message);
break; break;
} }