summaryrefslogtreecommitdiff
path: root/include/make
Commit message (Collapse)AuthorAgeFilesLines
* BUILD: makefile: only consider settings from enabled optionsWilly Tarreau2022-12-231-2/+2
| | | | | | | | | | | | | Due to the previous SSL exception we coudln't restrict the collected CFLAGS/LDFLAGS to those of enabled options, so all of them were considered if set. The problem is that it would prevent simply disabling a build option without unsetting its xxx_CFLAGS or _LDFLAGS values if those had incompatible values (e.g. -lfoo). Now that only existing options are listed in collect_opts_flags, we can safely check that the option is set and only consider its settings in this case. Thus OT_LDFLAGS will not be used if USE_OT is not set for example.
* BUILD: makefile: remove the special case of the SSL optionWilly Tarreau2022-12-231-2/+2
| | | | | | | | By creating USE_SSL and enabling it when USE_OPENSSL is set, we can get rid of the special case that was made with it regarding cflags collect and when resetting options. The option doesn't need to be manually set, though in the future it might prove useful if other non-openssl API are supported.
* BUILD: makefile: make all OpenSSL variants use the same settingsWilly Tarreau2022-12-231-1/+1
| | | | | | | | | | | | | | It's getting complicated to configure includes and lib dirs for OpenSSL API variants such as WolfSSL, because some settings are common and others are specific but carry a prefix that doesn't match the USE_* rule scheme. This patch simplifies everything by considering that all SSL libs will use SSL_INC, SSL_LIB, SSL_CFLAGS and SSL_LDFLAGS. That's much more convenient. This works thanks to the settings collector which explicitly checks the SSL_* settings. When USE_OPENSSL_WOLFSSL is set, then USE_OPENSSL is implied, so that there's no need to duplicate maintenance effort.
* BUILD: makefile: add a function to collect all options' CFLAGS/LDFLAGSWilly Tarreau2022-12-231-0/+13
| | | | | | | The new function collect_opts_flags now scans all USE_* options defined in use_opts and appends the corresponding *_CFLAGS and *_LDFLAGS to OPTIONS_{C,LD}FLAGS respectively. This will be useful to get rid of all the individual concatenations to these variables.
* BUILD: makefile: initialize all build options' variables at onceWilly Tarreau2022-12-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | A lot of _SRC, _INC, _LIB etc variables are set and expected to be initialized to an empty string by default. However, an in-depth review of all of them showed that WOLFSSL_{INC,LIB}, SSL_{INC,LIB}, LUA_{INC,LIB}, and maybe others were not always initialized and could sometimes leak from the environment and as such cause strange build issues when running from cascaded scripts that had exported them. The approach taken here consists in iterating over all USE_* options and unsetting any _SRC, _INC, _LIB, _CFLAGS and _LDFLAGS that follows the same name. For the few variable names options that don't exactly match the build option (SSL & WOLFSSL), these ones are specifically added to the list. The few that were explicitly cleared in their own sections were just removed since not needed anymore. Note that an "undefine" command appeared in GNU make 3.82 but since we support older ones we can only initialize the variables to an empty string here. It's not a problem in practice. We're now certain that these variables are empty wherever they are used, and that it is possible to just append to them, or use them as-is.
* BUILD: makefile: sort the features listWilly Tarreau2022-12-231-1/+1
| | | | | The features list that appears in -vv appears in a random order, which always makes it a pain to look for certain features. Let's sort it.
* BUILD: makefile: move common options-oriented macros to include/make/options.mkWilly Tarreau2022-12-231-0/+33
| | | | | | | | | Some macros and functions are barely understandable and are only used to iterate over known options from the use_opts list. Better assign them a name and move them into a dedicated file to clean the makefile a little bit. Now at least "use_opts" only appears once, where it is defined. This also allowed to completely remove the BUILD_FEATURES macro that caused some confusion until previous commit.
* BUILD: makefile: move the compiler option detection stuff to compiler.mkWilly Tarreau2022-11-171-0/+42
| | | | | | | | There's quite a large barely readable functions block in the makefile dedicated to compiler option support. It provides no value here and makes it harder to find user-configurable stuff, so let's move it to include/make/compiler.mk to keep the makefile a bit cleaner. It's better to keep the options themselves in the makefile however.
* BUILD: makefile: use $(cmd_MAKE) in quiet modeWilly Tarreau2022-11-171-0/+3
| | | | | | It's better to see "make" entering a subdir than seeing nothing, so let's use a command name for make. Since make 3.81, "+" needs to be prepended in front of the command to pass the job server to the subdir.
* BUILD: makefile: move default verbosity settings to include/make/verbose.mkWilly Tarreau2022-11-171-0/+27
The $(Q), $(V), $(cmd_xx) handling needs to be reused in sub-project makefiles and it's a pain to maintain inside the main makefile. Let's just move that into a new subdir include/make/ with a dedicated file "verbose.mk". It slightly cleans up the makefile in addition.