Salut Alexandre,
Thanks for the feedback:
Alexandre Duret-Lutz wrote:
> * LIBOBJDIR seems worthy to document from the Autoconf user perspective.
> Non-automake might also benefit from this; and we should avoid using
> undocumented interfaces in Automake.
Okay, I've added that to the attached revision of this patch.
> * The comment in _AC_LIBOBJS_NORMALIZE seems misleading to me,
> because LIBOBJDIR is unrelated to the macro
> AC_CONFIG_LIBOBJ_DIR as far as Autoconf is concerned.
> AC_CONFIG_LIBOBJ_DIR specifies where the *sources* files are.
> LIBOBJDIR is a prefix variable the user cano use to relocate
> the *object* files. This is not necessary the same place.
True enough also. I've changed the comments to describe the situation more
accurately.
> * Autoconf needs to be adjusted to reflect the fact that
> Automake scans a new macro. See the comment above the %traced
> variable you modified in scan_autoconf_trace.
AC_CONFIG_LIBOBJ_DIR is already there in autoconf-2.59 and HEAD.
> * Better write ${LIBOBJDIR} instead of $(LIBOBJDIR) in @LIBOBJS@
> (for the same reason we use ${prefix}, etc.)
I disagree, LIBOBJDIR is a make macro not a shell variable, so it is more akin
to $(srcdir) than ${prefix}. If I'm missing something, feel free to change it
before committing.
> * The Automake manual should be updated at least in two places:
> - the place where it documents all the macros that can
> affect its behavior (your patch causes
> AC_CONFIG_LIBOBJ_DIR to have a stronger semantic when used
> with Automake than when used with only Autoconf).
> - the section about how LIBOBJS is used.
> * Use $PERL, not perl.
Both done. Thanks for the pointers.
> * AFAICT your patch assumes that users use option `subdir-objects' when
> using @LIBOBJS@ remotely. I think we should also support the other case.
>
> I suggest you don't bother with the last point unless it looks
> easy to you. I'll probably find some time this week-end or next
> week.
Agreed on all counts. My perl-fu is as always insufficient to the task,
thanks for offering to do the rest.
ChangeLog entries for automake:
2005-04-25 Gary V. Vaughan <[EMAIL PROTECTED]>
Fixes PR/401
* automake.in (config_libobj_dir): Either `.' or whatever directory is
given to AC_CONFIG_LIBOBJ_DIR in configure.ac.
(scan_autoconf_traces): Set config_libobj_dir.
(sub_read_am_file): Define LIBOBJDIR according to relative path from
each Makefile to AC_CONFIG_LIBOBJ_DIR directory.
(require_libobj_with_macro): Use $config_libobj_dir when looking for
LIBOBJs.
(handle_LIBOBJS, handle_ALLOCA): Use it.
* tests/Makefile.am (TESTS): Declare pr401.test.
* tests/pr401.test: New test.
* doc/automake.texi (LIBOBJS): Document changes in behaviour of
LIBOBJS, ALLOCA, LTLIBOBJS & LTALLOCA in the presence of
subdir-objects and an invocation of AC_CONFIG_LIBOBJ_DIR.
And autoconf:
2004-04-20 Gary V. Vaughan <[EMAIL PROTECTED]>
* lib/autoconf/general.m4 (_AC_LIBOBJS_NORMALIZE): Prepend each object
named in LIBOBJS and LTLIBOBJS with the $(LIBOBJDIR), as set by latest
automake.
Cheers,
Gary.
--
Gary V. Vaughan ())_. [EMAIL PROTECTED],gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
--- automake.in.orig 2005-02-12 10:06:56.0 +
+++ automake.in 2005-04-20 14:08:05.0 +0100
@@ -142,6 +142,7 @@
use Automake::RuleDef;
use Automake::Wrap 'makefile_wrap';
use File::Basename;
+use File::Spec;
use Carp;
## --- ##
@@ -333,6 +334,10 @@
# in Makefiles.
my $am_config_aux_dir = '';
+# Directory to search for AC_LIBSOURCE file, as set by AC_CONFIG_LIBOBJ_DIR
+# in configure.ac.
+my $config_libobj_dir = '';
+
# Whether AM_GNU_GETTEXT has been seen in configure.ac.
my $seen_gettext = 0;
# Whether AM_GNU_GETTEXT([external]) is used.
@@ -2067,7 +2072,7 @@
if ($iter =~ /\.h$/)
{
- require_file_with_macro ($cond, $var, FOREIGN, $iter);
+ require_libobj_with_macro ($cond, $var, FOREIGN, $iter);
}
elsif ($iter ne 'alloca.c')
{
@@ -2079,7 +2084,7 @@
my $bs = var ('BUILT_SOURCES');
if (! $bs || ! grep (/$rewrite/, $bs->value_as_list_recursive))
{
- require_file_with_macro ($cond, $var, FOREIGN, $iter);
+ require_libobj_with_macro ($cond, $var, FOREIGN, $iter);
}
}
}
@@ -2092,7 +2097,7 @@
$lt ||= '';
$var->requires_variables ("[EMAIL PROTECTED]@ used", $lt . 'ALLOCA');
$dep_files{'$(DEPDIR)/alloca.P' . $myobjext} = 1;
- require_file_with_macro ($cond, $var, FOREIGN, 'alloca.c');
+ require_libobj_with_macro ($cond, $var, FOREIGN, 'alloca.c');
&saw_extension ('c');
}
@@ -4636,6 +4641,7 @@
AC_CONFIG_AUX_DIR => 1,
AC_CONFIG_FILES => 1,
AC_CONFIG_H