Hi There
I am trying to cross compile the net-snmp agent (snmpd) for an ARM platform (my STB). I can successful compile the "--mini-agent" version, which isn't very useful (only knows about itself, not the system it runs on). I am a bit along the way (I guess), but I am stumbling over this error to do with libpcre, perhaps somebody can help me out. Here is what I do:
I am using the toolchain "arm-linux-gnueabihf" (I am not even sure, this is the right terminology).
I am downloading net-snmp and running configure like so:
./configure \
--host=arm-linux-gnueabihf \
--target=arm-linux-gnueabihf \
--build=i686 \
--disable-manuals \
--disable-ipv6 \
--with-cc=arm-linux-gnueabihf-gcc \
--with-ar=arm-linux-gnueabihf-ar \
--without-rpm \
--disable-applications \
--disable-embedded-perl \
--disable-deprecated \
--disable-shared \
--enable-static LDFLAGS="-L/home/crayfish/openvuplus_3.0/build/vusolo4k/tmp/sysroots/vusolo4k/usr/lib/libpcre" \
--with-sysroot=/home/crayfish/openvuplus_3.0/build/vusolo4k/tmp/sysroots/vusolo4k/
/home/crayfish/openvuplus_3.0 is where the source code from the STB sits, and there is also the libpcre:
file /home/crayfish/openvuplus_3.0/build/vusolo4k/tmp/sysroots/vusolo4k/usr/lib/libpcre.so.1.2.4
/home/crayfish/openvuplus_3.0/build/vusolo4k/tmp/sysroots/vusolo4k/usr/lib/libpcre.so.1.2.4: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=335b7191beb073ea9f6567442c6269855f4053bc, not stripped
Now, most of this is guess work or trial and error by me, but the configure script runs fine (as far as I can see), but it throws me this error at make:
libtool: link: arm-linux-gnueabihf-gcc -fno-strict-aliasing -g -O2 -Ulinux -Dlinux=linux -Wall -Wstrict-prototypes -Wwrite-strings -Wcast-qual -o snmpd snmpd.o -L/home/crayfish/openvuplus_3.0/build/vusolo4k/tmp/sysroots/vusolo4k/usr/lib/libpcre ./.libs/libnetsnmpagent.a ./.libs/libnetsnmpmibs.a /home/crayfish/code/agent/.libs/libnetsnmpagent.a /home/crayfish/code/snmplib/.libs/libnetsnmp.a -ldl ../snmplib/.libs/libnetsnmp.a -lm
./.libs/libnetsnmpmibs.a(proc.o): In function `proc_parse_config':
/home/crayfish/code/agent/mibgroup/ucd-snmp/proc.c:232: undefined reference to `pcre_compile'
./.libs/libnetsnmpmibs.a(swrun.o): In function `swrun_count_processes_by_regex':
/home/crayfish/code/agent/mibgroup/host/data_access/swrun.c:134: undefined reference to `pcre_exec'
collect2: error: ld returned 1 exit status
make[1]: *** [snmpd] Fehler 1
make[1]: Verzeichnis »/home/crayfish/code/agent« wird verlassen
make: *** [subdirs] Fehler 1
As you might be able to see, I am trying to let the system know, where the libpcre sits, but - for the life of me - I cannot figure out what syntax to use.
So, any and every help would be highly appreciated!!!
Thomas