TODO: build: fix issue with standard libpaths introduced by cups-config and friends
[obnox/samba/samba-obnox.git] / buildtools / wafadmin / Tools / ccroot.py
index 264bdc7f0f6350db145fcdcba22aff27a94b306a..e68961bf4e2f2cd3db42db950be166831455be90 100644 (file)
@@ -20,6 +20,12 @@ import config_c # <- necessary for the configuration, do not touch
 
 USE_TOP_LEVEL = False
 
+def is_standard_libpath(env, path):
+       for _path in env.STANDARD_LIBPATH:
+               if _path == os.path.normpath(path):
+                       return True
+       return False
+
 def get_cc_version(conf, cc, gcc=False, icc=False):
 
        cmd = cc + ['-dM', '-E', '-']
@@ -467,10 +473,14 @@ def apply_obj_vars(self):
                v.append_value('LINKFLAGS', v['FULLSTATIC_MARKER'])
 
        for i in v['RPATH']:
+               if is_standard_libpath(v, i):
+                       continue
                if i and rpath_st:
                        app('LINKFLAGS', rpath_st % i)
 
        for i in v['LIBPATH']:
+               if is_standard_libpath(v, i):
+                       continue
                app('LINKFLAGS', libpath_st % i)
                app('LINKFLAGS', staticlibpath_st % i)