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: respect environment options more #1392

Merged
merged 5 commits into from
Jan 18, 2022
Merged

build: respect environment options more #1392

merged 5 commits into from
Jan 18, 2022

Conversation

thesamesam
Copy link
Contributor

@thesamesam thesamesam commented Jan 3, 2022

  • Update m4/ax_pthread.m4 (standard sync from autoconf-archive)
  • Respect AR, CC, RANLIB, CPPFLAGS, LDFLAGS (this is particularly helpful for downstreams)
  • Use $(MAKE) consistently for (very slightly) better parallel builds/installs

In addition to being able to easily use e.g. Clang for testing now, it should be easier to test with different LDFLAGS (e.g. different -fuse-ld= or -Wl,--as-needed).

I'd also like to say thanks for the configure.seed->configure.ac change (cf931fd) - it's helped a lot for us downstream in Gentoo.

If build system changes are welcome, please let me know, and I may make some further modernisation changes in future if that's something you're interested in?

Update ax_pthread.m4 to the latest version from the autoconf-archive
project.

Signed-off-by: Sam James <sam@gentoo.org>
It's necessary to be able to override choice of AR/CC/RANLIB and other toolchain
variables/tools for cross-compilation, testing with other toolchains, and
to ensure the compiler chosen by the user is actually used for the build.

Previously, GNU_PREFIX was kind-of used for this but this isn't a standard
variable (at all) and it wasn't applied consistently anyway.

We now use the standard autoconf mechanisms for finding these tools.

(RANLIB is already covered by LT_INIT.)

Signed-off-by: Sam James <sam@gentoo.org>
This ensures that parallel make works correctly, as otherwise, a fresh
make job will be started without the jobserver fd, and hence
not know about its parent, forcing -j1.
@thesamesam thesamesam marked this pull request as draft January 3, 2022 10:56
@thesamesam thesamesam marked this pull request as ready for review January 3, 2022 11:12
- CPPFLAGS is for the C preprocessor (usually for setting defines)
- LDFLAGS should be placed before objects for certain flags to work
  (e.g. -Wl,--as-needed)

Signed-off-by: Sam James <sam@gentoo.org>
@lucaderi lucaderi merged commit c2b7d77 into ntop:dev Jan 18, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jan 18, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@utoni
Copy link
Collaborator

utoni commented Mar 2, 2022

I would love to be able to build nDPI out-of-source which is, unfortunately, impossible at the moment.
One solution is to use git worktree but that is inconvenient.

I've tried to improve nDPI's build system (PR #1163), but those patches weren't merged.
So if you're keen on autoconf/automake, give it another try. ;)

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

Successfully merging this pull request may close these issues.

None yet

3 participants