[PATCH v4 13/20] [ACKED] src: esx: generate source files into build directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>
Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---

Notes:
    Changes in v2:
        - remove entries from .gitignore

 .gitignore                  |  1 -
 src/esx/Makefile.inc.am     |  5 +++--
 src/esx/esx_vi_generator.py | 11 ++++-------
 tests/Makefile.am           |  3 +++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8989b3e3e3..46f6f98045 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,7 +41,6 @@ Makefile.in
 # libvirt related ignores
 /build/
 /ci/scratch/
-/src/esx/*.generated.*
 /src/hyperv/*.generated.*
 /src/locking/lock_daemon_dispatch_stubs.h
 /src/logging/log_daemon_dispatch_stubs.h
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 014d0ddd39..9d9c582e42 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.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux