values.
(%needed_macros): New.
(&check_configure_ac): New. Call it.
(&output_libraries): Eve out from &output_programs.
(&print_unique): For the time being register in %needed_macros
only argument less macros.
+2001-01-22 Akim Demaille <akim@epita.fr>
+
+ * autoscan.pl: Instead of undefined globals, set them to empty
+ values.
+ (%needed_macros): New.
+ (&check_configure_ac): New. Call it.
+ (&output_libraries): Eve out from &output_programs.
+ (&print_unique): For the time being register in %needed_macros
+ only argument less macros.
+
2001-01-22 Lars J. Aas <somelarsa@sim.no>
* aclang.m4 (_AC_PROG_CXX_EXIT_DECLARATION): First try no declaration,
** Autotest
Document it.
+** Document AC_COMPILE_IFELSE, AC_LANG_PROGRAM etc.
+And make AC_TRY_COMPILE etc. obsolete.
+
+** Autoscan macros
+Can be introduced even before specializing macros. It just means that
+specializing macros will call them. OTOH, this doubles our work,
+since specializing macros will save us from additional typing. But
+the more powerful autoscan is, the better...
+
* Autoconf 2.51 or later
** Libtool
$verbose = 0;
# Reference these variables to pacify perl -w.
-undef %identifiers_macros;
-undef %makevars_macros;
-undef %programs_macros;
+%identifiers_macros = ();
+%makevars_macros = ();
+%programs_macros = ();
+%needed_macros = ();
&parse_args;
&init_tables;
&find('.');
&scan_files;
&output;
+&check_configure_ac ('configure.in');
exit 0;
}
}
-# Print a configure.ac.
+# Print a proto configure.ac.
sub output
{
local (%unique_makefiles);
}
&output_programs;
+ &output_libraries;
&output_headers;
&output_identifiers;
&output_functions;
$unique_makefiles{$_}++;
}
print CONF "\nAC_CONFIG_FILES([",
- join("\n ", keys(%unique_makefiles)), "])\n";
+ join("\n ", keys(%unique_makefiles)), "])\n";
print CONF "AC_OUTPUT\n";
close CONF;
if (defined($macro) && !defined($printed{$macro})) {
print CONF "$macro\n";
$printed{$macro} = 1;
+
+ # For the time being, just don't bother with macros with arguments.
+ $needed_macros{$macro} = 1
+ if ($macro !~ /]|^AC_CHECK_.*S/);
}
}
foreach $word (sort keys %makevars) {
&print_unique($makevars_macros{$word});
}
+}
+
+sub output_libraries
+{
+ local ($word);
+
print CONF "\n# Checks for libraries.\n";
foreach $word (sort keys %libraries) {
print CONF "# FIXME: Replace `main' with a function in `-l$word':\n";
print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n"
if defined(@have_funcs);
}
+
+
+# Use autoconf to check if all the suggested macros are included
+# in `configure.ac'
+sub check_configure_ac
+{
+ local ($configure_ac) = $@;
+ local ($trace_option) = '';
+ local ($word);
+
+ print STDERR "$trace_option\n";
+ foreach $macro (%needed_macros)
+ {
+ $trace_option .= " -t $macro";
+ }
+
+ open (TRACES, "/home/akim/src/ace/autoconf -A $datadir $trace_option $configure_ac|") ||
+ die "$me: cannot create read traces: $!\n";
+
+ while (<TRACES>)
+ {
+ local ($file, $line, $macro, $args) = split (/:/, $_, 4);
+ delete ($needed_macros{$macro});
+ }
+
+ foreach $macro (sort keys %needed_macros)
+ {
+ print STDERR "warning: missing $macro\n";
+ }
+}
$verbose = 0;
# Reference these variables to pacify perl -w.
-undef %identifiers_macros;
-undef %makevars_macros;
-undef %programs_macros;
+%identifiers_macros = ();
+%makevars_macros = ();
+%programs_macros = ();
+%needed_macros = ();
&parse_args;
&init_tables;
&find('.');
&scan_files;
&output;
+&check_configure_ac ('configure.in');
exit 0;
}
}
-# Print a configure.ac.
+# Print a proto configure.ac.
sub output
{
local (%unique_makefiles);
}
&output_programs;
+ &output_libraries;
&output_headers;
&output_identifiers;
&output_functions;
$unique_makefiles{$_}++;
}
print CONF "\nAC_CONFIG_FILES([",
- join("\n ", keys(%unique_makefiles)), "])\n";
+ join("\n ", keys(%unique_makefiles)), "])\n";
print CONF "AC_OUTPUT\n";
close CONF;
if (defined($macro) && !defined($printed{$macro})) {
print CONF "$macro\n";
$printed{$macro} = 1;
+
+ # For the time being, just don't bother with macros with arguments.
+ $needed_macros{$macro} = 1
+ if ($macro !~ /]|^AC_CHECK_.*S/);
}
}
foreach $word (sort keys %makevars) {
&print_unique($makevars_macros{$word});
}
+}
+
+sub output_libraries
+{
+ local ($word);
+
print CONF "\n# Checks for libraries.\n";
foreach $word (sort keys %libraries) {
print CONF "# FIXME: Replace `main' with a function in `-l$word':\n";
print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n"
if defined(@have_funcs);
}
+
+
+# Use autoconf to check if all the suggested macros are included
+# in `configure.ac'
+sub check_configure_ac
+{
+ local ($configure_ac) = $@;
+ local ($trace_option) = '';
+ local ($word);
+
+ print STDERR "$trace_option\n";
+ foreach $macro (%needed_macros)
+ {
+ $trace_option .= " -t $macro";
+ }
+
+ open (TRACES, "/home/akim/src/ace/autoconf -A $datadir $trace_option $configure_ac|") ||
+ die "$me: cannot create read traces: $!\n";
+
+ while (<TRACES>)
+ {
+ local ($file, $line, $macro, $args) = split (/:/, $_, 4);
+ delete ($needed_macros{$macro});
+ }
+
+ foreach $macro (sort keys %needed_macros)
+ {
+ print STDERR "warning: missing $macro\n";
+ }
+}
$verbose = 0;
# Reference these variables to pacify perl -w.
-undef %identifiers_macros;
-undef %makevars_macros;
-undef %programs_macros;
+%identifiers_macros = ();
+%makevars_macros = ();
+%programs_macros = ();
+%needed_macros = ();
&parse_args;
&init_tables;
&find('.');
&scan_files;
&output;
+&check_configure_ac ('configure.in');
exit 0;
}
}
-# Print a configure.ac.
+# Print a proto configure.ac.
sub output
{
local (%unique_makefiles);
}
&output_programs;
+ &output_libraries;
&output_headers;
&output_identifiers;
&output_functions;
$unique_makefiles{$_}++;
}
print CONF "\nAC_CONFIG_FILES([",
- join("\n ", keys(%unique_makefiles)), "])\n";
+ join("\n ", keys(%unique_makefiles)), "])\n";
print CONF "AC_OUTPUT\n";
close CONF;
if (defined($macro) && !defined($printed{$macro})) {
print CONF "$macro\n";
$printed{$macro} = 1;
+
+ # For the time being, just don't bother with macros with arguments.
+ $needed_macros{$macro} = 1
+ if ($macro !~ /]|^AC_CHECK_.*S/);
}
}
foreach $word (sort keys %makevars) {
&print_unique($makevars_macros{$word});
}
+}
+
+sub output_libraries
+{
+ local ($word);
+
print CONF "\n# Checks for libraries.\n";
foreach $word (sort keys %libraries) {
print CONF "# FIXME: Replace `main' with a function in `-l$word':\n";
print CONF "AC_CHECK_FUNCS([" . join(' ', sort(@have_funcs)) . "])\n"
if defined(@have_funcs);
}
+
+
+# Use autoconf to check if all the suggested macros are included
+# in `configure.ac'
+sub check_configure_ac
+{
+ local ($configure_ac) = $@;
+ local ($trace_option) = '';
+ local ($word);
+
+ print STDERR "$trace_option\n";
+ foreach $macro (%needed_macros)
+ {
+ $trace_option .= " -t $macro";
+ }
+
+ open (TRACES, "/home/akim/src/ace/autoconf -A $datadir $trace_option $configure_ac|") ||
+ die "$me: cannot create read traces: $!\n";
+
+ while (<TRACES>)
+ {
+ local ($file, $line, $macro, $args) = split (/:/, $_, 4);
+ delete ($needed_macros{$macro});
+ }
+
+ foreach $macro (sort keys %needed_macros)
+ {
+ print STDERR "warning: missing $macro\n";
+ }
+}