+2002-07-03 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * automake.in (am_macro_for_var): Add LIBTOOL.
+ (ac_macro_for_var): Add RANLIB.
+ (seen_libtool): Remove.
+ (handle_libtool, lang_c_finish, define_compiler_variable,
+ make_paragraphs): Use
+ variable_defined ('LIBTOOL') instead of $seen_libtool.
+ (handle_languages) <%transform>: Don't set 'LIBTOOL', it is
+ already done in make_paragraphs.
+ (handle_libraries): Simplify by requiring RANLIB with
+ &require_variables_for_macro.
+ (handle_ltlibraries): Simplify by requiring LIBTOOL with
+ &require_variables_for_macro.
+ (scan_autoconf_traces): Don't trace for AC_PROG_LIBTOOL and
+ AM_PROG_LIBTOOL.
+ * tests/libtool4.test, tests/library2.test: New files.
+ * tests/Makefile.in (TESTS): Add libtool4.test and library2.test.
+
2002-07-02 Alexandre Duret-Lutz <duret_g@epita.fr>
* automake.in (create, keyed_aclocal_warning): Delete, unused.
# Declare the macros that define known variables, so we can
# hint the user if she try to use one of these variables.
+
+# Macros accessible via aclocal.
my %am_macro_for_var =
(
ANSI2KNR => 'AM_C_PROTOTYPES',
EMACS => 'AM_PATH_LISPDIR',
GCJ => 'AM_PROG_GCJ',
LEX => 'AM_PROG_LEX',
+ LIBTOOL => 'AC_PROG_LIBTOOL',
lispdir => 'AM_PATH_LISPDIR',
pkgpyexecdir => 'AM_PATH_PYTHON',
pkgpythondir => 'AM_PATH_PYTHON',
U => 'AM_C_PROTOTYPES',
);
+# Macros shipped with Autoconf.
my %ac_macro_for_var =
(
CC => 'AC_PROG_CC',
CXXFLAGS => 'AC_PROG_CXX',
F77 => 'AC_PROG_F77',
F77FLAGS => 'AC_PROG_F77',
+ RANLIB => 'AC_PROG_RANLIB',
YACC => 'AC_PROG_YACC',
);
my $seen_canonical = 0;
my $canonical_location;
-# Where AC_PROG_LIBTOOL appears.
-my $seen_libtool;
-
# Where AM_MAINTAINER_MODE appears.
my $seen_maint_mode;
my %transform = ('EXT' => $ext,
'PFX' => $pfx,
'FPFX' => $fpfx,
- 'LIBTOOL' => defined $seen_libtool,
'AMDEP' => $AMDEP,
'-c' => $lang->compile_flag || '',
'MORE-THAN-ONE'
# Handle libtool rules.
sub handle_libtool
{
- return unless $seen_libtool;
+ return unless variable_defined ('LIBTOOL');
- # Libtool requires some files, but only at top level.
- require_conf_file ($seen_libtool, FOREIGN, @libtool_files)
- if $relative_dir eq '.';
+ # Libtool requires some files, but only at top level.
+ require_conf_file_with_macro ('LIBTOOL', FOREIGN, @libtool_files)
+ if $relative_dir eq '.';
- my @libtool_rms;
- foreach my $item (sort keys %libtool_clean_directories)
+ my @libtool_rms;
+ foreach my $item (sort keys %libtool_clean_directories)
{
- my $dir = ($item eq '.') ? '' : "$item/";
- # .libs is for Unix, _libs for DOS.
- push (@libtool_rms, "\t-rm -rf ${dir}.libs ${dir}_libs");
+ my $dir = ($item eq '.') ? '' : "$item/";
+ # .libs is for Unix, _libs for DOS.
+ push (@libtool_rms, "\t-rm -rf ${dir}.libs ${dir}_libs");
}
- # Output the libtool compilation rules.
- $output_rules .= &file_contents ('libtool',
- ('LTRMS' => join ("\n", @libtool_rms)));
+ # Output the libtool compilation rules.
+ $output_rules .= &file_contents ('libtool',
+ ('LTRMS' => join ("\n", @libtool_rms)));
}
# handle_programs ()
my @prefix = am_primary_prefixes ('LIBRARIES', 0, 'lib', 'pkglib',
'noinst', 'check');
- if (! defined $configure_vars{'RANLIB'}
- && @prefix)
- {
- macro_error ($prefix[0] . '_LIBRARIES',
- "library used but `RANLIB' not defined in `$configure_ac'");
- # Only get this error once. If this is ever printed, we have
- # a bug.
- $configure_vars{'RANLIB'} = 'BUG';
- }
+
+ require_variables_for_macro ($prefix[0] . '_LIBRARIES',
+ 'library used', 'RANLIB')
+ if (@prefix);
my $seen_libobjs = 0;
foreach my $onelib (@liblist)
my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib',
'noinst', 'check');
+ require_variables_for_macro ($prefix[0] . '_KTLIBRARIES',
+ 'Libtool library used', 'LIBTOOL')
+ if (@prefix);
+
foreach my $key (@prefix)
{
- if (!$seen_libtool)
- {
- macro_error ($key . '_LTLIBRARIES',
- "library used but `LIBTOOL' not defined in `$configure_ac'");
- # Only get this error once. If this is ever printed,
- # we have a bug.
- $configure_vars{'LIBTOOL'} = 'BUG';
- $seen_libtool = $var_location{$key . '_LTLIBRARIES'};
- }
-
# Get the installation directory of each library.
(my $dir = $key) =~ s/^nobase_//;
for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all'))
AC_CONFIG_HEADERS
AC_INIT
AC_LIBSOURCE
- AC_PROG_LIBTOOL AM_PROG_LIBTOOL
AC_SUBST
AM_AUTOMAKE_VERSION
AM_CONDITIONAL
{
$libsources{$args[1]} = $here;
}
- elsif ($macro =~ /^A(C|M)_PROG_LIBTOOL$/)
- {
- $seen_libtool = $here;
- }
elsif ($macro eq 'AC_SUBST')
{
# Just check for alphanumeric in AC_SUBST. If you do
. " || rm -f ${base}_.c\n");
push (@objects, $base . '_.$(OBJEXT)');
push (@objects, $base . '_.lo')
- if $seen_libtool;
+ if variable_defined ('LIBTOOL');
}
# Make all _.o (and _.lo) files depend on ansi2knr.
my ($var, $value) = ($lang->compiler, $lang->compile);
&define_variable ($var, $value);
&define_variable ("LT$var", "\$(LIBTOOL) --mode=compile $value")
- if $seen_libtool;
+ if variable_defined ('LIBTOOL');
}
&define_variable ($lang->lder, $lang->ld);
# CCLINK = $(CCLD) blah blah...
&define_variable ($lang->linker,
- (($seen_libtool ? '$(LIBTOOL) --mode=link ' : '')
+ ((variable_defined ('LIBTOOL')
+ ? '$(LIBTOOL) --mode=link ' : '')
. $lang->link));
}
'HOST' => $seen_canonical,
'TARGET' => $seen_canonical == AC_CANONICAL_SYSTEM,
- 'LIBTOOL' => defined $configure_vars{'LIBTOOL'})
+ 'LIBTOOL' => variable_defined ('LIBTOOL'))
# We don't need more than two consecutive new-lines.
. 's/\n{3,}/\n\n/g';