bug-autoconf
[Top][All Lists]
Advanced

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

Re: Bad pwd detection in generated 'configure'


From: Eric Blake
Subject: Re: Bad pwd detection in generated 'configure'
Date: Mon, 13 May 2013 08:28:16 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 05/13/2013 07:29 AM, Pavel Raiskup wrote:
> Hello, currently, configure scripts are badly detecting whether the build
> is done "in place" (pwd == $srcdir).  One problem (spotted in RH bugzilla)
> is this:
> 
>   $ PWD=`pwd`/ ./configure

Hmm, we already strip trailing slashes from '--prefix=/path/to/dir/', so
maybe we should do likewise when inspecting $PWD.  On the other hand,
technically POSIX says that PWD will never have a trailing slash when
set by 'cd' operations, and that shells are permitted (but not required)
to forbid changing $PWD from values other than what the shell would set
it to via 'cd'.

> 
> Would there be possible to use something like this?  It would pretty
> easily work-around the issue:
> 
>   # When building in place, set srcdir=.
>  -if test "$ac_abs_confdir" = "$ac_pwd"; then
>  +if test "`$readlink -f $ac_abs_confdir`" = "`$readlink -f $ac_pwd`"; then

Sorry, but 'readlink' is not portable.

That said, if we can come up with a PORTABLE construct that checks
whether the current directory matches srcdir, with minimal subprocesses,
I'm not opposed to a patch.  But like you say, it's low enough priority
that I probably won't be writing such a patch, and even if future
autoconf is patched, you still have to deal with all existing configure
scripts that won't pick up that patch until they are re-autotooled with
newer autoconf.

Best may be just fixing your build environment to never try and set PWD,
since that is already a non-portable operation.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]