Re: [kvm-unit-tests PATCH v2 1/9] configure: make it run-able from outside source tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-05-12 17:39+0100, Alex Bennée:
> This is a first step to enabling out-of-tree builds for
> kvm-unit-tests. When you invoke configure like this:
> 
>   ../tree.git/configure [args]
> 
> It will detect we the case and:
> 
>   - link ../tree.git/Makefile to the build-dir
>   - link ../tree.git/$(arch) and test scripts
>   - link ../tree.git/run_tests.sh
>   - ensure lib is created with a correct lib/asm
>   - set SRCDIR in the config.mk
> 
> Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx>
> 
> ---
> v2
>   - ln -sf more directory structure
>   - quotes around places where $srcdir is used
>   - dropped pointless {}s
> ---
> diff --git a/configure b/configure
> +srcdir=$(cd "$(dirname "$0")"; pwd)
> +# Are we in a separate build tree? If so, link the Makefile
> +# and shared stuff so that 'make' and run_tests.sh work.
> +if test ! -e Makefile; then
> +    echo "linking Makefile..."
> +    ln -s "$srcdir/Makefile" .
> +
> +    echo "linking tests..."
> +    mkdir -p $testdir
> +    ln -sf "$srcdir/$testdir/run" $testdir/
> +    ln -sf "$srcdir/$testdir/unittests.cfg" $testdir/
> +    ln -sf "$srcdir/run_tests.sh"
> +
> +    echo "linking scripts..."
> +    ln -sf "$srcdir/scripts"
> +fi
> +
>  
>  # create the config
>  cat <<EOF > config.mak
> +SRCDIR=$srcdir

Whitespace in $srcdir is going to break the build.  I think that we
cannot prevent that by escaping as `make` is notoriously bad in that
regard.  Aborting sounds better and maybe something like this could
work:

  ln -sf "$srcdir" srcdir
  srcdir=srcdir

I'm ok with this version if the solution would not be simple. :)




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux