FAQ:Compiling 01

From Net-SNMP Wiki
Jump to: navigation, search

How do I control the environment used to compile the software?

The basic mechanism for compiling the Net-SNMP project software is to run configure, followed by make (to compile it), make test (to check that it's working properly) and then make install (to install the files into the correct locations - which typically needs to be done as root.

The primary role of configure is to determines various aspects about the system that the software is being compiled on. However there are also a number of options to configure which can be used to control various aspects of the compilation environment.

The most common options are --with-mib-modules and --with-out-mib-modules which control the set of MIB module code files that are included within the agent binary. Adding or removing these modules will affect what MIB information the agent can return.
See the entry How do I add a MIB to the agent? for more details.


The configure script can also specify the compiler to use for compiling the source code (e.g. configure --with-cc=cc), the flags passed to this compiler (e.g. configure --with-cflags=-g), or to the linker (e.g. configure --with-ldflags=-Bstatic), and various other aspects of the build environment.
Run configure --help for a full list.

   FAQ:Compiling
   
  1. How do I control the environment used to compile the software?
  2. How do I control the environment used to compile the software under Windows?
  3. Why does the compilation complain about missing libraries?
  4. How can I reduce the memory footprint?
  5. How can I reduce the installation footprint or speed up compilation?
  6. How can I compile the project for use on an embedded system?
  7. How can I compile the project to use static linking?
  8. Why does 'make test' skip various tests?
  9. Why does 'make test' complain about a pid file?