X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Mainpage.dox;h=77ead86a457eb43b24dd10c1b7c7fa49f5edd867;hb=e9c7485ed08869e7813ee36c0c5712371bad0f30;hp=049d80cdd272c2d120bc003cfaae22f5888ba2d2;hpb=0734de7b0f8616d5f2454289d1c686ba1d2c625b;p=senf.git diff --git a/Mainpage.dox b/Mainpage.dox index 049d80c..77ead86 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -47,6 +47,61 @@ \see \ref senf_usage\n Examples + + \section senfutil_overview Building Projects using SENF + + When building projects using senf, SENFSCons has a very simple helper module \ref senfutil to + make the building of libraries utilizing senf simpler: + \code + import sys + sys.path.extend(('senf/site_scons','/usr/lib/senf/site_scons')) + import os.path, glob, senfutil + + env = Environment() + + senfutil.SetupForSENF( env ) + + env.Append( + + LIBS = [ ], + CXXFLAGS = [ '-Wall', '-Woverloaded-virtual' ], + LINKFLAGS = [ ], + + CXXFLAGS_debug = [ ], + LINKFLAGS_debug = [ ], + LOGLEVELS_debug = [ 'senf::log::Debug||VERBOSE' ], + + CXXFLAGS_final = [ '-O3' ], + LINKFLAGS_final = [ ], + LOGLEVELS_final = [ ], + + SENF_BUILDOPTS = [ ], + + ) + + env.Default( + env.Program( target = 'udpforward', + source = glob.glob('*.cc') ) + ) + + env.Clean(DEFAULT_TARGETS, [ 'udpforward.log', 'udpforward.pid' ]) + \endcode + + This example builds a simple binary from a number of source files (all '.cc' files). It links + against the SENF library and automatically sets all the correct compiler options using + senfutil.SetupForSENF( env ). + + This script automatically uses a SENF installation either symlinked or imported into the current + project in directory 'senf' or, if this directory does not exist, a globaly installed SENF. A + locally installed SENF is automatically recompiled if needed. Parallel building is also + supported. + + This script automatically supports the \c final and \c LOGLEVELS command line parameters. The + LOGLEVELS parameter uses a much more readable syntax than SENF_LOG_CONF: +
+    $ scons -j2 final=1 \
+          LOGLEVELS='senf::log::Debug||IMPORTANT myapp::Transactions|mytrans::Area|VERBOSE'
+    
*/ /** \page senf_usage Using the SENF framework