Zurab Kvachadze 2ce0f85d0c nginx{,-module}.eclass: save NGINX build config by storing ./configure flags
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>
2026-07-31 21:27:43 +01:00
2026-07-31 10:20:42 +02:00
2026-07-31 20:07:35 +01:00
2026-07-30 22:56:57 +01:00
2026-07-29 11:20:18 +02:00
2026-07-29 11:20:20 +02:00
2026-07-31 21:00:38 +02:00
2026-07-31 13:12:59 +07:00
2026-07-19 08:20:48 +01:00
2026-07-24 13:38:18 +02:00
2026-07-25 21:53:13 +02:00
2026-07-28 10:10:41 -05:00
2026-07-03 03:48:13 +00:00
2026-07-31 03:26:53 +02:00
2026-07-23 16:33:13 +02:00
2026-07-12 18:44:05 +02:00
2026-07-29 15:06:36 +02:00
2026-07-31 22:36:55 +03:00
2026-07-30 22:00:07 +01:00
2026-07-25 06:28:44 -04:00
…
2026-07-05 18:35:56 +02:00
S
Description
No description provided
9.8 GiB
Languages
Shell 98%
Roff 1.4%
Emacs Lisp 0.2%
C 0.1%