gdbus-codegen 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/python
  2. # GDBus - GLib D-Bus Library
  3. #
  4. # Copyright (C) 2008-2011 Red Hat, Inc.
  5. #
  6. # This library is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public
  8. # License as published by the Free Software Foundation; either
  9. # version 2 of the License, or (at your option) any later version.
  10. #
  11. # This library is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # Lesser General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Lesser General
  17. # Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # Author: David Zeuthen <davidz@redhat.com>
  20. import os
  21. import sys
  22. srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)
  23. if srcdir is not None:
  24. path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
  25. elif os.name == 'nt':
  26. # Makes gdbus-codegen 'relocatable' at runtime on Windows.
  27. path = os.path.join(os.path.dirname(__file__), '..', 'share', 'glib-2.0')
  28. else:
  29. path = os.path.join('/builds/community/qemu-stm32/sysroot-cross/share', 'glib-2.0')
  30. sys.path.insert(0, os.path.abspath(path))
  31. from codegen import codegen_main
  32. sys.exit(codegen_main.codegen_main())