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

bms_fbsd at users.sourceforge.net bms_fbsd at users.sourceforge.net
Thu Nov 26 15:25:22 PST 2009


Revision: 11591
          http://xorp.svn.sourceforge.net/xorp/?rev=11591&view=rev
Author:   bms_fbsd
Date:     2009-11-26 23:25:22 +0000 (Thu, 26 Nov 2009)

Log Message:
-----------
Teach SCons to print a warning if GNU ld is not available.
This check must be made after Environment() is constructed.

Most of our shared library magic is specific to GNU ld.
The exposure is a few flags here and there; it would be portable
to e.g. the Solaris linker without too much effort.

Fix some comments.

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

Modified: trunk/xorp/SConstruct
===================================================================
--- trunk/xorp/SConstruct	2009-11-26 22:51:14 UTC (rev 11590)
+++ trunk/xorp/SConstruct	2009-11-26 23:25:22 UTC (rev 11591)
@@ -18,7 +18,6 @@
 # $ID$
 
 # TODO build static and shared libraries. do so concisely and without bugs.
-# TODO make shared library linker flags portable to non-gnu linkers.
 # TODO tone down linker line spamming, -lpcre etc; stage use of LIBS please.
 # TODO cross compiles.
 # TODO Add separate toolchain test for C99 varargs macros.
@@ -142,8 +141,17 @@
 if gnustrip:
     env['_STRIP_UNNEEDED'] = "--strip-unneeded"
 
+# 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']:
     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,
@@ -339,6 +347,7 @@
     ( '_FORTIFY_SOURCE', 0 ),
     ])
 
+# NOTE: gcc specific flags.
 env.AppendUnique(CFLAGS = [
     '-Werror',
     '-W',
@@ -366,14 +375,14 @@
     '-ftemplate-depth-25'
     ])
 
-# XXX For GNU STL only at this time.
+# NOTE: For GNU STL only at this time.
 if env['debug_stl']:
     env.AppendUnique(CXXFLAGS = [
         '-D_GLIBCXX_DEBUG',
         '-D_GLIBCXX_DEBUG_PEDANTIC',
     ])
 
-# XXX DEBUG_LOGGING_GLOBAL current a no-op.
+# NOTE: DEBUG_LOGGING_GLOBAL currently a no-op.
 if env['debug_msg']:
     env.AppendUnique(CFLAGS = [
         '-DDEBUG_LOGGING',
@@ -404,6 +413,7 @@
     ])
 
 # Export dynamic symbols in executables for runtime backtraces w/o GDB.
+# NOTE: GNU ld specific flag.
 env.AppendUnique(LINKFLAGS = [
     '-rdynamic',
     ])


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