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

Fix header ordering, switch to meson #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

no92
Copy link
Contributor

@no92 no92 commented Jun 16, 2024

No description provided.

@eworm-de
Copy link
Owner

Changing the order of header includes has some side effects, for example signals (SIGINT, SIGTERM) are ignored. Why is that?

no92 added 3 commits June 18, 2024 18:55
As stated in the man pages, `sigaction` should be preferred to `signal`.
The kernel headers are supposed to be included after net/if.h, as they
check whether net/if.h has been included before them, and if so, avoid
redefinitions. This also avoid the non-portable hack of
`#undef __USE_MISC`, which probably silently breaks glibc and leads to
namespace pollution.
This allows for correctly checking for program presence, configuration
and cross-compilation.
@no92
Copy link
Contributor Author

no92 commented Jun 18, 2024

The header ordering probably isn't to blame; switching to sigaction, as recommended by the man pages, solved the problem.

Rebased onto current master.

@eworm-de
Copy link
Owner

Cherry-pick the first two into main. Thanks a lot!

I will have to take a deeper look at the meson changes, not yet very familiar with it.

@eworm-de
Copy link
Owner

I will prepare similar changes for signal handling in other projects. Do you want to be named as co-author there?

@no92
Copy link
Contributor Author

no92 commented Jun 19, 2024

Do you want to be named as co-author there?

No need to if I didn't write it. Thank you for being so considerate though :^)

I will have to take a deeper look at the meson changes, not yet very familiar with it.

As a quick introduction, make sure meson is installed. cd into your source directory and decide where you want to place the build directory. For now, I'll assume it's named build and located in the source directory. Then, run:

meson setup --prefix /usr build

This will perform some setup, warn about missing programs/dependencies, etc. This is ~equivalent to a ./configure. Then, run the build with:

ninja -C build

This builds the program and places the artifacts in the build directory. To install, you can use:

ninja -C build install

This installs the files, and this can be modified with DESTDIR set.

Further than this basic example, meson allows for correct cross-compilation (if requested), subprojects, etc. As for the details of how the meson.build script works, the Reference is quite helpful.

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.

2 participants