[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoconf-2.53 .. -2.57: Spurious cd error messages
From: |
Akim Demaille |
Subject: |
Re: Autoconf-2.53 .. -2.57: Spurious cd error messages |
Date: |
Sat, 01 Mar 2003 13:37:18 +0100 |
User-agent: |
Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 |
Hi!
Sorry for the delays...
| (initially posted to address@hidden, which may or may not
| exist.)
|
| Hello,
|
| I have been wondering why `config.status' issues spurious error
| messages when creating links. The links are created correctly,
| though the script complains about cds to a nonexistent directory.
| IIRC, the error occured from 2.53 on. I have now fixed it in 2.57.
|
| To reproduce, try something like
|
| AC_CONFIG_LINKS(include/kernel/mp-arith.h:interfaces/gmp/mp-arith.h)
|
| in `configure.ac', with `include/kernel' not existing in the
| source tree. (It's for build-time links only.) Then use a build
| directory other than the source directory, and voila: It works, but
| complains such that doubts arise immediately.
Wouldn't you prefer the include/kernel directory to be made? That
makes more sense to me.
| What happens is that _AC_SRCPATHS figures out many paths which may
| or may not be needed, and in case of ac_srcdir and ac_abs_srcdir
| need not even exist. The expansion of _AC_SRCPATHS leads to the
| superfluous attempt to provide ac_abs_srcdir by using a combination
| of cd and pwd. This fails and produces the irritating error message.
|
| My solution is to simply add a 2>/dev/null. This means that if
| $ac_srcdir does not exist, then $ac_abs_srcdir will be empty.
| You may or may not like this; perhaps you'd want to construct a
| hypothetical value using just string concatenation instead of cd
| and pwd. However, such a value would not work when it is used,
| simply because the directory does not exist. (It would occasionally
| work with an mkdir, but you would not create dirs in the source tree,
| would you?)
Sorry, but the problem you present seems to be related to the build
hierarchy, not the source hierarchy.
| On the other hand, my approach has the potential for making real
| errors more harmful. If $ac_srcdir does not exist, and is used,
| this leads to an error message about a nonexisting directory.
| But if $ac_abs_srcdir is used instead, e.g. "$ac_abs_srcdir/file",
| the path prefix gets lost, leaving "/file", which may or may not lead
| to a missing file or a permission denial afterwards. In any case,
| unrelated files could get involved silently. Think about that.
| Perhaps you'd prefer the fallback to a string concatenation.
|
| Tested with "make check".
|
| Regards,
|
| Christian Cornelssen
|
| * lib/autoconf/status.m4 (_AC_SRCPATHS): Added 2>/dev/null
| for the case that $ac_srcdir does not exist.
|
| --- lib/autoconf/status.m4.orig Tue Nov 12 11:54:46 2002
| +++ lib/autoconf/status.m4 Thu Jan 9 03:23:40 2003
| @@ -164,7 +164,9 @@
| # absolute.
| ac_abs_builddir=`cd $1 && cd $ac_builddir && pwd`
| ac_abs_top_builddir=`cd $1 && cd ${ac_top_builddir}. && pwd`
| -ac_abs_srcdir=`cd $1 && cd $ac_srcdir && pwd`
| +# If there is no srcdir corresponding to the builddir,
| +# forget it and suppress the warning.
| +ac_abs_srcdir=`cd $1 && cd $ac_srcdir 2>/dev/null && pwd`
| ac_abs_top_srcdir=`cd $1 && cd $ac_top_srcdir && pwd`
| ])# _AC_SRCPATHS
I don't have your problem with 2.57.
/tmp % cat configure.ac nostromo 13:36
AC_INIT
AC_CONFIG_LINKS(include/kernel/mp-arith.h:interfaces/gmp/mp-arith.h)
AC_OUTPUT
/tmp % autoconf -Wall nostromo 13:37
/tmp % ./configure nostromo 13:37
configure: creating ./config.status
config.status: linking ./interfaces/gmp/mp-arith.h to include/kernel/mp-arith.h
config.status: error: ./interfaces/gmp/mp-arith.h: file not found
- Re: Autoconf-2.53 .. -2.57: Spurious cd error messages,
Akim Demaille <=