summaryrefslogtreecommitdiff
path: root/libxklavier/Makefile.am
diff options
context:
space:
mode:
authorSergey Udaltsov <svu@gnome.org>2009-06-28 13:29:44 +0000
committerSergey Udaltsov <svu@gnome.org>2009-06-28 13:29:44 +0000
commit8a1e28e4e9887c799c6b34b8c0339cacc33d41cc (patch)
treece3982e0a58dc19fc58210ca5ad9b204d04120c4 /libxklavier/Makefile.am
parent55f7051979120d338912af9439c26799ee808653 (diff)
downloadlibxklavier-8a1e28e4e9887c799c6b34b8c0339cacc33d41cc.tar.gz
using binding-friendly glib-mkenums, b.fd.o#21578
Diffstat (limited to 'libxklavier/Makefile.am')
-rw-r--r--libxklavier/Makefile.am59
1 files changed, 44 insertions, 15 deletions
diff --git a/libxklavier/Makefile.am b/libxklavier/Makefile.am
index f69a52e..1101f9a 100644
--- a/libxklavier/Makefile.am
+++ b/libxklavier/Makefile.am
@@ -15,17 +15,6 @@ else
ENABLE_XMODMAP_SUPPORT_CFLAG = -DDISABLE_XMODMAP_SUPPORT=1
endif
-EXTRA_DIST=marshal.list
-
-# GLIB_GENMARSHAL = $(shell $PKG_CONFIG --variable=glib_genmarshal glib-2.0)
-GLIB_GENMARSHAL = `$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
-
-xkl_engine_marshal.h: marshal.list
- $(GLIB_GENMARSHAL) --prefix=xkl_engine marshal.list --header > xkl_engine_marshal.h
-
-xkl_engine_marshal.c: xkl_engine_marshal.h
- $(GLIB_GENMARSHAL) --prefix=xkl_engine marshal.list --body > xkl_engine_marshal.c
-
AM_CFLAGS=-Wall -DDATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-I. -I$(top_srcdir) $(X_CFLAGS) \
$(XML_CFLAGS) $(GLIB_CFLAGS) $(XINPUT_CFLAGS) \
@@ -35,20 +24,60 @@ AM_CFLAGS=-Wall -DDATA_DIR=\"$(datadir)/$(PACKAGE)\" \
lib_LTLIBRARIES = libxklavier.la
noinst_HEADERS = xklavier_private.h xklavier_private_xkb.h xklavier_private_xmm.h
+xklavier_headers = xklavier.h xkl_config_registry.h xkl_engine.h \
+ xkl_config_rec.h xkl_config_item.h xkl_engine_marshal.h
+xklavier_built_headers = xkl-enum-types.h
+xklavier_built_cfiles = xkl-enum-types.c
xklavierincdir = $(includedir)/libxklavier
-xklavierinc_HEADERS = xklavier.h xkl_config_registry.h xkl_engine.h \
- xkl_config_rec.h xkl_config_item.h xkl_engine_marshal.h
+xklavierinc_HEADERS = $(xklavier_headers) $(xklavier_built_headers)
-libxklavier_la_SOURCES = xklavier.c xklavier_evt.c xklavier_config.c xklavier_config_iso.c \
+libxklavier_la_SOURCES = $(xklavier_built_cfiles) xklavier.c xklavier_evt.c xklavier_config.c xklavier_config_iso.c \
xklavier_xkb.c xklavier_evt_xkb.c xklavier_config_xkb.c xklavier_toplevel.c \
xklavier_xmm.c xklavier_xmm_opts.c xklavier_evt_xmm.c xklavier_config_xmm.c \
xklavier_util.c xklavier_props.c xklavier_dump.c xkl_engine_marshal.c \
- $(noinst_HEADERS) $(xklavierinc_HEADERS)
+ $(noinst_HEADERS) $(xklavierinc_HEADERS)
libxklavier_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
libxklavier_la_LIBADD = \
$(XML_LIBS) $(GLIB_LIBS) $(XINPUT_LIBS) \
$(LIBXKBFILE_PRESENT_LDFLAGS) \
$(X_LIBS) -lX11 $(LIBICONV)
+EXTRA_DIST=marshal.list
+
+GLIB_GENMARSHAL = `$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+
+xkl_engine_marshal.h: marshal.list
+ $(GLIB_GENMARSHAL) --prefix=xkl_engine marshal.list --header > xkl_engine_marshal.h
+
+xkl_engine_marshal.c: xkl_engine_marshal.h
+ $(GLIB_GENMARSHAL) --prefix=xkl_engine marshal.list --body > xkl_engine_marshal.c
+
+xkl-enum-types.h: stamp-xkl-enum-types.h
+ @true
+stamp-xkl-enum-types.h: $(xklavier_headers)
+ (cd $(srcdir) \
+ && glib-mkenums \
+ --fhead "#ifndef __XKL_ENUM_TYPES_H__\n#define __XKL_ENUM_TYPES_H__\n" \
+ --fprod "/* enumerations from \"@filename@\" */\n" \
+ --vhead "GType @enum_name@_get_type (void);\n#define XKL_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
+ --ftail "#endif /* __XKL_ENUM_TYPES_H__ */" \
+ $(xklavier_headers)) > new-xkl-enum-types.h \
+ && (cmp -s new-xkl-enum-types.h xkl-enum-types.h || cp new-xkl-enum-types.h xkl-enum-types.h) \
+ && rm -f new-xkl-enum-types.h \
+ && echo timestamp > $(@F)
+
+xkl-enum-types.c: $(xklavier_headers) xkl-enum-types.h
+ (cd $(srcdir) \
+ && glib-mkenums \
+ --fhead "#include <libxklavier/xklavier.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 " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
+ $(xklavier_headers)) > new-xkl-enum-types.c \
+ && cp new-xkl-enum-types.c $(@F) \
+ && rm -f new-xkl-enum-types.c
+
+DISTCLEANFILES=$(xklavier_built_headers) $(xklavier_built_cfiles) stamp-xkl-enum-types.h