[Xorp-cvs] SF.net SVN: xorp:[11593] trunk/xorp/SConstruct

bms_fbsd at users.sourceforge.net bms_fbsd at users.sourceforge.net
Thu Nov 26 16:19:41 PST 2009


Revision: 11593
          http://xorp.svn.sourceforge.net/xorp/?rev=11593&view=rev
Author:   bms_fbsd
Date:     2009-11-27 00:19:41 +0000 (Fri, 27 Nov 2009)

Log Message:
-----------
Add a warning about GCC/G++ specific options being in use
which will be printed if these tools are not detected by SCons
when constructing the Environment().

Reword the GNU tool warning to be more generic.

Modified Paths:
--------------
    trunk/xorp/SConstruct

Modified: trunk/xorp/SConstruct
===================================================================
--- trunk/xorp/SConstruct	2009-11-26 23:26:46 UTC (rev 11592)
+++ trunk/xorp/SConstruct	2009-11-27 00:19:41 UTC (rev 11593)
@@ -25,6 +25,12 @@
 # TODO Merge scons-unfamiliar syntactic sugar from YHC's sconsfiles.
 # TODO conditionalize new directory layout here
 
+gnutoolwarning = """
+WARNING: The GNU %s was not detected on your system.
+Some combinations of linker or compiler flags, specific to building XORP,
+may not function correctly.
+"""
+
 # The XRL tgt-gen and clnt-gen scripts use Python 2.3+'s optparse
 # class.
 EnsurePythonVersion(2, 3)
@@ -142,14 +148,9 @@
 # Most of our shared library tweaks are specific to GNU ld.
 # Check if the GNU linker is available, and print a warning if not.
 if env['shared']:
+    if SCons.Tool.FindTool(['gnulink'], env) is None:
+        print gnutoolwarning % 'ld linker'
     env['SHAREDLIBS'] = "defined"
-    if SCons.Tool.FindTool(['gnulink'], env) is None:
-        print \
-"""
-WARNING: The GNU linker was not detected on your system.
-Some combinations of linker and compiler flags, specific to building
-shared libraries, may not function correctly.
-"""
 print 'Shared libraries: ', env.has_key('SHAREDLIBS')
 
 # AUTOTEST_SKIP_ERRORS is SetDefault() by site_scons/site_tools/autotest.py,
@@ -337,6 +338,10 @@
 
 ########## end configure magic
 
+if SCons.Tool.FindTool(['gcc'], env) is None or \
+   SCons.Tool.FindTool(['g++'], env) is None:
+    print gnutoolwarning % 'gcc or g++ compiler'
+
 env.AppendUnique( CFLAGS = Split(ARGUMENTS.get('CFLAGS', "-g")) )
 env.AppendUnique( CXXFLAGS = Split(ARGUMENTS.get('CXXFLAGS', "-g")) )
 env.AppendUnique( LINKFLAGS = Split(ARGUMENTS.get('LINKFLAGS', "")) )
@@ -358,7 +363,8 @@
     '-Wpointer-arith',
     '-Wcast-align',
     '-Wstrict-prototypes',
-    '-Wnested-externs'
+    '-Wnested-externs',
+    #'-pipe',
     ])
 
 env.AppendUnique(CXXFLAGS = [
@@ -370,7 +376,8 @@
     '-Wpointer-arith',
     '-Wcast-align',
     '-Woverloaded-virtual',
-    '-ftemplate-depth-25'
+    '-ftemplate-depth-25',
+    #'-pipe',
     ])
 
 # NOTE: For GNU STL only at this time.


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Xorp-cvs mailing list