From e3e320251e15bb4a574eb4e3201d375eb897166b Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Sun, 7 Aug 2011 21:52:46 +0200 Subject: Added automatic detection of the default incpaths! --- linkdeps.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/linkdeps.py b/linkdeps.py index edf9c7a..d498a88 100644 --- a/linkdeps.py +++ b/linkdeps.py @@ -13,13 +13,19 @@ def qfiletopackage(dep,addpaths): """ print(dep) - incpaths = ["/usr/include", "/usr/local/include"] + (statuscode,outstr) = getstatusoutput("`gcc -print-prog-name=cc1` -v ^C") + #"`gcc -print-prog-name=cc1plus` -v" for cpp + outlst = outstr.split("\n") + incpaths = [] + for item in outlst: + if item[:2] == " /": + incpaths += [item[1:]] incpaths += addpaths depname = os.path.split(dep)[1] (statuscode,packagestr) = getstatusoutput("qfile -C " + depname) if not statuscode == 0: - package = pfltopackage(dep,addpaths) + package = pfltopackage(dep,incpaths) else: packagelst = packagestr.split() @@ -35,7 +41,7 @@ def qfiletopackage(dep,addpaths): print("more than one matching package where found!") if not package: - package = pfltopackage(dep,addpaths) + package = pfltopackage(dep,incpaths) print(package) return package @@ -46,8 +52,7 @@ def pfltopackage(dep,addpaths): """ print(dep) - incpaths = ["/usr/include", "/usr/local/include"] - incpaths += addpaths + incpaths = addpaths url_lines = [] depname = os.path.split(dep)[1] @@ -80,4 +85,4 @@ def pfltopackage(dep,addpaths): return [matching_packages.pop()] -#pfltopackage("ncurses.h",[]) +#qfiletopackage("jack/ringbuffer.h",[]) -- cgit v1.2.3-65-gdbad