[Swan-dev] Append .kvm to OBJDIR when a KVM build

Andrew Cagney andrew.cagney at gmail.com
Thu Mar 12 05:26:27 EET 2015


On 11 March 2015 at 15:03, Antony Antony <antony at phenome.org> wrote:

> On Wed, Mar 11, 2015 at 11:46:12AM -0400, Andrew Cagney wrote:
> > Another of my local tweaks.
> >
> > Currently,  a VM build (swan-build) unhelpfully deletes all OBJ.linux.*
> > directories.  This, of course, includes any native build you've been
> > doing.  I'd like to tweak things so that:
> >
> > - on the VM OBJDIR has .kvm (.vm?) appended so VM and host builds use
> > different directories
> > - swan-build, which should only be run on a VM,  deletes OBJ.linix*.vm
> > (yes it should rely on "make distclean" but that's another story)
> >
> > Since the VM has its own private build directory this also gets us that
> bit
> > closer to not even needing the delete.
>
> Probably things got better recently. A couple of weeks ago, deleting
> OBJDIR inside VM was a safe strategy.
>

>
> > I've appended the key part of the patch.  The magic grep line matches
> what
> > virt-what does.
> >
> > Andrew
> >
> > diff --git a/mk/objdir.mk b/mk/objdir.mk
> > index f86c9db..a581319 100644
> > --- a/mk/objdir.mk
> > +++ b/mk/objdir.mk
> > @@ -56,4 +56,8 @@ BUILDENV:=$(shell uname -s | tr 'A-Z' 'a-z' | sed -e
> > 's/\(.*\)-.*/\1/')
> >  endif
> >  export BUILDENV
> >
> > -OBJDIR?=OBJ.${BUILDENV}.${ARCH}
> > +ifeq ($(origin OBJDIR_KVM),undefined)
> > +OBJDIR_KVM:=$(shell grep -i QEMU /proc/cpuinfo >/dev/null 2>&1 && echo
> > .kvm)
> > +endif
> > +
> > +OBJDIR?=OBJ.${BUILDENV}.${ARCH}$(OBJDIR_KVM)
>
> If someone build on kvm, not running full testsuite, just building to
> install, suddenly directory will have OBJDIR_KVM. That does not sound
> convenient to me. This probably belong to mk/testing.mk or something. I
> am not sure if it is good idea for the upstream.
>
>
I'm not following.  Why is appending .vm a problem?
It is certainly shorter than $(uname -r) "3.18.7-200.fc21.x86_64" which
should also be added.

Why modobj isn't under $(OBJDIR) I don't know, perhaps it can be fixed?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20150311/d0e34e52/attachment.html>


More information about the Swan-dev mailing list