Tizen 2.1 base
[platform/upstream/glib2.0.git] / gio / gdbus-2.0 / codegen / gdbus-codegen.in
1 #!/usr/bin/env python
2
3 # GDBus - GLib D-Bus Library
4 #
5 # Copyright (C) 2008-2011 Red Hat, Inc.
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General
18 # Public License along with this library; if not, write to the
19 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 # Boston, MA 02111-1307, USA.
21 #
22 # Author: David Zeuthen <davidz@redhat.com>
23
24
25 import os
26 import sys
27
28 srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)
29
30 if srcdir is not None:
31     path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
32 elif os.name == 'nt':
33     # Makes gdbus-codegen 'relocatable' at runtime on Windows.
34     path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gdbus-2.0')
35 else:
36     path = os.path.join('@libdir@', 'gdbus-2.0')
37
38 sys.path.insert(0, os.path.abspath(path))
39 from codegen import codegen_main
40
41 sys.exit(codegen_main.codegen_main())