]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: crop excessive net-snmp library list
authorDavid Lamparter <equinox@diac24.net>
Sat, 27 Oct 2018 17:06:22 +0000 (19:06 +0200)
committerDavid Lamparter <equinox@diac24.net>
Sun, 28 Oct 2018 15:05:00 +0000 (16:05 +0100)
This fixes the longstanding GPL vs. OpenSSL licensing issue in our SNMP
code (and cuts down on its other dependencies a wee bit.)

In a way, net-snmp is really buggy here in what it says that we should
link against, but I don't know their application scenarios well enough
to say it should be changed at their end.

Signed-off-by: David Lamparter <equinox@diac24.net>
configure.ac

index 5ebe188c19b94c458ca3673b6345322061374018..706b954d6f0ad141965e57c8cbc6f3f521af4372 100755 (executable)
@@ -1535,6 +1535,11 @@ if test "${enable_snmp}" != "" -a "${enable_snmp}" != "no"; then
    fi
    SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
    SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
+   # net-snmp lists all of its own dependencies.  we absolutely do not want that
+   # among other things we avoid a GPL vs. OpenSSL license conflict here
+   for removelib in crypto ssl sensors pci wrap; do
+     SNMP_LIBS="`echo $SNMP_LIBS | sed -e 's/\(^\|\s\)-l'$removelib'\b/ /g' -e 's/\(^\|\s\)\([^\s]*\/\)\?lib'$removelib'\.[^\s]\+\b/ /g'`"
+   done
    AC_MSG_CHECKING([whether we can link to Net-SNMP])
    AC_LINK_IFELSE_FLAGS([$SNMP_CFLAGS], [$SNMP_LIBS], [AC_LANG_PROGRAM([
 int main(void);