TODO: build: fix issue with standard libpaths introduced by cups-config and friends
[obnox/samba/samba-obnox.git] / buildtools / wafadmin / Tools / config_c.py
index d0bc61773625576cec1d0b1eec2635086d04c2e7..dedcfa841d24b28f81eb2cc2f7830184ce25a431 100644 (file)
@@ -11,6 +11,7 @@ from Utils import md5
 import Build, Utils, Configure, Task, Options, Logs, TaskGen
 from Constants import *
 from Configure import conf, conftest
+import ccroot
 
 cfg_ver = {
        'atleast-version': '>=',
@@ -60,7 +61,8 @@ def parse_flags(line, uselib, env):
                        app('LIB_' + uselib, ot)
                elif st == '-L':
                        if not ot: ot = lst.pop(0)
-                       app('LIBPATH_' + uselib, ot)
+                       if not ccroot.is_standard_libpath(env, ot):
+                               app('LIBPATH_' + uselib, ot)
                elif x == '-pthread' or x.startswith('+'):
                        app('CCFLAGS_' + uselib, x)
                        app('CXXFLAGS_' + uselib, x)
@@ -83,9 +85,11 @@ def parse_flags(line, uselib, env):
                # in too old versions of our internal libs.
                #
                elif x.startswith('-Wl,-R'):
-                       app('RPATH_' + uselib, x[6:])
+                       if not ccroot.is_standard_libpath(env,x[6:]):
+                               app('RPATH_' + uselib, x[6:])
                elif x.startswith('-Wl,-rpath,'):
-                       app('RPATH_' + uselib, x[11:])
+                       if not ccroot.is_standard_libpath(env, x[11:]):
+                               app('RPATH_' + uselib, x[11:])
                elif x.startswith('-Wl'):
                        app('LINKFLAGS_' + uselib, x)
                elif x.startswith('-m') or x.startswith('-f'):