[Top][All Lists]

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

Re: Bad pwd detection in generated 'configure'

From: Pavel Raiskup
Subject: Re: Bad pwd detection in generated 'configure'
Date: Tue, 14 May 2013 13:01:52 +0200
User-agent: KMail/4.10.2 (Linux/3.8.11-200.fc18.x86_64; KDE/4.10.2; x86_64; ; )

> > 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 still, e.g. $readlink could fall-back to empty operation if no
  'readlink' binary is found.

- I was also thinking about `pwd -P`, or `cd -P`.  These seem to be
  defined in POSIX.

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

Do you think that it is worth to fix this for the symlink case?  I did not
described it properly before:

  $ ls /tmp/ -l | grep source
  drwxrwxr-x.  2 user user   40 May 14 12:47 source
  lrwxrwxrwx.  1 user user    6 May 14 12:47 source_link -> source
  $ cd /tmp/source_link
  $ /tmp/source/configure

In such that case, the same issue occurs .. configure fails and the
quite unpleasant and hard to recover situation (but unlikely, though).

If we found a portable enough solution, it would be nice to have it fixed,
imo.  I could give it a and write a patch if you don't want to (if it was
considered as a bit useful).

reply via email to

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