[oe] [meta-networking][PATCH 1/1] net-snmp: Fix host contamination

Ovidiu Panait ovidiu.panait at windriver.com
Fri Jun 15 08:22:26 UTC 2018


If "/usr/local/ssl/include" directory exists on the host machine, net-snmp will
also search the host openssl headers:

build/net-snmp/temp$ grep -i "/usr/local/ssl/include" log.do_compile
x86_64-wrs-linux-libtool: compile: x86_64-wrs-linux-gcc ... -I/usr/local/ssl/include

Fix this by selecting the proper sysroot headers using
--with-openssl=${STAGING_EXECPREFIXDIR}

Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
---
 meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
index 5c827bb86..6f6f19ac9 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
@@ -66,7 +66,8 @@ EXTRA_OECONF = "--enable-shared \
                 --with-install-prefix=${D} \
                 --with-persistent-directory=${localstatedir}/lib/net-snmp \
                 ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
-"
+                --with-openssl=${STAGING_EXECPREFIXDIR} \
+                "
 
 # net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp
 EXTRA_OECONF += "--with-mib-modules=smux"
@@ -121,8 +122,10 @@ do_install_append() {
     install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
     install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
     sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=. at g" \
+           -e "s@${STAGING_DIR_TARGET}@@g" \
         -i ${D}${bindir}/net-snmp-create-v3-user
     sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=. at g" \
+           -e "s@${STAGING_DIR_TARGET}@@g" \
            -e "s@\([^ ]*-fdebug-prefix-map=[^ ]*\)\1*@@g" \
            -e "s@\([^ ]*--sysroot=[^ ]*\)\1*@@g" \
            -e "s@\([^ ]*--with-libtool-sysroot=[^ ]*\)\1*@@g" \
-- 
2.17.1




More information about the Openembedded-devel mailing list