diff options
author | 2011-08-07 21:52:46 +0200 | |
---|---|---|
committer | 2011-08-07 21:52:46 +0200 | |
commit | e3e320251e15bb4a574eb4e3201d375eb897166b (patch) | |
tree | 3477f389487531b4e445e4190e90fb17f135b757 | |
parent | hacked together somethings in the ebuild gen so it persumes autotools (diff) | |
download | ebuildgen-e3e320251e15bb4a574eb4e3201d375eb897166b.tar.gz ebuildgen-e3e320251e15bb4a574eb4e3201d375eb897166b.tar.bz2 ebuildgen-e3e320251e15bb4a574eb4e3201d375eb897166b.zip |
Added automatic detection of the default incpaths!
-rw-r--r-- | linkdeps.py | 17 |
1 files 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",[]) |