• E
    maint: detect VPATH builds when checking for gnulib update · 3cbd3b8e
    Eric Blake 提交于
    I accidentally typed 'make' in the srcdir of a VPATH build, and
    was surprised to see this:
    
    $ make
    /bin/sh: s/^[ +-]//;s/ .*//: No such file or directory
    INFO: gnulib update required; running ./autogen.sh first
    make: -n: Command not found
    ./autogen.sh
    I am going to run ./configure with no arguments - if you wish
    to pass any to it, please specify them on the ./autogen.sh command line.
    running bootstrap...
    ./bootstrap: Bootstrapping from checked-out libvirt sources...
    ./bootstrap: getting gnulib files...
    
    Oops - we're trying to execute some fairly bogus command names,
    and then trying to configure in-tree (which breaks all existing
    VPATH builds, since automake refuses to do a VPATH build if it
    detects an in-tree configure).  The third line (executing "-n")
    is fixed by updating to the latest gnulib; the rest of the problem
    is fixed by copying the same filtering in our cfg.mk as what
    gnulib just added, so that we avoid any $(shell) invocations which
    in turn depend on variables that are only populated by a working
    Makefile.  With that in place, we are back to the much nicer:
    
    $ make
    There seems to be no Makefile in this directory.
    You must run ./configure before running 'make'.
    make: *** [abort-due-to-no-makefile] Error 1
    
    Additionally, although harder to see - there was a trailing space in
    the message warning us that autogen would run an in-tree configure.
    
    * .gnulib: Update to latest, in part for maint.mk improvements.
    * cfg.mk (_update_required): Don't check for update in
    unconfigured directory.
    * autogen.sh (no_git): Drop trailing space.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    3cbd3b8e
cfg.mk 41.1 KB