diff --git a/.gitignore b/.gitignore index 46f6f980451fa1f4e307bbaefaca5caccc913aaf..85a417112d765c3cebfd97a9d61f314ce26a96bf 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,6 @@ Makefile.in # libvirt related ignores /build/ /ci/scratch/ -/src/hyperv/*.generated.* /src/locking/lock_daemon_dispatch_stubs.h /src/logging/log_daemon_dispatch_stubs.h /src/lxc/lxc_controller_dispatch.h diff --git a/src/hyperv/Makefile.inc.am b/src/hyperv/Makefile.inc.am index 6728b39c908ce04f6d7451bfc96834975f45be79..79e94d09bb79a7d20917bc2eddf55a052ba9a141 100644 --- a/src/hyperv/Makefile.inc.am +++ b/src/hyperv/Makefile.inc.am @@ -41,8 +41,8 @@ $(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP) $(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \ $(srcdir)/hyperv/hyperv_wmi_generator.py - $(AM_V_GEN)srcdir=$(srcdir) $(RUNUTF8) $(PYTHON) \ - $(srcdir)/hyperv/hyperv_wmi_generator.py \ + $(AM_V_GEN) $(RUNUTF8) $(PYTHON) \ + $(srcdir)/hyperv/hyperv_wmi_generator.py $(srcdir) $(builddir) \ && touch $@ MAINTAINERCLEANFILES += $(HYPERV_DRIVER_GENERATED) $(HYPERV_GENERATED_STAMP) @@ -53,6 +53,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la libvirt_driver_hyperv_la_CFLAGS = \ $(OPENWSMAN_CFLAGS) \ -I$(srcdir)/conf \ + -I$(builddir)/hyperv \ $(AM_CFLAGS) \ $(NULL) libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS) diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py index a9ece0ff00dac06edc39c1bae71415de99c8ee79..c3cd39cc766089cff0fcff58ff7bd90bf0f41b87 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -454,12 +454,11 @@ def parse_class(block): def main(): - if "srcdir" in os.environ: - input_filename = os.path.join(os.environ["srcdir"], "hyperv/hyperv_wmi_generator.input") - output_dirname = os.path.join(os.environ["srcdir"], "hyperv") - else: - input_filename = os.path.join(os.getcwd(), "hyperv_wmi_generator.input") - output_dirname = os.getcwd() + if len(sys.argv) != 3: + report_error("usage: %s srcdir builddir" % sys.argv[0]) + + input_filename = os.path.join(sys.argv[1], "hyperv", "hyperv_wmi_generator.input") + output_dirname = os.path.join(sys.argv[2], "hyperv") classes_typedef = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.typedef")) classes_header = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.h"))