4 # gtk-doc - GTK DocBook documentation generator.
5 # Copyright (C) 1998 Damon Chaplin
6 # 2007-2016 Stefan Sauer
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 sys.path.append('@PYTHON_PACKAGE_DIR@')
28 from gtkdoc import common, config, scangobj
30 if __name__ == '__main__':
31 parser = argparse.ArgumentParser(
32 description='gtkdoc-rebase version %s - introspect g-objects' % config.version)
33 parser.add_argument('--version', action='version', version=config.version)
34 parser.add_argument('--module', required=True,
35 help='Name of the doc module being parsed')
36 parser.add_argument('--types', default='',
37 help='The name of the file to store the types in')
38 parser.add_argument('--type-init-func', default='',
39 help='The init function(s) to call instead of g_type_init()')
40 parser.add_argument('--query-child-properties', default='',
41 help='A function that returns a list of child properties for a class')
42 parser.add_argument('--output-dir', default='.',
43 help='The directory where the results are stored')
44 parser.add_argument('--cc', default='', help='The compiler to use')
45 parser.add_argument('--ld', default='', help='The linker to use')
46 parser.add_argument('--cflags', default='', help='Compiler flags')
47 parser.add_argument('--ldflags', default='', help='Linker flags')
48 parser.add_argument('--run', default='',
49 help='Command for running the scanner')
50 parser.add_argument('--verbose', action='store_true', default=False,
51 help='Print extra output while processing')
53 options = parser.parse_args()
55 if options.types == '':
56 options.types = os.path.join(options.output_dir, options.module + '.types')
59 options.cc = os.environ.get('CC', 'gcc')
61 options.ld = os.environ.get('LD', options.cc)
62 if not options.cflags:
63 options.cflags = os.environ.get('CFLAGS', '')
64 if not options.ldflags:
65 options.ldflags = os.environ.get('LDFLAGS', '')
67 options.run = os.environ.get('RUN', '')
69 common.setup_logging()
71 sys.exit(scangobj.run(options))