gen_context: Don’t include basic-config.h
Before this commit, gen_context.c both included libsecp256k1-config.h and basic-config.h: The former only to obtain ECMULT_GEN_PREC_BITS and the latter to obtain a basic working configuration to be able to use the library.
This was inelegant and confusing: It meant that basic-config.h needs to #undef all the macros defined in libsecp256k1-config.h. Moreover, it meant that basic-config.h cannot define ECMULT_GEN_PREC_BITS, essentially making this file specific for use in gen_context.c.
After this commit, gen_context.c include only libsecp256k1-config.h. basic-config.h is not necessary anymore for the modules used in gen_context.c because 79f1f7a made the preprocessor detect all the relevant config options.
On the way, we remove an unused #define in basic-config.h.
This now cherrypicks https://github.com/bitcoin-core/secp256k1/pull/918/commits/71d76d1b3cb0480620a2071c5cdee033218eb37d from #918.
After this PR, basic-config.h is unused. We could simply remove it. But with the goal of improving non-autotools (#622) in mind, I don’t think that’s the best approach. Here are better options:
- We keep the file and it can help users to facilitate non-autotools builds. (This would mean we’ll merge #916 on top of this PR, which now should work properly now).
- We take a step back and think about a better solution for non-autotools builds. I’m willing to work on a PR.
- The library currently builds cleanly with a simply compiler invocation except that
ECMULT_WINDOW_SIZE
andECMULT_GEN_PREC_BITS
are not defined. So I suggest we define default values for those in the corresponding files. Then the library would be cleanly without any necessary config. - We provide the user with a template config file that documents the available config options. Creating such a template is not too hard using autotools, which supports this for the specific purpose of allowing non-autotools builds.
- We add a (then hopefully simple) section to the README that explains building without autotools.
- We add a CI job that tests that the build works with the command from the README.
- The library currently builds cleanly with a simply compiler invocation except that