summaryrefslogtreecommitdiff
path: root/gobject/glib-mkenums.in
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-07-17 10:54:28 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-07-17 11:05:07 +0100
commit3c03cc8f68b5d81c7b47423b1a3be3b8c9197d1c (patch)
tree179d9c3604a096c82864cd879413b48d6aad4de0 /gobject/glib-mkenums.in
parent7ee050dc4bf5187842f656889017414aa1c9a729 (diff)
downloadglib-3c03cc8f68b5d81c7b47423b1a3be3b8c9197d1c.tar.gz
meson: Simplify the use of built tools
The Meson build has fallen a bit behind the Autotools one, when it comes to the internally built tools like glib-mkenums and glib-genmarshals. We don't need to generate gmarshal.strings any more, and since the glib-genmarshal tool is now written in Python it can also be used when cross-compiling, and without indirection, just like we use glib-mkenums. We can also coalesce various rules into a simple array iteration, with minimal changes to glib-mkenums, thus making the build a bit more resilient and without unnecessary duplication.
Diffstat (limited to 'gobject/glib-mkenums.in')
-rwxr-xr-xgobject/glib-mkenums.in21
1 files changed, 9 insertions, 12 deletions
diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
index 62425611e..9ae036bf6 100755
--- a/gobject/glib-mkenums.in
+++ b/gobject/glib-mkenums.in
@@ -15,6 +15,13 @@ import re
import sys
import tempfile
+VERSION_STR = '''glib-mkenums version @VERSION@
+glib-genmarshal comes with ABSOLUTELY NO WARRANTY.
+You may redistribute copies of glib-genmarshal under the terms of
+the GNU General Public License which can be found in the
+GLib source package. Sources, examples and contact
+information are available at http://www.gtk.org'''
+
output_stream = sys.stdout
# pylint: disable=too-few-public-methods
@@ -64,8 +71,6 @@ def write_output(output):
global output_stream
print(output, file=output_stream)
-version = '@GLIB_VERSION@'
-
# glib-mkenums.py
# Information about the current enumeration
flags = False # Is enumeration a bitmask?
@@ -190,15 +195,6 @@ def parse_entries(file, file_name):
sys.exit("Failed to parse %s." % file_name)
return False
-def print_version():
- print("glib-mkenums version glib-" + version)
- print("glib-mkenums comes with ABSOLUTELY NO WARRANTY.")
- print("You may redistribute copies of glib-mkenums under the terms of")
- print("the GNU General Public License which can be found in the")
- print("GLib source package. Sources, examples and contact")
- print("information are available at http://www.gtk.org")
- sys.exit(0)
-
help_epilog = '''Production text substitutions:
\u0040EnumName\u0040 PrefixTheXEnum
\u0040enum_name\u0040 prefix_the_xenum
@@ -306,7 +302,8 @@ parser.add_argument('args', nargs='*')
options = parser.parse_args()
if options.version:
- print_version()
+ print(VERSION_STR)
+ sys.exit(0)
def unescape_cmdline_args(arg):
arg = arg.replace('\\n', '\n')