Difference between revisions of "FAQ:Compiling 01"

From Net-SNMP Wiki
Jump to: navigation, search
 
(Move FAQ text to a template page)
Line 1: Line 1:
 
= How do I compile with 'cc' instead of 'gcc'? =  
 
= How do I compile with 'cc' instead of 'gcc'? =  
  
Run <CODE>configure</CODE> with <CODE>--with-cc=cc</CODE>
+
{{FAQ:Compiling_01}}
 
+
Note that if you've already run <CODE>configure</CODE> once, it will probably have
+
detected the presence of <CODE>'gcc'</CODE>, cached this information, and may still
+
try to use this anyway.  In which case, simply remove the <CODE>'config.cache'</CODE>
+
file before re-running <CODE>configure</CODE>.
+
  
 
     [[FAQ:Compiling]]
 
     [[FAQ:Compiling]]
 
     {{FAQ:Compiling}}
 
     {{FAQ:Compiling}}

Revision as of 14:35, 29 December 2006

How do I compile with 'cc' instead of 'gcc'?

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?