Difference between revisions of "Configuration Options"

From reSIProcate
Jump to navigation Jump to search
(add epoll option)
Line 1: Line 1:
Because the resiprocate project does not use GNU autotools, it has its own configuration system that can be used to select various options within the project, as well as what parts of the project are built. By default, if you just type 'make', the configuration script is invoked by the makesystem, and some (mostly) sane defaults are chosen for you.
+
 
 +
== Autotools / UNIX build configuration (reSIProcate >= 1.8) ==
 +
 
 +
Here is a quick summary of how to do some things that were configurable with the legacy build system:
 +
 
 +
=== Library locations ===
 +
 
 +
If you have libraries in non-standard locations (e.g. /opt/something/lib instead of /usr/lib) then please add those locations to LDFLAGS when running configure.
 +
 
 +
This may be needed for any of the non-system libraries if you compile them yourself, e.g. libdb, radiusclient-ng, mysqlclient, openssl, boost, sipX, curl, popt or c-ares.
 +
 
 +
E.g.
 +
 
 +
{{{
 +
./configure \
 +
    LDFLAGS="-L/opt/csw/lib -L/opt/csw/bdb48/lib -DTHREAD=MULTI -mt -dalign -V -v"
 +
}}}
 +
 
 +
=== Header locations ===
 +
 
 +
If you have headers (e.g. db_cxx.h) in non-standard locations (e.g/ /opt/something/include instead of /usr/include) then please add those locations to CPPFLAGS when running configure
 +
 
 +
This may be needed for any of the non-system libraries if you compile them yourself, e.g. libdb, radiusclient-ng, mysqlclient, openssl, boost, sipX, curl, popt or c-ares.
 +
 
 +
E.g.
 +
 
 +
{{{
 +
./configure \
 +
    CPPFLAGS="-I/opt/csw/include -I/opt/csw/bdb48/include -mt -V -v"
 +
}}}
 +
 
 +
=== Using non-default compiler and tools or cross-compiling ===
 +
 
 +
If you want to use a compiler or cross-compiler other than the default compiler that autotools finds on your system, you can use the configure variables CC, CXX, LD, etc
 +
 
 +
Here is an example for using SunStudio on Solaris:
 +
 
 +
{{{
 +
./configure \
 +
    CC=/opt/studio/sunstudio12.1/bin/cc \
 +
    CXX=/opt/studio/sunstudio12.1/bin/CC
 +
}}}
 +
 
 +
==== Using distcc, ccache and other compiler wrappers ====
 +
 
 +
Setting CC and CXX also lets you invoke tools like distcc and ccache to speed up the compile
 +
 
 +
Just distcc:
 +
 
 +
{{{
 +
export DISTCC_POTENTIAL_HOSTS="localhost host2 host3"
 +
./configure \
 +
    CC=distcc
 +
pump make -j8
 +
}}}
 +
 
 +
Just using ccache:
 +
 
 +
{{{
 +
./configure \
 +
    CC=ccache
 +
make
 +
}}}
 +
 
 +
Using distcc and ccache together:
 +
 
 +
{{{
 +
export DISTCC_POTENTIAL_HOSTS="localhost host2 host3"
 +
./configure \
 +
    CC=ccache
 +
CCACHE_PREFIX=distcc pump make -j8
 +
}}}
 +
 
 +
=== Compile profiles (small builds, debug builds, optimised, etc) ===
 +
 
 +
The legacy configure offered some compiler profiles with common defaults.
 +
 
 +
Here are some examples of how to achieve similar behavior with autotools:
 +
 
 +
==== Debug vs non-debug builds ====
 +
 
 +
To turn off assert() processing in a production build, just add -DNDEBUG to CPPFLAGS, e.g.
 +
 
 +
./configure CPPFLAGS="-DNDEBUG"
 +
 
 +
=== Using Google malloc ===
 +
 
 +
Just add tcmalloc to LDFLAGS
 +
 
 +
{{{
 +
./configure LDFLAGS="-ltcmalloc"
 +
}}}
 +
 
 +
=== Using Google performance profiling libs ===
 +
 
 +
{{{
 +
./configure LDFLAGS="-lprofiler"
 +
}}}
 +
 
 +
== Legacy UNIX build configuration (reSIProcate <= 1.7) ==
 +
 
 +
