added defcheck.py.

2006-11-08  Sven Neumann  <sven@gimp.org>

	* tools/Makefile.am (EXTRA_DIST): added defcheck.py.

	* tools/defcheck.py: keep a list of .def files, glob didn't work
	for me. Also bail out with a reasonable message if not being
	called from the toplevel source directory.

	* Makefile.am (dist-hook): check .def files for consistency.
This commit is contained in:
Sven Neumann 2006-11-08 21:42:32 +00:00 committed by Sven Neumann
parent fda5a84514
commit f7513e5a80
4 changed files with 36 additions and 7 deletions

View file

@ -1,7 +1,17 @@
2006-11-08 Sven Neumann <sven@gimp.org>
* tools/Makefile.am (EXTRA_DIST): added defcheck.py.
* tools/defcheck.py: keep a list of .def files, glob didn't work
for me. Also bail out with a reasonable message if not being
called from the toplevel source directory.
* Makefile.am (dist-hook): check .def files for consistency.
2006-11-08 Jakub Steiner <jimmac@ximian.com> 2006-11-08 Jakub Steiner <jimmac@ximian.com>
* stock-tool-foreground-select: update SIOX icon based on feedback * stock-tool-foreground-select: update SIOX icon based on feedback
on the mailing list on the mailing list.
2006-11-08 Kevin Cozens <kcozens@cvs.gnome.org> 2006-11-08 Kevin Cozens <kcozens@cvs.gnome.org>

View file

@ -90,6 +90,9 @@ DISTCLEANFILES = \
gimpinstall-@GIMP_TOOL_VERSION@: gimpinstall-@GIMP_TOOL_VERSION@:
$(LN_S) $(srcdir)/install-sh $(srcdir)/gimpinstall-@GIMP_TOOL_VERSION@ $(LN_S) $(srcdir)/install-sh $(srcdir)/gimpinstall-@GIMP_TOOL_VERSION@
check-defs:
@$(PYTHON) tools/defcheck.py || \
( echo "* .def files inconsistent *"; exit 1; )
validate-authors: validate-authors:
if HAVE_XMLLINT if HAVE_XMLLINT
@ -99,4 +102,4 @@ endif
all-local: AUTHORS all-local: AUTHORS
dist-hook: validate-authors dist-hook: check-defs validate-authors

View file

@ -39,6 +39,7 @@ INCLUDES = \
-I$(includedir) -I$(includedir)
EXTRA_DIST = \ EXTRA_DIST = \
defcheck.py \
gimp-mkenums \ gimp-mkenums \
gimppath2svg.py \ gimppath2svg.py \
rmshm rmshm

View file

@ -27,14 +27,31 @@ Needs the tool "nm" to work.
""" """
import sys, commands, glob import sys, commands
for df in glob.glob ("lib*/*.def"): def_files = (
"libgimpbase/gimpbase.def",
"libgimpcolor/gimpcolor.def",
"libgimpconfig/gimpconfig.def",
"libgimp/gimp.def",
"libgimp/gimpui.def",
"libgimpmath/gimpmath.def",
"libgimpmodule/gimpmodule.def",
"libgimpthumb/gimpthumb.def",
"libgimpwidgets/gimpwidgets.def"
)
for df in def_files:
directory, rest = df.split ("/") directory, rest = df.split ("/")
basename, extension = rest.split (".") basename, extension = rest.split (".")
libname = directory + "/.libs/lib" + basename + "-*.so" libname = directory + "/.libs/lib" + basename + "-*.so"
try:
defsymbols = file (df).read ().split ()[1:] defsymbols = file (df).read ().split ()[1:]
except IOError, message:
print message
print "You need to run this script from the toplevel source directory."
sys.exit (-1)
doublesymbols = [] doublesymbols = []
for i in range (len (defsymbols)-1, 0, -1): for i in range (len (defsymbols)-1, 0, -1):
@ -90,5 +107,3 @@ for df in glob.glob ("lib*/*.def"):
sys.exit (1) sys.exit (1)
sys.exit (0) sys.exit (0)