atk/Makefile.am: Update Generation of Enum Sources
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 24 Apr 2014 10:48:32 +0000 (18:48 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 25 Apr 2014 00:27:42 +0000 (08:27 +0800)
This makes sure that the generated enumeration header include
atk/atkversion.h, and decorate the symbols there with ATK_AVAILABLE_IN_ALL.
Also, make sure that the generated enumeration source file includes
config.h before including atk.h.

https://bugzilla.gnome.org/show_bug.cgi?id=728031

atk/Makefile.am

index c049470..354c0e2 100644 (file)
@@ -135,9 +135,9 @@ atk-enum-types.h: s-enum-types-h
        @true
 s-enum-types-h: @REBUILD@ $(atk_headers) Makefile
        $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
-                       --fhead "#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)\n#error \"Only <atk/atk.h> can be included directly.\"\n#endif\n\n#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+                       --fhead "#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)\n#error \"Only <atk/atk.h> can be included directly.\"\n#endif\n\n#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include <atk/atkversion.h>\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
                        --fprod "/* enumerations from \"@filename@\" */\n" \
-                       --vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
+                       --vhead "ATK_AVAILABLE_IN_ALL\nGType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
                        --ftail "G_END_DECLS\n\n#endif /* __ATK_ENUM_TYPES_H__ */" \
                $(atk_headers) ) > tmp-atk-enum-types.h \
        && (cmp -s tmp-atk-enum-types.h atk-enum-types.h || cp tmp-atk-enum-types.h atk-enum-types.h ) \
@@ -148,7 +148,7 @@ atk-enum-types.c: s-enum-types-c
        @true
 s-enum-types-c: @REBUILD@ $(atk_headers) Makefile
        $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
-                       --fhead "#include <atk.h>" \
+                       --fhead "#include \"config.h\"\n\n#include <atk.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@\" }," \