codegen/override.py: Fix the lookup of override files in the specified search directories.

Original commit message from CVS:
* codegen/override.py:
Fix the lookup of override files in the specified search directories.
* gst/Makefile.am:
Don't distribute gstversion.override
Fixup .defs => .c make instructions
All the above fixes the cases where you're building in a directory
different from the source directory.
This commit is contained in:
Edward Hervey 2006-11-22 17:20:21 +00:00
parent d06c4740ef
commit 34d62eb035
3 changed files with 19 additions and 9 deletions

View file

@ -1,3 +1,13 @@
2006-11-22 Edward Hervey <edward@fluendo.com>
* codegen/override.py:
Fix the lookup of override files in the specified search directories.
* gst/Makefile.am:
Don't distribute gstversion.override
Fixup .defs => .c make instructions
All the above fixes the cases where you're building in a directory
different from the source directory.
2006-11-15 Michael Smith <msmith@fluendo.com>
* gst/extend/discoverer.py:

View file

@ -44,7 +44,7 @@ class Overrides:
self.defines = {}
self.functions = {}
self.newstyle_constructors = {}
self.path = path
self.path = [os.path.abspath(x) for x in path]
if filename:
self.handle_file(filename)
@ -54,15 +54,16 @@ class Overrides:
fp = None
for path in self.path:
os.chdir(oldpath)
os.chdir(os.path.abspath(path))
os.chdir(path)
try:
fp = open(filename, 'r')
break
except:
continue
os.chdir(oldpath)
if not fp:
raise Exception, "Couldn't find file %s" % filename
dirname = os.path.dirname(os.path.abspath(filename))
dirname = path
if dirname != oldpath:
os.chdir(dirname)

View file

@ -51,7 +51,6 @@ _gst_la_SOURCES = \
nodist__gst_la_SOURCES = gst.c
GST_OVERRIDES = \
gst.override \
gstversion.override \
gstbin.override \
gstbuffer.override \
gstbus.override \
@ -87,13 +86,13 @@ EXTRA_DIST += $(INTERFACES_DEFS) $(INTERFACES_OVERRIDES)
interfaces.c: $(INTERFACES_DEFS) $(INTERFACES_OVERRIDES) $(GEN_FILES)
.defs.c:
(cd $(srcdir) \
&& python $(top_srcdir)/codegen/codegen.py \
($(PYTHON) $(top_srcdir)/codegen/codegen.py \
--load-types $(srcdir)/arg-types.py \
--register $(srcdir)/gst-types.defs \
--override $*.override \
--override $(srcdir)/$*.override \
--extendpath $(top_builddir)/gst/ \
--prefix py$* $*.defs) > gen-$*.c \
--extendpath $(srcdir)/ \
--prefix py$* $<) > gen-$*.c \
&& cp gen-$*.c $*.c \
&& rm -f gen-$*.c