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
signature.asc
Description: OpenPGP digital signature