[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] configure: make source tree build more robust
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] configure: make source tree build more robust |
Date: |
Mon, 28 Apr 2014 08:52:33 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 04/28/2014 06:21 AM, Michael S. Tsirkin wrote:
> When source directory can be arrived at by two paths,
> configure might misdetect an out of tree build.
> The simplest way to trigger the problem is running
> configure using a full path. E.g. (<firstpath> refers to qemu source
> tree):
> ln -s <firstpath> <secondpath>
> cd <firstpath>
> <secondpath>/configure
>
> A more practical way is when make runs configure automatically:
> +# running configure in the source tree? create a temporary file
> +# under pwd, check for it in source tree. Use .o suffix so that
> +# make clean will blow it away if
> +canary_path=`pwd`
> +canary_fullpath=`mktemp "$canary_path/canary.XXXXXXXXXX.o"`
mktemp is non-POSIX, and not necessarily portable. In particular, on
FreeBSD, 'mktemp a.XXXX.b' generates the file 'a.XXXX.b', with no
randomness introduced, which therefore makes it a predictable file name
and defeats the purpose of using mktemp.
Paolo's suggestion of using ./configure as the canary seems more reliable.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature