Skip to content

Autotools: Fix SNMP checks #15263

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

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions ext/snmp/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,33 @@ if test "$PHP_SNMP" != "no"; then
[],
[$SNMP_SHARED_LIBADD])

dnl Check whether usmHMAC192SHA256AuthProtocol exists.
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [usmHMAC192SHA256AuthProtocol],
CFLAGS_SAVE=$CFLAGS
LIBS_SAVE=$LIBS
CFLAGS="$CFLAGS $SNMP_CFLAGS"
LIBS="$LIBS $SNMP_LIBS"

AC_CHECK_DECL([usmHMAC192SHA256AuthProtocol],
[AC_DEFINE([HAVE_SNMP_SHA256], [1],
[Define to 1 if SNMP library has the 'usmHMAC192SHA256AuthProtocol'
array.])],
[],
[$SNMP_SHARED_LIBADD])
[
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
])

dnl Check whether usmHMAC384SHA512AuthProtocol exists.
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [usmHMAC384SHA512AuthProtocol],
AC_CHECK_DECL([usmHMAC384SHA512AuthProtocol],
[AC_DEFINE([HAVE_SNMP_SHA512], [1],
[Define to 1 if SNMP library has the 'usmHMAC384SHA512AuthProtocol'
array.])],
[],
[$SNMP_SHARED_LIBADD])
[
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
])

CFLAGS=$CFLAGS_SAVE
LIBS=$LIBS_SAVE

PHP_NEW_EXTENSION([snmp], [snmp.c], [$ext_shared])
PHP_SUBST([SNMP_SHARED_LIBADD])
Expand Down
Loading