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