The legacy build system uses a custom configuration script that can be used to select various options within the project, as well as what parts of the project are built. By default, if you just type 'make', the configuration script is invoked by the makesystem, and some (mostly) sane defaults are chosen for you.
  
 
However, if you want to take advantage of the advanced, new, and/or experimental features available within resiprocate, you really want to take advantage of the configuration system. Currently, you have three options:
 
However, if you want to take advantage of the advanced, new, and/or experimental features available within resiprocate, you really want to take advantage of the configuration system. Currently, you have three options:

Revision as of 13:55, 23 January 2013

Autotools / UNIX build configuration (reSIProcate >= 1.8)

Here is a quick summary of how to do some things that were configurable with the legacy build system:

Library locations

If you have libraries in non-standard locations (e.g. /opt/something/lib instead of /usr/lib) then please add those locations to LDFLAGS when running configure.

This may be needed for any of the non-system libraries if you compile them yourself, e.g. libdb, radiusclient-ng, mysqlclient, openssl, boost, sipX, curl, popt or c-ares.

E.g.

{{{ ./configure \

    LDFLAGS="-L/opt/csw/lib -L/opt/csw/bdb48/lib -DTHREAD=MULTI -mt -dalign -V -v"

}}}

Header locations

If you have headers (e.g. db_cxx.h) in non-standard locations (e.g/ /opt/something/include instead of /usr/include) then please add those locations to CPPFLAGS when running configure

This may be needed for any of the non-system libraries if you compile them yourself, e.g. libdb, radiusclient-ng, mysqlclient, openssl, boost, sipX, curl, popt or c-ares.

E.g.

{{{ ./configure \

    CPPFLAGS="-I/opt/csw/include -I/opt/csw/bdb48/include -mt -V -v"

}}}

Using non-default compiler and tools or cross-compiling

If you want to use a compiler or cross-compiler other than the default compiler that autotools finds on your system, you can use the configure variables CC, CXX, LD, etc

Here is an example for using SunStudio on Solaris:

{{{ ./configure \

    CC=/opt/studio/sunstudio12.1/bin/cc \
    CXX=/opt/studio/sunstudio12.1/bin/CC

}}}

Using distcc, ccache and other compiler wrappers

Setting CC and CXX also lets you invoke tools like distcc and ccache to speed up the compile

Just distcc:

{{{ export DISTCC_POTENTIAL_HOSTS="localhost host2 host3" ./configure \

   CC=distcc

pump make -j8 }}}

Just using ccache:

{{{ ./configure \

   CC=ccache

make }}}

Using distcc and ccache together:

{{{ export DISTCC_POTENTIAL_HOSTS="localhost host2 host3" ./configure \

   CC=ccache

CCACHE_PREFIX=distcc pump make -j8 }}}

Compile profiles (small builds, debug builds, optimised, etc)

The legacy configure offered some compiler profiles with common defaults.

Here are some examples of how to achieve similar behavior with autotools:

Debug vs non-debug builds

To turn off assert() processing in a production build, just add -DNDEBUG to CPPFLAGS, e.g.

./configure CPPFLAGS="-DNDEBUG"

Using Google malloc

Just add tcmalloc to LDFLAGS

{{{ ./configure LDFLAGS="-ltcmalloc" }}}

Using Google performance profiling libs

{{{ ./configure LDFLAGS="-lprofiler" }}}

Legacy UNIX build configuration (reSIProcate <= 1.7)

The legacy build system uses a custom configuration script that can be used to select various options within the project, as well as what parts of the project are built. By default, if you just type 'make', the configuration script is invoked by the makesystem, and some (mostly) sane defaults are chosen for you.

However, if you want to take advantage of the advanced, new, and/or experimental features available within resiprocate, you really want to take advantage of the configuration system. Currently, you have three options:

  • ./configure - Invoke the configuration system in a text questionnaire mode. This can be tedious, but should work under all terminal environments.
  • ./configure -m - Invoke the configuration system in a (somewhat experimental) text-based menu mode. This is much easier to use, but requires a vt100-compatible that is tall enough to accommodate all the configuration options.
  • ./configure -y - Invoke the configuration system in a non-interactive mode. Configuration options will be set to defaults if they don't yet exist, and then any configuration-changing commandline switches will be applied. If the system is already configured, no options will be changed except as specified by commandline switches.

