|
Hi I 'm going to cross-compile net-snmp-5.3.2 on fedora11
Below is my .sh file
==================================================================================================
./configure --host=i386-linux --build=ppc-linux --target=ppc-linux --prefix=/usr --exec-prefix=/usr --enable-shared --disable-debugging --enable-mini-agent --with-mibs="IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:NEXCOMM-FAN-MIB:NEXCOMM-LOG-MIB:NEXCOMM-SMI" --with-mib-modules="agentx ucd-snmp/dlmod nexlib/snmp_fan nexlib/snmp_log" --with-enterprise-notification-oid=.1.3.6.1.4.1.5927.99.12.1 --sysconfdir=/etc --localstatedir=/var --enable-internal-md5 --enable-snmpv1 --enable-snmpv2c --disable-embedded-perl --with-cc=ppc_82xx-gcc --with-linkcc=ppc_82xx-gcc --with-ar=ppc_82xx-ar --with-endianness=big --with-install-prefix=/home/psyche/sychoi/install --without-rpm | tee snmp.config.log
make | tee snmp.config.log
perl -pi -e "s|^prefix=/usr|prefix=/home/psyche/sychoi/install/usr|" net-snmp-config
perl -pi -e "s|^exec_prefix=/usr|exec_prefix=/home/psyche/sychoi/install/usr|" net-snmp-config
make install | tee snmp.intall.log
================================================================================================ as you see,
I add mib source file name as snmp_fan.c and snmp_log.c in "--with-mib-modules"
================================================================================================ --with-mib-modules ="nexlib/snmp_fan nexlib/snmp_log" =================================================================================================
But I should add LIB PATH and CFLAGS PATH into configure option to compile snmp_fan.c and snmp_log.c
LIBS PATH is " /home/psyche/sychoi/lib/libnexcmd/libnexcmd.a" HEADER FILE PAH is "/home/psyche/sychoi/include" and "/home/psyche/sychoi/include/libnexcmd
I make a "Makefile" to make agentx This include snmp_fan.c and snmp_log.c
In agentx Makefile, I use LIBS and CFLAGS to add my library and header files
LIBS=/home/psyche/sychoi/lib/libnexcmd/libnexcmd.a -lpthread CFLAGS= -I. I /home/psyche/sychoi/incude/libnexcmd -I /home/psyche/sychoi/include
This is my agentx Makefile ================================================================================================
PROJDIR = /home/psyche/sychoi INSTDIR = $(PROJDIR)/rootfs/usr/sbin SNMPINC = /home/psyche/sychoi/install/usr CC=ppc_82xx-gcc STRIP=ppc_82xx-strip
OBJS += agentx.o OBJS += snmp_fan.o OBJS += snmp_log.o #OBJS += exam.o
TARGETS = agentx
LIBS=$(PROJDIR)/lib/libnexcmd/libnexcmd.a -lpthread
CFLAGS = -I. -I$(PROJDIR)/include/libnexcmd -I$(PROJDIR)/include CFLAGS+= -O2 -Dlinux -I. -I$(SNMPINC)/include BUILDLIBS = -L$(SNMPINC)/lib -lnetsnmp -lcrypto -lm BUILDAGENTLIBS = -L$(SNMPINC)/lib -lnetsnmpmibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp -ldl -lcrypto -lm
# shared library flags (assumes gcc) DLFLAGS=-fPIC -shared -lpthread
all: $(TARGETS)
agentx: $(OBJS) $(CC) -o agentx $(OBJS) $(LIBS) $(BUILDLIBS) $(BUILDAGENTLIBS) # $(CC) -o agentx $(OBJS) $(BUILDLIBS) $(BUILDAGENTLIBS) $(STRIP) agentx
install: cp -a agentx $(INSTDIR)
clean: rm -f $(OBJS) $(TARGETS)
=================================================================================================
This is first time to cross-compile net-snmp with my personal library
So I need many helpful advice ....
I wish all of you have a good day...
Thank you... :)
|
|
|
|
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
