mohandev2 / openhpi_old

Other
0 stars 0 forks source link

problems with snmp when trying to cross compile #1112

Closed mohandev2 closed 6 years ago

mohandev2 commented 18 years ago

When trying to build openhpi 2.4.0 in a cross development environment (building on a Redhat Linux machine for a MontaVista target board), the snmp components don't appear to have any mechanism of specifying the target systems net-snmp and rpm directories for include paths and/or libraries. Instead, the build machines local directories are added to the Makefile. -I/usr/include/rpm -I/usr/include/net-snmp This causes the compiler to error out.

In an attempt to work around this, I tried to disable the snmp directories by adding the following to the configure options; however, this doesn't force the snmp directory to be skipped for the build. --enable-snmp_bc=no --enable-snmp_client=no

Seems like if we don't need snmp, then that directory shouldn't be built.

Here are the compiler errors that are seen.

/opt/mvista_x86/cge4.0_LATEST/montavista/cge/devkit/x86/pentium4/bin/pentium4-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../utils -I../utils -pthread -I/opt/mvista_x86/cge4.0_LATEST/montavista/cge/devkit/x86/pentium4/target/usr/include/glib-2.0 -I/opt/mvista_x86/cge4.0_LATEST/montavista/cge/devkit/x86/pentium4/target/usr/lib/glib-2.0/include -ftest-coverage -fprofile-arcs -DDBG_MSGS -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-format-y2k -Wcast-qual -Wcast-align -Wno-strict-aliasing -Werror -D_GNU_SOURCE -D_REENTRANT -fexceptions -I/usr/include/rpm -DINET6 -g -pipe -march=i386 -mcpu=i686 -Dlinux -I/usr/include/rpm -I. -I/usr/include/net-snmp -pthread -I/opt/mvista_x86/cge4.0_LATEST/montavista/cge/devkit/x86/pentium4/target/usr/include/glib-2.0 -I/opt/mvista_x86/cge4.0_LATEST/montavista/cge/devkit/x86/pentium4/target/usr/lib/glib-2.0/include -ftest-coverage -fprofile-arcs -DDBG_MSGS -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-format-y2k -Wcast-qual -Wcast-align -Wno-strict-aliasing -Werror -D_GNU_SOURCE -D_REENTRANT -fexceptions -MT snmp_utils.lo -MD -MP -MF .deps/snmp_utils.Tpo -c snmp_utils.c -fPIC -DPIC -o .libs/snmp_utils.o `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. cc1: include location "/usr/include/rpm" is unsafe for cross-compilation cc1: include location "/usr/include/net-snmp" is unsafe for cross-compilation make[2]: *** [snmp_utils.lo] Error 1 make[2]: Leaving directory `/home/rjrees/openhpi/openhpi-2.4.0/snmp' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/rjrees/openhpi/openhpi-2.4.0' make: *** [all] Error 2

Reported by: rjrees

Original Ticket: "openhpi/bugs/1112":https://sourceforge.net/p/openhpi/bugs/1112

mohandev2 commented 18 years ago

Original comment by: renierm

mohandev2 commented 18 years ago

Logged In: YES user_id=660960

I've fixed this in cvs head. The snmp directory should not get built unless snmp_bc and/or snmp_client plugins are built, too. Let me know if it works out for you ok.

Original comment by: renierm

mohandev2 commented 18 years ago

Original comment by: renierm