HI Steve,
Tried cross compiling the net-snmp distribution, i
am back with queries.
#!/bin/bash
export AR=armv4b-unknown-linux-ar
export
RANLIB=armv4b-unknown-linux-ranlib
export
CC=armv4b-unknown-linux-gcc
export CFLAGS='-Wall -Wno-trigraphs -Os -pipe
-fomit-frame-pointer -mbig-endian -fno-strict-aliasing -fno-common -fno-builtin
-march=armv4 -Dlinux'
export CPPFLAGS='-I
../tulsi/include/' < Toochain path >
#export
LD=arm-linux-ld
#export LDFLAGS='-EB'
./configure
--host=arm-linux
\
--target=arm-linux
\
--with-default-snmp-version="3"
\
--with-sys-contact="[EMAIL PROTECTED]"
\
--with-sys-location="Cape Town"
\
--with-logfile="/var/log/snmpd.log"
\
--with-persistent-directory="/var/net-snmp"
\
--disable-nls
\
--disable-syslog
\
--with-endianness=big
\
--disable-mib-loading
\
#--with-mib-modules="fourD mibII mibII/tcp mibII/udp mibII/tcpTable
mibII/udpTable
ucd-snmp/lmSensors"\
During configuration If the above line is included ,
it reports that the FourD.h and other fails are missing , So i commented it. It
successfully configured.
--with-openssl="/usr/local/arm-linux/ssl/"\
--without-opaque-special-types
\
--enable-mini-agent
\
--with-ldlags="-lsensors
-liw"\
--disable-shared
/bin/sh ../../libtool --mode=compile armv4b-unknown-linux-gcc -I../../include -I../.. -I./../.. -I./../../include -I ../tulsi/include/ -Wall -Wno-trigraphs -Os -pipe -fomit-frame-pointer -mbig-endian -fno-strict-aliasing -fno-common -fno-builtin -march=armv4 -Dlinux -Dlinux -c -o winstub.lo winstub.c
armv4b-unknown-linux-gcc -I../../include -I../.. -I./../.. -I./../../include -I ../tulsi/include/ -Wall -Wno-trigraphs -Os -pipe -fomit-frame-pointer -mbig-endian -fno-strict-aliasing -fno-common -fno-builtin -march=armv4 -Dlinux -Dlinux -c winstub.c -o winstub.o
echo timestamp > winstub.lo
/bin/sh ../../libtool --mode=link armv4b-unknown-linux-gcc -o snmpnetstat inet.lo inet6.lo if.lo main.lo route.lo winstub.lo ../../snmplib/libnetsnmp.la -lm
mkdir .libs
armv4b-unknown-linux-gcc -o snmpnetstat inet.o inet6.o if.o main.o route.o winstub.o ../../snmplib/.libs/libnetsnmp.a -lm
/usr/local/armbe/armv4b-unknown-linux/lib/libm.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [snmpnetstat] Error 1
make[2]: Leaving directory `/home/gopuk/cpci-910/sweng/linux/net-snmp/net-snmp-5.1.1/apps/snmpnetstat'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/gopuk/cpci-910/sweng/linux/net-snmp/net-snmp-5.1.1/apps'
make: *** [subdirs] Error 1
-----Original Message-----
From: Steve Comfort [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August
26, 2004 1:56 PM
To: Ramachandran, Sanjeev
Cc:
[EMAIL PROTECTED]
Subject: Re: How Cross Compile Net SNMP
Agent
Hi Sanjeev,
With much help from Dave Shield, I recently
completed a port of netSNMP
5.1.1 to an embedded ARM system (XScale). I have
attached a few files that
I used for configuration, etc.
cfg.sh is
just a simple script where I setup all my config options. It
should contain
paths to your toolchain, library paths, etc.
route_patch.h is a file that
I cobbled together to get around broken
dependencies with the toochain I was
using. You may or may not need it.
If you do, stick it in
agent/mibgroup/mibII. You'll need to edit
include/net-snmp/net-snmp-config.h.
Find the line "HAVE_NET_ROUTE_H" and
comment this out. Any files in mibII
that have this conditional define
should be edited to include route_patch.h
rather than route.h.
Also, if you're targetting a big-endian system, I
found that I needed to
edit libtool (in the root directory of net-snmp).
Somewhere around line
1045 of this automatically generated file, there will
be a line like :
compile_command = "$nonopt"
I modified this line
to be :
compile_command = "$nonopt -mbig-endian"
Robert Story was
rather alarmed by this previous change, but since it
worked for me, I never
bothered digging deeper for the true source of
the problem
:)
Ciao
Steve Comfort