onetrueawk / awk

One true awk
Other
1.96k stars 156 forks source link

Consider providing `awkgram.tab.c` and `awkgram.tab.h` with the source #204

Closed absolutelynothinghere closed 8 months ago

absolutelynothinghere commented 8 months ago

Awk depends on bison during compilation to create the files awkgram.tab.c and awkgram.tab.h, however bison depends on awk to compile, causing a circular dependency... I suggest providing the files awkgram.tab.c and awkgram.tab.h with the awk source, perhaps with a .bak suffix, so the user can compile awk without bison if he so chooses.

Thank you.

plan9 commented 8 months ago

ah, i see, bison makefile requires awk. so is this to accommodate a build environment where both of those things are missing but eg. compilers available?

absolutelynothinghere commented 8 months ago

a build environment where both of those things are missing but eg. compilers available?

Yes.

plan9 commented 8 months ago

I would like to see a real-life example. in cross-compile environments, you don't usually end up missing eg. bison.

arnoldrobbins commented 8 months ago

Not to mention that any other yacc (e.g. Berkely Yacc) will also work for building awk. Or that a different awk, such as mawk or gawk, could be used for bootstrapping bison.

absolutelynothinghere commented 8 months ago

I would like to see a real-life example

Try bootstrapping any system without pre-compiled binaries of awk/yacc and see if you can break the circular dependency.

you don't usually end up missing eg. bison.

I thought that the "one true awk" would be portable across operating system and toolchains, and not another GNU tool. If that is not the case, then kindly state "this project depends on GNU Bison" in the readme and remove any mention of other yacc tools.

e.g. Berkely Yacc

Needs awk to compile. And speaking of byacc, it doesn't even compile your project without https://github.com/onetrueawk/awk/pull/201 which you also rejected.

Or that a different awk, such as mawk or gawk, could be used for bootstrapping bison.

So you're suggesting that I compile mawk/gawk, to compile bison, to... compile awk? This makes no sense.

It is impossible to "bootstrap bison" with mawk or gawk, because mawk also depends on yacc, and gawk depends on awk!