Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build improvement for downstream #1237

Closed
alonbl opened this issue Oct 4, 2017 · 10 comments
Closed

build improvement for downstream #1237

alonbl opened this issue Oct 4, 2017 · 10 comments

Comments

@alonbl
Copy link
Contributor

alonbl commented Oct 4, 2017

Hi,

It will be very nice if build system can be somewhat improved to meet downstream requirements, in this case it is Gentoo, but is common to all others.

As build system is non standard it is very difficult to come up with a proper patch so I submitting this issue.

  1. Please add option to configure.py to receive toolchain tools: CXX, AR, this enables downstream to specify requested toolchain without patching or overriding the make variables.

  2. Please separate between optimization and required CXXFLAGS, for example:

CXXFLAGS = -std=c++11 -D_REENTRANT -O3 -momit-leaf-frame-pointer

should be split into:

CXXFLAGS ?= -O3 -momit-leaf-frame-pointer
BUILD_CXXFLAGS = -std=c++11 -D_REENTRANT $(CXXFLAGS)

Downstream may override the CXXFLAGS as it can already override the LDFLAGS while upstream can add mandatory flags into the build without conflict with downstream.

  1. Please add an option to configure.py to disable/enable documentation build and installation. Currently, in order to disable documentation we remove "docs" from install target, it will be nice to have an interface.

  2. And also Add option to disable building static library #1230 to support disable of static lib build/installation.

Thanks!

@alonbl
Copy link
Contributor Author

alonbl commented Oct 4, 2017

@randombit: this should make it easer to support the botan package, please consider.

@randombit
Copy link
Owner

@alonbl All these seem like reasonable requirements, thanks for raising the issue. We should be able to have all of these addressed in the next feature release (~early January).

@ioquatix
Copy link

ioquatix commented Oct 7, 2017

I just ran into this today. I was trying to build botan and found it didn't respect any of the environment variables, I had to figure out the custom build system. +1 support standard ENV variables.

randombit added a commit that referenced this issue Nov 29, 2017
Allows distributor to override CFLAGS without having to worry
about what -std=c++xx options we are using. See GH #1237
randombit added a commit that referenced this issue Nov 29, 2017
Allows distributor to override CFLAGS without having to worry
about what -std=c++xx options we are using. See GH #1237
randombit added a commit that referenced this issue Nov 29, 2017
Splits up the ar command and ar options to make this possible.
Removes support for calling `ranlib` after `ar`: testing in #1317
confirms that all platforms we support no longer need it.

See #1237. Also fixes #455
randombit added a commit that referenced this issue Nov 29, 2017
Splits up the ar command and ar options to make this possible.
Removes support for calling `ranlib` after `ar`: testing in #1317
confirms that all platforms we support no longer need it.

See #1237. Also fixes #455
@randombit
Copy link
Owner

@alonbl All fixed now in master and will be available in 2.4.0 (eta early Jan), so closing this issue.

  • configure.py respects AR and CXX environment variables now. It also supports it via command line flags (--cc-bin= and --ar-command=). --cc-bin already existed but the one for ar is new.

  • CXXFLAGS is now only optimization flags that can be edited/overridden by end user, lang specific flags are in another field in the makefile.

  • Documentation build/install can be disabled with new flag --without-documentation

  • Static library can be disabled with new flag --disable-static-library.

Thanks for your helpful comments.

@alonbl
Copy link
Contributor Author

alonbl commented Dec 1, 2017

Hi,

Thanks!!!

See #1327 which solves installation failure.

Please consider the following to leftovers:

  1. Accept CXXFLAGS and LDFLAGS at configure.py and inject then into the Makefile, this will allow a consistent configuration phase then a predictable build. There are examples in existing implementation to accept flags at configure.py.

  2. Perform the documentation build at build and not at install, currently the docs are built only because the install target depend on them.

Regards,
Alon

randombit added a commit that referenced this issue Dec 2, 2017
Also remove a duplicated block (rebase error)
@randombit randombit mentioned this issue Dec 2, 2017
@randombit
Copy link
Owner

Yeah both good ideas - added in #1328

randombit added a commit that referenced this issue Dec 2, 2017
Also remove a duplicated block (rebase error)
randombit added a commit that referenced this issue Dec 2, 2017
Also remove a duplicated block (rebase error)
@alonbl
Copy link
Contributor Author

alonbl commented Dec 2, 2017

Thanks!
Working, once merged, I can publish live ebuild.

@alonbl
Copy link
Contributor Author

alonbl commented Dec 2, 2017

Thanks!

Build sequence is now without hacks[1]!

[1] https://github.com/gentoo/gentoo/blob/master/dev-libs/botan/botan-9999.ebuild

@randombit
Copy link
Owner

@alonbl Nice! BTW I think (if I'm reading the ebuild right) the 2.x ebuild is still assuming Boost.Python is used (as it was in 1.10) but that is no longer the case. Since 2.0 the Python module just relies on the C API + Python's ctypes. So there is no need to pull in Boost just because Python is enabled, and even if Boost is used, it doesn't need to have python use flag itself.

Also the C API module (ffi) is currently disabled unless python is in the USE flags. Which is fine I guess but some applications already use the C interface directly (f.e. https://github.com/riboseinc/rnp) and we expect more in the future (eg when we get to exporting the TLS API to C, part of the plan includes contributing support to libcurl - #1323). I believe there is also a strongswan plugin in the works, which uses the C API.

Final note, ebuild is disabling the unix_procs module, but that has already been removed upstream since 1.11.34.

@alonbl
Copy link
Contributor Author

alonbl commented Dec 3, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants