[poppler] poppler/glib: .cvsignore, 1.1, 1.2 Makefile.am, 1.7, 1.8 poppler-enums.c, 1.3, NONE poppler-enums.h, 1.3, NONE

Kristian Hogsberg krh at freedesktop.org
Mon May 16 14:56:33 PDT 2005


Update of /cvs/poppler/poppler/glib
In directory gabe:/tmp/cvs-serv7175/glib

Modified Files:
	.cvsignore Makefile.am 
Removed Files:
	poppler-enums.c poppler-enums.h 
Log Message:
2005-05-16  Kristian Høgsberg  <krh at redhat.com>

        * configure.ac: Check for glib-mkenums.

        * glib/Makefile.am (poppler-enums.h): Generate glib enums at
        compile time.

        * glib/poppler-enums.c:
        * glib/poppler-enums.h: Removed.



Index: .cvsignore
===================================================================
RCS file: /cvs/poppler/poppler/glib/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- .cvsignore	6 Apr 2005 20:49:19 -0000	1.1
+++ .cvsignore	16 May 2005 21:56:31 -0000	1.2
@@ -5,3 +5,4 @@
 Makefile
 Makefile.in
 test-poppler-glib
+stamp-*

Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/glib/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Makefile.am	6 May 2005 16:38:57 -0000	1.7
+++ Makefile.am	16 May 2005 21:56:31 -0000	1.8
@@ -17,27 +17,42 @@
 	$(cairo_includes)			\
 	-DDATADIR=\""$(datadir)"\"
 
+stamp_files = stamp-poppler-enums.h
 
+poppler-enums.h: stamp-poppler-enums.h
+	@true
+stamp-poppler-enums.h: $(poppler_glib_public_headers)
+	( cd $(srcdir) && $(GLIB_MKENUMS) \
+		--fhead "#ifndef __POPPLER_TYPE_ENUMS_H__\n" \
+		--fhead "#define __POPPLER_TYPE_ENUMS_H__ 1\n\n" \
+		--fhead "#include <glib-object.h>\n\n" \
+		--fhead "G_BEGIN_DECLS\n\n" \
+		--ftail "G_END_DECLS\n\n" \
+		--ftail "#endif /* __POPPLER_TYPE_ENUMS_H__ */\n" \
+		--fprod "\n/* --- @filename@ --- */" \
+		--eprod "#define POPPLER_TYPE_ at ENUMSHORT@ (@enum_name at _get_type())\n" \
+		--eprod "GType @enum_name at _get_type (void) G_GNUC_CONST;\n" \
+		$(^F) ) > xgen-$(@F) \
+	&& ( cmp -s xgen-$(@F) $(@F:stamp-%=%) || cp xgen-$(@F) $(@F:stamp-%=%) ) \
+	&& rm -f xgen-$(@F) \
+	&& echo timestamp > $(@F)
 
-
-poppler-enums.h: poppler-document.h
-	( cd $(srcdir) && glib-mkenums \
-			--fhead "#ifndef __POPPLER_TYPE_ENUMS_H__\n#define __POPPLER_TYPE_ENUMS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
-			--fprod "/* enumerations from \"@filename@\" */\n" \
-			--vhead "GType @enum_name at _get_type (void) G_GNUC_CONST;\n#define POPPLER_TYPE_ at ENUMSHORT@ (@enum_name at _get_type())\n" \
-			--ftail "G_END_DECLS\n\n#endif /* __POPPLER_TYPE_ENUMS_H__ */" \
-		$(poppler_glib_public_headers) ) > poppler-enums.h
-
-poppler-enums.c: poppler-document.h
-	( cd $(srcdir) && glib-mkenums \
-			--fhead "#include \"poppler-enums.h\"\n#include \"poppler-document.h\"\n" \
-			--ftail "#define __POPPLER_ENUMS_C__\n" \
-			--fprod "\n/* enumerations from \"@filename@\" */" \
-			--vhead "GType\n at enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G at Type@Value values[] = {" \
-			--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
-			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ at type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
-		$(poppler_glib_public_headers) ) > poppler-enums.c
-
+poppler-enums.c: $(poppler_glib_public_headers)
+	( cd $(srcdir) && $(GLIB_MKENUMS) \
+		--fhead "#include \"poppler-enums.h\"\n\n" \
+		--fprod "\n/* enumerations from \"@filename@\" */" \
+		--fprod "\n#include \"@filename@\"" \
+		--vhead "static const G at Type@Value _ at enum_name@_values[] = {" \
+		--vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+		--vtail "  { 0, NULL, NULL }\n};\n\n" \
+		--vtail "GType\n at enum_name@_get_type (void)\n{\n" \
+		--vtail "  static GType type = 0;\n\n" \
+		--vtail "  if (G_UNLIKELY (type == 0))\n" \
+		--vtail "    type = g_ at type@_register_static (\"@EnumName@\", _ at enum_name@_values);\n\n" \
+		--vtail "  return type;\n}\n\n" \
+		$(^F) ) > xgen-$(@F) \
+	&& ( cmp -s xgen-$(@F) $(@F) || cp xgen-$(@F) $(@F) ) \
+	&& rm -f xgen-$(@F)
 
 poppler_glib_public_headers =			\
 	poppler-action.h			\
@@ -53,8 +68,8 @@
 
 lib_LTLIBRARIES = libpoppler-glib.la
 libpoppler_glib_la_SOURCES =			\
+	$(BUILT_SOURCES)			\
 	poppler-action.cc			\
-	poppler-enums.c				\
 	poppler-document.cc			\
 	poppler-page.cc				\
 	poppler.cc				\
@@ -77,3 +92,11 @@
 	$(POPPLER_GLIB_LIBS)			\
 	$(FREETYPE_LIBS)			\
 	$(cairo_libs)
+
+BUILT_SOURCES = \
+	poppler-enums.c	\
+	poppler-enums.h
+
+CLEANFILES = $(BUILT_SOURCES) $(stamp_files)
+DISTCLEANFILES = $(BUILT_SOURCES) $(stamp_files)
+MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(stamp_files)

--- poppler-enums.c DELETED ---

--- poppler-enums.h DELETED ---



More information about the poppler mailing list