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

Ensure -lm specified, and other tidying up of CFLAGS, CPPFLAGS, LDLIBS and LDFLAGS #1262

Merged
merged 6 commits into from
May 13, 2019

Conversation

pqarmitage
Copy link
Collaborator

No description provided.

configure was testing whether it was necessary to add the -lm option,
but for some reason gcc adds it itself if -Os is not specified, but
does not add it if -Os is specified. Consequently if configure was
run without -Os, and make was run with -Os the link failed.

The commit ensures that -lm is always used.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
… files

Make sure any settings in CFLAGS etc at the time configure is run are added
to the Makefiles, to ensure that the make is run in the same environement
that configure is run in.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Use the correct variable for the relevant option type, e.g. -llib
should be in LDLIBS, not LDFLAGS, and -Ddefn should be in CPPFLAGS
not CFLAGS.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
@pqarmitage pqarmitage merged commit 6860c2a into acassen:master May 13, 2019
vincentbernat added a commit to vincentbernat/keepalived that referenced this pull request Jun 6, 2020
First, this reverts changes made in acassen#416 (commit 328ec28). With
lldpd, I don't use `--netsnmp-agent-libs --external-libs` and I never
had an issue with Ubuntu 14.04. From my understanding, the code to fix
mangle `NETSNMP_LIBS` to fix issues with Fedora is then not needed
anymore because the issue appears only because of `--external-libs`,
so the code can be removed as well. This was added in acassen#858 (commit
057c279).

Then, this also reverts changes introduced in acassen#1262, notably commit
63fe1f4. Seperating CPPFLAGS from CFLAGS also reorder some flags,
making headers in `/usr/lib/*/perl/*/CORE` used before the ones in
`lib/`. This happens for `parser.h` and leads to this error when
NetSNMP is linked to libperl. This happens with out-of-tree builds
when `-I$(srcdir)/../include -I$(srcdir)/../../lib` is appended too
late.

```
In file included from ../../../keepalived/core/main.c:54:
/usr/lib/x86_64-linux-gnu/perl/5.30/CORE/parser.h:15:5: error: unknown type name ‘YYSTYPE’
   15 |     YYSTYPE val;    /* semantic value */
      |     ^~~~~~~
```
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

1 participant