mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-20 22:27:17 -08:00
2ce0f85d0ce360488d2451ff8586e4b57f6465eb
Background
==========
NGINX's ABI and API can change depending on supplied ./configure flags
(most notoriously, enabling/disabling many first-party modules can
change ABI and API of NGINX as a whole). Perhaps unrelated, but
third-party modules are expected to be built in-tree, at the same time
NGINX is built. It is because of these two factors that we have to
freeze/preserve NGINX configuration.
Configuration-saving methods
============================
In general, I have identified two approaches as to how to preserve NGINX
configuration for building third-party modules out-of-tree.
The current implementation saves the generated headers:
ngx_auto_config.h and ngx_auto_headers.h. When third-party modules are
built, the ./configure flags are mostly ignored. It is straightforward
and easy and allowed us to cut some parts of configuration out.
Unfortunately, due to headers not being first-class configuration in the
build system, it has proven to be quite difficult to change some parts
of the build using headers alone.
For instance, my initial header-mangling-based implementation of
ngx_force_module (see the following commit) proved to be quite limited
and not really robust. The reason why I used this approach initially is
because when nginx-module.eclass was written, none of the
ngx_force_module fancy crossed my mind.
Second method is saving the ./configure flags themselves. Although
increasing the src_configure time (since we no longer skip phases), this
allows to build modules and edit the build configuration more easily and
correctly. This also gives users/ebuild authors more control since, as
stated above, most ./configure flags are ignored in the header
implementation.
Compatibility
=============
While nginx.eclass completely removes support for emitting
ngx_auto_{config,headers}.h, generating only ./configure flags,
nginx-module.eclass will support both configuration-saving methods for
the time being, allowing users to update www-servers/nginx.
Notes
=====
Passing ./configure flags around makes modules transitively depend on
NGINX's dependencies.
-Wl,--as-needed is added to LDFLAGS since NGINX links external
libraries needed by first-party modules also to third-party modules.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1329
Signed-off-by: Sam James <sam@gentoo.org>
…
…
…
…
…
…
…
Description
No description provided
9.8 GiB
Languages
Shell
98%
Roff
1.4%
Emacs Lisp
0.2%
C
0.1%