On 3/23/20 8:32 AM, Stefan Hajnoczi wrote:
We could also make configure actively warn if used in
the source tree.
This was discussed before. I think instead of annoying people with a
warning, rather configure should be changed to create a build dir if run
from source and have a Makefile in top dir that runs make -C builddir so
people don't have to care about this or change their ways and can continue
to run configure && make from source dir but you don't have to support
in-tree build. Then you can deprecate in-tree builds but supporting only
out-of-tree without this convenience would not just unnecessarily annoy
those who prefer working in a single tree but people (and apparently some
tools) expect sources to build with usual configure; make; make install so
that should be the minimum to support.
Yes, please! I use in-tree builds and find it tedious to cd into a
build dir manually.
Also, many build scripts (packaging, etc) we'll break if we simply
remove in-tree builds. I think make && make install should continue to
work.
Here's what I'm using locally to let my finger memory of building
in-tree work in spite of having done 'mkdir build; cd build;
../configure ...'. We'd still need glue code in configure itself to
detect when it is being invoked in-tree to create a subdir build/ and
such a forwarding file, but if we want in-tree to FEEL like it works
(even though it uses a build dir under the hood), it's certainly worth
considering.
$ cat GNUmakefile
# Hack for redirecting while reminding myself to use distinct builddir
ifeq ($(MAKECMDGOALS),)
recurse: all
endif
.NOTPARALLEL: %
%: force
@echo 'changing dir to build for $(MAKE) "$(MAKECMDGOALS)"...'
@$(MAKE) -C build -f Makefile $(MAKECMDGOALS)
force: ;
.PHONY: force
GNUmakefile: ;
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org