support --with-system-secp256k1 - #414
Conversation
7dd8a70 to
b745937
Compare
Quoting jgriffiths: > --enable-openssl-tests is no longer supported in secp and should be removed Suggested-by: Jon Griffiths <jon_p_griffiths@yahoo.com> (@jgriffiths) See: #414 (comment)
|
@whitslack you'll need to rebase, I'm keeping the docs updates and version bump floating as the top commits. |
b745937 to
8c7625a
Compare
8c7625a to
1e6e8d3
Compare
1e6e8d3 to
c0a97b0
Compare
b2f3331 to
7e6ab8b
Compare
Quoting jgriffiths: > --enable-openssl-tests is no longer supported in secp and should be removed Suggested-by: Jon Griffiths <jon_p_griffiths@yahoo.com> (@jgriffiths) See: #414 (comment)
f997f7d to
0d3639f
Compare
ee3196e to
041475a
Compare
0d3639f to
476ac41
Compare
041475a to
36488de
Compare
81ccbab to
0df2d50
Compare
|
@whitslack I've merged the core change for I think this just leaves the python/setup.py changes outstanding. If you can close these two outstanding PRs, rebase and put the Python changes into a single PR then I'll look at how to merge them. Note I won't be changing the amalgamation compile by default, but it should be possible to allow you to build without it via env var or similar. edit: |
@jgriffiths: Can you clarify? It doesn't make sense to include both the amalgamated sources and
Who the heck is building a software package from source without having |
This is a little misleading. Preferably users shouldn't be specifying any |
36488de to
25e1658
Compare
25e1658 should address this. |
As above, this is broken with libtool if they build dynamic and static, but want to link statically. But also, not everyone uses libtool to link their app, and wally should not force that upon them. |
True, but isn't that a moot point? If both shared and static libraries are found, Anyway, I have no real point. If someone uses libtool, then they ought to know that they're supposed to link against only |
Quoting jgriffiths: > --enable-openssl-tests is no longer supported in secp and should be removed Suggested-by: Jon Griffiths <jon_p_griffiths@yahoo.com> (@jgriffiths) See: #414 (comment)
|
Hi @whitslack sorry for the delay. I've cherry-picked and merged most of the 1.0.0 changes, with #422 scheduled to be merged next. Can you rebase this on #422 and include your proposed fixup commit 25e1658 ? the CI will then prove whether the build is working without pkgconfig installed. Once this commit is merged all that remains is the python linkage PR which I'll look at once this change is in, thanks. |
25e1658 to
b9434ac
Compare
Altering ac_configure_args to configure libsecp256k1 with options differing from those of libwally-core causes issues if the wally Makefile is out of date and needs to call autoreconf etc to regenerate itself. The secp arguments are passed back to the top level configure which changes and possibly breaks the original configuration. Instead, import and use AX_SUBDIRS_CONFIGURE from the autoconf-archive which supports sub-confiration with bespoke arguments. Because autoreconf does not recurse into subdirectories named by AX_SUBDIRS_CONFIGURE, we lose the automagic Autotools (re)generation in src/secp256k1, so add an explicit call to src/secp256k1/autogen.sh in tools/autogen.sh.
(Modified from the original submission). Libwally-core, in its stock configuration, compiles and statically links against a private copy of libsecp256k1_zkp. However, Gentoo unbundles libsecp256k1_zkp and instead links libwally-core against a system-wide shared libsecp256k1_zkp with headers in /usr/include/secp256k1_zkp and a libsecp256k1_zkp.pc that specifies the relevant CFLAGS and LIBS. Implement a --with-system-secp256k1 configure option to allow compiling and linking against a system-installed libsecp256k1. Pass the user- specified package name (or 'libsecp256k1' or 'libsecp256k1_zkp' by default, depending on --enable-standard-secp) to PKG_CHECK_MODULES to find the CFLAGS and LIBS of a system-installed libsecp256k1. Call AC_CHECK_FUNCS to assert that the required modules are present in the system-installed libsecp256k1. If the user does not specify --with-system-secp256k1 (or specifies --without-system-secp256k1), the build will use the bundled copy of libsecp256k1_zkp as before. Remove the existing libtool hack: When building as a static library, the user will need to link libsecp256k1.a in addition to libwallycore.a.
b9434ac to
cc65798
Compare
|
Merged under #423, closing. |
Quoting jgriffiths: > --enable-openssl-tests is no longer supported in secp and should be removed Suggested-by: Jon Griffiths <jon_p_griffiths@yahoo.com> (@jgriffiths) See: ElementsProject#414 (comment)
Libwally-core, in its stock configuration, compiles and statically links against a private copy of libsecp256k1_zkp. However, Gentoo unbundles libsecp256k1_zkp and instead links libwally-core against a system-wide shared libsecp256k1_zkp with headers in
/usr/include/secp256k1_zkpand alibsecp256k1_zkp.pcthat specifies the relevantCFLAGSandLIBS.Implement a
--with-system-secp256k1configure option to allow compiling and linking against a system-installed libsecp256k1. Pass the user-specified package name (orlibsecp256k1orlibsecp256k1_zkpby default, depending on--enable-standard-secp) toPKG_CHECK_MODULESto find theCFLAGSandLIBSof a system-installed libsecp256k1. CallAC_CHECK_FUNCSto assert that the required modules are present in the system-installed libsecp256k1.If the user does not specify
--with-system-secp256k1(or specifies--without-system-secp256k1), then the pre-existing behavior is preserved: namely, the build will use the bundled copy of libsecp256k1_zkp.Adjust several
#includedirectives to reference secp256k1 headers in the configured header search path rather than explicitly specifying paths to the private copies. In the case of using the bundled libsecp256k1_zkp,src/secp256k1/includeis added to the header search path; otherwise, the necessaryCFLAGS, if any, are taken from pkg-config.