Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/esx/Makefile.inc.am | 5 +++--
src/esx/esx_vi_generator.py | 11 ++++-------
tests/Makefile.am | 3 +++
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am
index 3dab05d71c..7ba9fd1758 100644
--- a/src/esx/Makefile.inc.am
+++ b/src/esx/Makefile.inc.am
@@ -63,8 +63,8 @@ $(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)
$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
$(srcdir)/esx/esx_vi_generator.py
- $(AM_V_GEN)srcdir=$(srcdir) $(RUNUTF8) $(PYTHON) \
- $(srcdir)/esx/esx_vi_generator.py && touch $@
+ $(AM_V_GEN) $(RUNUTF8) $(PYTHON) \
+ $(srcdir)/esx/esx_vi_generator.py $(srcdir) $(builddir) && touch $@
MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)
@@ -81,6 +81,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
libvirt_driver_esx_la_CFLAGS = \
$(CURL_CFLAGS) \
-I$(srcdir)/conf \
+ -I$(builddir)/esx \
-I$(srcdir)/vmx \
$(AM_CFLAGS) \
$(NULL)
diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py
index 28d440a6df..c77de6e60c 100755
--- a/src/esx/esx_vi_generator.py
+++ b/src/esx/esx_vi_generator.py
@@ -1379,14 +1379,11 @@ additional_object_features = {
removed_object_features = {}
+if len(sys.argv) != 3:
+ report_error("usage: %s srcdir builddir" % sys.argv[0])
-
-if "srcdir" in os.environ:
- input_filename = os.path.join(os.environ["srcdir"],
"esx/esx_vi_generator.input")
- output_dirname = os.path.join(os.environ["srcdir"], "esx")
-else:
- input_filename = os.path.join(os.getcwd(), "esx_vi_generator.input")
- output_dirname = os.getcwd()
+input_filename = os.path.join(sys.argv[1], "esx/esx_vi_generator.input")
+output_dirname = os.path.join(sys.argv[2], "esx")
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9ae456c268..d549e38e18 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -756,6 +756,9 @@ esxutilstest_SOURCES = \
esxutilstest.c \
testutils.c testutils.h
esxutilstest_LDADD = $(LDADDS)
+esxutilstest_CFLAGS = \
+ -I$(top_builddir)/src/esx \
+ $(AM_CFLAGS)
else ! WITH_ESX
EXTRA_DIST += esxutilstest.c
endif ! WITH_ESX
--
2.21.0