[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ac_config_libobj_dir broken
From: |
Akim Demaille |
Subject: |
Re: ac_config_libobj_dir broken |
Date: |
09 Sep 2002 10:51:58 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| > From: Akim Demaille <address@hidden>
| > Date: 06 Sep 2002 13:50:20 +0200
| >
| > >>>>> "Andreas" == Andreas Schwab <address@hidden> writes:
| >
| > Andreas> The default value of ac_config_libobj_dir is wrong, it should
| > Andreas> be $srcdir. Similarily, AC_CONFIG_LIBOBJ_DIR should prepend
| > Andreas> $srcdir to the directory.
| >
| > Arg, you are right. But I'm not sure sticking srcdir in
| > ac_config_libobj_dir is the right thing to do. For instance, in the
| > replacement of fnmatch, you have:
| >
| >
AC_CONFIG_LINKS([$ac_config_libobj_dir/fnmatch.h:$ac_config_libobj_dir/fnmatch_.h])
| >
| > This idiom is expected to spread, for getopt and others, and it should
| > not try to write in the $srcdir tree. I suppose there will be more
| > such examples where some replacement file will actually be in the
| > build hierarchy :(
| >
| > So I'm more inclined to paste $srcdir in from of $ac_config_libobj_dir
| > where needed.
| >
| > What do you (and other people :) think?
|
| Yes, I tend to agree. $ac_config_libobj_dir should be a relative
| path, and it should be a subdirectory of both $srcdir and of
| $builddir. It sounds like Autoconf should reject attempts to use an
| absolute directory as an argument to AC_CONFIG_LIBOBJ_DIR.
Here is my proposal. Once this checked in, shall we launch the
release process?
Index: ChangeLog
from Akim Demaille <address@hidden>
* lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Use $srcdir when
looking for a replacement file.
* lib/autoconf/general.m4 (AC_CHECK_DECLS): Check that the
directory is relative.
* doc/autoconf.texi (Generic Functions): Clarify the replacement
directory definition.
Reported by Andreas Schwab and Jim Meyering.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.667
diff -u -u -r1.667 autoconf.texi
--- doc/autoconf.texi 6 Sep 2002 11:10:37 -0000 1.667
+++ doc/autoconf.texi 9 Sep 2002 08:55:02 -0000
@@ -4109,11 +4109,15 @@
@defmac AC_CONFIG_LIBOBJ_DIR (@var{directory})
@acindex CONFIG_LIBOBJ_DIR
Specify that @code{AC_LIBOBJ} replacement files are to be found in
address@hidden (which defaults to @samp{.}, the top source directory).
address@hidden might need to know where these files are for the
address@hidden, a relative path starting from the top level of the
+source tree. The replacement directory defaults to @file{.}, the top
+level directory, and the most typical value is @file{lib}, corresponding
+to @samp{AC_CONFIG_LIBOBJ_DIR(lib)}.
+
address@hidden might need to know the replacement directory for the
following reasons: (i) some checks use the replacement files, (ii) some
macros bypass broken system headers by installing links to the
-replacement headers etc.
+replacement headers, etc.
@end defmac
@sp 1
Index: lib/autoconf/functions.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/functions.m4,v
retrieving revision 1.68
diff -u -u -r1.68 functions.m4
--- lib/autoconf/functions.m4 17 Jul 2002 16:55:49 -0000 1.68
+++ lib/autoconf/functions.m4 9 Sep 2002 08:55:03 -0000
@@ -553,8 +553,8 @@
[ac_have_func=no # yes means we've found a way to get the load average.
# Make sure getloadavg.c is where it belongs, at configure-time.
-test -f "$ac_config_libobj_dir/getloadavg.c" ||
- AC_MSG_ERROR([$ac_config_libobj_dir/getloadavg.c is missing])
+test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" ||
+ AC_MSG_ERROR([$srcdir/$ac_config_libobj_dir/getloadavg.c is missing])
ac_save_LIBS=$LIBS
@@ -600,7 +600,7 @@
AC_CACHE_CHECK(whether getloadavg requires setgid,
ac_cv_func_getloadavg_setgid,
[AC_EGREP_CPP([Yowza Am I SETGID yet],
-[#include "$ac_config_libobj_dir/getloadavg.c"
+[#include "$srcdir/$ac_config_libobj_dir/getloadavg.c"
#ifdef LDAV_PRIVILEGED
Yowza Am I SETGID yet
@%:@endif],
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.802
diff -u -u -r1.802 general.m4
--- lib/autoconf/general.m4 31 Aug 2002 05:47:02 -0000 1.802
+++ lib/autoconf/general.m4 9 Sep 2002 08:55:04 -0000
@@ -2363,9 +2363,11 @@
# AC_CONFIG_LIBOBJ_DIR(DIRNAME)
# -----------------------------
-# Announce LIBOBJ replacement files are in DIRNAME.
+# Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME.
AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR],
-[m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])[]dnl
+[m4_bmatch([$1], [^]m4_defn([m4_cr_symbols2]),
+ [AC_WARNING([invalid replacement directory: $1])])dnl
+m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])[]dnl
])