usr/bin/aclocal 0000755 00000107576 14720734500 0007473 0 ustar 00 #!/usr/bin/perl -w
# -*- perl -*-
# Generated from aclocal.in; do not edit by hand.
eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
if 0;
# aclocal - create aclocal.m4 by scanning configure.ac
# Copyright (C) 1996-2013 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, see .
# Written by Tom Tromey , and
# Alexandre Duret-Lutz .
BEGIN
{
@Aclocal::perl_libdirs = ('/usr/share/automake-1.13')
unless @Aclocal::perl_libdirs;
unshift @INC, @Aclocal::perl_libdirs;
}
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::Path ();
# Some globals.
# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
# FIXME: To be removed in Automake 2.0, once we can assume autoconf
# 2.70 or later.
# FIXME: keep in sync with 'internal/ac-config-macro-dirs.m4'.
my $ac_config_macro_dirs_fallback =
'm4_ifndef([AC_CONFIG_MACRO_DIRS], [' .
'm4_defun([_AM_CONFIG_MACRO_DIRS], [])' .
'm4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])' .
'])';
# We do not operate in threaded mode.
$perl_threads = 0;
# 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 macros.
# @user_includes can be augmented with -I or AC_CONFIG_MACRO_DIRS.
# @automake_includes can be reset with the '--automake-acdir' option.
# @system_includes can be augmented with the 'dirlist' file or the
# ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
# option.
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. This variable is set by 'trace_used_macros'.
my $ac_version;
# User directory containing extra m4 files for macros definition,
# as extracted from calls to the macro AC_CONFIG_MACRO_DIRS.
# This variable is updated by 'trace_used_macros'.
my @ac_config_macro_dirs;
# If set, names a temporary file that must be erased on abnormal exit.
my $erase_me;
# Constants for the $ERR_LEVEL parameter of the 'scan_m4_dirs' function.
use constant SCAN_M4_DIRS_SILENT => 0;
use constant SCAN_M4_DIRS_WARN => 1;
use constant SCAN_M4_DIRS_ERROR => 2;
################################################################
# Prototypes for all subroutines.
sub unlink_tmp (;$);
sub xmkdir_p ($);
sub check_acinclude ();
sub reset_maps ();
sub install_file ($$);
sub list_compare (\@\@);
sub scan_m4_dirs ($$@);
sub scan_m4_files ();
sub add_macro ($);
sub scan_configure_dep ($);
sub add_file ($);
sub scan_file ($$$);
sub strip_redundant_includes (%);
sub trace_used_macros ();
sub scan_configure ();
sub write_aclocal ($@);
sub usage ($);
sub version ();
sub handle_acdir_option ($$);
sub parse_arguments ();
sub parse_ACLOCAL_PATH ();
################################################################
# Erase temporary file ERASE_ME. Handle signals.
sub unlink_tmp (;$)
{
my ($sig) = @_;
if ($sig)
{
verb "caught SIG$sig, bailing out";
}
if (defined $erase_me && -e $erase_me && !unlink ($erase_me))
{
fatal "could not remove '$erase_me': $!";
}
undef $erase_me;
# reraise default handler.
if ($sig)
{
$SIG{$sig} = 'DEFAULT';
kill $sig => $$;
}
}
$SIG{'INT'} = $SIG{'TERM'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'unlink_tmp';
END { unlink_tmp }
sub xmkdir_p ($)
{
my $dir = shift;
local $@ = undef;
return
if -d $dir or eval { File::Path::mkpath $dir };
chomp $@;
$@ =~ s/\s+at\s.*\bline\s\d+.*$//;
fatal "could not create directory '$dir': $@";
}
# 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', "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, $DESTDIR)
sub install_file ($$)
{
my ($src, $destdir) = @_;
my $dest = $destdir . "/" . basename ($src);
my $diff_dest;
verb "installing $src to $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)
{
xmkdir_p ($destdir);
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, $ERR_LEVEL, @DIRS)
# -----------------------------------------------
# Scan all M4 files installed in @DIRS for new macro definitions.
# Register each file as of type $TYPE (one of the FT_* constants).
# If a directory in @DIRS cannot be read:
# - fail hard if $ERR_LEVEL == SCAN_M4_DIRS_ERROR
# - just print a warning if $ERR_LEVEL == SCAN_M4_DIRS_WA
# - continue silently if $ERR_LEVEL == SCAN_M4_DIRS_SILENT
sub scan_m4_dirs ($$@)
{
my ($type, $err_level, @dirlist) = @_;
foreach my $m4dir (@dirlist)
{
if (! opendir (DIR, $m4dir))
{
# TODO: maybe avoid complaining only if errno == ENONENT?
my $message = "couldn't open directory '$m4dir': $!";
if ($err_level == SCAN_M4_DIRS_ERROR)
{
fatal $message;
}
elsif ($err_level == SCAN_M4_DIRS_WARN)
{
msg ('unsupported', $message);
next;
}
elsif ($err_level == SCAN_M4_DIRS_SILENT)
{
next; # Silently ignore.
}
else
{
prog_error "invalid \$err_level value '$err_level'";
}
}
# 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.
if (@user_includes)
{
# Don't explore the same directory multiple times. This is here not
# only for speedup purposes. We need this when the user has e.g.
# specified 'ACLOCAL_AMFLAGS = -I m4' and has also set
# AC_CONFIG_MACRO_DIR[S]([m4]) in configure.ac. This makes the 'm4'
# directory to occur twice here and fail on the second call to
# scan_m4_dirs([m4]) when the 'm4' directory doesn't exist.
# TODO: Shouldn't there be rather a check in scan_m4_dirs for
# @user_includes[0]?
@user_includes = uniq @user_includes;
# Don't complain if the first user directory doesn't exist, in case
# we need to create it later (can happen if '--install' was given).
scan_m4_dirs (FT_USER,
$install ? SCAN_M4_DIRS_SILENT : SCAN_M4_DIRS_WARN,
$user_includes[0]);
scan_m4_dirs (FT_USER,
SCAN_M4_DIRS_ERROR,
@user_includes[1..$#user_includes]);
}
scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes);
scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @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",
"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:$.",
"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:$.", "underquoted definition of $2"
. "\n run info Automake 'Extending aclocal'\n"
. " or see http://www.gnu.org/software/automake/manual/"
. "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;
# When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings
# from autom4te about macros being "m4_require'd but not m4_defun'd";
# for more background, see:
# http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00004.html
# as well as autoconf commit 'v2.69-44-g1ed0548', "warn: allow aclocal
# to silence m4_require warnings".
my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])";
my $traces = ($ENV{AUTOM4TE} || 'autom4te');
$traces .= " --language Autoconf-without-aclocal-m4 ";
$traces = "echo '$early_m4_code' | $traces - ";
# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
# Note that we can't use '$ac_config_macro_dirs_fallback' here, because
# a bug in option parsing code of autom4te 2.68 and earlier will cause
# it to read standard input last, even if the "-" argument is specified
# early.
# FIXME: To be removed in Automake 2.0, once we can assume autoconf
# 2.70 or later.
$traces .= "$automake_includes[0]/internal/ac-config-macro-dirs.m4 ";
# All candidate files.
$traces .= join (' ',
(map { "'$_'" }
(grep { exists $files{$_} } @file_order))) . " ";
# All candidate macros.
$traces .= join (' ',
(map { "--trace='$_:\$f::\$n::\${::}%'" }
('AC_DEFUN',
'AC_DEFUN_ONCE',
'AU_DEFUN',
'_AM_AUTOCONF_VERSION',
'AC_CONFIG_MACRO_DIR_TRACE',
# FIXME: Tracing the next two macros is a hack for
# compatibility with older autoconf. Remove this in
# Automake 2.0, when we can assume Autoconf 2.70 or
# later.
'AC_CONFIG_MACRO_DIR',
'_AM_CONFIG_MACRO_DIRS')),
# 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 |");
@ac_config_macro_dirs = ();
my %traced = ();
while ($_ = $tracefh->getline)
{
chomp;
my ($file, $macro, $arg1) = split (/::/);
$traced{$macro} = 1 if exists $macro_seen{$macro};
if ($macro eq 'AC_DEFUN' || $macro eq 'AC_DEFUN_ONCE'
|| $macro eq 'AU_DEFUN')
{
$map_traced_defs{$arg1} = $file;
}
elsif ($macro eq '_AM_AUTOCONF_VERSION')
{
$ac_version = $arg1;
}
elsif ($macro eq 'AC_CONFIG_MACRO_DIR_TRACE')
{
push @ac_config_macro_dirs, $arg1;
}
# FIXME: We still need to trace AC_CONFIG_MACRO_DIR
# for compatibility with older autoconf. Remove this
# once we can assume Autoconf 2.70 or later.
elsif ($macro eq 'AC_CONFIG_MACRO_DIR')
{
@ac_config_macro_dirs = ($arg1);
}
# FIXME:This is an hack for compatibility with older autoconf.
# Remove this once we can assume Autoconf 2.70 or later.
elsif ($macro eq '_AM_CONFIG_MACRO_DIRS')
{
# Empty leading/trailing fields might be produced by split,
# hence the grep is really needed.
push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1));
}
}
# FIXME: in Autoconf >= 2.70, AC_CONFIG_MACRO_DIR calls
# AC_CONFIG_MACRO_DIR_TRACE behind the scenes, which could
# leave unwanted duplicates in @ac_config_macro_dirs.
# Remove this in Automake 2.0, when we'll stop tracing
# AC_CONFIG_MACRO_DIR explicitly.
@ac_config_macro_dirs = uniq @ac_config_macro_dirs;
$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)
{
install_file ($ifile, $user_includes[0]);
}
$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_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [$ac_version],,
[m4_warning([this file was generated for autoconf $ac_version.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
$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-$RELEASE_YEAR 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.
$ac_config_macro_dirs_fallback
$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 <<'EOF';
Usage: aclocal [OPTION]...
Generate 'aclocal.m4' by scanning 'configure.ac' or 'configure.in'
Options:
--automake-acdir=DIR directory holding automake-provided m4 files
--system-acdir=DIR directory holding third-party system-wide files
--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 system-wide
third-party 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 .
GNU Automake home page: .
General help using GNU software: .
EOF
exit $status;
}
# Print version and exit.
sub version ()
{
print <
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Tom Tromey
and Alexandre Duret-Lutz .
EOF
exit 0;
}
# Parse command line.
sub parse_arguments ()
{
my $print_and_exit = 0;
my $diff_command;
my %cli_options =
(
'help' => sub { usage(0); },
'version' => \&version,
'system-acdir=s' => sub { shift; @system_includes = @_; },
'automake-acdir=s' => sub { shift; @automake_includes = @_; },
'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 Automake::Getopt ();
Automake::Getopt::parse_options %cli_options;
if (@ARGV > 0)
{
fatal ("non-option arguments are not accepted: '$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;
}
# 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);
}
}
# Add any directory listed in the 'ACLOCAL_PATH' environment variable
# to the list of system include directories.
sub parse_ACLOCAL_PATH ()
{
return if not defined $ENV{"ACLOCAL_PATH"};
# Directories in ACLOCAL_PATH should take precedence over system
# directories, so we use unshift. However, directories that
# come first in ACLOCAL_PATH take precedence over directories
# coming later, which is why the result of split is reversed.
foreach my $dir (reverse split /:/, $ENV{"ACLOCAL_PATH"})
{
unshift (@system_includes, $dir) if $dir ne '' && -d $dir;
}
}
################################################################
parse_WARNINGS; # Parse the WARNINGS environment variable.
parse_arguments;
parse_ACLOCAL_PATH;
$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;
my $rerun_due_to_macrodir = 0;
while (1)
{
++$loop;
prog_error "too many loops" if $loop > 2 + $rerun_due_to_macrodir;
reset_maps;
scan_m4_files;
scan_configure;
last if $exit_code;
my %macro_traced = trace_used_macros;
if (!$rerun_due_to_macrodir && @ac_config_macro_dirs)
{
# The directory specified in calls to the AC_CONFIG_MACRO_DIRS
# m4 macro (if any) must go after the user includes specified
# explicitly with the '-I' option.
push @user_includes, @ac_config_macro_dirs;
# We might have to scan some new directory of .m4 files.
$rerun_due_to_macrodir++;
next;
}
if ($install && !@user_includes)
{
fatal "installation of third-party macros impossible without " .
"-I options nor AC_CONFIG_MACRO_DIR{,S} m4 macro(s)";
}
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:
libmcrypt.m4 0000644 00000020662 14723054632 0007027 0 ustar 00 dnl Autoconf macros for libmcrypt
dnl $id$
# This script detects libmcrypt version and defines
# LIBMCRYPT_CFLAGS, LIBMCRYPT_LIBS
# and LIBMCRYPT24 or LIBMCRYPT22 depending on libmcrypt version
# found.
# Modified for LIBMCRYPT -- nmav
# Configure paths for LIBGCRYPT
# Shamelessly stolen from the one of XDELTA by Owen Taylor
# Werner Koch 99-12-09
dnl AM_PATH_LIBMCRYPT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libmcrypt, and define LIBMCRYPT_CFLAGS and LIBMCRYPT_LIBS
dnl
AC_DEFUN([AM_PATH_LIBMCRYPT],
[dnl
dnl Get the cflags and libraries from the libmcrypt-config script
dnl
AC_ARG_WITH(libmcrypt-prefix,
[ --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)],
libmcrypt_config_prefix="$withval", libmcrypt_config_prefix="")
if test x$libmcrypt_config_prefix != x ; then
libmcrypt_config_args="$libmcrypt_config_args --prefix=$libmcrypt_config_prefix"
if test x${LIBMCRYPT_CONFIG+set} != xset ; then
LIBMCRYPT_CONFIG=$libmcrypt_config_prefix/bin/libmcrypt-config
fi
fi
AC_PATH_PROG(LIBMCRYPT_CONFIG, libmcrypt-config, no)
min_libmcrypt_version=ifelse([$1], ,2.4.0,$1)
AC_MSG_CHECKING(for libmcrypt - version >= $min_libmcrypt_version)
no_libmcrypt=""
if test "$LIBMCRYPT_CONFIG" = "no" ; then
dnl libmcrypt-config was not found (pre 2.4.11 versions)
dnl Try to detect libmcrypt version
AC_TRY_RUN([
#include
#include
#include
#include
int
main ()
{
#if MCRYPT_API_VERSION <= 19991015
/* version 2.2 */
return 0;
#else
/* version 2.4 */
return 1;
#endif /* 19991015 */
}
], libmcrypt_config_version="2.2.0"
if test x$libmcrypt_config_prefix != x ; then
TTLIBS="-L${libmcrypt_config_prefix}/libs"
TTINCLUDE="-I${libmcrypt_config_prefix}/include"
fi
LIBMCRYPT_CFLAGS="${TTINCLUDE}"
LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt"
AC_DEFINE(LIBMCRYPT22, 1, [have libmcrypt 2.2])
, libmcrypt_config_version="2.4.0"
if test x$libmcrypt_config_prefix != x ; then
TTLIBS="-L${libmcrypt_config_prefix}/libs"
TTINCLUDE="-I${libmcrypt_config_prefix}/include"
fi
LIBMCRYPT_CFLAGS="${TTINCLUDE}"
LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}"
AC_DEFINE(LIBMCRYPT24, 1, [have libmcrypt 2.4]))
else
dnl libmcrypt-config was found
LIBMCRYPT_CFLAGS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --cflags`
LIBMCRYPT_LIBS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --libs`
libmcrypt_config_version=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --version`
AC_DEFINE(LIBMCRYPT24, 1, [have libmcrypt 2.4])
fi
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS"
LIBS="$LIBS $LIBMCRYPT_LIBS"
dnl
dnl Now check if the installed libmcrypt is sufficiently new. Also sanity
dnl checks the results of libmcrypt-config to some extent
dnl
rm -f conf.libmcrypttest
AC_TRY_RUN([
#include
#include
#include
#include
#define TWO "2.2"
int
main ()
{
#if MCRYPT_API_VERSION <= 20010201
#if MCRYPT_API_VERSION <= 19991015
/* version 2.2 */
int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128);
system ("touch conf.libmcrypttest");
if( strncmp( TWO, "$min_libmcrypt_version", strlen(TWO))) {
printf("\n*** Requested libmcrypt %s, but LIBMCRYPT (%s)\n",
"$min_libmcrypt_version", TWO );
printf("*** was found!\n");
return 1;
}
return 0;
#else
/* version 2.4 before 11 */
MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL);
system ("touch conf.libmcrypttest");
mcrypt_module_close(td);
return 0;
#endif /* 19991015 */
#else
system ("touch conf.libmcrypttest");
if( strcmp( mcrypt_check_version(NULL), "$libmcrypt_config_version" ) )
{
printf("\n*** 'libmcrypt-config --version' returned %s, but LIBMCRYPT (%s)\n",
"$libmcrypt_config_version", mcrypt_check_version(NULL) );
printf("*** was found! If libmcrypt-config was correct, then it is best\n");
printf("*** to remove the old version of LIBMCRYPT. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG\n");
printf("*** to point to the correct copy of libmcrypt-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
else if ( strcmp(mcrypt_check_version(NULL), LIBMCRYPT_VERSION ) )
{
printf("\n*** LIBMCRYPT header file (version %s) does not match\n", LIBMCRYPT_VERSION);
printf("*** library (version %s)\n", mcrypt_check_version(NULL) );
}
else
{
if ( mcrypt_check_version( "$min_libmcrypt_version" ) )
{
return 0;
}
else
{
printf("no\n*** An old version of LIBMCRYPT (%s) was found.\n",
mcrypt_check_version(NULL) );
printf("*** You need a version of LIBMCRYPT newer than %s. The latest version of\n",
"$min_libmcrypt_version" );
printf("*** LIBMCRYPT is always available from ftp://mcrypt.hellug.gr/pub/mcrypt.\n");
printf("*** \n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the libmcrypt-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of LIBMCRYPT, but you can also set the LIBMCRYPT_CONFIG environment to point to the\n");
printf("*** correct copy of libmcrypt-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time)\n");
}
}
return 1;
#endif /* 20010201 */
}
],, no_libmcrypt=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "x$no_libmcrypt" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
if test -f conf.libmcrypttest ; then
:
else
AC_MSG_RESULT(no)
fi
if test -f conf.libmcrypttest ; then
:
else
echo "*** Could not run libmcrypt test program, checking why..."
CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS"
LIBS="$LIBS $LIBMCRYPT_LIBS"
AC_TRY_LINK([
#include
#include
#include
#include
], [
#if MCRYPT_API_VERSION <= 20010201
#if MCRYPT_API_VERSION <= 19991015
/* version 2.2 */
int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128);
return 0;
#else
/* version 2.4 before 11 */
MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL);
mcrypt_module_close(td);
return 0;
#endif /* 19991015 */
#else
return !!mcrypt_check_version(NULL);
#endif /* 20010201 */
],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBMCRYPT or finding the wrong"
echo "*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means LIBMCRYPT was incorrectly installed"
echo "*** or that you have moved LIBMCRYPT since it was installed. In the latter case, you"
echo "*** may want to edit the libmcrypt-config script: $LIBMCRYPT_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
LIBMCRYPT_CFLAGS=""
LIBMCRYPT_LIBS=""
ifelse([$3], , :, [$3])
fi
rm -f conf.libmcrypttest
AC_SUBST(LIBMCRYPT_CFLAGS)
AC_SUBST(LIBMCRYPT_LIBS)
])
dnl *-*wedit:notab*-* Please keep this as the last line.
libxml.m4 0000644 00000017310 14723064625 0006310 0 ustar 00 # Configure paths for LIBXML2
# Mike Hommey 2004-06-19
# use CPPFLAGS instead of CFLAGS
# Toshio Kuratomi 2001-04-21
# Adapted from:
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
dnl
AC_DEFUN([AM_PATH_XML2],[
AC_ARG_WITH(xml-prefix,
[ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
xml_config_prefix="$withval", xml_config_prefix="")
AC_ARG_WITH(xml-exec-prefix,
[ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
AC_ARG_ENABLE(xmltest,
[ --disable-xmltest Do not try to compile and run a test LIBXML program],,
enable_xmltest=yes)
if test x$xml_config_exec_prefix != x ; then
xml_config_args="$xml_config_args"
if test x${XML2_CONFIG+set} != xset ; then
XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
fi
fi
if test x$xml_config_prefix != x ; then
xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
if test x${XML2_CONFIG+set} != xset ; then
XML2_CONFIG=$xml_config_prefix/bin/xml2-config
fi
fi
AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
min_xml_version=ifelse([$1], ,2.0.0,[$1])
AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
no_xml=""
if test "$XML2_CONFIG" = "no" ; then
no_xml=yes
else
XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_xmltest" = "xyes" ; then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$XML_LIBS $LIBS"
dnl
dnl Now check if the installed libxml is sufficiently new.
dnl (Also sanity checks the results of xml2-config to some extent)
dnl
rm -f conf.xmltest
AC_TRY_RUN([
#include
#include
#include
#include
int
main()
{
int xml_major_version, xml_minor_version, xml_micro_version;
int major, minor, micro;
char *tmp_version;
system("touch conf.xmltest");
/* Capture xml2-config output via autoconf/configure variables */
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = (char *)strdup("$min_xml_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string from xml2-config\n", "$min_xml_version");
exit(1);
}
free(tmp_version);
/* Capture the version information from the header files */
tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
exit(1);
}
free(tmp_version);
/* Compare xml2-config output to the libxml headers */
if ((xml_major_version != $xml_config_major_version) ||
(xml_minor_version != $xml_config_minor_version) ||
(xml_micro_version != $xml_config_micro_version))
{
printf("*** libxml header files (version %d.%d.%d) do not match\n",
xml_major_version, xml_minor_version, xml_micro_version);
printf("*** xml2-config (version %d.%d.%d)\n",
$xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
return 1;
}
/* Compare the headers to the library to make sure we match */
/* Less than ideal -- doesn't provide us with return value feedback,
* only exits if there's a serious mismatch between header and library.
*/
LIBXML_TEST_VERSION;
/* Test that the library is greater than our minimum version */
if ((xml_major_version > major) ||
((xml_major_version == major) && (xml_minor_version > minor)) ||
((xml_major_version == major) && (xml_minor_version == minor) &&
(xml_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
xml_major_version, xml_minor_version, xml_micro_version);
printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
printf("*** correct copy of xml2-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
return 1;
}
],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_xml" = x ; then
AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$XML2_CONFIG" = "no" ; then
echo "*** The xml2-config script installed by LIBXML could not be found"
echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the XML2_CONFIG environment variable to the"
echo "*** full path to xml2-config."
else
if test -f conf.xmltest ; then
:
else
echo "*** Could not run libxml test program, checking why..."
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$LIBS $XML_LIBS"
AC_TRY_LINK([
#include
#include
], [ LIBXML_TEST_VERSION; return 0;],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
XML_CPPFLAGS=""
XML_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(XML_CPPFLAGS)
AC_SUBST(XML_LIBS)
rm -f conf.xmltest
])
intldir.m4 0000644 00000001625 14764526371 0006476 0 ustar 00 # intldir.m4 serial 2 (gettext-0.18)
dnl Copyright (C) 2006, 2009-2014, 2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
AC_PREREQ([2.52])
dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
iconv.m4 0000644 00000022072 14764526371 0006146 0 ustar 00 # iconv.m4 serial 19 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([iconv])
])
AC_DEFUN([AM_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include
#include
]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);]])],
[am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include
#include
]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);]])],
[am_cv_lib_iconv=yes]
[am_cv_func_iconv=yes])
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
dnl Solaris 10.
am_save_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
am_cv_func_iconv_works=no
for ac_iconv_const in '' 'const'; do
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[
#include
#include
#ifndef ICONV_CONST
# define ICONV_CONST $ac_iconv_const
#endif
]],
[[int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
char buf[10];
ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_utf8_to_88591,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 1;
iconv_close (cd_utf8_to_88591);
}
}
/* Test against Solaris 10 bug: Failures are not distinguishable from
successful returns. */
{
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
if (cd_ascii_to_88591 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\263";
char buf[10];
ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_ascii_to_88591,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 2;
iconv_close (cd_ascii_to_88591);
}
}
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
{
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\304";
static char buf[2] = { (char)0xDE, (char)0xAD };
ICONV_CONST char *inptr = input;
size_t inbytesleft = 1;
char *outptr = buf;
size_t outbytesleft = 1;
size_t res = iconv (cd_88591_to_utf8,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
result |= 4;
iconv_close (cd_88591_to_utf8);
}
}
#if 0 /* This bug could be worked around by the caller. */
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
{
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
char buf[50];
ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_88591_to_utf8,
&inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
result |= 8;
iconv_close (cd_88591_to_utf8);
}
}
#endif
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
provided. */
if (/* Try standardized names. */
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
/* Try IRIX, OSF/1 names. */
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
/* Try AIX names. */
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
/* Try HP-UX names. */
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
result |= 16;
return result;
]])],
[am_cv_func_iconv_works=yes], ,
[case "$host_os" in
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
*) am_cv_func_iconv_works="guessing yes" ;;
esac])
test "$am_cv_func_iconv_works" = no || break
done
LIBS="$am_save_LIBS"
])
case "$am_cv_func_iconv_works" in
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
*) am_func_iconv=yes ;;
esac
else
am_func_iconv=no am_cv_lib_iconv=no
fi
if test "$am_func_iconv" = yes; then
AC_DEFINE([HAVE_ICONV], [1],
[Define if you have the iconv() function and it works.])
fi
if test "$am_cv_lib_iconv" = yes; then
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([$LIBICONV])
else
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
dnl either.
CPPFLAGS="$am_save_CPPFLAGS"
LIBICONV=
LTLIBICONV=
fi
AC_SUBST([LIBICONV])
AC_SUBST([LTLIBICONV])
])
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
dnl avoid warnings like
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
dnl This is tricky because of the way 'aclocal' is implemented:
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings.
m4_define([gl_iconv_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[m4_ifdef([gl_00GNULIB],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[[AC_DEFUN(
[$1], [$2])]])]))
gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL([am_cv_proto_iconv], [
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include
#include
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
]],
[[]])],
[am_cv_proto_iconv_arg1=""],
[am_cv_proto_iconv_arg1="const"])
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([
$am_cv_proto_iconv])
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
dnl Also substitute ICONV_CONST in the gnulib generated .
m4_ifdef([gl_ICONV_H_DEFAULTS],
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
if test -n "$am_cv_proto_iconv_arg1"; then
ICONV_CONST="const"
fi
])
fi
])
ltversion.m4 0000644 00000001262 14764526371 0007053 0 ustar 00 # ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# 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.
# @configure_input@
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
freetype2.m4 0000644 00000014275 14764526371 0006743 0 ustar 00 # Configure paths for FreeType2
# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
#
# Copyright 2001-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
#
# As a special exception to the FreeType project license, this file may be
# distributed as part of a program that contains a configuration script
# generated by Autoconf, under the same distribution terms as the rest of
# that program.
#
# serial 4
# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
# FreeType 2.0.4).
#
AC_DEFUN([AC_CHECK_FT2],
[# Get the cflags and libraries from the freetype-config script
#
AC_ARG_WITH([ft-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-prefix=PREFIX],
[Prefix where FreeType is installed (optional)]),
[ft_config_prefix="$withval"],
[ft_config_prefix=""])
AC_ARG_WITH([ft-exec-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
[Exec prefix where FreeType is installed (optional)]),
[ft_config_exec_prefix="$withval"],
[ft_config_exec_prefix=""])
AC_ARG_ENABLE([freetypetest],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--disable-freetypetest],
[Do not try to compile and run a test FreeType program]),
[],
[enable_fttest=yes])
if test x$ft_config_exec_prefix != x ; then
ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
if test x${FT2_CONFIG+set} != xset ; then
FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
fi
fi
if test x$ft_config_prefix != x ; then
ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
if test x${FT2_CONFIG+set} != xset ; then
FT2_CONFIG=$ft_config_prefix/bin/freetype-config
fi
fi
if test "x$FT2_CONFIG" = x ; then
AC_PATH_TOOL([FT2_CONFIG], [freetype-config], [no])
fi
min_ft_version=m4_if([$1], [], [7.0.1], [$1])
AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
no_ft=""
if test "$FT2_CONFIG" = "no" ; then
no_ft=yes
else
FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
ft_min_major_version=`echo $min_ft_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
ft_min_minor_version=`echo $min_ft_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
ft_min_micro_version=`echo $min_ft_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test x$enable_fttest = xyes ; then
ft_config_is_lt=""
if test $ft_config_major_version -lt $ft_min_major_version ; then
ft_config_is_lt=yes
else
if test $ft_config_major_version -eq $ft_min_major_version ; then
if test $ft_config_minor_version -lt $ft_min_minor_version ; then
ft_config_is_lt=yes
else
if test $ft_config_minor_version -eq $ft_min_minor_version ; then
if test $ft_config_micro_version -lt $ft_min_micro_version ; then
ft_config_is_lt=yes
fi
fi
fi
fi
fi
if test x$ft_config_is_lt = xyes ; then
no_ft=yes
else
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $FT2_CFLAGS"
LIBS="$FT2_LIBS $LIBS"
#
# Sanity checks for the results of freetype-config to some extent.
#
AC_RUN_IFELSE([
AC_LANG_SOURCE([[
#include
#include FT_FREETYPE_H
#include
#include
int
main()
{
FT_Library library;
FT_Error error;
error = FT_Init_FreeType(&library);
if (error)
return 1;
else
{
FT_Done_FreeType(library);
return 0;
}
}
]])
],
[],
[no_ft=yes],
[echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi # test $ft_config_version -lt $ft_min_version
fi # test x$enable_fttest = xyes
fi # test "$FT2_CONFIG" = "no"
if test x$no_ft = x ; then
AC_MSG_RESULT([yes])
m4_if([$2], [], [:], [$2])
else
AC_MSG_RESULT([no])
if test "$FT2_CONFIG" = "no" ; then
AC_MSG_WARN([
The freetype-config script installed by FreeType 2 could not be found.
If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
your path, or set the FT2_CONFIG environment variable to the
full path to freetype-config.
])
else
if test x$ft_config_is_lt = xyes ; then
AC_MSG_WARN([
Your installed version of the FreeType 2 library is too old.
If you have different versions of FreeType 2, make sure that
correct values for --with-ft-prefix or --with-ft-exec-prefix
are used, or set the FT2_CONFIG environment variable to the
full path to freetype-config.
])
else
AC_MSG_WARN([
The FreeType test program failed to run. If your system uses
shared libraries and they are installed outside the normal
system library path, make sure the variable LD_LIBRARY_PATH
(or whatever is appropriate for your system) is correctly set.
])
fi
fi
FT2_CFLAGS=""
FT2_LIBS=""
m4_if([$3], [], [:], [$3])
fi
AC_SUBST([FT2_CFLAGS])
AC_SUBST([FT2_LIBS])])
# end of freetype2.m4
glibc21.m4 0000644 00000001613 14764526371 0006251 0 ustar 00 # glibc21.m4 serial 5
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2016 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Test for the GNU C Library, version 2.1 or newer, or uClibc.
# From Bruno Haible.
AC_DEFUN([gl_GLIBC21],
[
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
[ac_cv_gnu_library_2_1],
[AC_EGREP_CPP([Lucky],
[
#include
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user
#endif
#endif
#ifdef __UCLIBC__
Lucky user
#endif
],
[ac_cv_gnu_library_2_1=yes],
[ac_cv_gnu_library_2_1=no])
]
)
AC_SUBST([GLIBC21])
GLIBC21="$ac_cv_gnu_library_2_1"
]
)
threadlib.m4 0000644 00000035457 14764526371 0007001 0 ustar 00 # threadlib.m4 serial 11 (gettext-0.18.2)
dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl gl_THREADLIB
dnl ------------
dnl Tests for a multithreading library to be used.
dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
dnl default is 'no', otherwise it is system dependent. In both cases, the user
dnl can change the choice through the options --enable-threads=choice or
dnl --disable-threads.
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
dnl libtool).
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
dnl programs that really need multithread functionality. The difference
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
dnl multithread-safe programs.
AC_DEFUN([gl_THREADLIB_EARLY],
[
AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
])
dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
AC_DEFUN([gl_THREADLIB_EARLY_BODY],
[
dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
dnl influences the result of the autoconf tests that test for *_unlocked
dnl declarations, on AIX 5 at least. Therefore it must come early.
AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
AC_BEFORE([$0], [gl_ARGP])dnl
AC_REQUIRE([AC_CANONICAL_HOST])
dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
dnl AC_GNU_SOURCE.
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
[AC_REQUIRE([AC_GNU_SOURCE])])
dnl Check for multithreading.
m4_ifdef([gl_THREADLIB_DEFAULT_NO],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
AC_ARG_ENABLE([threads],
AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
[gl_use_threads=$enableval],
[if test -n "$gl_use_threads_default"; then
gl_use_threads="$gl_use_threads_default"
else
changequote(,)dnl
case "$host_os" in
dnl Disable multithreading by default on OSF/1, because it interferes
dnl with fork()/exec(): When msgexec is linked with -lpthread, its
dnl child process gets an endless segmentation fault inside execvp().
dnl Disable multithreading by default on Cygwin 1.5.x, because it has
dnl bugs that lead to endless loops or crashes. See
dnl .
osf*) gl_use_threads=no ;;
cygwin*)
case `uname -r` in
1.[0-5].*) gl_use_threads=no ;;
*) gl_use_threads=yes ;;
esac
;;
*) gl_use_threads=yes ;;
esac
changequote([,])dnl
fi
])
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
# For using :
case "$host_os" in
osf*)
# On OSF/1, the compiler needs the flag -D_REENTRANT so that it
# groks . cc also understands the flag -pthread, but
# we don't use it because 1. gcc-2.95 doesn't understand -pthread,
# 2. putting a flag into CPPFLAGS that has an effect on the linker
# causes the AC_LINK_IFELSE test below to succeed unexpectedly,
# leading to wrong values of LIBTHREAD and LTLIBTHREAD.
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
;;
esac
# Some systems optimize for single-threaded programs by default, and
# need special flags to disable these optimizations. For example, the
# definition of 'errno' in .
case "$host_os" in
aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
esac
fi
])
dnl The guts of gl_THREADLIB. Needs to be expanded only once.
AC_DEFUN([gl_THREADLIB_BODY],
[
AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
gl_threads_api=none
LIBTHREAD=
LTLIBTHREAD=
LIBMULTITHREAD=
LTLIBMULTITHREAD=
if test "$gl_use_threads" != no; then
dnl Check whether the compiler and linker support weak declarations.
AC_CACHE_CHECK([whether imported symbols can be declared weak],
[gl_cv_have_weak],
[gl_cv_have_weak=no
dnl First, test whether the compiler accepts it syntactically.
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[extern void xyzzy ();
#pragma weak xyzzy]],
[[xyzzy();]])],
[gl_cv_have_weak=maybe])
if test $gl_cv_have_weak = maybe; then
dnl Second, test whether it actually works. On Cygwin 1.7.2, with
dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include
#pragma weak fputs
int main ()
{
return (fputs == NULL);
}]])],
[gl_cv_have_weak=yes],
[gl_cv_have_weak=no],
[dnl When cross-compiling, assume that only ELF platforms support
dnl weak symbols.
AC_EGREP_CPP([Extensible Linking Format],
[#ifdef __ELF__
Extensible Linking Format
#endif
],
[gl_cv_have_weak="guessing yes"],
[gl_cv_have_weak="guessing no"])
])
fi
])
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
# it groks . It's added above, in gl_THREADLIB_EARLY_BODY.
AC_CHECK_HEADER([pthread.h],
[gl_have_pthread_h=yes], [gl_have_pthread_h=no])
if test "$gl_have_pthread_h" = yes; then
# Other possible tests:
# -lpthreads (FSU threads, PCthreads)
# -lgthreads
gl_have_pthread=
# Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
# in libc. IRIX 6.5 has the first one in both libc and libpthread, but
# the second one only in libpthread, and lock.c needs it.
#
# If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
# needs -pthread for some reason. See:
# http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
save_LIBS=$LIBS
for gl_pthread in '' '-pthread'; do
LIBS="$LIBS $gl_pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include
pthread_mutex_t m;
pthread_mutexattr_t ma;
]],
[[pthread_mutex_lock (&m);
pthread_mutexattr_init (&ma);]])],
[gl_have_pthread=yes
LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
LIBS=$save_LIBS
test -n "$gl_have_pthread" && break
done
# Test for libpthread by looking for pthread_kill. (Not pthread_self,
# since it is defined as a macro on OSF/1.)
if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
# The program links fine without libpthread. But it may actually
# need to link with libpthread in order to create multiple threads.
AC_CHECK_LIB([pthread], [pthread_kill],
[LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
# On Solaris and HP-UX, most pthread functions exist also in libc.
# Therefore pthread_in_use() needs to actually try to create a
# thread: pthread_create from libc will fail, whereas
# pthread_create will actually create a thread.
case "$host_os" in
solaris* | hpux*)
AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
[Define if the pthread_in_use() detection is hard.])
esac
])
elif test -z "$gl_have_pthread"; then
# Some library is needed. Try libpthread and libc_r.
AC_CHECK_LIB([pthread], [pthread_kill],
[gl_have_pthread=yes
LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
if test -z "$gl_have_pthread"; then
# For FreeBSD 4.
AC_CHECK_LIB([c_r], [pthread_kill],
[gl_have_pthread=yes
LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
fi
fi
if test -n "$gl_have_pthread"; then
gl_threads_api=posix
AC_DEFINE([USE_POSIX_THREADS], [1],
[Define if the POSIX multithreading library can be used.])
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
[Define if references to the POSIX multithreading library should be made weak.])
LIBTHREAD=
LTLIBTHREAD=
fi
fi
fi
fi
fi
if test -z "$gl_have_pthread"; then
if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
gl_have_solaristhread=
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include
#include
]],
[[thr_self();]])],
[gl_have_solaristhread=yes])
LIBS="$gl_save_LIBS"
if test -n "$gl_have_solaristhread"; then
gl_threads_api=solaris
LIBTHREAD=-lthread
LTLIBTHREAD=-lthread
LIBMULTITHREAD="$LIBTHREAD"
LTLIBMULTITHREAD="$LTLIBTHREAD"
AC_DEFINE([USE_SOLARIS_THREADS], [1],
[Define if the old Solaris multithreading library can be used.])
if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
[Define if references to the old Solaris multithreading library should be made weak.])
LIBTHREAD=
LTLIBTHREAD=
fi
fi
fi
fi
if test "$gl_use_threads" = pth; then
gl_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_LINKFLAGS([pth])
gl_have_pth=
gl_save_LIBS="$LIBS"
LIBS="$LIBS $LIBPTH"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include ]], [[pth_self();]])],
[gl_have_pth=yes])
LIBS="$gl_save_LIBS"
if test -n "$gl_have_pth"; then
gl_threads_api=pth
LIBTHREAD="$LIBPTH"
LTLIBTHREAD="$LTLIBPTH"
LIBMULTITHREAD="$LIBTHREAD"
LTLIBMULTITHREAD="$LTLIBTHREAD"
AC_DEFINE([USE_PTH_THREADS], [1],
[Define if the GNU Pth multithreading library can be used.])
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
[Define if references to the GNU Pth multithreading library should be made weak.])
LIBTHREAD=
LTLIBTHREAD=
fi
fi
else
CPPFLAGS="$gl_save_CPPFLAGS"
fi
fi
if test -z "$gl_have_pthread"; then
case "$gl_use_threads" in
yes | windows | win32) # The 'win32' is for backward compatibility.
if { case "$host_os" in
mingw*) true;;
*) false;;
esac
}; then
gl_threads_api=windows
AC_DEFINE([USE_WINDOWS_THREADS], [1],
[Define if the native Windows multithreading API can be used.])
fi
;;
esac
fi
fi
AC_MSG_CHECKING([for multithread API to use])
AC_MSG_RESULT([$gl_threads_api])
AC_SUBST([LIBTHREAD])
AC_SUBST([LTLIBTHREAD])
AC_SUBST([LIBMULTITHREAD])
AC_SUBST([LTLIBMULTITHREAD])
])
AC_DEFUN([gl_THREADLIB],
[
AC_REQUIRE([gl_THREADLIB_EARLY])
AC_REQUIRE([gl_THREADLIB_BODY])
])
dnl gl_DISABLE_THREADS
dnl ------------------
dnl Sets the gl_THREADLIB default so that threads are not used by default.
dnl The user can still override it at installation time, by using the
dnl configure option '--enable-threads'.
AC_DEFUN([gl_DISABLE_THREADS], [
m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
])
dnl Survey of platforms:
dnl
dnl Platform Available Compiler Supports test-lock
dnl flavours option weak result
dnl --------------- --------- --------- -------- ---------
dnl Linux 2.4/glibc posix -lpthread Y OK
dnl
dnl GNU Hurd/glibc posix
dnl
dnl Ubuntu 14.04 posix -pthread Y OK
dnl
dnl FreeBSD 5.3 posix -lc_r Y
dnl posix -lkse ? Y
dnl posix -lpthread ? Y
dnl posix -lthr Y
dnl
dnl FreeBSD 5.2 posix -lc_r Y
dnl posix -lkse Y
dnl posix -lthr Y
dnl
dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
dnl
dnl NetBSD 1.6 --
dnl
dnl OpenBSD 3.4 posix -lpthread Y OK
dnl
dnl Mac OS X 10.[123] posix -lpthread Y OK
dnl
dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
dnl
dnl HP-UX 11 posix -lpthread N (cc) OK
dnl Y (gcc)
dnl
dnl IRIX 6.5 posix -lpthread Y 0.5
dnl
dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
dnl
dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
dnl -lpthread (gcc) Y
dnl
dnl Cygwin posix -lpthread Y OK
dnl
dnl Any of the above pth -lpth 0.0
dnl
dnl Mingw windows N OK
dnl
dnl BeOS 5 --
dnl
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
dnl turned off:
dnl OK if all three tests terminate OK,
dnl 0.5 if the first test terminates OK but the second one loops endlessly,
dnl 0.0 if the first test already loops endlessly.
lib-ld.m4 0000644 00000007143 14764526371 0006175 0 ustar 00 # lib-ld.m4 serial 6
dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Subroutines of libtool.m4,
dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
dnl collision with libtool.m4.
dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
[# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 /dev/null 2>&1 \
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|| PATH_SEPARATOR=';'
}
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]]* | ?:[[\\/]]*)
re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL([acl_cv_path_LD],
[if test -z "$LD"; then
acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$acl_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1