How to compile Net-SNMP Libraries for Linux PPC Arch

Introduction

This article describes how to build Net-SNMP Libraries for Linux PPC architecture. Although this article is specific to ppc architecture, but the steps can be used for any architecture.

Obtaining the Net- SNMP Libraries

The Net-Snmp files that this article is based on are listed below and were obtained from the Net-Snmp’s sourceforge website, http://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.3/
FileDescription
net-snmp-5.7.3.tar.gzFor Linux Build

Build Steps

The Following steps were followed to build libraries for Linux PPC environment
  1. Set the environment for the ppc build .
  2. Download net-snmp open source tar file from, http://net-snmp.sourceforge.net/.
  3. Copy the source code net-snmp-5.7.3.tar.gz to your server
  4. Then Untar: tar xvfz net-snmp-5.7.3.tar.gz
  5. cd  net-snmp-5.7.3
  6. Edit the configure script:-
    In the "configure" script in the Net-SNMP root directory find the line
    test –n "$host_alias" && ac_tool_prefix=$host_alias-
    And change to
    test –n "$host_alias" && ac_tool_prefix=ppc_82xx
  7. Run configure with the following options                                                                       configure --host=ppc-hardhat-linux --target=ppc-motorola-linux --build=i686-pc-linux --with-cc=ppc_82xx-gcc --with-ar=ppc_82xx-ar --with-endianness=big --with-cflags="-s -O2 -Dlinux" --with-openssl --without-perl-modules --disable-embedded-perl --disable-perl-cc-checks --prefix=/usr --disable-debugging --disable-manuals
    *note here the version of OpenSSL use in the version which is installed on your server
  8. Just press enter when asked for or whatever you requireDefault version of SNMP to use (3):
    System Contact Information (@@no.where):
    System Location (Unknown):
    Location to write logfile (/var/log/snmpd.log):
    Location to write persistent information (/var/net-snmp):This will set all the defaults options.
  9. Just type make in the net-snmp.5.7.3 directory to build Net-SNMP tools and libraries
  10.   The following files are created which will needs to be copied to your server :-                        • net-snmp-5.7.3/snmplib/.libs - libnetsnmp.so.30.0.3 (copy to /lib on your server)
     • net-snmp-5.7.3/agent/.libs - libnetsnmpagent.so.30.0.3 (copy to /lib on your server)
     • net-snmp-5.7.3/agent/.libs - libnetsnmpmibs.so.30.0.3 (copy to /lib on your server)
     • net-snmp-5.7.3/agent/.libs/ -snmpd (copy to /usr/sbin on your server)
  11. The above files can be stripped using the following command
    ppc_82xx-strip --remove-section=.note --remove-section=.comment filename
  12. Run the Net-SNMP daemon as /usr/sbin/snmpd -f. That's it!! 

Comments

Post a Comment

Popular Posts