[evolution-data-server] Fix glib-gen.mak rules.



commit eba57e3b28a7a55e2311e3f8fbe3452a3130e84f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Dec 2 14:15:33 2011 -0600

    Fix glib-gen.mak rules.
    
    The %-enumtypes.h pattern causes problems when an "*-enumtypes.h"
    from elsewhere (e.g. Camel) is found in the preprocessor search path.
    
    Instead specify the output filename explicitly through a new variable:
    glib_enum_output.  (e.g. glib_enum_output=e-data-book-enumtypes)

 addressbook/libedata-book/Makefile.am    |    1 +
 calendar/libedata-cal/Makefile.am        |    1 +
 calendar/libedata-cal/e-data-cal-types.h |    2 ++
 camel/Makefile.am                        |    1 +
 camel/glib-gen.mak                       |   11 ++++++-----
 glib-gen.mak                             |   13 +++++++------
 6 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/addressbook/libedata-book/Makefile.am b/addressbook/libedata-book/Makefile.am
index c1388e0..756d182 100644
--- a/addressbook/libedata-book/Makefile.am
+++ b/addressbook/libedata-book/Makefile.am
@@ -1,5 +1,6 @@
 include $(top_srcdir)/glib-gen.mak
 glib_enum_headers=e-data-book-types.h
+glib_enum_output=e-data-book-enumtypes
 glib_enum_define=E_DATA_BOOK
 glib_enum_prefix=e_data_book
 
diff --git a/calendar/libedata-cal/Makefile.am b/calendar/libedata-cal/Makefile.am
index bc56024..c540d9b 100644
--- a/calendar/libedata-cal/Makefile.am
+++ b/calendar/libedata-cal/Makefile.am
@@ -1,5 +1,6 @@
 include $(top_srcdir)/glib-gen.mak
 glib_enum_headers=e-data-cal-types.h
+glib_enum_output=e-data-cal-enumtypes
 glib_enum_define=E_DATA_CAL
 glib_enum_prefix=e_data_cal
 
diff --git a/calendar/libedata-cal/e-data-cal-types.h b/calendar/libedata-cal/e-data-cal-types.h
index 7792b66..66787e2 100644
--- a/calendar/libedata-cal/e-data-cal-types.h
+++ b/calendar/libedata-cal/e-data-cal-types.h
@@ -2,6 +2,8 @@
 #ifndef __E_DATA_CAL_TYPES_H__
 #define __E_DATA_CAL_TYPES_H__
 
+#include <glib.h>
+
 G_BEGIN_DECLS
 
 typedef enum {
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 04d84f1..9e8a3ab 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -31,6 +31,7 @@ lib_LTLIBRARIES = libcamel-1.2.la
 
 include $(top_srcdir)/camel/glib-gen.mak
 glib_enum_headers=camel-enums.h
+glib_enum_output=camel-enumtypes
 glib_enum_define=CAMEL
 glib_enum_prefix=camel
 
diff --git a/camel/glib-gen.mak b/camel/glib-gen.mak
index 2deb0ed..846093d 100644
--- a/camel/glib-gen.mak
+++ b/camel/glib-gen.mak
@@ -2,6 +2,7 @@
 # the example is based on the colorbalance interface
 
 #glib_enum_headers=$(colorbalance_headers)
+#glib_enum_output=gst-color-balance-enumtypes
 #glib_enum_define=GST_COLOR_BALANCE
 #glib_enum_prefix=gst_color_balance
 
@@ -15,7 +16,7 @@
 	glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \
 	mv $*-marshal.c.tmp $*-marshal.c
 
-%-enumtypes.h: $(glib_enum_headers)
+$(glib_enum_output).h: $(glib_enum_headers)
 	$(AM_V_GEN) glib-mkenums \
 	--fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
 	--fprod "/* enumerations from \"@filename \" */\n" \
@@ -23,13 +24,13 @@
 	--ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \
 	$^ > $@
 
-%-enumtypes.c: $(glib_enum_headers)
+$(glib_enum_output).c: $(glib_enum_headers)
 	@if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi
 	$(AM_V_GEN) glib-mkenums \
-	--fhead "#include <$*.h>\n#include \"$*-enumtypes.h\"" \
+	--fhead "#include <$<>\n#include \"$(glib_enum_output).h\"" \
 	--fprod "\n/* enumerations from \"@filename \" */" \
 	--vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G Type@Value values[] = {"     \
-	--vprod "      { @valuenum@, \"@VALUENAME \", \"@valuenick \" }," \
+	--vprod "      { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
 	--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ type@_register_static (\"@EnumName \", values);\n  }\n  return etype;\n}\n" \
 	$^ > $@
 
@@ -38,5 +39,5 @@
 .deps/%-marshal.Plo:
 	touch $@
 
-.deps/%-enumtypes.Plo:
+.deps/$(glib_enum_output).Plo:
 	touch $@
diff --git a/glib-gen.mak b/glib-gen.mak
index 3e2cd7b..a360dde 100644
--- a/glib-gen.mak
+++ b/glib-gen.mak
@@ -2,6 +2,7 @@
 # the example is based on the colorbalance interface
 
 #glib_enum_headers=$(colorbalance_headers)
+#glib_enum_output=gst-color-balance-enumtypes
 #glib_enum_define=GST_COLOR_BALANCE
 #glib_enum_prefix=gst_color_balance
 
@@ -15,7 +16,7 @@
 	glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp && \
 	mv $*-marshal.c.tmp $*-marshal.c
 
-%-enumtypes.h: $(glib_enum_headers)
+$(glib_enum_output).h: $(glib_enum_headers)
 	$(AM_V_GEN) glib-mkenums \
 	--fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
 	--fprod "/* enumerations from \"@filename \" */\n" \
@@ -23,13 +24,13 @@
 	--ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \
 	$^ > $@
 
-%-enumtypes.c: $(glib_enum_headers)
-	@if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi && \
+$(glib_enum_output).c: $(glib_enum_headers)
+	@if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi
 	$(AM_V_GEN) glib-mkenums \
-	--fhead "#include <$*.h>\n#include \"$*-enumtypes.h\"" \
+	--fhead "#include <$<>\n#include \"$(glib_enum_output).h\"" \
 	--fprod "\n/* enumerations from \"@filename \" */" \
 	--vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G Type@Value values[] = {"     \
-	--vprod "      { @valuenum@, \"@VALUENAME \", \"@valuenick \" }," \
+	--vprod "      { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
 	--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ type@_register_static (\"@EnumName \", values);\n  }\n  return etype;\n}\n" \
 	$^ > $@
 
@@ -38,5 +39,5 @@
 .deps/%-marshal.Plo:
 	touch $@
 
-.deps/%-enumtypes.Plo:
+.deps/$(glib_enum_output).Plo:
 	touch $@



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]