import os, shutil, re
import Build, Configure, Utils
from Configure import conf
+import config_c
from samba_utils import *
msg='Checking for -D_FILE_OFFSET_BITS=64'):
conf.DEFINE('_FILE_OFFSET_BITS', 64)
return True
+
+ if conf.CHECK_CODE('return !(sizeof(off_t) >= 8)',
+ define,
+ execute=True,
+ cflags='-D_LARGE_FILES',
+ msg='Checking for -D_LARGE_FILES'):
+ conf.DEFINE('_LARGE_FILES', 1)
+ return True
return False
msg='Checking for stylesheet %s' % s,
define='XSLTPROC_MANPAGES', on_target=False,
boolean=True)
+ if not conf.CONFIG_SET('XSLTPROC_MANPAGES'):
+ print "A local copy of the docbook.xsl wasn't found on your system" \
+ " consider installing package like docbook-xsl"
+
+#
+# Determine the standard libpath for the used compiler,
+# so we can later use that to filter out these standard
+# library paths when some tools like cups-config or
+# python-config report standard lib paths with their
+# ldflags (-L...)
+#
+@conf
+def CHECK_STANDARD_LIBPATH(conf):
+ # at least gcc and clang support this:
+ try:
+ cmd = conf.env.CC + ['-print-search-dirs']
+ out = Utils.cmd_output(cmd).split('\n')
+ except ValueError:
+ # option not supported by compiler - use a standard list of directories
+ dirlist = [ '/usr/lib', '/usr/lib64' ]
+ except:
+ raise Utils.WafError('Unexpected error running "%s"' % (cmd))
+ else:
+ dirlist = []
+ for line in out:
+ line = line.strip()
+ if line.startswith("libraries: ="):
+ dirliststr = line[len("libraries: ="):]
+ dirlist = [ os.path.normpath(x) for x in dirliststr.split(':') ]
+ break
+
+ conf.env.STANDARD_LIBPATH = dirlist
+
+
+waf_config_c_parse_flags = config_c.parse_flags;
+def samba_config_c_parse_flags(line, uselib, env):
+ #
+ # We do a special treatment of the rpath components
+ # in the linkflags line, because currently the upstream
+ # parse_flags function is incomplete with respect to
+ # treatment of the rpath. The remainder of the linkflags
+ # line is later passed to the original funcion.
+ #
+ lst1 = shlex.split(line)
+ lst2 = []
+ while lst1:
+ x = lst1.pop(0)
+
+ #
+ # NOTE on special treatment of -Wl,-R and -Wl,-rpath:
+ #
+ # It is important to not put a library provided RPATH
+ # into the LINKFLAGS but in the RPATH instead, since
+ # the provided LINKFLAGS get prepended to our own internal
+ # RPATH later, and hence can potentially lead to linking
+ # in too old versions of our internal libs.
+ #
+ if x == '-Wl,-rpath' or x == '-Wl,-R':
+ linkflags.remove(x)
+ x = lst1.pop(0)
+ if x.startswith('-Wl,'):
+ rpath = x[4:]
+ else:
+ rpath = x
+ elif x.startswith('-Wl,-R,'):
+ rpath = x[7:]
+ elif x.startswith('-Wl,-R'):
+ rpath = x[6:]
+ elif x.startswith('-Wl,-rpath,'):
+ rpath = x[11:]
+ else:
+ lst2.append(x)
+ continue
+
+ env.append_value('RPATH_' + uselib, rpath)
+
+ line2 = ' '.join(lst2)
+ waf_config_c_parse_flags(line2, uselib, env)
+
+ return
+
+config_c.parse_flags = samba_config_c_parse_flags