[Bug 271214] net-mgmt/net-snmp: LDFLAGS/PKG_PREFIX bugs

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 02 May 2023 22:46:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271214

            Bug ID: 271214
           Summary: net-mgmt/net-snmp: LDFLAGS/PKG_PREFIX bugs
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: zi@FreeBSD.org
          Reporter: ngie@FreeBSD.org
             Flags: maintainer-feedback?(zi@FreeBSD.org)
          Assignee: zi@FreeBSD.org

As part of getting OpenSSL from ports and base to play well with one another, I
moved OpenSSL from ports to /usr/local/lib/openssl . This has exposed the fact
that LDFLAGS from USES+=ssl isn't honored/passed through to configure properly.

Moreover, the port uses PKG_PREFIX, a non-existent variable, instead of PREFIX
or LOCALBASE.

```
$ (cd ../freebsd-ports/net-mgmt/net-snmp; make -VPKG_PREFIX)

$
```

The patch below addresses both of those issues:
```
diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile
index 0af9bccd05ee..e2e91ff73eac 100644
--- a/net-mgmt/net-snmp/Makefile
+++ b/net-mgmt/net-snmp/Makefile
@@ -50,7 +50,7 @@ CPE_PRODUCT=  net-snmp
 USE_PERL5=     build run
 USE_CSTD=      c99

-CFLAGS+=       -I${LOCALBASE}/include -I${PKG_PREFIX}/include
+CFLAGS+=       -I${LOCALBASE}/include -I${PREFIX}/include
 LDFLAGS+=      -L${LOCALBASE}/lib
 CONFIGURE_ENV+=        PERLPROG="${PERL}" PSPROG="${PS_CMD}" SED="${SED}"
 CONFIGURE_ARGS+=--enable-shared --enable-internal-md5 \
@@ -60,7 +60,7 @@ CONFIGURE_ARGS+=--enable-shared --enable-internal-md5 \
                --with-logfile="${NET_SNMP_LOGFILE}" \
                --with-persistent-directory="${NET_SNMP_PERSISTENTDIR}" \
                --with-gnu-ld --without-libwrap \
-               --with-ldflags="-lm -lkvm -ldevstat -L${PKG_PREFIX}/lib
-L${LOCALBASE}/lib ${LCRYPTO}"
+               --with-ldflags="-lm -lkvm -ldevstat -L${PREFIX}/lib ${LDFLAGS}"
 SUB_FILES=     pkg-message

 .if !defined(WITHOUT_SSP)
```

-- 
You are receiving this mail because:
You are the assignee for the bug.