EnsureSConsVersion(0, 96, 93)
+ -- THE CheckLib Configure TEST WILL CHANGE BEHAVIOR
+
+ The CheckLib() Configure test appends the lib(s) to the
+ Environment's LIBS list in 1.3 and earlier. In 1.3 there is a
+ new CheckLib argument, append, which defaults to True to
+ preserve the old behavior. In a future release, append will
+ be changed to default to False, to conform with autoconf and
+ user expectations, since it is usually used to build up
+ library lists in a right-to-left way.
+
+
+
SCons is developed with an extensive regression test suite, and a
rigorous development methodology for continually improving that suite.
Because of this, SCons is of sufficient quality that you can use it
# Append "lib_name_list" to the value of LIBS.
# "lib_namelist" is a list of strings.
# Return the value of LIBS before changing it (any type
-# can be used, it is passed to SetLIBS() later.
+# can be used, it is passed to SetLIBS() later.)
+#
+# context.PrependLIBS(lib_name_list)
+# Prepend "lib_name_list" to the value of LIBS.
+# "lib_namelist" is a list of strings.
+# Return the value of LIBS before changing it (any type
+# can be used, it is passed to SetLIBS() later.)
#
# context.SetLIBS(value)
# Set LIBS to "value". The type of "value" is what
# AppendLIBS() returned.
# Return the value of LIBS before changing it (any type
-# can be used, it is passed to SetLIBS() later.
+# can be used, it is passed to SetLIBS() later.)
#
# context.headerfilename
# Name of file to append configure results to, usually
return st
def CheckLib(context, libs, func_name = None, header = None,
- extra_libs = None, call = None, language = None, autoadd = 1):
+ extra_libs = None, call = None, language = None, autoadd = 1,
+ append = True):
"""
Configure check for a C or C++ libraries "libs". Searches through
the list of libraries, until one is found where the test succeeds.
l = [ lib_name ]
if extra_libs:
l.extend(extra_libs)
- oldLIBS = context.AppendLIBS(l)
+ if append:
+ oldLIBS = context.AppendLIBS(l)
+ else:
+ oldLIBS = context.PrependLIBS(l)
sym = "HAVE_LIB" + lib_name
else:
oldLIBS = -1
self.env.Append(LIBS = lib_name_list)
return oldLIBS
+ def PrependLIBS(self, lib_name_list):
+ oldLIBS = self.env.get( 'LIBS', [] )
+ self.env.Prepend(LIBS = lib_name_list)
+ return oldLIBS
+
def SetLIBS(self, val):
oldLIBS = self.env.get( 'LIBS', [] )
self.env.Replace(LIBS = val)