Skip to content

Conjure up config.h header guards and improve search for shared libs#2329

Merged
jimklimov merged 5 commits intonetworkupstools:masterfrom
jimklimov:config-header-guards
Mar 1, 2024
Merged

Conjure up config.h header guards and improve search for shared libs#2329
jimklimov merged 5 commits intonetworkupstools:masterfrom
jimklimov:config-header-guards

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Feb 29, 2024

Our include/config.h is sourced by many programs explicitly, and by some implicitly via common.h or other headers.

Since autotools generates it without a header guard, this is wasteful in terms of processing, and causes conflicts when certain test code carefully re-defines some of the configured values and then another header pulls in config.h again with a now-differently defined value.

This PR adds use of #ifndef NUT_NETVERSION in consuming NUT internal headers as a sort of header guard for #include "config.h" directive there, to avoid double-processing.

Other commits fix:

  • a small typo for Fix make docs for runs made completely out-of-tree #2318 makefile comment changes;
  • suggesting related libraries (maybe a missing symlink?) if no direct hit is found;
  • update docs regarding libneon on OpenBSD (the case of the missing symlink) and finding pip for older Python releases

@jimklimov jimklimov added CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings portability We want NUT to build and run everywhere possible labels Feb 29, 2024
@jimklimov jimklimov added this to the 2.8.2 milestone Feb 29, 2024
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the config-header-guards branch from 15baa36 to d31b8c2 Compare February 29, 2024 13:25
...on systems that only support it partially

Courtesy of https://stackoverflow.com/a/65125295/4715872

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ame (if any), if got no hits

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov changed the title Conjure up config.h header guards Conjure up config.h header guards and improve search for shared libs Feb 29, 2024
@jimklimov jimklimov merged commit 2e68f7e into networkupstools:master Mar 1, 2024
@jimklimov jimklimov deleted the config-header-guards branch March 1, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) portability We want NUT to build and run everywhere possible refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant