aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2011-08-10 00:02:42 +0200
committerSebastian Parborg <darkdefende@gmail.com>2011-08-10 00:02:42 +0200
commit356d71a0dfbb61c1564aa3d602ecd80cfa96edfd (patch)
tree4a75c49b5772410590ca00bf6a780ad10c022003
parentFixed some more small stuff (diff)
downloadebuildgen-356d71a0dfbb61c1564aa3d602ecd80cfa96edfd.tar.gz
ebuildgen-356d71a0dfbb61c1564aa3d602ecd80cfa96edfd.tar.bz2
ebuildgen-356d71a0dfbb61c1564aa3d602ecd80cfa96edfd.zip
fixed bogus deps in the moc project
-rw-r--r--filetypes/automake.py5
-rw-r--r--filetypes/ctypefiles.py24
-rw-r--r--linkdeps.py2
-rw-r--r--scanfiles.py4
4 files changed, 24 insertions, 11 deletions
diff --git a/filetypes/automake.py b/filetypes/automake.py
index 3bd061e..c4ca432 100644
--- a/filetypes/automake.py
+++ b/filetypes/automake.py
@@ -288,7 +288,7 @@ def initscan(amfile,iflst):
if item.split(".")[0] == src.split(".")[0]:
sources += [src]
- if variable.split("_")[-1] == "CFLAGS":
+ if variable.split("_")[-1] == "CFLAGS" or variable == "DEFAULT_INCLUDES":
for item in amlist[0][variable]:
if item[:2] == "-I":
if item[2:] == "$(top_srcdir)" or item[2:] == "$(srcdir)":
@@ -298,6 +298,9 @@ def initscan(amfile,iflst):
else:
incflags += [curdir + item[2:]]
+ if not "DEFAULT_INCLUDES" in amlist[0]:
+ incflags += [curdir,top_dir]
+
if "SUBDIRS" in amlist[0]:
for dir in amlist[0]["SUBDIRS"]:
sources += scan(curdir + dir + "/Makefile.am")
diff --git a/filetypes/ctypefiles.py b/filetypes/ctypefiles.py
index e6b9624..dac3e0d 100644
--- a/filetypes/ctypefiles.py
+++ b/filetypes/ctypefiles.py
@@ -96,14 +96,18 @@ def scanincludes(string,inclst,curdir,incpaths):
"""
includes : includes ginc
"""
- p[1][0].add(p[2])
+ if islocalinc(p[2],curdir,incpaths):
+ p[1][1].add(p[2])
+ else:
+ p[1][0].add(p[2])
p[0] = p[1]
def p_lincludes(p):
"""
includes : includes linc
"""
- if islocalinc(p[2],curdir,incpaths):
+ locincpaths = incpaths + [curdir + "/"]
+ if islocalinc(p[2],curdir,locincpaths):
p[1][1].add(p[2])
else:
p[1][0].add(p[2])
@@ -136,13 +140,17 @@ def scanincludes(string,inclst,curdir,incpaths):
"includes : ginc"
globinc = set()
globinc.add(p[1])
- p[0] = [globinc,set(),{}]
+ if islocalinc(p[1], curdir, incpaths):
+ p[0] = [set(),globinc,{}]
+ else:
+ p[0] = [globinc,set(),{}]
def p_linc(p):
"includes : linc"
locinc = set()
locinc.add(p[1])
- if islocalinc(p[1], curdir, incpaths):
+ locincpaths = incpaths + [curdir + "/"]
+ if islocalinc(p[1], curdir, locincpaths):
p[0] = [set(),locinc,{}]
else:
p[0] = [locinc,set(),{}]
@@ -174,11 +182,13 @@ def islocalinc(inc, curdir, incpaths):
Checks if the file can be found with the path that is supplied.
If not this is probably a global include and thus return False
"""
- incpaths += [curdir + "/"]
for incpath in incpaths:
- if not glob.glob(incpath + inc) == []:
- return True
+ #check if the path for a local inc is correct.
+ #The work dir is in /tmp.
+ if incpath[:4] == "/tmp":
+ if not glob.glob(incpath + inc) == []:
+ return True
return False
diff --git a/linkdeps.py b/linkdeps.py
index f9902c8..bf44391 100644
--- a/linkdeps.py
+++ b/linkdeps.py
@@ -13,7 +13,7 @@ def qfiletopackage(dep,addpaths):
"""
print(dep)
- (statuscode,outstr) = getstatusoutput("`gcc -print-prog-name=cc1` -v ^C")
+ (statuscode,outstr) = getstatusoutput('echo "" | `gcc -print-prog-name=cc1` -v')
#"`gcc -print-prog-name=cc1plus` -v" for cpp
outlst = outstr.split("\n")
incpaths = []
diff --git a/scanfiles.py b/scanfiles.py
index b0cd7aa..6ebe92b 100644
--- a/scanfiles.py
+++ b/scanfiles.py
@@ -145,7 +145,7 @@ def scanproject(dir,projecttype):
"""
if projecttype == "guess":
filestolookfor = ["Makefile","makefile",
- "configure.ac","configure.in"] #add more later
+ "configure.ac","configure.in"] #add more later
elif projecttype == "makefile":
filestolookfor = ["Makefile","makefile"]
elif projecttype == "autotools":
@@ -155,7 +155,7 @@ def scanproject(dir,projecttype):
print(mfile)
if mfile == "Makefile" or mfile == "makefile":
(scanlist,binaries,incflags,targets) = scanmakefiledeps(mfile)
- #this is broken now... rewrite
+ #this is broken now... rewrite
return scanfilelist(scanlist),binaries,incflags,targets
else: