[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] configure: add support for psuedo-"in source tree" builds
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH] configure: add support for psuedo-"in source tree" builds |
Date: |
Thu, 20 Aug 2020 18:12:21 +0100 |
User-agent: |
Mutt/1.14.5 (2020-06-23) |
On Thu, Aug 20, 2020 at 06:10:34PM +0100, Peter Maydell wrote:
> On Thu, 20 Aug 2020 at 17:56, Daniel P. Berrangé <berrange@redhat.com> wrote:
> > Meson requires the build dir to be separate from the source tree. Many
> > people are used to just running "./configure && make" though and the
> > meson conversion breaks that.
> >
> > This introduces some backcompat support to make it appear as if an
> > "in source tree" build is being done, but with the the results in the
> > "build/" directory. This allows "./configure && make" to work as it
> > did historically, albeit with the output binaries staying under build/.
>
> > +if test "$PWD" == "$source_path"
> > +then
> > + echo "Using './build' as the directory for build output"
> > + rm -rf build
> > + mkdir -p build
>
> Can we put in a mollyguard here so we only blow away build/
> if we previously auto-created it? Something like
>
> if ! -e build || -e build/created-by-configure; then
> rm -rf build
> mkdir -p build
> touch build/created-by-configure
> else
> echo "some helpful error message here"
> fi
>
> (shell syntax probably wrong but you get the idea)
>
> My current setup has multiple build-directories like
> build/x86, build/clang, ... and I'd like a guard against
> configure blowing them all away if I accidentally run it
> from the source tree some day.
Sure, that makes sense.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|