import os
import sys
-path = os.path.join('@libdir@', 'gdbus-2.0', 'codegen')
-sys.path.insert(0, path)
+srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)
-from codegen_main import codegen_main
+if srcdir is not None:
+ path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
+else:
+ path = os.path.join('@libdir@', 'gdbus-2.0')
-sys.exit(codegen_main())
+sys.path.insert(0, os.path.abspath(path))
+from codegen import codegen_main
+
+sys.exit(codegen_main.codegen_main())
if OS_UNIX
gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml
- $(AM_V_GEN) UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
- PYTHONPATH=$(top_srcdir)/gio/gdbus-2.0 \
+ $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+ UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
--interface-prefix org.project. \
--generate-c-code gdbus-test-codegen-generated \
$(NULL)
$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml
- $(AM_V_GEN) UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
- PYTHONPATH=$(top_srcdir)/gio/gdbus-2.0 \
+ $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+ UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
--interface-prefix org.gtk.GDBus.Example.ObjectManager. \
--c-namespace Example \