From a8ff40ec99fccceaf14f0281c9dc5e198cc75417 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 30 Aug 2007 12:08:26 +0100 Subject: [PATCH] Update autoconf to version 2.61 Signed-off-by: Johannes Schindelin --- bin/aclocal-1.10 | 1072 ++ bin/aclocal-1.7 | 475 - bin/autoconf | 465 +- bin/autoheader | 91 +- bin/autom4te | 400 +- bin/autoreconf | 318 +- bin/autoscan | 92 +- bin/autoupdate | 312 +- bin/ifnames | 47 +- share/aclocal-1.10/amversion.m4 | 35 + share/aclocal-1.10/as.m4 | 21 + share/aclocal-1.10/auxdir.m4 | 52 + share/aclocal-1.10/ccstdc.m4 | 26 + share/aclocal-1.10/cond.m4 | 34 + share/aclocal-1.10/depend.m4 | 158 + share/aclocal-1.10/depout.m4 | 68 + share/aclocal-1.10/dmalloc.m4 | 31 + share/aclocal-1.10/gcj.m4 | 18 + share/aclocal-1.10/header.m4 | 12 + share/aclocal-1.10/init.m4 | 124 + share/aclocal-1.10/install-sh.m4 | 14 + share/aclocal-1.10/lead-dot.m4 | 21 + share/aclocal-1.10/lex.m4 | 22 + share/aclocal-1.10/lispdir.m4 | 55 + share/aclocal-1.10/maintainer.m4 | 28 + share/aclocal-1.10/make.m4 | 51 + share/aclocal-1.10/minuso.m4 | 34 + share/aclocal-1.10/missing.m4 | 35 + share/aclocal-1.10/mkdirp.m4 | 26 + share/aclocal-1.10/multi.m4 | 65 + share/aclocal-1.10/obsol-gt.m4 | 12 + share/aclocal-1.10/obsol-lt.m4 | 12 + share/aclocal-1.10/obsolete.m4 | 37 + share/aclocal-1.10/options.m4 | 32 + share/aclocal-1.10/protos.m4 | 29 + share/aclocal-1.10/python.m4 | 168 + share/aclocal-1.10/regex.m4 | 53 + share/aclocal-1.10/runlog.m4 | 17 + share/aclocal-1.10/sanity.m4 | 51 + share/aclocal-1.10/strip.m4 | 28 + share/aclocal-1.10/substnot.m4 | 12 + share/aclocal-1.10/tar.m4 | 95 + share/aclocal-1.10/upc.m4 | 20 + share/autoconf/Autom4te/C4che.pm | 244 + share/autoconf/Autom4te/ChannelDefs.pm | 390 + share/autoconf/Autom4te/Channels.pm | 709 ++ share/autoconf/Autom4te/Configure_ac.pm | 108 + share/autoconf/Autom4te/FileUtils.pm | 384 + share/autoconf/Autom4te/General.pm | 421 + share/autoconf/Autom4te/Request.pm | 116 + share/autoconf/Autom4te/Struct.pm | 630 + share/autoconf/Autom4te/XFile.pm | 291 + share/autoconf/INSTALL | 234 + share/autoconf/autoconf/autoconf.m4 | 116 + share/autoconf/autoconf/autoconf.m4f | 12002 +++++++++++++++++++ share/autoconf/autoconf/autoheader.m4 | 101 + share/autoconf/autoconf/autoscan.m4 | 72 + share/autoconf/autoconf/autotest.m4 | 89 + share/autoconf/autoconf/autoupdate.m4 | 130 + share/autoconf/autoconf/c.m4 | 1737 +++ share/autoconf/autoconf/erlang.m4 | 306 + share/autoconf/autoconf/fortran.m4 | 1234 ++ share/autoconf/autoconf/functions.m4 | 2046 ++++ share/autoconf/autoconf/general.m4 | 2730 +++++ share/autoconf/autoconf/headers.m4 | 873 ++ share/autoconf/autoconf/lang.m4 | 671 ++ share/autoconf/autoconf/libs.m4 | 496 + share/autoconf/autoconf/oldnames.m4 | 113 + share/autoconf/autoconf/programs.m4 | 888 ++ share/autoconf/autoconf/specific.m4 | 514 + share/autoconf/autoconf/status.m4 | 1536 +++ share/autoconf/autoconf/types.m4 | 991 ++ share/autoconf/autom4te.cfg | 156 + share/autoconf/autoscan/autoscan.list | 316 + share/autoconf/autotest/autotest.m4 | 47 + share/autoconf/autotest/autotest.m4f | 2550 +++++ share/autoconf/autotest/general.m4 | 1523 +++ share/autoconf/m4sugar/m4sh.m4 | 1529 +++ share/autoconf/m4sugar/m4sh.m4f | 1412 +++ share/autoconf/m4sugar/m4sugar.m4 | 1785 +++ share/autoconf/m4sugar/m4sugar.m4f | 542 + share/autoconf/m4sugar/version.m4 | 10 + share/info/autoconf.info | 18431 ++++++++++++++++++++++++++++++ share/man/man1/autoconf.1 | 107 + share/man/man1/autoheader.1 | 103 + share/man/man1/autom4te.1 | 156 + share/man/man1/autoreconf.1 | 128 + share/man/man1/autoscan.1 | 65 + share/man/man1/autoupdate.1 | 67 + share/man/man1/config.guess.1 | 57 + share/man/man1/config.sub.1 | 41 + share/man/man1/ifnames.1 | 52 + 92 files changed, 62814 insertions(+), 1203 deletions(-) create mode 100644 bin/aclocal-1.10 delete mode 100644 bin/aclocal-1.7 create mode 100644 share/aclocal-1.10/amversion.m4 create mode 100644 share/aclocal-1.10/as.m4 create mode 100644 share/aclocal-1.10/auxdir.m4 create mode 100644 share/aclocal-1.10/ccstdc.m4 create mode 100644 share/aclocal-1.10/cond.m4 create mode 100644 share/aclocal-1.10/depend.m4 create mode 100644 share/aclocal-1.10/depout.m4 create mode 100644 share/aclocal-1.10/dmalloc.m4 create mode 100644 share/aclocal-1.10/gcj.m4 create mode 100644 share/aclocal-1.10/header.m4 create mode 100644 share/aclocal-1.10/init.m4 create mode 100644 share/aclocal-1.10/install-sh.m4 create mode 100644 share/aclocal-1.10/lead-dot.m4 create mode 100644 share/aclocal-1.10/lex.m4 create mode 100644 share/aclocal-1.10/lispdir.m4 create mode 100644 share/aclocal-1.10/maintainer.m4 create mode 100644 share/aclocal-1.10/make.m4 create mode 100644 share/aclocal-1.10/minuso.m4 create mode 100644 share/aclocal-1.10/missing.m4 create mode 100644 share/aclocal-1.10/mkdirp.m4 create mode 100644 share/aclocal-1.10/multi.m4 create mode 100644 share/aclocal-1.10/obsol-gt.m4 create mode 100644 share/aclocal-1.10/obsol-lt.m4 create mode 100644 share/aclocal-1.10/obsolete.m4 create mode 100644 share/aclocal-1.10/options.m4 create mode 100644 share/aclocal-1.10/protos.m4 create mode 100644 share/aclocal-1.10/python.m4 create mode 100644 share/aclocal-1.10/regex.m4 create mode 100644 share/aclocal-1.10/runlog.m4 create mode 100644 share/aclocal-1.10/sanity.m4 create mode 100644 share/aclocal-1.10/strip.m4 create mode 100644 share/aclocal-1.10/substnot.m4 create mode 100644 share/aclocal-1.10/tar.m4 create mode 100644 share/aclocal-1.10/upc.m4 create mode 100644 share/autoconf/Autom4te/C4che.pm create mode 100644 share/autoconf/Autom4te/ChannelDefs.pm create mode 100644 share/autoconf/Autom4te/Channels.pm create mode 100644 share/autoconf/Autom4te/Configure_ac.pm create mode 100644 share/autoconf/Autom4te/FileUtils.pm create mode 100644 share/autoconf/Autom4te/General.pm create mode 100644 share/autoconf/Autom4te/Request.pm create mode 100644 share/autoconf/Autom4te/Struct.pm create mode 100644 share/autoconf/Autom4te/XFile.pm create mode 100644 share/autoconf/INSTALL create mode 100644 share/autoconf/autoconf/autoconf.m4 create mode 100644 share/autoconf/autoconf/autoconf.m4f create mode 100644 share/autoconf/autoconf/autoheader.m4 create mode 100644 share/autoconf/autoconf/autoscan.m4 create mode 100644 share/autoconf/autoconf/autotest.m4 create mode 100644 share/autoconf/autoconf/autoupdate.m4 create mode 100644 share/autoconf/autoconf/c.m4 create mode 100644 share/autoconf/autoconf/erlang.m4 create mode 100644 share/autoconf/autoconf/fortran.m4 create mode 100644 share/autoconf/autoconf/functions.m4 create mode 100644 share/autoconf/autoconf/general.m4 create mode 100644 share/autoconf/autoconf/headers.m4 create mode 100644 share/autoconf/autoconf/lang.m4 create mode 100644 share/autoconf/autoconf/libs.m4 create mode 100644 share/autoconf/autoconf/oldnames.m4 create mode 100644 share/autoconf/autoconf/programs.m4 create mode 100644 share/autoconf/autoconf/specific.m4 create mode 100644 share/autoconf/autoconf/status.m4 create mode 100644 share/autoconf/autoconf/types.m4 create mode 100644 share/autoconf/autom4te.cfg create mode 100644 share/autoconf/autoscan/autoscan.list create mode 100644 share/autoconf/autotest/autotest.m4 create mode 100644 share/autoconf/autotest/autotest.m4f create mode 100644 share/autoconf/autotest/general.m4 create mode 100644 share/autoconf/m4sugar/m4sh.m4 create mode 100644 share/autoconf/m4sugar/m4sh.m4f create mode 100644 share/autoconf/m4sugar/m4sugar.m4 create mode 100644 share/autoconf/m4sugar/m4sugar.m4f create mode 100644 share/autoconf/m4sugar/version.m4 create mode 100644 share/info/autoconf.info create mode 100644 share/man/man1/autoconf.1 create mode 100644 share/man/man1/autoheader.1 create mode 100644 share/man/man1/autom4te.1 create mode 100644 share/man/man1/autoreconf.1 create mode 100644 share/man/man1/autoscan.1 create mode 100644 share/man/man1/autoupdate.1 create mode 100644 share/man/man1/config.guess.1 create mode 100644 share/man/man1/config.sub.1 create mode 100644 share/man/man1/ifnames.1 diff --git a/bin/aclocal-1.10 b/bin/aclocal-1.10 new file mode 100644 index 00000000..e728ee45 --- /dev/null +++ b/bin/aclocal-1.10 @@ -0,0 +1,1072 @@ +#!/bin/perl -w +# -*- perl -*- +# Generated from aclocal.in; do not edit by hand. + +eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; esac' + if 0; + +# aclocal - create aclocal.m4 by scanning configure.ac + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# Written by Tom Tromey , and +# Alexandre Duret-Lutz . + +BEGIN +{ + my $perllibdir = $ENV{'perllibdir'} || '/usr/share/automake-1.10'; + unshift @INC, (split ':', $perllibdir); +} + +use strict; + +use Automake::Config; +use Automake::General; +use Automake::Configure_ac; +use Automake::Channels; +use Automake::ChannelDefs; +use Automake::XFile; +use Automake::FileUtils; +use File::Basename; +use File::stat; +use Cwd; + +# Some globals. + +# Include paths for searching macros. We search macros in this order: +# user-supplied directories first, then the directory containing the +# automake macros, and finally the system-wide directories for +# third-party macro. @user_includes can be augmented with -I. +# @system_includes can be augmented with the `dirlist' file. Also +# --acdir will reset both @automake_includes and @system_includes. +my @user_includes = (); +my @automake_includes = ("/usr/share/aclocal-$APIVERSION"); +my @system_includes = ('/usr/share/aclocal'); + +# Whether we should copy M4 file in $user_includes[0]. +my $install = 0; + +# --diff +my @diff_command; + +# --dry-run +my $dry_run = 0; + +# configure.ac or configure.in. +my $configure_ac; + +# Output file name. +my $output_file = 'aclocal.m4'; + +# Option --force. +my $force_output = 0; + +# Modification time of the youngest dependency. +my $greatest_mtime = 0; + +# Which macros have been seen. +my %macro_seen = (); + +# Remember the order into which we scanned the files. +# It's important to output the contents of aclocal.m4 in the opposite order. +# (Definitions in first files we have scanned should override those from +# later files. So they must appear last in the output.) +my @file_order = (); + +# Map macro names to file names. +my %map = (); + +# Ditto, but records the last definition of each macro as returned by --trace. +my %map_traced_defs = (); + +# Map basenames to macro names. +my %invmap = (); + +# Map file names to file contents. +my %file_contents = (); + +# Map file names to file types. +my %file_type = (); +use constant FT_USER => 1; +use constant FT_AUTOMAKE => 2; +use constant FT_SYSTEM => 3; + +# Map file names to included files (transitively closed). +my %file_includes = (); + +# Files which have already been added. +my %file_added = (); + +# Files that have already been scanned. +my %scanned_configure_dep = (); + +# Serial numbers, for files that have one. +# The key is the basename of the file, +# the value is the serial number represented as a list. +my %serial = (); + +# Matches a macro definition. +# AC_DEFUN([macroname], ...) +# or +# AC_DEFUN(macroname, ...) +# When macroname is `['-quoted , we accept any character in the name, +# except `]'. Otherwise macroname stops on the first `]', `,', `)', +# or `\n' encountered. +my $ac_defun_rx = + "(?:AU_ALIAS|A[CU]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))"; + +# Matches an AC_REQUIRE line. +my $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)"; + +# Matches an m4_include line. +my $m4_include_rx = "(m4_|m4_s|s)include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)"; + +# Match a serial number. +my $serial_line_rx = '^#\s*serial\s+(\S*)'; +my $serial_number_rx = '^\d+(?:\.\d+)*$'; + +# Autoconf version +# Set by trace_used_macros. +my $ac_version; + +# If set, names a temporary file that must be erased on abnormal exit. +my $erase_me; + +################################################################ + +# Erase temporary file ERASE_ME. +sub unlink_tmp +{ + if (defined $erase_me && -e $erase_me && !unlink ($erase_me)) + { + fatal "could not remove `$erase_me': $!"; + } + undef $erase_me; +} + +$SIG{'INT'} = $SIG{'TERM'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'unlink_tmp'; +END { unlink_tmp } + +# Check macros in acinclude.m4. If one is not used, warn. +sub check_acinclude () +{ + foreach my $key (keys %map) + { + # FIXME: should print line number of acinclude.m4. + msg ('syntax', "warning: macro `$key' defined in " + . "acinclude.m4 but never used") + if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key}; + } +} + +sub reset_maps () +{ + $greatest_mtime = 0; + %macro_seen = (); + @file_order = (); + %map = (); + %map_traced_defs = (); + %file_contents = (); + %file_type = (); + %file_includes = (); + %file_added = (); + %scanned_configure_dep = (); + %invmap = (); + %serial = (); + undef &search; +} + +# install_file ($SRC, $DEST) +sub install_file ($$) +{ + my ($src, $dest) = @_; + my $diff_dest; + + if ($force_output + || !exists $file_contents{$dest} + || $file_contents{$src} ne $file_contents{$dest}) + { + if (-e $dest) + { + msg 'note', "overwriting `$dest' with `$src'"; + $diff_dest = $dest; + } + else + { + msg 'note', "installing `$dest' from `$src'"; + } + + if (@diff_command) + { + if (! defined $diff_dest) + { + # $dest does not exist. We create an empty one just to + # run diff, and we erase it afterward. Using the real + # the destination file (rather than a temporary file) is + # good when diff is run with options that display the + # file name. + # + # If creating $dest fails, fall back to /dev/null. At + # least one diff implementation (Tru64's) cannot deal + # with /dev/null. However working around this is not + # worth the trouble since nobody run aclocal on a + # read-only tree anyway. + $erase_me = $dest; + my $f = new IO::File "> $dest"; + if (! defined $f) + { + undef $erase_me; + $diff_dest = '/dev/null'; + } + else + { + $diff_dest = $dest; + $f->close; + } + } + my @cmd = (@diff_command, $diff_dest, $src); + $! = 0; + verb "running: @cmd"; + my $res = system (@cmd); + Automake::FileUtils::handle_exec_errors "@cmd", 1 + if $res; + unlink_tmp; + } + elsif (!$dry_run) + { + xsystem ('cp', $src, $dest); + } + } +} + +# Compare two lists of numbers. +sub list_compare (\@\@) +{ + my @l = @{$_[0]}; + my @r = @{$_[1]}; + while (1) + { + if (0 == @l) + { + return (0 == @r) ? 0 : -1; + } + elsif (0 == @r) + { + return 1; + } + elsif ($l[0] < $r[0]) + { + return -1; + } + elsif ($l[0] > $r[0]) + { + return 1; + } + shift @l; + shift @r; + } +} + +################################################################ + +# scan_m4_dirs($TYPE, @DIRS) +# -------------------------- +# Scan all M4 files installed in @DIRS for new macro definitions. +# Register each file as of type $TYPE (one of the FT_* constants). +sub scan_m4_dirs ($@) +{ + my ($type, @dirlist) = @_; + + foreach my $m4dir (@dirlist) + { + if (! opendir (DIR, $m4dir)) + { + fatal "couldn't open directory `$m4dir': $!"; + } + + # We reverse the directory contents so that foo2.m4 gets + # used in preference to foo1.m4. + foreach my $file (reverse sort grep (! /^\./, readdir (DIR))) + { + # Only examine .m4 files. + next unless $file =~ /\.m4$/; + + # Skip some files when running out of srcdir. + next if $file eq 'aclocal.m4'; + + my $fullfile = File::Spec->canonpath ("$m4dir/$file"); + &scan_file ($type, $fullfile, 'aclocal'); + } + closedir (DIR); + } +} + +# Scan all the installed m4 files and construct a map. +sub scan_m4_files () +{ + # First, scan configure.ac. It may contain macro definitions, + # or may include other files that define macros. + &scan_file (FT_USER, $configure_ac, 'aclocal'); + + # Then, scan acinclude.m4 if it exists. + if (-f 'acinclude.m4') + { + &scan_file (FT_USER, 'acinclude.m4', 'aclocal'); + } + + # Finally, scan all files in our search paths. + scan_m4_dirs (FT_USER, @user_includes); + scan_m4_dirs (FT_AUTOMAKE, @automake_includes); + scan_m4_dirs (FT_SYSTEM, @system_includes); + + # Construct a new function that does the searching. We use a + # function (instead of just evaluating $search in the loop) so that + # "die" is correctly and easily propagated if run. + my $search = "sub search {\nmy \$found = 0;\n"; + foreach my $key (reverse sort keys %map) + { + $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key + . '"); $found = 1; }' . "\n"); + } + $search .= "return \$found;\n};\n"; + eval $search; + prog_error "$@\n search is $search" if $@; +} + +################################################################ + +# Add a macro to the output. +sub add_macro ($) +{ + my ($macro) = @_; + + # Ignore unknown required macros. Either they are not really + # needed (e.g., a conditional AC_REQUIRE), in which case aclocal + # should be quiet, or they are needed and Autoconf itself will + # complain when we trace for macro usage later. + return unless defined $map{$macro}; + + verb "saw macro $macro"; + $macro_seen{$macro} = 1; + &add_file ($map{$macro}); +} + +# scan_configure_dep ($file) +# -------------------------- +# Scan a configure dependency (configure.ac, or separate m4 files) +# for uses of known macros and AC_REQUIREs of possibly unknown macros. +# Recursively scan m4_included files. +sub scan_configure_dep ($) +{ + my ($file) = @_; + # Do not scan a file twice. + return () + if exists $scanned_configure_dep{$file}; + $scanned_configure_dep{$file} = 1; + + my $mtime = mtime $file; + $greatest_mtime = $mtime if $greatest_mtime < $mtime; + + my $contents = exists $file_contents{$file} ? + $file_contents{$file} : contents $file; + + my $line = 0; + my @rlist = (); + my @ilist = (); + foreach (split ("\n", $contents)) + { + ++$line; + # Remove comments from current line. + s/\bdnl\b.*$//; + s/\#.*$//; + # Avoid running all the following regexes on white lines. + next if /^\s*$/; + + while (/$m4_include_rx/go) + { + my $ifile = $2 || $3; + # Skip missing `sinclude'd files. + next if $1 ne 'm4_' && ! -f $ifile; + push @ilist, $ifile; + } + + while (/$ac_require_rx/go) + { + push (@rlist, $1 || $2); + } + + # The search function is constructed dynamically by + # scan_m4_files. The last parenthetical match makes sure we + # don't match things that look like macro assignments or + # AC_SUBSTs. + if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/) + { + # Macro not found, but AM_ prefix found. + # Make this just a warning, because we do not know whether + # the macro is actually used (it could be called conditionally). + msg ('unsupported', "$file:$line", + "warning: macro `$2' not found in library"); + } + } + + add_macro ($_) foreach (@rlist); + &scan_configure_dep ($_) foreach @ilist; +} + +# add_file ($FILE) +# ---------------- +# Add $FILE to output. +sub add_file ($) +{ + my ($file) = @_; + + # Only add a file once. + return if ($file_added{$file}); + $file_added{$file} = 1; + + scan_configure_dep $file; +} + +# Point to the documentation for underquoted AC_DEFUN only once. +my $underquoted_manual_once = 0; + +# scan_file ($TYPE, $FILE, $WHERE) +# -------------------------------- +# Scan a single M4 file ($FILE), and all files it includes. +# Return the list of included files. +# $TYPE is one of FT_USER, FT_AUTOMAKE, or FT_SYSTEM, depending +# on where the file comes from. +# $WHERE is the location to use in the diagnostic if the file +# does not exist. +sub scan_file ($$$) +{ + my ($type, $file, $where) = @_; + my $basename = basename $file; + + # Do not scan the same file twice. + return @{$file_includes{$file}} if exists $file_includes{$file}; + # Prevent potential infinite recursion (if two files include each other). + return () if exists $file_contents{$file}; + + unshift @file_order, $file; + + $file_type{$file} = $type; + + fatal "$where: file `$file' does not exist" if ! -e $file; + + my $fh = new Automake::XFile $file; + my $contents = ''; + my @inc_files = (); + my %inc_lines = (); + + my $defun_seen = 0; + my $serial_seen = 0; + my $serial_older = 0; + + while ($_ = $fh->getline) + { + # Ignore `##' lines. + next if /^##/; + + $contents .= $_; + my $line = $_; + + if ($line =~ /$serial_line_rx/go) + { + my $number = $1; + if ($number !~ /$serial_number_rx/go) + { + msg ('syntax', "$file:$.", + "warning: ill-formed serial number `$number', " + . "expecting a version string with only digits and dots"); + } + elsif ($defun_seen) + { + # aclocal removes all definitions from M4 file with the + # same basename if a greater serial number is found. + # Encountering a serial after some macros will undefine + # these macros... + msg ('syntax', "$file:$.", + 'the serial number must appear before any macro definition'); + } + # We really care about serials only for non-automake macros + # and when --install is used. But the above diagnostics are + # made regardless of this, because not using --install is + # not a reason not the fix macro files. + elsif ($install && $type != FT_AUTOMAKE) + { + $serial_seen = 1; + my @new = split (/\./, $number); + + verb "$file:$.: serial $number"; + + if (!exists $serial{$basename} + || list_compare (@new, @{$serial{$basename}}) > 0) + { + # Delete any definition we knew from the old macro. + foreach my $def (@{$invmap{$basename}}) + { + verb "$file:$.: ignoring previous definition of $def"; + delete $map{$def}; + } + $invmap{$basename} = []; + $serial{$basename} = \@new; + } + else + { + $serial_older = 1; + } + } + } + + # Remove comments from current line. + # Do not do it earlier, because the serial line is a comment. + $line =~ s/\bdnl\b.*$//; + $line =~ s/\#.*$//; + + while ($line =~ /$ac_defun_rx/go) + { + $defun_seen = 1; + if (! defined $1) + { + msg ('syntax', "$file:$.", "warning: underquoted definition of $2" + . "\n run info '(automake)Extending aclocal'\n" + . " or see http://sources.redhat.com/automake/" + . "automake.html#Extending-aclocal") + unless $underquoted_manual_once; + $underquoted_manual_once = 1; + } + + # If this macro does not have a serial and we have already + # seen a macro with the same basename earlier, we should + # ignore the macro (don't exit immediately so we can still + # diagnose later #serial numbers and underquoted macros). + $serial_older ||= ($type != FT_AUTOMAKE + && !$serial_seen && exists $serial{$basename}); + + my $macro = $1 || $2; + if (!$serial_older && !defined $map{$macro}) + { + verb "found macro $macro in $file: $."; + $map{$macro} = $file; + push @{$invmap{$basename}}, $macro; + } + else + { + # Note: we used to give an error here if we saw a + # duplicated macro. However, this turns out to be + # extremely unpopular. It causes actual problems which + # are hard to work around, especially when you must + # mix-and-match tool versions. + verb "ignoring macro $macro in $file: $."; + } + } + + while ($line =~ /$m4_include_rx/go) + { + my $ifile = $2 || $3; + # Skip missing `sinclude'd files. + next if $1 ne 'm4_' && ! -f $ifile; + push (@inc_files, $ifile); + $inc_lines{$ifile} = $.; + } + } + + # Ignore any file that has an old serial (or no serial if we know + # another one with a serial). + return () + if ($serial_older || + ($type != FT_AUTOMAKE && !$serial_seen && exists $serial{$basename})); + + $file_contents{$file} = $contents; + + # For some reason I don't understand, it does not work + # to do `map { scan_file ($_, ...) } @inc_files' below. + # With Perl 5.8.2 it undefines @inc_files. + my @copy = @inc_files; + my @all_inc_files = (@inc_files, + map { scan_file ($type, $_, + "$file:$inc_lines{$_}") } @copy); + $file_includes{$file} = \@all_inc_files; + return @all_inc_files; +} + +# strip_redundant_includes (%FILES) +# --------------------------------- +# Each key in %FILES is a file that must be present in the output. +# However some of these files might already include other files in %FILES, +# so there is no point in including them another time. +# This removes items of %FILES which are already included by another file. +sub strip_redundant_includes (%) +{ + my %files = @_; + + # Always include acinclude.m4, even if it does not appear to be used. + $files{'acinclude.m4'} = 1 if -f 'acinclude.m4'; + # File included by $configure_ac are redundant. + $files{$configure_ac} = 1; + + # Files at the end of @file_order should override those at the beginning, + # so it is important to preserve these trailing files. We can remove + # a file A if it is going to be output before a file B that includes + # file A, not the converse. + foreach my $file (reverse @file_order) + { + next unless exists $files{$file}; + foreach my $ifile (@{$file_includes{$file}}) + { + next unless exists $files{$ifile}; + delete $files{$ifile}; + verb "$ifile is already included by $file"; + } + } + + # configure.ac is implicitly included. + delete $files{$configure_ac}; + + return %files; +} + +sub trace_used_macros () +{ + my %files = map { $map{$_} => 1 } keys %macro_seen; + %files = strip_redundant_includes %files; + + my $traces = ($ENV{AUTOM4TE} || 'autom4te'); + $traces .= " --language Autoconf-without-aclocal-m4 "; + # All candidate files. + $traces .= join (' ', grep { exists $files{$_} } @file_order) . " "; + # All candidate macros. + $traces .= join (' ', + (map { "--trace='$_:\$f::\$n::\$1'" } + ('AC_DEFUN', + 'AC_DEFUN_ONCE', + 'AU_DEFUN', + '_AM_AUTOCONF_VERSION')), + # Do not trace $1 for all other macros as we do + # not need it and it might contains harmful + # characters (like newlines). + (map { "--trace='$_:\$f::\$n'" } (keys %macro_seen))); + + verb "running $traces $configure_ac"; + + my $tracefh = new Automake::XFile ("$traces $configure_ac |"); + + my %traced = (); + + while ($_ = $tracefh->getline) + { + chomp; + my ($file, $macro, $arg1) = split (/::/); + + $traced{$macro} = 1 if exists $macro_seen{$macro}; + + $map_traced_defs{$arg1} = $file + if ($macro eq 'AC_DEFUN' + || $macro eq 'AC_DEFUN_ONCE' + || $macro eq 'AU_DEFUN'); + + $ac_version = $arg1 if $macro eq '_AM_AUTOCONF_VERSION'; + } + + $tracefh->close; + + return %traced; +} + +sub scan_configure () +{ + # Make sure we include acinclude.m4 if it exists. + if (-f 'acinclude.m4') + { + add_file ('acinclude.m4'); + } + scan_configure_dep ($configure_ac); +} + +################################################################ + +# Write output. +# Return 0 iff some files were installed locally. +sub write_aclocal ($@) +{ + my ($output_file, @macros) = @_; + my $output = ''; + + my %files = (); + # Get the list of files containing definitions for the macros used. + # (Filter out unused macro definitions with $map_traced_defs. This + # can happen when an Autoconf macro is conditionally defined: + # aclocal sees the potential definition, but this definition is + # actually never processed and the Autoconf implementation is used + # instead.) + for my $m (@macros) + { + $files{$map{$m}} = 1 + if (exists $map_traced_defs{$m} + && $map{$m} eq $map_traced_defs{$m}); + } + # Do not explicitly include a file that is already indirectly included. + %files = strip_redundant_includes %files; + + my $installed = 0; + + for my $file (grep { exists $files{$_} } @file_order) + { + # Check the time stamp of this file, and of all files it includes. + for my $ifile ($file, @{$file_includes{$file}}) + { + my $mtime = mtime $ifile; + $greatest_mtime = $mtime if $greatest_mtime < $mtime; + } + + # If the file to add looks like outside the project, copy it + # to the output. The regex catches filenames starting with + # things like `/', `\', or `c:\'. + if ($file_type{$file} != FT_USER + || $file =~ m,^(?:\w:)?[\\/],) + { + if (!$install || $file_type{$file} != FT_SYSTEM) + { + # Copy the file into aclocal.m4. + $output .= $file_contents{$file} . "\n"; + } + else + { + # Install the file (and any file it includes). + my $dest; + for my $ifile (@{$file_includes{$file}}, $file) + { + $dest = "$user_includes[0]/" . basename $ifile; + verb "installing $ifile to $dest"; + install_file ($ifile, $dest); + } + $installed = 1; + } + } + else + { + # Otherwise, simply include the file. + $output .= "m4_include([$file])\n"; + } + } + + if ($installed) + { + verb "running aclocal anew, because some files were installed locally"; + return 0; + } + + # Nothing to output?! + # FIXME: Shouldn't we diagnose this? + return 1 if ! length ($output); + + if ($ac_version) + { + # Do not use "$output_file" here for the same reason we do not + # use it in the header below. autom4te will output the name of + # the file in the diagnostic anyway. + $output = "m4_if(m4_PACKAGE_VERSION, [$ac_version],, +[m4_fatal([this file was generated for autoconf $ac_version. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +$output"; + } + + # We used to print `# $output_file generated automatically etc.' But + # this creates spurious differences when using autoreconf. Autoreconf + # creates aclocal.m4t and then rename it to aclocal.m4, but the + # rebuild rules generated by Automake create aclocal.m4 directly -- + # this would gives two ways to get the same file, with a different + # name in the header. + $output = "# generated automatically by aclocal $VERSION -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +$output"; + + # We try not to update $output_file unless necessary, because + # doing so invalidate Autom4te's cache and therefore slows down + # tools called after aclocal. + # + # We need to overwrite $output_file in the following situations. + # * The --force option is in use. + # * One of the dependencies is younger. + # (Not updating $output_file in this situation would cause + # make to call aclocal in loop.) + # * The contents of the current file are different from what + # we have computed. + if (!$force_output + && $greatest_mtime < mtime ($output_file) + && $output eq contents ($output_file)) + { + verb "$output_file unchanged"; + return 1; + } + + verb "writing $output_file"; + + if (!$dry_run) + { + if (-e $output_file && !unlink $output_file) + { + fatal "could not remove `$output_file': $!"; + } + my $out = new Automake::XFile "> $output_file"; + print $out $output; + } + return 1; +} + +################################################################ + +# Print usage and exit. +sub usage ($) +{ + my ($status) = @_; + + print "Usage: aclocal [OPTIONS] ... + +Generate `aclocal.m4' by scanning `configure.ac' or `configure.in' + +Options: + --acdir=DIR directory holding config files (for debugging) + --diff[=COMMAND] run COMMAND [diff -u] on M4 files that would be + changed (implies --install and --dry-run) + --dry-run pretend to, but do not actually update any file + --force always update output file + --help print this help, then exit + -I DIR add directory to search list for .m4 files + --install copy third-party files to the first -I directory + --output=FILE put output in FILE (default aclocal.m4) + --print-ac-dir print name of directory holding m4 files, then exit + --verbose don't be silent + --version print version number, then exit + -W, --warnings=CATEGORY report the warnings falling in CATEGORY + +Warning categories include: + `syntax' dubious syntactic constructs (default) + `unsupported' unknown macros (default) + `all' all the warnings (default) + `no-CATEGORY' turn off warnings in CATEGORY + `none' turn off all the warnings + `error' treat warnings as errors + +Report bugs to .\n"; + + exit $status; +} + +# Print version and exit. +sub version() +{ + print < + and Alexandre Duret-Lutz . + +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +EOF + exit 0; +} + +# Parse command line. +sub parse_arguments () +{ + my $print_and_exit = 0; + my $diff_command; + + my %cli_options = + ( + 'acdir=s' => sub # Setting --acdir overrides both the + { # automake (versioned) directory and the + # public (unversioned) system directory. + @automake_includes = (); + @system_includes = ($_[1]) + }, + 'diff:s' => \$diff_command, + 'dry-run' => \$dry_run, + 'force' => \$force_output, + 'I=s' => \@user_includes, + 'install' => \$install, + 'output=s' => \$output_file, + 'print-ac-dir' => \$print_and_exit, + 'verbose' => sub { setup_channel 'verb', silent => 0; }, + 'W|warnings=s' => \&parse_warnings, + ); + use Getopt::Long; + Getopt::Long::config ("bundling", "pass_through"); + + # See if --version or --help is used. We want to process these before + # anything else because the GNU Coding Standards require us to + # `exit 0' after processing these options, and we can't guarantee this + # if we treat other options first. (Handling other options first + # could produce error diagnostics, and in this condition it is + # confusing if aclocal does `exit 0'.) + my %cli_options_1st_pass = + ( + 'version' => \&version, + 'help' => sub { usage(0); }, + # Recognize all other options (and their arguments) but do nothing. + map { $_ => sub {} } (keys %cli_options) + ); + my @ARGV_backup = @ARGV; + Getopt::Long::GetOptions %cli_options_1st_pass + or exit 1; + @ARGV = @ARGV_backup; + + # Now *really* process the options. This time we know that --help + # and --version are not present, but we specify them nonetheless so + # that ambiguous abbreviation are diagnosed. + Getopt::Long::GetOptions %cli_options, 'version' => sub {}, 'help' => sub {} + or exit 1; + + if (@ARGV) + { + my %argopts; + for my $k (keys %cli_options) + { + if ($k =~ /(.*)=s$/) + { + map { $argopts{(length ($_) == 1) + ? "-$_" : "--$_" } = 1; } (split (/\|/, $1)); + } + } + if (exists $argopts{$ARGV[0]}) + { + fatal ("option `$ARGV[0]' requires an argument\n" + . "Try `$0 --help' for more information."); + } + else + { + fatal ("unrecognized option `$ARGV[0]'\n" + . "Try `$0 --help' for more information."); + } + } + + if ($print_and_exit) + { + print "@system_includes\n"; + exit 0; + } + + if (defined $diff_command) + { + $diff_command = 'diff -u' if $diff_command eq ''; + @diff_command = split (' ', $diff_command); + $install = 1; + $dry_run = 1; + } + + if ($install && !@user_includes) + { + fatal ("--install should copy macros in the directory indicated by the" + . "\nfirst -I option, but no -I was supplied."); + } + + if (! -d $system_includes[0]) + { + # By default $(datadir)/aclocal doesn't exist. We don't want to + # get an error in the case where we are searching the default + # directory and it hasn't been created. (We know + # @system_includes has its default value if @automake_includes + # is not empty, because --acdir is the only way to change this.) + @system_includes = () if @automake_includes; + } + else + { + # Finally, adds any directory listed in the `dirlist' file. + if (open (DIRLIST, "$system_includes[0]/dirlist")) + { + while () + { + # Ignore '#' lines. + next if /^#/; + # strip off newlines and end-of-line comments + s/\s*\#.*$//; + chomp; + foreach my $dir (glob) + { + push (@system_includes, $dir) if -d $dir; + } + } + close (DIRLIST); + } + } +} + +################################################################ + +parse_WARNINGS; # Parse the WARNINGS environment variable. +parse_arguments; +$configure_ac = require_configure_ac; + +# We may have to rerun aclocal if some file have been installed, but +# it should not happen more than once. The reason we must run again +# is that once the file has been moved from /usr/share/aclocal/ to the +# local m4/ directory it appears at a new place in the search path, +# hence it should be output at a different position in aclocal.m4. If +# we did not rerun aclocal, the next run of aclocal would produce a +# different aclocal.m4. +my $loop = 0; +while (1) + { + ++$loop; + prog_error "Too many loops." if $loop > 2; + + reset_maps; + scan_m4_files; + scan_configure; + last if $exit_code; + my %macro_traced = trace_used_macros; + last if write_aclocal ($output_file, keys %macro_traced); + last if $dry_run; + } +check_acinclude; + +exit $exit_code; + +### Setup "GNU" style for perl-mode and cperl-mode. +## Local Variables: +## perl-indent-level: 2 +## perl-continued-statement-offset: 2 +## perl-continued-brace-offset: 0 +## perl-brace-offset: 0 +## perl-brace-imaginary-offset: 0 +## perl-label-offset: -2 +## cperl-indent-level: 2 +## cperl-brace-offset: 0 +## cperl-continued-brace-offset: 0 +## cperl-label-offset: -2 +## cperl-extra-newline-before-brace: t +## cperl-merge-trailing-else: nil +## cperl-continued-statement-offset: 2 +## End: diff --git a/bin/aclocal-1.7 b/bin/aclocal-1.7 deleted file mode 100644 index ea2a104f..00000000 --- a/bin/aclocal-1.7 +++ /dev/null @@ -1,475 +0,0 @@ -#!/bin/perl -# -*- perl -*- -# Makefile. Generated from Makefile.in by configure. - -eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; esac' - if 0; - -# aclocal - create aclocal.m4 by scanning configure.ac - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Written by Tom Tromey . - -BEGIN -{ - my $perllibdir = $ENV{'perllibdir'} || '/usr/share/automake-1.7'; - unshift @INC, $perllibdir; -} - -use Automake::General; -use Automake::XFile; - -# Some constants. -$VERSION = '1.7.1'; -$APIVERSION = '1.7'; -$PACKAGE = 'automake'; -# Note that this isn't pkgdatadir, but a separate directory. -# Note also that the versioned directory is handled later. -$acdir = '/usr/share/aclocal'; -$default_acdir = $acdir; -# contains a list of directories, one per line, to be added -# to the dirlist in addition to $acdir, as if -I had been -# added to the command line. If acdir has been redirected, -# we will also check the specified acdir (this is done later). -$default_dirlist = "$default_acdir/dirlist"; - -# Some globals. - -# Exit status. -$exit_status = 0; - -# Name of the top autoconf input: `configure.ac' or `configure.in'. -$configure_ac = find_configure_ac; - -# Text to output. -$output = ''; - -# Output file name. -$output_file = 'aclocal.m4'; - -# Which macros have been seen. -%macro_seen = (); - -# Which files have been seen. -%file_seen = (); - -# Map macro names to file names. -%map = (); - -# Map file names to file contents. -%file_contents = (); - -# How much to say. -$verbose = 0; - -# Matches a macro definition. -# AC_DEFUN([macroname], ...) -# or -# AC_DEFUN(macroname, ...) -# When macroname is `['-quoted , we accept any character in the name, -# except `]'. Otherwise macroname stops on the first `]', `,', `)', -# or `\n' encountered. -$ac_defun_rx = "A[CU]_DEFUN\\((?:\\[([^]]+)\\]|([^],)\n]+))"; - -# Matches an AC_REQUIRE line. -$ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)"; - - - -local (@dirlist) = &parse_arguments (@ARGV); -&scan_m4_files (@dirlist); -&scan_configure; -if (! $exit_status) -{ - &write_aclocal; -} -&check_acinclude; - -exit $exit_status; - -################################################################ - -# Print usage and exit. -sub usage ($) -{ - local ($status) = @_; - - print "Usage: aclocal [OPTIONS] ...\n\n"; - print "\ -Generate `aclocal.m4' by scanning `configure.ac' or `configure.in' - - --acdir=DIR directory holding config files - --help print this help, then exit - -I DIR add directory to search list for .m4 files - --output=FILE put output in FILE (default aclocal.m4) - --print-ac-dir print name of directory holding m4 files - --verbose don't be silent - --version print version number, then exit - -Report bugs to .\n"; - - exit $status; -} - -# Parse command line. -sub parse_arguments (@) -{ - local (@arglist) = @_; - local (@dirlist); - local ($print_and_exit) = 0; - - while (@arglist) - { - if ($arglist[0] =~ /^--acdir=(.+)$/) - { - $acdir = $1; - } - elsif ($arglist[0] =~/^--output=(.+)$/) - { - $output_file = $1; - } - elsif ($arglist[0] eq '-I') - { - shift (@arglist); - push (@dirlist, $arglist[0]); - } - elsif ($arglist[0] eq '--print-ac-dir') - { - $print_and_exit = 1; - } - elsif ($arglist[0] eq '--verbose') - { - ++$verbose; - } - elsif ($arglist[0] eq '--version') - { - print "aclocal (GNU $PACKAGE) $VERSION\n\n"; - print "Copyright (C) 2002 Free Software Foundation, Inc.\n"; - print "This is free software; see the source for copying conditions. There is NO\n"; - print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"; - print "Written by Tom Tromey \n"; - exit 0; - } - elsif ($arglist[0] eq '--help') - { - &usage (0); - } - else - { - die "aclocal: unrecognized option -- `$arglist[0]'\nTry `aclocal --help' for more information.\n"; - } - - shift (@arglist); - } - - if ($print_and_exit) - { - print $acdir, "\n"; - exit 0; - } - - $default_dirlist="$acdir/dirlist" - if $acdir ne $default_acdir; - - # Search the versioned directory near the end, and then the - # unversioned directory last. Only do this if the user didn't - # override acdir. - push (@dirlist, "$acdir-$APIVERSION") - if $acdir eq $default_acdir; - - # By default $(datadir)/aclocal doesn't exist. We don't want to - # get an error in the case where we are searching the default - # directory and it hasn't been created. - push (@dirlist, $acdir) - unless $acdir eq $default_acdir && ! -d $acdir; - - # Finally, adds any directory listed in the `dirlist' file. - if (open (DEFAULT_DIRLIST, $default_dirlist)) - { - while () - { - # Ignore '#' lines. - next if /^#/; - # strip off newlines and end-of-line comments - s/\s*\#.*$//; - chomp ($contents=$_); - if (-d $contents ) - { - push (@dirlist, $contents); - } - } - close (DEFAULT_DIRLIST); - } - - - return @dirlist; -} - -################################################################ - -sub scan_configure () -{ - die "aclocal: `configure.ac' or `configure.in' is required\n" - if !$configure_ac; - - open (CONFIGURE, $configure_ac) - || die "aclocal: couldn't open `$configure_ac': $!\n"; - - # Make sure we include acinclude.m4 if it exists. - if (-f 'acinclude.m4') - { - &add_file ('acinclude.m4'); - } - - while () - { - # Remove comments from current line. - s/\bdnl\b.*$//; - s/\#.*$//; - - # Search for things we know about. The "search" sub is - # constructed dynamically by scan_m4_files. The last - # parenthethical match makes sure we don't match things that - # look like macro assignments or AC_SUBSTs. - if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/) - { - # Macro not found, but AM_ prefix found. - warn "aclocal: $configure_ac: $.: macro `$2' not found in library\n"; - $exit_status = 1; - } - } - - close (CONFIGURE); -} - -################################################################ - -# Check macros in acinclude.m4. If one is not used, warn. -sub check_acinclude () -{ - local ($key); - - foreach $key (keys %map) - { - next unless $map{$key} eq 'acinclude.m4'; - if (! $macro_seen{$key}) - { - # FIXME: should print line number of acinclude.m4. - warn "aclocal: macro `$key' defined in acinclude.m4 but never used\n"; - } - } -} - -################################################################ - -# Scan all the installed m4 files and construct a map. -sub scan_m4_files (@) -{ - local (@dirlist) = @_; - - # First, scan acinclude.m4 if it exists. - if (-f 'acinclude.m4') - { - $file_contents{'acinclude.m4'} = &scan_file ('acinclude.m4'); - } - - local ($m4dir); - foreach $m4dir (@dirlist) - { - opendir (DIR, $m4dir) - || die "aclocal: couldn't open directory `$m4dir': $!\n"; - local ($file, $fullfile); - foreach $file (sort grep (! /^\./, readdir (DIR))) - { - # Only examine .m4 files. - next unless $file =~ /\.m4$/; - - # Skip some files when running out of srcdir. - next if $file eq 'aclocal.m4'; - - $fullfile = $m4dir . '/' . $file; - $file_contents{$fullfile} = &scan_file ($fullfile); - } - closedir (DIR); - } - - # Construct a new function that does the searching. We use a - # function (instead of just evalling $search in the loop) so that - # "die" is correctly and easily propagated if run. - my $search = "sub search {\nmy \$found = 0;\n"; - foreach my $key (reverse sort keys %map) - { - $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key - . '"); $found = 1; }' . "\n"); - } - $search .= "return \$found;\n};\n"; - eval $search; - die "internal error: $@\n search is $search" if $@; -} - -################################################################ - -# Add a macro to the output. -sub add_macro ($) -{ - local ($macro) = @_; - - # We want to ignore AC_ macros. However, if an AC_ macro is - # defined in (eg) acinclude.m4, then we want to make sure we mark - # it as seen. - return if $macro =~ /^AC_/ && ! defined $map{$macro}; - - if (! defined $map{$macro}) - { - warn "aclocal: macro `$macro' required but not defined\n"; - $exit_status = 1; - return; - } - - print STDERR "aclocal: saw macro $macro\n" if $verbose; - $macro_seen{$macro} = 1; - &add_file ($map{$macro}); -} - -# Add a file to output. -sub add_file ($) -{ - local ($file) = @_; - - # Only add a file once. - return if ($file_seen{$file}); - $file_seen{$file} = 1; - - $output .= $file_contents{$file} . "\n"; - my (@rlist); - foreach (split ("\n", $file_contents{$file})) - { - # Remove comments from current line. - s/\bdnl\b.*$//; - s/\#.*$//; - - if (/$ac_require_rx/g) - { - push (@rlist, $1 || $2); - } - - # The search function is constructed dynamically by - # scan_m4_files. The last parenthethical match makes sure we - # don't match things that look like macro assignments or - # AC_SUBSTs. - if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/) - { - # Macro not found, but AM_ prefix found. - warn "aclocal: $configure_ac: $.: macro `$2' not found in library\n"; - $exit_status = 1; - } - } - - local ($macro); - foreach $macro (@rlist) - { - &add_macro ($macro); - } -} - -# Scan a single M4 file. Return contents. -sub scan_file ($) -{ - local ($file) = @_; - - my $fh = new Automake::XFile $file; - my $contents = ''; - while ($_ = $fh->getline) - { - # Ignore `##' lines. - next if /^##/; - - $contents .= $_; - - if (/$ac_defun_rx/) - { - if (! defined $map{$1 || $2}) - { - $map{$1 || $2} = $file; - } - - # Note: we used to give an error here if we saw a - # duplicated macro. However, this turns out to be - # extremely unpopular. It causes actual problems which - # are hard to work around, especially when you must - # mix-and-match tool versions. - - print STDERR "aclocal: found macro $1 in $file: $.\n" if $verbose; - } - } - - return $contents; -} - -################################################################ - -# Write output. -sub write_aclocal () -{ - return if ! length ($output); - - print STDERR "aclocal: writing $output_file\n" if $verbose; - - my $out = new Automake::XFile "> $output_file"; - -# We used to print `# $output_file generated automatically etc.' But -# this creates spurious differences when using autoreconf. Autoreconf -# creates aclocal.m4t and then rename it to aclocal.m4, but the -# rebuild rules generated by Automake create aclocal.m4 directly -- -# this would gives two ways to get the same file, with a different -# name in the header. - print $out -"# generated automatically by aclocal $VERSION -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -$output"; -} - -### Setup "GNU" style for perl-mode and cperl-mode. -## Local Variables: -## perl-indent-level: 2 -## perl-continued-statement-offset: 2 -## perl-continued-brace-offset: 0 -## perl-brace-offset: 0 -## perl-brace-imaginary-offset: 0 -## perl-label-offset: -2 -## cperl-indent-level: 2 -## cperl-brace-offset: 0 -## cperl-continued-brace-offset: 0 -## cperl-label-offset: -2 -## cperl-extra-newline-before-brace: t -## cperl-merge-trailing-else: nil -## cperl-continued-statement-offset: 2 -## End: diff --git a/bin/autoconf b/bin/autoconf index 447b771b..e8d91fa4 100644 --- a/bin/autoconf +++ b/bin/autoconf @@ -3,27 +3,91 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -34,21 +98,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -56,21 +121,288 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + # autoconf -- create `configure' using m4 macros -# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. + +# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003, +# 2004, 2005, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -84,8 +416,8 @@ echo X/"$0" | # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. usage="\ Usage: $0 [OPTION] ... [TEMPLATE-FILE] @@ -113,7 +445,7 @@ Warning categories include: \`none' turn off all the warnings \`error' warnings are error -The environment variable \`WARNINGS' is honored. +The environment variables \`M4' and \`WARNINGS' are honored. Library directories: -B, --prepend-include=DIR prepend directory DIR to search path @@ -128,64 +460,43 @@ In tracing mode, no configuration script is created. Report bugs to ." version="\ -autoconf (GNU Autoconf) 2.56 -Written by David J. MacKenzie and Akim Demaille. - -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -me=`$as_basename $0 || -$as_expr X/$0 : '.*/\([^/][^/]*\)/*$' \| \ - X$0 : 'X\(//\)$' \| \ - X$0 : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/$0 | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` +autoconf (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. + +Written by David J. MacKenzie and Akim Demaille." help="\ -Try \`$me --help' for more information." +Try \`$as_me --help' for more information." exit_missing_arg="\ -echo \"$me: option \\\`\$1' requires an argument\" >&2 +echo \"$as_me: option \\\`\$1' requires an argument\" >&2 echo \"\$help\" >&2 exit 1" # Variables. : ${AUTOM4TE='/usr/bin/autom4te'} -dir=`(dirname $0) 2>/dev/null || -$as_expr X$0 : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$0 : 'X\(//\)[^/]' \| \ - X$0 : 'X\(//\)$' \| \ - X$0 : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X$0 | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` +autom4te_options= outfile= verbose=: # Parse command line. while test $# -gt 0 ; do option=`expr "x$1" : 'x\(--[^=]*\)' \| \ - "x$1" : 'x\(-.\)'` + "x$1" : 'x\(-.\)'` optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \ - "x$1" : 'x-.\(.*\)'` + "x$1" : 'x-.\(.*\)'` case $1 in --version | -V ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; --verbose | -v ) verbose=echo - AUTOM4TE="$AUTOM4TE $1"; shift ;; + autom4te_options="$autom4te_options $1"; shift ;; # Arguments passed as is to autom4te. --debug | -d | \ @@ -193,26 +504,25 @@ while test $# -gt 0 ; do --include=* | -I?* | \ --prepend-include=* | -B?* | \ --warnings=* | -W?* ) - AUTOM4TE="$AUTOM4TE $1"; shift ;; + autom4te_options="$autom4te_options '$1'"; shift ;; # Options with separated arg passed as is to autom4te. - --include | -I | \ - --prepend-include | -B | \ + --include | -I | \ + --prepend-include | -B | \ --warnings | -W ) test $# = 1 && eval "$exit_missing_arg" - AUTOM4TE="$AUTOM4TE $option $2" - shift 2 ;; + autom4te_options="$autom4te_options $option '$2'" + shift; shift ;; --trace=* | -t?* ) traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'" shift ;; --trace | -t ) test $# = 1 && eval "$exit_missing_arg" - shift - traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'" - shift ;; + traces="$traces --trace='"`echo "$2" | sed "s/'/'\\\\\\\\''/g"`"'" + shift; shift ;; --initialization | -i ) - AUTOM4TE="$AUTOM4TE --melt" + autom4te_options="$autom4te_options --melt" shift;; --output=* | -o?* ) @@ -220,9 +530,8 @@ while test $# -gt 0 ; do shift ;; --output | -o ) test $# = 1 && eval "$exit_missing_arg" - shift - outfile=$1 - shift ;; + outfile=$2 + shift; shift ;; -- ) # Stop option processing shift; break ;; @@ -230,7 +539,7 @@ while test $# -gt 0 ; do break ;; -* ) exec >&2 - echo "$me: invalid option $1" + echo "$as_me: invalid option $1" echo "$help" exit 1 ;; * ) @@ -243,21 +552,21 @@ case $# in 0) if test -f configure.ac; then if test -f configure.in; then - echo "$me: warning: both \`configure.ac' and \`configure.in' are present." >&2 - echo "$me: warning: proceeding with \`configure.ac'." >&2 + echo "$as_me: warning: both \`configure.ac' and \`configure.in' are present." >&2 + echo "$as_me: warning: proceeding with \`configure.ac'." >&2 fi infile=configure.ac elif test -f configure.in; then infile=configure.in else - echo "$me: no input file" >&2 + echo "$as_me: no input file" >&2 exit 1 fi test -z "$traces" && test -z "$outfile" && outfile=configure;; 1) # autom4te doesn't like `-'. test "x$1" != "x-" && infile=$1 ;; *) exec >&2 - echo "$me: invalid number of arguments." + echo "$as_me: invalid number of arguments." echo "$help" (exit 1); exit 1 ;; esac @@ -266,6 +575,8 @@ esac test -z "$outfile" && outfile=- # Run autom4te with expansion. -eval set \$AUTOM4TE --language=autoconf --output=\$outfile "$traces" \$infile -$verbose "$me: running $*" >&2 -exec "$@" +eval set x $autom4te_options \ + --language=autoconf --output=\$outfile "$traces" \$infile +shift +$verbose "$as_me: running $AUTOM4TE $*" >&2 +exec "$AUTOM4TE" "$@" diff --git a/bin/autoheader b/bin/autoheader index 5ccf6c5a..733509e6 100644 --- a/bin/autoheader +++ b/bin/autoheader @@ -1,13 +1,14 @@ #! /bin/perl # -*- Perl -*- -# @configure_input@ +# Generated from autoheader.in; do not edit by hand. eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; esac' if 0; # autoheader -- create `config.h.in' from `configure.ac' -# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. + +# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,18 +22,28 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # Written by Roland McGrath. # Rewritten in Perl by Akim Demaille. BEGIN { - my $perllibdir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; - unshift @INC, "$perllibdir"; + my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; + unshift @INC, "$datadir"; + + # Override SHELL. On DJGPP SHELL may not be set to a shell + # that can handle redirection and quote arguments correctly, + # e.g.: COMMAND.COM. For DJGPP always use the shell that configure + # has detected. + $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); } +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use Autom4te::Configure_ac; +use Autom4te::FileUtils; use Autom4te::General; use Autom4te::XFile; use strict; @@ -46,13 +57,11 @@ local $config_h; my $config_h_in; my @prepend_include; my @include; -my @warning; # $HELP # ----- -$help = <<"END"; -Usage: $0 [OPTION] ... [TEMPLATE-FILE] +$help = "Usage: $0 [OPTION] ... [TEMPLATE-FILE] Create a template file of C \`\#define\' statements for \`configure\' to use. To this end, scan TEMPLATE-FILE, or \`configure.ac\' if present, @@ -65,31 +74,26 @@ or else \`configure.in\'. -f, --force consider all files obsolete -W, --warnings=CATEGORY report the warnings falling in CATEGORY -Warning categories include: - \`obsolete\' obsolete constructs - \`all\' all the warnings - \`no-CATEGORY\' turn off the warnings on CATEGORY - \`none\' turn off all the warnings - \`error\' warnings are error +" . Autom4te::ChannelDefs::usage () . " Library directories: -B, --prepend-include=DIR prepend directory DIR to search path -I, --include=DIR append directory DIR to search path Report bugs to . -END +"; # $VERSION # -------- -$version = <<"END"; -autoheader (GNU Autoconf) 2.56 -Written by Roland McGrath and Akim Demaille. +$version = "autoheader (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -END +Written by Roland McGrath and Akim Demaille. +"; ## ---------- ## @@ -104,15 +108,14 @@ sub parse_args () { my $srcdir; - getopt ('I|include=s' => \@include, + parse_WARNINGS; + getopt ('I|include=s' => \@include, 'B|prepend-include=s' => \@prepend_include, - 'W|warnings=s' => \@warning); + 'W|warnings=s' => \&parse_warnings); if (! @ARGV) { - my $configure_ac = find_configure_ac; - error "no input file" - unless $configure_ac; + my $configure_ac = require_configure_ac; push @ARGV, $configure_ac; } } @@ -123,6 +126,7 @@ sub parse_args () ## -------------- ## mktmpdir ('ah'); +switch_warning 'obsolete'; parse_args; # Preach. @@ -140,23 +144,23 @@ if ($config_h_top || $config_h_bot || $acconfig_h) is deprecated and discouraged. Using the third argument of \`AC_DEFINE\' and - \`AC_DEFINE_UNQUOTED\' allows to define a template without + \`AC_DEFINE_UNQUOTED\' allows one to define a template without \`acconfig.h\': - AC_DEFINE([NEED_MAIN], 1, - [Define if a function \`main\' is needed.]) + AC_DEFINE([NEED_FUNC_MAIN], 1, + [Define if a function \`main\' is needed.]) More sophisticated templates can also be produced, see the documentation. END $msg =~ s/^ /WARNING: /gm; - print STDERR $msg; + msg 'obsolete', $msg; } # Set up autoconf. -my $autoconf = "$autom4te --language=autoconf "; -$autoconf .= join (' ', map { "--include=$_" } @include); -$autoconf .= join (' ', map { "--prepend-include=$_" } @prepend_include); +my $autoconf = "'$autom4te' --language=autoconf "; +$autoconf .= join (' ', map { "--include='$_'" } @include); +$autoconf .= join (' ', map { "--prepend-include='$_'" } @prepend_include); $autoconf .= ' --debug' if $debug; $autoconf .= ' --force' if $force; $autoconf .= ' --verbose' if $verbose; @@ -166,7 +170,7 @@ $autoconf .= ' --verbose' if $verbose; # ----------------------- # # Source what the traces are trying to tell us. -verbose "$me: running $autoconf to trace from $ARGV[0]"; +verb "$me: running $autoconf to trace from $ARGV[0]"; xsystem ("$autoconf" # If you change this list, update the # `Autoheader-preselections' section of autom4te.in. @@ -179,8 +183,11 @@ local (%verbatim, %symbol); debug "$me: \`do'ing $tmp/traces.pl:\n" . `sed 's/^/| /' $tmp/traces.pl`; do "$tmp/traces.pl"; warn "couldn't parse $tmp/traces.pl: $@" if $@; -error "error: AC_CONFIG_HEADERS not found in $ARGV[0]" - unless $config_h; +unless ($config_h) + { + error "error: AC_CONFIG_HEADERS not found in $ARGV[0]"; + exit 1; + } # We template only the first CONFIG_HEADER. $config_h =~ s/ .*//; @@ -262,10 +269,10 @@ $out->close; } foreach (sort keys %symbol) { - print STDERR "$me: missing template: $_\n"; + msg 'syntax', "warning: missing template: $_"; if ($suggest_ac_define) { - print STDERR "Use AC_DEFINE([$_], [], [Description])"; + msg 'syntax', "Use AC_DEFINE([$_], [], [Description])"; $suggest_ac_define = 0; } @@ -274,7 +281,7 @@ $out->close; if keys %symbol; } -update_file ("$tmp/config.hin", "$config_h_in"); +update_file ("$tmp/config.hin", "$config_h_in", $force); ### Setup "GNU" style for perl-mode and cperl-mode. ## Local Variables: diff --git a/bin/autom4te b/bin/autom4te index ad8fde33..65c3b169 100644 --- a/bin/autom4te +++ b/bin/autom4te @@ -1,12 +1,12 @@ #! /bin/perl -w # -*- perl -*- -# @configure_input@ +# Generated from autom4te.in; do not edit by hand. eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; esac' if 0; # autom4te - Wrapper around M4 libraries. -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,214 +20,29 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. BEGIN { - my $datadir = ($ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'); - unshift @INC, "$datadir"; + my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; + unshift @INC, $datadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell + # that can handle redirection and quote arguments correctly, + # e.g.: COMMAND.COM. For DJGPP always use the shell that configure + # has detected. + $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); } -## --------- ## -## Request. ## -## --------- ## - -package Request; - -use Data::Dumper; +use Autom4te::C4che; +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use Autom4te::FileUtils; use Autom4te::General; -use Autom4te::Struct; use Autom4te::XFile; -use Carp; -use strict; - -# List of requests. -# We can't declare it `my' as the loading, performed via `do', -# would refer to another scope, and @request would not be updated. -# It used to work with `my' vars, and I don't know whether the current -# behavior (5.6) is wanted or not. -use vars qw(@request); - -struct - ( - # The key of the cache files. - 'id' => "\$", - # True iff %MACRO contains all the macros we want to trace. - 'valid' => "\$", - # The include path. - 'path' => '@', - # The set of input files. - 'input' => '@', - # The set of macros currently traced. - 'macro' => '%', - ); - - -# $REQUEST-OBJ -# retrieve ($SELF, %ATTR) -# ----------------------- -# Find a request with the same path and input. -# Private. -sub retrieve -{ - my ($self, %attr) = @_; - - foreach (@request) - { - # Same path. - next - if join ("\n", @{$_->path}) ne join ("\n", @{$attr{path}}); - - # Same inputs. - next - if join ("\n", @{$_->input}) ne join ("\n", @{$attr{input}}); - - # Found it. - return $_; - } - - return undef; -} - - -# $REQUEST-OBJ -# register ($SELF, %ATTR) -# ----------------------- -# NEW should not be called directly. -# Private. -sub register ($%) -{ - my ($self, %attr) = @_; - - # path and input are the only ID for a request object. - my $obj = $self->new ('path' => $attr{path}, - 'input' => $attr{input}); - push @request, $obj; - - # Assign an id for cache file. - $obj->id ("$#request"); - - return $obj; -} - - -# $REQUEST-OBJ -# request($SELF, %REQUEST) -# ------------------------ -# Return a request corresponding to $REQUEST{path} and $REQUEST{input}, -# using a cache value if it exists. -sub request ($%) -{ - my ($self, %request) = @_; - - my $req = Request->retrieve (%request) || Request->register (%request); - - # If there are new traces to produce, then we are not valid. - foreach (@{$request{'macro'}}) - { - if (! exists ${$req->macro}{$_}) - { - ${$req->macro}{$_} = 1; - $req->valid (0); - } - } - - # It would be great to have $REQ check that it up to date wrt its - # dependencies, but that requires getting traces (to fetch the - # included files), which is out of the scope of Request - # (currently?). - - return $req; -} - -# Serialize a request or all the current requests. -sub marshall -{ - my ($caller) = @_; - my $res = ''; - - if (ref ($caller)) - { - # CALLER is an object: instance method. - my $marshall = Data::Dumper->new ([$caller]); - $marshall->Indent(2)->Terse(0); - $res = $marshall->Dump . "\n"; - } - else - { - # CALLER is the package: class method. - my $marshall = Data::Dumper->new ([\@request], [qw (*request)]); - $marshall->Indent(2)->Terse(0); - $res = $marshall->Dump . "\n"; - } - - return $res; -} - - -# includes_p (@MACRO) -# ------------------- -# Does this request covers all the @MACRO. -sub includes_p -{ - my ($self, @macro) = @_; - - foreach (@macro) - { - return 0 - if ! exists ${$self->macro}{$_}; - } - return 1; -} - - -# SAVE ($FILENAME) -# ---------------- -sub save -{ - my ($self, $filename) = @_; - - croak "$me: cannot save a single request\n" - if ref ($self); - - my $requests = new Autom4te::XFile ("> $filename"); - print $requests - "# This file was created by $me.\n", - "# It contains the lists of macros which have been traced.\n", - "# It can be safely removed.\n", - "\n", - $self->marshall; -} - - -# LOAD ($FILE) -# ------------ -sub load -{ - my ($self, $file) = @_; - - croak "$me: cannot load a single request\n" - if ref ($self); - - (my $return) = do "$file"; - - croak "$me: cannot parse $file: $@\n" if $@; - croak "$me: cannot do $file: $!\n" unless defined $return; - croak "$me: cannot run $file\n" unless $return; -} - - -## ---------- ## -## Autom4te. ## -## ---------- ## - -package Autom4te; - -use Autom4te::General; use File::Basename; -use Autom4te::XFile; use strict; # Data directory. @@ -245,11 +60,12 @@ my $mode = "0666"; my $melt = 0; # Names of the cache directory, cache directory index, trace cache -# prefix, and output cache prefix. +# prefix, and output cache prefix. And the IO objet for the index. my $cache; my $icache; my $tcache; my $ocache; +my $icache_file; # The macros to trace mapped to their format, as specified by the # user. @@ -260,30 +76,26 @@ my %trace; # `m4_pattern_allow' to check the output. # # FIXME: What about `sinclude'? -my @preselect = ('include', 'm4_pattern_allow', 'm4_pattern_forbid'); - -# List of warnings. -my @warning; +my @preselect = ('include', + 'm4_pattern_allow', 'm4_pattern_forbid', + '_m4_warn'); # M4 include path. my @include; -# 0 for EXIT_SUCCESS. -my $exit_status = 0; - # Do we freeze? my $freeze = 0; # $M4. my $m4 = $ENV{"M4"} || '/bin/m4'; # Some non-GNU m4's don't reject the --help option, so give them /dev/null. -error "need GNU m4 1.4 or later: $m4" +fatal "need GNU m4 1.4 or later: $m4" if system "$m4 --help &1 | grep reload-state >/dev/null"; # Set some high recursion limit as the default limit, 250, has already # been hit with AC_OUTPUT. Don't override the user's choice. $m4 .= ' --nesting-limit=1024' - if " $m4 " !~ / (--nesting-limit|-L) /; + if " $m4 " !~ / (--nesting-limit(=[0-9]+)?|-L[0-9]*) /; # @M4_BUILTIN -- M4 builtins and a useful comment. @@ -343,8 +155,7 @@ my %m4_builtin_alternate_name; # $HELP # ----- -$help = << "EOF"; -Usage: $0 [OPTION] ... [FILES] +$help = "Usage: $0 [OPTION] ... [FILES] Run GNU M4 on the FILES, avoiding useless runs. Output the traces if tracing, the frozen file if freezing, otherwise the expansion of the FILES. @@ -378,16 +189,9 @@ Languages include: \`M4sh\' create M4sh shell scripts \`M4sugar\' create M4sugar output -Warning categories include: - \`cross\' cross compilation issues - \`obsolete\' obsolete constructs - \`syntax\' dubious syntactic constructs - \`all\' all the warnings - \`no-CATEGORY\' turn off the warnings on CATEGORY - \`none\' turn off all the warnings - \`error\' warnings are error +" . Autom4te::ChannelDefs::usage . " -The environment variable \`WARNINGS\' is honored. +The environment variables \`M4\' and \`WARNINGS\' are honored. Library directories: -B, --prepend-include=DIR prepend directory DIR to search path @@ -401,17 +205,18 @@ Freezing: -F, --freeze produce an M4 frozen state file for FILES Report bugs to . -EOF +"; # $VERSION # -------- $version = <<"EOF"; -autom4te (GNU Autoconf) 2.56 -Written by Akim Demaille. +autom4te (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Akim Demaille. EOF @@ -465,7 +270,7 @@ sub load_configuration ($) my $type = shift @words; if ($type eq 'begin-language:') { - error "$file:$.: end-language missing for: $lang" + fatal "$file:$.: end-language missing for: $lang" if defined $lang; $lang = lc $words[0]; } @@ -477,7 +282,7 @@ sub load_configuration ($) } elsif ($type eq 'args:') { - error "$file:$.: no current language" + fatal "$file:$.: no current language" unless defined $lang; push @{$language{$lang}}, @words; } @@ -527,11 +332,12 @@ sub parse_args () # Process the arguments for real this time. my @trace; my @prepend_include; + parse_WARNINGS; getopt ( # Operation modes: "o|output=s" => \$output, - "W|warnings=s" => \@warning, + "W|warnings=s" => \&parse_warnings, "m|mode=s" => \$mode, "M|melt" => \$melt, @@ -555,7 +361,7 @@ sub parse_args () "no-cache" => sub { $cache = undef; }, ); - error "too few arguments + fatal "too few arguments Try `$me --help' for more information." unless @ARGV; @@ -564,7 +370,7 @@ Try `$me --help' for more information." # And it implies melting: there is risk not to update properly using # old frozen files, and worse yet: we could load a frozen file and # refreeze it! A sort of caching :) - error "cannot freeze and trace" + fatal "cannot freeze and trace" if $freeze && @trace; $melt = 1 if $freeze; @@ -643,31 +449,20 @@ sub handle_m4 ($@) { my ($req, @macro) = @_; - # The warnings are the concatenation of 1. application's defaults, - # 2. $WARNINGS, $3 command line options, in that order. - # Set them in the order expected by the M4 macros: the converse. - my $m4_warnings = - lc join (',', reverse (split (',', ($ENV{'WARNINGS'} || '')), - map { split /,/ } @warning)); - - # GNU m4 appends when using --error-output. + # GNU m4 appends when using --debugfile/--error-output. unlink ($tcache . $req->id . "t"); # Run m4. # - # Neutralize its stdin, so that GNU M4 1.5 doesn't neutralize SIGINT. - # # We don't output directly to the cache files, to avoid problems # when we are interrupted (that leaves corrupted files). xsystem ("$m4" . join (' --include=', '', @include) - . " --define=m4_warnings=$m4_warnings" . ' --debug=aflq' . (!exists $ENV{'AUTOM4TE_NO_FATAL'} ? ' --fatal-warning' : '') . " --error-output=$tcache" . $req->id . "t" . join (' --trace=', '', sort @macro) . " " . files_to_options (@ARGV) - . ' $ocache" . $req->id . "t"); # Everything went ok: preserve the outputs. @@ -675,7 +470,7 @@ sub handle_m4 ($@) { use File::Copy; move ("${file}t", "$file") - or error "cannot not rename ${file}t as $file: $!"; + or fatal "cannot rename ${file}t as $file: $!"; } } @@ -720,7 +515,7 @@ sub handle_output ($$) { my ($req, $output) = @_; - verbose "creating $output"; + verb "creating $output"; # Load the forbidden/allowed patterns. handle_traces ($req, "$tmp/patterns", @@ -733,10 +528,10 @@ sub handle_output ($$) my $forbidden = join ('|', map { /^forbid:([^:]+)/ } @patterns) || "^\$"; my $allowed = join ('|', map { /^allow:([^:]+)/ } @patterns) || "^\$"; - verbose "forbidden tokens: $forbidden"; - verbose "forbidden token : $_ => $forbidden{$_}" + verb "forbidden tokens: $forbidden"; + verb "forbidden token : $_ => $forbidden{$_}" foreach (sort keys %forbidden); - verbose "allowed tokens: $allowed"; + verb "allowed tokens: $allowed"; # Read the (cached) raw M4 output, produce the actual result. We # have to use the 2nd arg to have Autom4te::XFile honor the third, but then @@ -751,7 +546,7 @@ sub handle_output ($$) { $out->open($output, O_CREAT | O_WRONLY | O_TRUNC, oct ($mode)); } - error "cannot create $output: $!" + fatal "cannot create $output: $!" unless $out; my $in = new Autom4te::XFile ($ocache . $req->id); @@ -775,7 +570,7 @@ sub handle_output ($$) foreach (split (/\W+/)) { $prohibited{$_} = $. - if /$forbidden/o && !/$allowed/o && ! exists $prohibited{$_}; + if !/^$/ && /$forbidden/o && !/$allowed/o && ! exists $prohibited{$_}; } # Performed *last*: the empty quadrigraph. @@ -792,7 +587,7 @@ sub handle_output ($$) # This is unsatisfying but... my $prohibited = '\b(' . join ('|', keys %prohibited) . ')\b'; my $file = new Autom4te::XFile ($ARGV[$#ARGV]); - $exit_status = 1; + $exit_code = 1; while ($_ = $file->getline) { @@ -853,7 +648,7 @@ sub trace_format_to_m4 ($) } # $x, no separator given. elsif (s/^\$([fldn\$])//) - { + { $res .= $escape{$1}; } # $.x or ${sep}x. @@ -877,14 +672,14 @@ sub trace_format_to_m4 ($) } } elsif (/^(\$.)/) - { + { error "invalid escape: $1"; - } + } else - { + { s/^([^\$]+)//; $res .= $1; - } + } } $_ = $underscore; @@ -906,7 +701,7 @@ sub handle_traces ($$%) { my ($req, $output, %trace) = @_; - verbose "formatting traces for `$output': ", join (', ', sort keys %trace); + verb "formatting traces for `$output': " . join (', ', sort keys %trace); # Processing the traces. my $trace_m4 = new Autom4te::XFile (">$tmp/traces.m4"); @@ -924,26 +719,27 @@ sub handle_traces ($$%) # and no new line remains. define([_at_at], [at_ifelse([$#], [1], [], - [$#], [2], [[[$2]]], - [[[$2]][$1]$0([$1], at_shift(at_shift($@)))])]) + [$#], [2], [[[$2]]], + [[[$2]][$1]$0([$1], at_shift(at_shift($@)))])]) define([_at_percent], [at_ifelse([$#], [1], [], - [$#], [2], [at_flatten([$2])], - [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])]) + [$#], [2], [at_flatten([$2])], + [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])]) define([_at_star], [at_ifelse([$#], [1], [], - [$#], [2], [[$2]], - [[$2][$1]$0([$1], at_shift(at_shift($@)))])]) + [$#], [2], [[$2]], + [[$2][$1]$0([$1], at_shift(at_shift($@)))])]) # FLATTEN quotes its result. # Note that the second pattern is `newline, tab or space'. Don't lose # the tab! define([at_flatten], - [at_patsubst(at_patsubst(at_patsubst([[[$1]]], [\\\n]), - [[\n\t ]+], [ ]), - [^ *\(.*\) *$], [[\1]])]) + [at_patsubst(at_patsubst(at_patsubst(at_patsubst([[[[$1]]]], [\\\n]), + [[\n\t ]+], [ ]), + [ *\(.\)$], [\1]), + [^ *\(.*\)], [[\1]])]) define([at_args], [at_shift(at_shift(at_shift(at_shift(at_shift($@)))))]) define([at_at], [_$0([$1], at_args($@))]) @@ -1038,7 +834,7 @@ EOF # It makes no sense to try to transform __oline__. s/\@<:\@/[/g; s/\@:>\@/]/g; - s/\@\$\|\@/\$/g; + s/\@S\|\@/\$/g; s/\@%:\@/#/g; s/\@&t\@//g; print $out $_; @@ -1124,7 +920,7 @@ sub freeze ($) $result =~ s/#.*\n//g; $result =~ s/^\n//mg; - error "freezing produced output:\n$result" + fatal "freezing produced output:\n$result" if $result; # If freezing produces output, something went wrong: a bad `divert', @@ -1144,7 +940,7 @@ sub freeze ($) mktmpdir ('am4t'); load_configuration ($ENV{'AUTOM4TE_CFG'} || "$datadir/autom4te.cfg"); load_configuration ("$ENV{'HOME'}/.autom4te.cfg") - if -f "$ENV{'HOME'}/.autom4te.cfg"; + if exists $ENV{'HOME'} && -f "$ENV{'HOME'}/.autom4te.cfg"; load_configuration (".autom4te.cfg") if -f ".autom4te.cfg"; parse_args; @@ -1153,26 +949,32 @@ parse_args; if ($freeze) { freeze ($output); - exit 0; + exit $exit_code; } # We need our cache directory. if (! -d "$cache") { mkdir "$cache", 0755 - or error "cannot create $cache: $!"; + or fatal "cannot create $cache: $!"; } +# Open the index for update, and lock it. autom4te handles several +# files, but the index is the first and last file to be update, so +# locking it is sufficient. +$icache_file = new Autom4te::XFile $icache, O_RDWR|O_CREAT; +$icache_file->lock (LOCK_EX); + # Read the cache index if available and older than autom4te itself. -# If autom4te is younger, then some structures such as Request, might +# If autom4te is younger, then some structures such as C4che, might # have changed, which would corrupt its processing. -Request->load ($icache) +Autom4te::C4che->load ($icache_file) if -f $icache && mtime ($icache) > mtime ($0); # Add the new trace requests. -my $req = Request->request ('input' => \@ARGV, - 'path' => \@include, - 'macro' => [keys %trace, @preselect]); +my $req = Autom4te::C4che->request ('input' => \@ARGV, + 'path' => \@include, + 'macro' => [keys %trace, @preselect]); # If $REQ's cache files are not up to date, or simply if the user # discarded them (-f), declare it invalid. @@ -1180,13 +982,35 @@ $req->valid (0) if $force || ! up_to_date ($req); # We now know whether we can trust the Request object. Say it. -verbose "$me: the trace request object is:\n" . $req->marshall; +verb "the trace request object is:\n" . $req->marshall; -# We need to run M4 if (i) the users wants it (--force), (ii) $REQ is +# We need to run M4 if (i) the user wants it (--force), (ii) $REQ is # invalid. handle_m4 ($req, keys %{$req->macro}) if $force || ! $req->valid; +# Issue the warnings each time autom4te was run. +my $separator = "\n" . ('-' x 25) . " END OF WARNING " . ('-' x 25) . "\n\n"; +handle_traces ($req, "$tmp/warnings", + ('_m4_warn' => "\$1::\$f:\$l::\$2::\$3$separator")); +# Swallow excessive newlines. +for (split (/\n*$separator\n*/o, contents ("$tmp/warnings"))) +{ + # The message looks like: + # | syntax::input.as:5::ouch + # | ::input.as:4: baz is expanded from... + # | input.as:2: bar is expanded from... + # | input.as:3: foo is expanded from... + # | input.as:5: the top level + my ($cat, $loc, $msg, $stacktrace) = split ('::', $_, 4); + msg $cat, $loc, "warning: $msg"; + for (split /\n/, $stacktrace) + { + my ($loc, $trace) = split (': ', $_, 2); + msg $cat, $loc, $trace; + } +} + # Now output... if (%trace) { @@ -1199,19 +1023,17 @@ if (%trace) } else { - # Actual M4 expansion, only if $output is too old. STDOUT is - # pretty old. + # Actual M4 expansion, if the user wants it, or if $output is old + # (STDOUT is pretty old). handle_output ($req, $output) - if mtime ($output) < mtime ($ocache . $req->id); + if $force || mtime ($output) < mtime ($ocache . $req->id); } -# If all went fine, the cache is valid. -$req->valid (1) - if $exit_status == 0; - -Request->save ($icache); +# If we ran up to here, the cache is valid. +$req->valid (1); +Autom4te::C4che->save ($icache_file); -exit $exit_status; +exit $exit_code; ### Setup "GNU" style for perl-mode and cperl-mode. ## Local Variables: diff --git a/bin/autoreconf b/bin/autoreconf index 767ba7fc..f1dfef26 100644 --- a/bin/autoreconf +++ b/bin/autoreconf @@ -1,12 +1,13 @@ #! /bin/perl -w # -*- perl -*- -# @configure_input@ +# Generated from autoreconf.in; do not edit by hand. eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; esac' if 0; # autoreconf - install the GNU Build System in a directory tree -# Copyright (C) 1994, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,18 +21,28 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # Written by David J. MacKenzie. # Extended and rewritten in Perl by Akim Demaille. BEGIN { - my $perllibdir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; - unshift @INC, "$perllibdir"; + my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; + unshift @INC, $datadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell + # that can handle redirection and quote arguments correctly, + # e.g.: COMMAND.COM. For DJGPP always use the shell that configure + # has detected. + $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); } +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use Autom4te::Configure_ac; +use Autom4te::FileUtils; use Autom4te::General; use Autom4te::XFile; # Do not use Cwd::chdir, since it might hang. @@ -44,16 +55,16 @@ use strict; # $HELP # ----- -$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ... +$help = "Usage: $0 [OPTION] ... [DIRECTORY] ... Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint' (formerly `gettextize'), and `libtoolize' where appropriate) -repeatedly to remake the GNU Build System files in the DIRECTORIES or -the directory trees driven by CONFIGURE-AC (defaulting to `.'). +repeatedly to remake the GNU Build System files in specified +DIRECTORIES and their subdirectories (defaulting to `.'). By default, it only remakes those files that are older than their -predecessors. If you install new versions of the GNU Build System, -running `autoreconf' remakes all of the files by giving it the +sources. If you install new versions of the GNU Build System, +you can make `autoreconf' remake all of the files by giving it the `--force' option. Operation modes: @@ -63,19 +74,12 @@ Operation modes: -d, --debug don't remove temporary files -f, --force consider all files obsolete -i, --install copy missing auxiliary files + --no-recursive don't rebuild sub-packages -s, --symlink with -i, install symbolic links instead of copies -m, --make when applicable, re-run ./configure && make -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] -Warning categories include: - \`cross\' cross compilation issues - \`obsolete\' obsolete constructs - \`portability\' portability issues - \`syntax\' dubious syntactic constructs - \`all\' all the warnings - \`no-CATEGORY\' turn off the warnings on CATEGORY - \`none\' turn off all the warnings - \`error\' warnings are error +" . Autom4te::ChannelDefs::usage . " The environment variable \`WARNINGS\' is honored. Some subtools might support other warning types, using \`all' is encouraged. @@ -85,19 +89,20 @@ Library directories: -I, --include=DIR append directory DIR to search path The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL, -AUTOPOINT, LIBTOOLIZE are honored. +AUTOPOINT, LIBTOOLIZE, M4 are honored. Report bugs to . "; # $VERSION # -------- -$version = "autoreconf (GNU Autoconf) 2.56 -Written by David J. MacKenzie and Akim Demaille. +$version = "autoreconf (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by David J. MacKenzie and Akim Demaille. "; # Lib files. @@ -112,16 +117,23 @@ my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint'; my $install = 0; # symlink -- when --install, use symlinks instead. my $symlink = 0; +# Does aclocal support --force? +my $aclocal_supports_force = 0; +# Does automake support --force-missing? +my $automake_supports_force_missing = 0; my @prepend_include; my @include; -# List of warnings. +# List of command line warning requests. my @warning; # Rerun `./configure && make'? my $make = 0; +# Recurse into subpackages +my $recursive = 1; + ## ---------- ## ## Routines. ## ## ---------- ## @@ -139,11 +151,14 @@ sub parse_args () 'B|prepend-include=s' => \@prepend_include, 'i|install' => \$install, 's|symlink' => \$symlink, - 'm|make' => \$make); + 'm|make' => \$make, + 'recursive!' => \$recursive); # Split the warnings as a list of elements instead of a list of # lists. @warning = map { split /,/ } @warning; + parse_WARNINGS; + parse_warnings '--warnings', @warning; # Even if the user specified a configure.ac, trim to get the # directory, and look for configure.ac again. Because (i) the code @@ -164,6 +179,9 @@ sub parse_args () } } + $aclocal_supports_force = `$aclocal --help` =~ /--force/; + $automake_supports_force_missing = `$automake --help` =~ /--force-missing/; + # Dispatch autoreconf's option to the tools. # --include; $autoconf .= join (' --include=', '', @include); @@ -181,43 +199,116 @@ sub parse_args () # --force; if ($force) { + $aclocal .= ' --force' + if $aclocal_supports_force; $autoconf .= ' --force'; $autoheader .= ' --force'; - $automake .= ' --force-missing'; + $automake .= ' --force-missing' + if $automake_supports_force_missing; $autopoint .= ' --force'; $libtoolize .= ' --force'; } else { - $automake .= ' --no-force'; + # The implementation of --no-force is bogus in all implementations + # of Automake up to 1.8, so we avoid it in these cases. (Automake + # 1.8 is the first version where aclocal supports force, hence + # the condition.) + $automake .= ' --no-force' + if $aclocal_supports_force; } - # --debug; - if ($debug) + # --verbose --verbose or --debug; + if ($verbose > 1 || $debug) { - $autoconf .= ' --verbose --debug'; - $autoheader .= ' --verbose --debug'; + $autoconf .= ' --verbose'; + $autoheader .= ' --verbose'; $automake .= ' --verbose'; $aclocal .= ' --verbose'; + } + if ($debug) + { + $autoconf .= ' --debug'; + $autoheader .= ' --debug'; $libtoolize .= ' --debug'; } # --warnings; if (@warning) { - $autoconf .= ' --warnings=' . join (',', @warning); - $autoheader .= ' --warnings=' . join (',', @warning); - $automake .= ' --warnings=' . join (',', @warning) + my $warn = ' --warnings=' . join (',', @warning); + $autoconf .= $warn; + $autoheader .= $warn; + $automake .= $warn if `$automake --help` =~ /--warnings/; } } +# &run_aclocal ($ACLOCAL, $FLAGS) +# ------------------------------- +# Update aclocal.m4 as lazily as possible, as aclocal pre-1.8 always +# overwrites aclocal.m4, hence triggers autoconf, autoheader, automake +# etc. uselessly. aclocal 1.8+ does not need this. +sub run_aclocal ($$) +{ + my ($aclocal, $flags) = @_; + + # aclocal 1.8+ does all this for free. It can be recognized by its + # --force support. + if ($aclocal_supports_force) + { + xsystem ("$aclocal $flags"); + } + else + { + xsystem ("$aclocal $flags --output=aclocal.m4t"); + # aclocal may produce no output. + if (-f 'aclocal.m4t') + { + update_file ('aclocal.m4t', 'aclocal.m4'); + # Make sure that the local m4 files are older than + # aclocal.m4. + # + # Why is not always the case? Because we already run + # aclocal at first (before tracing), which, for instance, + # can find Gettext's macros in .../share/aclocal, so we may + # have had the right aclocal.m4 already. Then autopoint is + # run, and installs locally these M4 files. Then + # autoreconf, via update_file, sees it is the _same_ + # aclocal.m4, and doesn't change its timestamp. But later, + # Automake's Makefile expresses that aclocal.m4 depends on + # these local files, which are newer, so it triggers aclocal + # again. + # + # To make sure aclocal.m4 is no older, we change the + # modification times of the local M4 files to be not newer + # than it. + # + # First, where are the local files? + my $aclocal_local_dir = '.'; + if ($flags =~ /-I\s+(\S+)/) + { + $aclocal_local_dir = $1; + } + # All the local files newer than aclocal.m4 are to be + # made not newer than it. + my $aclocal_m4_mtime = mtime ('aclocal.m4'); + for my $file (glob ("$aclocal_local_dir/*.m4"), 'acinclude.m4') + { + if ($aclocal_m4_mtime < mtime ($file)) + { + debug "aging $file to be not newer than aclocal.m4"; + utime $aclocal_m4_mtime, $aclocal_m4_mtime, $file; + } + } + } + } +} + # &autoreconf_current_directory # ----------------------------- sub autoreconf_current_directory () { my $configure_ac = find_configure_ac; - error "cannot find `configure.ac'" - unless $configure_ac; # ---------------------- # # Is it using Autoconf? # @@ -225,19 +316,21 @@ sub autoreconf_current_directory () my $uses_autoconf; my $uses_gettext; - my $configure_ac_file = new Autom4te::XFile $configure_ac; - while ($_ = $configure_ac_file->getline) - { - s/#.*//; - s/dnl.*//; - $uses_autoconf = 1 if /AC_INIT/; - # See below for why we look for gettext here. - $uses_gettext = 1 if /^AM_GNU_GETTEXT_VERSION/; - } - + if (-f $configure_ac) + { + my $configure_ac_file = new Autom4te::XFile $configure_ac; + while ($_ = $configure_ac_file->getline) + { + s/#.*//; + s/dnl.*//; + $uses_autoconf = 1 if /AC_INIT/; + # See below for why we look for gettext here. + $uses_gettext = 1 if /^AM_GNU_GETTEXT_VERSION/; + } + } if (!$uses_autoconf) { - verbose "$configure_ac: not using Autoconf"; + verb "$configure_ac: not using Autoconf"; return; } @@ -264,11 +357,11 @@ sub autoreconf_current_directory () # scanning configure.ac. if (!$uses_gettext) { - verbose "$configure_ac: not using Gettext"; + verb "$configure_ac: not using Gettext"; } elsif (!$install) { - verbose "$configure_ac: not running autopoint: --install not given"; + verb "$configure_ac: not running autopoint: --install not given"; } else { @@ -297,7 +390,7 @@ sub autoreconf_current_directory () my $aclocal_m4 = new Autom4te::XFile 'aclocal.m4'; $_ = $aclocal_m4->getline; $uses_aclocal = 0 - unless /generated.*by aclocal/; + unless defined ($_) && /generated.*by aclocal/; } # If there are flags for aclocal in Makefile.am, use them. @@ -317,11 +410,11 @@ sub autoreconf_current_directory () if (!$uses_aclocal) { - verbose "$configure_ac: not using aclocal"; + verb "$configure_ac: not using aclocal"; } else { - # Some filesystems have sub-second time stamps, and if so we may + # Some file systems have sub-second time stamps, and if so we may # run into trouble later, after we rerun autoconf and set the # time stamps of input files to be no greater than aclocal.m4, # because the time-stamp-setting operation (utime) has a @@ -331,10 +424,7 @@ sub autoreconf_current_directory () # fall. sleep 1; - xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t"); - # aclocal may produce no output. - update_file ('aclocal.m4t', 'aclocal.m4') - if -f 'aclocal.m4t'; + run_aclocal ($aclocal, $aclocal_flags); } # We might have to rerun aclocal if Libtool (or others) imports new @@ -350,30 +440,40 @@ sub autoreconf_current_directory () # Perform a single trace reading to avoid --force forcing a rerun # between two --trace, that's useless. If there is no AC_INIT, then # we are not interested: it looks like a Cygnus thingy. + my $aux_dir; my $uses_gettext_via_traces; my $uses_libtool; + my $uses_libltdl; my $uses_autoheader; + my $uses_automake; my @subdir; - verbose "$configure_ac: tracing"; + verb "$configure_ac: tracing"; my $traces = new Autom4te::XFile ("$autoconf" . join (' --trace=', '', # If you change this list, update the # `Autoreconf-preselections' section of autom4te.in. + 'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1', 'AC_CONFIG_HEADERS', 'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1', 'AC_INIT', 'AC_PROG_LIBTOOL', + 'LT_INIT', + 'LT_CONFIG_LTDL_DIR', 'AM_GNU_GETTEXT', + 'AM_INIT_AUTOMAKE', ) . ' |'); while ($_ = $traces->getline) { + $aux_dir = $1 if /AC_CONFIG_AUX_DIR:(.*)/; $uses_autoconf = 1 if /AC_INIT/; $uses_gettext_via_traces = 1 if /AM_GNU_GETTEXT/; - $uses_libtool = 1 if /AC_PROG_LIBTOOL/; + $uses_libtool = 1 if /(AC_PROG_LIBTOOL|LT_INIT)/; + $uses_libltdl = 1 if /LT_CONFIG_LTDL_DIR/; $uses_autoheader = 1 if /AC_CONFIG_HEADERS/; - push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/; + $uses_automake = 1 if /AM_INIT_AUTOMAKE/; + push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/ && $recursive; } # The subdirs are *optional*, they may not exist. @@ -381,12 +481,12 @@ sub autoreconf_current_directory () { if (-d) { - verbose "$configure_ac: subdirectory $_ to autoreconf"; + verb "$configure_ac: adding subdirectory $_ to autoreconf"; autoreconf ($_); } else { - verbose "$configure_ac: subdirectory $_ not present"; + verb "$configure_ac: subdirectory $_ not present"; } } @@ -397,22 +497,44 @@ sub autoreconf_current_directory () if $uses_gettext && ! $uses_gettext_via_traces; + # ---------------------------- # + # Setting up the source tree. # + # ---------------------------- # + + # libtoolize, automake --add-missing etc. will drop files in the + # $AUX_DIR. But these tools fail to install these files if the + # directory itself does not exist, which valid: just imagine a CVS + # repository with hand written code only (there is not even a need + # for a Makefile.am!). + + if (defined $aux_dir && ! -d $aux_dir) + { + verb "$configure_ac: creating directory $aux_dir"; + mkdir $aux_dir, 0755 + or error "cannot create $aux_dir: $!"; + } + + # -------------------- # # Running libtoolize. # # -------------------- # if (!$uses_libtool) { - verbose "$configure_ac: not using Libtool"; + verb "$configure_ac: not using Libtool"; } elsif ($install) { + if ($uses_libltdl) + { + $libtoolize .= " --ltdl"; + } xsystem ($libtoolize); $rerun_aclocal = 1; } else { - verbose "$configure_ac: not running libtoolize: --install not given"; + verb "$configure_ac: not running libtoolize: --install not given"; } @@ -427,51 +549,11 @@ sub autoreconf_current_directory () { if (!$uses_aclocal) { - verbose "$configure_ac: not using aclocal"; + verb "$configure_ac: not using aclocal"; } else { - xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t"); - # aclocal may produce no output. - if (-f 'aclocal.m4t') - { - update_file ('aclocal.m4t', 'aclocal.m4'); - # Make sure that the local m4 files are older than - # aclocal.m4. - # - # Why is not always the case? Because we already run - # aclocal at first (before tracing), which, for instance, - # can find Gettext's macros in .../share/aclocal, so we - # may have had the right aclocal.m4 already. Then - # autopoint is run, and installs locally these M4 - # files. Then autoreconf, via update_file, sees it is - # the _same_ aclocal.m4, and doesn't change its - # timestamp. But later, Automake's Makefile expresses - # that aclocal.m4 depends on these local files, which - # are newer, so it triggers aclocal again. - # - # To make sure aclocal.m4 is no older, we change the - # modification times of the local M4 files to be - # not newer than it. - # - # First, where are the local files? - my $aclocal_local_dir = '.'; - if ($aclocal_flags =~ /-I\s+(\S+)/) - { - $aclocal_local_dir = $1; - } - # All the local files newer than aclocal.m4 are to be - # made not newer than it. - my $aclocal_m4_mtime = mtime ('aclocal.m4'); - for my $file (glob ("$aclocal_local_dir/*.m4"), 'acinclude.m4') - { - if ($aclocal_m4_mtime < mtime ($file)) - { - debug "aging $file to be not newer than aclocal.m4"; - utime $aclocal_m4_mtime, $aclocal_m4_mtime, $file; - } - } - } + run_aclocal ($aclocal, $aclocal_flags); } } @@ -504,7 +586,7 @@ sub autoreconf_current_directory () # config.h.in when it sees an AC_CONFIG_HEADERS. if (!$uses_autoheader) { - verbose "$configure_ac: not using Autoheader"; + verb "$configure_ac: not using Autoheader"; } else { @@ -516,10 +598,9 @@ sub autoreconf_current_directory () # Running automake. # # ------------------ # - # Assumes that there is a Makefile.am in the topmost directory. - if (!-f 'Makefile.am') + if (!$uses_automake) { - verbose "$configure_ac: not using Automake"; + verb "$configure_ac: not using Automake"; } else { @@ -538,7 +619,7 @@ sub autoreconf_current_directory () { if (!-f "config.status") { - verbose "no config.status: cannot re-make"; + verb "no config.status: cannot re-make"; } else { @@ -546,7 +627,7 @@ sub autoreconf_current_directory () xsystem ("./config.status"); if (!-f "Makefile") { - verbose "no Makefile: cannot re-make"; + verb "no Makefile: cannot re-make"; } else { @@ -567,7 +648,7 @@ sub autoreconf ($) # The format for this message is not free: taken from Emacs, itself # using GNU Make's format. - verbose "Entering directory `$directory'"; + verb "Entering directory `$directory'"; chdir $directory or error "cannot chdir to $directory: $!"; @@ -575,7 +656,7 @@ sub autoreconf ($) # The format is not free: taken from Emacs, itself using GNU Make's # format. - verbose "Leaving directory `$directory'"; + verb "Leaving directory `$directory'"; chdir $cwd or error "cannot chdir to $cwd: $!"; } @@ -591,10 +672,11 @@ mktmpdir ('ar'); $ENV{'TMPDIR'} = $tmp; parse_args; -# Autoreconf all the given configure.ac. A while loop, not a for, -# since the list can change at runtime because of AC_CONFIG_SUBDIRS. +# Autoreconf all the given configure.ac. Unless `--no-recursive' is passed, +# AC_CONFIG_SUBDIRS will be traversed in &autoreconf_current_directory. for my $directory (@ARGV) { + require_configure_ac ($directory); autoreconf ($directory); } diff --git a/bin/autoscan b/bin/autoscan index 8a8da7c4..32b9c9d9 100644 --- a/bin/autoscan +++ b/bin/autoscan @@ -1,7 +1,10 @@ #! /bin/perl -w # -*- perl -*- +# Generated from autoscan.in; do not edit by hand. + # autoscan - Create configure.scan (a preliminary configure.ac) for a package. -# Copyright (C) 1994, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,8 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # Written by David MacKenzie . @@ -25,21 +28,30 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es BEGIN { - my $perllibdir = $ENV{'autom4te_perllibdir'} || "/usr/share/autoconf"; - unshift @INC, "$perllibdir"; + my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; + unshift @INC, $datadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell + # that can handle redirection and quote arguments correctly, + # e.g.: COMMAND.COM. For DJGPP always use the shell that configure + # has detected. + $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); } +use Autom4te::ChannelDefs; +use Autom4te::Configure_ac; use Autom4te::General; +use Autom4te::FileUtils; use Autom4te::XFile; use File::Basename; use File::Find; use strict; -use vars qw(@cfiles @makefiles @shfiles %printed); +use vars qw(@cfiles @makefiles @shfiles @subdirs %printed); # The kind of the words we are looking for. my @kinds = qw (function header identifier program - makevar librarie); + makevar librarie); # For each kind, the default macro. my %generic_macro = @@ -79,7 +91,7 @@ my %needed_macros = ); my $configure_scan = 'configure.scan'; -my $log = new Autom4te::XFile ">$me.log"; +my $log; # Autoconf and lib files. my $autom4te = $ENV{'AUTOM4TE'} || '/usr/bin/autom4te'; @@ -110,12 +122,14 @@ Report bugs to .\n"; # $version # -------- -$version = "autoscan (GNU Autoconf) 2.56 -Written by David J. MacKenzie and Akim Demaille. +$version = "autoscan (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; +Written by David J. MacKenzie and Akim Demaille. +"; @@ -138,7 +152,7 @@ Try `$me --help' for more information.\n" my $srcdir = $ARGV[0] || "."; - verbose "srcdir = $srcdir"; + verb "srcdir = $srcdir"; chdir $srcdir || error "cannot cd to $srcdir: $!"; } @@ -219,17 +233,17 @@ sub used ($$;$) ## ----------------------- ## -# scan_c_file ($FILENAME) -# ----------------------- +# scan_c_file ($FILE-NAME) +# ------------------------ sub scan_c_file ($) { - my ($filename) = @_; + my ($file_name) = @_; push @cfiles, $File::Find::name; # Nonzero if in a multiline comment. my $in_comment = 0; - my $file = new Autom4te::XFile "<$filename"; + my $file = new Autom4te::XFile "<$file_name"; while ($_ = $file->getline) { @@ -292,10 +306,10 @@ sub scan_c_file ($) # ----------------------------- sub scan_makefile ($) { - my ($filename) = @_; + my ($file_name) = @_; push @makefiles, $File::Find::name; - my $file = new Autom4te::XFile "<$filename"; + my $file = new Autom4te::XFile "<$file_name"; while ($_ = $file->getline) { @@ -334,10 +348,10 @@ sub scan_makefile ($) # -------------------------------- sub scan_sh_file ($) { - my ($filename) = @_; + my ($file_name) = @_; push @shfiles, $File::Find::name; - my $file = new Autom4te::XFile "<$filename"; + my $file = new Autom4te::XFile "<$file_name"; while ($_ = $file->getline) { @@ -359,7 +373,7 @@ sub scan_sh_file ($) # scan_file () # ------------ -# Called by &find on each file. $_ contains the current filename with +# Called by &find on each file. $_ contains the current file name with # the current directory of the walk through. sub scan_file () { @@ -373,6 +387,15 @@ sub scan_file () # Strip a useless leading `./'. $File::Find::name =~ s,^\./,,; + if ($_ ne '.' and -d $_ and + -f "$_/configure.in" || + -f "$_/configure.ac" || + -f "$_/configure.gnu" || + -f "$_/configure") + { + $File::Find::prune = 1; + push @subdirs, $File::Find::name; + } if (/\.[chlym](\.in)?$/) { used 'program', 'cc', $File::Find::name; @@ -503,7 +526,7 @@ sub output ($) ("# -*- Autoconf -*-\n" . "# Process this file with autoconf to produce a configure script.\n" . "\n" . - "AC_PREREQ(2.56)\n" . + "AC_PREREQ(2.61)\n" . "AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)\n"); if (defined $cfiles[0]) { @@ -518,6 +541,7 @@ sub output ($) output_kind ($file, 'identifier'); output_kind ($file, 'function'); + print $file "\n"; if (@makefiles) { # Change DIR/Makefile.in to DIR/Makefile. @@ -526,10 +550,16 @@ sub output ($) $m =~ s/\.(?:in|am)$//; $unique_makefiles{$m}++; } - print $file ("\nAC_CONFIG_FILES([", + print $file ("AC_CONFIG_FILES([", join ("\n ", sort keys %unique_makefiles), "])\n"); } + if (@subdirs) + { + print $file ("AC_CONFIG_SUBDIRS([", + join ("\n ", + sort @subdirs), "])\n"); + } print $file "AC_OUTPUT\n"; $file->close; @@ -557,7 +587,7 @@ sub check_configure_ac ($) join (' --trace=', '', uniq (sort (map { s/\(.*//; $_ } keys %needed_macros))); - verbose "running: $autoconf $trace_option $configure_ac"; + verb "running: $autoconf $trace_option $configure_ac"; my $traces = new Autom4te::XFile "$autoconf $trace_option $configure_ac|"; @@ -596,9 +626,9 @@ sub check_configure_ac ($) . "\n"); print $log "$me: warning: missing $macro wanted by: \n"; foreach my $need (@{$needed_macros{$macro}}) - { - print $log "\t$need\n"; - } + { + print $log "\t$need\n"; + } } } @@ -608,6 +638,8 @@ sub check_configure_ac ($) ## -------------- ## parse_args; +$log = new Autom4te::XFile ">$me.log"; + $autoconf .= " --debug" if $debug; $autoconf .= " --verbose" if $verbose; $autoconf .= join (' --include=', '', @include); @@ -617,7 +649,7 @@ my $configure_ac = find_configure_ac; init_tables; scan_files; output ('configure.scan'); -if ($configure_ac) +if (-f $configure_ac) { check_configure_ac ($configure_ac); } diff --git a/bin/autoupdate b/bin/autoupdate index c38abf94..74bd6e00 100644 --- a/bin/autoupdate +++ b/bin/autoupdate @@ -1,7 +1,10 @@ #! /bin/perl -w # -*- perl -*- +# Generated from autoupdate.in; do not edit by hand. + # autoupdate - modernize an Autoconf file. -# Copyright (C) 1994, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,8 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # Originally written by David MacKenzie . # Rewritten by Akim Demaille . @@ -26,13 +29,23 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es BEGIN { - my $perllibdir = $ENV{'autom4te_perllibdir'} || "/usr/share/autoconf"; - unshift @INC, "$perllibdir"; + my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; + unshift @INC, $datadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell + # that can handle redirection and quote arguments correctly, + # e.g.: COMMAND.COM. For DJGPP always use the shell that configure + # has detected. + $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); } -use File::Basename; +use Autom4te::ChannelDefs; +use Autom4te::Channels; +use Autom4te::Configure_ac; +use Autom4te::FileUtils; use Autom4te::General; use Autom4te::XFile; +use File::Basename; use strict; # Lib files. @@ -43,7 +56,7 @@ my @prepend_include; my @include = ('/usr/share/autoconf'); my $force = 0; # m4. -my $m4 = $ENV{"M4"} || "/bin/m4"; +my $m4 = $ENV{"M4"} || '/bin/m4'; # $HELP @@ -70,12 +83,13 @@ Report bugs to . # $VERSION # -------- -$version = "autoupdate (GNU Autoconf) 2.56 -Written by David J. MacKenzie and Akim Demaille. +$version = "autoupdate (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by David J. MacKenzie and Akim Demaille. "; ## ---------- ## @@ -96,105 +110,67 @@ sub parse_args () if (! @ARGV) { - my $configure_ac = find_configure_ac; - error "no input file" - unless $configure_ac; + my $configure_ac = require_configure_ac; push @ARGV, $configure_ac; } } -# ------------- # -# M4 builtins. # -# ------------- # - -my @m4_builtins; - -# &handle_m4_symbols () -# --------------------- -# Create the following $tmp files: -# m4.m4 -- enable the m4 builtins. -# unm4.m4 -- disable the m4 builtins. -# savem4.m4 -- save the m4 builtins. -sub handle_m4_macros () -{ - # Get the list of builtins. - xsystem ("echo dumpdef | $m4 2>$tmp/m4.defs >/dev/null"); - my $m4_defs = new Autom4te::XFile "$tmp/m4.defs"; - while ($_ = $m4_defs->getline) - { - push @m4_builtins, $1 - if /^(\w+):/; - } - $m4_defs->close; - - # Output the files. - my $m4_m4 = new Autom4te::XFile ">$tmp/m4.m4"; - print $m4_m4 "# m4.m4 -- enable the m4 builtins.\n"; - my $unm4_m4 = new Autom4te::XFile ">$tmp/unm4.m4"; - print $unm4_m4 "# unm4.m4 -- disable the m4 builtins.\n"; - print $unm4_m4 "# Because Autoconf, via M4sugar, redefines some of these\n"; - print $unm4_m4 "# macros, and therefore since unac.m4 disables them,\n"; - print $unm4_m4 "# disable only if defined.\n"; - my $m4save_m4 = new Autom4te::XFile ">$tmp/m4save.m4"; - print $m4save_m4 "# savem4.m4 -- save the m4 builtins.\n"; - foreach (@m4_builtins) - { - print $m4save_m4 "define([_au_$_], defn([$_]))\n"; - print $unm4_m4 "_au_ifdef([$_], [_au_undefine([$_])])\n"; - print $m4_m4 "_au_define([$_], _au_defn([_au_$_]))\n"; - } -} - - # ----------------- # # Autoconf macros. # # ----------------- # - -# @AU_MACROS & AC_MACROS -- AU and AC macros and yet another useful comment. -my (%ac_macros, %au_macros); - +my (%ac_macros, %au_macros, %m4_builtins); # HANDLE_AUTOCONF_MACROS () # ------------------------- # @M4_BUILTINS -- M4 builtins and a useful comment. sub handle_autoconf_macros () { + # Get the builtins. + xsystem ("echo dumpdef | $m4 2>$tmp/m4.defs >/dev/null"); + my $m4_defs = new Autom4te::XFile "$tmp/m4.defs"; + while ($_ = $m4_defs->getline) + { + $m4_builtins{$1} = 1 + if /^(\w+):/; + } + $m4_defs->close; + my $macros = new Autom4te::XFile ("$autoconf" - . " --trace AU_DEFUN:'AU:\$f:\$1'" - . " --trace define:'AC:\$f:\$1'" - . " --melt /dev/null |"); + . " --trace AU_DEFINE:'AU:\$f:\$1'" + . " --trace define:'AC:\$f:\$1'" + . " --melt /dev/null |"); while ($_ = $macros->getline) { chomp; my ($domain, $file, $macro) = /^(AC|AU):(.*):([^:]*)$/ or next; - # ../lib/m4sugar/m4sugar.m4 -> m4sugar - # ../lib/autoconf/general.m4 -> autoconf - # aclocal.m4 -> aclocal - my $set = basename (dirname ($file)); - $set = 'aclocal' if $file eq 'aclocal.m4'; - error "unknown set: $set: $_" - unless $set =~ /^(m4sugar|aclocal|autoconf)$/; - if ($domain eq "AC") + if ($domain eq "AU") + { + $au_macros{$macro} = 1; + } + elsif ($file =~ /(^|\/)m4sugar\/(m4sugar|version)\.m4$/) { - $ac_macros{$macro} = $set; + # Add the m4sugar macros to m4_builtins. + $m4_builtins{$macro} = 1; } else { - $au_macros{$macro} = $set; + # Autoconf, aclocal, and m4sh macros. + $ac_macros{$macro} = 1; } } $macros->close; + # Don't keep AU macros in @AC_MACROS. delete $ac_macros{$_} foreach (keys %au_macros); # Don't keep M4sugar macros which are redefined by Autoconf, # such as `builtin', `changequote' etc. See autoconf/autoconf.m4. delete $ac_macros{$_} - foreach (@m4_builtins); + foreach (keys %m4_builtins); error "no current Autoconf macros found" unless keys %ac_macros; error "no obsolete Autoconf macros found" @@ -214,10 +190,26 @@ sub handle_autoconf_macros () print $ac_m4 "# ac.m4 -- autoquoting definitions of the AC macros.\n"; my $unac_m4 = new Autom4te::XFile ">$tmp/unac.m4"; print $unac_m4 "# unac.m4 -- undefine the AC macros.\n"; - foreach (sort grep { $ac_macros{$_} ne 'm4sugar' } keys %ac_macros) + foreach (sort keys %ac_macros) { - print $ac_m4 "_au_define([$_], [[\$0(\$\@)]])\n"; - print $unac_m4 "_au_undefine([$_])\n"; + print $ac_m4 "_au_m4_define([$_], [m4_if(\$#, 0, [[\$0]], [[\$0(\$\@)]])])\n"; + print $unac_m4 "_au_m4_undefine([$_])\n"; + } + + # m4save.m4 -- save the m4 builtins. + # unm4.m4 -- disable the m4 builtins. + # m4.m4 -- enable the m4 builtins. + my $m4save_m4 = new Autom4te::XFile ">$tmp/m4save.m4"; + print $m4save_m4 "# m4save.m4 -- save the m4 builtins.\n"; + my $unm4_m4 = new Autom4te::XFile ">$tmp/unm4.m4"; + print $unm4_m4 "# unm4.m4 -- disable the m4 builtins.\n"; + my $m4_m4 = new Autom4te::XFile ">$tmp/m4.m4"; + print $m4_m4 "# m4.m4 -- enable the m4 builtins.\n"; + foreach (sort keys %m4_builtins) + { + print $m4save_m4 "_au__save([$_])\n"; + print $unm4_m4 "_au__undefine([$_])\n"; + print $m4_m4 "_au__restore([$_])\n"; } } @@ -234,15 +226,14 @@ $autoconf .= join (' --include=', '', @include); $autoconf .= join (' --prepend-include=', '', @prepend_include); mktmpdir ('au'); -handle_m4_macros; handle_autoconf_macros; # $au_changequote -- enable the quote `[', `]' right before any AU macro. my $au_changequote = - 's/\b(' . join ('|', keys %au_macros) . ')\b/_au_changequote([,])$1/g'; + 's/\b(' . join ('|', keys %au_macros) . ')\b/_au_m4_changequote([,])$1/g'; # au.m4 -- definitions the AU macros. -xsystem ("$autoconf --trace AU_DEFUN:'_au_defun(\@<:\@\$1\@:>\@, +xsystem ("$autoconf --trace AU_DEFINE:'_au_defun(\@<:\@\$1\@:>\@, \@<:\@\$2\@:>\@)' --melt /dev/null " . ">$tmp/au.m4"); @@ -254,7 +245,6 @@ xsystem ("$autoconf --trace AU_DEFUN:'_au_defun(\@<:\@\$1\@:>\@, foreach my $file (@ARGV) { - my $filename = $file; # We need an actual file. if ($file eq '-') { @@ -271,22 +261,41 @@ foreach my $file (@ARGV) # input file. my $input_m4 = <<\EOF; divert(-1) -*- Autoconf -*- - changequote([, ]) + changequote([,]) + + # Define our special macros: + define([_au__defn], defn([defn])) + define([_au__divert], defn([divert])) + define([_au__include], defn([include])) + define([_au__undefine], defn([undefine])) + define([_au__save], [m4_ifdef([$1], [m4_copy([$1], [_au_$1])])]) + define([_au__restore], + [_au_m4_ifdef([_au_$1], + [_au_m4_define([$1], _au__defn([_au_$1]))])]) + + # Set up m4sugar. + include(m4sugar/m4sugar.m4) + + # Redefine __file__ to make warnings nicer; $file is replaced below. + m4_define([__file__], [$file]) + + # Redefine m4_location to fix the line number. + m4_define([m4_location], [__file__:m4_eval(__line__ - _au__first_line)]) # Move all the builtins into the `_au_' pseudo namespace - include([m4save.m4]) + m4_include([m4save.m4]) # _au_defun(NAME, BODY) # --------------------- # Define NAME to BODY, plus AU activation/deactivation. - _au_define([_au_defun], - [_au_define([$1], + _au_m4_define([_au_defun], + [_au_m4_define([$1], [_au_enable()dnl $2[]dnl _au_disable()])]) # Import the definition of the obsolete macros. - _au_include([au.m4]) + _au__include([au.m4]) ## ------------------------ ## @@ -304,72 +313,69 @@ foreach my $file (@ARGV) # __au_enable # ----------- - # Reenable the builtins, and m4sugar. - _au_define([__au_enable], - [_au_divert(-1) + # Reenable the builtins, m4sugar, and the autoquoting AC macros. + _au_m4_define([__au_enable], + [_au__divert(-1) # Enable special characters. - _au_changecom([#]) + _au_m4_changecom([#]) - # Enable the m4 builtins, m4sugar and the autoquoting AC macros. - _au_include([m4.m4]) - _au_include([m4sugar/m4sugar.m4]) - _au_include([ac.m4]) + _au__include([m4.m4]) + _au__include([ac.m4]) - _au_divert(0)]) + _au__divert(0)]) # _au_enable # ---------- - # Called at the beginning of all the obsolete macros. Reenable the - # builtins, and m4sugar if needed. - _au_define([_au_enable], - [_au_ifdef([_au_enabled], - [], - [__au_enable()])_au_dnl - _au_pushdef([_au_enabled])]) + # Called at the beginning of all the obsolete macros. If this is the + # outermost level, call __au_enable. + _au_m4_define([_au_enable], + [_au_m4_ifdef([_au_enabled], + [], + [__au_enable()])_au_dnl + _au_m4_pushdef([_au_enabled])]) # __au_disable # ------------ - # Disable the builtins, and m4sugar. - _au_define([__au_disable], - [_au_divert(-1) - # Disable m4sugar, the AC autoquoting macros, and m4. - _au_include([unac.m4]) - _au_include([unm4.m4]) + # Disable the AC autoquoting macros, m4sugar, and m4. + _au_m4_define([__au_disable], + [_au__divert(-1) + _au__include([unac.m4]) + _au__include([unm4.m4]) # Disable special characters. - _au_changequote() - _au_changecom() + _au_m4_changequote() + _au_m4_changecom() - _au_divert(0)]) + _au__divert(0)]) # _au_disable # ----------- - # Called at the end of all the obsolete macros. Disable the - # builtins, and m4sugar if needed.. - _au_define([_au_disable], - [_au_popdef([_au_enabled])_au_dnl - _au_ifdef([_au_enabled], - [], - [__au_disable()])]) + # Called at the end of all the obsolete macros. If we are at the + # outermost level, call __au_disable. + _au_m4_define([_au_disable], + [_au_m4_popdef([_au_enabled])_au_dnl + _au_m4_ifdef([_au_enabled], + [], + [__au_disable()])]) ## ------------------------------- ## ## Disable, and process the file. ## ## ------------------------------- ## - _au_divert(-1) - # Disable m4: M4sugar and the AC autoquoting macros are not loaded yet, - # hence invoking `_au_disable' is wrong. - _au_include([unm4.m4]) + # The AC autoquoting macros are not loaded yet, hence invoking + # `_au_disable' would be wrong. + _au__include([unm4.m4]) - # Disable special characters. - _au_changequote() - _au_changecom() + # Disable special characters, and set the first line number. + _au_m4_changequote() + _au_m4_changecom() - _au_divert(0)_au_dnl + _au_m4_define(_au__first_line, _au___line__)_au__divert(0)_au_dnl EOF $input_m4 =~ s/^ //mg; + $input_m4 =~ s/\$file/$file/g; # prepared input -- input, but reenables the quote before each AU macro. open INPUT_M4, ">$tmp/input.m4" @@ -398,14 +404,14 @@ EOF exit 0; -# ## ---------------------------- ## -# ## How `autoupdate' functions. ## -# ## ---------------------------- ## +# ## ---------------------------- ## +# ## How `autoupdate' functions. ## +# ## ---------------------------- ## # # The task of `autoupdate' is not trivial: the biggest difficulty being # that you must limit the changes to the parts that really need to be # updated. Finding a satisfying implementation proved to be quite hard, -# as this is the fourth implementation of `autoupdate'. +# as this is the fifth implementation of `autoupdate'. # # Below, we will use a simple example of obsolete macro: # @@ -538,13 +544,13 @@ exit 0; # You first think to design AU_DEFUN like this: # # 1. AC_DEFUN(OLD-NAME, -# [Warn the user OLD-NAME is obsolete. -# NEW-CODE]) +# [Warn the user OLD-NAME is obsolete. +# NEW-CODE]) # # 2. Store for late AU binding([define(OLD_NAME, -# [Reestablish the quotes. -# NEW-CODE -# Disable the quotes.])]) +# [Reestablish the quotes. +# NEW-CODE +# Disable the quotes.])]) # # but this will not work: NEW-CODE has probably $1, $2 etc. and these # guys will be replaced with the argument of `Store for late AU binding' @@ -588,7 +594,7 @@ exit 0; # strings which can become quickly huge, which slows it significantly. # # In particular one should avoid as much as possible to use `define' for -# temporaries. Now that `define' as quite a complex meaning, it is an +# temporaries. Now that `define' has quite a complex meaning, it is an # expensive operations that should be limited to macros. Use # `m4_define' for temporaries. # @@ -653,14 +659,14 @@ exit 0; # dnl The Unbelievable Truth # changequote([, ])OLD(1, 2) # NEW([0, 0], -# 0) +# 0) # # which will result in # # dnl The Unbelievable Truth # NEW(1, 2, m4_eval(1 + 2)) # NEW([0, 0], -# 0) +# 0) # # Grpmh. Two problems. A minor problem: it would have been much better # to have the `m4_eval' computed, and a major problem: you lost the @@ -683,7 +689,7 @@ exit 0; # dnl The Unbelievable Truth # changequote([, ])OLD(1, 2) # changequote([, ])NEW([0, 0], -# 0) +# 0) # # which results in # @@ -703,7 +709,7 @@ exit 0; # No big deal for the semantics (unless the macro depends upon $#, which # is bad), but the users would not be happy. # -# Additionally, we introduced quotes that we not there before, which is +# Additionally, we introduced quotes that were not there before, which is # OK in most cases, but could change the semantics of the file. # # Cruel dilemma: we do want the auto-quoting definition of `NEW' when @@ -731,7 +737,7 @@ exit 0; # dnl The Unbelievable Truth # changequote([, ])OLD(1, 2) # NEW([0, 0], -# 0) +# 0) # # i.e., the new value of `OLD' is precomputed using the auto-quoting # definition of `NEW' and the m4 builtins. We'll see how afterwards, @@ -753,7 +759,7 @@ exit 0; # dnl The Unbelievable Truth # changequote([, ])OLD(1, 2) # NEW([0, 0], -# 0) +# 0) # # i.e., for each call to obsolete macros, we build an array `call => # value', and use a macro to dispatch these values. This results in: @@ -761,7 +767,7 @@ exit 0; # dnl The Unbelievable Truth # NEW([1, 2], [3]) # NEW([0, 0], -# 0) +# 0) # # In French, we say `Youpi !', which you might roughly translate as # `Yippee!'. @@ -789,7 +795,7 @@ exit 0; # dnl The Unbelievable Truth # changequote([, ])OLD(1, 2) # NEW([0, 0], -# 0) +# 0) # # # # Computing the `values' section @@ -861,7 +867,7 @@ exit 0; # dnl The Unbelievable Truth # changequote([, ])OLD(1, 2) # NEW([0, 0], -# 0) +# 0) # # And we just run m4 on it. Et voila`, Monsieur ! Mais oui, mais oui. # @@ -875,10 +881,10 @@ exit 0; # # ------------------------------ # # This approach is heavily based on traces, but then there is an obvious -# problem: non expanded code will never be seen/ In particular, the body +# problem: non expanded code will never be seen. In particular, the body # of a `define' definition is not seen, so on the input # -# define([idem], [OLD(0, [$1])]) +# define([idem], [OLD(0, [$1])]) # # autoupdate would never see the `OLD', and wouldn't have updated it. # Worse yet, if `idem(0)' was used later, then autoupdate sees that @@ -887,7 +893,7 @@ exit 0; # [$1])', the dispatcher would have replaced with... nothing, leading # to # -# define([idem], []) +# define([idem], []) # # With some more thinking, you see that the two step approach is wrong, # the namespace approach was much saner. @@ -941,11 +947,11 @@ exit 0; # this: # # `m4save.m4' -# moves the m4 builtins into the `_au_' pseudo namespace +# moves the m4 builtins into the `_au_' pseudo namespace, # `unm4.m4' -# undefines the builtins +# undefines the builtins, # `m4.m4' -# restores them +# restores them. # # So `input.m4' is: # diff --git a/bin/ifnames b/bin/ifnames index b4e784b4..503ce427 100644 --- a/bin/ifnames +++ b/bin/ifnames @@ -1,14 +1,14 @@ #! /bin/perl -w # -*- perl -*- -# @configure_input@ +# Generated from ifnames.in; do not edit by hand. eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; esac' if 0; # ifnames - print the identifiers used in C preprocessor conditionals -# Copyright (C) 1994, 1995, 1999, 2000, 2001, 2002 Free Software -# Foundation, Inc. +# Copyright (C) 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2005, 2006 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,8 +22,8 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # Reads from stdin if no files are given. # Writes to stdout. @@ -33,8 +33,14 @@ eval 'case $# in 0) exec /bin/perl -S "$0";; *) exec /bin/perl -S "$0" "$@";; es BEGIN { - my $datadir = ($ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'); - unshift @INC, "$datadir"; + my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/share/autoconf'; + unshift @INC, $datadir; + + # Override SHELL. On DJGPP SHELL may not be set to a shell + # that can handle redirection and quote arguments correctly, + # e.g.: COMMAND.COM. For DJGPP always use the shell that configure + # has detected. + $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); } use Autom4te::General; @@ -53,18 +59,20 @@ space-separated list of the files in which that identifier occurs. -h, --help print this help, then exit -V, --version print version number, then exit -Report bugs to ."; +Report bugs to . +"; # $VERSION # -------- -$version = "\ -ifnames (GNU Autoconf) 2.56 -Written by David J. MacKenzie and Paul Eggert. +$version = "ifnames (GNU Autoconf) 2.61 +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software. You may redistribute copies of it under the terms of +the GNU General Public License . +There is NO WARRANTY, to the extent permitted by law. -Copyright 2002 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; +Written by David J. MacKenzie and Paul Eggert. +"; # &parse_args () @@ -81,12 +89,12 @@ sub parse_args () my %occurrence; -# &scan_file ($FILENAME) -# ---------------------- +# &scan_file ($FILE-NAME) +# ----------------------- sub scan_file ($) { - my ($filename) = @_; - my $file = new Autom4te::XFile ($filename); + my ($file_name) = @_; + my $file = new Autom4te::XFile ($file_name); while ($_ = $file->getline) { # Continuation lines. @@ -99,11 +107,12 @@ sub scan_file ($) # Remove comments. Not perfect, but close enough. s(/\*.*?\*/)(); s(/\*.*)(); + s(//.*)(); foreach my $word (split (/\W+/)) { next if $word eq 'defined' || $word !~ /^[a-zA-Z_]/; - $occurrence{$word}{$filename} = 1; + $occurrence{$word}{$file_name} = 1; } } } diff --git a/share/aclocal-1.10/amversion.m4 b/share/aclocal-1.10/amversion.m4 new file mode 100644 index 00000000..9dcef89e --- /dev/null +++ b/share/aclocal-1.10/amversion.m4 @@ -0,0 +1,35 @@ +## -*- Autoconf -*- +## Generated from amversion.in; do not edit by hand. +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) diff --git a/share/aclocal-1.10/as.m4 b/share/aclocal-1.10/as.m4 new file mode 100644 index 00000000..cc8bf470 --- /dev/null +++ b/share/aclocal-1.10/as.m4 @@ -0,0 +1,21 @@ +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) diff --git a/share/aclocal-1.10/auxdir.m4 b/share/aclocal-1.10/auxdir.m4 new file mode 100644 index 00000000..091e3b7a --- /dev/null +++ b/share/aclocal-1.10/auxdir.m4 @@ -0,0 +1,52 @@ +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) diff --git a/share/aclocal-1.10/ccstdc.m4 b/share/aclocal-1.10/ccstdc.m4 new file mode 100644 index 00000000..ec1541ea --- /dev/null +++ b/share/aclocal-1.10/ccstdc.m4 @@ -0,0 +1,26 @@ +## ----------------------------------------- ## -*- Autoconf -*- +## ANSIfy the C compiler whenever possible. ## +## From Franc,ois Pinard ## +## ----------------------------------------- ## + +# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# This was merged into AC_PROG_CC in Autoconf. + +AU_DEFUN([AM_PROG_CC_STDC], +[AC_PROG_CC +AC_DIAGNOSE([obsolete], [$0: + your code should no longer depend upon `am_cv_prog_cc_stdc', but upon + `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when + you adjust the code. You can also remove the above call to + AC_PROG_CC if you already called it elsewhere.]) +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc +]) +AU_DEFUN([fp_PROG_CC_STDC]) diff --git a/share/aclocal-1.10/cond.m4 b/share/aclocal-1.10/cond.m4 new file mode 100644 index 00000000..d9a58d2f --- /dev/null +++ b/share/aclocal-1.10/cond.m4 @@ -0,0 +1,34 @@ +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) diff --git a/share/aclocal-1.10/depend.m4 b/share/aclocal-1.10/depend.m4 new file mode 100644 index 00000000..fd093733 --- /dev/null +++ b/share/aclocal-1.10/depend.m4 @@ -0,0 +1,158 @@ +## -*- Autoconf -*- +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) diff --git a/share/aclocal-1.10/depout.m4 b/share/aclocal-1.10/depout.m4 new file mode 100644 index 00000000..0d9717a1 --- /dev/null +++ b/share/aclocal-1.10/depout.m4 @@ -0,0 +1,68 @@ +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) diff --git a/share/aclocal-1.10/dmalloc.m4 b/share/aclocal-1.10/dmalloc.m4 new file mode 100644 index 00000000..44990154 --- /dev/null +++ b/share/aclocal-1.10/dmalloc.m4 @@ -0,0 +1,31 @@ +## ----------------------------------- ## -*- Autoconf -*- +## Check if --with-dmalloc was given. ## +## From Franc,ois Pinard ## +## ----------------------------------- ## + +# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +AC_DEFUN([AM_WITH_DMALLOC], +[AC_MSG_CHECKING([if malloc debugging is wanted]) +AC_ARG_WITH(dmalloc, +[ --with-dmalloc use dmalloc, as in + http://www.dmalloc.com/dmalloc.tar.gz], +[if test "$withval" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_DMALLOC,1, + [Define if using the dmalloc debugging malloc package]) + LIBS="$LIBS -ldmalloc" + LDFLAGS="$LDFLAGS -g" +else + AC_MSG_RESULT(no) +fi], [AC_MSG_RESULT(no)]) +]) + +AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC]) diff --git a/share/aclocal-1.10/gcj.m4 b/share/aclocal-1.10/gcj.m4 new file mode 100644 index 00000000..5d1e00f9 --- /dev/null +++ b/share/aclocal-1.10/gcj.m4 @@ -0,0 +1,18 @@ +# Check for Java compiler. -*- Autoconf -*- +# For now we only handle the GNU compiler. + +# Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([AM_PROG_GCJ],[ +AC_CHECK_PROGS(GCJ, gcj, gcj) +test -z "$GCJ" && AC_MSG_ERROR([no acceptable gcj found in \$PATH]) +if test "x${GCJFLAGS-unset}" = xunset; then + GCJFLAGS="-g -O2" +fi +AC_SUBST(GCJFLAGS) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(GCJ)]) +]) diff --git a/share/aclocal-1.10/header.m4 b/share/aclocal-1.10/header.m4 new file mode 100644 index 00000000..c328ceb4 --- /dev/null +++ b/share/aclocal-1.10/header.m4 @@ -0,0 +1,12 @@ +## -*- Autoconf -*- +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) diff --git a/share/aclocal-1.10/init.m4 b/share/aclocal-1.10/init.m4 new file mode 100644 index 00000000..511073c1 --- /dev/null +++ b/share/aclocal-1.10/init.m4 @@ -0,0 +1,124 @@ +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) diff --git a/share/aclocal-1.10/install-sh.m4 b/share/aclocal-1.10/install-sh.m4 new file mode 100644 index 00000000..32c2ebb2 --- /dev/null +++ b/share/aclocal-1.10/install-sh.m4 @@ -0,0 +1,14 @@ +## -*- Autoconf -*- +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) diff --git a/share/aclocal-1.10/lead-dot.m4 b/share/aclocal-1.10/lead-dot.m4 new file mode 100644 index 00000000..d83bfa0b --- /dev/null +++ b/share/aclocal-1.10/lead-dot.m4 @@ -0,0 +1,21 @@ +## -*- Autoconf -*- +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) diff --git a/share/aclocal-1.10/lex.m4 b/share/aclocal-1.10/lex.m4 new file mode 100644 index 00000000..022f6a8b --- /dev/null +++ b/share/aclocal-1.10/lex.m4 @@ -0,0 +1,22 @@ +## Replacement for AC_PROG_LEX. -*- Autoconf -*- +## by Alexandre Oliva +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_LEX +# ----------- +# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a +# "missing" invocation, for better error output. +AC_DEFUN([AM_PROG_LEX], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AM_MISSING_HAS_RUN])dnl +AC_REQUIRE([AC_PROG_LEX])dnl +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi]) diff --git a/share/aclocal-1.10/lispdir.m4 b/share/aclocal-1.10/lispdir.m4 new file mode 100644 index 00000000..62c2daf6 --- /dev/null +++ b/share/aclocal-1.10/lispdir.m4 @@ -0,0 +1,55 @@ +## ------------------------ -*- Autoconf -*- +## Emacs LISP file handling +## From Ulrich Drepper +## Almost entirely rewritten by Alexandre Oliva +## ------------------------ +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +# 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# AM_PATH_LISPDIR +# --------------- +AC_DEFUN([AM_PATH_LISPDIR], +[AC_PREREQ([2.60])dnl + # If set to t, that means we are running in a shell under Emacs. + # If you have an Emacs named "t", then use the full path. + test x"$EMACS" = xt && EMACS= + AC_CHECK_PROGS([EMACS], [emacs xemacs], [no]) + AC_ARG_VAR([EMACS], [the Emacs editor command]) + AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path]) + AC_ARG_WITH([lispdir], + [ --with-lispdir override the default lisp directory], + [ lispdir="$withval" + AC_MSG_CHECKING([where .elc files should go]) + AC_MSG_RESULT([$lispdir])], + [ + AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [ + if test $EMACS != "no"; then + if test x${lispdir+set} != xset; then + # If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly + # Some emacsen will start up in interactive mode, requiring C-x C-c to exit, + # which is non-obvious for non-emacs users. + # Redirecting /dev/null should help a bit; pity we can't detect "broken" + # emacsen earlier and avoid running this altogether. + AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' conftest.out]) + am_cv_lispdir=`sed -n \ + -e 's,/$,,' \ + -e '/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}' \ + -e '/.*\/share\/x*emacs\/site-lisp$/{s,.*/share/\(x*emacs/site-lisp\),${datarootdir}/\1,;p;q;}' \ + conftest.out` + rm conftest.out + fi + fi + test -z "$am_cv_lispdir" && am_cv_lispdir='${datadir}/emacs/site-lisp' + ]) + lispdir="$am_cv_lispdir" +]) +AC_SUBST([lispdir]) +])# AM_PATH_LISPDIR + +AU_DEFUN([ud_PATH_LISPDIR], [AM_PATH_LISPDIR]) diff --git a/share/aclocal-1.10/maintainer.m4 b/share/aclocal-1.10/maintainer.m4 new file mode 100644 index 00000000..1c15c980 --- /dev/null +++ b/share/aclocal-1.10/maintainer.m4 @@ -0,0 +1,28 @@ +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) diff --git a/share/aclocal-1.10/make.m4 b/share/aclocal-1.10/make.m4 new file mode 100644 index 00000000..0969d9a7 --- /dev/null +++ b/share/aclocal-1.10/make.m4 @@ -0,0 +1,51 @@ +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) diff --git a/share/aclocal-1.10/minuso.m4 b/share/aclocal-1.10/minuso.m4 new file mode 100644 index 00000000..925baec7 --- /dev/null +++ b/share/aclocal-1.10/minuso.m4 @@ -0,0 +1,34 @@ +## -*- Autoconf -*- +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) diff --git a/share/aclocal-1.10/missing.m4 b/share/aclocal-1.10/missing.m4 new file mode 100644 index 00000000..26fab2aa --- /dev/null +++ b/share/aclocal-1.10/missing.m4 @@ -0,0 +1,35 @@ +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) diff --git a/share/aclocal-1.10/mkdirp.m4 b/share/aclocal-1.10/mkdirp.m4 new file mode 100644 index 00000000..be8a9de5 --- /dev/null +++ b/share/aclocal-1.10/mkdirp.m4 @@ -0,0 +1,26 @@ +## -*- Autoconf -*- +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) diff --git a/share/aclocal-1.10/multi.m4 b/share/aclocal-1.10/multi.m4 new file mode 100644 index 00000000..98417679 --- /dev/null +++ b/share/aclocal-1.10/multi.m4 @@ -0,0 +1,65 @@ +## -*- Autoconf -*- +# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) +# --------------------------------------------------- +# Add --enable-multilib to configure. +AC_DEFUN([AM_ENABLE_MULTILIB], +[# Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "$enableval" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; + esac], + [multilib=yes]) + +# We may get other options which we leave undocumented: +# --with-target-subdir, --with-multisrctop, --with-multisubdir +# See config-ml.in if you want the gory details. + +if test "$srcdir" = "."; then + if test "$with_target_subdir" != "."; then + multi_basedir="$srcdir/$with_multisrctop../$2" + else + multi_basedir="$srcdir/$with_multisrctop$2" + fi +else + multi_basedir="$srcdir/$2" +fi +AC_SUBST(multi_basedir) + +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling = no && test $multilib = yes \ + && test "x${with_multisubdir}" != x ; then + cross_compiling=maybe +fi + +AC_OUTPUT_COMMANDS([ +# Only add multilib support code if we just rebuilt the top-level +# Makefile. +case " $CONFIG_FILES " in + *" ]m4_default([$1],Makefile)[ "*) + ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in + ;; +esac], + [ +srcdir="$srcdir" +host="$host" +target="$target" +with_multisubdir="$with_multisubdir" +with_multisrctop="$with_multisrctop" +with_target_subdir="$with_target_subdir" +ac_configure_args="${multilib_arg} ${ac_configure_args}" +multi_basedir="$multi_basedir" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +CC="$CC"])])dnl diff --git a/share/aclocal-1.10/obsol-gt.m4 b/share/aclocal-1.10/obsol-gt.m4 new file mode 100644 index 00000000..d380c6d1 --- /dev/null +++ b/share/aclocal-1.10/obsol-gt.m4 @@ -0,0 +1,12 @@ +# Support for obsolete Gettext macro. -*- Autoconf -*- + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# See comment in obsolete.m4. +AU_DEFUN([ud_GNU_GETTEXT], [AM_GNU_GETTEXT]) diff --git a/share/aclocal-1.10/obsol-lt.m4 b/share/aclocal-1.10/obsol-lt.m4 new file mode 100644 index 00000000..12c4d7d0 --- /dev/null +++ b/share/aclocal-1.10/obsol-lt.m4 @@ -0,0 +1,12 @@ +# Support for obsolete Libtool macro. -*- Autoconf -*- + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# See comment in obsolete.m4. +AU_DEFUN([gm_PROG_LIBTOOL], [AM_PROG_LIBTOOL]) diff --git a/share/aclocal-1.10/obsolete.m4 b/share/aclocal-1.10/obsolete.m4 new file mode 100644 index 00000000..bad1db76 --- /dev/null +++ b/share/aclocal-1.10/obsolete.m4 @@ -0,0 +1,37 @@ +## -*- Autoconf -*- +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Obsolete Automake macros. + +# We put here only the macros whose substitution is not an Automake +# macro; otherwise including this file would trigger dependencies for +# all the substitutions. Generally, obsolete Automake macros are +# better AU_DEFUNed in the same file as their replacement, or alone in +# a separate file (see obsol-gt.m4 or obsol-lt.m4 for instance). + +AU_DEFUN([AC_FEATURE_CTYPE], [AC_HEADER_STDC]) +AU_DEFUN([AC_FEATURE_ERRNO], [AC_REPLACE_FUNCS([strerror])]) +AU_DEFUN([AM_CYGWIN32], [AC_CYGWIN]) +AU_DEFUN([AM_EXEEXT], [AC_EXEEXT]) +AU_DEFUN([AM_FUNC_MKTIME], [AC_FUNC_MKTIME]) +AU_DEFUN([AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL], + [AC_HEADER_TIOCGWINSZ]) +AU_DEFUN([AM_MINGW32], [AC_MINGW32]) +AU_DEFUN([AM_PROG_INSTALL], [AC_PROG_INSTALL]) +AU_DEFUN([AM_SANITY_CHECK_CC], [AC_PROG_CC]) +AU_DEFUN([AM_SYS_POSIX_TERMIOS], [AC_SYS_POSIX_TERMIOS]) +AU_DEFUN([fp_FUNC_FNMATCH], [AC_FUNC_FNMATCH]) +AU_DEFUN([fp_PROG_INSTALL], [AC_PROG_INSTALL]) +AU_DEFUN([md_TYPE_PTRDIFF_T], [AC_CHECK_TYPES([ptrdiff_t])]) + +# Don't know how to translate these. +# If used, Autoconf will complain that they are possibly unexpended; +# this seems a good enough error message. +# AC_FEATURE_EXIT +# AC_SYSTEM_HEADER diff --git a/share/aclocal-1.10/options.m4 b/share/aclocal-1.10/options.m4 new file mode 100644 index 00000000..34c086d0 --- /dev/null +++ b/share/aclocal-1.10/options.m4 @@ -0,0 +1,32 @@ +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) diff --git a/share/aclocal-1.10/protos.m4 b/share/aclocal-1.10/protos.m4 new file mode 100644 index 00000000..427193b9 --- /dev/null +++ b/share/aclocal-1.10/protos.m4 @@ -0,0 +1,29 @@ +## ------------------------------- ## -*- Autoconf -*- +## Check for function prototypes. ## +## From Franc,ois Pinard ## +## ------------------------------- ## +# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +AC_DEFUN([AM_C_PROTOTYPES], +[AC_REQUIRE([AC_C_PROTOTYPES]) +if test "$ac_cv_prog_cc_stdc" != no; then + U= ANSI2KNR= +else + U=_ ANSI2KNR=./ansi2knr +fi +# Ensure some checks needed by ansi2knr itself. +AC_REQUIRE([AC_HEADER_STDC]) +AC_CHECK_HEADERS([string.h]) +AC_SUBST([U])dnl +AC_SUBST([ANSI2KNR])dnl +_AM_SUBST_NOTMAKE([ANSI2KNR])dnl +]) + +AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) diff --git a/share/aclocal-1.10/python.m4 b/share/aclocal-1.10/python.m4 new file mode 100644 index 00000000..229fd554 --- /dev/null +++ b/share/aclocal-1.10/python.m4 @@ -0,0 +1,168 @@ +## ------------------------ -*- Autoconf -*- +## Python file handling +## From Andrew Dalke +## Updated by James Henstridge +## ------------------------ +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------------------------- +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. +# +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. +# +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). +# +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. +AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 1.5 are not + dnl supported because the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5. + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], + [python python2 python2.5 python2.4 python2.3 python2.2 dnl +python2.1 python2.0 python1.6 python1.5]) + + m4_if([$1],[],[ + dnl No version check is needed. + # Find any Python interpreter. + if test -z "$PYTHON"; then + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) + fi + am_display_PYTHON=python + ], [ + dnl A version check is needed. + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + AC_MSG_CHECKING([whether $PYTHON version >= $1]) + AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(too old)]) + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + AC_CACHE_CHECK([for a Python interpreter with version >= $1], + [am_cv_pathless_PYTHON],[ + for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do + test "$am_cv_pathless_PYTHON" = none && break + AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) + done]) + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + ]) + + if test "$PYTHON" = :; then + dnl Run any user-specified action, or abort. + m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) + else + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. + + AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], + [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) + AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], + [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) + AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + + AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + + AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) + + dnl Run any user-specified action. + $2 + fi + +]) + + +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# hexversion has been introduced in Python 1.5.2; it's probably not +# worth to support older versions (1.5.1 was released on October 31, 1998). +AC_DEFUN([AM_PYTHON_CHECK_VERSION], + [prog="import sys, string +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] +minverhex = 0 +for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] +sys.exit(sys.hexversion < minverhex)" + AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) diff --git a/share/aclocal-1.10/regex.m4 b/share/aclocal-1.10/regex.m4 new file mode 100644 index 00000000..c05bb381 --- /dev/null +++ b/share/aclocal-1.10/regex.m4 @@ -0,0 +1,53 @@ +## --------------------------------- ## -*- Autoconf -*- +## Check if --with-regex was given. ## +## --------------------------------- ## +# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_WITH_REGEX +# ------------- +# +# The idea is to distribute rx.[hc] and regex.[hc] together, for a +# while. The WITH_REGEX symbol is used to decide which of regex.h or +# rx.h should be included in the application. If `./configure +# --with-regex' is given (the default), the package will use gawk's +# regex. If `./configure --without-regex', a check is made to see if +# rx is already installed, as with newer Linux'es. If not found, the +# package will use the rx from the distribution. If found, the +# package will use the system's rx which, on Linux at least, will +# result in a smaller executable file. +# +# FIXME: This macro seems quite obsolete now since rx doesn't seem to +# be maintained, while regex is. +AC_DEFUN([AM_WITH_REGEX], +[AC_PREREQ(2.50)dnl +AC_LIBSOURCES([rx.h, rx.c, regex.c, regex.h])dnl +AC_MSG_CHECKING([which of GNU rx or gawk's regex is wanted]) +AC_ARG_WITH([regex], +[ --without-regex use GNU rx in lieu of gawk's regex for matching], + [test "$withval" = yes && am_with_regex=1], + [am_with_regex=1]) +if test -n "$am_with_regex"; then + AC_MSG_RESULT([regex]) + AC_DEFINE([WITH_REGEX], 1, [Define if using GNU regex]) + AC_CACHE_CHECK([for GNU regex in libc], [am_cv_gnu_regex], + [AC_TRY_LINK([], + [extern int re_max_failures; re_max_failures = 1], + [am_cv_gnu_regex=yes], + [am_cv_gnu_regex=no])]) + if test $am_cv_gnu_regex = no; then + AC_LIBOBJ([regex]) + fi +else + AC_MSG_RESULT([rx]) + AC_CHECK_FUNC([re_rx_search], , [AC_LIBOBJ([rx])]) +fi[]dnl +]) + +AU_DEFUN([fp_WITH_REGEX], [AM_WITH_REGEX]) diff --git a/share/aclocal-1.10/runlog.m4 b/share/aclocal-1.10/runlog.m4 new file mode 100644 index 00000000..c3608fbb --- /dev/null +++ b/share/aclocal-1.10/runlog.m4 @@ -0,0 +1,17 @@ +## -*- Autoconf -*- +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) diff --git a/share/aclocal-1.10/sanity.m4 b/share/aclocal-1.10/sanity.m4 new file mode 100644 index 00000000..2e76b10d --- /dev/null +++ b/share/aclocal-1.10/sanity.m4 @@ -0,0 +1,51 @@ +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) diff --git a/share/aclocal-1.10/strip.m4 b/share/aclocal-1.10/strip.m4 new file mode 100644 index 00000000..43435dcf --- /dev/null +++ b/share/aclocal-1.10/strip.m4 @@ -0,0 +1,28 @@ +## -*- Autoconf -*- +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) diff --git a/share/aclocal-1.10/substnot.m4 b/share/aclocal-1.10/substnot.m4 new file mode 100644 index 00000000..27d3f1fb --- /dev/null +++ b/share/aclocal-1.10/substnot.m4 @@ -0,0 +1,12 @@ +## -*- Autoconf -*- +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) diff --git a/share/aclocal-1.10/tar.m4 b/share/aclocal-1.10/tar.m4 new file mode 100644 index 00000000..a4a00ecf --- /dev/null +++ b/share/aclocal-1.10/tar.m4 @@ -0,0 +1,95 @@ +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR diff --git a/share/aclocal-1.10/upc.m4 b/share/aclocal-1.10/upc.m4 new file mode 100644 index 00000000..a819ea72 --- /dev/null +++ b/share/aclocal-1.10/upc.m4 @@ -0,0 +1,20 @@ +# Find a compiler for Unified Parallel C. -*- Autoconf -*- + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([AM_PROG_UPC], +[dnl We need OBJEXT and EXEEXT, but Autoconf doesn't offer any public +dnl macro to compute them. Use AC_PROG_CC instead. +AC_REQUIRE([AC_PROG_CC])dnl +AC_ARG_VAR([UPC], [Unified Parallel C compiler command])dnl +AC_ARG_VAR([UPCFLAGS], [Unified Parallel C compiler flags])dnl +AC_CHECK_TOOLS([UPC], [m4_default([$1], [upcc upc])], [:]) +if test "$UPC" = :; then + AC_MSG_ERROR([no Unified Parallel C compiler was found], [77]) +fi +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([UPC])])dnl +]) diff --git a/share/autoconf/Autom4te/C4che.pm b/share/autoconf/Autom4te/C4che.pm new file mode 100644 index 00000000..bf8c6219 --- /dev/null +++ b/share/autoconf/Autom4te/C4che.pm @@ -0,0 +1,244 @@ +# autoconf -- create `configure' using m4 macros +# Copyright (C) 2003, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +package Autom4te::C4che; + +=head1 NAME + +Autom4te::C4che - a single m4 run request + +=head1 SYNOPSIS + + use Autom4te::C4che; + +=head1 DESCRIPTION + +This Perl module handles the cache of M4 runs used by autom4te. + +=cut + +use Data::Dumper; +use Autom4te::Request; +use Carp; +use strict; + +=over 4 + +=item @request + +List of requests. + +We cannot declare it "my" as the loading, performed via "do", would +refer to another scope, and @request would not be updated. It used to +work with "my" vars, and I do not know whether the current behavior +(5.6) is wanted or not. + +=cut + +use vars qw(@request); + +=item C<$req = Autom4te::C4che-Eretrieve (%attr)> + +Find a request with the same path and input. + +=cut + +sub retrieve($%) +{ + my ($self, %attr) = @_; + + foreach (@request) + { + # Same path. + next + if join ("\n", @{$_->path}) ne join ("\n", @{$attr{path}}); + + # Same inputs. + next + if join ("\n", @{$_->input}) ne join ("\n", @{$attr{input}}); + + # Found it. + return $_; + } + + return undef; +} + +=item C<$req = Autom4te::C4che-Eregister (%attr)> + +Create and register a request for these path and input. + +=cut + +# $REQUEST-OBJ +# register ($SELF, %ATTR) +# ----------------------- +# NEW should not be called directly. +# Private. +sub register ($%) +{ + my ($self, %attr) = @_; + + # path and input are the only ID for a request object. + my $obj = new Autom4te::Request ('path' => $attr{path}, + 'input' => $attr{input}); + push @request, $obj; + + # Assign an id for cache file. + $obj->id ("$#request"); + + return $obj; +} + + +=item C<$req = Autom4te::C4che-Erequest (%request)> + +Get (retrieve or create) a request for the path C<$request{path}> and +the input C<$request{input}>. + +=cut + +# $REQUEST-OBJ +# request($SELF, %REQUEST) +# ------------------------ +sub request ($%) +{ + my ($self, %request) = @_; + + my $req = + Autom4te::C4che->retrieve (%request) + || Autom4te::C4che->register (%request); + + # If there are new traces to produce, then we are not valid. + foreach (@{$request{'macro'}}) + { + if (! exists ${$req->macro}{$_}) + { + ${$req->macro}{$_} = 1; + $req->valid (0); + } + } + + # It would be great to have $REQ check that it is up to date wrt + # its dependencies, but that requires getting traces (to fetch the + # included files), which is out of the scope of Request (currently?). + + return $req; +} + + +=item C<$string = Autom4te::C4che-Emarshall ()> + +Serialize all the current requests. + +=cut + + +# marshall($SELF) +# --------------- +sub marshall ($) +{ + my ($caller) = @_; + my $res = ''; + + my $marshall = Data::Dumper->new ([\@request], [qw (*request)]); + $marshall->Indent(2)->Terse(0); + $res = $marshall->Dump . "\n"; + + return $res; +} + + +=item Csave ($file)> + +Save the cache in the C<$file> file object. + +=cut + +# SAVE ($FILE) +# ------------ +sub save ($$) +{ + my ($self, $file) = @_; + + confess "cannot save a single request\n" + if ref ($self); + + $file->seek (0, 0); + $file->truncate (0); + print $file + "# This file was generated.\n", + "# It contains the lists of macros which have been traced.\n", + "# It can be safely removed.\n", + "\n", + $self->marshall; +} + + +=item Cload ($file)> + +Load the cache from the C<$file> file object. + +=cut + +# LOAD ($FILE) +# ------------ +sub load ($$) +{ + my ($self, $file) = @_; + my $fname = $file->name; + + confess "cannot load a single request\n" + if ref ($self); + + my $contents = join "", $file->getlines; + + eval $contents; + + confess "cannot eval $fname: $@\n" if $@; +} + + +=head1 SEE ALSO + +L + +=head1 HISTORY + +Written by Akim Demaille EFE. + +=cut + +1; # for require + +### Setup "GNU" style for perl-mode and cperl-mode. +## Local Variables: +## perl-indent-level: 2 +## perl-continued-statement-offset: 2 +## perl-continued-brace-offset: 0 +## perl-brace-offset: 0 +## perl-brace-imaginary-offset: 0 +## perl-label-offset: -2 +## cperl-indent-level: 2 +## cperl-brace-offset: 0 +## cperl-continued-brace-offset: 0 +## cperl-label-offset: -2 +## cperl-extra-newline-before-brace: t +## cperl-merge-trailing-else: nil +## cperl-continued-statement-offset: 2 +## End: diff --git a/share/autoconf/Autom4te/ChannelDefs.pm b/share/autoconf/Autom4te/ChannelDefs.pm new file mode 100644 index 00000000..ba94e245 --- /dev/null +++ b/share/autoconf/Autom4te/ChannelDefs.pm @@ -0,0 +1,390 @@ +# Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +package Autom4te::ChannelDefs; + +use Autom4te::Channels; + +=head1 NAME + +Autom4te::ChannelDefs - channel definitions for Automake and helper functions + +=head1 SYNOPSIS + + use Autom4te::ChannelDefs; + + print Autom4te::ChannelDefs::usage (), "\n"; + prog_error ($MESSAGE, [%OPTIONS]); + error ($WHERE, $MESSAGE, [%OPTIONS]); + error ($MESSAGE); + fatal ($WHERE, $MESSAGE, [%OPTIONS]); + fatal ($MESSAGE); + verb ($MESSAGE, [%OPTIONS]); + switch_warning ($CATEGORY); + parse_WARNINGS (); + parse_warnings ($OPTION, $ARGUMENT); + Autom4te::ChannelDefs::set_strictness ($STRICTNESS_NAME); + +=head1 DESCRIPTION + +This packages defines channels that can be used in Automake to +output diagnostics and other messages (via C). It also defines +some helper function to enable or disable these channels, and some +shorthand function to output on specific channels. + +=cut + +use 5.005; +use strict; +use Exporter; + +use vars qw (@ISA @EXPORT); + +@ISA = qw (Exporter); +@EXPORT = qw (&prog_error &error &fatal &verb + &switch_warning &parse_WARNINGS &parse_warnings); + +=head2 CHANNELS + +The following channels can be used as the first argument of +C. For some of them we list a shorthand +function that makes the code more readable. + +=over 4 + +=item C + +Fatal errors. Use C<&fatal> to send messages over this channel. + +=item C + +Common errors. Use C<&error> to send messages over this channel. + +=item C + +Errors related to GNU Standards. + +=item C + +Errors related to GNU Standards that should be warnings in "foreign" mode. + +=item C + +Errors related to GNITS Standards (silent by default). + +=item C + +Internal errors. Use C<&prog_error> to send messages over this channel. + +=item C + +Constructs compromising the cross-compilation of the package. + +=item C + +Warnings related to GNU Coding Standards. + +=item C + +Warnings about obsolete features (silent by default). + +=item C + +Warnings about user redefinitions of Automake rules or +variables (silent by default). + +=item C + +Warnings about non-portable constructs. + +=item C + +Warnings about weird syntax, unused variables, typos... + +=item C + +Warnings about unsupported (or mis-supported) features. + +=item C + +Messages output in C<--verbose> mode. Use C<&verb> to send such messages. + +=item C + +Informative messages. + +=back + +=cut + +# Initialize our list of error/warning channels. +# Do not forget to update &usage and the manual +# if you add or change a warning channel. + +register_channel 'fatal', type => 'fatal'; +register_channel 'error', type => 'error'; +register_channel 'error-gnu', type => 'error'; +register_channel 'error-gnu/warn', type => 'error'; +register_channel 'error-gnits', type => 'error', silent => 1; +register_channel 'automake', type => 'fatal', backtrace => 1, + header => ("####################\n" . + "## Internal Error ##\n" . + "####################\n"), + footer => "\nPlease contact ."; + +register_channel 'cross', type => 'warning', silent => 1; +register_channel 'gnu', type => 'warning'; +register_channel 'obsolete', type => 'warning', silent => 1; +register_channel 'override', type => 'warning', silent => 1; +register_channel 'portability', type => 'warning', silent => 1; +register_channel 'syntax', type => 'warning'; +register_channel 'unsupported', type => 'warning'; + +register_channel 'verb', type => 'debug', silent => 1; +register_channel 'note', type => 'debug', silent => 0; + +=head2 FUNCTIONS + +=over 4 + +=item C + +Return the warning category descriptions. + +=cut + +sub usage () +{ + return "Warning categories include: + `cross' cross compilation issues + `gnu' GNU coding standards (default in gnu and gnits modes) + `obsolete' obsolete features or constructions + `override' user redefinitions of Automake rules or variables + `portability' portability issues (default in gnu and gnits modes) + `syntax' dubious syntactic constructs (default) + `unsupported' unsupported or incomplete features (default) + `all' all the warnings + `no-CATEGORY' turn off warnings in CATEGORY + `none' turn off all the warnings + `error' treat warnings as errors"; +} + +=item C + +Signal a programming error (on channel C), +display C<$MESSAGE>, and exit 1. + +=cut + +sub prog_error ($;%) +{ + my ($msg, %opts) = @_; + msg 'automake', '', $msg, %opts; +} + +=item C + +=item C + +Uncategorized errors. + +=cut + +sub error ($;$%) +{ + my ($where, $msg, %opts) = @_; + msg ('error', $where, $msg, %opts); +} + +=item C + +=item C + +Fatal errors. + +=cut + +sub fatal ($;$%) +{ + my ($where, $msg, %opts) = @_; + msg ('fatal', $where, $msg, %opts); +} + +=item C + +C<--verbose> messages. + +=cut + +sub verb ($;%) +{ + my ($msg, %opts) = @_; + msg 'verb', '', $msg, %opts; +} + +=item C + +If C<$CATEGORY> is C, turn on channel C. +If it is C, turn C off. +Else handle C and C for completeness. + +=cut + +sub switch_warning ($) +{ + my ($cat) = @_; + my $has_no = 0; + + if ($cat =~ /^no-(.*)$/) + { + $cat = $1; + $has_no = 1; + } + + if ($cat eq 'all') + { + setup_channel_type 'warning', silent => $has_no; + } + elsif ($cat eq 'none') + { + setup_channel_type 'warning', silent => ! $has_no; + } + elsif ($cat eq 'error') + { + $warnings_are_errors = ! $has_no; + # Set exit code if Perl warns about something + # (like uninitialized variables). + $SIG{"__WARN__"} = + $has_no ? 'DEFAULT' : sub { print STDERR @_; $exit_code = 1; }; + } + elsif (channel_type ($cat) eq 'warning') + { + setup_channel $cat, silent => $has_no; + } + else + { + return 1; + } + return 0; +} + +=item C + +Parse the WARNINGS environment variable. + +=cut + +sub parse_WARNINGS () +{ + if (exists $ENV{'WARNINGS'}) + { + # Ignore unknown categories. This is required because WARNINGS + # should be honored by many tools. + switch_warning $_ foreach (split (',', $ENV{'WARNINGS'})); + } +} + +=item C + +Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>. + +C<$OPTIONS> is C<"--warning"> or C<"-W">, C<@ARGUMENT> is a list of +C. + +This can be used as a argument to C. + +=cut + +sub parse_warnings ($@) +{ + my ($opt, @categories) = @_; + + foreach my $cat (map { split ',' } @categories) + { + msg 'unsupported', "unknown warning category `$cat'" + if switch_warning $cat; + } +} + +=item C + +Configure channels for strictness C<$STRICTNESS_NAME>. + +=cut + +sub set_strictness ($) +{ + my ($name) = @_; + + if ($name eq 'gnu') + { + setup_channel 'error-gnu', silent => 0; + setup_channel 'error-gnu/warn', silent => 0, type => 'error'; + setup_channel 'error-gnits', silent => 1; + setup_channel 'portability', silent => 0; + setup_channel 'gnu', silent => 0; + } + elsif ($name eq 'gnits') + { + setup_channel 'error-gnu', silent => 0; + setup_channel 'error-gnu/warn', silent => 0, type => 'error'; + setup_channel 'error-gnits', silent => 0; + setup_channel 'portability', silent => 0; + setup_channel 'gnu', silent => 0; + } + elsif ($name eq 'foreign') + { + setup_channel 'error-gnu', silent => 1; + setup_channel 'error-gnu/warn', silent => 0, type => 'warning'; + setup_channel 'error-gnits', silent => 1; + setup_channel 'portability', silent => 1; + setup_channel 'gnu', silent => 1; + } + else + { + prog_error "level `$name' not recognized\n"; + } +} + +=back + +=head1 SEE ALSO + +L + +=head1 HISTORY + +Written by Alexandre Duret-Lutz EFE. + +=cut + +### Setup "GNU" style for perl-mode and cperl-mode. +## Local Variables: +## perl-indent-level: 2 +## perl-continued-statement-offset: 2 +## perl-continued-brace-offset: 0 +## perl-brace-offset: 0 +## perl-brace-imaginary-offset: 0 +## perl-label-offset: -2 +## cperl-indent-level: 2 +## cperl-brace-offset: 0 +## cperl-continued-brace-offset: 0 +## cperl-label-offset: -2 +## cperl-extra-newline-before-brace: t +## cperl-merge-trailing-else: nil +## cperl-continued-statement-offset: 2 +## End: diff --git a/share/autoconf/Autom4te/Channels.pm b/share/autoconf/Autom4te/Channels.pm new file mode 100644 index 00000000..1d4d824b --- /dev/null +++ b/share/autoconf/Autom4te/Channels.pm @@ -0,0 +1,709 @@ +# Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +############################################################### +# The main copy of this file is in Automake's CVS repository. # +# Updates should be sent to automake-patches@gnu.org. # +############################################################### + +package Autom4te::Channels; + +=head1 NAME + +Autom4te::Channels - support functions for error and warning management + +=head1 SYNOPSIS + + use Autom4te::Channels; + + # Register a channel to output warnings about unused variables. + register_channel 'unused', type => 'warning'; + + # Register a channel for system errors. + register_channel 'system', type => 'error', exit_code => 4; + + # Output a message on channel 'unused'. + msg 'unused', "$file:$line", "unused variable `$var'"; + + # Make the 'unused' channel silent. + setup_channel 'unused', silent => 1; + + # Turn on all channels of type 'warning'. + setup_channel_type 'warning', silent => 0; + + # Treat all warnings as errors. + $warnings_are_errors = 1; + + # Exit with the greatest exit code encountered so far. + exit $exit_code; + +=head1 DESCRIPTION + +This perl module provides support functions for handling diagnostic +channels in programs. Channels can be registered to convey fatal, +error, warning, or debug messages. Each channel has various options +(e.g. is the channel silent, should duplicate messages be removed, +etc.) that can also be overridden on a per-message basis. + +=cut + +use 5.005; +use strict; +use Exporter; +use Carp; +use File::Basename; + +use vars qw (@ISA @EXPORT %channels $me); + +@ISA = qw (Exporter); +@EXPORT = qw ($exit_code $warnings_are_errors + &reset_local_duplicates &reset_global_duplicates + ®ister_channel &msg &exists_channel &channel_type + &setup_channel &setup_channel_type + &dup_channel_setup &drop_channel_setup + &buffer_messages &flush_messages + US_GLOBAL US_LOCAL + UP_NONE UP_TEXT UP_LOC_TEXT); + +$me = basename $0; + +=head2 Global Variables + +=over 4 + +=item C<$exit_code> + +The greatest exit code seen so far. C<$exit_code> is updated from +the C options of C and C channels. + +=cut + +use vars qw ($exit_code); +$exit_code = 0; + +=item C<$warnings_are_errors> + +Set this variable to 1 if warning messages should be treated as +errors (i.e. if they should update C<$exit_code>). + +=cut + +use vars qw ($warnings_are_errors); +$warnings_are_errors = 0; + +=back + +=head2 Constants + +=over 4 + +=item C, C, C + +Possible values for the C options. This selects the part +of the message that should be considered when filtering out duplicates. +If C is used, the location and the explanation message +are used for filtering. If C is used, only the explanation +message is used (so the same message will be filtered out if it appears +at different locations). C means that duplicate messages +should be output. + +=cut + +use constant UP_NONE => 0; +use constant UP_TEXT => 1; +use constant UP_LOC_TEXT => 2; + +=item C, C + +Possible values for the C options. +Use C for error messages that should be printed only +once during the execution of the program, C for message that +should be printed only once per file. (Actually, C does not +do this now when files are changed, it relies on you calling +C when this happens.) + +=cut + +# possible values for uniq_scope +use constant US_LOCAL => 0; +use constant US_GLOBAL => 1; + +=back + +=head2 Options + +Channels accept the options described below. These options can be +passed as a hash to the C, C, and C +functions. The possible keys, with their default value are: + +=over + +=item C 'warning'> + +The type of the channel. One of C<'debug'>, C<'warning'>, C<'error'>, or +C<'fatal'>. Fatal messages abort the program when they are output. +Error messages update the exit status. Debug and warning messages are +harmless, except that warnings can be treated as errors of +C<$warnings_are_errors> is set. + +=item C 1> + +The value to update C<$exit_code> with when a fatal or error message +is emitted. C<$exit_code> is also updated for warnings output +when @<$warnings_are_errors> is set. + +=item C \*STDERR> + +The file where the error should be output. + +=item C 0> + +Whether the channel should be silent. Use this do disable a +category of warning, for instance. + +=item C UP_LOC_TEXT> + +The part of the message subject to duplicate filtering. See the +documentation for the C, C, and C +constants above. + +C can also be set to an arbitrary string that will be used +instead of the message when considering duplicates. + +=item C US_LOCAL> + +The scope of duplicate filtering. See the documentation for the +C, and C constants above. + +=item C
''> + +A string to prepend to each message emitted through this channel. + +=item C