From dc7f3206a1919786a831286b7de2759737203b1b Mon Sep 17 00:00:00 2001 From: Pawel Piatek Date: Mon, 10 Aug 2020 15:52:51 +0200 Subject: [PATCH] script/vagrant: split into functions - clear cflags Signed-off-by: Pawel Piatek Change-Id: I8842fda241403d7bfc0ec0da144848777d44921a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3714 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Maciej Wawryk Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- scripts/vagrant/Vagrantfile | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/vagrant/Vagrantfile b/scripts/vagrant/Vagrantfile index 47a7161cf..c44d51575 100644 --- a/scripts/vagrant/Vagrantfile +++ b/scripts/vagrant/Vagrantfile @@ -113,6 +113,17 @@ def make_spdk_local_copy_of_nfs(config,distro) config.vm.provision "shell", inline: $spdk_repo_cmd end +def clear_cflags(config) + $clearcflags_cmd = <<-SCRIPT + echo "export CFLAGS=" >> /etc/profile.d/clearcflags.sh + echo "export CFFLAGS=" >> /etc/profile.d/clearcflags.sh + echo "export CXXFLAGS=" >> /etc/profile.d/clearcflags.sh + echo "export FFLAGS=" >> /etc/profile.d/clearcflags.sh + echo "export THEANO_FLAGS=" >> /etc/profile.d/clearcflags.sh + SCRIPT + config.vm.provision "shell", inline: $clearcflags_cmd, run: "always" +end + Vagrant.configure(2) do |config| # Pick the right distro and bootstrap, default is fedora30 @@ -178,6 +189,9 @@ Vagrant.configure(2) do |config| # use http proxy if avaiable setup_proxy(config, distro) + # Clear CFLAGS in clear linux + clear_cflags(config) if distro == 'clearlinux' + # freebsd and clearlinux boxes in order to have spdk sources synced from # host properly will use NFS with "ro" option enabled to prevent changes # on host filesystem. @@ -297,16 +311,4 @@ Vagrant.configure(2) do |config| setup.args = ["-u", "-i"] end end - - # Clear CFLAGS in clear linux - if distro == "clearlinux" - $clearcflags = <<-SCRIPT - echo "export CFLAGS=" >> /etc/profile.d/clearcflags.sh - echo "export CFFLAGS=" >> /etc/profile.d/clearcflags.sh - echo "export CXXFLAGS=" >> /etc/profile.d/clearcflags.sh - echo "export FFLAGS=" >> /etc/profile.d/clearcflags.sh - echo "export THEANO_FLAGS=" >> /etc/profile.d/clearcflags.sh - SCRIPT - config.vm.provision "shell", inline: $clearcflags, run: "always" - end end