bug-autoconf
[Top][All Lists]
Advanced

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

Bad pwd detection in generated 'configure'


From: Pavel Raiskup
Subject: Bad pwd detection in generated 'configure'
Date: Mon, 13 May 2013 15:29:06 +0200
User-agent: KMail/4.10.2 (Linux/3.8.11-200.fc18.x86_64; KDE/4.10.2; x86_64; ; )

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

In case of Bash, there we are hitting a bug (or feature? .. ksh also has
this one..):

  $ cd /tmp
  $ PWD=`pwd`/ sh -c pwd
  /tmp/

Note the _trailing slash_.  In this case, the $ac_pwd in config.status is
badly set and the comparison with $srcdir (comming from _AC_INIT_DIRCHECK,
comment "# When building in place, set srcdir=.") fails.

That is IMO low prio.  But there is still problem with the situation we
have symlinked the directory from somewhere.  Consider this:

  $ ls /tmp -l | grep source
  drwxrwxr-x. 2 praiskup praiskup   40 May 13 15:14 source
  lrwxrwxrwx. 1 praiskup praiskup    6 May 13 15:15 source_link -> source
  $ cd /tmp/source_link && ./configure

In this case, the detection also fails.

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
    srcdir=.
  fi

-------------------

Note that nasty things happen when there is the
'AC_CONFIG_LINKS(TESTFILE:TESTFILE)' construct used and the $srcdir is
badly detected.

Pavel




reply via email to

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