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

Autotools: Add pkg-config support for NET-SNMP library #15261

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

petk
Copy link
Member

@petk petk commented Aug 6, 2024

This is alternative and a BC compatible implementation to GH-15002 (NET-SNMP pkg-config support).

NET-SNMP has pkg-config support since 5.8.1

This optionally finds the NET-SNMP library using pkg-config or falls back to find library on the system with net-snmp-config. The configure option argument (--with-snmp=DIR) works like before (path to the net-snmp-config).

When explicitly using the DIR argument, the pkg-config check is silently skipped.

When not using DIR argument, the SNMP_CFLAGS and SNMP_LIBS can be also used to find the NET-SNMP library:

./configure --with-snmp \
    SNMP_CFLAGS=-I/path/to/net-snmp/include \
    SNMP_LIBS="-L/path/to/net-snmp -lnetsnmp"

NET-SNMP has pkg-config support since 5.8.1

This optionally finds the NET-SNMP library using pkg-config or falls
back to find library on the system with net-snmp-config. The configure
option argument (--with-snmp=DIR) works like before (path to the
net-snmp-config).

When explicitly using the DIR argument, the pkg-config check is silently
skipped.

When not using DIR argument, the SNMP_CFLAGS and SNMP_LIBS can be also
used to find the NET-SNMP library:

    ./configure --with-snmp \
        SNMP_CFLAGS=-I/path/to/net-snmp/include \
        SNMP_LIBS="-L/path/to/net-snmp -lnetsnmp"

Co-authored-by: Calvin Buckley <calvin@cmpct.info>
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSTM

@petk
Copy link
Member Author

petk commented Aug 8, 2024

Merging this soon then. cc @NattyNarwhal

Copy link
Member

@NattyNarwhal NattyNarwhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and easier to merge than my PR. Could look into doing the ifdef cleanup I tried earlier.

@petk petk merged commit 3a30c29 into php:master Aug 9, 2024
10 of 11 checks passed
@petk petk deleted the patch-snmp-pkgconf branch August 9, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants