[monkey-bubble: 213/753] Use the new glib-mkenums instead of our own gnome-makeenums.pl and
- From: Sven Herzberg <herzi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [monkey-bubble: 213/753] Use the new glib-mkenums instead of our own gnome-makeenums.pl and
- Date: Wed, 14 Jul 2010 22:13:34 +0000 (UTC)
commit 3e531095733d45130ab38d022c92596f56902c65
Author: Martin Baulig <baulig suse de>
Date: Sun Apr 29 15:13:48 2001 +0000
Use the new glib-mkenums instead of our own gnome-makeenums.pl and
2001-04-29 Martin Baulig <baulig suse de>
* Makefile.am: Use the new glib-mkenums instead of our own
gnome-makeenums.pl and gnome-maketypes.awk.
* libgnometypebuiltins.[ch]: New generated files; provide a
type installation routine for each enum and flags type.
* gnome-program.c, libgnomeP.h (libgnome_type_init): This
function no longer exists.
libgnome/.cvsignore | 4 +--
libgnome/ChangeLog | 11 ++++++
libgnome/Makefile.am | 87 +++++++++++++++++++++++++++------------------
libgnome/gnome-program.c | 4 +-
libgnome/libgnomeP.h | 2 -
5 files changed, 66 insertions(+), 42 deletions(-)
---
diff --git a/libgnome/.cvsignore b/libgnome/.cvsignore
index 4ab279e..85f2089 100644
--- a/libgnome/.cvsignore
+++ b/libgnome/.cvsignore
@@ -15,6 +15,4 @@ libgnome-2.0.pc
test-libgnome
libgnome.defs
libgnometypebuiltins.h
-libgnometypebuiltins_evals.c
-libgnometypebuiltins_ids.c
-libgnometypebuiltins_vars.c
+libgnometypebuiltins.c
diff --git a/libgnome/ChangeLog b/libgnome/ChangeLog
index 636c105..e545034 100644
--- a/libgnome/ChangeLog
+++ b/libgnome/ChangeLog
@@ -1,5 +1,16 @@
2001-04-29 Martin Baulig <baulig suse de>
+ * Makefile.am: Use the new glib-mkenums instead of our own
+ gnome-makeenums.pl and gnome-maketypes.awk.
+
+ * libgnometypebuiltins.[ch]: New generated files; provide a
+ type installation routine for each enum and flags type.
+
+ * gnome-program.c, libgnomeP.h (libgnome_type_init): This
+ function no longer exists.
+
+2001-04-29 Martin Baulig <baulig suse de>
+
* libgnome-init.[ch]
(GNOME_PARAM_DESKTOP_CONFIG_DATABASE): New property.
(GNOME_PARAM_DESKTOP_CONFIG_MONIKER): Likewise.
diff --git a/libgnome/Makefile.am b/libgnome/Makefile.am
index b4c84c3..194969e 100644
--- a/libgnome/Makefile.am
+++ b/libgnome/Makefile.am
@@ -4,9 +4,6 @@
# Targets
#
-GNOME_MAKEENUMS = $(top_srcdir)/tools/gnome-makeenums.pl
-GNOME_MAKETYPES = $(top_builddir)/tools/gnome-maketypes.awk
-
LIB_VERSION=0:0:0
LIB_VERSION_NUM=0.0.0
@@ -38,6 +35,7 @@ INCLUDES = \
-DG_LOG_DOMAIN=\"Gnome\"
libgnome_2_la_SOURCES = \
+ $(BUILT_SOURCES) \
gnome-program.c \
gnome-config.c \
gnome-ditem.c \
@@ -52,8 +50,7 @@ libgnome_2_la_SOURCES = \
gnome-util.c \
gnome-paper.c \
gnome-preferences.c \
- libgnome-init.c \
- libgnometypes.c
+ libgnome-init.c
libgnome_headers = \
gnome-program.h \
@@ -81,36 +78,58 @@ noinst_HEADERS = \
gnome-triggersP.h \
libgnomeP.h
-# generate libgnome.defs file from libgnome-boxed.defs and *.h
-libgnome.defs: $(GNOME_MAKEENUMS) libgnome-boxed.defs $(libgnome_headers)
- cd $(srcdir) \
- && $(GNOME_MAKEENUMS) defs $(libgnome_headers) > gd.tmp \
- && cat libgnome-boxed.defs >> gd.tmp \
- && mv gd.tmp libgnome.defs
-
-# generate type identifier header (GTK_TYPE_WIDGET_FLAGS)
-libgnometypebuiltins.h: libgnome.defs $(GNOME_MAKETYPES)
+# all autogenerated files need to be generated in the srcdir,
+# so old versions get remade and are not confused with newer
+# versions in the build dir. thus a development setup requires
+# srcdir to be writable, passing --disable-rebuilds to
+# ../configure will supress all autogeneration rules.
+$(srcdir)/stamp-libgnome.defs: @REBUILD@ Makefile.am libgnome.defs libgnome-boxed.defs $(libgnome_headers)
cd $(srcdir) \
- && LC_COLLATE=C $(GNOME_MAKETYPES) libgnome.defs macros > gtb.tmp \
- && mv gtb.tmp libgnometypebuiltins.h
-
-# generate type identifier variables (GTK_TYPE_WIDGET_FLAGS)
-libgnometypebuiltins_vars.c: libgnome.defs $(GNOME_MAKETYPES)
+ && glib-mkenums \
+ --comments ";; @comment@" \
+ --fprod "; enumerations from \"@filename \"\n " \
+ --vhead "(define- type@ @EnumName@" \
+ --vprod " (@valuenick@ @VALUENAME@)" \
+ --vtail ")" \
+ $(libgnome_headers) > xgen-gdef \
+ && cat libgnome-boxed.defs >> xgen-gdef \
+ && (cmp -s xgen-gdef libgnome.defs || cp xgen-gdef libgnome.defs) \
+ && rm -f xgen-gdef \
+ && echo timestamp > $(@F)
+
+$(srcdir)/libgnometypebuiltins.c: @REBUILD@ Makefile.am $(libgnome_headers)
cd $(srcdir) \
- && LC_COLLATE=C $(GNOME_MAKETYPES) libgnome.defs variables > gtbv.tmp \
- && mv gtbv.tmp libgnometypebuiltins_vars.c
-
-# generate type entries for type-id registration
-libgnometypebuiltins_ids.c: libgnome.defs $(GNOME_MAKETYPES)
- cd $(srcdir) \
- && LC_COLLATE=C $(GNOME_MAKETYPES) libgnome.defs entries > gtbi.tmp \
- && mv gtbi.tmp libgnometypebuiltins_ids.c
-
-# generate enum value arrays
-libgnometypebuiltins_evals.c: $(GNOME_MAKEENUMS) libgnome.defs
+ && glib-mkenums \
+ --fhead "#include <gobject/genums.h>\n" \
+ --fhead "#include \"libgnometypebuiltins.h\"\n\n" \
+ --fprod "\n/* enumerations from \"@filename \" */" \
+ --vhead "static const G Type@Value _ enum_name@_values[] = {" \
+ --vprod " { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
+ --vtail " { 0, NULL, NULL }\n};\n\n" \
+ --vtail "GType\n enum_name@_get_type (void)\n{\n" \
+ --vtail " static GType type = 0;\n\n" \
+ --vtail " if (!type)\n" \
+ --vtail " type = g_ type@_register_static (\"@EnumName \", _ enum_name@_values);\n\n" \
+ --vtail " return type;\n}\n\n" \
+ $(libgnome_headers) > xgen-gtbec \
+ && cp xgen-gtbec $(@F) \
+ && rm -f xgen-gtbec
+
+$(srcdir)/libgnometypebuiltins.h: @REBUILD@ Makefile.am $(libgnome_headers)
cd $(srcdir) \
- && $(GNOME_MAKEENUMS) arrays $(libgnome_headers) > gtbe.tmp \
- && mv gtbe.tmp libgnometypebuiltins_evals.c
+ && glib-mkenums \
+ --fhead "#ifndef __LIBGNOMETYPEBUILTINS_H__\n" \
+ --fhead "#define __LIBGNOMETYPEBUILTINS_H__ 1\n\n" \
+ --fhead "#include <libgnome/libgnome.h>\n\n" \
+ --fhead "G_BEGIN_DECLS\n\n" \
+ --ftail "G_END_DECLS\n\n" \
+ --ftail "#endif /* __LIBGNOMETYPEBUILTINS_H__ */\n" \
+ --fprod "\n/* --- @filename@ --- */" \
+ --eprod "#define GNOME_TYPE_ ENUMSHORT@ @enum_name _get_type()\n" \
+ --eprod "GType @enum_name _get_type (void);\n" \
+ $(libgnome_headers) > xgen-gth \
+ && cp xgen-gth $(@F) \
+ && rm -f xgen-gth
EXTRA_DIST = \
parse-path.cP \
@@ -118,9 +137,7 @@ EXTRA_DIST = \
BUILT_SOURCES = \
libgnometypebuiltins.h \
- libgnometypebuiltins_evals.c \
- libgnometypebuiltins_ids.c \
- libgnometypebuiltins_vars.c
+ libgnometypebuiltins.c
#just to be sure, add an explicit dependency
gnome-config.o: parse-path.cP
diff --git a/libgnome/gnome-program.c b/libgnome/gnome-program.c
index 2c318ee..2dfb8c2 100644
--- a/libgnome/gnome-program.c
+++ b/libgnome/gnome-program.c
@@ -1229,7 +1229,7 @@ gnome_program_init (const char *app_id, const char *app_version,
GnomeProgram *program;
va_list args;
- libgnome_type_init ();
+ g_type_init (G_TYPE_DEBUG_NONE);
va_start(args, first_property_name);
program = gnome_program_initv (GNOME_TYPE_PROGRAM,
@@ -1250,7 +1250,7 @@ gnome_program_initv (GType type,
GnomeProgram *program;
int i;
- libgnome_type_init ();
+ g_type_init (G_TYPE_DEBUG_NONE);
if (!program_initialized) {
GnomeProgramClass *klass;
diff --git a/libgnome/libgnomeP.h b/libgnome/libgnomeP.h
index fc9d3d8..b471102 100644
--- a/libgnome/libgnomeP.h
+++ b/libgnome/libgnomeP.h
@@ -34,6 +34,4 @@
#define PATH_SEP '/'
#define PATH_SEP_STR "/"
-void libgnome_type_init (void);
-
#endif /* LIBGNOMEP_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]