Hi jin,

I have attached my Makefile as a reference for you to get your cross-compile working. I haven't needed to modify my config.in file from the default that comes with buildroot, which is available here:

http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/package/netsnmp/Config.in?rev=9617&view=markup

Hope this helps.

Regards,
Kelby Rogers



jin zhou wrote:
Dear kelby,
  Thank you for your tips.It seems to be a simple way to add user-applications to uclinux by buildroot.I've visted the site.But it seems the key of buildroot is also the commands in the makefile.Could you send me your config.in and makefile of adding net-snmp for a reference.Thank you very much~!
 
Best regards,
 
jin zhou

Mp3疯狂搜-新歌热歌高速下


This email, including any attachments, is only for the intended addressee. It is subject to copyright, confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission.

#############################################################
#
# netsnmp
#
#############################################################

ZCAT=zcat
BR2_SOURCEFORGE_MIRROR:=easynews

NETSNMP_URL:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
NETSNMP_DIR:=$(BUILD_DIR)/net-snmp-5.4
NETSNMP_SOURCE:=net-snmp-5.4.tar.gz

$(DL_DIR)/$(NETSNMP_SOURCE):
        $(WGET) -P $(DL_DIR) $(NETSNMP_URL)/$(NETSNMP_SOURCE)

$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE) 
$(DL_DIR)/$(NETSNMP_PATCH1)
        $(ZCAT) $(DL_DIR)/$(NETSNMP_SOURCE) | tar -C $(BUILD_DIR) 
$(TAR_OPTIONS) -x
        cat $(SOURCE_DIR)/netsnmp_fork.patch | patch -p1 -d $(NETSNMP_DIR)
        find $(NETSNMP_DIR) -name "*.c"|xargs grep -l gettimeofday|sudo xargs 
sed -i s/gettimeofday/gettimesince0/
        touch $(NETSNMP_DIR)/.unpacked

# We set CAN_USE_SYSCTL to no and use /proc since the
# sysctl code in this thing is apparently intended for
# freebsd or some such thing...
$(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
        (cd $(NETSNMP_DIR); autoconf; \
                ac_cv_CAN_USE_SYSCTL=no \
                PATH=$(TARGET_PATH) \
                ./configure \
                --with-cc=$(TARGET_CROSS)gcc \
                --with-ar=$(TARGET_CROSS)ar \
                --target=$(GNU_TARGET_NAME) \
                --host=$(GNU_TARGET_NAME) \
                --build=$(GNU_HOST_NAME) \
                --with-endianness=big \
                --with-persistent-directory=/var/lib/snmp \
                --enable-ucd-snmp-compatibility \
                --enable-shared \
                --disable-static \
                --without-rpm \
                --without-efence \
                --without-rsaref \
                --with-defaults \
                --without-kmem-usage \
                --sysconfdir=/etc \
                --with-default-snmp-version=2 \
                --disable-privacy \
                --enable-internal-md5 \
                --disable-manuals \
                --disable-scripts \
                --disable-mibs \
                --without-dmalloc \
                --without-openssl \
                --disable-applications \
                --with-logfile=none \
                --without-rpm \
                --with-sys-contact="Unknown Contact" \
                --with-sys-location="Unknown Location" \
                --without-perl-modules \
                --disable-embedded-perl \
                --disable-debugging \
                --without-keymem-usage \
                --enable-mini-agent \
                --disable-mib-loading \
                --with-mib-modules="agentx notification mibII" \
                --with-out-mib-modues="snmpv3mibs agent_mibs" \
                --with-logfile="/tmp/snmpd.log" \
        );
        touch $(NETSNMP_DIR)/.configured

$(NETSNMP_DIR)/agent/snmpd: $(NETSNMP_DIR)/.configured
        $(MAKE) -C $(NETSNMP_DIR)

$(TARGET_DIR)/usr/sbin/snmpd: $(NETSNMP_DIR)/agent/snmpd
        #$(MAKE) DESTDIR=$(TARGET_DIR) -C $(NETSNMP_DIR) install
        $(MAKE) PREFIX=$(TARGET_DIR)/usr \
            prefix=$(TARGET_DIR)/usr \
            exec_prefix=$(TARGET_DIR)/usr \
            persistentdir=$(TARGET_DIR)/var/lib/snmp \
            infodir=$(TARGET_DIR)/usr/info \
            mandir=$(TARGET_DIR)/usr/man \
            includedir=$(STAGING_DIR)/include/net-snmp \
            ucdincludedir=$(STAGING_DIR)/include/ucd-snmp \
            -C $(NETSNMP_DIR) install;
        rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
                $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
        # Copy the .conf files.
        mkdir -p $(TARGET_DIR)/etc/snmp
        cp $(SOURCE_DIR)/snmpd.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
        -mv $(TARGET_DIR)/usr/share/snmp/mib2c*.conf $(TARGET_DIR)/etc/snmp
        # Remove the unsupported snmpcheck program
        -rm $(TARGET_DIR)/usr/bin/snmpcheck
        # Install the "broken" headers
        cp $(NETSNMP_DIR)/agent/mibgroup/struct.h 
$(STAGING_DIR)/include/net-snmp/agent
        cp $(NETSNMP_DIR)/agent/mibgroup/util_funcs.h 
$(STAGING_DIR)/include/net-snmp
        cp $(NETSNMP_DIR)/agent/mibgroup/mibincl.h 
$(STAGING_DIR)/include/net-snmp/library
        cp $(NETSNMP_DIR)/agent/mibgroup/header_complex.h 
$(STAGING_DIR)/include/net-snmp/agent
        # create an agentx directory for the master - subagent socket
        mkdir -p $(TARGET_DIR)/var/agentx
        # Strip the binaries
        -$(STRIP) $(TARGET_DIR)/usr/lib/libnetsnmp*so.*
        -$(STRIP) $(TARGET_DIR)/usr/lib/libsnmp*so.*
        -$(STRIP) $(TARGET_DIR)/usr/sbin/snmpd

netsnmp: $(TARGET_DIR)/usr/sbin/snmpd

netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
        cp -a $(STAGING_DIR)/include/net-snmp $(TARGET_DIR)/usr/include/net-snmp
        cp -a $(STAGING_DIR)/include/ucd-snmp $(TARGET_DIR)/usr/include/net-snmp

netsnmp-source: $(DL_DIR)/$(NETSNMP_SOURCE)

netsnmp-clean: 
        $(MAKE) -C $(NETSNMP_DIR) clean

netsnmp-dirclean: 
        rm -rf $(NETSNMP_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y)
TARGETS+=netsnmp
endif

=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to