Note that the defaults chosen for some options vary from platform to platform, and even according to what is installed on the system when configuration is invoked.

The various options currently available in the configuration system are:

     --with-toolchain="..."
       Which toolchain do you want to use?
       Valid values are: [gnu, intel, sunpro, msgnu, gnu-cross]
     --with-cross-platform="..."
       What is the name your toolchain uses for the cross platform?
     --with-cross-tool-prefix="..."
       What is the prefix for the cross-compiler binaries?
     --with-cross-compiler-dir="..."
       Where is your cross compiler installed?
     --with-compile-type="..."
       What compile profile will you use?
       Valid values are: [debug, nodebug, opt, gopt, prof, small]
     --enable-shared-libs
     --disable-shared-libs
       Should the resip libraries be built shared?
     --enable-force-pic
     --disable-force-pic
       Should position-independent-code (PIC) be generated even when
       not building shared libraries? This only applies on x86_64/amd64
       architecture and only when NOT building shared libraries. When enabled,
       the generated static libraries will be PIC, and can then be linked
       into "jumbo" shared libraries.
     --enable-distcc
     --disable-distcc
       Will you be using distcc?
     --enable-ccache
     --disable-ccache
       Will you be using ccache?
     --enable-repro
     --disable-repro
       Build the Repro proxy server?
     --repro-db="..."
       Which database should be used with Repro?
       Valid values are: [berkeley-db4]
     --db4-headers="..."
       Where is db_cxx.h?
     --enable-radius
     --disable-radius
       Build the RADIUS authentication module? (requires radiusclient-ng)
     --enable-tfm
     --disable-tfm
       Build the TFM test framework?
     --enable-recon
     --disable-recon
       Build the reCon Conversation Manager? (requires dtls-srtp patched OpenSSL)
     --enable-return-client
     --disable-return-client
       Build the reTurn client?
     --enable-return-server
     --disable-return-server
       Build the reTurn server?
     --boost-headers="..."
       Where is boost/config.hpp?
     --enable-sipx-installed
     --disable-sipx-installed
       Are the sipX libraries and headers installed?
     --libsipx-lib="..."
       Where is the common root of the sipX libraries?
     --sipx-libdir="..."
       Where are the sipX libraries installed?
     --sipx-incdir="..."
       Where are the sipX header files installed?
     --enable-ssl
     --disable-ssl
       Include SIP over TLS, SMIME or Identity header support? (Requires OpenSSL)
     --enable-dtls
     --disable-dtls
       Do you want to include SIP over DTLS support? (Requires OpenSSL 0.9.8+)
     --with-ssl-location="..."
       Where is OpenSSL? (leave blank to use installed copy)
     --enable-curl
     --disable-curl
       Should DUM use curl to retreive identity information?
     --enable-google-malloc
     --disable-google-malloc
       Use the Google malloc() implementation?
     --enable-random-thread-local
     --disable-random-thread-local
       Use Thread Local Storage with random_r() to generate random numbers?
       See Random_number_generation for details.
     --enable-google-cpuperf
     --disable-google-cpuperf
       Use Google cpuperf?
     --enable-ipv6
     --disable-ipv6
       Compile in IPv6 support?
     --enable-epoll
     --disable-epoll
       Compile in stack support for epoll() system call?
       Enabled by default if system header file present.
     --enable-popt
     --disable-popt
       Use popt to read commandline options?
       Test apps and repro make use of popt.
     --popt-headers="..."
       Where is popt.h?
     --popt-lib="..."
       Where is libpopt?
     --enable-resip-fixed-point
     --disable-resip-fixed-point
       Compile with no floating point functions?
     --enable-pedantic-stack
     --disable-pedantic-stack
       Force stack to fully parse every message it receives?
     --prefix="..."
       Where should the libraries be installed?
     --with-resolver="..."
       Which DNS resolution library do you want to use?
       Valid values are: [resip-ares, c-ares]

Support for c-ares remains experimental. Note that using c-ares with resiprocate requires a bleeding-edge copy of c-ares at the moment. See the c-ares project page for information about obtaining a copy of c-ares from their cvs repository.

     --ares-prefix="..."
       Where should ares be installed?
     --cares-headers="..."
       If using c-ares, the directory containing its headers.
     --cares-libs="..."
       If using c-ares, the directory containing its libraries.