You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 07:26:36 UTC

[buildstream] 01/03: buildstream/plugins/elements/autotools.yaml: Make builds out of tree by default

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch jjardon/integration-test
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 141e8dbf465685c49285e6cee654a5aa448ae978
Author: Javier Jardón <jj...@gnome.org>
AuthorDate: Wed Dec 6 16:29:16 2017 +0000

    buildstream/plugins/elements/autotools.yaml: Make builds out of tree by default
    
    Similar to what cmake and meson do
---
 buildstream/plugins/elements/autotools.yaml | 12 ++++++++----
 tests/variables/variables.py                |  4 ++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/buildstream/plugins/elements/autotools.yaml b/buildstream/plugins/elements/autotools.yaml
index 6a16648..dfa4679 100644
--- a/buildstream/plugins/elements/autotools.yaml
+++ b/buildstream/plugins/elements/autotools.yaml
@@ -2,6 +2,8 @@
 
 variables:
 
+  build-dir: _builddir
+
   autogen: |
     export NOCONFIGURE=1;
     if [ -e autogen ]; then ./autogen;
@@ -11,7 +13,7 @@ variables:
     else autoreconf -ivf;
     fi
 
-  conf-cmd: ./configure
+  conf-cmd: configure
   conf-extra: ''
   conf-global: ''
   conf-local: ''
@@ -33,10 +35,12 @@ variables:
 
   configure: |
 
-    %{conf-cmd} %{conf-args}
+    mkdir %{build-dir}
+    cd %{build-dir}
+    ../%{conf-cmd} %{conf-args}
 
-  make: make
-  make-install: make -j1 DESTDIR="%{install-root}" install
+  make: make -C %{build-dir}
+  make-install: make -j1 -C %{build-dir} DESTDIR="%{install-root}" install
 
   # Set this if the sources cannot handle parallelization.
   #
diff --git a/tests/variables/variables.py b/tests/variables/variables.py
index 47b1ff9..fa8ddb6 100644
--- a/tests/variables/variables.py
+++ b/tests/variables/variables.py
@@ -43,7 +43,7 @@ def assert_command(datafiles, tmpdir, target, command, expected):
 ###############################################################
 @pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions")
 @pytest.mark.parametrize("target,command,expected", [
-    ('autotools.bst', 'install-commands', "make -j1 DESTDIR=\"/buildstream/install\" install"),
+    ('autotools.bst', 'install-commands', "make -j1 -C _builddir DESTDIR=\"/buildstream/install\" install"),
     ('cmake.bst', 'configure-commands',
      "cmake -B_builddir -H. -DCMAKE_INSTALL_PREFIX:PATH=\"/usr\" \\\n" +
      "-DCMAKE_INSTALL_LIBDIR=lib"),
@@ -64,7 +64,7 @@ def test_defaults(datafiles, tmpdir, target, command, expected):
 ################################################################
 @pytest.mark.skipif(not HAVE_ROOT, reason="requires root permissions")
 @pytest.mark.parametrize("target,command,expected", [
-    ('autotools.bst', 'install-commands', "make -j1 DESTDIR=\"/custom/install/root\" install"),
+    ('autotools.bst', 'install-commands', "make -j1 -C _builddir DESTDIR=\"/custom/install/root\" install"),
     ('cmake.bst', 'configure-commands',
      "cmake -B_builddir -H. -DCMAKE_INSTALL_PREFIX:PATH=\"/opt\" \\\n" +
      "-DCMAKE_INSTALL_LIBDIR=lib"),