После тестов пришлось добавить Autoconf

This commit is contained in:
svsp 2026-01-31 08:58:40 +05:00
parent dd62ff2ec3
commit c4b32460de
1536 changed files with 260539 additions and 1 deletions

View File

@ -0,0 +1,13 @@
# This file is expected to be used via gitlog-to-changelog's --amend=FILE
# option. It specifies what changes to make to each given SHA1's commit
# log and metadata, using Perl-eval'able expressions.
3b369e6bbe0fb6d7359398935706c87dd9375cb6
# Date: Thu Feb 16 22:29:32 2012 +0100
# Fix a typo.
s| bur | bug |
22729165f6bb902daeb8a4d8e7cb06982390f327
# Date: Fri Feb 17 10:13:15 2012 +0100
# Fix a typo.
s|.fix-git-log|.git-log-fix|

27
automake-1.15.1/AUTHORS Normal file
View File

@ -0,0 +1,27 @@
Authors of GNU Automake.
David Mackenzie
First version of most ".am" files.
Wrote sh version of automake.in.
Tom Tromey
Touched all ".am" files.
Rewrote automake.in
Alexandre Oliva
Some of the user-side dependency tracking system.
Some more random hacking.
Alexandre Duret-Lutz
Major overhaul of everything.
Maintenance since 2002.
Ralf Wildenhues
Random breakage.
Maintenance since 2006.
Stefano Lattarini
Testsuite overhaul.
TAP support and custom testsuite drivers.
Random breakage.
De-facto maintenance since 2012.

339
automake-1.15.1/COPYING Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 of the License, 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.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

21997
automake-1.15.1/ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,88 @@
# Maintainer makefile for Automake. Requires GNU make.
# Copyright (C) 2012-2017 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 <http://www.gnu.org/licenses/>.
ifeq ($(filter bootstrap,$(MAKECMDGOALS)),)
ifeq ($(wildcard Makefile),)
# Any target but 'bootstrap' specified in an unconfigured tree
# is an error, even when the user is running GNU make.
$(warning There seems to be no Makefile in this directory.)
$(warning You must run ./configure before running 'make'.)
$(error Fatal Error)
endif
include ./Makefile
include $(srcdir)/maintainer/maint.mk
include $(srcdir)/maintainer/syntax-checks.mk
else # ! bootstrap in $(MAKECMDGOALS)
other-targets := $(filter-out bootstrap,$(MAKECMDGOALS))
config-status := $(wildcard ./config.status)
BOOTSTRAP_SHELL ?= /bin/sh
export BOOTSTRAP_SHELL
# Allow the user (or more likely the developer) to ask for a bootstrap
# of the package.
#
# Two issues that must be kept in mind in the implementation below:
#
# [1] "make bootstrap" can be invoked before 'configure' is run (and in
# fact, even before it is created, if we are bootstrapping from a
# freshly-cloned checkout).
#
# [2] When re-bootstrapping an already configured tree, we must ensure
# that the automatic remake rules for Makefile and company do not
# kick in, because the tree might be in an inconsistent state (e.g.,
# we have just switched from 'maint' to 'master', and have the built
# 'automake' script left from 'maint', but the files 'lib/am/*.am'
# are from 'master': if 'automake' gets run and uses those files --
# boom!).
ifdef config-status # Bootstrap from an already-configured tree.
# We need the definition of $(srcdir) in the 'bootstrap' rule
# below.
srcdir := $(shell echo @srcdir@ | $(config-status) --file=-)
ifndef srcdir
$(error Could not obtain $$(srcdir) from $(config-status))
endif
# Also, if we are re-bootstrapping an already-configured tree, we
# want to re-configure it with the same pre-existing configuration.
old-configure-flags := $(shell $(config-status) --config)
else # Assume we are bootstrapping from an unconfigured srcdir.
srcdir := .
old-configure-flags :=
endif
configure-flags := $(old-configure-flags) $(BOOTSTRAP_CONFIGURE_FLAGS)
.PHONY: bootstrap
bootstrap:
cd $(srcdir) && $(SHELL) ./bootstrap
$(srcdir)/configure $(configure-flags)
$(MAKE) clean
$(MAKE) check TESTS=t/get-sysconf
# Ensure that all the specified targets but 'bootstrap' (if any) are
# run with a properly re-bootstrapped tree.
ifdef other-targets
$(other-targets): restart
.PHONY: $(other-targets) restart
restart: bootstrap; $(MAKE) $(AM_MAKEFLAGS) $(other-targets)
endif
endif # ! bootstrap in $(MAKECMDGOALS)

404
automake-1.15.1/HACKING Normal file
View File

@ -0,0 +1,404 @@
============================================================================
= This file
* This file attempts to describe the rules to use when hacking
automake.
============================================================================
= Administrivia
* The correct response to most actual bugs is to write a new test case
which demonstrates the bug. Then fix the bug, re-run the test suite,
and check everything in.
* If you incorporate a change from somebody on the net:
- First, if it is a large change, you must make sure they have
signed the appropriate paperwork.
- Second, be sure to add their name and email address to THANKS.
* If a change fixes a test, mention the test in the commit message.
If a change fixes a bug registered in the Automake debbugs tracker,
mention the bug number in the commit message.
* If somebody reports a new bug, mention his name in the commit message
that fixes or exposes the bug, and put him into THANKS.
* When documenting a non-trivial idiom or example in the manual, be
sure to add a test case for it, and to reference such test case from
a proper Texinfo comment.
* Some files in the automake package are not owned by automake; these
files are listed in the $(FETCHFILES) variable in Makefile.am. They
should never be edited here. Almost all of them can be updated from
respective upstreams with "make fetch" (this should be done especially
before releases). The only exception is the 'lib/COPYING' (from FSF),
which should be updated by hand whenever the GPL gets updated (which
shouldn't happen that often anyway :-)
* Changes other than *trivial* bug fixes must be mentioned in NEWS.
* Changes which are potentially controversial, require a non-trivial
plan, or must be implemented gradually with a roadmap spanning several
releases (either minor or major) should be discussed on the list,
and have a proper entry in the PLANS directory. This entry should be
always committed in the "maint" branch, even if the change it deals
with is only for the master branch, or a topic branch. Usually, in
addition to this, it is useful to open a "wishlist" report on the
Automake debbugs tracker, to keep the idea more visible, and have the
discussions surrounding it easily archived in a central place.
============================================================================
= Naming
* We've adopted the convention that internal AC_SUBSTs and make variables
should be named with a leading 'am__', and internally generated targets
should be named with a leading 'am--'. This convention, although in
place from at least February 2001, isn't yet universally used.
But all new code should use it.
We used to use '_am_' as the prefix for an internal AC_SUBSTs.
However, it turns out that NEWS-OS 4.2R complains if a Makefile
variable begins with the underscore character. Yay for them.
I changed the target naming convention just to be safe.
============================================================================
= Editing '.am' files
* Always use $(...) and not ${...}
* Prefer ':' over 'true', mostly for consistency with existing code.
* Use '##' comments liberally. Comment anything even remotely unusual.
* Never use basename or dirname. Instead, use sed.
* Do not use 'cd' within back-quotes, use '$(am__cd)' instead.
Otherwise the directory name may be printed, depending on CDPATH.
More generally, do not ever use plain 'cd' together with a relative
directory that does not start with a dot, or you might end up in one
computed with CDPATH.
* For install and uninstall rules, if a loop is required, it should be
silent. Then the body of the loop itself should print each "important"
command it runs. The printed commands should be preceded by a single
space.
* Ensure install rules do not create any installation directory where
nothing is to be actually installed. See automake bug#11030.
============================================================================
= Editing automake.in and aclocal.in
* Indent using GNU style. For historical reasons, the perl code
contains portions indented using Larry Wall's style (perl-mode's
default), and other portions using the GNU style (cperl-mode's
default). Write new code using GNU style.
* Don't use & for function calls, unless really required.
The use of & prevents prototypes from being checked.
============================================================================
= Automake versioning and compatibility scheme
* There are three kinds of automake releases:
- new major releases (e.g., 2.0, 5.0)
- new minor releases (e.g., 1.14, 2.1)
- micro a.k.a. "bug-fixing" releases (e.g., 1.13.2, 2.0.1, 3.5.17).
A new major release should have the major version number bumped, and
the minor and micro version numbers reset to zero. A new minor release
should have the major version number unchanged, the minor version number
bumped, and the micro version number reset to zero. Finally, a new
micro version should have the major and minor version numbers unchanged,
and the micro version number bumped by one.
For example, the first minor version after 1.13.2 will be 1.14; the
first bug-fixing version after 1.14 that will be 1.14.1; the first
new major version after all such releases will be 2.0; the first
bug-fixing version after 2.0 will be 2.0.1; and a further bug-fixing
version after 2.0.1 will be 2.0.2.
* Micro releases should be just bug-fixing releases; no new features
should be added, and ideally, only trivial bugs, recent regressions,
or documentation issues should be addressed by them. On the other
hand, it's OK to include testsuite work and even testsuite refactoring
in a micro version, since a regression there is not going to annoy or
inconvenience Automake users, but only the Automake developers.
* Minor releases can introduce new "safe" features, do non-trivial but
mostly safe code clean-ups, and even add new runtime warnings (rigorously
non-fatal). But they shouldn't include any backward incompatible change,
nor contain any potentially destabilizing refactoring or sweeping change,
nor introduce new features whose implementation might be liable to cause
bugs or regressions in existing code. However, it might be acceptable to
introduce very limited and localized backward-incompatibilities, *only*
if that is necessary to fix non-trivial bugs, address serious performance
issues, or greatly enhance usability. But please, do this sparsely and
rarely!
* Major releases can introduce backward-incompatibilities (albeit such
incompatibilities should be announced well in advance, and a smooth
transition plan prepared for them), and try more risking and daring
refactorings and code cleanups.
* For more information, refer to the extensive discussion associated
with automake bug#13578.
============================================================================
= Working with git
* To regenerate dependent files created by aclocal and automake,
use the 'bootstrap' script. It uses the code from the source
tree, so the resulting files (aclocal.m4 and Makefile.in) should
be the same as you would get if you install this version of
automake and use it to generate those files. Be sure to have the
latest stable version of Autoconf installed and available early
in your PATH.
* The Automake git tree currently carries three basic branches: 'micro',
'maint' and 'master'.
* The 'micro' branch, reserved to changes that should go into the next
micro release; so it will just see fixes for regressions, trivial
bugs, or documentation issues, and no "active" development whatsoever.
Since emergency regression-fixing or security releases could be cut
from this branch at any time, it should always be kept in a releasable
state.
* The 'maint' branch is where the development of the next minor release
takes place. It should be kept in a stable, almost-releasable state,
to simplify testing and deploying of new minor version. Note that
this is not a hard rule, and such "stability" is not expected to be
absolute (emergency releases are cut from the 'micro' branch anyway).
* The 'master' branch is reserved for the development of the next major
release. Experimenting a little is OK here, but don't let the branch
grow too unstable; if you need to do exploratory programming or
over-arching change, you should use a dedicated topic branch, and
only merge that back once it is reasonably stable.
* The 'micro' branch should be kept regularly merged into the 'maint'
branch, and the 'maint' branch into the 'master' branch. It is advisable
to merge only after a set of related commits have been applied, to avoid
introducing too much noise in the history.
* There may be a number of longer-lived feature branches for new
developments. They should be based off of a common ancestor of all
active branches to which the feature should or might be merged later.
* After a new minor release is done, the 'maint' branch is to be merged
into the 'micro' branch, and then a "new" 'maint' branch created
stemming from the resulting commit.
Similarly, after a new major release is done, the 'master' branch is to
be merged into both the 'micro' and 'maint' branches, and then "new"
'master' branch created stemming from the resulting commit.
* When fixing a bug (especially a long-standing one), it may be useful
to commit the fix to a new temporary branch based off the commit that
introduced the bug. Then this "bugfix branch" can be merged into all
the active branches descending from the buggy commit. This offers a
simple way to fix the bug consistently and effectively.
* When merging, prefer 'git merge --log' over plain 'git merge', so that
a later 'git log' gives an indication of which actual patches were
merged even when they don't appear early in the list.
* The 'master', 'maint' and 'micro' branches should not be rewound, i.e.,
should always fast-forward, except maybe for privacy issues. For
feature branches, the announcement for the branch should document
the rewinding policy.
If a topic branch is expected to be rewound, it is good practice to put
it in the 'experimental/*' namespace; for example, a rewindable branch
dealing with Vala support could be named like "experimental/vala-work".
============================================================================
= Writing a good commit message
* Here is the general format that Automake's commit messages are expected
to follow. See the further points below for clarifications and minor
corrections.
topic: brief description (this is the "summary line")
<reference to relevant bugs, if any>
Here goes a more detailed explanation of why the commit is needed,
and a general overview of what it does, and how. This section
should almost always be provided, possibly only with the expection
of obvious fixes or very trivial changes.
And if the detailed explanation is quite long or detailed, you can
want to break it in more paragraphs.
Then you can add references to relevant mailing list discussions
(if any), with proper links. But don't take this as an excuse for
writing incomplete commit messages! The "distilled" conclusions
reached in such discussions should have been placed in the
paragraphs above.
Finally, here you can thank people that motivated or helped the
change. So, thanks to John Doe for bringing up the issue, and to
J. Random Hacker for providing suggestions and testing the patch.
<detailed list of touched files>
* The <detailed list of touched files> should usually be provided (but
for short or trivial changes), and should follow the GNU guidelines
for ChangeLog entries (described explicitly in the GNU Coding
Standards); it might be something of this sort:
* some/file (func1): Improved frobnication.
(func2): Adjusted accordingly.
* another/file (foo, bar): Likewise.
* tests/foo.tap: New test.
* tests/Makefile.am (TESTS): Add it.
* If your commit fixes an automake bug registered in the tracker (say
numbered 1234), you should put the following line after the summary
line:
This change fixes automake bug#1234.
* If your commit is just related to the given bug report, but does not
fix it, you might want to add a line like this instead:
This change is related to automake bug#1234.
* When referring to older commits, use 'git describe' output as pointer.
But also try to identify the given commit by date and/or summary line
if possible. Examples:
Since yesterday's commit, v1.11-2019-g4d2bf42, ...
... removed in commit 'v1.11-1674-g02e9072' of 01-01-2012,
"dist: ditch support for lzma"...
============================================================================
= Test suite
* Use "make check" and "make maintainer-check" liberally.
* Export the 'keep_testdirs' environment variable to "yes" to keep
test directories for successful tests also.
* Use perl coverage information to ensure your new code is thoroughly
tested by your new tests.
* See file 't/README' for more information.
============================================================================
= Release procedure
* The steps outlined here are meant to be followed for alpha and stable
releases as well. Where differences are expected, they will be
explicitly described.
* Fetch new versions of the files that are maintained by the FSF by
running "make fetch". In case any file in the automake repository
has been updated, commit and re-run the testsuite.
* Ensure that the copyright notices of the distributed files is up to
date. The maintainer-only target "update-copyright" can help with
this.
* Check NEWS; in particular, ensure that all the relevant differences
with the last release are actually reported.
* Update the version number in configure.ac.
(The idea is that every other alpha number will be a net release.
The repository will always have its own "odd" number so we can easily
distinguish net and repo versions.)
* Run these commands, in this order:
make bootstrap
make check keep_testdirs=yes
make maintainer-check
make distcheck
make check-no-trailing-backslash-in-recipes
make check-cc-no-c-o
It is also advised to run "git clean -fdx" before invoking the
bootstrap, to ensure a really clean rebuild. However, it must
be done carefully, because that command will remove *all* the
files that are not tracked by git!
* Run "make git-tag-release".
This will run the maintainer checks, verify that the local git
repository and working tree are clean and up-to-date, and create
a proper signed git tag for the release (based on the contents
of $(VERSION)).
* Run "make git-upload-release".
This will first verify that you are releasing from a tagged version
and that the local git repository and working tree are clean and
up-to-date, and will then run "make dist" to create the tarballs,
and invoke the 'gnupload' script sign and upload them to the correct
locations. In case you need to sign with a non-default key, you can
use "make GNUPLOADFLAGS='--user KEY' git-upload-release".
* For stable releases you'll have to update the manuals at www.gnu.org.
- Generate manuals (with the help of the standard gendocs.sh script):
make web-manual
The ready-to-be-uploaded manuals (in several formats) will be left
in the 'doc/web-manuals' directory.
- Commit the updated manuals to web CVS:
make web-manual-update
If your local username is different from your username at Savannah,
you'll have to override the 'CVS_USER' make variable accordingly;
for example:
make web-manual-update CVS_USER=slattarini
- Check for link errors, fix them, recheck until convergence:
<http://validator.w3.org/checklink>
* Create an announcement message with "make announcement". Edit the
generated 'announcement' file appropriately, in particularly filling
in by hand any "TODO" left in there.
* Update version number in configure.ac to next alpha number.
Re-run ./bootstrap and commit.
* Don't forget to "git push" your changes so they appear in the public
git tree.
* Send the announcement generated in the earlier steps at least to
<autotools-announce@gnu.org> and <automake@gnu.org>. If the release
is a stable one, the announcement must also go to <info-gnu@gnu.org>;
if it is an alpha or beta release, announcement should be sent also
to <platform-testers@gnu.org>, to maximize the possibility of early
testing on exotic or proprietary systems. Finally, copy an abridged
version of the announcement into the NEWS feed at:
<https://savannah.gnu.org/projects/automake>.
Be sure to link a version to the complete announcement (from
the version you sent to the automake list, as get archived on
<http://lists.gnu.org/archive/html/automake/>).
-----
Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
Local Variables:
mode: text
End:

370
automake-1.15.1/INSTALL Normal file
View File

@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

135
automake-1.15.1/Makefile.am Normal file
View File

@ -0,0 +1,135 @@
## Process this file with automake to create Makefile.in
## Makefile for Automake.
# Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## Might be updated later.
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
EXTRA_DIST =
TAGS_FILES =
dist_noinst_DATA =
nodist_noinst_DATA =
dist_noinst_SCRIPTS =
nodist_noinst_SCRIPTS =
## ------------ ##
## Top level. ##
## ------------ ##
EXTRA_DIST += \
bootstrap \
GNUmakefile \
HACKING \
PLANS
# We want a handful of substitutions to be fully-expanded by make;
# then use config.status to substitute the remainder where a single
# expansion is sufficient. We use a funny notation here to avoid
# configure substitutions in our text.
do_subst = ( sed \
-e "s,[@]configure_input[@],Generated from $$in; do not edit by hand.,g" \
-e 's,[@]datadir[@],$(datadir),g' \
-e 's,[@]amdir[@],$(amdir),g' \
-e 's,[@]bindir[@],$(bindir),g' \
-e 's,[@]docdir[@],$(docdir),g' \
-e 's,[@]pkgvdatadir[@],$(pkgvdatadir),g' \
-e 's,[@]scriptdir[@],$(scriptdir),g' \
-e 's,[@]automake_acdir[@],$(automake_acdir),g' \
-e 's,[@]system_acdir[@],$(system_acdir),g' \
## Hack to avoid a spurious substitution in the Automake script (part 1).
-e 's,[@]am__isrc[@],!!@!!am__isrc!!@!!,g' \
| $(SHELL) ./config.status --file=- \
## Hack to avoid a spurious substitution in the Automake script (part 2).
| sed -e 's,!!@!!am__isrc!!@!!,@''am__isrc@,g' \
)
# Generated files shouldn't contain unexpanded '@substitutions@', and
# should be made read-only, to prevent them from being edited by mistake
# instead of the file the are generated from.
generated_file_finalize = $(AM_V_at) \
if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
echo "$@ contains unexpanded substitution (see lines above)"; \
exit 1; \
fi; \
chmod a-w $@-t && mv -f $@-t $@
# For some tests or targets, we need to have the just-build automake and
# aclocal scripts avaiable on PATH.
extend_PATH = \
{ PATH='$(abs_builddir)/t/wrap$(PATH_SEPARATOR)'$$PATH && export PATH; }
# The master location for INSTALL is lib/INSTALL.
# This is where "make fetch" will install new versions.
# Make sure we also update this copy.
INSTALL: lib/INSTALL
$(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
# We don't use the default name for the autom4te cache directory,
# so we need this.
maintainer-clean-local:
rm -rf .autom4te.cache
# So that automake won't complain about the missing ChangeLog.
# The real rule for ChangeLog generation is now in maintainer/maint.mk
# (as it is maintainer-specific).
ChangeLog:
# Third-party, obsolescent or experimental stuff.
EXTRA_DIST += \
contrib/tap-driver.pl \
contrib/check-html.am \
contrib/multilib/README \
contrib/multilib/config-ml.in \
contrib/multilib/symlink-tree \
contrib/multilib/multilib.am \
contrib/multilib/multi.m4 \
contrib/README
# Older files, kept mostly for historical interest.
EXTRA_DIST += \
old/ChangeLog-tests \
old/ChangeLog.96 \
old/ChangeLog.98 \
old/ChangeLog.00 \
old/ChangeLog.01 \
old/ChangeLog.02 \
old/ChangeLog.03 \
old/ChangeLog.04 \
old/ChangeLog.09 \
old/ChangeLog.11 \
old/TODO
# Maintainer-specific files and scripts.
EXTRA_DIST += \
maintainer/am-ft \
maintainer/am-xft \
maintainer/rename-tests \
maintainer/maint.mk \
maintainer/syntax-checks.mk
# Most work delegated to sub-dir makefile fragments.
include $(srcdir)/bin/Makefile.inc
include $(srcdir)/doc/Makefile.inc
include $(srcdir)/lib/Makefile.inc
include $(srcdir)/lib/Automake/Makefile.inc
include $(srcdir)/lib/am/Makefile.inc
include $(srcdir)/m4/Makefile.inc
include $(srcdir)/t/Makefile.inc
# vim: ft=automake noet

4201
automake-1.15.1/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

2952
automake-1.15.1/NEWS Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
"Plans" for future or on-going Automake development.
The contents is meant to help ensure a more controlled and smooth
development and evolution for Automake, in several ways.
- Having the plans clearly spelled out should will avoid messy
roadmaps with no clear way forward or with muddy or ill-defined
aims or purposes; a trap this is too easy to fall into.
- Keeping planned changes cooking and re-hashed for a while should
ensure rough edges are smoothed up, transitions are planned in a
proper way (hopefully avoiding debacles like the AM_MKDIR_PROG_P
deprecation and the AM_CONFIG_HEADER too-abrupt removal), and
"power users" have more chances of getting informed in due time,
thus having all the time to prepare for the changes or raise
objections against them.
- Having the plans clearly stated and registered in a "centralized"
location should make it more difficult to them to slip through
the cracks, getting forgotten or (worse) only half-implemented.
- Even for discussions and plans registered on the Bug Tracker
as well, a corresponding entry in the PLANS directory can help
in keeping main ideas summarized, and consensus and/or objections
registered and easily compared.

View File

@ -0,0 +1,62 @@
The macro AM_PROG_MKDIR_P is no longer going to be removed from Automake.
Let's see a bit of history to understand why.
I had already scheduled the removal of the long-deprecated AM_PROG_MKDR_P
macro (superseded by the Autoconf-provided one AC_PROG_MKDIR_P) for
Automake 1.13 -- see commit 'v1.12-20-g8a1c64f'.
Alas, it turned out the latest Gettext version at the time (0.18.1.1) was
still using that macro:
<http://lists.gnu.org/archive/html/automake/2012-09/msg00010.html>
And since the maintenance of Gettext was stalled, I couldn't get a fix
committed and released in time for the appearance of Automake 1.13:
<http://lists.gnu.org/archive/html/bug-gettext/2012-04/msg00018.html>
<http://lists.gnu.org/archive/html/bug-gettext/2012-06/msg00012.html>
<http://lists.gnu.org/archive/html/bug-gettext/2012-10/msg00001.html>
So, on strong advice by Jim Meyering, in commit 'v1.12.4-158-gdf23daf'
I re-introduced AM_PROG_MKDIR_P in Automake (thanks to Jim for having
convinced me to do so in time!)
But then, Gettext (as said, the greatest "offender" in the use of
AM_PROG_MKDIR_P), in its latest release 0.18.2, finally removed all the
uses of that macro still present in its code base. Yay. So I thought
we could finally and quite safely remove AM_PROG_MKDIR_P in Automake 1.14;
and I proceeded to do so, see commit 'v1.13-30-gd01834b' and the merge
commit 'v1.13-5-gb373ad9'. Well, it turned out I was wrong, again, and
in a trickier and sublter way this time. Let's see the details.
If a package's 'configure.ac' contains a call like:
AM_GNU_GETTEXT_VERSION([0.18])
then the 'autopoint' script will bring the data files from the Gettext
release *1.18* into the package's tree -- yes, even even if the developer
has installed *and is using* Gettext 1.18.2! Now, these data files
comprise m4 files (that will be seen by subsequent aclocal and autoconf
calls), and of course, the pre-0.18.2 version of some of these files
still contains occurrences of AM_PROG_MKDIR_P -- so Automake 1.13 errors
out, and we lose. That already happened in practice:
<http://lists.gnu.org/archive/html/bug-grep/2013-01/msg00003.html>
Moreover, while I might see it as not unreasonable to ask a developer
using Automake 2.0 to also update Gettext to 1.18.2, that would not
be enough; in order for gettext to use the correct data files, that
developer would have to update his configure.ac to read:
AM_GNU_GETTEXT_VERSION([0.18.2])
thus requiring *all* of his co-developers to install Gettext 1.18.2,
even if they are still using, say, Automake 1.13 or 1.14. Bad.
So I decided to re-instate this macro as a simple alias for AC_PROG_MKDIR_P
(plus a non-fatal runtime warning in the 'obsolete' category), and drop
any plan to remove it (see how much good those plans have done us so far).
See commit v1.13.1-109-g030ecb4.
Similarly, the obsolete '@mkdir_p@' substitution and '$(mkdir_p)' make
variable are still supported, as simple aliases to '$(MKDIR_P)'.

View File

@ -0,0 +1,28 @@
In Automake 1.13.x (once planned, then dropped)
-----------------------------------------------
We are already warning about 'configure.in' used as the name for the
Autoconf input file ('configure.ac' should be used instead); we've
been doing that since Automake 1.12.4.
We had scheduled to remove support for it altogether in Automake 1.13
(and announced that in our NEWS file), because we thought that Autoconf
too would have started deprecating it by the time our 1.13 release was
done. Alas, this hasn't been the case: the deprecation code is only
present in the development version of autoconf so far (scheduled to
become Autoconf 2.70). So ...
For Automake 2.0
----------------
... we have decided to wait until 2.70 is out before really removing
'configure.in' support. Since we plan to require Autoconf 2.70 in
Automake 2.0 (so that we can remove the hacky code emulating
AC_CONFIG_MACRO_DIRS for older autoconf versions), we are quite sure
that Autoconf will actually have started deprecating 'configure.in'
by the time Automake 2.0 is released.
Note that the removal of 'configure.in' has already been implemented
in our 'master' branch (from where the 2.0 release will be finally
cut); see commits 'v1.13-17-gbff57c8' and 'v1.13-21-g7626e63'.

View File

@ -0,0 +1,40 @@
Summary
-------
POSIX will say in a future version that calling "rm -f" with no argument
is OK; and this sensible behaviour seem to be already very widespread in
"the wild" (and possibly lacking only on those systems that are well on
their way to obsolescence).
Se we'd like to simplify several automake-generated "cleaning" rules
accordingly, to get rid of the awful idiom:
test -z "$(VAR)" || rm -f $(VAR)
See automake bug#10828.
For Automake 1.14 (DONE)
------------------------
Add a temporary "probe check" in AM_INIT_AUTOMAKE that verifies that
the no-args "rm -f" usage is supported on the system configure is
being run on; complain loudly if this is not the case, and tell the
user to report the situation to us.
For Automake 2.0
----------------
Make any failure in the configure-time probe check introduced by the
previous point fatal; and in case of failure, also suggest to the user
to install an older version of GNU coreutils to work around the
limitation of his system (this version should be old enough not to
be bootstrapped with Automake 2.0, otherwise the user will face a
bootstrapping catch-22).
In all our recipes, start assuming "rm -f" with no argument is OK;
simplify and de-uglify the recipes accordingly.
For Automake 3.0
----------------
Remove the runtime probe altogether.

View File

@ -0,0 +1,71 @@
Summary
-------
We want to make the behaviour currently enabled by the 'subdir-objects'
the default one, and in fact the *only* one, in Automake 2.0.
See automake bug#13378: <http://debbugs.gnu.org/13378>.
Sadly, **THIS IS IMPOSSIBLE** until automake bug#13928 is resolved:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
Details
-------
The fact that Automake-generated Makefiles place compiled object files in
the current directory by default, also when the corresponding source file
is in a subdirectory, is basically an historical accident, due to the fact
that the 'subdir-objects' option had only been introduced in April 1999,
starting with commit 'user-dep-gen-branchpoint-56-g88b5959', and never
made the default (likely to avoid backwards-compatibility issues).
Since I believe the behaviour enabled by the 'subdir-objects' is the most
useful one, and in fact the *only* natural one, I'd like to make it the
only one available, simplifying the Automake implementation and APIs a
little in the process.
Alas, since this also means changing the default behaviour of Automake
('subdir-objects' is not enabled by default, sadly), this means the
transition path will be less smooth than I'd like.
DONE for automake 1.13.2
------------------------
The bug spotted by Nick Bowler:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35>
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44>
and exposed in test case 't/ccnoco4.sh' has been fixed (see commit
v1.13.1-56-g34001a9). The bug was due to the fact that Automake-generated
C compilation rules mistakenly passed the "-c -o" options combination
unconditionally (even to losing compiler) when the 'subdir-objects' was
used but sources were only present in the top-level directory.
DONE for automake 1.14
----------------------
We give a warning in the category 'unsupported' if the 'subdir-objects'
option is not specified. This should give the users enough forewarning
about the planned change, and give them time to update their packages
to the new semantic.
We also make sure to avoid the warning when it would be irrelevant, i.e.,
if all source files sit in "current" directory (thanks to Peter Johansson
for suggesting this).
For some automake 1.x (*before* 2.0 can be released)
----------------------------------------------------
Find a proper way to fix the blocking automake bug#13928:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
For automake 2.0
----------------
Make the behaviour once activated by the 'subdir-object' option mandatory.
With that change, we'll drop support for the "old" behaviour of having
object files derived from sources in a subdirectory being placed in the
current directory rather than in that same subdirectory.
Still keep the 'subdir-objects' option supported (as a simple no-op
now), to save useless churn in our user's build systems.

View File

@ -0,0 +1,27 @@
For in Automake 2.0 (DONE)
--------------------------
We will drop split info files in Automake 2.0.
See automake bug#13351: <http://debbugs.gnu.org/13351>.
Basically, it has been confirmed that the original reason behind
the existence of split info files was indeed "efficiency,
especially memory size":
<http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html>
So split info files have lost their reason d'etre on modern systems
(where even Emacs has become a lightweight program ;-). And you are
not using an embedded system to read Info documentation, right?
In addition, it appears that the use of split info files (at least
the way Automake-generated rules have been handling them for a long
time) can cause real problems in some (admittedly quite corner-case)
situations; see automake bug#12320: <http://debbugs.gnu.org/12320>.
This change should be completely transparent to the developer (no
adjustments needed to be made to Makefile.am or other parts of the
build system). In case some CI system or overly picky build script
used to rely on that feature, they'll have to be adjusted; but that
is expected to be a rare occurrence, and thus a price worth pay for
the nice simplifications and the fixlets this planned change will
offer us.

View File

@ -0,0 +1,21 @@
Done in automake 1.13.2:
------------------------
I have discouraged the use of '.txi' and '.texinfo' suffixes for
Texinfo inputs (see commit 'v1.13.1-6-ge1ed314') and the generation
of suffix-less info files (commit 'v1.13.1-4-g2af418d').
This is done to ease transition to Automake-NG (see commits
'v1.12.1-416-gd5459b9' and 'v1.12.1-392-ga0c7b6a' there), and
(to a lesser degree) to discourage use of seldom-tested setups.
The Future:
-----------
I have no plans to do the further step of removing support for those
usages in future Automake versions. That would be a gratuitous
incompatibility (in Automake-NG, they have been useful because have
allowed further refactorings and improvements, but those were
based on GNU make features, and as such have no place in mainline
Automake).

68
automake-1.15.1/README Normal file
View File

@ -0,0 +1,68 @@
This is Automake, a Makefile generator. It aims to be portable and
to conform to the GNU Coding Standards for Makefile variables and
targets.
See the INSTALL file for detailed information about how to configure
and install Automake.
Automake is a Perl script. The input files are called Makefile.am.
The output files are called Makefile.in; they are intended for use
with Autoconf. Automake requires certain things to be done in your
configure.ac.
Automake comes with extensive documentation; please refer to it for
more details about its purpose, features, and usage patterns.
This package also includes the "aclocal" program, whose purpose is
to generate an 'aclocal.m4' based on the contents of 'configure.ac'.
It is useful as an extensible, maintainable mechanism for augmenting
autoconf. It is intended that other package authors will write m4
macros which can be automatically used by aclocal. The documentation
for aclocal is currently found in the Automake manual.
Automake has a test suite. Use "make check" to run it. For more
information, see the file t/README.
Automake has a page on the web. See:
http://www.gnu.org/software/automake/
Automake also has three mailing lists:
* automake@gnu.org
For general discussions of Automake and its interactions with other
configuration/portability tools like Autoconf or Libtool.
* bug-automake@gnu.org
Where to send bug reports and feature requests.
* automake-patches@gnu.org
Where to send patches, and discuss the automake development process
and the design of new features.
To obtain more information about these list, or to subscribe to them,
refer to <http://www.gnu.org/software/automake/#mailinglists>
New releases are announced to autotools-announce@gnu.org. If you want to
be informed, subscribe to that list by following the instructions at
<http://lists.gnu.org/mailman/listinfo/autotools-announce>.
For any copyright year range specified as YYYY-ZZZZ in this package,
that the range specifies every single year in that closed interval.
-----
Copyright (C) 1994-2012 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 <http://www.gnu.org/licenses/>.

440
automake-1.15.1/THANKS Normal file
View File

@ -0,0 +1,440 @@
Automake was originally written by David J. MacKenzie <djm@uunet.uu.net>.
It would not be what it is today without the invaluable help of these
people:
Adam J. Richter adam@yggdrasil.com
Adam Mercer ramercer@gmail.com
Adam Sampson ats@offog.org
Adrian Bunk bunk@fs.tum.de
Aharon Robbins arnold@skeeve.com
Akim Demaille akim@gnu.org
Alan Modra amodra@bigpond.net.au
Alex Hornby alex@anvil.co.uk
Alex Unleashed unledev@gmail.com
Alexander Mai st002279@hrzpub.tu-darmstadt.de
Alexander Martens alexander.martens@gtd.es
Alexander V. Lukyanov lav@yars.free.net
Alexander Turbov zaufi@sendmail.ru
Alexandre Duret-Lutz duret_g@epita.fr
Alexey Mahotkin alexm@hsys.msk.ru
Alfred M. Szmidt ams@gnu.org
Andrea Urbani matfanjol@mail.com
Andreas Bergmeier lcid-fire@gmx.net
Andreas Buening andreas.buening@nexgo.de
Andreas Köhler andi5.py@gmx.net
Andreas Schwab schwab@suse.de
Andrew Cagney cagney@tpgi.com.au
Andrew Eikum aeikum@codeweavers.com
Andrew Suffield asuffield@debian.org
Andris Pavenis pavenis@lanet.lv
Andy Wingo wingo@pobox.com
Angus Leeming a.leeming@ic.ac.uk
Anthony Green green@cygnus.com
Antonio Diaz Diaz ant_diaz@teleline.es
Arkadiusz Miskiewicz misiek@pld.ORG.PL
Art Haas ahaas@neosoft.com
Arto C. Nirkko anirkko@insel.ch
Assar Westerlund assar@sics.se
Axel Belinfante Axel.Belinfante@cs.utwente.nl
Bas Wijnen shevek@fmf.nl
Ben Pfaff blp@cs.standford.edu
Benoit Sigoure tsuna@lrde.epita.fr
Bernard Giroud bernard.giroud@creditlyonnais.ch
Bernard Urban Bernard.Urban@meteo.fr
Bernd Jendrissek berndfoobar@users.sourceforge.net
Bert Wesarg bert.wesarg@googlemail.com
Bill Currie bcurrie@tssc.co.nz
Bill Davidson bill@kayhay.com
Bill Fenner fenner@parc.xerox.com
Bob Friesenhahn bfriesen@simple.dallas.tx.us
Bob Proulx rwp@hprwp.fc.hp.com
Bob Rossi bob@brasko.net
Bobby Jack bobbykjack@yahoo.co.uk
Boris Kolpackov boris@codesynthesis.com
Braden N. McDaniel braden@endoframe.com
Brandon Black blblack@gmail.com
Brendan O'Dea bod@debian.org
Brian Cameron Brian.Cameron@Sun.COM
Brian Ford ford@vss.fsi.com
Brian Gough bjg@network-theory.co.uk
Brian Jones cbj@nortel.net
Bruce Korb bkorb@gnu.org
Bruno Haible haible@ilog.fr
Carsten Lohrke carlo@gentoo.org
Charles Wilson cwilson@ece.gatech.edu
Chris Hoogendyk hoogendyk@bio.umass.edu
Chris Pickett chris.pickett@mail.mcgill.ca
Chris Provenzano proven@io.proven.org
Christian Cornelssen ccorn@cs.tu-berlin.de
Christina Gratorp christina.gratorp@gmail.com
Claudio Fontana sick_soul@yahoo.it
Clifford Wolf clifford@clifford.at
Colin Watson cjwatson@ubuntu.com
Dagobert Michelsen dam@opencsw.org
Daiki Ueno ueno@unixuser.org
Dalibor Topic robilad@kaffe.org
danbp danpb@nospam.postmaster.co.uk
Daniel Jacobowitz drow@false.org
Daniel Kahn Gillmor dkg@fifthhorseman.net
Daniel Richard G. skunk@iskunk.org
Debarshi Ray rishi@gnu.org
Dave Brolley brolley@redhat.com
Dave Goodell goodell@mcs.anl.gov
Dave Hart davehart@gmail.com
Dave Korn dave.korn.cygwin@googlemail.com
Dave Morrison dave@bnl.gov
David A. Swierczek swiercze@mr.med.ge.com
David A. Wheeler dwheeler@dwheeler.com
David Byron dbyron@dbyron.com
David Fang fang@csl.cornell.edu
Davyd Madeley davyd@fugro-fsi.com.au
David Pashley david@davidpashley.com
David Zaroski cz253@cleveland.Freenet.Edu
Dean Povey dpovey@wedgetail.com
Dennis J. Linse Dennis.J.Linse@SAIC.com
Dennis Schridde devurandom@gmx.net
Derek R. Price derek.price@openavenue.com
Diab Jerius djerius@cfa.harvard.edu
Didier Cassirame faded@free.fr
Diego Elio Pettenò flameeyes@flameeyes.eu
Dieter Baron dillo@stieltjes.smc.univie.ac.at
Dieter Jurzitza DJurzitza@harmanbecker.com
Дилян Палаузов dilyan.palauzov@aegee.org
Dmitry Mikhin dmitrym@acres.com.au
Dmitry V. Levin ldv@altlinux.org
Doug Evans devans@cygnus.com
Duncan Gibson duncan@thermal.esa.int
Ed Hartnett ed@unidata.ucar.edu
Eleftherios Gkioulekas lf@amath.washington.edu
Elena A. Vengerova helen@oktetlabs.ru
Elmar Hoffmann elho@elho.net
Elrond Elrond@Wunder-Nett.org
Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de
Erez Zadok ezk@cs.columbia.edu
Eric Blake eblake@redhat.com
Eric Dorland eric@debian.org
Eric Magnien emagnien@club-internet.fr
Eric Siegerman erics_97@pobox.com
Eric Sunshine sunshine@sunshineco.com
Erick Branderhorst branderh@iaehv.nl
Erik Lindahl E.Lindahl@chem.rug.nl
Esben Haabendal Soerensen bart@kom.aau.dk
Ezra Peisach epeisach@MED-XTAL.BU.EDU
Fabian Alenius fabian.alenius@gmail.com
Federico Simoncelli fsimonce@redhat.com
Felix Salfelder felix@salfelder.org
Flavien Astraud flav42@yahoo.fr
Florian Briegel briegel@zone42.de
Francesco Salvestrini salvestrini@gmail.com
François Pinard pinard@iro.umontreal.ca
Fred Fish fnf@ninemoons.com
Ganesan Rajagopal rganesan@novell.com
Garrett D'Amore garrett@qualcomm.com
Garth Corral garthc@inktomi.com
Gary V Vaughan gvaughan@oranda.demon.co.uk
Gavin Smith gavinsmith0123@gmail.com
Geoffrey Keating geoffk@apple.com
Glenn Amerine glenn@pie.mhsc.org
Gord Matzigkeit gord@gnu.ai.mit.edu
Gordon Sadler gbsadler1@lcisp.com
Graham Reitz grahamreitz@me.com
Greg A. Woods woods@most.weird.com
Greg Schafer gschafer@zip.com.au
Guido Draheim guidod@gmx.de
Guillermo Ontañón gontanonext@pandasoftware.es
Gustavo Carneiro gjc@inescporto.pt
Gwenole Beauchesne gbeauchesne@mandrakesoft.com
H.J. Lu hjl@lucon.org
H.Merijn Brand h.m.brand@hccnet.nl
Hans Ulrich Niedermann hun@n-dimensional.de
Hanspeter Niederstrasser fink@snaggledworks.com
Harald Dunkel harald@CoWare.com
Harlan Stenn Harlan.Stenn@pfcs.com
He Li tippa000@yahoo.com
Henrik Frystyk Nielsen frystyk@w3.org
Hib Eris hib@hiberis.nl
Hilko Bengen bengen@debian.org
Holger Hans Peter Freyther holger@freyther.de
Ian Lance Taylor ian@cygnus.com
Ignacy Gawedzki i@lri.fr
Илья Н. Голубев gin@mo.msk.ru
Imacat imacat@mail.imacat.idv.tw
Infirit infirit@gmail.com
Inoue inoue@ainet.or.jp
Jack Kelly jack@jackkelly.name
James Amundson amundson@users.sourceforge.net
James Bostock james.bostock@gmail.com
James Henstridge james@daa.com.au
James R. Van Zandt jrv@vanzandt.mv.com
James Youngman jay@gnu.org
Jan Engelhardt jengelh@medozas.de
Janos Farkas chexum@shadow.banki.hu
Jared Davis abiword@aiksaurus.com
Jason DeVinney jasondevinney@gmail.com
Jason Duell jcduell@lbl.gov
Jason Molenda crash@cygnus.co.jp
Javier Jardón jjardon@gnome.org
Jeff Bailey Jbailey@phn.ca
Jeff A. Daily jeff.daily@pnl.gov
Jeff Garzik jgarzik@pobox.com
Jeff Squyres jsquyres@lam-mpi.org
Jens Elkner elkner@imsgroup.de
Jens Krüger jens_krueger@physik.tu-muenchen.de
Jens Petersen petersen@redhat.com
Jeremy Nimmer jwnimmer@alum.mit.edu
Jerome Lovy jlovy@multimania.com
Jerome Santini santini@chambord.univ-orleans.fr
Jesse Chisholm jesse@ctc.volant.org
Jim Meyering meyering@na-net.ornl.gov
Joakim Tjernlund Joakim.Tjernlund@transmode.se
Jochen Kuepper jochen@uni-duesseldorf.de
Joel N. Weber II nemo@koa.iolani.honolulu.hi.us
Joerg-Martin Schwarz jms@jms.prima.ruhr.de
Johan Dahlin jdahlin@async.com.br
Johan Danielsson joda@pdc.kth.se
Johannes Nicolai johannes.nicolai@student.hpi.uni-potsdam.de
John Calcote john.calcote@gmail.com
John F Trudeau JohnTrudeau@firsthealth.com
John Pierce hawkfan@pyrotechnics.com
John Ratliff autoconf@technoplaza.net
John R. Cary cary@txcorp.com
John W. Coomes jcoomes@eng.Sun.COM
Jonathan L Peyton jonathan.l.peyton@intel.com
Jonathan Nieder jrnieder@gmail.com
Joseph S. Myers joseph@codesourcery.com
Josh MacDonald jmacd@cs.berkeley.edu
Joshua Cowan jcowan@jcowan.reslife.okstate.edu
js pendry js.pendry@msdw.com
Juergen A. Erhard jae@laden.ilk.de
Juergen Keil jk@tools.de
Juergen Leising juergen.leising@gmx.de
Julien Sopena julien.sopena@lip6.fr
Jürg Billeter j@bitron.ch
Karl Berry kb@cs.umb.edu
Karl Heuer kwzh@gnu.org
Kelley Cook kcook@gcc.gnu.org
Kent Boortz kent@mysql.com
Kevin Dalley kevin@aimnet.com
Kevin P. Fleming. kpfleming@cox.net
Kevin Ryde user42@zip.com.au
Kevin Street street@iname.com
Klaus Reichl Klaus.Reichl@alcatel.at
Krzysztof Żelechowski giecrilj@stegny.2a.pl
L. Peter Deutsch ghost@aladdin.com
Ladislav Strojil Ladislav.Strojil@seznam.cz
Larry Daniel larry@larrybrucedaniel.com
Larry Jones larry.jones@sdrc.com
Lars Hecking lhecking@nmrc.ucc.ie
Lars J. Aas larsa@sim.no
Laurent Morichetti laurentm@cup.hp.com
Leo Davis ldavis@fonix.com
Leonardo Boiko leoboiko@conectiva.com.br
Loulou Pouchet loulou@lrde.epita.fr
Ludovic Courtès ludo@gnu.org
Luo Yi luoyi.ly@gmail.com
Maciej Stachowiak mstachow@mit.edu
Maciej W. Rozycki macro@ds2.pg.gda.pl
Manu Rouat emmanuel.rouat@wanadoo.fr
Marc Herbert marc.herbert@intel.com
Marcus Brinkmann Marcus.Brinkmann@ruhr-uni-bochum.de
Marcus G. Daniels mgd@ute.santafe.edu
Marius Vollmer mvo@zagadka.ping.de
Marc-Antoine Perennou Marc-Antoine@Perennou.com
Mark D. Baushke mdb@cvshome.org
Mark Eichin eichin@cygnus.com
Mark Elbrecht snowball3@bigfoot.com
Mark Galassi rosalia@nis.lanl.gov
Mark Mitchell mark@codesourcery.com
Mark Phillips msp@nortelnetworks.com
Markku Rossi mtr@ngs.fi
Markus Duft Markus.Duft@salomon.at
Markus F.X.J. Oberhumer k3040e4@wildsau.idv-edu.uni-linz.ac.at
Martin Bravenboer martin@cs.uu.nl
Martin Frydl martin@idoox.com
Martin Waitz tali@admingilde.org
Mathias Doreille doreille@smr.ch
Mathias Froehlich M.Froehlich@science-computing.de
Mathias Hasselmann mathias.hasselmann@gmx.de
Matt Burgess matthew@linuxfromscratch.org
Matt Leach mleach@cygnus.com
Matthew D. Langston langston@SLAC.Stanford.EDU
Matthias Andree matthias.andree@gmx.de
Matthias Clasen clasen@mathematik.uni-freiburg.de
Matthias Klose doko@ubuntu.com
Matthieu Baerts matttbe@glx-dock.org
Max Horn max@quendi.de
Maxim Sinev good@goods.ru
Maynard Johnson maynardj@us.ibm.com
Merijn de Jonge M.de.Jonge@cwi.nl
Michael Brantley Michael-Brantley@deshaw.com
Michael Daniels mdaniels@rim.com
Michael Hofmann mhofma@googlemail.com
Michael Ploujnikov ploujj@gmail.com
Michael Zucchi notzed@gmail.com
Michel de Ruiter mdruiter@cs.vu.nl
Mike Castle dalgoda@ix.netcom.com
Mike Frysinger vapier@gentoo.org
Mike Nolta mrnolta@princeton.edu
Miles Bader miles@ccs.mt.nec.co.jp
Miloslav Trmac trmac@popelka.ms.mff.cuni.cz
Miodrag Vallat miodrag@ifrance.com
Mirko Streckenbach strecken@infosun.fmi.uni-passau.de
Miroslaw Dobrzanski-Neumann mne@mosaic-ag.com
Morten Eriksen mortene@sim.no
Motoyuki Kasahara m-kasahr@sra.co.jp
Nathanael Nerode neroden@twcny.rr.com
Nelson H. F. Beebe beebe@math.utah.edu
Nicholas Wourms nwourms@netscape.net
Nick Bowler nbowler@elliptictech.com
Nicola Fontana ntd@entidi.it
Nicolas Joly njoly@pasteur.fr
Nicolas Thiery nthiery@Icare.mines.edu
NightStrike nightstrike@gmail.com
Nik A. Melchior nam1@cse.wustl.edu
Nikolai Weibull now@bitwi.se
NISHIDA Keisuke knishida@nn.iij4u.or.jp
Noah Friedman friedman@gnu.ai.mit.edu
Norman Gray norman@astro.gla.ac.uk
Nyul Laszlo nyul@sol.cc.u-szeged.hu
OKUJI Yoshinori okuji@kuicr.kyoto-u.ac.jp
Olivier Fourdan fourdan@cena.fr
Olivier Louchart-Fletcher olivier@zipworld.com.au
Olly Betts olly@muscat.co.uk
Oren Ben-Kiki oren@ben-kiki.org
Owen Taylor otaylor@redhat.com
Panther Martin mrsmiley98@lycos.com
Patrick Welche prlw1@newn.cam.ac.uk
Patrik Weiskircher me@justp.at
Paul Berrevoets paul@swi.com
Paul D. Smith psmith@BayNetworks.COM
Paul Eggert eggert@twinsun.com
Paul Jarc prj@po.cwru.edu
Paul Lunau temp@lunau.me.uk
Paul Martinolich martinol@datasync.com
Paul Thomas PTHOMAS@novell.com
Pavel Raiskup praiskup@redhat.com
Pavel Roskin pavel_roskin@geocities.com
Pavel Sanda ps@twin.jikos.cz
Per Bothner bothner@cygnus.com
Per Cederqvist ceder@lysator.liu.se
Per Oyvind Hvidsten poeh@enter.vg
Peter Breitenlohner peb@mppmu.mpg.de
Peter Eisentraut peter_e@gmx.net
Peter Gavin pgavin@debaser.kicks-ass.org
Peter Hutterer peter.hutterer@who-t.net
Peter Johansson trojkan@gmail.com
Peter Mattis petm@scam.XCF.Berkeley.EDU
Peter Muir iyhi@yahoo.com
Peter O'Gorman peter@pogma.com
Peter Rosin peda@lysator.liu.se
Peter Seiderer seiderer123@ciselant.de
Petr Hracek phracek@redhat.com
Petter Reinholdtsen pere@hungry.com
Petteri Räty betelgeuse@gentoo.org
Phil Edwards phil@jaj.com
Phil Nelson phil@cs.wwu.edu
Philip Fong pwlfong@users.sourceforge.net
Philip S Tellis philip@ncst.ernet.in
Philipp A. Hartmann philipp.hartmann@offis.de
Пухальский Юрий Андреевич pooh@cryptopro.ru
Quentin Glidic sardemff7+gnu@sardemff7.net
Rainer Orth ro@techfak.uni-bielefeld.de
Rafael Laboissiere laboissiere@psy.mpg.de
Rainer Tammer tammer@tammer.net
Raja R Harinath harinath@cs.umn.edu
Ralf Corsepius ralf.corsepius@gmail.com
Ralf Menzel menzel@ls6.cs.uni-dortmund.de
Ralf Wildenhues Ralf.Wildenhues@gmx.de
Ralph Schleicher rs@purple.UL.BaWue.DE
Ramón García Fernández ramon@jl1.quim.ucm.es
Reuben Thomas rrt@sc3d.org
Rich Wales richw@webcom.com
Richard Boulton richard@tartarus.org
Richard Dawe rich@phekda.freeserve.co.uk
Richard W.M. Jones rjones@redhat.com
Rob Savoye rob@cygnus.com
Robert Bihlmeyer robbe@orcus.priv.at
Robert Boehne rboehne@ricardo-us.com
Robert Collins robert.collins@itdomain.com.au
Robert Swafford robert.swafford@l-3com.com
Roberto Bagnara bagnara@cs.unipr.it
Roman Fietze roman.fietze@telemotive.de
Ronald Copley ronald.copley@gmail.com
Ronald Landheer ronald@landheer.com
Roumen Petrov bugtrack@roumenpetrov.info
Russ Allbery rra@stanford.edu
Rusty Ballinger rusty@rlyeh.engr.sgi.com
Ryan Lortie desrt@desrt.ca
Ryan T. Sammartino ryants@shaw.ca
Sam Hocevar sam@zoy.org
Sam Sirlin sam@kalessin.jpl.nasa.gov
Sam Steingold sds@gnu.org
Sander Niemeijer niemeijer@science-and-technology.nl
Santiago Vila sanvila@unex.es
Scott James Remnant scott@netsplit.com
Sébastien Wilmet swilmet@gnome.org
Sergey Poznyakoff gray@gnu.org.ua
Sergey Vlasov vsu@mivlgu.murom.ru
Seth Alves alves@hungry.com
Shannon L. Brown slbrow@sandia.gov
Shuhei Amakawa sa264@cam.ac.uk
Shigio Yamaguchi shigio@tamacom.com
Simon Josefsson jas@extundo.com
Simon Richter sjr@debian.org
Stefan Nordhausen nordhaus@informatik.hu-berlin.de
Stefano Lattarini stefano.lattarini@gmail.com
Stepan Kasal kasal@math.cas.cz
Steve M. Robbins steve@nyongwa.montreal.qc.ca
Steve Goetze goetze@dovetail.com
Steven Drake sbd@NetBSD.org
Steven G. Johnson stevenj@alum.mit.edu
Sven Verdoolaege skimo@kotnet.org
Tamara L. Dahlgren dahlgren1@llnl.gov
Tatu Ylonen ylo@ssh.fi
Teun Burgers burgers@ecn.nl
The Crimson Binome steve@nyongwa.montreal.qc.ca
Theodoros V. Kalamatianos thkala@gmail.com
Thien-Thi Nguyen ttn@glug.org
Thomas Fitzsimmons fitzsim@redhat.com
Thomas Gagne tgagne@ix.netcom.com
Thomas Jahns jahns@dkrz.de
Thomas Klausner tk@giga.or.at
Thomas Morgan tmorgan@pobox.com
Thomas Schwinge tschwinge@gnu.org
Thomas Tanner tanner@ffii.org
Toralf Förster toralf.foerster@gmx.de
Tim Goodwin tjg@star.le.ac.uk
Tim Landscheidt tim@tim-landscheidt.de
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Tim Retout diocles@debian.org
Tim Rice tim@multitalents.net
Tim Van Holder tim.van.holder@pandora.be
Tobias Hansen thansen@debian.org
Toshio Kuratomi toshio@tiki-lounge.com
Tom Epperly tepperly@llnl.gov
Tom Rini tom_rini@mentor.com
Ulrich Drepper drepper@gnu.ai.mit.edu
Ulrich Eckhardt eckhardt@satorlaser.com
Václav Haisman V.Haisman@sh.cvut.cz
Václav Zeman vhaisman@gmail.com
Vadim Zeitlin Vadim.zeitlin@dptmaths.ens-cachan.fr
Vasyl Khalak basiliomail@gmail.com
Vincent Lefevre vincent@vinc17.org
Vladimir Serbinenko phcoder@gmail.com
Volker Boerchers vboerchers@tecon.de
Weiller Ronfini weillerronfini@yahoo.com.br
Werner John john@oswf.de
Werner Koch wk@isil.d.shuttle.de
Werner Lemberg wl@gnu.org
William Pursell bill.pursell@gmail.com
William S Fulton wsf@fultondesigns.co.uk
Yann Droneaud ydroneaud@meuh.eu.org
Younes Younes younes@cs.tu-berlin.de
Zack Weinberg zackw@panix.com
Zbigniew Jędrzejewski-Szmek zbyszek@in.waw.pl
Zoltan Rado z.rado@chello.hu
;; Local Variables:
;; mode: text
;; coding: utf-8
;; End:

37
automake-1.15.1/aclocal.m4 vendored Normal file
View File

@ -0,0 +1,37 @@
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2017 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.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
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'.])])
m4_include([m4/amversion.m4])
m4_include([m4/auxdir.m4])
m4_include([m4/cond.m4])
m4_include([m4/init.m4])
m4_include([m4/install-sh.m4])
m4_include([m4/lead-dot.m4])
m4_include([m4/missing.m4])
m4_include([m4/options.m4])
m4_include([m4/prog-cc-c-o.m4])
m4_include([m4/runlog.m4])
m4_include([m4/sanity.m4])
m4_include([m4/silent.m4])
m4_include([m4/strip.m4])
m4_include([m4/substnot.m4])
m4_include([m4/tar.m4])

View File

@ -0,0 +1,71 @@
## Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## ----------------------------------- ##
## The automake and aclocal scripts. ##
## ----------------------------------- ##
bin_SCRIPTS = %D%/automake %D%/aclocal
CLEANFILES += $(bin_SCRIPTS)
# Used by maintainer checks and such.
automake_in = $(srcdir)/%D%/automake.in
aclocal_in = $(srcdir)/%D%/aclocal.in
automake_script = %D%/automake
aclocal_script = %D%/aclocal
AUTOMAKESOURCES = $(automake_in) $(aclocal_in)
TAGS_FILES += $(AUTOMAKESOURCES)
EXTRA_DIST += $(AUTOMAKESOURCES)
# Make versioned links. We only run the transform on the root name;
# then we make a versioned link with the transformed base name. This
# seemed like the most reasonable approach.
install-exec-hook:
@$(POST_INSTALL)
@for p in $(bin_SCRIPTS); do \
f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
fv="$$f-$(APIVERSION)"; \
rm -f "$(DESTDIR)$(bindir)/$$fv"; \
echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
$(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
done
uninstall-hook:
@for p in $(bin_SCRIPTS); do \
f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
fv="$$f-$(APIVERSION)"; \
rm -f "$(DESTDIR)$(bindir)/$$fv"; \
done
# These files depend on Makefile so they are rebuilt if $(VERSION),
# $(datadir) or other do_subst'ituted variables change.
%D%/automake: %D%/automake.in
%D%/aclocal: %D%/aclocal.in
%D%/automake %D%/aclocal: Makefile %D%/gen-perl-protos
$(AM_V_GEN)rm -f $@ $@-t $@-t2 \
&& $(MKDIR_P) $(@D) \
## Common substitutions.
&& in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
## Auto-compute prototypes of perl subroutines.
&& $(PERL) -w $(srcdir)/%D%/gen-perl-protos $@-t > $@-t2 \
&& mv -f $@-t2 $@-t \
## We can't use '$(generated_file_finalize)' here, because currently
## Automake contains occurrences of unexpanded @substitutions@ in
## comments, and that is perfectly legit.
&& chmod a+x,a-w $@-t && mv -f $@-t $@
EXTRA_DIST += %D%/gen-perl-protos
# vim: ft=automake noet

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
#!/usr/bin/env perl
#
# Copyright (C) 2013-2017 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 3, 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 <http://www.gnu.org/licenses/>.
use warnings;
use strict;
my @lines = <>;
my @protos = map { /^(sub \w+\s*\(.*\))/ ? ("$1;") : () } @lines;
while (defined ($_ = shift @lines))
{
if (/^#!.* prototypes/i)
{
print "# BEGIN AUTOMATICALLY GENERATED PROTOTYPES\n";
print join ("\n", sort @protos) . "\n";
print "# END AUTOMATICALLY GENERATED PROTOTYPES\n";
}
else
{
print;
}
}

127
automake-1.15.1/bootstrap Executable file
View File

@ -0,0 +1,127 @@
#! /bin/sh
# This script helps bootstrap automake, when checked out from git.
#
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
# Originally written by Pavel Roskin <proski@gnu.org> September 2002.
#
# 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 <http://www.gnu.org/licenses/>.
# Since Automake uses itself in its build process, we can't simply run
# 'autoreconf -i' which would require Automake to already be
# installed.
# Don't ignore failures.
set -e
# Set program basename.
me=`echo "$0" | sed 's,^.*/,,'`
# Let user choose which version of autoconf, autom4te and perl to use.
: ${AUTOCONF=autoconf}
export AUTOCONF # might be used by aclocal and/or automake
: ${AUTOM4TE=autom4te}
export AUTOM4TE # ditto
: ${PERL=perl}
# Variables to substitute.
VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
PACKAGE=automake
datadir=.
# This should be automatically updated by the 'update-copyright'
# rule of our Makefile.
RELEASE_YEAR=2017
# Override SHELL. This is required on DJGPP so that Perl's system()
# uses bash, not COMMAND.COM which doesn't quote arguments properly.
# It's not used otherwise.
if test -n "$DJDIR"; then
BOOTSTRAP_SHELL=/dev/env/DJDIR/bin/bash.exe
else
BOOTSTRAP_SHELL=/bin/sh
fi
# Read the rule for calculating APIVERSION and execute it.
apiver_cmd=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
eval "$apiver_cmd"
# Sanity checks.
if test -z "$VERSION"; then
echo "$me: cannot find VERSION" >&2
exit 1
fi
if test -z "$APIVERSION"; then
echo "$me: cannot find APIVERSION" >&2
exit 1
fi
# Make a dummy versioned directory for aclocal.
rm -rf aclocal-$APIVERSION
mkdir aclocal-$APIVERSION
if test -d automake-$APIVERSION; then
find automake-$APIVERSION -exec chmod u+wx '{}' ';'
fi
rm -rf automake-$APIVERSION
# Can't use "ln -s lib automake-$APIVERSION", that would create a
# lib.exe stub under DJGPP 2.03.
mkdir automake-$APIVERSION
cp -rf lib/* automake-$APIVERSION
dosubst ()
{
rm -f $2
in=`echo $1 | sed 's,^.*/,,'`
sed -e "s%@APIVERSION@%$APIVERSION%g" \
-e "s%@PACKAGE@%$PACKAGE%g" \
-e "s%@PERL@%$PERL%g" \
-e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
-e "s%@VERSION@%$VERSION%g" \
-e "s%@datadir@%$datadir%g" \
-e "s%@RELEASE_YEAR@%$RELEASE_YEAR%g" \
-e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
$1 > $2
chmod a-w $2
}
# Create temporary replacement for lib/Automake/Config.pm.
dosubst automake-$APIVERSION/Automake/Config.in \
automake-$APIVERSION/Automake/Config.pm
# Overwrite amversion.m4.
dosubst m4/amversion.in m4/amversion.m4
# Create temporary replacement for aclocal and automake.
for p in bin/aclocal bin/automake; do
dosubst $p.in $p.tmp
$PERL -w bin/gen-perl-protos $p.tmp > $p.tmp2
mv -f $p.tmp2 $p.tmp
done
# Create required makefile snippets.
$PERL ./gen-testsuite-part > t/testsuite-part.tmp
chmod a-w t/testsuite-part.tmp
mv -f t/testsuite-part.tmp t/testsuite-part.am
# Run the autotools. Bail out if any warning is triggered.
# Use '-I' here so that our own *.m4 files in m4/ gets included,
# not copied, in aclocal.m4.
$PERL ./bin/aclocal.tmp -Wall -Werror -I m4 \
--automake-acdir=m4 --system-acdir=m4/acdir
$AUTOCONF -Wall -Werror
$PERL ./bin/automake.tmp -Wall -Werror
# Remove temporary files and directories.
rm -rf aclocal-$APIVERSION automake-$APIVERSION
rm -f bin/aclocal.tmp bin/automake.tmp

7781
automake-1.15.1/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,616 @@
# Process this file with autoconf to produce a configure script.
# Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
AC_PREREQ([2.69])
AC_INIT([GNU Automake], [1.15.1], [bug-automake@gnu.org])
AC_CONFIG_SRCDIR([bin/automake.in])
AC_CONFIG_AUX_DIR([lib])
AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
# Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
# way we can run Autoconf tests from configure (or from the test
# suite) without being bothered by 'missing'. Likewise for autom4te,
# autoreconf, autoheader, and autoupdate.
AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
AC_SUBST([am_AUTOM4TE], ["${AUTOM4TE-autom4te}"])
AC_SUBST([am_AUTORECONF], ["${AUTORECONF-autoreconf}"])
AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
AC_SUBST([am_AUTOUPDATE], ["${AUTOUPDATE-autoupdate}"])
dnl We call AC_PROG_CC in an unusual way, and only for use in our
dnl testsuite, so also use 'no-dependencies' and 'no-define' among
dnl the automake options to avoid bloating and potential problems.
AM_INIT_AUTOMAKE([-Wall -Werror dist-xz filename-length-max=99
no-define no-dependencies])
# Keep this on a line of its own, since it must be found and processed
# by the 'update-copyright' rule in our Makefile.
RELEASE_YEAR=2017
AC_SUBST([RELEASE_YEAR])
# The API version is the base version. We must guarantee
# compatibility for all releases with the same API version.
# Our current rule is that:
# * All releases, including the prereleases, in an X.Y series
# are compatible. So 1.5.1c is compatible with 1.5.
# * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c
# aren't the same.
APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'`
AC_SUBST([APIVERSION])
AC_SUBST([pkgvdatadir], ["\${datadir}/$PACKAGE-$APIVERSION"])
AC_SUBST([scriptdir], ["\${pkgvdatadir}"])
AC_SUBST([amdir], ["\${pkgvdatadir}/am"])
AC_SUBST([automake_acdir], ["\${datadir}/aclocal-$APIVERSION"])
AC_SUBST([system_acdir], ["\${datadir}/aclocal"])
# Our build system is bootstrapped with the bleeding-edge versions of
# aclocal and automake, hence the remake rules must use those versions
# as well. The extra quoting is to cater to cases when the build
# directory contains whitespace or shell metacharacters.
ACLOCAL="\"`pwd`/t/wrap/aclocal-$APIVERSION\""
AUTOMAKE="\"`pwd`/t/wrap/automake-$APIVERSION\""
AC_PROG_LN_S
AC_PATH_PROG([PERL], [perl])
if test -z "$PERL"; then
AC_MSG_ERROR([perl not found])
fi
# Save details about the selected perl interpreter in config.log.
AM_RUN_LOG([$PERL --version])
$PERL -e 'require 5.006;' || {
AC_MSG_ERROR(
[perl 5.6 or better is required; perl 5.8.2 or better
is recommended. If you have several perl versions
installed, select the one Automake should use using
./configure PERL=/path/to/perl])
}
# The test suite will skip some tests if tex is absent.
AC_CHECK_PROG([TEX], [tex], [tex])
# Save details about the selected TeX program in config.log.
# Redirect input from /dev/null, as TeX might otherwise hang waiting
# for input from the terminal.
AM_RUN_LOG([$TEX --version </dev/null])
# The test suite will skip some tests if no lex or yacc program is
# available.
# We don't use AC_PROG_LEX nor AC_PROG_YACC here because:
# 1. we don't want flex (resp. bison) to be preferred to system lex
# (resp. system yacc);
# 2. we don't want $LEX (resp. $YACC) to be defined to ':' (resp. 'yacc')
# by default;
# 3. we prefer not to have the variables YFLAGS, LEX_OUTPUT_ROOT and
# LEXLIB to be calculated and/or AC_SUBST'd;
# 4. we prefer that the YACC and LEX variables are not reported in the
# configure help screen.
AC_CHECK_PROGS([YACC], [yacc byacc 'bison -y'], [false])
AC_CHECK_PROGS([LEX], [lex flex], [false])
# Test for Autoconf. We run Autoconf in a subdirectory to ease
# deletion of any files created (such as those added to
# autom4te.cache). We used to perform only the last of the three
# following tests, but some users were unable to figure out that their
# installation was broken since --version appeared to work.
AC_SUBST([required_autoconf_version], [2.65])
AC_CACHE_CHECK([whether autoconf is installed], [am_cv_autoconf_installed],
[if AM_RUN_LOG([$am_AUTOCONF --version]);
then
am_cv_autoconf_installed=yes
else
am_cv_autoconf_installed=no
fi])
if test "$am_cv_autoconf_installed" = no; then
AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.
Please make sure it is installed and in your PATH.])
fi
AC_CACHE_CHECK([whether autoconf works], [am_cv_autoconf_works],
[mkdir conftest
echo 'AC''_INIT' > conftest/conftest.ac
if AM_RUN_LOG([cd conftest && $am_AUTOCONF -o /dev/null conftest.ac]);
then
am_cv_autoconf_works=yes
else
am_cv_autoconf_works=no
fi
rm -rf conftest])
if test "$am_cv_autoconf_works" = no; then
AC_MSG_ERROR([The installed version of autoconf does not work.
Please check config.log for error messages before this one.])
fi
AC_CACHE_CHECK([whether autoconf is recent enough], [am_cv_autoconf_version],
[mkdir conftest
dnl Creative quoting required to avoid spurious expansion of AC_PREREQ macro
echo 'AC'"_PREREQ([[$required_autoconf_version]])" > conftest/conftest.ac
if AM_RUN_LOG([cd conftest && $am_AUTOCONF -o /dev/null conftest.ac]);
then
am_cv_autoconf_version=yes
else
am_cv_autoconf_version=no
fi
rm -rf conftest])
if test "$am_cv_autoconf_version" = no; then
AC_MSG_ERROR([Autoconf $required_autoconf_version or better is required.])
fi
# Test for ln. We need use it to install the versioned binaries.
AC_MSG_CHECKING([whether ln works])
AC_CACHE_VAL([am_cv_prog_ln], [
rm -f conftest conftest.file
: >conftest.file
if ln conftest.file conftest 2>/dev/null; then
am_cv_prog_ln=ln
else
am_cv_prog_ln='cp -p'
fi
rm -f conftest conftest.file])
AC_SUBST([LN], [$am_cv_prog_ln])
result=no
test "x$am_cv_prog_ln" = xln && result=yes
AC_MSG_RESULT([$result])
# The amount we should wait after modifying files depends on the platform.
# On Windows '95, '98 and ME, files modifications have 2-seconds
# granularity and can be up to 3 seconds in the future w.r.t. the
# system clock. When it is important to ensure one file is older
# than another we wait at least 5 seconds between creations.
case $build in
*-pc-msdosdjgpp) MODIFICATION_DELAY=5;;
*) MODIFICATION_DELAY=2;;
esac
AC_SUBST([MODIFICATION_DELAY])
## ------------------------------------------- ##
## Test for things needed by the test suite. ##
## ------------------------------------------- ##
AC_PROG_EGREP
AC_PROG_FGREP
dnl FIXME: could we extract this in a simpler way through autoconf
dnl FIXME: idioms or internals?
AC_DEFUN(
[_AM_INIT_BOURNE_COMPATIBLE_VAR],
[am_bourne_compatible="AS_ESCAPE(_m4_expand([AS_BOURNE_COMPATIBLE]))"])
dnl
dnl Arguments to this macro:
dnl
dnl $1 - shell to test
dnl $2 - description of the tested feature
dnl $3 - shell code used to check the feature; to indicate success,
dnl it can either exit with status 77, or have the last command
dnl returning with exit status of zero
dnl $4 - shell code to execute if the check on the shell is successful
dnl (defaults to nothing)
dnl $5 - shell code to execute if the check on the shell is not
dnl successful (defaults to nothing)
dnl
AC_DEFUN([_AM_CHECK_SHELL_FEATURE],
[AC_REQUIRE([_AM_INIT_BOURNE_COMPATIBLE_VAR])
AC_MSG_CHECKING([whether $1 $2])
if { $1 -c "$am_bourne_compatible
AS_ESCAPE([$3])
test \$? -eq 0 || exit 1
# Use 77 to indicate success (rather than 0), in case some shell
# acts like Solaris 10's /bin/sh, exiting successfully on some
# syntax errors.
exit 77" >&AS_MESSAGE_LOG_FD 2>&1; test $? -eq 77; }
then
AC_MSG_RESULT([yes])
$4
else
AC_MSG_RESULT([no])
$5
fi])
# AM_CHECK_CANDIDATE_TEST_SHELL(SHELL-PATH)
# -----------------------------------------
#
# Check if the given shell is good enough to run our test scripts.
# Inspired to gnulib's 'tests/init.sh'.
#
# We require POSIX and XSI features (e.g., '$(...)' for command
# substitutions, '$((...))' for shell arithmetic, and support for
# '${var#...}' and '${var%...}' parameter expansions).
#
# We require that the shell can correctly trap EXIT when 'set -e' is in
# effect (OSF1/Tru64 sh failed to do so, see commit v1.10b-52-g9fe8259).
#
# We want to able to define shell aliases with the same name of shell
# builtins.
#
# We also prefer shells that, when 'set -x' is in effect, do not also
# redirect traces upon stderr redirections. For example,
# $ set -x; echo x 2>file
# would emit "+ echo x" into file with older zsh versions. Similarly,
# $ set -x; P=1 true 2>file
# would emit "P=1" into file with /usr/xpg4/bin/sh from Solaris 10 and
# /bin/sh from SunOS 5.11 and OpenBSD 4.7.
#
# Use '$am_score' to indicate the degree of acceptability of the shell.
# A score of "10" means that the shell is good enough for our needs;
# a score of "9" means that the shell has some minor bugs or limitation,
# but is still (barely) acceptable for our uses. Any other score means
# that the shell is broken or unfit.
#
AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
[am_score=10
while :; do
_AM_CHECK_SHELL_FEATURE([$1],
[supports \$(cmd)],
[test "$(echo x)" = x],
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[supports \$((expr))],
[test $((1 + 2 * 3)) = 7],
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[supports \${@%:@var}],
[zero='' one='x' twelve=' foobar baz!' \
&& test ${@%:@zero} -eq 0 \
&& test ${@%:@one} -eq 1 \
&& test ${@%:@twelve} -eq 12],
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[supports \${var@%:@glob} and \${var%glob}],
[v=a/b/c \
&& test ${v@%:@*/} = b/c \
&& test ${v@%:@@%:@*/} = c \
&& test ${v%/*} = a/b \
&& test ${v%%/*} = a],
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[preserves exit traps with "set -e"],
[set -e; trap 'exit $?' 0; (exit 77); exit 77],
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[can define exit traps in a shell function],
[fail=0 && foo() { trap 'fail=1' 0; } && foo && test $fail = 0],
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[corrupts stderr with "set -x"],
[(set -x; P=1 true 2>&3) 3>&1 2>/dev/null | grep P=1],
[am_score=9], [])
echo 'return 34' > conftest-return.sh
echo 'ok=no' >> conftest-return.sh
_AM_CHECK_SHELL_FEATURE([$1],
[can return early from "dot-sourced" files],
[ok=yes; . ./conftest-return.sh; test $? -eq 34 && test $ok = yes],
[rm -f conftest-return.sh],
[rm -f conftest-return.sh; am_score=1; break])
echo 'alias false=echo' > conftest-alias.sh
echo 'false && test "$(false 97)" = 97' >> conftest-alias.sh
_AM_CHECK_SHELL_FEATURE([$1],
[supports alias named like shell builtins],
[. ./conftest-alias.sh],
[rm -f conftest-alias.sh],
[rm -f conftest-alias.sh; am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
[supports "test -e"],
[test -e config.log && test -e . && test ! -e nonesuch],
[], [am_score=1; break])
break
done])
# These messages only goes to the config.log file.
AC_MSG_NOTICE([will now look for a sturdy POSIX shell, for our testsuite])
AC_CACHE_VAL(
[ac_cv_AM_TEST_RUNNER_SHELL],
[if test "$AM_TEST_RUNNER_SHELL"; then
# Let the user override it.
ac_cv_AM_TEST_RUNNER_SHELL=$AM_TEST_RUNNER_SHELL
else
ac_cv_AM_TEST_RUNNER_SHELL=no
am_candidate_shells=${CONFIG_SHELL-}
# For the benefit of Solaris.
am_PATH=$PATH$PATH_SEPARATOR/usr/xpg6/bin$PATH_SEPARATOR/usr/xpg4/bin
for am_sh in sh sh5 dash ash bash zsh ksh pdksh; do
AC_PATH_PROG([am_candidate_sh], [$am_sh], [], [$am_PATH])
if test -n "$am_candidate_sh"; then
am_candidate_shells="$am_candidate_shells $am_candidate_sh"
fi
AM_SUBST_NOTMAKE([am_candidate_sh])
# Must nullify these in order not to interfere with the checks in
# the next loop.
AS_UNSET([am_candidate_sh])
AS_UNSET([ac_cv_path_am_candidate_sh])
done
AS_UNSET([am_PATH]) # Not required anymore
for am_sh in $am_candidate_shells; do
am_score=0
_AM_CHECK_CANDIDATE_SHELL([$am_sh])
if test $am_score -eq 9; then
# The shell is barely acceptable for our needs. We might
# still find one that is even better, so continue looking.
AC_MSG_NOTICE([shell $am_sh is acceptable, but we might do better])
ac_cv_AM_TEST_RUNNER_SHELL=$am_sh
elif test $am_score -eq 10; then
AC_MSG_NOTICE([shell $am_sh is good enough, stop looking])
ac_cv_AM_TEST_RUNNER_SHELL=$am_sh
break
fi
done
fi
AM_TEST_RUNNER_SHELL=$ac_cv_AM_TEST_RUNNER_SHELL])
if test $AM_TEST_RUNNER_SHELL = no; then
AC_MSG_FAILURE([m4_normalize([no POSIX shell found that is good
enough to be used in our testsuite])])
else
AC_MSG_NOTICE([will use $AM_TEST_RUNNER_SHELL as the testsuite shell])
fi
AC_ARG_VAR([AM_TEST_RUNNER_SHELL],
[a sturdy POSIX shell for our testsuite])
###########################################################################
# Look for C, C++ and fortran compilers to be used in the testsuite.
dnl We don't want to abort our configuration script if no C compiler is
dnl available, as such a compiler is only required to run part of the
dnl testsuite, not to build or install Automake. Ditto for C++, Fortran
dnl and Fortran 77 compilers. Unfortunately, autoconf does not offer an
dnl easy way to obtain this behaviour, so we'll need a few hacks.
dnl We want the body of this macro to expand as a single shell statement,
dnl thus we wrap it into { ... } brackets.
AC_DEFUN([_AM_WRAP_MSG_ERROR], [ {
AC_MSG_WARN([$1])
am__failed=yes
break
} ])
AC_DEFUN([_AM_COMPILER_CAN_FAIL], [
m4_pushdef([AC_MSG_FAILURE], m4_defn([_AM_WRAP_MSG_ERROR]))
m4_pushdef([AC_MSG_ERROR], m4_defn([_AM_WRAP_MSG_ERROR]))
am__failed=no
while :; do
$1
break
done
AS_IF([test $am__failed = yes], [$2])
# We have to clear these cache variables, so that future checks on
# compilers for different languages won't be confused.
unset ac_cv_objext ac_cv_exeext
# We also need to meddle with the autoconf internals to ensure that
# checks to find object and executable extensions will be run anew.
# FIXME: In the long run, the better thing to do would be to fix
# FIXME: autoconf instead ...
m4_undefine([m4_provide(_AC_COMPILER_OBJEXT)])
m4_undefine([m4_provide(_AC_COMPILER_EXEEXT)])
m4_popdef([AC_MSG_FAILURE])
m4_popdef([AC_MSG_ERROR])
])
AC_DEFUN([_AM_SKIP_COMP_TESTS],
[AC_MSG_NOTICE([tests requiring the $1 compiler will be skipped])])
# Prefer generic compilers to GNU ones when possible. This will ensure
# more testsuite coverage "in the wild".
# Note that we don't look for the MSVC C/C++ compiler here. This is
# deliberate; for more discussion and rationale, see:
# <http://lists.gnu.org/archive/html/automake-patches/2012-01/msg00130.html>
AC_MSG_NOTICE([will now look for generic compilers])
# C compiler.
_AM_COMPILER_CAN_FAIL(dnl
[AC_PROG_CC([cc gcc])],
[CC=false; _AM_SKIP_COMP_TESTS([C])])
AS_IF([test x"$GCC" = x"yes"], [am_CC_is_GNU=yes], [am_CC_is_GNU=no])
# On case-insensitive file systems (seen e.g. on Cygwin and Mac OS X)
# we must avoid looking for 'CC', because that would be the same as
# 'cc', and could cause $CXX to point to the C compiler, instead of
# to a C++ compiler as expected (see automake bugs #11893 and #10766).
# Similarly, we must avoid looking for 'RCC', as that can point to the
# Qt4 "Resource Compiler": <http://doc.qt.digia.com/4.2/rcc.html>
if test -f /bIn/rMdIr || test -f /uSr/bIn/rMdIr; then
# Case-insensitive file system, don't look for CC.
am_CC= am_RCC=
else
am_CC=CC am_RCC=RCC
fi
# The list of C++ compilers here has been copied, pasted and edited
# from 'lib/autoconf/c.m4:AC_PROG_CXX' in the Autoconf distribution.
# Keep it in sync, or better again, find out a way to avoid this code
# duplication.
_AM_COMPILER_CAN_FAIL([AC_PROG_CXX(dnl
[aCC $am_CC FCC KCC $am_RCC xlC_r xlC c++ cxx cc++ gpp g++])],
[CXX=false; _AM_SKIP_COMP_TESTS([C++])])
AS_IF([test x"$GXX" = x"yes"], [am_CXX_is_GNU=yes], [am_CXX_is_GNU=no])
# The lists of Fortran compilers here has been copied, pasted and edited
# from file 'lib/autoconf/fortran.m4' in the Autoconf distribution.
# Keep it in sync, or better again, find out a way to avoid this code
# duplication.
_AM_COMPILER_CAN_FAIL([AC_PROG_FC(dnl
[xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor] dnl
[xlf90 f90 pgf90 pghpf epcf90 g95 gfortran])],
[FC=false; _AM_SKIP_COMP_TESTS([Fortran])])
AS_IF([test x"$GFC" = x"yes"], [am_FC_is_GNU=yes], [am_FC_is_GNU=no])
_AM_COMPILER_CAN_FAIL([AC_PROG_F77(dnl
[xlf f77 frt pgf77 cf77 fort77 fl32 af77 g77 gfortran])],
[F77=false; _AM_SKIP_COMP_TESTS([Fortran 77])])
AS_IF([test x"$G77" = x"yes"], [am_F77_is_GNU=yes], [am_F77_is_GNU=no])
# Some tests will need the GNU compilers. Searching for them here would
# be overkill, since our testsuite already handles their search and setup
# pretty well. But in case the compilers already found are the GNU ones,
# we want to use them in the testsuite where GNU compilers are required.
# Also, in case the compilers detected above (at configure time) are not
# the GNU ones, we cannot use the values of CFLAGS, CXXFLAGS, FCFLAGS and
# FFLAGS detected for them with the GNU compilers too, since it's likely
# they won't be compatible. So we allow the user to define variants of
# these variables for the GNU compilers separately.
AC_MSG_NOTICE([will now look for GNU compilers])
# GNU C compiler.
AC_ARG_VAR([GNU_CC], [GNU C compiler])
AC_ARG_VAR([GNU_CFLAGS], [GNU C compiler flags])
if test $am_CC_is_GNU = yes; then
AC_MSG_NOTICE([$CC is already a GNU C compiler])
GNU_CC=$CC GNU_CFLAGS=${GNU_CFLAGS-$CFLAGS}
else
AC_CHECK_TOOLS([GNU_CC], [gcc], [false])
fi
if test "$GNU_CC" != false; then
AS_IF([AM_RUN_LOG([$GNU_CC --version && $GNU_CC -v])], [],
[AC_MSG_WARN([botched installation for GNU C compiler])
_AM_SKIP_COMP_TESTS([GNU C])])
fi
# GNU C++ compiler.
AC_ARG_VAR([GNU_CXX], [GNU C++ compiler])
AC_ARG_VAR([GNU_CXXFLAGS], [GNU C++ compiler flags])
if test $am_CXX_is_GNU = yes; then
AC_MSG_NOTICE([$CXX is already a GNU C++ compiler])
GNU_CXX=$CXX
GNU_CXXFLAGS=${GNU_CXXFLAGS-$CXXFLAGS}
else
AC_CHECK_TOOLS([GNU_CXX], [g++ gpp], [false])
fi
if test "$GNU_CXX" != false; then
AS_IF([AM_RUN_LOG([$GNU_CXX --version && $GNU_CXX -v])], [],
[AC_MSG_WARN([botched installation for GNU C++ compiler])
_AM_SKIP_COMP_TESTS([GNU C++])])
fi
# GNU Fortran compiler.
AC_ARG_VAR([GNU_FC], [GNU Fortran compiler])
AC_ARG_VAR([GNU_FCFLAGS], [GNU Fortran compiler flags])
if test $am_FC_is_GNU = yes; then
AC_MSG_NOTICE([$FC is already a GNU Fortran compiler])
GNU_FC=$FC
GNU_FCFLAGS=${GNU_FCFLAGS-$FCFLAGS}
else
AC_CHECK_TOOLS([GNU_FC], [gfortran], [false])
fi
if test "$GNU_FC" != false; then
AS_IF([AM_RUN_LOG([$GNU_FC --version && $GNU_FC -v])], [],
[AC_MSG_WARN([botched installation for GNU Fortran compiler])
_AM_SKIP_COMP_TESTS([GNU Fortran])])
fi
# GNU Fortran 77 compiler.
AC_ARG_VAR([GNU_F77], [GNU Fortran 77 compiler])
AC_ARG_VAR([GNU_FFLAGS], [GNU Fortran 77 compiler flags])
if test $am_F77_is_GNU = yes; then
AC_MSG_NOTICE([$F77 is already a GNU Fortran 77 compiler])
GNU_F77=$F77
GNU_FFLAGS=${GNU_FFLAGS-$FFLAGS}
else
AC_CHECK_TOOLS([GNU_F77], [g77 gfortran], [false])
fi
if test "$GNU_F77" != false; then
AS_IF([AM_RUN_LOG([$GNU_F77 --version && $GNU_F77 -v])], [],
[AC_MSG_WARN([botched installation for GNU Fortran 77 compiler])
_AM_SKIP_COMP_TESTS([GNU Fortran 77])])
fi
# GNU Java compiler.
AC_ARG_VAR([GNU_GCJ], [GNU Java compiler])
AC_ARG_VAR([GNU_GCJFLAGS], [GNU Java compiler flags])
AC_CHECK_TOOLS([GNU_GCJ], [gcj], [false])
if test "$GNU_GCJ" != false; then
AS_IF([AM_RUN_LOG([$GNU_GCJ --version && $GNU_GCJ -v])], [],
[AC_MSG_WARN([botched installation for GNU Java compiler])
_AM_SKIP_COMP_TESTS([GNU Java])])
fi
# If we have been able to find at least a working compiler above, we
# know what the object and executable extensions for this platform are.
OBJEXT=${ac_cv_objext-UNKNOWN}
EXEEXT=${ac_cv_exeext-UNKNOWN}
AC_SUBST([OBJEXT])
AC_SUBST([EXEEXT])
###########################################################################
## ---------------------- ##
## Create output files. ##
## ---------------------- ##
AC_CONFIG_FILES([Makefile])
AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
AC_CONFIG_FILES([t/wrap/aclocal-${APIVERSION}:t/wrap/aclocal.in],
[chmod +x t/wrap/aclocal-${APIVERSION}],
[APIVERSION=$APIVERSION])
AC_CONFIG_FILES([t/wrap/automake-${APIVERSION}:t/wrap/automake.in],
[chmod +x t/wrap/automake-${APIVERSION}],
[APIVERSION=$APIVERSION])
AC_OUTPUT
# Inform the user if this version of automake is a beta release or
# a development snapshot.
# According to HACKING, the version of a development snapshot should
# end with an "odd" letter (a, c, ...), the version of a test release
# should end wit an "even" letter (b, d, ...).
am_stable_version_rx='[[1-9]\.[0-9]+(\.[0-9]+)?]'
am_beta_version_rx="[$am_stable_version_rx[bdfhjlnprtvxz]]"
am_release_type=`AS_ECHO(["$PACKAGE_VERSION"]) | LC_ALL=C awk ["
/^$am_stable_version_rx$/ { print \"stable\"; exit(0); }
/^$am_beta_version_rx$/ { print \"beta version\"; exit(0); }
{ print \"development snapshot\"; }"]`
# '$silent' is set to yes if configure is passed the '--quiet' option.
test "$am_release_type" = stable || test "$silent" = yes || cat <<EOF
WARNING: You are about to use a $am_release_type of automake.
WARNING: It might easily suffer from new bugs or regressions.
WARNING: You are strongly advised not to use it in production code.
Please report bugs, problems and feedback to <AC_PACKAGE_BUGREPORT>.
EOF
AS_EXIT([0])

View File

@ -0,0 +1,26 @@
This is the 'contrib' directory of the GNU Automake distribution.
Here you'll find additions to the Automake base distribution, in form of
makefile fragments, m4 macros, scripts, documentation, et cetera. Such
addition that might be useful for a significant percentage of its general
audience, but (for one reason or another) are not deemed appropriate for
inclusion into the Automake core.
There are several reasons for which a feature can be kept in contrib:
1. The long-term usefulness of the feature is debatable and uncertain;
on-field and real-word testing are necessary to prove or disprove
its usefulness, before the feature can be committed into the Automake
core (as doing so too early would later force us to continue the
support for backward-compatibility, even if the features proves
flawed or fails to attract widespread use).
2. The APIs or overall design of the feature are still unstable, and
need on-field testing to iron warts and usability bugs, or uncover
potential flaws.
3. The feature was an historical one, mostly obsoleted but still used
"here and there" in the wild; so we want to to deprecate it and
remove it from the Automake core, but cannot remove it altogether,
for the sake of those still-existing usage. So it gets moved in
contrib.

View File

@ -0,0 +1,57 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
## Makefile.am fragment to produce HTML output from RST-formatted
## log files produced by the parallel-tests output.
## This fragment was part of the automake core in the 1.11.x release
## series, but has been then moved to contrib.
TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
mostlyclean-local: mostlyclean-check-html
.PHONY: mostlyclean-check-html
mostlyclean-check-html:
## Expand $(TEST_LOGS) only once, to avoid exceeding line length limits.
list='$(TEST_LOGS:.log=.html)'; test -z "$$list" || rm -f $$list
rm -f $(TEST_SUITE_HTML)
.log.html:
@list='$(RST2HTML) rst2html rst2html.py'; \
while :; do \
for r2h in $$list; do \
if ($$r2h --version) >/dev/null 2>&1; then break 2; \
else :; fi; \
done; \
echo "cannot find rst2html, cannot create $@" >&2; \
exit 2; \
done; \
$$r2h $(AM_RST2HTMLFLAGS) $(RST2HTMLFLAGS) $< >$@-t \
&& mv -f $@-t $@
# Be sure to run check first, and then to convert the result.
# Beware of concurrent executions. Run "check" not "check-TESTS", as
# check-SCRIPTS and other dependencies are rebuilt by the former only.
# And expect check to fail.
check-html recheck-html:
@target=`echo $@ | sed 's/-html$$//'`; \
rv=0; $(MAKE) $(AM_MAKEFLAGS) $$target || rv=$$?; \
## The nullification of $(TEST_LOGS) is required to ensure that
## "make recheck-html" do not try to uselessly re-run tests.
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \
exit $$rv
.PHONY: check-html recheck-html
.MAKE: check-html recheck-html

View File

@ -0,0 +1,9 @@
Minimal support for multilib builds.
For a little more information, see:
<http://airs.com/ian/configure/configure_8.html>
The master (and probably more up-to-date) copies of the 'config-ml.in'
and 'symlink-tree' files are maintained in the GCC development tree
at <http://gcc.gnu.org/svn.html>. The same is probably true also for
the 'multi.m4' file.

View File

@ -0,0 +1,876 @@
# Configure fragment invoked in the post-target section for subdirs
# wanting multilib support.
#
# Copyright (C) 1995-2017 Free Software Foundation, Inc.
#
# This file 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 of the License, 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.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
#
# Please report bugs to <gcc-bugs@gnu.org>
# and send patches to <gcc-patches@gnu.org>.
# It is advisable to support a few --enable/--disable options to let the
# user select which libraries s/he really wants.
#
# Subdirectories wishing to use multilib should put the following lines
# in the "post-target" section of configure.in.
#
# if [ "${srcdir}" = "." ] ; then
# if [ "${with_target_subdir}" != "." ] ; then
# . ${with_multisrctop}../../config-ml.in
# else
# . ${with_multisrctop}../config-ml.in
# fi
# else
# . ${srcdir}/../config-ml.in
# fi
#
#
# Things are complicated because 6 separate cases must be handled:
# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
#
# srcdir=. is special. It must handle make programs that don't handle VPATH.
# To implement this, a symlink tree is built for each library and for each
# multilib subdir.
#
# The build tree is laid out as
#
# ./
# newlib
# m68020/
# newlib
# m68881/
# newlib
#
# The nice feature about this arrangement is that inter-library references
# in the build tree work without having to care where you are. Note that
# inter-library references also work in the source tree because symlink trees
# are built when srcdir=.
#
# Unfortunately, trying to access the libraries in the build tree requires
# the user to manually choose which library to use as GCC won't be able to
# find the right one. This is viewed as the lesser of two evils.
#
# Configure variables:
# ${with_target_subdir} = "." for native, or ${target_alias} for cross.
# Set by top level Makefile.
# ${with_multisrctop} = how many levels of multilibs there are in the source
# tree. It exists to handle the case of configuring in the source tree:
# ${srcdir} is not constant.
# ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881).
#
# Makefile variables:
# MULTISRCTOP = number of multilib levels in source tree (+1 if cross)
# (FIXME: note that this is different than ${with_multisrctop}. Check out.).
# MULTIBUILDTOP = number of multilib levels in build tree
# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...)
# (only defined in each library's main Makefile).
# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000)
# (only defined in each multilib subdir).
# FIXME: Multilib is currently disabled by default for everything other than
# newlib. It is up to each target to turn on multilib support for the other
# libraries as desired.
# Autoconf incoming variables:
# srcdir, host, ac_configure_args
#
# We *could* figure srcdir and host out, but we'd have to do work that
# our caller has already done to figure them out and requiring these two
# seems reasonable.
# Note that `host' in this case is GCC's `target'. Target libraries are
# configured for a particular host.
Makefile=${ac_file-Makefile}
ml_config_shell=${CONFIG_SHELL-/bin/sh}
ml_realsrcdir=${srcdir}
# Scan all the arguments and set all the ones we need.
ml_verbose=--verbose
for option in ${ac_configure_args}
do
# strip single quotes surrounding individual options
case $option in
\'*\') eval option=$option ;;
esac
case $option in
--*) ;;
-*) option=-$option ;;
esac
case $option in
--*=*)
optarg=`echo $option | sed -e 's/^[^=]*=//'`
;;
esac
case $option in
--disable-*)
enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
eval $enableopt=no
;;
--enable-*)
case "$option" in
*=*) ;;
*) optarg=yes ;;
esac
enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
# enable_shared and enable_static are handled by configure.
# Don't undo its work.
case $enableopt in
enable_shared | enable_static) ;;
*) eval $enableopt="$optarg" ;;
esac
;;
--norecursion | --no-recursion)
ml_norecursion=yes
;;
--silent | --sil* | --quiet | --q*)
ml_verbose=--silent
;;
--verbose | --v | --verb*)
ml_verbose=--verbose
;;
--with-*)
case "$option" in
*=*) ;;
*) optarg=yes ;;
esac
withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
eval $withopt="$optarg"
;;
--without-*)
withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
eval $withopt=no
;;
esac
done
# Only do this if --enable-multilib.
if [ "${enable_multilib}" = yes ]; then
# Compute whether this is the library's top level directory
# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
# ${with_multisubdir} tells us we're in the right branch, but we could be
# in a subdir of that.
# ??? The previous version could void this test by separating the process into
# two files: one that only the library's toplevel configure.in ran (to
# configure the multilib subdirs), and another that all configure.in's ran to
# update the Makefile. It seemed reasonable to collapse all multilib support
# into one file, but it does leave us with having to perform this test.
ml_toplevel_p=no
if [ -z "${with_multisubdir}" ]; then
if [ "${srcdir}" = "." ]; then
# Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
# ${with_target_subdir} = "." for native, otherwise target alias.
if [ "${with_target_subdir}" = "." ]; then
if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
ml_toplevel_p=yes
fi
else
if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then
ml_toplevel_p=yes
fi
fi
else
# Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
ml_toplevel_p=yes
fi
fi
fi
# If this is the library's top level directory, set multidirs to the
# multilib subdirs to support. This lives at the top because we need
# `multidirs' set right away.
if [ "${ml_toplevel_p}" = yes ]; then
multidirs=
for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
dir=`echo $i | sed -e 's/;.*$//'`
if [ "${dir}" = "." ]; then
true
else
if [ -z "${multidirs}" ]; then
multidirs="${dir}"
else
multidirs="${multidirs} ${dir}"
fi
fi
done
# Target libraries are configured for the host they run on, so we check
# $host here, not $target.
case "${host}" in
arm-*-*)
if [ x"$enable_fpu" = xno ]
then
old_multidirs=${multidirs}
multidirs=""
for x in ${old_multidirs}; do
case "${x}" in
*fpu*) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x"$enable_26bit" = xno ]
then
old_multidirs=${multidirs}
multidirs=""
for x in ${old_multidirs}; do
case "${x}" in
*26bit*) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x"$enable_underscore" = xno ]
then
old_multidirs=${multidirs}
multidirs=""
for x in ${old_multidirs}; do
case "${x}" in
*under*) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x"$enable_interwork" = xno ]
then
old_multidirs=${multidirs}
multidirs=""
for x in ${old_multidirs}; do
case "${x}" in
*interwork*) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_biendian = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*le* ) : ;;
*be* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x"$enable_nofmult" = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*nofmult* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
m68*-*-*)
if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*soft-float* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_m68881 = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*m68881* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_m68000 = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*m68000* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_m68020 = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*m68020* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
mips*-*-*)
if [ x$enable_single_float = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*single* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_biendian = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*el* ) : ;;
*eb* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*soft-float* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
powerpc*-*-* | rs6000*-*-*)
if [ x$enable_aix64 = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*ppc64* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_pthread = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*pthread* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*soft-float* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_powercpu = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
power | */power | */power/* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_powerpccpu = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*powerpc* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_powerpcos = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*mcall-linux* | *mcall-solaris* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_biendian = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*mlittle* | *mbig* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
if [ x$enable_sysv = xno ]
then
old_multidirs="${multidirs}"
multidirs=""
for x in ${old_multidirs}; do
case "$x" in
*mcall-sysv* ) : ;;
*) multidirs="${multidirs} ${x}" ;;
esac
done
fi
;;
esac
# Remove extraneous blanks from multidirs.
# Tests like `if [ -n "$multidirs" ]' require it.
multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
# Add code to library's top level makefile to handle building the multilib
# subdirs.
cat > Multi.tem <<\EOF
PWD_COMMAND=$${PWDCMD-pwd}
# FIXME: There should be an @-sign in front of the `if'.
# Leave out until this is tested a bit more.
multi-do:
if [ -z "$(MULTIDIRS)" ]; then \
true; \
else \
rootpre=`${PWD_COMMAND}`/; export rootpre; \
srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
lib=`echo "$${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
compiler="$(CC)"; \
for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
dir=`echo $$i | sed -e 's/;.*$$//'`; \
if [ "$${dir}" = "." ]; then \
true; \
else \
if [ -d ../$${dir}/$${lib} ]; then \
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
CFLAGS="$(CFLAGS) $${flags}" \
CCASFLAGS="$(CCASFLAGS) $${flags}" \
FCFLAGS="$(FCFLAGS) $${flags}" \
FFLAGS="$(FFLAGS) $${flags}" \
ADAFLAGS="$(ADAFLAGS) $${flags}" \
prefix="$(prefix)" \
exec_prefix="$(exec_prefix)" \
GCJFLAGS="$(GCJFLAGS) $${flags}" \
GOCFLAGS="$(GOCFLAGS) $${flags}" \
CXXFLAGS="$(CXXFLAGS) $${flags}" \
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
LDFLAGS="$(LDFLAGS) $${flags}" \
MULTIFLAGS="$${flags}" \
DESTDIR="$(DESTDIR)" \
INSTALL="$(INSTALL)" \
INSTALL_DATA="$(INSTALL_DATA)" \
INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \
$(DO)); then \
true; \
else \
exit 1; \
fi; \
else true; \
fi; \
fi; \
done; \
fi
# FIXME: There should be an @-sign in front of the `if'.
# Leave out until this is tested a bit more.
multi-clean:
if [ -z "$(MULTIDIRS)" ]; then \
true; \
else \
lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
for dir in : $(MULTIDIRS); do \
test $$dir != : || continue; \
EOF
cat >>Multi.tem <<EOF
if [ -f ../\$\${dir}/\$\${lib}/${Makefile} ]; then \\
EOF
cat >>Multi.tem <<\EOF
if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
then true; \
else exit 1; \
fi; \
else true; \
fi; \
done; \
fi
EOF
cat ${Makefile} Multi.tem > Makefile.tem
rm -f ${Makefile} Multi.tem
mv Makefile.tem ${Makefile}
fi # ${ml_toplevel_p} = yes
if [ "${ml_verbose}" = --verbose ]; then
echo "Adding multilib support to ${Makefile} in ${ml_realsrcdir}"
if [ "${ml_toplevel_p}" = yes ]; then
echo "multidirs=${multidirs}"
fi
echo "with_multisubdir=${with_multisubdir}"
fi
if [ "${srcdir}" = "." ]; then
if [ "${with_target_subdir}" != "." ]; then
ml_srcdotdot="../"
else
ml_srcdotdot=""
fi
else
ml_srcdotdot=""
fi
if [ -z "${with_multisubdir}" ]; then
ml_subdir=
ml_builddotdot=
: # ml_srcdotdot= # already set
else
ml_subdir="/${with_multisubdir}"
# The '[^/][^/]*' appears that way to work around a SunOS sed bug.
ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/
if [ "$srcdir" = "." ]; then
ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot}
else
: # ml_srcdotdot= # already set
fi
fi
if [ "${ml_toplevel_p}" = yes ]; then
ml_do='$(MAKE)'
ml_clean='$(MAKE)'
else
ml_do=true
ml_clean=true
fi
# TOP is used by newlib and should not be used elsewhere for this purpose.
# MULTI{SRC,BUILD}TOP are the proper ones to use. MULTISRCTOP is empty
# when srcdir != builddir. MULTIBUILDTOP is always some number of ../'s.
# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can
# delete TOP. Newlib may wish to continue to use TOP for its own purposes
# of course.
# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile)
# and lists the subdirectories to recurse into.
# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile
# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with
# a leading '/'.
# MULTIDO is used for targets like all, install, and check where
# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed.
# MULTICLEAN is used for the *clean targets.
#
# ??? It is possible to merge MULTIDO and MULTICLEAN into one. They are
# currently kept separate because we don't want the *clean targets to require
# the existence of the compiler (which MULTIDO currently requires) and
# therefore we'd have to record the directory options as well as names
# (currently we just record the names and use --print-multi-lib to get the
# options).
sed -e "s:^TOP[ ]*=[ ]*\([./]*\)[ ]*$:TOP = ${ml_builddotdot}\1:" \
-e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \
-e "s:^MULTIBUILDTOP[ ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \
-e "s:^MULTIDIRS[ ]*=.*$:MULTIDIRS = ${multidirs}:" \
-e "s:^MULTISUBDIR[ ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \
-e "s:^MULTIDO[ ]*=.*$:MULTIDO = $ml_do:" \
-e "s:^MULTICLEAN[ ]*=.*$:MULTICLEAN = $ml_clean:" \
${Makefile} > Makefile.tem
rm -f ${Makefile}
mv Makefile.tem ${Makefile}
# If this is the library's top level, configure each multilib subdir.
# This is done at the end because this is the loop that runs configure
# in each multilib subdir and it seemed reasonable to finish updating the
# Makefile before going on to configure the subdirs.
if [ "${ml_toplevel_p}" = yes ]; then
# We must freshly configure each subdirectory. This bit of code is
# actually partially stolen from the main configure script. FIXME.
if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
if [ "${ml_verbose}" = --verbose ]; then
echo "Running configure in multilib subdirs ${multidirs}"
echo "pwd: `${PWDCMD-pwd}`"
fi
ml_origdir=`${PWDCMD-pwd}`
ml_libdir=`echo "$ml_origdir" | sed -e 's,^.*/,,'`
# cd to top-level-build-dir/${with_target_subdir}
cd ..
for ml_dir in ${multidirs}; do
if [ "${ml_verbose}" = --verbose ]; then
echo "Running configure in multilib subdir ${ml_dir}"
echo "pwd: `${PWDCMD-pwd}`"
fi
if [ -d ${ml_dir} ]; then true; else
# ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
pathcomp=""
for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
fi
if test ! -d "$pathcomp"; then
exit $lasterr
fi
pathcomp="$pathcomp/"
done
fi
if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
# Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../
dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
case ${srcdir} in
".")
echo "Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}"
if [ "${with_target_subdir}" != "." ]; then
ml_unsubdir="../"
else
ml_unsubdir=""
fi
(cd ${ml_dir}/${ml_libdir};
../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "")
if [ -f ${ml_dir}/${ml_libdir}/${Makefile} ]; then
if [ x"${MAKE}" = x ]; then
(cd ${ml_dir}/${ml_libdir}; make distclean)
else
(cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean)
fi
fi
ml_newsrcdir="."
ml_srcdiroption=
multisrctop=${dotdot}
;;
*)
case "${srcdir}" in
/* | [A-Za-z]:[\\/]* ) # absolute path
ml_newsrcdir=${srcdir}
;;
*) # otherwise relative
ml_newsrcdir=${dotdot}${srcdir}
;;
esac
ml_srcdiroption="-srcdir=${ml_newsrcdir}"
multisrctop=
;;
esac
case "${progname}" in
/* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;;
*) ml_recprog=${dotdot}${progname} ;;
esac
# FIXME: POPDIR=${PWD=`pwd`} doesn't work here.
ML_POPDIR=`${PWDCMD-pwd}`
cd ${ml_dir}/${ml_libdir}
if [ -f ${ml_newsrcdir}/configure ]; then
ml_recprog="${ml_newsrcdir}/configure"
fi
# find compiler flag corresponding to ${ml_dir}
for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
dir=`echo $i | sed -e 's/;.*$//'`
if [ "${dir}" = "${ml_dir}" ]; then
flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
break
fi
done
ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"'
if [ "${with_target_subdir}" = "." ]; then
CC_=$CC' '
CXX_=$CXX' '
F77_=$F77' '
GCJ_=$GCJ' '
GFORTRAN_=$GFORTRAN' '
GOC_=$GOC' '
else
# Create a regular expression that matches any string as long
# as ML_POPDIR.
popdir_rx=`echo "${ML_POPDIR}" | sed 's,.,.,g'`
CC_=
for arg in ${CC}; do
case $arg in
-[BIL]"${ML_POPDIR}"/*)
CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;;
"${ML_POPDIR}"/*)
CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
CC_="${CC_}${arg} " ;;
esac
done
CXX_=
for arg in ${CXX}; do
case $arg in
-[BIL]"${ML_POPDIR}"/*)
CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
"${ML_POPDIR}"/*)
CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
CXX_="${CXX_}${arg} " ;;
esac
done
F77_=
for arg in ${F77}; do
case $arg in
-[BIL]"${ML_POPDIR}"/*)
F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
"${ML_POPDIR}"/*)
F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
F77_="${F77_}${arg} " ;;
esac
done
GCJ_=
for arg in ${GCJ}; do
case $arg in
-[BIL]"${ML_POPDIR}"/*)
GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
"${ML_POPDIR}"/*)
GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
GCJ_="${GCJ_}${arg} " ;;
esac
done
GFORTRAN_=
for arg in ${GFORTRAN}; do
case $arg in
-[BIL]"${ML_POPDIR}"/*)
GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
"${ML_POPDIR}"/*)
GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
GFORTRAN_="${GFORTRAN_}${arg} " ;;
esac
done
GOC_=
for arg in ${GOC}; do
case $arg in
-[BIL]"${ML_POPDIR}"/*)
GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
"${ML_POPDIR}"/*)
GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
GOC_="${GOC_}${arg} " ;;
esac
done
if test "x${LD_LIBRARY_PATH+set}" = xset; then
LD_LIBRARY_PATH_=
for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
case "$arg" in
"${ML_POPDIR}"/*)
arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
;;
esac
if test "x$LD_LIBRARY_PATH_" != x; then
LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg
else
LD_LIBRARY_PATH_=$arg
fi
done
ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_"
fi
if test "x${SHLIB_PATH+set}" = xset; then
SHLIB_PATH_=
for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do
case "$arg" in
"${ML_POPDIR}"/*)
arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
;;
esac
if test "x$SHLIB_PATH_" != x; then
SHLIB_PATH_=$SHLIB_PATH_:$arg
else
SHLIB_PATH_=$arg
fi
done
ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_"
fi
fi
if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then
true
else
exit 1
fi
cd "${ML_POPDIR}"
done
cd "${ml_origdir}"
fi
fi # ${ml_toplevel_p} = yes
fi # ${enable_multilib} = yes

View File

@ -0,0 +1,64 @@
## -*- Autoconf -*-
# Copyright (C) 1998-2017 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

View File

@ -0,0 +1,45 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 Free Software Foundation, Inc.
## This Makefile.in 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; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
# GNU Make needs to see an explicit $(MAKE) variable in the command it
# runs to enable its job server during parallel builds. Hence the
# comments below.
all-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
install-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
mostlyclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
.MAKE .PHONY: all-multi clean-multi distclean-multi install-am \
install-multi maintainer-clean-multi mostlyclean-multi
install-exec-local: install-multi
all-local: all-multi
mostlyclean-local: mostlyclean-multi
clean-local: clean-multi
distclean-local: distclean-multi
maintainer-clean-local: maintainer-clean-multi

View File

@ -0,0 +1,78 @@
#!/bin/sh
# Create a symlink tree.
#
# Copyright (C) 1995-2017 Free Software Foundation, Inc.
#
# This file 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 of the License, 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.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
#
# Please report bugs to <gcc-bugs@gnu.org>
# and send patches to <gcc-patches@gnu.org>.
# Syntax: symlink-tree srcdir "ignore1 ignore2 ..."
#
# where srcdir is the directory to create a symlink tree to,
# and "ignoreN" is a list of files/directories to ignore.
prog=$0
srcdir=$1
ignore="$2"
if test $# -lt 1; then
echo "symlink-tree error: Usage: symlink-tree srcdir \"ignore1 ignore2 ...\""
exit 1
fi
ignore_additional=". .. CVS"
# If we were invoked with a relative path name, adjust ${prog} to work
# in subdirs.
case ${prog} in
/* | [A-Za-z]:[\\/]*) ;;
*) prog=../${prog} ;;
esac
# Set newsrcdir to something subdirectories can use.
case ${srcdir} in
/* | [A-Za-z]:[\\/]*) newsrcdir=${srcdir} ;;
*) newsrcdir=../${srcdir} ;;
esac
for f in `ls -a ${srcdir}`; do
if [ -d ${srcdir}/$f ]; then
found=
for i in ${ignore} ${ignore_additional}; do
if [ "$f" = "$i" ]; then
found=yes
fi
done
if [ -z "${found}" ]; then
echo "$f ..working in"
if [ -d $f ]; then true; else mkdir $f; fi
(cd $f; ${prog} ${newsrcdir}/$f "${ignore}")
fi
else
echo "$f ..linked"
rm -f $f
ln -s ${srcdir}/$f .
fi
done
exit 0

View File

@ -0,0 +1,26 @@
## Included by top-level Makefile for Automake.
## Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## -------------------------------- ##
## Tests for stuff in 'contrib/'. ##
## -------------------------------- ##
contrib_TESTS = \
%D%/parallel-tests-html.sh \
%D%/parallel-tests-html-recursive.sh \
%D%/help-multilib.sh \
%D%/multilib.sh

View File

@ -0,0 +1,32 @@
#! /bin/sh
# Copyright (C) 2010-2017 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 <http://www.gnu.org/licenses/>.
# Make sure that our macro 'AM_ENABLE_MULTILIB' adds proper text to
# the configure help screen.
. test-init.sh
cat > configure.ac <<END
AC_INIT([$me], [1.0])
AM_ENABLE_MULTILIB
END
cat "$am_top_srcdir"/contrib/multilib/multi.m4 > aclocal.m4
$AUTOCONF
grep_configure_help --enable-multilib ' many library versions \(default\)'
:

View File

@ -0,0 +1,160 @@
#! /bin/sh
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
# Check multilib support.
# Based on a test case from Ralf Corsepius.
required='gcc GNUmake'
. test-init.sh
mldir=$am_top_srcdir/contrib/multilib
mkdir m4
cp "$mldir"/config-ml.in "$mldir"/symlink-tree .
cp "$mldir"/multi.m4 m4
ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4
export ACLOCAL_PATH
cat >configure.ac <<'END'
AC_INIT([multlib], [1.0])
AC_CONFIG_SRCDIR(libfoo/foo.c)
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_CONFIG_SUBDIRS(libfoo)
AC_CONFIG_SUBDIRS(libbar)
AC_OUTPUT
END
cat >mycc <<'END'
#! /bin/sh
case ${1+"$@"} in
*-print-multi-lib*)
echo ".;"
echo "debug;@g"
exit 0 ;;
esac
gcc ${1+"$@"}
END
chmod +x mycc
PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
cat >Makefile.am <<'EOF'
SUBDIRS = @subdirs@
EXTRA_DIST = config-ml.in symlink-tree
check-all:
test -f debug/libfoo/libfoo.a
test -f debug/libbar/libbar.a
test -f libfoo/libfoo.a
test -f libbar/libbar.a
EOF
# libfoo tests multilib supports when there are no subdirectories
# libbar tests multilib supports when there are subdirectories
mkdir libfoo
cp "$mldir"/multilib.am libfoo/
cat >libfoo/configure.ac <<'END'
AC_PREREQ(2.57)
AC_INIT(libfoo, 0.1, nobody@localhost)
AC_CONFIG_SRCDIR(foo.c)
# Apparently it doesn't work to have auxdir=.. when
# multilib uses symlinked trees.
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
AM_ENABLE_MULTILIB(Makefile,[..])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
cat >libfoo/Makefile.am <<'END'
noinst_LIBRARIES = libfoo.a
libfoo_a_SOURCES = foo.c
include $(top_srcdir)/multilib.am
END
: > libfoo/foo.c
mkdir libbar
cp "$mldir"/multilib.am libbar/
cat >libbar/configure.ac <<'END'
AC_PREREQ(2.57)
AC_INIT(libbar, 0.1, nobody@localhost)
# Apparently it doesn't work to have auxdir=.. when
# multilib uses symlinked trees.
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
AM_ENABLE_MULTILIB(Makefile,[..])
AC_CONFIG_FILES([Makefile sub/Makefile])
AC_OUTPUT
END
cat >libbar/Makefile.am <<'END'
SUBDIRS = sub
noinst_LIBRARIES = libbar.a
libbar_a_SOURCES = bar.c
include $(top_srcdir)/multilib.am
END
mkdir libbar/sub
echo 'include $(top_srcdir)/multilib.am' >libbar/sub/Makefile.am
: > libbar/bar.c
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
cd libfoo
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
cd ..
cd libbar
$ACLOCAL
$AUTOCONF
$AUTOMAKE --add-missing
cd ..
# Check VPATH builds
mkdir build
cd build
../configure --enable-multilib CC=mycc
$MAKE
test -f debug/libfoo/libfoo.a
test -f debug/libbar/libbar.a
test -f libfoo/libfoo.a
test -f libbar/libbar.a
$MAKE install
$MAKE distcleancheck
# Check standard builds.
cd ..
# Why to I have to specify --with-target-subdir?
./configure --enable-multilib --with-target-subdir=. CC=mycc
$MAKE check
DISTCHECK_CONFIGURE_FLAGS='--enable-multilib CC=mycc' $MAKE distcheck
:

View File

@ -0,0 +1,163 @@
#! /bin/sh
# Copyright (C) 2012-2017 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 <http://www.gnu.org/licenses/>.
# Recursive use of 'check-html'. See Automake bug#11287.
. test-init.sh
# Try the variants that are tried in check-html.am.
while :; do
for r2h in $RST2HTML rst2html rst2html.py; do
echo "$me: running $r2h --version"
$r2h --version && break 2
: For shells with busted 'set -e'.
done
skip_all_ "no proper rst2html program found"
done
unset r2h
cp "$am_top_srcdir"/contrib/check-html.am . \
|| fatal_ "cannot fetch 'check-html.am' from contrib"
cat >> configure.ac << 'END'
AM_EXTRA_RECURSIVE_TARGETS([check-html])
AC_CONFIG_FILES([sub/Makefile sub/more/Makefile])
AC_OUTPUT
END
cat > Makefile.am << 'END'
SUBDIRS = sub
EXTRA_DIST = $(TESTS)
TEST_SUITE_LOG = mylog.log
TESTS = foo.test bar.sh mu
XFAIL_TESTS = bar.sh
check_SCRIPTS = bla
bla:
echo '#!/bin/sh' > $@-t
echo 'echo Blah Blah Blah' >> $@-t
chmod a+x,a-w $@-t
mv -f $@-t $@
CLEANFILES = bla
include $(srcdir)/check-html.am
END
mkdir sub
echo SUBDIRS = more > sub/Makefile.am
mkdir sub/more
cat > sub/more/Makefile.am << 'END'
include $(top_srcdir)/check-html.am
TEST_EXTENSIONS = .test .sh
TESTS = sh.sh test.test
LOG_COMPILER = true
test.log: sh.log
nodist_check_DATA = x.txt
$(nodist_check_DATA):
echo $@ > $@
CLEANFILES = $(nodist_check_DATA)
EXTRA_DIST = $(TESTS)
END
cat > foo.test <<'END'
#! /bin/sh
./bla
exit 77
END
cat > bar.sh <<'END'
#! /bin/sh
echo "this is $0"
exit 1
END
cat > mu <<'END'
#! /bin/sh
set -x
test -f sub/more/test.log
test -f sub/more/sh.log
END
cat > sub/more/test.test << 'END'
#!/bin/sh
echo "this is $0"
set -x
test -f sh.log
test -f x.txt
exit 77
END
cat > sub/more/sh.sh << 'END'
#!/bin/sh
set -x
test ! -f test.log
test -f x.txt
END
cat > sub/more/mu << 'END'
#!/bin/sh
exit 99
END
chmod a+x foo.test bar.sh mu sub/more/test.test sub/more/sh.sh
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
$MAKE check-html
grep 'Blah Blah Blah' mylog.html
grep 'this is .*bar\.sh' mylog.html
grep 'this is .*test\.test' sub/more/test-suite.html
# check-html should cause check_SCRIPTS and check_DATA to be created.
test -f bla
test -f sub/more/x.txt
# "make clean" should remove HTML files.
$MAKE clean
test ! -e mylog.html
test ! -e sub/more/test-suite.html
test ! -e bla
test ! -e sub/more/x.txt
# Create HTML output for individual tests.
$MAKE bla
$MAKE foo.html bar.sh.html
grep 'Blah Blah Blah' foo.html
grep 'this is .*bar\.sh' bar.sh.html
test ! -e mu.hml
ocwd=$(pwd) || fatal_ "getting current workind directory"
( cd sub/more \
&& $MAKE sh.html \
&& test -f sh.html \
&& test ! -e test.html \
&& $MAKE test.html \
&& grep 'this is .*test\.test' test.html) || exit 1
# HTML output removed by mostlyclean.
$MAKE check-html
test -f mylog.html
test -f sub/more/test-suite.html
$MAKE mostlyclean
find . -name '*.html' | grep . && exit 1
$MAKE distcheck
:

View File

@ -0,0 +1,144 @@
#! /bin/sh
# Copyright (C) 2009-2017 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 <http://www.gnu.org/licenses/>.
# Check parallel-tests features:
# - check-html
# - recheck-html
. test-init.sh
# Try the variants that are tried in check-html.am.
while :; do
for r2h in $RST2HTML rst2html rst2html.py; do
echo "$me: running $r2h --version"
$r2h --version && break 2
: For shells with busted 'set -e'.
done
skip_all_ "no proper rst2html program found"
done
unset r2h
cp "$am_top_srcdir"/contrib/check-html.am . \
|| fatal_ "cannot fetch 'check-html.am' from contrib"
cat >> configure.ac << 'END'
AC_OUTPUT
END
cat > Makefile.am << 'END'
TEST_SUITE_LOG = mylog.log
TESTS = foo.test bar.test baz.test
check_SCRIPTS = bla
bla:
echo bla > $@
CLEANFILES = bla
include $(srcdir)/check-html.am
END
cat > foo.test <<'END'
#! /bin/sh
echo "this is $0"
test -f bla || exit 1
exit 0
END
cat > bar.test <<'END'
#! /bin/sh
echo "this is $0"
exit 99
END
cat > baz.test <<'END'
#! /bin/sh
echo "this is $0"
exit 1
END
chmod a+x foo.test bar.test baz.test
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
$MAKE check-html && exit 1
test -f mylog.html
# check-html should cause check_SCRIPTS to be created.
test -f bla
# "make clean" should remove HTML files.
$MAKE clean
test ! -e mylog.html
test ! -e bla
# Always create the HTML output, even if there were no failures.
rm -f mylog.html
run_make TESTS=foo.test check-html
test -f mylog.html
# Create summarizing HTML output also with recheck-html.
rm -f mylog.html
run_make TESTS=foo.test recheck-html
test -f mylog.html
# Create HTML output for an individual test.
$MAKE foo.html
grep 'this is .*foo\.test' foo.html
test ! -e bar.html
test ! -e baz.html
# Create HTML output for individual tests. Since the pre-existing log
# files are expected to be used for the HTML conversion, this should
# go smoothly even for failed tests.
$MAKE bar.html baz.html
grep 'this is .*bar\.test' bar.html
grep 'this is .*baz\.test' baz.html
# HTML output removed by mostlyclean.
$MAKE mostlyclean
test ! -e foo.html
test ! -e bar.html
test ! -e baz.html
test ! -e mylog.html
# check-html and recheck-html should cause check_SCRIPTS to be created,
# and recheck-html should rerun no tests if check has not been run.
$MAKE clean
test ! -e mylog.html
run_make TEST_LOGS=foo.log check-html
test -f bla
test -f foo.log
test ! -e bar.log
test ! -e baz.log
test -f mylog.html
$MAKE clean
run_make TESTS=foo.test recheck-html
test -f bla
test ! -e foo.log
test -f mylog.html
$MAKE clean
$MAKE recheck-html
test -f bla
test ! -e foo.log
test ! -e bar.log
test ! -e baz.log
test -f mylog.html
:

View File

@ -0,0 +1,563 @@
#! /usr/bin/env perl
# Copyright (C) 2011-2017 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 <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# ---------------------------------- #
# Imports, static data, and setup. #
# ---------------------------------- #
use warnings FATAL => 'all';
use strict;
use Getopt::Long ();
use TAP::Parser;
my $VERSION = '2013-12-24.15'; # UTC
my $ME = "tap-driver.pl";
my $USAGE = <<'END';
Usage:
tap-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--ignore-exit]
[--diagnostic-string=STRING] [--merge|--no-merge]
[--comments|--no-comments] [--] TEST-COMMAND
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
my $HELP = "$ME: TAP-aware test driver for Automake testsuite harness." .
"\n" . $USAGE;
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
my %COLOR = (
red => "\e[0;31m",
grn => "\e[0;32m",
lgn => "\e[1;32m",
blu => "\e[1;34m",
mgn => "\e[0;35m",
brg => "\e[1m",
std => "\e[m",
);
# It's important that NO_PLAN evaluates "false" as a boolean.
use constant NO_PLAN => 0;
use constant EARLY_PLAN => 1;
use constant LATE_PLAN => 2;
# ------------------- #
# Global variables. #
# ------------------- #
my $testno = 0; # Number of test results seen so far.
my $bailed_out = 0; # Whether a "Bail out!" directive has been seen.
my $parser; # TAP parser object (will be initialized later).
# Whether the TAP plan has been seen or not, and if yes, which kind
# it is ("early" is seen before any test result, "late" otherwise).
my $plan_seen = NO_PLAN;
# ----------------- #
# Option parsing. #
# ----------------- #
my %cfg = (
"color-tests" => 0,
"expect-failure" => 0,
"merge" => 0,
"comments" => 0,
"ignore-exit" => 0,
);
my $test_script_name = undef;
my $log_file = undef;
my $trs_file = undef;
my $diag_string = "#";
Getopt::Long::GetOptions
(
'help' => sub { print $HELP; exit 0; },
'version' => sub { print "$ME $VERSION\n"; exit 0; },
'test-name=s' => \$test_script_name,
'log-file=s' => \$log_file,
'trs-file=s' => \$trs_file,
'color-tests=s' => \&bool_opt,
'expect-failure=s' => \&bool_opt,
'enable-hard-errors=s' => sub {}, # No-op.
'diagnostic-string=s' => \$diag_string,
'comments' => sub { $cfg{"comments"} = 1; },
'no-comments' => sub { $cfg{"comments"} = 0; },
'merge' => sub { $cfg{"merge"} = 1; },
'no-merge' => sub { $cfg{"merge"} = 0; },
'ignore-exit' => sub { $cfg{"ignore-exit"} = 1; },
) or exit 1;
# ------------- #
# Prototypes. #
# ------------- #
sub add_test_result ($);
sub bool_opt ($$);
sub colored ($$);
sub copy_in_global_log ();
sub decorate_result ($);
sub extract_tap_comment ($);
sub finish ();
sub get_global_test_result ();
sub get_test_exit_message ();
sub get_test_results ();
sub handle_tap_bailout ($);
sub handle_tap_plan ($);
sub handle_tap_result ($);
sub is_null_string ($);
sub main (@);
sub must_recheck ();
sub report ($;$);
sub setup_io ();
sub setup_parser (@);
sub stringify_result_obj ($);
sub testsuite_error ($);
sub trap_perl_warnings_and_errors ();
sub write_test_results ();
sub yn ($);
# -------------- #
# Subroutines. #
# -------------- #
sub bool_opt ($$)
{
my ($opt, $val) = @_;
if ($val =~ /^(?:y|yes)\z/i)
{
$cfg{$opt} = 1;
}
elsif ($val =~ /^(?:n|no)\z/i)
{
$cfg{$opt} = 0;
}
else
{
die "$ME: invalid argument '$val' for option '$opt'\n";
}
}
# If the given string is undefined or empty, return true, otherwise
# return false. This function is useful to avoid pitfalls like:
# if ($message) { print "$message\n"; }
# which wouldn't print anything if $message is the literal "0".
sub is_null_string ($)
{
my $str = shift;
return ! (defined $str and length $str);
}
# Convert a boolean to a "yes"/"no" string.
sub yn ($)
{
my $bool = shift;
return $bool ? "yes" : "no";
}
TEST_RESULTS :
{
my (@test_results_list, %test_results_seen);
sub add_test_result ($)
{
my $res = shift;
push @test_results_list, $res;
$test_results_seen{$res} = 1;
}
sub get_test_results ()
{
return @test_results_list;
}
# Whether the test script should be re-run by "make recheck".
sub must_recheck ()
{
return grep { !/^(?:XFAIL|PASS|SKIP)$/ } (keys %test_results_seen);
}
# Whether the content of the log file associated to this test should
# be copied into the "global" test-suite.log.
sub copy_in_global_log ()
{
return grep { not $_ eq "PASS" } (keys %test_results_seen);
}
sub get_global_test_result ()
{
return "ERROR"
if $test_results_seen{"ERROR"};
return "FAIL"
if $test_results_seen{"FAIL"} || $test_results_seen{"XPASS"};
return "SKIP"
if scalar keys %test_results_seen == 1 && $test_results_seen{"SKIP"};
return "PASS";
}
}
sub write_test_results ()
{
open RES, ">", $trs_file or die "$ME: opening $trs_file: $!\n";
print RES ":global-test-result: " . get_global_test_result . "\n";
print RES ":recheck: " . yn (must_recheck) . "\n";
print RES ":copy-in-global-log: " . yn (copy_in_global_log) . "\n";
foreach my $result (get_test_results)
{
print RES ":test-result: $result\n";
}
close RES or die "$ME: closing $trs_file: $!\n";
}
sub trap_perl_warnings_and_errors ()
{
$SIG{__WARN__} = $SIG{__DIE__} = sub
{
# Be sure to send the warning/error message to the original stderr
# (presumably the console), not into the log file.
open STDERR, ">&OLDERR";
die @_;
}
}
sub setup_io ()
{
# Redirect stderr and stdout to a temporary log file. Save the
# original stdout stream, since we need it to print testsuite
# progress output. Save original stderr stream, so that we can
# redirect warning and error messages from perl there.
open LOG, ">", $log_file or die "$ME: opening $log_file: $!\n";
open OLDOUT, ">&STDOUT" or die "$ME: duplicating stdout: $!\n";
open OLDERR, ">&STDERR" or die "$ME: duplicating stdout: $!\n";
*OLDERR = *OLDERR; # To pacify a "used only once" warning.
trap_perl_warnings_and_errors;
open STDOUT, ">&LOG" or die "$ME: redirecting stdout: $!\n";
open STDERR, ">&LOG" or die "$ME: redirecting stderr: $!\n";
}
sub setup_parser (@)
{
local $@ = '';
eval { $parser = TAP::Parser->new ({exec => \@_, merge => $cfg{merge}}) };
if ($@ ne '')
{
# Don't use the error message in $@ as set by TAP::Parser, since
# currently it's both too generic (at the point of being basically
# useless) and quite long.
report "ERROR", "- couldn't execute test script";
finish;
}
}
sub get_test_exit_message ()
{
my $wstatus = $parser->wait;
# Watch out for possible internal errors.
die "$ME: couldn't get the exit status of the TAP producer"
unless defined $wstatus;
# Return an undefined value if the producer exited with success.
return unless $wstatus;
# Otherwise, determine whether it exited with error or was terminated
# by a signal.
use POSIX qw (WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
if (WIFEXITED ($wstatus))
{
return sprintf "exited with status %d", WEXITSTATUS ($wstatus);
}
elsif (WIFSIGNALED ($wstatus))
{
return sprintf "terminated by signal %d", WTERMSIG ($wstatus);
}
else
{
return "terminated abnormally";
}
}
sub stringify_result_obj ($)
{
my $result_obj = shift;
my $COOKED_PASS = $cfg{"expect-failure"} ? "XPASS": "PASS";
my $COOKED_FAIL = $cfg{"expect-failure"} ? "XFAIL": "FAIL";
if ($result_obj->is_unplanned || $result_obj->number != $testno)
{
return "ERROR";
}
elsif ($plan_seen == LATE_PLAN)
{
return "ERROR";
}
elsif (!$result_obj->directive)
{
return $result_obj->is_ok ? $COOKED_PASS: $COOKED_FAIL;
}
elsif ($result_obj->has_todo)
{
return $result_obj->is_actual_ok ? "XPASS" : "XFAIL";
}
elsif ($result_obj->has_skip)
{
return $result_obj->is_ok ? "SKIP" : $COOKED_FAIL;
}
die "$ME: INTERNAL ERROR"; # NOTREACHED
}
sub colored ($$)
{
my ($color_name, $text) = @_;
return $COLOR{$color_name} . $text . $COLOR{'std'};
}
sub decorate_result ($)
{
my $result = shift;
return $result unless $cfg{"color-tests"};
my %color_for_result =
(
"ERROR" => 'mgn',
"PASS" => 'grn',
"XPASS" => 'red',
"FAIL" => 'red',
"XFAIL" => 'lgn',
"SKIP" => 'blu',
);
if (my $color = $color_for_result{$result})
{
return colored ($color, $result);
}
else
{
return $result; # Don't colorize unknown stuff.
}
}
sub report ($;$)
{
my ($msg, $result, $explanation) = (undef, @_);
if ($result =~ /^(?:X?(?:PASS|FAIL)|SKIP|ERROR)/)
{
$msg = ": $test_script_name";
add_test_result $result;
}
elsif ($result eq "#")
{
$msg = " $test_script_name:";
}
else
{
die "$ME: INTERNAL ERROR"; # NOTREACHED
}
$msg .= " $explanation" if defined $explanation;
$msg .= "\n";
# Output on console might be colorized.
print OLDOUT decorate_result ($result) . $msg;
# Log the result in the log file too, to help debugging (this is
# especially true when said result is a TAP error or "Bail out!").
print $result . $msg;
}
sub testsuite_error ($)
{
report "ERROR", "- $_[0]";
}
sub handle_tap_result ($)
{
$testno++;
my $result_obj = shift;
my $test_result = stringify_result_obj $result_obj;
my $string = $result_obj->number;
my $description = $result_obj->description;
$string .= " $description"
unless is_null_string $description;
if ($plan_seen == LATE_PLAN)
{
$string .= " # AFTER LATE PLAN";
}
elsif ($result_obj->is_unplanned)
{
$string .= " # UNPLANNED";
}
elsif ($result_obj->number != $testno)
{
$string .= " # OUT-OF-ORDER (expecting $testno)";
}
elsif (my $directive = $result_obj->directive)
{
$string .= " # $directive";
my $explanation = $result_obj->explanation;
$string .= " $explanation"
unless is_null_string $explanation;
}
report $test_result, $string;
}
sub handle_tap_plan ($)
{
my $plan = shift;
if ($plan_seen)
{
# Error, only one plan per stream is acceptable.
testsuite_error "multiple test plans";
return;
}
# The TAP plan can come before or after *all* the TAP results; we speak
# respectively of an "early" or a "late" plan. If we see the plan line
# after at least one TAP result has been seen, assume we have a late
# plan; in this case, any further test result seen after the plan will
# be flagged as an error.
$plan_seen = ($testno >= 1 ? LATE_PLAN : EARLY_PLAN);
# If $testno > 0, we have an error ("too many tests run") that will be
# automatically dealt with later, so don't worry about it here. If
# $plan_seen is true, we have an error due to a repeated plan, and that
# has already been dealt with above. Otherwise, we have a valid "plan
# with SKIP" specification, and should report it as a particular kind
# of SKIP result.
if ($plan->directive && $testno == 0)
{
my $explanation = is_null_string ($plan->explanation) ?
undef : "- " . $plan->explanation;
report "SKIP", $explanation;
}
}
sub handle_tap_bailout ($)
{
my ($bailout, $msg) = ($_[0], "Bail out!");
$bailed_out = 1;
$msg .= " " . $bailout->explanation
unless is_null_string $bailout->explanation;
testsuite_error $msg;
}
sub extract_tap_comment ($)
{
my $line = shift;
if (index ($line, $diag_string) == 0)
{
# Strip leading '$diag_string' from '$line'.
$line = substr ($line, length ($diag_string));
# And strip any leading and trailing whitespace left.
$line =~ s/(?:^\s*|\s*$)//g;
# Return what is left (if any).
return $line;
}
return "";
}
sub finish ()
{
write_test_results;
close LOG or die "$ME: closing $log_file: $!\n";
exit 0;
}
sub main (@)
{
setup_io;
setup_parser @_;
while (defined (my $cur = $parser->next))
{
# Verbatim copy any input line into the log file.
print $cur->raw . "\n";
# Parsing of TAP input should stop after a "Bail out!" directive.
next if $bailed_out;
if ($cur->is_plan)
{
handle_tap_plan ($cur);
}
elsif ($cur->is_test)
{
handle_tap_result ($cur);
}
elsif ($cur->is_bailout)
{
handle_tap_bailout ($cur);
}
elsif ($cfg{comments})
{
my $comment = extract_tap_comment ($cur->raw);
report "#", "$comment" if length $comment;
}
}
# A "Bail out!" directive should cause us to ignore any following TAP
# error, as well as a non-zero exit status from the TAP producer.
if (!$bailed_out)
{
if (!$plan_seen)
{
testsuite_error "missing test plan";
}
elsif ($parser->tests_planned != $parser->tests_run)
{
my ($planned, $run) = ($parser->tests_planned, $parser->tests_run);
my $bad_amount = $run > $planned ? "many" : "few";
testsuite_error (sprintf "too %s tests run (expected %d, got %d)",
$bad_amount, $planned, $run);
}
if (!$cfg{"ignore-exit"})
{
my $msg = get_test_exit_message ();
testsuite_error $msg if $msg;
}
}
finish;
}
# ----------- #
# Main code. #
# ----------- #
main @ARGV;
# 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
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "my $VERSION = "
# time-stamp-format: "'%:y-%02m-%02d.%02H'"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@ -0,0 +1,116 @@
## Included by top-level Makefile for Automake.
## Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## ---------------- ##
## Documentation. ##
## ---------------- ##
info_TEXINFOS = %D%/automake.texi %D%/automake-history.texi
doc_automake_TEXINFOS = %D%/fdl.texi
doc_automake_history_TEXINFOS = %D%/fdl.texi
man1_MANS = \
%D%/aclocal.1 \
%D%/automake.1 \
%D%/aclocal-$(APIVERSION).1 \
%D%/automake-$(APIVERSION).1
$(man1_MANS): $(top_srcdir)/configure.ac
CLEANFILES += $(man1_MANS)
EXTRA_DIST += %D%/help2man
update_mans = \
$(AM_V_GEN): \
&& $(MKDIR_P) %D% \
&& $(extend_PATH) \
&& $(PERL) $(srcdir)/%D%/help2man --output=$@
%D%/aclocal.1 %D%/automake.1:
$(AM_V_GEN): \
&& $(MKDIR_P) %D% \
&& f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'` \
&& echo ".so man1/$$f-$(APIVERSION).1" > $@
%D%/aclocal-$(APIVERSION).1: $(aclocal_script) lib/Automake/Config.pm
$(update_mans) aclocal-$(APIVERSION)
%D%/automake-$(APIVERSION).1: $(automake_script) lib/Automake/Config.pm
$(update_mans) automake-$(APIVERSION)
## ---------------------------- ##
## Example package "amhello". ##
## ---------------------------- ##
amhello_sources = \
%D%/amhello/configure.ac \
%D%/amhello/Makefile.am \
%D%/amhello/README \
%D%/amhello/src/main.c \
%D%/amhello/src/Makefile.am
amhello_configury = \
aclocal.m4 \
autom4te.cache \
Makefile.in \
config.h.in \
configure \
depcomp \
install-sh \
missing \
src/Makefile.in
dist_noinst_DATA += $(amhello_sources)
dist_doc_DATA = $(srcdir)/%D%/amhello-1.0.tar.gz
setup_autotools_paths = { \
$(extend_PATH) \
&& ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
&& AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \
&& AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \
&& AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \
&& AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \
&& AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \
&& AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \
&& true; \
}
# We depend on configure.ac so that we regenerate the tarball
# whenever the Automake version changes.
$(srcdir)/%D%/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
$(AM_V_GEN)tmp=amhello-output.tmp \
&& $(am__cd) $(srcdir)/%D%/amhello \
&& : Make our aclocal and automake avaiable before system ones. \
&& $(setup_autotools_paths) \
&& ( \
{ $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \
&& $(am_AUTORECONF) -vfi \
&& ./configure \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck \
&& $(MAKE) $(AM_MAKEFLAGS) distclean \
|| { \
if $(AM_V_P); then :; else \
echo "$@: recipe failed." >&5; \
echo "See file '`pwd`/$$tmp' for details" >&5; \
fi; \
exit 1; \
} \
) \
&& rm -rf $(amhello_configury) $$tmp \
&& mv -f amhello-1.0.tar.gz ..
# vim: ft=automake noet

Binary file not shown.

View File

@ -0,0 +1,6 @@
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
# This Makefile.am is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
SUBDIRS = src
dist_doc_DATA = README

View File

@ -0,0 +1,2 @@
This is a demonstration package for GNU Automake.
Type `info Automake' to read the Automake manual.

View File

@ -0,0 +1,13 @@
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
# This configure.ac script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
AC_INIT([amhello], [1.0], [bug-automake@gnu.org])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT

View File

@ -0,0 +1,6 @@
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
# This Makefile.am is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
bin_PROGRAMS = hello
hello_SOURCES = main.c

View File

@ -0,0 +1,14 @@
/* Copyright (C) 2006-2017 Free Software Foundation, Inc.
This program is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it. */
#include <config.h>
#include <stdio.h>
int
main (void)
{
puts ("Hello World!");
puts ("This is " PACKAGE_STRING ".");
return 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,246 @@
This is automake.info, produced by makeinfo version 6.1 from
automake.texi.
This manual is for GNU Automake (version 1.15.1, 17 June 2017), a
program that creates GNU standards-compliant Makefiles from template
files.
Copyright © 1995-2017 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, with no Front-Cover texts,
and with no Back-Cover Texts. A copy of the license is included in
the section entitled “GNU Free Documentation License.”
INFO-DIR-SECTION Software development
START-INFO-DIR-ENTRY
* Automake: (automake). Making GNU standards-compliant Makefiles.
END-INFO-DIR-ENTRY
INFO-DIR-SECTION Individual utilities
START-INFO-DIR-ENTRY
* aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
* automake-invocation: (automake)automake Invocation. Generating Makefile.in.
END-INFO-DIR-ENTRY

Indirect:
automake.info-1: 1079
automake.info-2: 301288

Tag Table:
(Indirect)
Node: Top1079
Node: Introduction14404
Ref: Introduction-Footnote-115813
Node: Autotools Introduction15972
Node: GNU Build System17353
Node: Use Cases20101
Node: Basic Installation22229
Node: Standard Targets25815
Node: Standard Directory Variables27418
Node: Standard Configuration Variables29275
Node: config.site30634
Node: VPATH Builds32060
Node: Two-Part Install36008
Node: Cross-Compilation38452
Node: Renaming41427
Node: DESTDIR42585
Node: Preparing Distributions44767
Node: Dependency Tracking47138
Node: Nested Packages49246
Node: Why Autotools50762
Node: Hello World52404
Ref: amhello Explained52826
Node: Creating amhello52998
Node: amhello's configure.ac Setup Explained58353
Node: amhello's Makefile.am Setup Explained63273
Node: Generalities66973
Node: General Operation67667
Node: Strictness71090
Node: Uniform72708
Node: Length Limitations77647
Node: Canonicalization79957
Node: User Variables81029
Node: Auxiliary Programs82519
Node: Examples86255
Node: Complete87125
Node: true89230
Node: automake Invocation91721
Ref: Invoking automake91876
Node: configure99471
Node: Requirements100400
Node: Optional105638
Node: aclocal Invocation115040
Ref: Invoking aclocal115201
Node: aclocal Options118256
Node: Macro Search Path121772
Ref: ACLOCAL_PATH126147
Node: Extending aclocal127717
Node: Local Macros131441
Node: Serials135425
Node: Future of aclocal140618
Node: Macros143007
Node: Public Macros143548
Ref: Modernize AM_INIT_AUTOMAKE invocation145179
Node: Obsolete Macros149660
Node: Private Macros151002
Node: Directories152452
Node: Subdirectories154048
Node: Conditional Subdirectories157439
Node: SUBDIRS vs DIST_SUBDIRS159119
Node: Subdirectories with AM_CONDITIONAL160757
Node: Subdirectories with AC_SUBST161951
Node: Unconfigured Subdirectories162778
Node: Alternative166229
Ref: Alternative-Footnote-1168421
Node: Subpackages168546
Node: Programs171893
Node: A Program173435
Node: Program Sources174158
Node: Linking176063
Node: Conditional Sources179708
Node: Conditional Programs182634
Node: A Library184524
Node: A Shared Library187201
Node: Libtool Concept188205
Node: Libtool Libraries190309
Node: Conditional Libtool Libraries192043
Node: Conditional Libtool Sources194500
Node: Libtool Convenience Libraries195887
Node: Libtool Modules199314
Node: Libtool Flags200630
Node: LTLIBOBJS202534
Node: Libtool Issues203169
Node: Error required file ltmain.sh not found203510
Node: Objects created both with libtool and without204731
Node: Program and Library Variables206655
Ref: Program and Library Variables-Footnote-1218031
Node: Default _SOURCES218106
Node: LIBOBJS220578
Node: Program Variables225805
Node: Yacc and Lex229369
Ref: Yacc and Lex-Footnote-1234993
Node: C++ Support235256
Node: Objective C Support236136
Node: Objective C++ Support237109
Node: Unified Parallel C Support238131
Node: Assembly Support239127
Node: Fortran 77 Support240299
Ref: Fortran 77 Support-Footnote-1241984
Node: Preprocessing Fortran 77242187
Node: Compiling Fortran 77 Files242791
Node: Mixing Fortran 77 With C and C++243403
Ref: Mixing Fortran 77 With C and C++-Footnote-1245726
Node: How the Linker is Chosen246033
Node: Fortran 9x Support247571
Node: Compiling Fortran 9x Files248617
Node: Java Support with gcj249253
Node: Vala Support250734
Node: Support for Other Languages252819
Node: Dependencies253527
Node: EXEEXT255414
Node: Other Objects257657
Node: Scripts258249
Node: Headers261108
Node: Data262911
Node: Sources263596
Node: Built Sources Example266541
Node: Other GNU Tools273729
Node: Emacs Lisp274258
Node: gettext276356
Node: Libtool277044
Node: Java277303
Node: Python279962
Node: Documentation285043
Node: Texinfo285347
Node: Man Pages292546
Node: Install295671
Node: Basics of Installation296375
Node: The Two Parts of Install297905
Node: Extending Installation299445
Node: Staged Installs301288
Node: Install Rules for the User302701
Node: Clean303259
Node: Dist305431
Node: Basics of Distribution305935
Node: Fine-grained Distribution Control309166
Node: The dist Hook310093
Node: Checking the Distribution312584
Node: The Types of Distributions318944
Node: Tests321182
Node: Generalities about Testing322378
Node: Simple Tests325313
Node: Scripts-based Testsuites325694
Ref: Testsuite progress on console328079
Ref: Simple tests and color-tests329182
Node: Serial Test Harness333198
Node: Parallel Test Harness335296
Ref: Basics of test metadata335802
Node: Custom Test Drivers344531
Node: Overview of Custom Test Drivers Support344822
Node: Declaring Custom Test Drivers347876
Node: API for Custom Test Drivers349298
Node: Command-line arguments for test drivers350075
Node: Log files generation and test results recording352789
Node: Testsuite progress output357000
Node: Using the TAP test protocol358422
Node: Introduction to TAP358784
Node: Use TAP with the Automake test harness360601
Node: Incompatibilities with other TAP parsers and drivers366017
Node: Links and external resources on TAP367412
Node: DejaGnu Tests369036
Node: Install Tests371161
Node: Rebuilding371471
Node: Options375146
Node: Options generalities375447
Node: List of Automake options377229
Ref: tar-formats383880
Node: Miscellaneous387231
Node: Tags387576
Node: Suffixes390692
Node: Include392324
Node: Conditionals394059
Node: Usage of Conditionals394918
Node: Limits of Conditionals398274
Node: Silencing Make399459
Node: Make verbosity399810
Ref: Make verbosity-Footnote-1401132
Node: Tricks For Silencing Make401206
Node: Automake Silent Rules403723
Node: Gnits410707
Node: Not Enough413186
Node: Extending413633
Node: Third-Party Makefiles418668
Node: Distributing425604
Node: API Versioning426253
Node: Upgrading428962
Node: FAQ431007
Node: CVS432131
Node: maintainer-mode440520
Node: Wildcards444684
Node: Limitations on File Names448123
Node: Errors with distclean450753
Node: Flag Variables Ordering455701
Node: Renamed Objects463532
Node: Per-Object Flags465123
Node: Multiple Outputs468128
Node: Hard-Coded Install Paths480083
Node: Debugging Make Rules485239
Ref: Debugging Make Rules-Footnote-1487396
Node: Reporting Bugs487574
Node: Copying This Manual489519
Node: GNU Free Documentation License489749
Node: Indices515052
Node: Macro Index515341
Node: Variable Index520980
Node: General Index551856

End Tag Table

Local Variables:
coding: utf-8
End:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,506 @@
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000-2017 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
The ``publisher'' means any person or entity that distributes copies
of the Document to the public.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all of these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation. If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.
@item
RELICENSING
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server. A
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
site means any set of copyrightable works thus published on the MMC
site.
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
``Incorporate'' means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is ``eligible for relicensing'' if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
@end enumerate
@page
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:

669
automake-1.15.1/doc/help2man Executable file
View File

@ -0,0 +1,669 @@
#!/usr/bin/perl -w
# Generate a short man page from --help and --version output.
# Copyright (C) 1997-2017 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 3, 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 <http://www.gnu.org/licenses/>.
# Written by Brendan O'Dea <bod@debian.org>
# Available from ftp://ftp.gnu.org/gnu/help2man/
use 5.006;
use strict;
use Getopt::Long;
use Text::Tabs qw(expand);
use POSIX qw(strftime setlocale LC_ALL);
my $this_program = 'help2man';
my $this_version = '1.40.8';
sub _ { $_[0] }
sub configure_locale
{
my $locale = shift;
die "$this_program: no locale support (Locale::gettext required)\n"
unless $locale eq 'C';
}
sub dec { $_[0] }
sub enc { $_[0] }
sub enc_user { $_[0] }
sub kark { die +(sprintf shift, @_), "\n" }
sub N_ { $_[0] }
my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version;
GNU %s %s
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009, 2010,
2011, 2012 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 Brendan O'Dea <bod@debian.org>
EOT
my $help_info = enc_user sprintf _(<<'EOT'), $this_program, $this_program;
`%s' generates a man page out of `--help' and `--version' output.
Usage: %s [OPTION]... EXECUTABLE
-n, --name=STRING description for the NAME paragraph
-s, --section=SECTION section number for manual page (1, 6, 8)
-m, --manual=TEXT name of manual (User Commands, ...)
-S, --source=TEXT source of program (FSF, Debian, ...)
-L, --locale=STRING select locale (default "C")
-i, --include=FILE include material from `FILE'
-I, --opt-include=FILE include material from `FILE' if it exists
-o, --output=FILE send output to `FILE'
-p, --info-page=TEXT name of Texinfo manual
-N, --no-info suppress pointer to Texinfo manual
-l, --libtool exclude the `lt-' from the program name
--help print this help, then exit
--version print version number, then exit
EXECUTABLE should accept `--help' and `--version' options and produce output on
stdout although alternatives may be specified using:
-h, --help-option=STRING help option string
-v, --version-option=STRING version option string
--version-string=STRING version string
--no-discard-stderr include stderr when parsing option output
Report bugs to <bug-help2man@gnu.org>.
EOT
my $section = 1;
my $manual = '';
my $source = '';
my $help_option = '--help';
my $version_option = '--version';
my $discard_stderr = 1;
my ($opt_name, @opt_include, $opt_output, $opt_info, $opt_no_info, $opt_libtool,
$version_text);
my %opt_def = (
'n|name=s' => \$opt_name,
's|section=s' => \$section,
'm|manual=s' => \$manual,
'S|source=s' => \$source,
'L|locale=s' => sub { configure_locale pop },
'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
'o|output=s' => \$opt_output,
'p|info-page=s' => \$opt_info,
'N|no-info' => \$opt_no_info,
'l|libtool' => \$opt_libtool,
'help' => sub { print $help_info; exit },
'version' => sub { print $version_info; exit },
'h|help-option=s' => \$help_option,
'v|version-option=s' => \$version_option,
'version-string=s' => \$version_text,
'discard-stderr!' => \$discard_stderr,
);
# Parse options.
Getopt::Long::config('bundling');
die $help_info unless GetOptions %opt_def and @ARGV == 1;
my %include = ();
my %append = ();
my @include = (); # retain order given in include file
# Process include file (if given). Format is:
#
# [section name]
# verbatim text
#
# or
#
# /pattern/
# verbatim text
#
while (@opt_include)
{
my ($inc, $required) = @{shift @opt_include};
next unless -f $inc or $required;
kark N_("%s: can't open `%s' (%s)"), $this_program, $inc, $!
unless open INC, $inc;
my $key;
my $hash = \%include;
while (<INC>)
{
# Convert input to internal Perl format, so that multibyte
# sequences are treated as single characters.
$_ = dec $_;
# [section]
if (/^\[([^]]+)\]\s*$/)
{
$key = uc $1;
$key =~ s/^\s+//;
$key =~ s/\s+$//;
$hash = \%include;
push @include, $key unless $include{$key};
next;
}
# /pattern/
if (m!^/(.*)/([ims]*)\s*$!)
{
my $pat = $2 ? "(?$2)$1" : $1;
# Check pattern.
eval { $key = qr($pat) };
if ($@)
{
$@ =~ s/ at .*? line \d.*//;
die "$inc:$.:$@";
}
$hash = \%append;
next;
}
# Check for options before the first section--anything else is
# silently ignored, allowing the first for comments and
# revision info.
unless ($key)
{
# handle options
if (/^-/)
{
local @ARGV = split;
GetOptions %opt_def;
}
next;
}
$hash->{$key} ||= '';
$hash->{$key} .= $_;
}
close INC;
kark N_("%s: no valid information found in `%s'"), $this_program, $inc
unless $key;
}
# Compress trailing blank lines.
for my $hash (\(%include, %append))
{
for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ }
}
sub get_option_value;
# Grab help and version info from executable.
my $help_text = get_option_value $ARGV[0], $help_option;
$version_text ||= get_option_value $ARGV[0], $version_option;
# Translators: the following message is a strftime(3) format string, which in
# the English version expands to the month as a word and the full year. It
# is used on the footer of the generated manual pages. If in doubt, you may
# just use %x as the value (which should be the full locale-specific date).
my $date = enc strftime _("%B %Y"), localtime;
(my $program = $ARGV[0]) =~ s!.*/!!;
my $package = $program;
my $version;
if ($opt_output)
{
unlink $opt_output or kark N_("%s: can't unlink %s (%s)"),
$this_program, $opt_output, $! if -e $opt_output;
open STDOUT, ">$opt_output"
or kark N_("%s: can't create %s (%s)"), $this_program, $opt_output, $!;
}
# The first line of the --version information is assumed to be in one
# of the following formats:
#
# <version>
# <program> <version>
# {GNU,Free} <program> <version>
# <program> ({GNU,Free} <package>) <version>
# <program> - {GNU,Free} <package> <version>
#
# and separated from any copyright/author details by a blank line.
($_, $version_text) = ((split /\n+/, $version_text, 2), '');
if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or
/^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
{
$program = $1;
$package = $2;
$version = $3;
}
elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/)
{
$program = $2;
$package = $1 ? "$1$2" : $2;
$version = $3;
}
else
{
$version = $_;
}
$program =~ s!.*/!!;
# No info for `info' itself.
$opt_no_info = 1 if $program eq 'info';
# Translators: "NAME", "SYNOPSIS" and other one or two word strings in all
# upper case are manual page section headings. The man(1) manual page in your
# language, if available should provide the conventional translations.
for ($include{_('NAME')})
{
if ($opt_name) # --name overrides --include contents.
{
$_ = "$program \\- $opt_name\n";
}
elsif ($_) # Use first name given as $program
{
$program = $1 if /^([^\s,]+)(?:,?\s*[^\s,\\-]+)*\s+\\?-/;
}
else # Set a default (useless) NAME paragraph.
{
$_ = sprintf _("%s \\- manual page for %s %s") . "\n", $program,
$program, $version;
}
}
# Man pages traditionally have the page title in caps.
my $PROGRAM = uc $program;
# Set default page head/footers
$source ||= "$program $version";
unless ($manual)
{
for ($section)
{
if (/^(1[Mm]|8)/) { $manual = enc _('System Administration Utilities') }
elsif (/^6/) { $manual = enc _('Games') }
else { $manual = enc _('User Commands') }
}
}
# Extract usage clause(s) [if any] for SYNOPSIS.
# Translators: "Usage" and "or" here are patterns (regular expressions) which
# are used to match the usage synopsis in program output. An example from cp
# (GNU coreutils) which contains both strings:
# Usage: cp [OPTION]... [-T] SOURCE DEST
# or: cp [OPTION]... SOURCE... DIRECTORY
# or: cp [OPTION]... -t DIRECTORY SOURCE...
my $PAT_USAGE = _('Usage');
my $PAT_USAGE_CONT = _('or');
if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CONT): +\S).*)*)//om)
{
my @syn = $3 . $4;
if ($_ = $5)
{
s/^\n//;
for (split /\n/) { s/^ *(($PAT_USAGE_CONT): +)?//o; push @syn, $_ }
}
my $synopsis = '';
for (@syn)
{
$synopsis .= ".br\n" if $synopsis;
s!^\S*/!!;
s/^lt-// if $opt_libtool;
s/^(\S+) *//;
$synopsis .= ".B $1\n";
s/\s+$//;
s/(([][]|\.\.+)+)/\\fR$1\\fI/g;
s/^/\\fI/ unless s/^\\fR//;
$_ .= '\fR';
s/(\\fI)( *)/$2$1/g;
s/\\fI\\fR//g;
s/^\\fR//;
s/\\fI$//;
s/^\./\\&./;
$synopsis .= "$_\n";
}
$include{_('SYNOPSIS')} ||= $synopsis;
}
# Process text, initial section is DESCRIPTION.
my $sect = _('DESCRIPTION');
$_ = "$help_text\n\n$version_text";
# Normalise paragraph breaks.
s/^\n+//;
s/\n*$/\n/;
s/\n\n+/\n\n/g;
# Join hyphenated lines.
s/([A-Za-z])-\n *([A-Za-z])/$1$2/g;
# Temporarily exchange leading dots, apostrophes and backslashes for
# tokens.
s/^\./\x80/mg;
s/^'/\x81/mg;
s/\\/\x82/g;
# Translators: patterns are used to match common program output. In the source
# these strings are all of the form of "my $PAT_something = _('...');" and are
# regular expressions. If there is more than one commonly used string, you
# may separate alternatives with "|". Spaces in these expressions are written
# as " +" to indicate that more than one space may be matched. The string
# "(?:[\\w-]+ +)?" in the bug reporting pattern is used to indicate an
# optional word, so that either "Report bugs" or "Report _program_ bugs" will
# be matched.
my $PAT_BUGS = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to');
my $PAT_AUTHOR = _('Written +by');
my $PAT_OPTIONS = _('Options');
my $PAT_ENVIRONMENT = _('Environment');
my $PAT_FILES = _('Files');
my $PAT_EXAMPLES = _('Examples');
my $PAT_FREE_SOFTWARE = _('This +is +free +software');
# Start a new paragraph (if required) for these.
s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
# Convert iso-8859-1 copyright symbol or (c) to nroff
# character.
s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg;
sub convert_option;
while (length)
{
# Convert some standard paragraph names.
if (s/^($PAT_OPTIONS): *\n//o)
{
$sect = _('OPTIONS');
next;
}
if (s/^($PAT_ENVIRONMENT): *\n//o)
{
$sect = _('ENVIRONMENT');
next;
}
if (s/^($PAT_FILES): *\n//o)
{
$sect = _('FILES');
next;
}
elsif (s/^($PAT_EXAMPLES): *\n//o)
{
$sect = _('EXAMPLES');
next;
}
# Copyright section
if (/^Copyright /)
{
$sect = _('COPYRIGHT');
}
# Bug reporting section.
elsif (/^($PAT_BUGS) /o)
{
$sect = _('REPORTING BUGS');
}
# Author section.
elsif (/^($PAT_AUTHOR)/o)
{
$sect = _('AUTHOR');
}
# Examples, indicated by an indented leading $, % or > are
# rendered in a constant width font.
if (/^( +)([\$\%>] )\S/)
{
my $indent = $1;
my $prefix = $2;
my $break = '.IP';
$include{$sect} ||= '';
while (s/^$indent\Q$prefix\E(\S.*)\n*//)
{
$include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n";
$break = '.br';
}
next;
}
my $matched = '';
$include{$sect} ||= '';
# Sub-sections have a trailing colon and the second line indented.
if (s/^(\S.*:) *\n / /)
{
$matched .= $& if %append;
$include{$sect} .= qq(.SS "$1"\n);
}
my $indent = 0;
my $content = '';
# Option with description.
if (s/^( {1,10}([+-]\S.*?))(?:( +(?!-))|\n( {20,}))(\S.*)\n//)
{
$matched .= $& if %append;
$indent = length ($4 || "$1$3");
$content = ".TP\n\x84$2\n\x84$5\n";
unless ($4)
{
# Indent may be different on second line.
$indent = length $& if /^ {20,}/;
}
}
# Option without description.
elsif (s/^ {1,10}([+-]\S.*)\n//)
{
$matched .= $& if %append;
$content = ".HP\n\x84$1\n";
$indent = 80; # not continued
}
# Indented paragraph with tag.
elsif (s/^( +(\S.*?) +)(\S.*)\n//)
{
$matched .= $& if %append;
$indent = length $1;
$content = ".TP\n\x84$2\n\x84$3\n";
}
# Indented paragraph.
elsif (s/^( +)(\S.*)\n//)
{
$matched .= $& if %append;
$indent = length $1;
$content = ".IP\n\x84$2\n";
}
# Left justified paragraph.
else
{
s/(.*)\n//;
$matched .= $& if %append;
$content = ".PP\n" if $include{$sect};
$content .= "$1\n";
}
# Append continuations.
while ($indent ? s/^ {$indent}(\S.*)\n// : s/^(\S.*)\n//)
{
$matched .= $& if %append;
$content .= "\x84$1\n";
}
# Move to next paragraph.
s/^\n+//;
for ($content)
{
# Leading dot and apostrophe protection.
s/\x84\./\x80/g;
s/\x84'/\x81/g;
s/\x84//g;
# Convert options.
s/(^| |\()(-[][\w=-]+)/$1 . convert_option $2/mge;
# Escape remaining hyphens
s/-/\x83/g;
if ($sect eq 'COPYRIGHT')
{
# Insert line breaks before additional copyright messages
# and the disclaimer.
s/\n(Copyright |$PAT_FREE_SOFTWARE)/\n.br\n$1/og;
}
elsif ($sect eq 'REPORTING BUGS')
{
# Handle multi-line bug reporting sections of the form:
#
# Report <program> bugs to <addr>
# GNU <package> home page: <url>
# ...
s/\n([[:upper:]])/\n.br\n$1/g;
}
}
# Check if matched paragraph contains /pat/.
if (%append)
{
for my $pat (keys %append)
{
if ($matched =~ $pat)
{
$content .= ".PP\n" unless $append{$pat} =~ /^\./;
$content .= $append{$pat};
}
}
}
$include{$sect} .= $content;
}
# Refer to the real documentation.
unless ($opt_no_info)
{
my $info_page = $opt_info || $program;
$sect = _('SEE ALSO');
$include{$sect} ||= '';
$include{$sect} .= ".PP\n" if $include{$sect};
$include{$sect} .= sprintf _(<<'EOT'), $program, $program, $info_page;
The full documentation for
.B %s
is maintained as a Texinfo manual. If the
.B info
and
.B %s
programs are properly installed at your site, the command
.IP
.B info %s
.PP
should give you access to the complete manual.
EOT
}
# Output header.
print <<EOT;
.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
.TH $PROGRAM "$section" "$date" "$source" "$manual"
EOT
# Section ordering.
my @pre = (_('NAME'), _('SYNOPSIS'), _('DESCRIPTION'), _('OPTIONS'),
_('ENVIRONMENT'), _('FILES'), _('EXAMPLES'));
my @post = (_('AUTHOR'), _('REPORTING BUGS'), _('COPYRIGHT'), _('SEE ALSO'));
my $filter = join '|', @pre, @post;
# Output content.
for my $sect (@pre, (grep ! /^($filter)$/o, @include), @post)
{
if ($include{$sect})
{
my $quote = $sect =~ /\W/ ? '"' : '';
print enc ".SH $quote$sect$quote\n";
for ($include{$sect})
{
# Replace leading dot, apostrophe, backslash and hyphen
# tokens.
s/\x80/\\&./g;
s/\x81/\\&'/g;
s/\x82/\\e/g;
s/\x83/\\-/g;
# Convert some latin1 chars to troff equivalents
s/\xa0/\\ /g; # non-breaking space
print enc $_;
}
}
}
close STDOUT or kark N_("%s: error writing to %s (%s)"), $this_program,
$opt_output || 'stdout', $!;
exit;
# Call program with given option and return results.
sub get_option_value
{
my ($prog, $opt) = @_;
my $stderr = $discard_stderr ? '/dev/null' : '&1';
my $value = join '',
map { s/ +$//; expand $_ }
map { dec $_ }
`$prog $opt 2>$stderr`;
unless ($value)
{
my $err = N_("%s: can't get `%s' info from %s%s");
my $extra = $discard_stderr
? "\n" . N_("Try `--no-discard-stderr' if option outputs to stderr")
: '';
kark $err, $this_program, $opt, $prog, $extra;
}
return $value;
}
# Convert option dashes to \- to stop nroff from hyphenating 'em, and
# embolden. Option arguments get italicised.
sub convert_option
{
local $_ = '\fB' . shift;
s/-/\x83/g;
unless (s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/)
{
s/=(.)/\\fR=\\fI$1/;
s/ (.)/ \\fI$1/;
$_ .= '\fR';
}
$_;
}

View File

@ -0,0 +1,4 @@
@set UPDATED 17 June 2017
@set UPDATED-MONTH June 2017
@set EDITION 1.15.1
@set VERSION 1.15.1

View File

@ -0,0 +1,4 @@
@set UPDATED 17 June 2017
@set UPDATED-MONTH June 2017
@set EDITION 1.15.1
@set VERSION 1.15.1

View File

@ -0,0 +1,420 @@
#! /usr/bin/env perl
# Automatically compute some dependencies for the hand-written tests
# of the Automake testsuite. Also, automatically generate some more
# tests from them (for particular cases/setups only).
# Copyright (C) 2011-2017 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 <http://www.gnu.org/licenses/>.
#--------------------------------------------------------------------------
use warnings FATAL => "all";
use strict;
use File::Basename ();
use constant TRUE => 1;
use constant FALSE => 0;
my $me = File::Basename::basename $0;
# For use in VPATH builds.
my $srcdir = ".";
# The testsuite subdirectory, relative to the top-lever source directory.
my $testdir = "t";
# Where testsuite-related helper scripts, data files and shell libraries
# are placed. Relative to the top-lever source directory.
my $testauxdir = "$testdir/ax";
#--------------------------------------------------------------------------
sub unindent ($)
{
my $text = shift;
$text =~ /^(\s*)/;
my $indentation = $1;
$text =~ s/^$indentation//gm;
return $text;
}
sub atomic_write ($$;$)
{
my ($outfile, $func) = (shift, shift);
my $perms = @_ > 0 ? shift : 0777;
my $tmpfile = "$outfile-t";
foreach my $f ($outfile, $tmpfile)
{
unlink $f or die "$me: cannot unlink '$f': $!\n"
if -e $f;
}
open (my $fh, ">$tmpfile")
or die "$me: can't write to '$tmpfile': $!\n";
$func->($fh);
close $fh
or die "$me: closing '$tmpfile': $!\n";
chmod ($perms & ~umask, $tmpfile)
or die "$me: cannot change perms for '$tmpfile': $!\n";
rename ($tmpfile, $outfile)
or die "$me: renaming '$tmpfile' -> '$outfile: $!\n'";
}
sub line_match ($$)
{
my ($re, $file) = (shift, shift);
# Try both builddir and srcdir, with builddir first, to play nice
# with VPATH builds.
open (FH, "<$file") or open (FH, "<$srcdir/$file")
or die "$me: cannot open file '$file': $!\n";
my $ret = 0;
while (defined (my $line = <FH>))
{
if ($line =~ $re)
{
$ret = 1;
last;
}
}
close FH or die "$me: cannot close file '$file': $!\n";
return $ret;
}
sub write_wrapper_script ($$$)
{
my ($file_handle, $wrapped_test, $shell_setup_code, $creator_name) = @_;
print $file_handle unindent <<EOF;
#! /bin/sh
# This file has been automatically generated. DO NOT EDIT BY HAND!
. test-lib.sh
$shell_setup_code
# In the spirit of VPATH, we prefer a test in the build tree
# over one in the source tree.
for dir in . "\$am_top_srcdir"; do
if test -f "\$dir/$wrapped_test"; then
echo "\$0: will source \$dir/$wrapped_test"
. "\$dir/$wrapped_test"; exit \$?
fi
done
echo "\$0: cannot find wrapped test '$wrapped_test'" >&2
exit 99
EOF
}
sub get_list_of_tests ()
{
my $make = defined $ENV{MAKE} ? $ENV{MAKE} : "make";
# Unset MAKEFLAGS, for when we are called from make itself.
my $cmd = "MAKEFLAGS= && unset MAKEFLAGS && cd '$srcdir' && "
. "$make -s -f $testdir/list-of-tests.mk print-list-of-tests";
my @tests_list = split /\s+/, `$cmd`;
die "$me: cannot get list of tests\n" unless $? == 0 && @tests_list;
my $ok = 1;
foreach my $test (@tests_list)
{
# Respect VPATH builds.
next if -f $test || -f "$srcdir/$test";
warn "$me: test '$test' not found\n";
$ok = 0;
}
die "$me: some test scripts not found\n" if !$ok;
return @tests_list;
}
sub parse_options (@)
{
use Getopt::Long qw/GetOptions/;
local @ARGV = @_;
GetOptions ('srcdir=s' => \$srcdir) or die "$me: usage error\n";
die "$me: too many arguments\n" if @ARGV > 0;
die "$me: srcdir '$srcdir': not a directory\n" unless -d $srcdir;
}
#--------------------------------------------------------------------------
my %deps_extractor =
(
libtool_macros =>
{
line_matcher => qr/^\s*required=.*\blibtool/,
nodist_prereqs => "$testdir/libtool-macros.log",
},
gettext_macros =>
{
line_matcher => qr/^\s*required=.*\bgettext/,
nodist_prereqs => "$testdir/gettext-macros.log",
},
pkgconfig_macros =>
{
line_matcher => qr/^\s*required=.*\bpkg-config/,
nodist_prereqs => "$testdir/pkg-config-macros.log",
},
use_trivial_test_driver =>
{
line_matcher => qr/\btrivial-test-driver\b/,
dist_prereqs => "$testauxdir/trivial-test-driver",
},
check_testsuite_summary =>
{
line_matcher => qr/\btestsuite-summary-checks\.sh\b/,
dist_prereqs => "$testauxdir/testsuite-summary-checks.sh",
},
extract_testsuite_summary =>
{
line_matcher => qr/\bextract-testsuite-summary\.pl\b/,
dist_prereqs => "$testauxdir/extract-testsuite-summary.pl",
},
check_tap_testsuite_summary =>
{
line_matcher => qr/\btap-summary-aux\.sh\b/,
dist_prereqs => "$testauxdir/tap-summary-aux.sh",
},
on_tap_with_common_setup =>
{
line_matcher => qr/\btap-setup\.sh\b/,
dist_prereqs => "$testauxdir/tap-setup.sh",
nodist_prereqs => "$testdir/tap-common-setup.log",
},
depcomp =>
{
line_matcher => qr/\bdepcomp\.sh\b/,
dist_prereqs => "$testauxdir/depcomp.sh",
},
);
#--------------------------------------------------------------------------
my %test_generators =
(
#
# Any test script in the Automake testsuite that checks features of
# the Automake-provided parallel testsuite harness might want to
# define a sibling test that does similar checks, but for the old
# serial testsuite harness instead.
#
# Individual tests can request the creation of such a sibling by
# making the string "try-with-serial-tests" appear any line of the
# test itself.
#
serial_testsuite_harness =>
{
line_matcher => qr/\btry-with-serial-tests\b/,
shell_setup_code => 'am_serial_tests=yes',
},
#
# For each test script in the Automake testsuite that tests features
# of one or more automake-provided shell script from the 'lib/'
# subdirectory by running those scripts directly (i.e., not thought
# make calls and automake-generated makefiles), define a sibling test
# that does likewise, but running the said script with the configure
# time $SHELL instead of the default system shell /bin/sh.
#
# A test is considered a candidate for sibling-generation if it calls
# the 'get_shell_script' function anywhere.
#
# Individual tests can prevent the creation of such a sibling by
# explicitly setting the '$am_test_prefer_config_shell' variable
# to either "yes" or "no".
# The rationale for this is that if the variable is set to "yes",
# the test already uses $SHELL, so that a sibling would be just a
# duplicate; while if the variable is set to "no", the test doesn't
# support, or is not meant to use, $SHELL to run the script under
# testing, and forcing it to do so in the sibling would likely
# cause a spurious failure.
#
prefer_config_shell =>
{
line_matcher =>
qr/(^|\s)get_shell_script\s/,
line_rejecter =>
qr/\bam_test_prefer_config_shell=/,
shell_setup_code =>
'am_test_prefer_config_shell=yes',
},
);
#--------------------------------------------------------------------------
parse_options @ARGV;
my @all_tests = get_list_of_tests;
my @generated_tests = (); # Will be updated later.
print "## -*- Makefile -*-\n";
print "## Generated by $me. DO NOT EDIT BY HAND!\n\n";
print <<EOF;
## --------------------------------------------- ##
## Autogenerated tests and their dependencies. ##
## --------------------------------------------- ##
EOF
# A test script '$test' can possibly match more than one condition, so
# for each tests we need to keep a list of generated wrapper tests.
# Since what defines these wrapper scripts is the set of initializations
# that are issued before sourcing the original, wrapped tests, these
# initializations is what we put in our list entries.
# The list will be saved in the hash entry '$wrapper_setups{$test}'.
my %wrapper_setups = ();
foreach my $test (@all_tests)
{
my @setups = ('');
foreach my $x (values %test_generators)
{
next
if not line_match $x->{line_matcher}, $test;
next
if $x->{line_rejecter} and line_match $x->{line_rejecter}, $test;
@setups = map { ($_, "$_\n$x->{shell_setup_code}") } @setups;
}
@setups = grep { $_ ne '' } @setups;
$wrapper_setups{$test} = \@setups if @setups;
}
# And now create all the wrapper tests.
for my $wrapped_test (sort keys %wrapper_setups)
{
my $setup_list = $wrapper_setups{$wrapped_test};
(my $base = $wrapped_test) =~ s/\.([^.]*)$//;
my $suf = $1 or die "$me: test '$wrapped_test' lacks a suffix\n";
my $count = 0;
foreach my $setup (@$setup_list)
{
$count++;
my $wbase = "$base-w" . ($count > 1 ? $count : '');
my $wrapper_test = "$wbase.$suf";
# Register wrapper test as "autogenerated".
push @generated_tests, $wrapper_test;
# Create wrapper test.
atomic_write $wrapper_test,
sub { write_wrapper_script $_[0], $wrapped_test,
$setup },
0444;
# The generated test works by sourcing the original test, so that
# it has to be re-run every time that changes ...
print "$wbase.log: $wrapped_test\n";
# ... but also every time the prerequisites of the wrapped test
# changes. The simpler (although suboptimal) way to do so is to
# ensure that the wrapped tests runs before the wrapper one (in
# case it needs to be re-run *at all*).
# FIXME: we could maybe refactor the script to find a more
# granular way to express such implicit dependencies.
print "$wbase.log: $base.log\n";
}
}
print <<EOF;
## ---------------------------------------------------- ##
## Ad-hoc autogenerated tests and their dependencies. ##
## ---------------------------------------------------- ##
EOF
print "## Tests on automatic dependency tracking (see 'depcomp.sh').\n";
# Key: depmode, value: list of required programs.
my %depmodes =
(
auto => ["cc"],
disabled => ["cc"],
makedepend => ["cc", "makedepend", "-c-o"],
dashmstdout => ["gcc"],
cpp => ["gcc"],
# This was for older (pre-3.x) GCC versions (newer versions
# have depmode "gcc3"). But other compilers use this depmode
# as well (for example, the IMB xlc/xlC compilers, and the HP
# C compiler, see 'lib/depcomp' for more info), so it's not
# obsolete, and it's worth giving it some coverage.
gcc => ["gcc"],
# This is for older (pre-7) msvc versions. Newer versions
# have depmodes "msvc7" and "msvc7msys".
msvisualcpp => ["cl", "cygpath"],
msvcmsys => ["cl", "mingw"],
);
foreach my $lt (TRUE, FALSE)
{
foreach my $m (sort keys %depmodes)
{
my $planned = ($lt && $m eq "auto") ? 84 : 28;
my @required =
(
@{$depmodes{$m}},
$lt ? ("libtoolize",) : (),
);
my @vars_init =
(
"am_create_testdir=empty",
"depmode=$m",
"depcomp_with_libtool=" . ($lt ? "yes" : "no"),
);
my $test = "$testdir/depcomp" . ($lt ? "-lt-" : "-") . "$m.tap";
# Register wrapper test as "autogenerated" ...
push @generated_tests, $test;
# ... and create it.
atomic_write ($test, sub
{
my $file_handle = shift;
print $file_handle unindent <<EOF;
#! /bin/sh
# Automatically generated test. DO NOT EDIT BY HAND!
@vars_init
required="@required"
. test-init.sh
plan_ $planned
. depcomp.sh
exit \$?
EOF
},
0444);
}
}
# Update generated makefile fragment to account for all the generated tests.
print "generated_TESTS =\n";
map { print "generated_TESTS += $_\n" } @generated_tests;
# The test scripts are scanned for automatic dependency generation *after*
# the generated tests have been created, so they too can be scanned. To
# do so correctly, we need to update the list in '@all_tests' to make it
# comprise also the freshly-generated tests.
push @all_tests, @generated_tests;
print <<EOF;
## ----------------------------- ##
## Autogenerated dependencies. ##
## ----------------------------- ##
EOF
for my $k (sort keys %deps_extractor)
{
my $x = $deps_extractor{$k};
my $dist_prereqs = $x->{dist_prereqs} || "";
my $nodist_prereqs = $x->{nodist_prereqs} || "";
my @tests = grep { line_match $x->{line_matcher}, $_ } @all_tests;
map { s/\.[^.]*$//; s/$/\.log/; } (my @logs = @tests);
print "## Added by deps-extracting key '$k'.\n";
## The list of all tests which have a dependency detected by the
## current key.
print join(" \\\n ", "${k}_TESTS =", @tests) . "\n";
print "EXTRA_DIST += $dist_prereqs\n";
map { print "$_: $dist_prereqs $nodist_prereqs\n" } @logs;
print "\n";
}
__END__

View File

@ -0,0 +1,444 @@
# Copyright (C) 2002-2017 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 <http://www.gnu.org/licenses/>.
package Automake::ChannelDefs;
use Automake::Config;
BEGIN
{
if ($perl_threads)
{
require threads;
import threads;
}
}
use Automake::Channels;
=head1 NAME
Automake::ChannelDefs - channel definitions for Automake and helper functions
=head1 SYNOPSIS
use Automake::ChannelDefs;
Automake::ChannelDefs::usage ();
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);
Automake::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<msg()>). It also defines
some helper function to enable or disable these channels, and some
shorthand function to output on specific channels.
=cut
use 5.006;
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<Automake::Channel::msg>. For some of them we list a shorthand
function that makes the code more readable.
=over 4
=item C<fatal>
Fatal errors. Use C<&fatal> to send messages over this channel.
=item C<error>
Common errors. Use C<&error> to send messages over this channel.
=item C<error-gnu>
Errors related to GNU Standards.
=item C<error-gnu/warn>
Errors related to GNU Standards that should be warnings in 'foreign' mode.
=item C<error-gnits>
Errors related to GNITS Standards (silent by default).
=item C<automake>
Internal errors. Use C<&prog_error> to send messages over this channel.
=item C<gnu>
Warnings related to GNU Coding Standards.
=item C<obsolete>
Warnings about obsolete features (silent by default).
=item C<override>
Warnings about user redefinitions of Automake rules or
variables (silent by default).
=item C<portability>
Warnings about non-portable constructs.
=item C<extra-portability>
Extra warnings about non-portable constructs covering obscure tools.
=item C<syntax>
Warnings about weird syntax, unused variables, typos...
=item C<unsupported>
Warnings about unsupported (or mis-supported) features.
=item C<verb>
Messages output in C<--verbose> mode. Use C<&verb> to send such messages.
=item C<note>
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', uniq_part => UP_NONE, ordered => 0;
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 <$PACKAGE_BUGREPORT>.",
uniq_part => UP_NONE, ordered => 0;
register_channel 'extra-portability', type => 'warning', silent => 1;
register_channel 'gnu', type => 'warning';
register_channel 'obsolete', type => 'warning';
register_channel 'override', type => 'warning', silent => 1;
register_channel 'portability', type => 'warning', silent => 1;
register_channel 'portability-recursive', type => 'warning', silent => 1;
register_channel 'syntax', type => 'warning';
register_channel 'unsupported', type => 'warning';
register_channel 'verb', type => 'debug', silent => 1, uniq_part => UP_NONE,
ordered => 0;
register_channel 'note', type => 'debug', silent => 0;
setup_channel_type 'warning', header => 'warning: ';
setup_channel_type 'error', header => 'error: ';
setup_channel_type 'fatal', header => 'error: ';
=head2 FUNCTIONS
=over 4
=item C<usage ()>
Display warning categories.
=cut
sub usage ()
{
print <<EOF;
Warning categories include:
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)
extra-portability extra portability issues related to obscure tools
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
EOF
}
=item C<prog_error ($MESSAGE, [%OPTIONS])>
Signal a programming error (on channel C<automake>),
display C<$MESSAGE>, and exit 1.
=cut
sub prog_error ($;%)
{
my ($msg, %opts) = @_;
msg 'automake', '', $msg, %opts;
}
=item C<error ($WHERE, $MESSAGE, [%OPTIONS])>
=item C<error ($MESSAGE)>
Uncategorized errors.
=cut
sub error ($;$%)
{
my ($where, $msg, %opts) = @_;
msg ('error', $where, $msg, %opts);
}
=item C<fatal ($WHERE, $MESSAGE, [%OPTIONS])>
=item C<fatal ($MESSAGE)>
Fatal errors.
=cut
sub fatal ($;$%)
{
my ($where, $msg, %opts) = @_;
msg ('fatal', $where, $msg, %opts);
}
=item C<verb ($MESSAGE, [%OPTIONS])>
C<--verbose> messages.
=cut
sub verb ($;%)
{
my ($msg, %opts) = @_;
$msg = "thread " . threads->tid . ": " . $msg
if $perl_threads;
msg 'verb', '', $msg, %opts;
}
=item C<switch_warning ($CATEGORY)>
If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>.
If it's C<no-mumble>, turn C<mumble> off.
Else handle C<all> and C<none> 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;
#
# Handling of portability warnings is trickier. For relevant tests,
# see 'dollarvar2', 'extra-portability' and 'extra-portability3'.
#
# -Wportability-recursive and -Wno-portability-recursive should not
# have any effect on other 'portability' or 'extra-portability'
# warnings, so there's no need to handle them separately or ad-hoc.
#
if ($cat eq 'extra-portability' && ! $has_no) # -Wextra-portability
{
# -Wextra-portability must enable 'portability' and
# 'portability-recursive' warnings.
setup_channel 'portability', silent => 0;
setup_channel 'portability-recursive', silent => 0;
}
if ($cat eq 'portability') # -Wportability or -Wno-portability
{
if ($has_no) # -Wno-portability
{
# -Wno-portability must disable 'extra-portability' and
# 'portability-recursive' warnings.
setup_channel 'portability-recursive', silent => 1;
setup_channel 'extra-portability', silent => 1;
}
else # -Wportability
{
# -Wportability must enable 'portability-recursive'
# warnings. But it should have no influence over the
# 'extra-portability' warnings.
setup_channel 'portability-recursive', silent => 0;
}
}
}
else
{
return 1;
}
return 0;
}
=item C<parse_WARNINGS ()>
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_warnings ($OPTION, $ARGUMENT)>
Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>.
C<$OPTIONS> is C<"--warning"> or C<"-W">, C<$ARGUMENT> is C<CATEGORY>.
This is meant to be used as an argument to C<Getopt>.
=cut
sub parse_warnings ($$)
{
my ($opt, $categories) = @_;
foreach my $cat (split (',', $categories))
{
msg 'unsupported', "unknown warning category '$cat'"
if switch_warning $cat;
}
}
=item C<set_strictness ($STRICTNESS_NAME)>
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 'extra-portability', silent => 1;
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 'extra-portability', silent => 1;
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 'extra-portability', silent => 1;
setup_channel 'gnu', silent => 1;
}
else
{
prog_error "level '$name' not recognized";
}
}
=back
=head1 SEE ALSO
L<Automake::Channels>
=head1 HISTORY
Written by Alexandre Duret-Lutz E<lt>F<adl@gnu.org>E<gt>.
=cut
1;
### 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:

View File

@ -0,0 +1,836 @@
# Copyright (C) 2002-2017 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 <http://www.gnu.org/licenses/>.
###############################################################
# The main copy of this file is in Automake's git repository. #
# Updates should be sent to automake-patches@gnu.org. #
###############################################################
package Automake::Channels;
=head1 NAME
Automake::Channels - support functions for error and warning management
=head1 SYNOPSIS
use Automake::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;
# Redirect all channels to push messages on a Thread::Queue using
# the specified serialization key.
setup_channel_queue $queue, $key;
# Output a message pending in a Thread::Queue.
pop_channel_queue $queue;
# 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.006;
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
&register_channel &msg &exists_channel &channel_type
&setup_channel &setup_channel_type
&dup_channel_setup &drop_channel_setup
&buffer_messages &flush_messages
&setup_channel_queue &pop_channel_queue
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<exit_code> options of C<fatal> and C<error> 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<UP_NONE>, C<UP_TEXT>, C<UP_LOC_TEXT>
Possible values for the C<uniq_part> options. This selects the part
of the message that should be considered when filtering out duplicates.
If C<UP_LOC_TEXT> is used, the location and the explanation message
are used for filtering. If C<UP_TEXT> is used, only the explanation
message is used (so the same message will be filtered out if it appears
at different locations). C<UP_NONE> 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<US_LOCAL>, C<US_GLOBAL>
Possible values for the C<uniq_scope> options.
Use C<US_GLOBAL> for error messages that should be printed only
once during the execution of the program, C<US_LOCAL> for message that
should be printed only once per file. (Actually, C<Channels> does not
do this now when files are changed, it relies on you calling
C<reset_local_duplicates> 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<register_channel>, C<setup_channel>, and C<msg>
functions. The possible keys, with their default value are:
=over
=item C<type =E<gt> '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 are treated as errors if
C<$warnings_are_errors> is set.
=item C<exit_code =E<gt> 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 C<$warnings_are_errors> is set.
=item C<file =E<gt> \*STDERR>
The file where the error should be output.
=item C<silent =E<gt> 0>
Whether the channel should be silent. Use this do disable a
category of warning, for instance.
=item C<ordered =E<gt> 1>
Whether, with multi-threaded execution, the message should be queued
for ordered output.
=item C<uniq_part =E<gt> UP_LOC_TEXT>
The part of the message subject to duplicate filtering. See the
documentation for the C<UP_NONE>, C<UP_TEXT>, and C<UP_LOC_TEXT>
constants above.
C<uniq_part> can also be set to an arbitrary string that will be used
instead of the message when considering duplicates.
=item C<uniq_scope =E<gt> US_LOCAL>
The scope of duplicate filtering. See the documentation for the
C<US_LOCAL>, and C<US_GLOBAL> constants above.
=item C<header =E<gt> ''>
A string to prepend to each message emitted through this channel.
With partial messages, only the first part will have C<header>
prepended.
=item C<footer =E<gt> ''>
A string to append to each message emitted through this channel.
With partial messages, only the final part will have C<footer>
appended.
=item C<backtrace =E<gt> 0>
Die with a stack backtrace after displaying the message.
=item C<partial =E<gt> 0>
When set, indicates a partial message that should
be output along with the next message with C<partial> unset.
Several partial messages can be stacked this way.
Duplicate filtering will apply to the I<global> message resulting from
all I<partial> messages, using the options from the last (non-partial)
message. Linking associated messages is the main reason to use this
option.
For instance the following messages
msg 'channel', 'foo:2', 'redefinition of A ...';
msg 'channel', 'foo:1', '... A previously defined here';
msg 'channel', 'foo:3', 'redefinition of A ...';
msg 'channel', 'foo:1', '... A previously defined here';
will result in
foo:2: redefinition of A ...
foo:1: ... A previously defined here
foo:3: redefinition of A ...
where the duplicate "I<... A previously defined here>" has been
filtered out.
Linking these messages using C<partial> as follows will prevent the
fourth message to disappear.
msg 'channel', 'foo:2', 'redefinition of A ...', partial => 1;
msg 'channel', 'foo:1', '... A previously defined here';
msg 'channel', 'foo:3', 'redefinition of A ...', partial => 1;
msg 'channel', 'foo:1', '... A previously defined here';
Note that because the stack of C<partial> messages is printed with the
first non-C<partial> message, most options of C<partial> messages will
be ignored.
=back
=cut
use vars qw (%_default_options %_global_duplicate_messages
%_local_duplicate_messages);
# Default options for a channel.
%_default_options =
(
type => 'warning',
exit_code => 1,
file => \*STDERR,
silent => 0,
ordered => 1,
queue => 0,
queue_key => undef,
uniq_scope => US_LOCAL,
uniq_part => UP_LOC_TEXT,
header => '',
footer => '',
backtrace => 0,
partial => 0,
);
# Filled with output messages as keys, to detect duplicates.
# The value associated with each key is the number of occurrences
# filtered out.
%_local_duplicate_messages = ();
%_global_duplicate_messages = ();
sub _reset_duplicates (\%)
{
my ($ref) = @_;
my $dup = 0;
foreach my $k (keys %$ref)
{
$dup += $ref->{$k};
}
%$ref = ();
return $dup;
}
=head2 Functions
=over 4
=item C<reset_local_duplicates ()>
Reset local duplicate messages (see C<US_LOCAL>), and
return the number of messages that have been filtered out.
=cut
sub reset_local_duplicates ()
{
return _reset_duplicates %_local_duplicate_messages;
}
=item C<reset_global_duplicates ()>
Reset local duplicate messages (see C<US_GLOBAL>), and
return the number of messages that have been filtered out.
=cut
sub reset_global_duplicates ()
{
return _reset_duplicates %_global_duplicate_messages;
}
sub _merge_options (\%%)
{
my ($hash, %options) = @_;
local $_;
foreach (keys %options)
{
if (exists $hash->{$_})
{
$hash->{$_} = $options{$_}
}
else
{
confess "unknown option '$_'";
}
}
if ($hash->{'ordered'})
{
confess "fatal messages cannot be ordered"
if $hash->{'type'} eq 'fatal';
confess "backtrace cannot be output on ordered messages"
if $hash->{'backtrace'};
}
}
=item C<register_channel ($name, [%options])>
Declare channel C<$name>, and override the default options
with those listed in C<%options>.
=cut
sub register_channel ($;%)
{
my ($name, %options) = @_;
my %channel_opts = %_default_options;
_merge_options %channel_opts, %options;
$channels{$name} = \%channel_opts;
}
=item C<exists_channel ($name)>
Returns true iff channel C<$name> has been registered.
=cut
sub exists_channel ($)
{
my ($name) = @_;
return exists $channels{$name};
}
=item C<channel_type ($name)>
Returns the type of channel C<$name> if it has been registered.
Returns the empty string otherwise.
=cut
sub channel_type ($)
{
my ($name) = @_;
return $channels{$name}{'type'} if exists_channel $name;
return '';
}
# _format_sub_message ($LEADER, $MESSAGE)
# ---------------------------------------
# Split $MESSAGE at new lines and add $LEADER to each line.
sub _format_sub_message ($$)
{
my ($leader, $message) = @_;
return $leader . join ("\n" . $leader, split ("\n", $message)) . "\n";
}
# Store partial messages here. (See the 'partial' option.)
use vars qw ($partial);
$partial = '';
# _format_message ($LOCATION, $MESSAGE, %OPTIONS)
# -----------------------------------------------
# Format the message. Return a string ready to print.
sub _format_message ($$%)
{
my ($location, $message, %opts) = @_;
my $msg = ($partial eq '' ? $opts{'header'} : '') . $message
. ($opts{'partial'} ? '' : $opts{'footer'});
if (ref $location)
{
# If $LOCATION is a reference, assume it's an instance of the
# Automake::Location class and display contexts.
my $loc = $location->get || $me;
$msg = _format_sub_message ("$loc: ", $msg);
for my $pair ($location->get_contexts)
{
$msg .= _format_sub_message ($pair->[0] . ": ", $pair->[1]);
}
}
else
{
$location ||= $me;
$msg = _format_sub_message ("$location: ", $msg);
}
return $msg;
}
# _enqueue ($QUEUE, $KEY, $UNIQ_SCOPE, $TO_FILTER, $MSG, $FILE)
# -------------------------------------------------------------
# Push message on a queue, to be processed by another thread.
sub _enqueue ($$$$$$)
{
my ($queue, $key, $uniq_scope, $to_filter, $msg, $file) = @_;
$queue->enqueue ($key, $msg, $to_filter, $uniq_scope);
confess "message queuing works only for STDERR"
if $file ne \*STDERR;
}
# _dequeue ($QUEUE)
# -----------------
# Pop a message from a queue, and print, similarly to how
# _print_message would do it. Return 0 if the queue is
# empty. Note that the key has already been dequeued.
sub _dequeue ($)
{
my ($queue) = @_;
my $msg = $queue->dequeue || return 0;
my $to_filter = $queue->dequeue;
my $uniq_scope = $queue->dequeue;
my $file = \*STDERR;
if ($to_filter ne '')
{
# Do we want local or global uniqueness?
my $dups;
if ($uniq_scope == US_LOCAL)
{
$dups = \%_local_duplicate_messages;
}
elsif ($uniq_scope == US_GLOBAL)
{
$dups = \%_global_duplicate_messages;
}
else
{
confess "unknown value for uniq_scope: " . $uniq_scope;
}
# Update the hash of messages.
if (exists $dups->{$to_filter})
{
++$dups->{$to_filter};
return 1;
}
else
{
$dups->{$to_filter} = 0;
}
}
print $file $msg;
return 1;
}
# _print_message ($LOCATION, $MESSAGE, %OPTIONS)
# ----------------------------------------------
# Format the message, check duplicates, and print it.
sub _print_message ($$%)
{
my ($location, $message, %opts) = @_;
return 0 if ($opts{'silent'});
my $msg = _format_message ($location, $message, %opts);
if ($opts{'partial'})
{
# Incomplete message. Store, don't print.
$partial .= $msg;
return;
}
else
{
# Prefix with any partial message send so far.
$msg = $partial . $msg;
$partial = '';
}
msg ('note', '', 'warnings are treated as errors', uniq_scope => US_GLOBAL)
if ($opts{'type'} eq 'warning' && $warnings_are_errors);
# Check for duplicate message if requested.
my $to_filter;
if ($opts{'uniq_part'} ne UP_NONE)
{
# Which part of the error should we match?
if ($opts{'uniq_part'} eq UP_TEXT)
{
$to_filter = $message;
}
elsif ($opts{'uniq_part'} eq UP_LOC_TEXT)
{
$to_filter = $msg;
}
else
{
$to_filter = $opts{'uniq_part'};
}
# Do we want local or global uniqueness?
my $dups;
if ($opts{'uniq_scope'} == US_LOCAL)
{
$dups = \%_local_duplicate_messages;
}
elsif ($opts{'uniq_scope'} == US_GLOBAL)
{
$dups = \%_global_duplicate_messages;
}
else
{
confess "unknown value for uniq_scope: " . $opts{'uniq_scope'};
}
# Update the hash of messages.
if (exists $dups->{$to_filter})
{
++$dups->{$to_filter};
return 0;
}
else
{
$dups->{$to_filter} = 0;
}
}
my $file = $opts{'file'};
if ($opts{'ordered'} && $opts{'queue'})
{
_enqueue ($opts{'queue'}, $opts{'queue_key'}, $opts{'uniq_scope'},
$to_filter, $msg, $file);
}
else
{
print $file $msg;
}
return 1;
}
=item C<msg ($channel, $location, $message, [%options])>
Emit a message on C<$channel>, overriding some options of the channel with
those specified in C<%options>. Obviously C<$channel> must have been
registered with C<register_channel>.
C<$message> is the text of the message, and C<$location> is a location
associated to the message.
For instance to complain about some unused variable C<mumble>
declared at line 10 in F<foo.c>, one could do:
msg 'unused', 'foo.c:10', "unused variable 'mumble'";
If channel C<unused> is not silent (and if this message is not a duplicate),
the following would be output:
foo.c:10: unused variable 'mumble'
C<$location> can also be an instance of C<Automake::Location>. In this
case, the stack of contexts will be displayed in addition.
If C<$message> contains newline characters, C<$location> is prepended
to each line. For instance,
msg 'error', 'somewhere', "1st line\n2nd line";
becomes
somewhere: 1st line
somewhere: 2nd line
If C<$location> is an empty string, it is replaced by the name of the
program. Actually, if you don't use C<%options>, you can even
elide the empty C<$location>. Thus
msg 'fatal', '', 'fatal error';
msg 'fatal', 'fatal error';
both print
progname: fatal error
=cut
use vars qw (@backlog %buffering);
# See buffer_messages() and flush_messages() below.
%buffering = (); # The map of channel types to buffer.
@backlog = (); # The buffer of messages.
sub msg ($$;$%)
{
my ($channel, $location, $message, %options) = @_;
if (! defined $message)
{
$message = $location;
$location = '';
}
confess "unknown channel $channel" unless exists $channels{$channel};
my %opts = %{$channels{$channel}};
_merge_options (%opts, %options);
if (exists $buffering{$opts{'type'}})
{
push @backlog, [$channel, $location->clone, $message, %options];
return;
}
# Print the message if needed.
if (_print_message ($location, $message, %opts))
{
# Adjust exit status.
if ($opts{'type'} eq 'error'
|| $opts{'type'} eq 'fatal'
|| ($opts{'type'} eq 'warning' && $warnings_are_errors))
{
my $es = $opts{'exit_code'};
$exit_code = $es if $es > $exit_code;
}
# Die on fatal messages.
confess if $opts{'backtrace'};
if ($opts{'type'} eq 'fatal')
{
# flush messages explicitly here, needed in worker threads.
STDERR->flush;
exit $exit_code;
}
}
}
=item C<setup_channel ($channel, %options)>
Override the options of C<$channel> with those specified by C<%options>.
=cut
sub setup_channel ($%)
{
my ($name, %opts) = @_;
confess "unknown channel $name" unless exists $channels{$name};
_merge_options %{$channels{$name}}, %opts;
}
=item C<setup_channel_type ($type, %options)>
Override the options of any channel of type C<$type>
with those specified by C<%options>.
=cut
sub setup_channel_type ($%)
{
my ($type, %opts) = @_;
foreach my $channel (keys %channels)
{
setup_channel $channel, %opts
if $channels{$channel}{'type'} eq $type;
}
}
=item C<dup_channel_setup ()>, C<drop_channel_setup ()>
Sometimes it is necessary to make temporary modifications to channels.
For instance one may want to disable a warning while processing a
particular file, and then restore the initial setup. These two
functions make it easy: C<dup_channel_setup ()> saves a copy of the
current configuration for later restoration by
C<drop_channel_setup ()>.
You can think of this as a stack of configurations whose first entry
is the active one. C<dup_channel_setup ()> duplicates the first
entry, while C<drop_channel_setup ()> just deletes it.
=cut
use vars qw (@_saved_channels @_saved_werrors);
@_saved_channels = ();
@_saved_werrors = ();
sub dup_channel_setup ()
{
my %channels_copy;
foreach my $k1 (keys %channels)
{
$channels_copy{$k1} = {%{$channels{$k1}}};
}
push @_saved_channels, \%channels_copy;
push @_saved_werrors, $warnings_are_errors;
}
sub drop_channel_setup ()
{
my $saved = pop @_saved_channels;
%channels = %$saved;
$warnings_are_errors = pop @_saved_werrors;
}
=item C<buffer_messages (@types)>, C<flush_messages ()>
By default, when C<msg> is called, messages are processed immediately.
Sometimes it is necessary to delay the output of messages.
For instance you might want to make diagnostics before
channels have been completely configured.
After C<buffer_messages(@types)> has been called, messages sent with
C<msg> to a channel whose type is listed in C<@types> will be stored in a
list for later processing.
This backlog of messages is processed when C<flush_messages> is
called, with the current channel options (not the options in effect,
at the time of C<msg>). So for instance, if some channel was silenced
in the meantime, messages to this channel will not be printed.
C<flush_messages> cancels the effect of C<buffer_messages>. Following
calls to C<msg> are processed immediately as usual.
=cut
sub buffer_messages (@)
{
foreach my $type (@_)
{
$buffering{$type} = 1;
}
}
sub flush_messages ()
{
%buffering = ();
foreach my $args (@backlog)
{
&msg (@$args);
}
@backlog = ();
}
=item C<setup_channel_queue ($queue, $key)>
Set the queue to fill for each channel that is ordered,
and the key to use for serialization.
=cut
sub setup_channel_queue ($$)
{
my ($queue, $key) = @_;
foreach my $channel (keys %channels)
{
setup_channel $channel, queue => $queue, queue_key => $key
if $channels{$channel}{'ordered'};
}
}
=item C<pop_channel_queue ($queue)>
pop a message off the $queue; the key has already been popped.
=cut
sub pop_channel_queue ($)
{
my ($queue) = @_;
return _dequeue ($queue);
}
=back
=head1 SEE ALSO
L<Automake::Location>
=head1 HISTORY
Written by Alexandre Duret-Lutz E<lt>F<adl@gnu.org>E<gt>.
=cut
1;
### 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:

View File

@ -0,0 +1,657 @@
# Copyright (C) 1997-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Condition;
use 5.006;
use strict;
use Carp;
require Exporter;
use vars '@ISA', '@EXPORT_OK';
@ISA = qw/Exporter/;
@EXPORT_OK = qw/TRUE FALSE reduce_and reduce_or/;
=head1 NAME
Automake::Condition - record a conjunction of conditionals
=head1 SYNOPSIS
use Automake::Condition;
# Create a condition to represent "COND1 and not COND2".
my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
# Create a condition to represent "not COND3".
my $other = new Automake::Condition "COND3_FALSE";
# Create a condition to represent
# "COND1 and not COND2 and not COND3".
my $both = $cond->merge ($other);
# Likewise, but using a list of conditional strings
my $both2 = $cond->merge_conds ("COND3_FALSE");
# Strip from $both any subconditions which are in $other.
# This is the opposite of merge.
$cond = $both->strip ($other);
# Return the list of conditions ("COND1_TRUE", "COND2_FALSE"):
my @conds = $cond->conds;
# Is $cond always true? (Not in this example)
if ($cond->true) { ... }
# Is $cond always false? (Not in this example)
if ($cond->false) { ... }
# Return the list of conditionals as a string:
# "COND1_TRUE COND2_FALSE"
my $str = $cond->string;
# Return the list of conditionals as a human readable string:
# "COND1 and !COND2"
my $str = $cond->human;
# Return the list of conditionals as a AC_SUBST-style string:
# "@COND1_TRUE@@COND2_FALSE@"
my $subst = $cond->subst_string;
# Is $cond true when $both is true? (Yes in this example)
if ($cond->true_when ($both)) { ... }
# Is $cond redundant w.r.t. {$other, $both}?
# (Yes in this example)
if ($cond->redundant_wrt ($other, $both)) { ... }
# Does $cond imply any of {$other, $both}?
# (Not in this example)
if ($cond->implies_any ($other, $both)) { ... }
# Remove superfluous conditionals assuming they will eventually
# be multiplied together.
# (Returns @conds = ($both) in this example, because
# $other and $cond are implied by $both.)
@conds = Automake::Condition::reduce_and ($other, $both, $cond);
# Remove superfluous conditionals assuming they will eventually
# be summed together.
# (Returns @conds = ($cond, $other) in this example, because
# $both is a subset condition of $cond: $cond is true whenever $both
# is true.)
@conds = Automake::Condition::reduce_or ($other, $both, $cond);
# Invert a Condition. This returns a list of Conditions.
@conds = $both->not;
=head1 DESCRIPTION
A C<Condition> is a conjunction of conditionals (i.e., atomic conditions
defined in F<configure.ac> by C<AM_CONDITIONAL>. In Automake they
are used to represent the conditions into which F<Makefile> variables and
F<Makefile> rules are defined.
If the variable C<VAR> is defined as
if COND1
if COND2
VAR = value
endif
endif
then it will be associated a C<Condition> created with
the following statement.
new Automake::Condition "COND1_TRUE", "COND2_TRUE";
Remember that a C<Condition> is a I<conjunction> of conditionals, so
the above C<Condition> means C<VAR> is defined when C<COND1>
B<and> C<COND2> are true. There is no way to express disjunctions
(i.e., I<or>s) with this class (but see L<DisjConditions>).
Another point worth to mention is that each C<Condition> object is
unique with respect to its conditionals. Two C<Condition> objects
created for the same set of conditionals will have the same address.
This makes it easy to compare C<Condition>s: just compare the
references.
my $c1 = new Automake::Condition "COND1_TRUE", "COND2_TRUE";
my $c2 = new Automake::Condition "COND1_TRUE", "COND2_TRUE";
$c1 == $c2; # True!
=head2 Methods
=over 4
=item C<$cond = new Automake::Condition [@conds]>
Return a C<Condition> objects for the conjunctions of conditionals
listed in C<@conds> as strings.
An item in C<@conds> should be either C<"FALSE">, C<"TRUE">, or have
the form C<"NAME_FALSE"> or C<"NAME_TRUE"> where C<NAME> can be
anything (in practice C<NAME> should be the name of a conditional
declared in F<configure.ac> with C<AM_CONDITIONAL>, but it's not
C<Automake::Condition>'s responsibility to ensure this).
An empty C<@conds> means C<"TRUE">.
As explained previously, the reference (object) returned is unique
with respect to C<@conds>. For this purpose, duplicate elements are
ignored, and C<@conds> is rewritten as C<("FALSE")> if it contains
C<"FALSE"> or two contradictory conditionals (such as C<"NAME_FALSE">
and C<"NAME_TRUE">.)
Therefore the following two statements create the same object (they
both create the C<"FALSE"> condition).
my $c3 = new Automake::Condition "COND1_TRUE", "COND1_FALSE";
my $c4 = new Automake::Condition "COND2_TRUE", "FALSE";
$c3 == $c4; # True!
$c3 == FALSE; # True!
=cut
# Keys in this hash are conditional strings. Values are the
# associated object conditions. This is used by 'new' to reuse
# Condition objects with identical conditionals.
use vars '%_condition_singletons';
# Do NOT reset this hash here. It's already empty by default,
# and any setting would otherwise occur AFTER the 'TRUE' and 'FALSE'
# constants definitions.
# %_condition_singletons = ();
sub new ($;@)
{
my ($class, @conds) = @_;
my $self = {
hash => {},
};
bless $self, $class;
for my $cond (@conds)
{
# Catch some common programming errors:
# - A Condition passed to new
confess "'$cond' is a reference, expected a string" if ref $cond;
# - A Condition passed as a string to new
confess "'$cond' does not look like a condition" if $cond =~ /::/;
}
# Accept strings like "FOO BAR" as shorthand for ("FOO", "BAR").
@conds = map { split (' ', $_) } @conds;
for my $cond (@conds)
{
next if $cond eq 'TRUE';
# Detect cases when @conds can be simplified to FALSE.
if (($cond eq 'FALSE' && $#conds > 0)
|| ($cond =~ /^(.*)_TRUE$/ && exists $self->{'hash'}{"${1}_FALSE"})
|| ($cond =~ /^(.*)_FALSE$/ && exists $self->{'hash'}{"${1}_TRUE"}))
{
return &FALSE;
}
$self->{'hash'}{$cond} = 1;
}
my $key = $self->string;
if (exists $_condition_singletons{$key})
{
return $_condition_singletons{$key};
}
$_condition_singletons{$key} = $self;
return $self;
}
=item C<$newcond = $cond-E<gt>merge (@otherconds)>
Return a new condition which is the conjunction of
C<$cond> and C<@otherconds>.
=cut
sub merge ($@)
{
my ($self, @otherconds) = @_;
new Automake::Condition (map { $_->conds } ($self, @otherconds));
}
=item C<$newcond = $cond-E<gt>merge_conds (@conds)>
Return a new condition which is the conjunction of C<$cond> and
C<@conds>, where C<@conds> is a list of conditional strings, as
passed to C<new>.
=cut
sub merge_conds ($@)
{
my ($self, @conds) = @_;
new Automake::Condition $self->conds, @conds;
}
=item C<$newcond = $cond-E<gt>strip ($minuscond)>
Return a new condition which has all the conditionals of C<$cond>
except those of C<$minuscond>. This is the opposite of C<merge>.
=cut
sub strip ($$)
{
my ($self, $minus) = @_;
my @res = grep { not $minus->_has ($_) } $self->conds;
return new Automake::Condition @res;
}
=item C<@list = $cond-E<gt>conds>
Return the set of conditionals defining C<$cond>, as strings. Note that
this might not be exactly the list passed to C<new> (or a
concatenation of such lists if C<merge> was used), because of the
cleanup mentioned in C<new>'s description.
For instance C<$c3-E<gt>conds> will simply return C<("FALSE")>.
=cut
sub conds ($ )
{
my ($self) = @_;
my @conds = keys %{$self->{'hash'}};
return ("TRUE") unless @conds;
return sort @conds;
}
# Undocumented, shouldn't be needed outside of this class.
sub _has ($$)
{
my ($self, $cond) = @_;
return exists $self->{'hash'}{$cond};
}
=item C<$cond-E<gt>false>
Return 1 iff this condition is always false.
=cut
sub false ($ )
{
my ($self) = @_;
return $self->_has ('FALSE');
}
=item C<$cond-E<gt>true>
Return 1 iff this condition is always true.
=cut
sub true ($ )
{
my ($self) = @_;
return 0 == keys %{$self->{'hash'}};
}
=item C<$cond-E<gt>string>
Build a string which denotes the condition.
For instance using the C<$cond> definition from L<SYNOPSYS>,
C<$cond-E<gt>string> will return C<"COND1_TRUE COND2_FALSE">.
=cut
sub string ($ )
{
my ($self) = @_;
return $self->{'string'} if defined $self->{'string'};
my $res = '';
if ($self->false)
{
$res = 'FALSE';
}
else
{
$res = join (' ', $self->conds);
}
$self->{'string'} = $res;
return $res;
}
=item C<$cond-E<gt>human>
Build a human readable string which denotes the condition.
For instance using the C<$cond> definition from L<SYNOPSYS>,
C<$cond-E<gt>string> will return C<"COND1 and !COND2">.
=cut
sub _to_human ($ )
{
my ($s) = @_;
if ($s =~ /^(.*)_(TRUE|FALSE)$/)
{
return (($2 eq 'FALSE') ? '!' : '') . $1;
}
else
{
return $s;
}
}
sub human ($ )
{
my ($self) = @_;
return $self->{'human'} if defined $self->{'human'};
my $res = '';
if ($self->false)
{
$res = 'FALSE';
}
else
{
$res = join (' and ', map { _to_human $_ } $self->conds);
}
$self->{'human'} = $res;
return $res;
}
=item C<$cond-E<gt>subst_string>
Build a C<AC_SUBST>-style string for output in F<Makefile.in>.
For instance using the C<$cond> definition from L<SYNOPSYS>,
C<$cond-E<gt>subst_string> will return C<"@COND1_TRUE@@COND2_FALSE@">.
=cut
sub subst_string ($ )
{
my ($self) = @_;
return $self->{'subst_string'} if defined $self->{'subst_string'};
my $res = '';
if ($self->false)
{
$res = '#';
}
elsif (! $self->true)
{
$res = '@' . join ('@@', sort $self->conds) . '@';
}
$self->{'subst_string'} = $res;
return $res;
}
=item C<$cond-E<gt>true_when ($when)>
Return 1 iff C<$cond> is true when C<$when> is true.
Return 0 otherwise.
Using the definitions from L<SYNOPSYS>, C<$cond> is true
when C<$both> is true, but the converse is wrong.
=cut
sub true_when ($$)
{
my ($self, $when) = @_;
# Nothing is true when FALSE (not even FALSE itself, but it
# shouldn't hurt if you decide to change that).
return 0 if $self->false || $when->false;
# If we are true, we stay true when $when is true :)
return 1 if $self->true;
# $SELF is true under $WHEN if each conditional component of $SELF
# exists in $WHEN.
foreach my $cond ($self->conds)
{
return 0 unless $when->_has ($cond);
}
return 1;
}
=item C<$cond-E<gt>redundant_wrt (@conds)>
Return 1 iff C<$cond> is true for any condition in C<@conds>.
If @conds is empty, return 1 iff C<$cond> is C<FALSE>.
Return 0 otherwise.
=cut
sub redundant_wrt ($@)
{
my ($self, @conds) = @_;
foreach my $cond (@conds)
{
return 1 if $self->true_when ($cond);
}
return $self->false;
}
=item C<$cond-E<gt>implies_any (@conds)>
Return 1 iff C<$cond> implies any of the conditions in C<@conds>.
Return 0 otherwise.
=cut
sub implies_any ($@)
{
my ($self, @conds) = @_;
foreach my $cond (@conds)
{
return 1 if $cond->true_when ($self);
}
return 0;
}
=item C<$cond-E<gt>not>
Return a negation of C<$cond> as a list of C<Condition>s.
This list should be used to construct a C<DisjConditions>
(we cannot return a C<DisjConditions> from C<Automake::Condition>,
because that would make these two packages interdependent).
=cut
sub not ($ )
{
my ($self) = @_;
return @{$self->{'not'}} if defined $self->{'not'};
my @res =
map { new Automake::Condition &conditional_negate ($_) } $self->conds;
$self->{'not'} = [@res];
return @res;
}
=item C<$cond-E<gt>multiply (@conds)>
Assumption: C<@conds> represent a disjunction of conditions.
Return the result of multiplying C<$cond> with that disjunction.
The result will be a list of conditions suitable to construct a
C<DisjConditions>.
=cut
sub multiply ($@)
{
my ($self, @set) = @_;
my %res = ();
for my $cond (@set)
{
my $ans = $self->merge ($cond);
$res{$ans} = $ans;
}
# FALSE can always be removed from a disjunction.
delete $res{FALSE};
# Now, $self is a common factor of the remaining conditions.
# If one of the conditions is $self, we can discard the rest.
return ($self, ())
if exists $res{$self};
return (values %res);
}
=back
=head2 Other helper functions
=over 4
=item C<TRUE>
The C<"TRUE"> conditional.
=item C<FALSE>
The C<"FALSE"> conditional.
=cut
use constant TRUE => new Automake::Condition "TRUE";
use constant FALSE => new Automake::Condition "FALSE";
=item C<reduce_and (@conds)>
Return a subset of @conds with the property that the conjunction of
the subset is the same as the conjunction of @conds. For example, if
both C<COND1_TRUE COND2_TRUE> and C<COND1_TRUE> are in the list,
discard the latter. If the input list is empty, return C<(TRUE)>.
=cut
sub reduce_and (@)
{
my (@conds) = @_;
my @ret = ();
my $cond;
while (@conds > 0)
{
$cond = shift @conds;
# FALSE is absorbent.
return FALSE
if $cond == FALSE;
if (! $cond->redundant_wrt (@ret, @conds))
{
push (@ret, $cond);
}
}
return TRUE if @ret == 0;
return @ret;
}
=item C<reduce_or (@conds)>
Return a subset of @conds with the property that the disjunction of
the subset is equivalent to the disjunction of @conds. For example,
if both C<COND1_TRUE COND2_TRUE> and C<COND1_TRUE> are in the list,
discard the former. If the input list is empty, return C<(FALSE)>.
=cut
sub reduce_or (@)
{
my (@conds) = @_;
my @ret = ();
my $cond;
while (@conds > 0)
{
$cond = shift @conds;
next
if $cond == FALSE;
return TRUE
if $cond == TRUE;
push (@ret, $cond)
unless $cond->implies_any (@ret, @conds);
}
return FALSE if @ret == 0;
return @ret;
}
=item C<conditional_negate ($condstr)>
Negate a conditional string.
=cut
sub conditional_negate ($)
{
my ($cond) = @_;
$cond =~ s/TRUE$/TRUEO/;
$cond =~ s/FALSE$/TRUE/;
$cond =~ s/TRUEO$/FALSE/;
return $cond;
}
=back
=head1 SEE ALSO
L<Automake::DisjConditions>.
=head1 HISTORY
C<AM_CONDITIONAL>s and supporting code were added to Automake 1.1o by
Ian Lance Taylor <ian@cygnus.org> in 1997. Since then it has been
improved by Tom Tromey <tromey@redhat.com>, Richard Boulton
<richard@tartarus.org>, Raja R Harinath <harinath@cs.umn.edu>,
Akim Demaille <akim@epita.fr>, and Alexandre Duret-Lutz <adl@gnu.org>.
=cut
1;
### 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:

View File

@ -0,0 +1,62 @@
# -*- Perl -*-
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
# @configure_input@
# 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 <http://www.gnu.org/licenses/>.
package Automake::Config;
use strict;
use 5.006;
require Exporter;
our @ISA = qw (Exporter);
our @EXPORT = qw ($APIVERSION $PACKAGE $PACKAGE_BUGREPORT $VERSION
$RELEASE_YEAR $libdir $perl_threads);
# Parameters set by configure. Not to be changed. NOTE: assign
# VERSION as string so that e.g. version 0.30 will print correctly.
our $APIVERSION = '@APIVERSION@';
our $PACKAGE = '@PACKAGE@';
our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
our $VERSION = '@VERSION@';
our $RELEASE_YEAR = '@RELEASE_YEAR@';
our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
our $perl_threads = 0;
# We need at least this version for CLONE support.
if (eval { require 5.007_002; })
{
use Config;
$perl_threads = $Config{useithreads};
}
1;
### 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:

View File

@ -0,0 +1,128 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
###############################################################
# The main copy of this file is in Automake's git repository. #
# Updates should be sent to automake-patches@gnu.org. #
###############################################################
package Automake::Configure_ac;
use 5.006;
use strict;
use Exporter;
use Automake::Channels;
use Automake::ChannelDefs;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
@EXPORT = qw (&find_configure_ac &require_configure_ac);
=head1 NAME
Automake::Configure_ac - Locate configure.ac or configure.in.
=head1 SYNOPSIS
use Automake::Configure_ac;
# Try to locate configure.in or configure.ac in the current
# directory. It may be absent. Complain if both files exist.
my $file_name = find_configure_ac;
# Likewise, but bomb out if the file does not exist.
my $file_name = require_configure_ac;
# Likewise, but in $dir.
my $file_name = find_configure_ac ($dir);
my $file_name = require_configure_ac ($dir);
=over 4
=back
=head2 Functions
=over 4
=item C<$configure_ac = find_configure_ac ([$directory])>
Find a F<configure.ac> or F<configure.in> file in C<$directory>,
defaulting to the current directory. Complain if both files are present.
Return the name of the file found, or the former if neither is present.
=cut
sub find_configure_ac (;@)
{
my ($directory) = @_;
$directory ||= '.';
my $configure_ac =
File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.ac'));
my $configure_in =
File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.in'));
if (-f $configure_in)
{
msg ('obsolete', "autoconf input should be named 'configure.ac'," .
" not 'configure.in'");
if (-f $configure_ac)
{
msg ('unsupported',
"'$configure_ac' and '$configure_in' both present.\n"
. "proceeding with '$configure_ac'");
return $configure_ac
}
else
{
return $configure_in;
}
}
return $configure_ac;
}
=item C<$configure_ac = require_configure_ac ([$directory])>
Like C<find_configure_ac>, but fail if neither is present.
=cut
sub require_configure_ac (;$)
{
my $res = find_configure_ac (@_);
fatal "'configure.ac' is required" unless -f $res;
return $res
}
1;
### 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:

View File

@ -0,0 +1,557 @@
# Copyright (C) 1997-2017 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 <http://www.gnu.org/licenses/>.
package Automake::DisjConditions;
use 5.006;
use strict;
use Carp;
use Automake::Condition qw/TRUE FALSE/;
=head1 NAME
Automake::DisjConditions - record a disjunction of Conditions
=head1 SYNOPSIS
use Automake::Condition;
use Automake::DisjConditions;
# Create a Condition to represent "COND1 and not COND2".
my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
# Create a Condition to represent "not COND3".
my $other = new Automake::Condition "COND3_FALSE";
# Create a DisjConditions to represent
# "(COND1 and not COND2) or (not COND3)"
my $set = new Automake::DisjConditions $cond, $other;
# Return the list of Conditions involved in $set.
my @conds = $set->conds;
# Return one of the Condition involved in $set.
my $cond = $set->one_cond;
# Return true iff $set is always true (i.e. its subconditions
# cover all cases).
if ($set->true) { ... }
# Return false iff $set is always false (i.e. is empty, or contains
# only false conditions).
if ($set->false) { ... }
# Return a string representing the DisjConditions.
# "COND1_TRUE COND2_FALSE | COND3_FALSE"
my $str = $set->string;
# Return a human readable string representing the DisjConditions.
# "(COND1 and !COND2) or (!COND3)"
my $str = $set->human;
# Merge (OR) several DisjConditions.
my $all = $set->merge($set2, $set3, ...)
# Invert a DisjConditions, i.e., create a new DisjConditions
# that complements $set.
my $inv = $set->invert;
# Multiply two DisjConditions.
my $prod = $set1->multiply ($set2);
# Return the subconditions of a DisjConditions with respect to
# a Condition. See the description for a real example.
my $subconds = $set->sub_conditions ($cond);
# Check whether a new definition in condition $cond would be
# ambiguous w.r.t. existing definitions in $set.
($msg, $ambig_cond) = $set->ambiguous_p ($what, $cond);
=head1 DESCRIPTION
A C<DisjConditions> is a disjunction of C<Condition>s. In Automake
they are used to represent the conditions into which Makefile
variables and Makefile rules are defined.
If the variable C<VAR> is defined as
if COND1
if COND2
VAR = value1
endif
endif
if !COND3
if COND4
VAR = value2
endif
endif
then it will be associated a C<DisjConditions> created with
the following statement.
new Automake::DisjConditions
(new Automake::Condition ("COND1_TRUE", "COND2_TRUE"),
new Automake::Condition ("COND3_FALSE", "COND4_TRUE"));
As you can see, a C<DisjConditions> is made from a list of
C<Condition>s. Since C<DisjConditions> is a disjunction, and
C<Condition> is a conjunction, the above can be read as
follows.
(COND1 and COND2) or ((not COND3) and COND4)
That's indeed the condition in which C<VAR> has a value.
Like C<Condition> objects, a C<DisjConditions> object is unique
with respect to its conditions. Two C<DisjConditions> objects created
for the same set of conditions will have the same address. This makes
it easy to compare C<DisjConditions>s: just compare the references.
=head2 Methods
=over 4
=item C<$set = new Automake::DisjConditions [@conds]>
Create a C<DisjConditions> object from the list of C<Condition>
objects passed in arguments.
If the C<@conds> list is empty, the C<DisjConditions> is assumed to be
false.
As explained previously, the reference (object) returned is unique
with respect to C<@conds>. For this purpose, duplicate elements are
ignored.
=cut
# Keys in this hash are DisjConditions strings. Values are the
# associated object DisjConditions. This is used by 'new' to reuse
# DisjConditions objects with identical conditions.
use vars '%_disjcondition_singletons';
sub new ($;@)
{
my ($class, @conds) = @_;
my @filtered_conds = ();
for my $cond (@conds)
{
confess "'$cond' isn't a reference" unless ref $cond;
confess "'$cond' isn't an Automake::Condition"
unless $cond->isa ("Automake::Condition");
# This is a disjunction of conditions, so we drop
# false conditions. We'll always treat an "empty"
# DisjConditions as false for this reason.
next if $cond->false;
push @filtered_conds, $cond;
}
my $string;
if (@filtered_conds)
{
@filtered_conds = sort { $a->string cmp $b->string } @filtered_conds;
$string = join (' | ', map { $_->string } @filtered_conds);
}
else
{
$string = 'FALSE';
}
# Return any existing identical DisjConditions.
my $me = $_disjcondition_singletons{$string};
return $me if $me;
# Else, create a new DisjConditions.
# Store conditions as keys AND as values, because blessed
# objects are converted to strings when used as keys (so
# at least we still have the value when we need to call
# a method).
my %h = map {$_ => $_} @filtered_conds;
my $self = {
hash => \%h,
string => $string,
conds => \@filtered_conds,
};
bless $self, $class;
$_disjcondition_singletons{$string} = $self;
return $self;
}
=item C<CLONE>
Internal special subroutine to fix up the self hashes in
C<%_disjcondition_singletons> upon thread creation. C<CLONE> is invoked
automatically with ithreads from Perl 5.7.2 or later, so if you use this
module with earlier versions of Perl, it is not thread-safe.
=cut
sub CLONE
{
foreach my $self (values %_disjcondition_singletons)
{
my %h = map { $_ => $_ } @{$self->{'conds'}};
$self->{'hash'} = \%h;
}
}
=item C<@conds = $set-E<gt>conds>
Return the list of C<Condition> objects involved in C<$set>.
=cut
sub conds ($ )
{
my ($self) = @_;
return @{$self->{'conds'}};
}
=item C<$cond = $set-E<gt>one_cond>
Return one C<Condition> object involved in C<$set>.
=cut
sub one_cond ($)
{
my ($self) = @_;
return (%{$self->{'hash'}},)[1];
}
=item C<$et = $set-E<gt>false>
Return 1 iff the C<DisjConditions> object is always false (i.e., if it
is empty, or if it contains only false C<Condition>s). Return 0
otherwise.
=cut
sub false ($ )
{
my ($self) = @_;
return 0 == keys %{$self->{'hash'}};
}
=item C<$et = $set-E<gt>true>
Return 1 iff the C<DisjConditions> object is always true (i.e. covers all
conditions). Return 0 otherwise.
=cut
sub true ($ )
{
my ($self) = @_;
return $self->invert->false;
}
=item C<$str = $set-E<gt>string>
Build a string which denotes the C<DisjConditions>.
=cut
sub string ($ )
{
my ($self) = @_;
return $self->{'string'};
}
=item C<$cond-E<gt>human>
Build a human readable string which denotes the C<DisjConditions>.
=cut
sub human ($ )
{
my ($self) = @_;
return $self->{'human'} if defined $self->{'human'};
my $res = '';
if ($self->false)
{
$res = 'FALSE';
}
else
{
my @c = $self->conds;
if (1 == @c)
{
$res = $c[0]->human;
}
else
{
$res = '(' . join (') or (', map { $_->human } $self->conds) . ')';
}
}
$self->{'human'} = $res;
return $res;
}
=item C<$newcond = $cond-E<gt>merge (@otherconds)>
Return a new C<DisjConditions> which is the disjunction of
C<$cond> and C<@otherconds>. Items in C<@otherconds> can be
@C<Condition>s or C<DisjConditions>.
=cut
sub merge ($@)
{
my ($self, @otherconds) = @_;
new Automake::DisjConditions (
map { $_->isa ("Automake::DisjConditions") ? $_->conds : $_ }
($self, @otherconds));
}
=item C<$prod = $set1-E<gt>multiply ($set2)>
Multiply two conditional sets.
my $set1 = new Automake::DisjConditions
(new Automake::Condition ("A_TRUE"),
new Automake::Condition ("B_TRUE"));
my $set2 = new Automake::DisjConditions
(new Automake::Condition ("C_FALSE"),
new Automake::Condition ("D_FALSE"));
C<$set1-E<gt>multiply ($set2)> will return
new Automake::DisjConditions
(new Automake::Condition ("A_TRUE", "C_FALSE"),
new Automake::Condition ("B_TRUE", "C_FALSE"),;
new Automake::Condition ("A_TRUE", "D_FALSE"),
new Automake::Condition ("B_TRUE", "D_FALSE"));
The argument can also be a C<Condition>.
=cut
# Same as multiply() but take a list of Conditionals as second argument.
# We use this in invert().
sub _multiply ($@)
{
my ($self, @set) = @_;
my @res = map { $_->multiply (@set) } $self->conds;
return new Automake::DisjConditions (Automake::Condition::reduce_or @res);
}
sub multiply ($$)
{
my ($self, $set) = @_;
return $self->_multiply ($set) if $set->isa('Automake::Condition');
return $self->_multiply ($set->conds);
}
=item C<$inv = $set-E<gt>invert>
Invert a C<DisjConditions>. Return a C<DisjConditions> which is true
when C<$set> is false, and vice-versa.
my $set = new Automake::DisjConditions
(new Automake::Condition ("A_TRUE", "B_TRUE"),
new Automake::Condition ("A_FALSE", "B_FALSE"));
Calling C<$set-E<gt>invert> will return the following C<DisjConditions>.
new Automake::DisjConditions
(new Automake::Condition ("A_TRUE", "B_FALSE"),
new Automake::Condition ("A_FALSE", "B_TRUE"));
We implement the inversion by a product-of-sums to sum-of-products
conversion using repeated multiplications. Because of the way we
implement multiplication, the result of inversion is in canonical
prime implicant form.
=cut
sub invert($ )
{
my ($self) = @_;
return $self->{'invert'} if defined $self->{'invert'};
# The invert of an empty DisjConditions is TRUE.
my $res = new Automake::DisjConditions TRUE;
# !((a.b)+(c.d)+(e.f))
# = (!a+!b).(!c+!d).(!e+!f)
# We develop this into a sum of product iteratively, starting from TRUE:
# 1) TRUE
# 2) TRUE.!a + TRUE.!b
# 3) TRUE.!a.!c + TRUE.!b.!c + TRUE.!a.!d + TRUE.!b.!d
# 4) TRUE.!a.!c.!e + TRUE.!b.!c.!e + TRUE.!a.!d.!e + TRUE.!b.!d.!e
# + TRUE.!a.!c.!f + TRUE.!b.!c.!f + TRUE.!a.!d.!f + TRUE.!b.!d.!f
foreach my $cond ($self->conds)
{
$res = $res->_multiply ($cond->not);
}
# Cache result.
$self->{'invert'} = $res;
# It's tempting to also set $res->{'invert'} to $self, but that
# is a bad idea as $self hasn't been normalized in any way.
# (Different inputs can produce the same inverted set.)
return $res;
}
=item C<$self-E<gt>simplify>
Return a C<Disjunction> which is a simplified canonical form of C<$self>.
This canonical form contains only prime implicants, but it can contain
non-essential prime implicants.
=cut
sub simplify ($)
{
my ($self) = @_;
return $self->invert->invert;
}
=item C<$self-E<gt>sub_conditions ($cond)>
Return the subconditions of C<$self> that contains C<$cond>, with
C<$cond> stripped. More formally, return C<$res> such that
C<$res-E<gt>multiply ($cond) == $self-E<gt>multiply ($cond)> and
C<$res> does not mention any of the variables in C<$cond>.
For instance, consider:
my $a = new Automake::DisjConditions
(new Automake::Condition ("A_TRUE", "B_TRUE"),
new Automake::Condition ("A_TRUE", "C_FALSE"),
new Automake::Condition ("A_TRUE", "B_FALSE", "C_TRUE"),
new Automake::Condition ("A_FALSE"));
my $b = new Automake::DisjConditions
(new Automake::Condition ("A_TRUE", "B_FALSE"));
Calling C<$a-E<gt>sub_conditions ($b)> will return the following
C<DisjConditions>.
new Automake::DisjConditions
(new Automake::Condition ("C_FALSE"), # From A_TRUE C_FALSE
new Automake::Condition ("C_TRUE")); # From A_TRUE B_FALSE C_TRUE"
=cut
sub sub_conditions ($$)
{
my ($self, $subcond) = @_;
# Make $subcond blindingly apparent in the DisjConditions.
# For instance '$b->multiply($a->conds)' (from the POD example) is:
# (new Automake::Condition ("FALSE"),
# new Automake::Condition ("A_TRUE", "B_FALSE", "C_FALSE"),
# new Automake::Condition ("A_TRUE", "B_FALSE", "C_TRUE"),
# new Automake::Condition ("FALSE"))
my @prodconds = $subcond->multiply ($self->conds);
# Now, strip $subcond from the remaining (i.e., non-false) Conditions.
my @res = map { $_->false ? () : $_->strip ($subcond) } @prodconds;
return new Automake::DisjConditions @res;
}
=item C<($string, $ambig_cond) = $condset-E<gt>ambiguous_p ($what, $cond)>
Check for an ambiguous condition. Return an error message and the
other condition involved if we have an ambiguity. Return an empty
string and FALSE otherwise.
C<$what> is the name of the thing being defined, to use in the error
message. C<$cond> is the C<Condition> under which it is being
defined. C<$condset> is the C<DisjConditions> under which it had
already been defined.
=cut
sub ambiguous_p ($$$)
{
my ($self, $var, $cond) = @_;
# Note that these rules don't consider the following
# example as ambiguous.
#
# if COND1
# FOO = foo
# endif
# if COND2
# FOO = bar
# endif
#
# It's up to the user to not define COND1 and COND2
# simultaneously.
return ("$var multiply defined in condition " . $cond->human, $cond)
if exists $self->{'hash'}{$cond};
foreach my $vcond ($self->conds)
{
return ("$var was already defined in condition " . $vcond->human
. ", which includes condition ". $cond->human, $vcond)
if $vcond->true_when ($cond);
return ("$var was already defined in condition " . $vcond->human
. ", which is included in condition " . $cond->human, $vcond)
if $cond->true_when ($vcond);
}
return ('', FALSE);
}
=head1 SEE ALSO
L<Automake::Condition>.
=head1 HISTORY
C<AM_CONDITIONAL>s and supporting code were added to Automake 1.1o by
Ian Lance Taylor <ian@cygnus.org> in 1997. Since then it has been
improved by Tom Tromey <tromey@redhat.com>, Richard Boulton
<richard@tartarus.org>, Raja R Harinath <harinath@cs.umn.edu>, Akim
Demaille <akim@epita.fr>, Pavel Roskin <proski@gnu.org>, and
Alexandre Duret-Lutz <adl@gnu.org>.
=cut
1;
### 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:

View File

@ -0,0 +1,425 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
###############################################################
# The main copy of this file is in Automake's git repository. #
# Updates should be sent to automake-patches@gnu.org. #
###############################################################
package Automake::FileUtils;
=head1 NAME
Automake::FileUtils - handling files
=head1 SYNOPSIS
use Automake::FileUtils
=head1 DESCRIPTION
This perl module provides various general purpose file handling functions.
=cut
use 5.006;
use strict;
use Exporter;
use File::stat;
use IO::File;
use Automake::Channels;
use Automake::ChannelDefs;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
@EXPORT = qw (&contents
&find_file &mtime
&update_file &up_to_date_p
&xsystem &xsystem_hint &xqx
&dir_has_case_matching_file &reset_dir_cache
&set_dir_cache_file);
=item C<find_file ($file_name, @include)>
Return the first path for a C<$file_name> in the C<include>s.
We match exactly the behavior of GNU M4: first look in the current
directory (which includes the case of absolute file names), and then,
if the file name is not absolute, look in C<@include>.
If the file is flagged as optional (ends with C<?>), then return undef
if absent, otherwise exit with error.
=cut
# $FILE_NAME
# find_file ($FILE_NAME, @INCLUDE)
# --------------------------------
sub find_file ($@)
{
use File::Spec;
my ($file_name, @include) = @_;
my $optional = 0;
$optional = 1
if $file_name =~ s/\?$//;
return File::Spec->canonpath ($file_name)
if -e $file_name;
if (!File::Spec->file_name_is_absolute ($file_name))
{
foreach my $path (@include)
{
return File::Spec->canonpath (File::Spec->catfile ($path, $file_name))
if -e File::Spec->catfile ($path, $file_name)
}
}
fatal "$file_name: no such file or directory"
unless $optional;
return undef;
}
=item C<mtime ($file)>
Return the mtime of C<$file>. Missing files, or C<-> standing for
C<STDIN> or C<STDOUT> are "obsolete", i.e., as old as possible.
=cut
# $MTIME
# MTIME ($FILE)
# -------------
sub mtime ($)
{
my ($file) = @_;
return 0
if $file eq '-' || ! -f $file;
my $stat = stat ($file)
or fatal "cannot stat $file: $!";
return $stat->mtime;
}
=item C<update_file ($from, $to, [$force])>
Rename C<$from> as C<$to>, preserving C<$to> timestamp if it has not
changed, unless C<$force> is true (defaults to false). Recognize
C<$to> = C<-> standing for C<STDIN>. C<$from> is always
removed/renamed.
=cut
# &update_file ($FROM, $TO; $FORCE)
# ---------------------------------
sub update_file ($$;$)
{
my ($from, $to, $force) = @_;
$force = 0
unless defined $force;
my $SIMPLE_BACKUP_SUFFIX = $ENV{'SIMPLE_BACKUP_SUFFIX'} || '~';
use File::Compare;
use File::Copy;
if ($to eq '-')
{
my $in = new IO::File $from, "<";
my $out = new IO::File (">-");
while ($_ = $in->getline)
{
print $out $_;
}
$in->close;
unlink ($from) || fatal "cannot remove $from: $!";
return;
}
if (!$force && -f "$to" && compare ("$from", "$to") == 0)
{
# File didn't change, so don't update its mod time.
msg 'note', "'$to' is unchanged";
unlink ($from)
or fatal "cannot remove $from: $!";
return
}
if (-f "$to")
{
# Back up and install the new one.
move ("$to", "$to$SIMPLE_BACKUP_SUFFIX")
or fatal "cannot backup $to: $!";
move ("$from", "$to")
or fatal "cannot rename $from as $to: $!";
msg 'note', "'$to' is updated";
}
else
{
move ("$from", "$to")
or fatal "cannot rename $from as $to: $!";
msg 'note', "'$to' is created";
}
}
=item C<up_to_date_p ($file, @dep)>
Is C<$file> more recent than C<@dep>?
=cut
# $BOOLEAN
# &up_to_date_p ($FILE, @DEP)
# ---------------------------
sub up_to_date_p ($@)
{
my ($file, @dep) = @_;
my $mtime = mtime ($file);
foreach my $dep (@dep)
{
if ($mtime < mtime ($dep))
{
verb "up_to_date ($file): outdated: $dep";
return 0;
}
}
verb "up_to_date ($file): up to date";
return 1;
}
=item C<handle_exec_errors ($command, [$expected_exit_code = 0], [$hint])>
Display an error message for C<$command>, based on the content of
C<$?> and C<$!>. Be quiet if the command exited normally
with C<$expected_exit_code>. If C<$hint> is given, display that as well
if the command failed to run at all.
=cut
sub handle_exec_errors ($;$$)
{
my ($command, $expected, $hint) = @_;
$expected = 0 unless defined $expected;
if (defined $hint)
{
$hint = "\n" . $hint;
}
else
{
$hint = '';
}
$command = (split (' ', $command))[0];
if ($!)
{
fatal "failed to run $command: $!" . $hint;
}
else
{
use POSIX qw (WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
if (WIFEXITED ($?))
{
my $status = WEXITSTATUS ($?);
# Propagate exit codes.
fatal ('',
"$command failed with exit status: $status",
exit_code => $status)
unless $status == $expected;
}
elsif (WIFSIGNALED ($?))
{
my $signal = WTERMSIG ($?);
fatal "$command terminated by signal: $signal";
}
else
{
fatal "$command exited abnormally";
}
}
}
=item C<xqx ($command)>
Same as C<qx> (but in scalar context), but fails on errors.
=cut
# xqx ($COMMAND)
# --------------
sub xqx ($)
{
my ($command) = @_;
verb "running: $command";
$! = 0;
my $res = `$command`;
handle_exec_errors $command
if $?;
return $res;
}
=item C<xsystem (@argv)>
Same as C<system>, but fails on errors, and reports the C<@argv>
in verbose mode.
=cut
sub xsystem (@)
{
my (@command) = @_;
verb "running: @command";
$! = 0;
handle_exec_errors "@command"
if system @command;
}
=item C<xsystem_hint ($msg, @argv)>
Same as C<xsystem>, but allows to pass a hint that will be displayed
in case the command failed to run at all.
=cut
sub xsystem_hint (@)
{
my ($hint, @command) = @_;
verb "running: @command";
$! = 0;
handle_exec_errors "@command", 0, $hint
if system @command;
}
=item C<contents ($file_name)>
Return the contents of C<$file_name>.
=cut
# contents ($FILE_NAME)
# ---------------------
sub contents ($)
{
my ($file) = @_;
verb "reading $file";
local $/; # Turn on slurp-mode.
my $f = new Automake::XFile $file, "<";
my $contents = $f->getline;
$f->close;
return $contents;
}
=item C<dir_has_case_matching_file ($DIRNAME, $FILE_NAME)>
Return true iff $DIR contains a file name that matches $FILE_NAME case
insensitively.
We need to be cautious on case-insensitive case-preserving file
systems (e.g. Mac OS X's HFS+). On such systems C<-f 'Foo'> and C<-f
'foO'> answer the same thing. Hence if a package distributes its own
F<CHANGELOG> file, but has no F<ChangeLog> file, automake would still
try to distribute F<ChangeLog> (because it thinks it exists) in
addition to F<CHANGELOG>, although it is impossible for these two
files to be in the same directory (the two file names designate the
same file).
=cut
use vars '%_directory_cache';
sub dir_has_case_matching_file ($$)
{
# Note that print File::Spec->case_tolerant returns 0 even on MacOS
# X (with Perl v5.8.1-RC3 at least), so do not try to shortcut this
# function using that.
my ($dirname, $file_name) = @_;
return 0 unless -f "$dirname/$file_name";
# The file appears to exist, however it might be a mirage if the
# system is case insensitive. Let's browse the directory and check
# whether the file is really in. We maintain a cache of directories
# so Automake doesn't spend all its time reading the same directory
# again and again.
if (!exists $_directory_cache{$dirname})
{
error "failed to open directory '$dirname'"
unless opendir (DIR, $dirname);
$_directory_cache{$dirname} = { map { $_ => 1 } readdir (DIR) };
closedir (DIR);
}
return exists $_directory_cache{$dirname}{$file_name};
}
=item C<reset_dir_cache ($dirname)>
Clear C<dir_has_case_matching_file>'s cache for C<$dirname>.
=cut
sub reset_dir_cache ($)
{
delete $_directory_cache{$_[0]};
}
=item C<set_dir_cache_file ($dirname, $file_name)>
State that C<$dirname> contains C<$file_name> now.
=cut
sub set_dir_cache_file ($$)
{
my ($dirname, $file_name) = @_;
$_directory_cache{$dirname}{$file_name} = 1
if exists $_directory_cache{$dirname};
}
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:

View File

@ -0,0 +1,87 @@
# Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
package Automake::General;
use 5.006;
use strict;
use Exporter;
use File::Basename;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
@EXPORT = qw (&uniq $me);
# Variable we share with the main package. Be sure to have a single
# copy of them: using 'my' together with multiple inclusion of this
# package would introduce several copies.
use vars qw ($me);
$me = basename ($0);
# END
# ---
# Exit nonzero whenever closing STDOUT fails.
sub END
{
# This is required if the code might send any output to stdout
# E.g., even --version or --help. So it's best to do it unconditionally.
if (! close STDOUT)
{
print STDERR "$me: closing standard output: $!\n";
$? = 74; # EX_IOERR
return;
}
}
# @RES
# uniq (@LIST)
# ------------
# Return LIST with no duplicates.
sub uniq (@)
{
my @res = ();
my %seen = ();
foreach my $item (@_)
{
if (! exists $seen{$item})
{
$seen{$item} = 1;
push (@res, $item);
}
}
return wantarray ? @res : "@res";
}
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:

View File

@ -0,0 +1,115 @@
# Copyright (C) 2012-2017 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 3 of the License, 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 <http://www.gnu.org/licenses/>.
package Automake::Getopt;
=head1 NAME
Automake::Getopt - GCS conforming parser for command line options
=head1 SYNOPSIS
use Automake::Getopt;
=head1 DESCRIPTION
Export a function C<parse_options>, performing parsing of command
line options in conformance to the GNU Coding standards.
=cut
use 5.006;
use strict;
use warnings FATAL => 'all';
use Exporter ();
use Getopt::Long ();
use Automake::ChannelDefs qw/fatal/;
use Carp qw/croak confess/;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
@EXPORT= qw/getopt/;
=item C<parse_options (%option)>
Wrapper around C<Getopt::Long>, trying to conform to the GNU
Coding Standards for error messages.
=cut
sub parse_options (%)
{
my %option = @_;
Getopt::Long::Configure ("bundling", "pass_through");
# Unrecognized options are passed through, so GetOption can only fail
# due to internal errors or misuse of options specification.
Getopt::Long::GetOptions (%option)
or confess "error in options specification (likely)";
if (@ARGV && $ARGV[0] =~ /^-./)
{
my %argopts;
for my $k (keys %option)
{
if ($k =~ /(.*)=s$/)
{
map { $argopts{(length ($_) == 1)
? "-$_" : "--$_" } = 1; } (split (/\|/, $1));
}
}
if ($ARGV[0] eq '--')
{
shift @ARGV;
}
elsif (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.");
}
}
}
=back
=head1 SEE ALSO
L<Getopt::Long>
=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:

View File

@ -0,0 +1,206 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Item;
use 5.006;
use strict;
use Carp;
use Automake::ChannelDefs;
use Automake::DisjConditions;
=head1 NAME
Automake::Item - base class for Automake::Variable and Automake::Rule
=head1 DESCRIPTION
=head2 Methods
=over 4
=item C<new Automake::Item $name>
Create and return an empty Item called C<$name>.
=cut
sub new ($$)
{
my ($class, $name) = @_;
my $self = {
name => $name,
defs => {},
conds => {},
};
bless $self, $class;
return $self;
}
=item C<$item-E<gt>name>
Return the name of C<$item>.
=cut
sub name ($)
{
my ($self) = @_;
return $self->{'name'};
}
=item C<$item-E<gt>def ($cond)>
Return the definition for this item in condition C<$cond>, if it
exists. Return 0 otherwise.
=cut
sub def ($$)
{
# This method is called very often, so keep it small and fast. We
# don't mind the extra undefined items introduced by lookup failure;
# avoiding this with 'exists' means doing two hash lookup on
# success, and proved worse on benchmark.
my $def = $_[0]->{'defs'}{$_[1]};
return defined $def && $def;
}
=item C<$item-E<gt>rdef ($cond)>
Return the definition for this item in condition C<$cond>. Abort with
an internal error if the item was not defined under this condition.
The I<r> in front of C<def> stands for I<required>. One
should call C<rdef> to assert the conditional definition's existence.
=cut
sub rdef ($$)
{
my ($self, $cond) = @_;
my $d = $self->def ($cond);
prog_error ("undefined condition '" . $cond->human . "' for '"
. $self->name . "'\n" . $self->dump)
unless $d;
return $d;
}
=item C<$item-E<gt>set ($cond, $def)>
Add a new definition to an existing item.
=cut
sub set ($$$)
{
my ($self, $cond, $def) = @_;
$self->{'defs'}{$cond} = $def;
$self->{'conds'}{$cond} = $cond;
}
=item C<$var-E<gt>conditions>
Return an L<Automake::DisjConditions> describing the conditions that
that an item is defined in.
These are all the conditions for which is would be safe to call
C<rdef>.
=cut
sub conditions ($)
{
my ($self) = @_;
prog_error ("self is not a reference")
unless ref $self;
return new Automake::DisjConditions (values %{$self->{'conds'}});
}
=item C<@missing_conds = $var-E<gt>not_always_defined_in_cond ($cond)>
Check whether C<$var> is always defined for condition C<$cond>.
Return a list of conditions where the definition is missing.
For instance, given
if COND1
if COND2
A = foo
D = d1
else
A = bar
D = d2
endif
else
D = d3
endif
if COND3
A = baz
B = mumble
endif
C = mumble
we should have (we display result as conditional strings in this
illustration, but we really return DisjConditions objects):
var ('A')->not_always_defined_in_cond ('COND1_TRUE COND2_TRUE')
=> ()
var ('A')->not_always_defined_in_cond ('COND1_TRUE')
=> ()
var ('A')->not_always_defined_in_cond ('TRUE')
=> ("COND1_FALSE COND3_FALSE")
var ('B')->not_always_defined_in_cond ('COND1_TRUE')
=> ("COND1_TRUE COND3_FALSE")
var ('C')->not_always_defined_in_cond ('COND1_TRUE')
=> ()
var ('D')->not_always_defined_in_cond ('TRUE')
=> ()
var ('Z')->not_always_defined_in_cond ('TRUE')
=> ("TRUE")
=cut
sub not_always_defined_in_cond ($$)
{
my ($self, $cond) = @_;
# Compute the subconditions where $var isn't defined.
return
$self->conditions
->sub_conditions ($cond)
->invert
->multiply ($cond);
}
1;
### 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:

View File

@ -0,0 +1,113 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::ItemDef;
use 5.006;
use strict;
use Carp;
=head1 NAME
Automake::ItemDef - base class for Automake::VarDef and Automake::RuleDef
=head1 DESCRIPTION
=head2 Methods
=over 4
=item C<my $def = Automake::new ($comment, $location, $owner)>
Create a new Makefile-item definition.
C<$comment> is any comment preceding the definition. (Because
Automake reorders items in the output, it also tries to carry comments
around.)
C<$location> is the place where the definition occurred, it should be
an instance of L<Automake::Location>.
C<$owner> specifies who owns the rule.
=cut
sub new ($$$$)
{
my ($class, $comment, $location, $owner) = @_;
my $self = {
comment => $comment,
location => $location,
owner => $owner,
};
bless $self, $class;
return $self;
}
=item C<$def-E<gt>comment>
=item C<$def-E<gt>location>
=item C<$def-E<gt>owner>
Accessors to the various constituents of an C<ItemDef>. See the
documentation of C<new>'s arguments for a description of these.
=cut
sub comment ($)
{
my ($self) = @_;
return $self->{'comment'};
}
sub location ($)
{
my ($self) = @_;
return $self->{'location'};
}
sub owner ($)
{
my ($self) = @_;
return $self->{'owner'};
}
=head1 SEE ALSO
L<Automake::VarDef>, and L<Automake::RuleDef>.
=cut
1;
### 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:

View File

@ -0,0 +1,122 @@
# Copyright (C) 2013-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Language;
use 5.006;
use strict;
use Class::Struct ();
Class::Struct::struct (
# Short name of the language (c, f77...).
'name' => "\$",
# Nice name of the language (C, Fortran 77...).
'Name' => "\$",
# List of configure variables which must be defined.
'config_vars' => '@',
# 'pure' is '1' or ''. A 'pure' language is one where, if
# all the files in a directory are of that language, then we
# do not require the C compiler or any code to call it.
'pure' => "\$",
'autodep' => "\$",
# Name of the compiling variable (COMPILE).
'compiler' => "\$",
# Content of the compiling variable.
'compile' => "\$",
# Flag to require compilation without linking (-c).
'compile_flag' => "\$",
'extensions' => '@',
# A subroutine to compute a list of possible extensions of
# the product given the input extensions.
# (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
'output_extensions' => "\$",
# A list of flag variables used in 'compile'.
# (defaults to [])
'flags' => "@",
# Any tag to pass to libtool while compiling.
'libtool_tag' => "\$",
# The file to use when generating rules for this language.
# The default is 'depend2'.
'rule_file' => "\$",
# Name of the linking variable (LINK).
'linker' => "\$",
# Content of the linking variable.
'link' => "\$",
# Name of the compiler variable (CC).
'ccer' => "\$",
# Name of the linker variable (LD).
'lder' => "\$",
# Content of the linker variable ($(CC)).
'ld' => "\$",
# Flag to specify the output file (-o).
'output_flag' => "\$",
'_finish' => "\$",
# This is a subroutine which is called whenever we finally
# determine the context in which a source file will be
# compiled.
'_target_hook' => "\$",
# If TRUE, nodist_ sources will be compiled using specific rules
# (i.e. not inference rules). The default is FALSE.
'nodist_specific' => "\$");
sub finish ($)
{
my ($self) = @_;
if (defined $self->_finish)
{
&{$self->_finish} (@_);
}
}
sub target_hook ($$$$%)
{
my ($self) = @_;
if (defined $self->_target_hook)
{
$self->_target_hook->(@_);
}
}
1;
### 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:

View File

@ -0,0 +1,279 @@
# Copyright (C) 2002-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Location;
use 5.006;
=head1 NAME
Automake::Location - a class for location tracking, with a stack of contexts
=head1 SYNOPSIS
use Automake::Location;
# Create a new Location object
my $where = new Automake::Location "foo.c:13";
# Change the location
$where->set ("foo.c:14");
# Get the location (without context).
# Here this should print "foo.c:14"
print $where->get, "\n";
# Push a context, and change the location
$where->push_context ("included from here");
$where->set ("bar.h:1");
# Print the location and the stack of context (for debugging)
print $where->dump;
# This should display
# bar.h:1:
# foo.c:14: included from here
# Get the contexts (list of [$location_string, $description])
for my $pair (reverse $where->contexts)
{
my ($loc, $descr) = @{$pair};
...
}
# Pop a context, and reset the location to the previous context.
$where->pop_context;
# Clone a Location. Use this when storing the state of a location
# that would otherwise be modified.
my $where_copy = $where->clone;
# Serialize a Location object (for passing through a thread queue,
# for example)
my @array = $where->serialize ();
# De-serialize: recreate a Location object from a queue.
my $where = new Automake::Location::deserialize ($queue);
=head1 DESCRIPTION
C<Location> objects are used to keep track of locations in Automake,
and used to produce diagnostics.
A C<Location> object is made of two parts: a location string, and
a stack of contexts.
For instance if C<VAR> is defined at line 1 in F<bar.h> which was
included at line 14 in F<foo.c>, then the location string should be
C<"bar.h:10"> and the context should be the pair (C<"foo.c:14">,
C<"included from here">).
Section I<SYNOPSIS> shows how to setup such a C<Location>, and access
the location string or the stack of contexts.
You can pass a C<Location> to C<Automake::Channels::msg>.
=cut
=head2 Methods
=over
=item C<$where = new Automake::Location ([$position])>
Create and return a new Location object.
=cut
sub new ($;$)
{
my ($class, $position) = @_;
my $self = {
position => $position,
contexts => [],
};
bless $self, $class;
return $self;
}
=item C<$location-E<gt>set ($position)>
Change the location to be C<$position>.
=cut
sub set ($$)
{
my ($self, $position) = @_;
$self->{'position'} = $position;
}
=item C<$location-E<gt>get>
Get the location (without context).
=cut
sub get ($)
{
my ($self) = @_;
return $self->{'position'};
}
=item C<$location-E<gt>push_context ($context)>
Push a context to the location.
=cut
sub push_context ($$)
{
my ($self, $context) = @_;
push @{$self->{'contexts'}}, [$self->get, $context];
$self->set (undef);
}
=item C<$where = $location-E<gt>pop_context ($context)>
Pop a context, and reset the location to the previous context.
=cut
sub pop_context ($)
{
my ($self) = @_;
my $pair = pop @{$self->{'contexts'}};
$self->set ($pair->[0]);
return @{$pair};
}
=item C<@contexts = $location-E<gt>get_contexts>
Return the array of contexts.
=cut
sub get_contexts ($)
{
my ($self) = @_;
return @{$self->{'contexts'}};
}
=item C<$location = $location-E<gt>clone>
Clone a Location. Use this when storing the state of a location
that would otherwise be modified.
=cut
sub clone ($)
{
my ($self) = @_;
my $other = new Automake::Location ($self->get);
my @contexts = $self->get_contexts;
for my $pair (@contexts)
{
push @{$other->{'contexts'}}, [@{$pair}];
}
return $other;
}
=item C<$res = $location-E<gt>dump>
Print the location and the stack of context (for debugging).
=cut
sub dump ($)
{
my ($self) = @_;
my $res = ($self->get || 'INTERNAL') . ":\n";
for my $pair (reverse $self->get_contexts)
{
$res .= $pair->[0] || 'INTERNAL';
$res .= ": $pair->[1]\n";
}
return $res;
}
=item C<@array = $location-E<gt>serialize>
Serialize a Location object (for passing through a thread queue,
for example).
=cut
sub serialize ($)
{
my ($self) = @_;
my @serial = ();
push @serial, $self->get;
my @contexts = $self->get_contexts;
for my $pair (@contexts)
{
push @serial, @{$pair};
}
push @serial, undef;
return @serial;
}
=item C<new Automake::Location::deserialize ($queue)>
De-serialize: recreate a Location object from a queue.
=cut
sub deserialize ($)
{
my ($queue) = @_;
my $position = $queue->dequeue ();
my $self = new Automake::Location $position;
while (my $position = $queue->dequeue ())
{
my $context = $queue->dequeue ();
push @{$self->{'contexts'}}, [$position, $context];
}
return $self;
}
=back
=head1 SEE ALSO
L<Automake::Channels>
=head1 HISTORY
Written by Alexandre Duret-Lutz E<lt>F<adl@gnu.org>E<gt>.
=cut
1;
### 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:

View File

@ -0,0 +1,57 @@
## Included by top-level Makefile for Automake.
## Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## ---------------------------------------------------- ##
## Private perl modules used by automake and aclocal. ##
## ---------------------------------------------------- ##
perllibdir = $(pkgvdatadir)/Automake
dist_perllib_DATA = \
%D%/ChannelDefs.pm \
%D%/Channels.pm \
%D%/Condition.pm \
%D%/Configure_ac.pm \
%D%/DisjConditions.pm \
%D%/FileUtils.pm \
%D%/General.pm \
%D%/Getopt.pm \
%D%/Item.pm \
%D%/ItemDef.pm \
%D%/Language.pm \
%D%/Location.pm \
%D%/Options.pm \
%D%/Rule.pm \
%D%/RuleDef.pm \
%D%/Variable.pm \
%D%/VarDef.pm \
%D%/Version.pm \
%D%/XFile.pm \
%D%/Wrap.pm
nodist_perllib_DATA = %D%/Config.pm
CLEANFILES += $(nodist_perllib_DATA)
%D%/Config.pm: %D%/Config.in Makefile
$(AM_V_at)rm -f $@ $@-t
$(AM_V_at)$(MKDIR_P) %D%
$(AM_V_GEN)in=Config.in \
&& $(do_subst) <$(srcdir)/%D%/Config.in >$@-t
$(generated_file_finalize)
EXTRA_DIST += %D%/Config.in
# vim: ft=automake noet

View File

@ -0,0 +1,476 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Options;
use 5.006;
use strict;
use Exporter;
use Automake::Config;
use Automake::ChannelDefs;
use Automake::Channels;
use Automake::Version;
use vars qw (@ISA @EXPORT);
@ISA = qw (Exporter);
@EXPORT = qw (option global_option
set_option set_global_option
unset_option unset_global_option
process_option_list process_global_option_list
set_strictness $strictness $strictness_name
&FOREIGN &GNU &GNITS);
=head1 NAME
Automake::Options - keep track of Automake options
=head1 SYNOPSIS
use Automake::Options;
# Option lookup and setting.
$opt = option 'name';
$opt = global_option 'name';
set_option 'name', 'value';
set_global_option 'name', 'value';
unset_option 'name';
unset_global_option 'name';
# Batch option setting.
process_option_list $location, @names;
process_global_option_list $location, @names;
# Strictness lookup and setting.
set_strictness 'foreign';
set_strictness 'gnu';
set_strictness 'gnits';
if ($strictness >= GNU) { ... }
print "$strictness_name\n";
=head1 DESCRIPTION
This packages manages Automake's options and strictness settings.
Options can be either local or global. Local options are set using an
C<AUTOMAKE_OPTIONS> variable in a F<Makefile.am> and apply only to
this F<Makefile.am>. Global options are set from the command line or
passed as an argument to C<AM_INIT_AUTOMAKE>, they apply to all
F<Makefile.am>s.
=cut
# Values are the Automake::Location of the definition.
use vars '%_options'; # From AUTOMAKE_OPTIONS
use vars '%_global_options'; # From AM_INIT_AUTOMAKE or the command line.
# Whether process_option_list has already been called for the current
# Makefile.am.
use vars '$_options_processed';
# Whether process_global_option_list has already been called.
use vars '$_global_options_processed';
=head2 Constants
=over 4
=item FOREIGN
=item GNU
=item GNITS
Strictness constants used as values for C<$strictness>.
=back
=cut
# Constants to define the "strictness" level.
use constant FOREIGN => 0;
use constant GNU => 1;
use constant GNITS => 2;
=head2 Variables
=over 4
=item C<$strictness>
The current strictness. One of C<FOREIGN>, C<GNU>, or C<GNITS>.
=item C<$strictness_name>
The current strictness name. One of C<'foreign'>, C<'gnu'>, or C<'gnits'>.
=back
=cut
# Strictness levels.
use vars qw ($strictness $strictness_name);
# Strictness level as set on command line.
use vars qw ($_default_strictness $_default_strictness_name);
=head2 Functions
=over 4
=item C<Automake::Options::reset>
Reset the options variables for the next F<Makefile.am>.
In other words, this gets rid of all local options in use by the
previous F<Makefile.am>.
=cut
sub reset ()
{
$_options_processed = 0;
%_options = %_global_options;
# The first time we are run,
# remember the current setting as the default.
if (defined $_default_strictness)
{
$strictness = $_default_strictness;
$strictness_name = $_default_strictness_name;
}
else
{
$_default_strictness = $strictness;
$_default_strictness_name = $strictness_name;
}
}
=item C<$value = option ($name)>
=item C<$value = global_option ($name)>
Query the state of an option. If the option is unset, this
returns the empty list. Otherwise it returns the option's value,
as set by C<set_option> or C<set_global_option>.
Note that C<global_option> should be used only when it is
important to make sure an option hasn't been set locally.
Otherwise C<option> should be the standard function to
check for options (be they global or local).
=cut
sub option ($)
{
my ($name) = @_;
return () unless defined $_options{$name};
return $_options{$name};
}
sub global_option ($)
{
my ($name) = @_;
return () unless defined $_global_options{$name};
return $_global_options{$name};
}
=item C<set_option ($name, $value)>
=item C<set_global_option ($name, $value)>
Set an option. By convention, C<$value> is usually the location
of the option definition.
=cut
sub set_option ($$)
{
my ($name, $value) = @_;
$_options{$name} = $value;
}
sub set_global_option ($$)
{
my ($name, $value) = @_;
$_global_options{$name} = $value;
}
=item C<unset_option ($name)>
=item C<unset_global_option ($name)>
Unset an option.
=cut
sub unset_option ($)
{
my ($name) = @_;
delete $_options{$name};
}
sub unset_global_option ($)
{
my ($name) = @_;
delete $_global_options{$name};
}
=item C<process_option_list (@list)>
=item C<process_global_option_list (@list)>
Process Automake's option lists. C<@list> should be a list of hash
references with keys C<option> and C<where>, where C<option> is an
option as they occur in C<AUTOMAKE_OPTIONS> or C<AM_INIT_AUTOMAKE>,
and C<where> is the location where that option occurred.
These functions should be called at most once for each set of options
having the same precedence; i.e., do not call it twice for two options
from C<AM_INIT_AUTOMAKE>.
Return 0 on error, 1 otherwise.
=cut
# $BOOL
# _option_is_from_configure ($OPTION, $WHERE)
# ----------------------------------------------
# Check that the $OPTION given in location $WHERE is specified with
# AM_INIT_AUTOMAKE, not with AUTOMAKE_OPTIONS.
sub _option_is_from_configure ($$)
{
my ($opt, $where)= @_;
return 1
if $where->get =~ /^configure\./;
error $where,
"option '$opt' can only be used as argument to AM_INIT_AUTOMAKE\n" .
"but not in AUTOMAKE_OPTIONS makefile statements";
return 0;
}
# $BOOL
# _is_valid_easy_option ($OPTION)
# -------------------------------
# Explicitly recognize valid automake options that require no
# special handling by '_process_option_list' below.
sub _is_valid_easy_option ($)
{
my $opt = shift;
return scalar grep { $opt eq $_ } qw(
check-news
color-tests
dejagnu
dist-bzip2
dist-lzip
dist-xz
dist-zip
info-in-builddir
no-define
no-dependencies
no-dist
no-dist-gzip
no-exeext
no-installinfo
no-installman
no-texinfo.tex
nostdinc
readme-alpha
serial-tests
parallel-tests
silent-rules
std-options
subdir-objects
);
}
# $BOOL
# _process_option_list (\%OPTIONS, @LIST)
# ------------------------------------------
# Process a list of options. \%OPTIONS is the hash to fill with options
# data. @LIST is a list of options as get passed to public subroutines
# process_option_list() and process_global_option_list() (see POD
# documentation above).
sub _process_option_list (\%@)
{
my ($options, @list) = @_;
my @warnings = ();
my $ret = 1;
foreach my $h (@list)
{
local $_ = $h->{'option'};
my $where = $h->{'where'};
$options->{$_} = $where;
if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign')
{
set_strictness ($_);
}
# TODO: Remove this special check in Automake 3.0.
elsif (/^(.*\/)?ansi2knr$/)
{
# Obsolete (and now removed) de-ANSI-fication support.
error ($where,
"automatic de-ANSI-fication support has been removed");
$ret = 0;
}
# TODO: Remove this special check in Automake 3.0.
elsif ($_ eq 'cygnus')
{
error $where, "support for Cygnus-style trees has been removed";
$ret = 0;
}
# TODO: Remove this special check in Automake 3.0.
elsif ($_ eq 'dist-lzma')
{
error ($where, "support for lzma-compressed distribution " .
"archives has been removed");
$ret = 0;
}
# TODO: Make this a fatal error in Automake 2.0.
elsif ($_ eq 'dist-shar')
{
msg ('obsolete', $where,
"support for shar distribution archives is deprecated.\n" .
" It will be removed in Automake 2.0");
}
# TODO: Make this a fatal error in Automake 2.0.
elsif ($_ eq 'dist-tarZ')
{
msg ('obsolete', $where,
"support for distribution archives compressed with " .
"legacy program 'compress' is deprecated.\n" .
" It will be removed in Automake 2.0");
}
elsif (/^filename-length-max=(\d+)$/)
{
delete $options->{$_};
$options->{'filename-length-max'} = [$_, $1];
}
elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
{
if (not _option_is_from_configure ($_, $where))
{
$ret = 0;
}
for my $opt ('tar-v7', 'tar-ustar', 'tar-pax')
{
next
if $opt eq $_ or ! exists $options->{$opt};
error ($where,
"options '$_' and '$opt' are mutually exclusive");
$ret = 0;
}
}
elsif (/^\d+\.\d+(?:\.\d+)?[a-z]?(?:-[A-Za-z0-9]+)?$/)
{
# Got a version number.
if (Automake::Version::check ($VERSION, $&))
{
error ($where, "require Automake $_, but have $VERSION");
$ret = 0;
}
}
elsif (/^(?:--warnings=|-W)(.*)$/)
{
my @w = map { { cat => $_, loc => $where} } split (',', $1);
push @warnings, @w;
}
elsif (! _is_valid_easy_option $_)
{
error ($where, "option '$_' not recognized");
$ret = 0;
}
}
# We process warnings here, so that any explicitly-given warning setting
# will take precedence over warning settings defined implicitly by the
# strictness.
foreach my $w (@warnings)
{
msg 'unsupported', $w->{'loc'},
"unknown warning category '$w->{'cat'}'"
if switch_warning $w->{cat};
}
return $ret;
}
sub process_option_list (@)
{
prog_error "local options already processed"
if $_options_processed;
$_options_processed = 1;
_process_option_list (%_options, @_);
}
sub process_global_option_list (@)
{
prog_error "global options already processed"
if $_global_options_processed;
$_global_options_processed = 1;
_process_option_list (%_global_options, @_);
}
=item C<set_strictness ($name)>
Set the current strictness level.
C<$name> should be one of C<'foreign'>, C<'gnu'>, or C<'gnits'>.
=cut
# Set strictness.
sub set_strictness ($)
{
$strictness_name = $_[0];
Automake::ChannelDefs::set_strictness ($strictness_name);
if ($strictness_name eq 'gnu')
{
$strictness = GNU;
}
elsif ($strictness_name eq 'gnits')
{
$strictness = GNITS;
}
elsif ($strictness_name eq 'foreign')
{
$strictness = FOREIGN;
}
else
{
prog_error "level '$strictness_name' not recognized";
}
}
1;
### 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:

View File

@ -0,0 +1,879 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Rule;
use 5.006;
use strict;
use Carp;
use Automake::Item;
use Automake::RuleDef;
use Automake::ChannelDefs;
use Automake::Channels;
use Automake::Options;
use Automake::Condition qw (TRUE FALSE);
use Automake::DisjConditions;
require Exporter;
use vars '@ISA', '@EXPORT', '@EXPORT_OK';
@ISA = qw/Automake::Item Exporter/;
@EXPORT = qw (reset register_suffix_rule next_in_suffix_chain
suffixes rules $KNOWN_EXTENSIONS_PATTERN
depend %dependencies %actions register_action
accept_extensions
reject_rule msg_rule msg_cond_rule err_rule err_cond_rule
rule rrule ruledef rruledef);
=head1 NAME
Automake::Rule - support for rules definitions
=head1 SYNOPSIS
use Automake::Rule;
use Automake::RuleDef;
=head1 DESCRIPTION
This package provides support for Makefile rule definitions.
An C<Automake::Rule> is a rule name associated to possibly
many conditional definitions. These definitions are instances
of C<Automake::RuleDef>.
Therefore obtaining the value of a rule under a given
condition involves two lookups. One to look up the rule,
and one to look up the conditional definition:
my $rule = rule $name;
if ($rule)
{
my $def = $rule->def ($cond);
if ($def)
{
return $def->location;
}
...
}
...
when it is known that the rule and the definition
being looked up exist, the above can be simplified to
return rule ($name)->def ($cond)->location; # do not write this.
but is better written
return rrule ($name)->rdef ($cond)->location;
or even
return rruledef ($name, $cond)->location;
The I<r> variants of the C<rule>, C<def>, and C<ruledef> methods add
an extra test to ensure that the lookup succeeded, and will diagnose
failures as internal errors (with a message which is much more
informative than Perl's warning about calling a method on a
non-object).
=head2 Global variables
=over 4
=cut
my $_SUFFIX_RULE_PATTERN =
'^(\.[a-zA-Z0-9_(){}$+@\-]+)(\.[a-zA-Z0-9_(){}$+@\-]+)' . "\$";
my @_suffixes = ();
my @_known_extensions_list = ();
my %_rule_dict = ();
# See comments in the implementation of the 'next_in_suffix_chain()'
# variable for details.
my %_suffix_rules;
# Same as $suffix_rules, but records only the default rules
# supplied by the languages Automake supports.
my %_suffix_rules_builtin;
=item C<%dependencies>
Holds the dependencies of targets which dependencies are factored.
Typically, C<.PHONY> will appear in plenty of F<*.am> files, but must
be output once. Arguably all pure dependencies could be subject to
this factoring, but it is not unpleasant to have paragraphs in
Makefile: keeping related stuff altogether.
=cut
use vars '%dependencies';
=item <%actions>
Holds the factored actions. Tied to C<%dependencies>, i.e., filled
only when keys exists in C<%dependencies>.
=cut
use vars '%actions';
=item C<$KNOWN_EXTENSIONS_PATTERN>
Pattern that matches all know input extensions (i.e. extensions used
by the languages supported by Automake). Using this pattern (instead
of '\..*$') to match extensions allows Automake to support dot-less
extensions.
New extensions should be registered with C<accept_extensions>.
=cut
use vars qw ($KNOWN_EXTENSIONS_PATTERN);
$KNOWN_EXTENSIONS_PATTERN = "";
=back
=head2 Error reporting functions
In these functions, C<$rule> can be either a rule name, or
an instance of C<Automake::Rule>.
=over 4
=item C<err_rule ($rule, $message, [%options])>
Uncategorized errors about rules.
=cut
sub err_rule ($$;%)
{
msg_rule ('error', @_);
}
=item C<err_cond_rule ($cond, $rule, $message, [%options])>
Uncategorized errors about conditional rules.
=cut
sub err_cond_rule ($$$;%)
{
msg_cond_rule ('error', @_);
}
=item C<msg_cond_rule ($channel, $cond, $rule, $message, [%options])>
Messages about conditional rules.
=cut
sub msg_cond_rule ($$$$;%)
{
my ($channel, $cond, $rule, $msg, %opts) = @_;
my $r = ref ($rule) ? $rule : rrule ($rule);
msg $channel, $r->rdef ($cond)->location, $msg, %opts;
}
=item C<msg_rule ($channel, $targetname, $message, [%options])>
Messages about rules.
=cut
sub msg_rule ($$$;%)
{
my ($channel, $rule, $msg, %opts) = @_;
my $r = ref ($rule) ? $rule : rrule ($rule);
# Don't know which condition is concerned. Pick any.
my $cond = $r->conditions->one_cond;
msg_cond_rule ($channel, $cond, $r, $msg, %opts);
}
=item C<$bool = reject_rule ($rule, $error_msg)>
Bail out with C<$error_msg> if a rule with name C<$rule> has been
defined.
Return true iff C<$rule> is defined.
=cut
sub reject_rule ($$)
{
my ($rule, $msg) = @_;
if (rule ($rule))
{
err_rule $rule, $msg;
return 1;
}
return 0;
}
=back
=head2 Administrative functions
=over 4
=item C<accept_extensions (@exts)>
Update C<$KNOWN_EXTENSIONS_PATTERN> to recognize the extensions
listed in C<@exts>. Extensions should contain a dot if needed.
=cut
sub accept_extensions (@)
{
push @_known_extensions_list, @_;
$KNOWN_EXTENSIONS_PATTERN =
'(?:' . join ('|', map (quotemeta, @_known_extensions_list)) . ')';
}
=item C<rules>
Return the list of all L<Automake::Rule> instances. (I.e., all
rules defined so far.)
=cut
sub rules ()
{
return values %_rule_dict;
}
=item C<register_action($target, $action)>
Append the C<$action> to C<$actions{$target}> taking care of special
cases.
=cut
sub register_action ($$)
{
my ($target, $action) = @_;
if ($actions{$target})
{
$actions{$target} .= "\n$action" if $action;
}
else
{
$actions{$target} = $action;
}
}
=item C<Automake::Rule::reset>
The I<forget all> function. Clears all known rules and resets some
other internal data.
=cut
sub reset()
{
%_rule_dict = ();
@_suffixes = ();
%_suffix_rules = %_suffix_rules_builtin;
%dependencies =
(
# Texinfoing.
'dvi' => [],
'dvi-am' => [],
'pdf' => [],
'pdf-am' => [],
'ps' => [],
'ps-am' => [],
'info' => [],
'info-am' => [],
'html' => [],
'html-am' => [],
# Installing/uninstalling.
'install-data-am' => [],
'install-exec-am' => [],
'uninstall-am' => [],
'install-man' => [],
'uninstall-man' => [],
'install-dvi' => [],
'install-dvi-am' => [],
'install-html' => [],
'install-html-am' => [],
'install-info' => [],
'install-info-am' => [],
'install-pdf' => [],
'install-pdf-am' => [],
'install-ps' => [],
'install-ps-am' => [],
'installcheck-am' => [],
# Cleaning.
'clean-am' => [],
'mostlyclean-am' => [],
'maintainer-clean-am' => [],
'distclean-am' => [],
'clean' => [],
'mostlyclean' => [],
'maintainer-clean' => [],
'distclean' => [],
# Tarballing.
'dist-all' => [],
'.PHONY' => [],
'.PRECIOUS' => [],
# Recursive install targets (so "make -n install" works for BSD Make).
'.MAKE' => [],
);
%actions = ();
}
=item C<next_in_suffix_chain ($ext1, $ext2)>
Return the target suffix for the next rule to use to reach C<$ext2>
from C<$ext1>, or C<undef> if no such rule exists.
=cut
sub next_in_suffix_chain ($$)
{
my ($ext1, $ext2) = @_;
return undef unless (exists $_suffix_rules{$ext1} and
exists $_suffix_rules{$ext1}{$ext2});
return $_suffix_rules{$ext1}{$ext2}[0];
}
=item C<register_suffix_rule ($where, $src, $dest)>
Register a suffix rule defined on C<$where> that transforms
files ending in C<$src> into files ending in C<$dest>.
=cut
sub register_suffix_rule ($$$)
{
my ($where, $src, $dest) = @_;
my $suffix_rules = $where->{'position'} ? \%_suffix_rules
: \%_suffix_rules_builtin;
verb "Sources ending in $src become $dest";
push @_suffixes, $src, $dest;
# When transforming sources to objects, Automake uses the
# %suffix_rules to move from each source extension to
# '.$(OBJEXT)', not to '.o' or '.obj'. However some people
# define suffix rules for '.o' or '.obj', so internally we will
# consider these extensions equivalent to '.$(OBJEXT)'. We
# CANNOT rewrite the target (i.e., automagically replace '.o'
# and '.obj' by '.$(OBJEXT)' in the output), or warn the user
# that (s)he'd better use '.$(OBJEXT)', because Automake itself
# output suffix rules for '.o' or '.obj' ...
$dest = '.$(OBJEXT)' if ($dest eq '.o' || $dest eq '.obj');
# ----------------------------------------------------------------------
# The $suffix_rules variable maps the source extension for all suffix
# rules seen to a hash whose keys are the possible output extensions.
#
# Note that this is transitively closed by construction:
# if we have
#
# exists $suffix_rules{$ext1}{$ext2}
# && exists $suffix_rules{$ext2}{$ext3}
#
# then we also have
#
# exists $suffix_rules{$ext1}{$ext3}
#
# So it's easy to check whether '.foo' can be transformed to
# '.$(OBJEXT)' by checking whether $suffix_rules{'.foo'}{'.$(OBJEXT)'}
# exists. This will work even if transforming '.foo' to '.$(OBJEXT)'
# involves a chain of several suffix rules.
#
# The value of $suffix_rules{$ext1}{$ext2} is a pair [$next_sfx, $dist]
# where $next_sfx is target suffix for the next rule to use to reach
# $ext2, and $dist the distance to $ext2.
# ----------------------------------------------------------------------
# Register $dest as a possible destination from $src.
# We might have the create the \hash.
if (exists $suffix_rules->{$src})
{
$suffix_rules->{$src}{$dest} = [ $dest, 1 ];
}
else
{
$suffix_rules->{$src} = { $dest => [ $dest, 1 ] };
}
# If we know how to transform $dest in something else, then
# we know how to transform $src in that "something else".
if (exists $suffix_rules->{$dest})
{
for my $dest2 (keys %{$suffix_rules->{$dest}})
{
my $dist = $suffix_rules->{$dest}{$dest2}[1] + 1;
# Overwrite an existing $src->$dest2 path only if
# the path via $dest which is shorter.
if (! exists $suffix_rules->{$src}{$dest2}
|| $suffix_rules->{$src}{$dest2}[1] > $dist)
{
$suffix_rules->{$src}{$dest2} = [ $dest, $dist ];
}
}
}
# Similarly, any extension that can be derived into $src
# can be derived into the same extensions as $src can.
my @dest2 = keys %{$suffix_rules->{$src}};
for my $src2 (keys %$suffix_rules)
{
if (exists $suffix_rules->{$src2}{$src})
{
for my $dest2 (@dest2)
{
my $dist = $suffix_rules->{$src}{$dest2} + 1;
# Overwrite an existing $src2->$dest2 path only if
# the path via $src is shorter.
if (! exists $suffix_rules->{$src2}{$dest2}
|| $suffix_rules->{$src2}{$dest2}[1] > $dist)
{
$suffix_rules->{$src2}{$dest2} = [ $src, $dist ];
}
}
}
}
}
=item C<@list = suffixes>
Return the list of known suffixes.
=cut
sub suffixes ()
{
return @_suffixes;
}
=item C<rule ($rulename)>
Return the C<Automake::Rule> object for the rule
named C<$rulename> if defined. Return 0 otherwise.
=cut
sub rule ($)
{
my ($name) = @_;
# Strip $(EXEEXT) from $name, so we can diagnose
# a clash if 'ctags$(EXEEXT):' is redefined after 'ctags:'.
$name =~ s,\$\(EXEEXT\)$,,;
return $_rule_dict{$name} || 0;
}
=item C<ruledef ($rulename, $cond)>
Return the C<Automake::RuleDef> object for the rule named
C<$rulename> if defined in condition C<$cond>. Return false
if the condition or the rule does not exist.
=cut
sub ruledef ($$)
{
my ($name, $cond) = @_;
my $rule = rule $name;
return $rule && $rule->def ($cond);
}
=item C<rrule ($rulename)
Return the C<Automake::Rule> object for the variable named
C<$rulename>. Abort with an internal error if the variable was not
defined.
The I<r> in front of C<var> stands for I<required>. One
should call C<rvar> to assert the rule's existence.
=cut
sub rrule ($)
{
my ($name) = @_;
my $r = rule $name;
prog_error ("undefined rule $name\n" . &rules_dump)
unless $r;
return $r;
}
=item C<rruledef ($varname, $cond)>
Return the C<Automake::RuleDef> object for the rule named
C<$rulename> if defined in condition C<$cond>. Abort with an internal
error if the condition or the rule does not exist.
=cut
sub rruledef ($$)
{
my ($name, $cond) = @_;
return rrule ($name)->rdef ($cond);
}
# Create the variable if it does not exist.
# This is used only by other functions in this package.
sub _crule ($)
{
my ($name) = @_;
my $r = rule $name;
return $r if $r;
return _new Automake::Rule $name;
}
sub _new ($$)
{
my ($class, $name) = @_;
# Strip $(EXEEXT) from $name, so we can diagnose
# a clash if 'ctags$(EXEEXT):' is redefined after 'ctags:'.
(my $keyname = $name) =~ s,\$\(EXEEXT\)$,,;
my $self = Automake::Item::new ($class, $name);
$_rule_dict{$keyname} = $self;
return $self;
}
sub _rule_defn_with_exeext_awareness ($$$)
{
my ($target, $cond, $where) = @_;
# For now 'foo:' will override 'foo$(EXEEXT):'. This is temporary,
# though, so we emit a warning.
(my $noexe = $target) =~ s/\$\(EXEEXT\)$//;
my $noexerule = rule $noexe;
my $tdef = $noexerule ? $noexerule->def ($cond) : undef;
if ($noexe ne $target
&& $tdef
&& $noexerule->name ne $target)
{
# The no-exeext option enables this feature.
if (! option 'no-exeext')
{
msg ('obsolete', $tdef->location,
"deprecated feature: target '$noexe' overrides "
. "'$noexe\$(EXEEXT)'\n"
. "change your target to read '$noexe\$(EXEEXT)'",
partial => 1);
msg ('obsolete', $where, "target '$target' was defined here");
}
}
return $tdef;
}
sub _maybe_warn_about_duplicated_target ($$$$$$)
{
my ($target, $tdef, $source, $owner, $cond, $where) = @_;
my $oldowner = $tdef->owner;
# Ok, it's the name target, but the name maybe different because
# 'foo$(EXEEXT)' and 'foo' have the same key in our table.
my $oldname = $tdef->name;
# Don't mention true conditions in diagnostics.
my $condmsg =
$cond == TRUE ? '' : (" in condition '" . $cond->human . "'");
if ($owner == RULE_USER)
{
if ($oldowner == RULE_USER)
{
# Ignore '%'-style pattern rules. We'd need the
# dependencies to detect duplicates, and they are
# already diagnosed as unportable by -Wportability.
if ($target !~ /^[^%]*%[^%]*$/)
{
## FIXME: Presently we can't diagnose duplicate user rules
## because we don't distinguish rules with commands
## from rules that only add dependencies. E.g.,
## .PHONY: foo
## .PHONY: bar
## is legitimate. This is checked in the 'phony.sh' test.
# msg ('syntax', $where,
# "redefinition of '$target'$condmsg ...", partial => 1);
# msg_cond_rule ('syntax', $cond, $target,
# "... '$target' previously defined here");
}
}
else
{
# Since we parse the user Makefile.am before reading
# the Automake fragments, this condition should never happen.
prog_error ("user target '$target'$condmsg seen after Automake's"
. " definition\nfrom " . $tdef->source);
}
}
else # $owner == RULE_AUTOMAKE
{
if ($oldowner == RULE_USER)
{
# -am targets listed in %dependencies support a -local
# variant. If the user tries to override TARGET or
# TARGET-am for which there exists a -local variant,
# just tell the user to use it.
my $hint = 0;
my $noam = $target;
$noam =~ s/-am$//;
if (exists $dependencies{"$noam-am"})
{
$hint = "consider using $noam-local instead of $target";
}
msg_cond_rule ('override', $cond, $target,
"user target '$target' defined here"
. "$condmsg ...", partial => 1);
msg ('override', $where,
"... overrides Automake target '$oldname' defined here",
partial => $hint);
msg_cond_rule ('override', $cond, $target, $hint)
if $hint;
}
else # $oldowner == RULE_AUTOMAKE
{
# Automake should ignore redefinitions of its own
# rules if they came from the same file. This makes
# it easier to process a Makefile fragment several times.
# However it's an error if the target is defined in many
# files. E.g., the user might be using bin_PROGRAMS = ctags
# which clashes with our 'ctags' rule.
# (It would be more accurate if we had a way to compare
# the *content* of both rules. Then $targets_source would
# be useless.)
my $oldsource = $tdef->source;
if (not ($source eq $oldsource && $target eq $oldname))
{
msg ('syntax',
$where, "redefinition of '$target'$condmsg ...",
partial => 1);
msg_cond_rule ('syntax', $cond, $target,
"... '$oldname' previously defined here");
}
}
}
}
# Return the list of conditionals in which the rule was defined. In case
# an ambiguous conditional definition is detected, return the empty list.
sub _conditionals_for_rule ($$$$)
{
my ($rule, $owner, $cond, $where) = @_;
my $target = $rule->name;
my @conds;
my ($message, $ambig_cond) = $rule->conditions->ambiguous_p ($target, $cond);
return $cond if !$message; # No ambiguity.
if ($owner == RULE_USER)
{
# For user rules, just diagnose the ambiguity.
msg 'syntax', $where, "$message ...", partial => 1;
msg_cond_rule ('syntax', $ambig_cond, $target,
"... '$target' previously defined here");
return ();
}
# FIXME: for Automake rules, we can't diagnose ambiguities yet.
# The point is that Automake doesn't propagate conditions
# everywhere. For instance &handle_PROGRAMS doesn't care if
# bin_PROGRAMS was defined conditionally or not.
# On the following input
# if COND1
# foo:
# ...
# else
# bin_PROGRAMS = foo
# endif
# &handle_PROGRAMS will attempt to define a 'foo:' rule
# in condition TRUE (which conflicts with COND1). Fixing
# this in &handle_PROGRAMS and siblings seems hard: you'd
# have to explain &file_contents what to do with a
# condition. So for now we do our best *here*. If 'foo:'
# was already defined in condition COND1 and we want to define
# it in condition TRUE, then define it only in condition !COND1.
# (See cond14.sh and cond15.sh for some test cases.)
@conds = $rule->not_always_defined_in_cond ($cond)->conds;
# No conditions left to define the rule.
# Warn, because our workaround is meaningless in this case.
if (scalar @conds == 0)
{
msg 'syntax', $where, "$message ...", partial => 1;
msg_cond_rule ('syntax', $ambig_cond, $target,
"... '$target' previously defined here");
return ();
}
return @conds;
}
=item C<@conds = define ($rulename, $source, $owner, $cond, $where)>
Define a new rule. C<$rulename> is the list of targets. C<$source>
is the filename the rule comes from. C<$owner> is the owner of the
rule (C<RULE_AUTOMAKE> or C<RULE_USER>). C<$cond> is the
C<Automake::Condition> under which the rule is defined. C<$where> is
the C<Automake::Location> where the rule is defined.
Returns a (possibly empty) list of C<Automake::Condition>s where the
rule's definition should be output.
=cut
sub define ($$$$$)
{
my ($target, $source, $owner, $cond, $where) = @_;
prog_error "$where is not a reference"
unless ref $where;
prog_error "$cond is not a reference"
unless ref $cond;
# Don't even think about defining a rule in condition FALSE.
return () if $cond == FALSE;
my $tdef = _rule_defn_with_exeext_awareness ($target, $cond, $where);
# A GNU make-style pattern rule has a single "%" in the target name.
msg ('portability', $where,
"'%'-style pattern rules are a GNU make extension")
if $target =~ /^[^%]*%[^%]*$/;
# See whether this is a duplicated target declaration.
if ($tdef)
{
# Diagnose invalid target redefinitions, if any. Note that some
# target redefinitions are valid (e.g., for multiple-targets
# pattern rules).
_maybe_warn_about_duplicated_target ($target, $tdef, $source,
$owner, $cond, $where);
# Return so we don't redefine the rule in our tables, don't check
# for ambiguous condition, etc. The rule will be output anyway
# because '&read_am_file' ignores the return code.
return ();
}
my $rule = _crule $target;
# Conditions for which the rule should be defined. Due to some
# complications in the automake internals, this aspect is not as
# obvious as it might be, and in come cases this list must contain
# other entries in addition to '$cond'. See the comments in
# '_conditionals_for_rule' for a rationale.
my @conds = _conditionals_for_rule ($rule, $owner, $cond, $where);
# Stop if we had ambiguous conditional definitions.
return unless @conds;
# Finally define this rule.
for my $c (@conds)
{
my $def = new Automake::RuleDef ($target, '', $where->clone,
$owner, $source);
$rule->set ($c, $def);
}
# We honor inference rules with multiple targets because many
# makes support this and people use it. However this is disallowed
# by POSIX. We'll print a warning later.
my $target_count = 0;
my $inference_rule_count = 0;
for my $t (split (' ', $target))
{
++$target_count;
# Check if the rule is a suffix rule: either it's a rule for
# two known extensions...
if ($t =~ /^($KNOWN_EXTENSIONS_PATTERN)($KNOWN_EXTENSIONS_PATTERN)$/
# ...or it's a rule with unknown extensions (i.e., the rule
# looks like '.foo.bar:' but '.foo' or '.bar' are not
# declared in SUFFIXES and are not known language
# extensions). Automake will complete SUFFIXES from
# @suffixes automatically (see handle_footer).
|| ($t =~ /$_SUFFIX_RULE_PATTERN/o && accept_extensions($1)))
{
++$inference_rule_count;
register_suffix_rule ($where, $1, $2);
}
}
# POSIX allows multiple targets before the colon, but disallows
# definitions of multiple inference rules. It's also
# disallowed to mix plain targets with inference rules.
msg ('portability', $where,
"inference rules can have only one target before the colon (POSIX)")
if $inference_rule_count > 0 && $target_count > 1;
return @conds;
}
=item C<depend ($target, @deps)>
Adds C<@deps> to the dependencies of target C<$target>. This should
be used only with factored targets (those appearing in
C<%dependees>).
=cut
sub depend ($@)
{
my ($category, @dependees) = @_;
push (@{$dependencies{$category}}, @dependees);
}
=back
=head1 SEE ALSO
L<Automake::RuleDef>, L<Automake::Condition>,
L<Automake::DisjConditions>, L<Automake::Location>.
=cut
1;
### 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:

View File

@ -0,0 +1,129 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::RuleDef;
use 5.006;
use strict;
use Carp;
use Automake::ChannelDefs;
use Automake::ItemDef;
require Exporter;
use vars '@ISA', '@EXPORT';
@ISA = qw/Automake::ItemDef Exporter/;
@EXPORT = qw (&RULE_AUTOMAKE &RULE_USER);
=head1 NAME
Automake::RuleDef - a class for rule definitions
=head1 SYNOPSIS
use Automake::RuleDef;
use Automake::Location;
=head1 DESCRIPTION
This class gathers data related to one Makefile-rule definition.
It shouldn't be needed outside of F<Rule.pm>.
=head2 Constants
=over 4
=item C<RULE_AUTOMAKE>, C<RULE_USER>
Possible owners for rules.
=cut
use constant RULE_AUTOMAKE => 0; # Rule defined by Automake.
use constant RULE_USER => 1; # Rule defined in the user's Makefile.am.
=back
=head2 Methods
=over 4
=item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
Create a new rule definition with target C<$name>, with associated comment
C<$comment>, Location C<$location> and owner C<$owner>, defined in file
C<$source>.
=cut
sub new ($$$$$)
{
my ($class, $name, $comment, $location, $owner, $source) = @_;
my $self = Automake::ItemDef::new ($class, $comment, $location, $owner);
$self->{'source'} = $source;
$self->{'name'} = $name;
return $self;
}
=item C<$source = $rule-E<gt>source>
Return the source of the rule.
=cut
sub source ($)
{
my ($self) = @_;
return $self->{'source'};
}
=item C<$name = $rule-E<gt>name>
Return the name of the rule.
=cut
sub name ($)
{
my ($self) = @_;
return $self->{'name'};
}
=back
=head1 SEE ALSO
L<Automake::Rule>, L<Automake::ItemDef>.
=cut
1;
### 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:

View File

@ -0,0 +1,349 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::VarDef;
use 5.006;
use strict;
use Carp;
use Automake::ChannelDefs;
use Automake::ItemDef;
require Exporter;
use vars '@ISA', '@EXPORT';
@ISA = qw/Automake::ItemDef Exporter/;
@EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE
&VAR_ASIS &VAR_PRETTY &VAR_SILENT &VAR_SORTED);
=head1 NAME
Automake::VarDef - a class for variable definitions
=head1 SYNOPSIS
use Automake::VarDef;
use Automake::Location;
# Create a VarDef for a definition such as
# | # any comment
# | foo = bar # more comment
# in Makefile.am
my $loc = new Automake::Location 'Makefile.am:2';
my $def = new Automake::VarDef ('foo', 'bar # more comment',
'# any comment',
$loc, '', VAR_MAKEFILE, VAR_ASIS);
# Appending to a definition.
$def->append ('value to append', 'comment to append');
# Accessors.
my $value = $def->value; # with trailing '#' comments and
# continuation ("\\\n") omitted.
my $value = $def->raw_value; # the real value, as passed to new().
my $comment = $def->comment;
my $location = $def->location;
my $type = $def->type;
my $owner = $def->owner;
my $pretty = $def->pretty;
# Changing owner.
$def->set_owner (VAR_CONFIGURE,
new Automake::Location 'configure.ac:15');
# Marking examined definitions.
$def->set_seen;
my $seen_p = $def->seen;
# Printing a variable for debugging.
print STDERR $def->dump;
=head1 DESCRIPTION
This class gathers data related to one Makefile-variable definition.
=head2 Constants
=over 4
=item C<VAR_AUTOMAKE>, C<VAR_CONFIGURE>, C<VAR_MAKEFILE>
Possible owners for variables. A variable can be defined
by Automake, in F<configure.ac> (using C<AC_SUBST>), or in
the user's F<Makefile.am>.
=cut
# Defined so that the owner of a variable can only be increased (e.g
# Automake should not override a configure or Makefile variable).
use constant VAR_AUTOMAKE => 0; # Variable defined by Automake.
use constant VAR_CONFIGURE => 1;# Variable defined in configure.ac.
use constant VAR_MAKEFILE => 2; # Variable defined in Makefile.am.
=item C<VAR_ASIS>, C<VAR_PRETTY>, C<VAR_SILENT>, C<VAR_SORTED>
Possible print styles. C<VAR_ASIS> variables should be output as-is.
C<VAR_PRETTY> variables are wrapped on multiple lines if they cannot
fit on one. C<VAR_SILENT> variables are not output at all. Finally,
C<VAR_SORTED> variables should be sorted and then handled as
C<VAR_PRETTY> variables.
C<VAR_SILENT> variables can also be overridden silently (unlike the
other kinds of variables whose overriding may sometimes produce
warnings).
=cut
# Possible values for pretty.
use constant VAR_ASIS => 0; # Output as-is.
use constant VAR_PRETTY => 1; # Pretty printed on output.
use constant VAR_SILENT => 2; # Not output. (Can also be
# overridden silently.)
use constant VAR_SORTED => 3; # Sorted and pretty-printed.
=back
=head2 Methods
C<VarDef> defines the following methods in addition to those inherited
from L<Automake::ItemDef>.
=over 4
=item C<my $def = new Automake::VarDef ($varname, $value, $comment, $location, $type, $owner, $pretty)>
Create a new Makefile-variable definition. C<$varname> is the name of
the variable being defined and C<$value> its value.
C<$comment> is any comment preceding the definition. (Because
Automake reorders variable definitions in the output, it also tries to
carry comments around.)
C<$location> is the place where the definition occurred, it should be
an instance of L<Automake::Location>.
C<$type> should be C<''> for definitions made with C<=>, and C<':'>
for those made with C<:=>.
C<$owner> specifies who owns the variables, it can be one of
C<VAR_AUTOMAKE>, C<VAR_CONFIGURE>, or C<VAR_MAKEFILE> (see these
definitions).
Finally, C<$pretty> tells how the variable should be output, and can
be one of C<VAR_ASIS>, C<VAR_PRETTY>, or C<VAR_SILENT>, or
C<VAR_SORTED> (see these definitions).
=cut
sub new ($$$$$$$$)
{
my ($class, $var, $value, $comment, $location, $type, $owner, $pretty) = @_;
# A user variable must be set by either '=' or ':=', and later
# promoted to '+='.
if ($owner != VAR_AUTOMAKE && $type eq '+')
{
error $location, "$var must be set with '=' before using '+='";
}
my $self = Automake::ItemDef::new ($class, $comment, $location, $owner);
$self->{'value'} = $value;
$self->{'type'} = $type;
$self->{'pretty'} = $pretty;
$self->{'seen'} = 0;
return $self;
}
=item C<$def-E<gt>append ($value, $comment)>
Append C<$value> and <$comment> to the existing value and comment of
C<$def>. This is normally called on C<+=> definitions.
=cut
sub append ($$$)
{
my ($self, $value, $comment) = @_;
$self->{'comment'} .= $comment;
my $val = $self->{'value'};
# Strip comments from augmented variables. This is so that
# VAR = foo # com
# VAR += bar
# does not become
# VAR = foo # com bar
# Furthermore keeping '#' would not be portable if the variable is
# output on multiple lines.
$val =~ s/ ?#.*//;
# Insert a separator, if required.
$val .= ' ' if $val;
$self->{'value'} = $val . $value;
# Turn ASIS appended variables into PRETTY variables. This is to
# cope with 'make' implementation that cannot read very long lines.
$self->{'pretty'} = VAR_PRETTY if $self->{'pretty'} == VAR_ASIS;
}
=item C<$def-E<gt>value>
=item C<$def-E<gt>raw_value>
=item C<$def-E<gt>type>
=item C<$def-E<gt>pretty>
Accessors to the various constituents of a C<VarDef>. See the
documentation of C<new>'s arguments for a description of these.
=cut
sub value ($)
{
my ($self) = @_;
my $val = $self->raw_value;
# Strip anything past '#'. '#' characters cannot be escaped
# in Makefiles, so we don't have to be smart.
$val =~ s/#.*$//s;
# Strip backslashes.
$val =~ s/\\$/ /mg;
return $val;
}
sub raw_value ($)
{
my ($self) = @_;
return $self->{'value'};
}
sub type ($)
{
my ($self) = @_;
return $self->{'type'};
}
sub pretty ($)
{
my ($self) = @_;
return $self->{'pretty'};
}
=item C<$def-E<gt>set_owner ($owner, $location)>
Change the owner of a definition. This usually happens because
the user used C<+=> on an Automake variable, so (s)he now owns
the content. C<$location> should be an instance of L<Automake::Location>
indicating where the change took place.
=cut
sub set_owner ($$$)
{
my ($self, $owner, $location) = @_;
# We always adjust the location when the owner changes (even for
# '+=' statements). The risk otherwise is to warn about
# a VAR_MAKEFILE variable and locate it in configure.ac...
$self->{'owner'} = $owner;
$self->{'location'} = $location;
}
=item C<$def-E<gt>set_seen>
=item C<$bool = $def-E<gt>seen>
These function allows Automake to mark (C<set_seen>) variable that
it has examined in some way, and latter check (using C<seen>) for
unused variables. Unused variables usually indicate typos.
=cut
sub set_seen ($)
{
my ($self) = @_;
$self->{'seen'} = 1;
}
sub seen ($)
{
my ($self) = @_;
return $self->{'seen'};
}
=item C<$str = $def-E<gt>dump>
Format the contents of C<$def> as a human-readable string,
for debugging.
=cut
sub dump ($)
{
my ($self) = @_;
my $owner = $self->owner;
if ($owner == VAR_AUTOMAKE)
{
$owner = 'Automake';
}
elsif ($owner == VAR_CONFIGURE)
{
$owner = 'Configure';
}
elsif ($owner == VAR_MAKEFILE)
{
$owner = 'Makefile';
}
else
{
prog_error ("unexpected owner");
}
my $where = $self->location->dump;
my $comment = $self->comment;
my $value = $self->raw_value;
my $type = $self->type;
return "{
type: $type=
where: $where comment: $comment
value: $value
owner: $owner
}\n";
}
=back
=head1 SEE ALSO
L<Automake::Variable>, L<Automake::ItemDef>.
=cut
1;
### 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:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,159 @@
# Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Version;
use 5.006;
use strict;
use Automake::ChannelDefs;
=head1 NAME
Automake::Version - version comparison
=head1 SYNOPSIS
use Automake::Version;
print "Version $version is older than required version $required\n"
if Automake::Version::check ($version, $required);
=head1 DESCRIPTION
This module provides support for comparing versions string
as they are used in Automake.
A version is a string that looks like
C<MAJOR.MINOR[.MICRO][ALPHA][-FORK]> where C<MAJOR>, C<MINOR>, and
C<MICRO> are digits, C<ALPHA> is a character, and C<FORK> any
alphanumeric word.
Usually, C<ALPHA> is used to label alpha releases or intermediate
snapshots, C<FORK> is used for git branches or patched releases, and
C<MICRO> is used for bug fixes releases on the C<MAJOR.MINOR> branch.
For the purpose of ordering, C<1.4> is the same as C<1.4.0>, but
C<1.4g> is the same as C<1.4.99g>. The C<FORK> identifier is ignored
in the ordering, except when it looks like C<-pMINOR[ALPHA]>: some
versions were labeled like C<1.4-p3a>, this is the same as an alpha
release labeled C<1.4.3a>. Yes, it's horrible, but Automake did not
support two-dot versions in the past.
=head2 FUNCTIONS
=over 4
=item C<split ($version)>
Split the string C<$version> into the corresponding C<(MAJOR, MINOR,
MICRO, ALPHA, FORK)> tuple. For instance C<'1.4g'> would be split
into C<(1, 4, 99, 'g', '')>. Return C<()> on error.
=cut
sub split ($)
{
my ($ver) = @_;
# Special case for versions like 1.4-p2a.
if ($ver =~ /^(\d+)\.(\d+)(?:-p(\d+)([a-z]+)?)$/)
{
return ($1, $2, $3, $4 || '', '');
}
# Common case.
elsif ($ver =~ /^(\d+)\.(\d+)(?:\.(\d+))?([a-z])?(?:-([A-Za-z0-9]+))?$/)
{
return ($1, $2, $3 || (defined $4 ? 99 : 0), $4 || '', $5 || '');
}
return ();
}
=item C<compare (\@LVERSION, \@RVERSION)>
Compare two version tuples, as returned by C<split>.
Return 1, 0, or -1, if C<LVERSION> is found to be respectively
greater than, equal to, or less than C<RVERSION>.
=cut
sub compare (\@\@)
{
my @l = @{$_[0]};
my @r = @{$_[1]};
for my $i (0, 1, 2)
{
return 1 if ($l[$i] > $r[$i]);
return -1 if ($l[$i] < $r[$i]);
}
for my $i (3, 4)
{
return 1 if ($l[$i] gt $r[$i]);
return -1 if ($l[$i] lt $r[$i]);
}
return 0;
}
=item C<check($VERSION, $REQUIRED)>
Handles the logic of requiring a version number in Automake.
C<$VERSION> should be Automake's version, while C<$REQUIRED>
is the version required by the user input.
Return 0 if the required version is satisfied, 1 otherwise.
=cut
sub check ($$)
{
my ($version, $required) = @_;
my @version = Automake::Version::split ($version);
my @required = Automake::Version::split ($required);
prog_error "version is incorrect: $version"
if $#version == -1;
# This should not happen, because process_option_list and split_version
# use similar regexes.
prog_error "required version is incorrect: $required"
if $#required == -1;
# If we require 3.4n-foo then we require something
# >= 3.4n, with the 'foo' fork identifier.
return 1
if ($required[4] ne '' && $required[4] ne $version[4]);
return 0 > compare (@version, @required);
}
1;
### 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:

View File

@ -0,0 +1,166 @@
# Copyright (C) 2003-2017 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 <http://www.gnu.org/licenses/>.
package Automake::Wrap;
use 5.006;
use strict;
require Exporter;
use vars '@ISA', '@EXPORT_OK';
@ISA = qw/Exporter/;
@EXPORT_OK = qw/wrap makefile_wrap/;
=head1 NAME
Automake::Wrap - a paragraph formatter
=head1 SYNOPSIS
use Automake::Wrap 'wrap', 'makefile_wrap';
print wrap ($first_ident, $next_ident, $end_of_line, $max_length,
@values);
print makefile_wrap ("VARIABLE = ", " ", @values);
=head1 DESCRIPTION
This modules provide facility to format list of strings. It is
comparable to Perl's L<Text::Wrap>, however we can't use L<Text::Wrap>
because some versions will abort when some word to print exceeds the
maximum length allowed. (Ticket #17141, fixed in Perl 5.8.0.)
=head2 Functions
=over 4
=cut
# _tab_length ($TXT)
# ------------------
# Compute the length of TXT, counting tab characters as 8 characters.
sub _tab_length($)
{
my ($txt) = @_;
my $len = length ($txt);
$len += 7 * ($txt =~ tr/\t/\t/);
return $len;
}
=item C<wrap ($head, $fill, $eol, $max_len, @values)>
Format C<@values> as a block of text that starts with C<$head>,
followed by the strings in C<@values> separated by spaces or by
C<"$eol\n$fill"> so that the length of each line never exceeds
C<$max_len>.
The C<$max_len> constraint is ignored for C<@values> items which
are too big to fit alone one a line.
The constructed paragraph is C<"\n">-terminated.
=cut
sub wrap($$$$@)
{
my ($head, $fill, $eol, $max_len, @values) = @_;
my $result = $head;
my $column = _tab_length ($head);
my $fill_len = _tab_length ($fill);
my $eol_len = _tab_length ($eol);
my $not_first_word = 0;
foreach (@values)
{
my $len = _tab_length ($_);
# See if the new variable fits on this line.
# (The + 1 is for the space we add in front of the value.).
if ($column + $len + $eol_len + 1 > $max_len
# Do not break before the first word if it does not fit on
# the next line anyway.
&& ($not_first_word || $fill_len + $len + $eol_len + 1 <= $max_len))
{
# Start a new line.
$result .= "$eol\n" . $fill;
$column = $fill_len;
}
elsif ($not_first_word)
{
# Add a space only if result does not already end
# with a space.
$_ = " $_" if $result =~ /\S\z/;
++$len;
}
$result .= $_;
$column += $len;
$not_first_word = 1;
}
$result .= "\n";
return $result;
}
=item C<makefile_wrap ($head, $fill, @values)>
Format C<@values> in a way which is suitable for F<Makefile>s.
This is comparable to C<wrap>, except C<$eol> is known to
be C<" \\">, and the maximum length has been hardcoded to C<72>.
A space is appended to C<$head> when this is not already
the case.
This can be used to format variable definitions or dependency lines.
makefile_wrap ('VARIABLE =', "\t", @values);
makefile_wrap ('rule:', "\t", @dependencies);
=cut
sub makefile_wrap ($$@)
{
my ($head, $fill, @values) = @_;
if (@values)
{
$head .= ' ' if $head =~ /\S\z/;
return wrap $head, $fill, " \\", 72, @values;
}
return "$head\n";
}
1;
### 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:

View File

@ -0,0 +1,324 @@
# Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
# Written by Akim Demaille <akim@freefriends.org>.
###############################################################
# The main copy of this file is in Automake's git repository. #
# Updates should be sent to automake-patches@gnu.org. #
###############################################################
package Automake::XFile;
=head1 NAME
Automake::XFile - supply object methods for filehandles with error handling
=head1 SYNOPSIS
use Automake::XFile;
$fh = new Automake::XFile;
$fh->open ("file", "<");
# No need to check $FH: we died if open failed.
print <$fh>;
$fh->close;
# No need to check the return value of close: we died if it failed.
$fh = new Automake::XFile "file", ">";
# No need to check $FH: we died if new failed.
print $fh "bar\n";
$fh->close;
$fh = new Automake::XFile "file", "r";
# No need to check $FH: we died if new failed.
defined $fh
print <$fh>;
undef $fh; # automatically closes the file and checks for errors.
$fh = new Automake::XFile "file", O_WRONLY | O_APPEND;
# No need to check $FH: we died if new failed.
print $fh "corge\n";
$pos = $fh->getpos;
$fh->setpos ($pos);
undef $fh; # automatically closes the file and checks for errors.
autoflush STDOUT 1;
=head1 DESCRIPTION
C<Automake::XFile> inherits from C<IO::File>. It provides the method
C<name> returning the file name. It provides dying versions of the
methods C<close>, C<lock> (corresponding to C<flock>), C<new>,
C<open>, C<seek>, and C<truncate>. It also overrides the C<getline>
and C<getlines> methods to translate C<\r\n> to C<\n>.
=cut
use 5.006;
use strict;
use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
use Carp;
use Errno;
use IO::File;
use File::Basename;
use Automake::ChannelDefs;
use Automake::Channels qw(msg);
use Automake::FileUtils;
require Exporter;
require DynaLoader;
@ISA = qw(IO::File Exporter DynaLoader);
$VERSION = "1.2";
@EXPORT = @IO::File::EXPORT;
eval {
# Make all Fcntl O_XXX and LOCK_XXX constants available for importing
require Fcntl;
my @O = grep /^(LOCK|O)_/, @Fcntl::EXPORT, @Fcntl::EXPORT_OK;
Fcntl->import (@O); # first we import what we want to export
push (@EXPORT, @O);
};
=head2 Methods
=over
=item C<$fh = new Automake::XFile ([$expr, ...]>
Constructor a new XFile object. Additional arguments
are passed to C<open>, if any.
=cut
sub new
{
my $type = shift;
my $class = ref $type || $type || "Automake::XFile";
my $fh = $class->SUPER::new ();
if (@_)
{
$fh->open (@_);
}
$fh;
}
=item C<$fh-E<gt>open ([$file, ...])>
Open a file, passing C<$file> and further arguments to C<IO::File::open>.
Die if opening fails. Store the name of the file. Use binmode for writing.
=cut
sub open
{
my $fh = shift;
my ($file, $mode) = @_;
# WARNING: Gross hack: $FH is a typeglob: use its hash slot to store
# the 'name' of the file we are opening. See the example with
# io_socket_timeout in IO::Socket for more, and read Graham's
# comment in IO::Handle.
${*$fh}{'autom4te_xfile_file'} = "$file";
if (!$fh->SUPER::open (@_))
{
fatal "cannot open $file: $!";
}
# In case we're running under MSWindows, don't write with CRLF.
# (This circumvents a bug in at least Cygwin bash where the shell
# parsing fails on lines ending with the continuation character '\'
# and CRLF).
# Correctly recognize usages like:
# - open ($file, "w")
# - open ($file, "+<")
# - open (" >$file")
binmode $fh
if (defined $mode && $mode =~ /^[+>wa]/ or $file =~ /^\s*>/);
}
=item C<$fh-E<gt>close>
Close the file, handling errors.
=cut
sub close
{
my $fh = shift;
if (!$fh->SUPER::close (@_))
{
my $file = $fh->name;
Automake::FileUtils::handle_exec_errors $file
unless $!;
fatal "cannot close $file: $!";
}
}
=item C<$line = $fh-E<gt>getline>
Read and return a line from the file. Ensure C<\r\n> is translated to
C<\n> on input files.
=cut
# Some native Windows/perl installations fail to translate \r\n to \n on
# input so we do that here.
sub getline
{
local $_ = $_[0]->SUPER::getline;
# Perform a _global_ replacement: $_ may can contains many lines
# in slurp mode ($/ = undef).
s/\015\012/\n/gs if defined $_;
return $_;
}
=item C<@lines = $fh-E<gt>getlines>
Slurp lines from the files.
=cut
sub getlines
{
my @res = ();
my $line;
push @res, $line while $line = $_[0]->getline;
return @res;
}
=item C<$name = $fh-E<gt>name>
Return the name of the file.
=cut
sub name
{
my $fh = shift;
return ${*$fh}{'autom4te_xfile_file'};
}
=item C<$fh-E<gt>lock>
Lock the file using C<flock>. If locking fails for reasons other than
C<flock> being unsupported, then error out if C<$ENV{'MAKEFLAGS'}> indicates
that we are spawned from a parallel C<make>.
=cut
sub lock
{
my ($fh, $mode) = @_;
# Cannot use @_ here.
# Unless explicitly configured otherwise, Perl implements its 'flock' with the
# first of flock(2), fcntl(2), or lockf(3) that works. These can fail on
# NFS-backed files, with ENOLCK (GNU/Linux) or EOPNOTSUPP (FreeBSD); we
# usually ignore these errors. If $ENV{MAKEFLAGS} suggests that a parallel
# invocation of 'make' has invoked the tool we serve, report all locking
# failures and abort.
#
# On Unicos, flock(2) and fcntl(2) over NFS hang indefinitely when 'lockd' is
# not running. NetBSD NFS clients silently grant all locks. We do not
# attempt to defend against these dangers.
#
# -j is for parallel BSD make, -P is for parallel HP-UX make.
if (!flock ($fh, $mode))
{
my $make_j = (exists $ENV{'MAKEFLAGS'}
&& " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*[jP]|--[jP]|---?jobs)/);
my $note = "\nforgo \"make -j\" or use a file system that supports locks";
my $file = $fh->name;
msg ($make_j ? 'fatal' : 'unsupported',
"cannot lock $file with mode $mode: $!" . ($make_j ? $note : ""))
if $make_j || !($!{ENOLCK} || $!{EOPNOTSUPP});
}
}
=item C<$fh-E<gt>seek ($position, [$whence])>
Seek file to C<$position>. Die if seeking fails.
=cut
sub seek
{
my $fh = shift;
# Cannot use @_ here.
if (!seek ($fh, $_[0], $_[1]))
{
my $file = $fh->name;
fatal "cannot rewind $file with @_: $!";
}
}
=item C<$fh-E<gt>truncate ($len)>
Truncate the file to length C<$len>. Die on failure.
=cut
sub truncate
{
my ($fh, $len) = @_;
if (!truncate ($fh, $len))
{
my $file = $fh->name;
fatal "cannot truncate $file at $len: $!";
}
}
=back
=head1 SEE ALSO
L<perlfunc>,
L<perlop/"I/O Operators">,
L<IO::File>
L<IO::Handle>
L<IO::Seekable>
=head1 HISTORY
Derived from IO::File.pm by Akim Demaille E<lt>F<akim@freefriends.org>E<gt>.
=cut
1;
### 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:

674
automake-1.15.1/lib/COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 3 of the License, 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 <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

368
automake-1.15.1/lib/INSTALL Normal file
View File

@ -0,0 +1,368 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell command './configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the 'README' file for
instructions specific to this package. Some packages provide this
'INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The 'configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a 'Makefile' in each directory of the package.
It may also create one or more '.h' files containing system-dependent
definitions. Finally, it creates a shell script 'config.status' that
you can run in the future to recreate the current configuration, and a
file 'config.log' containing compiler output (useful mainly for
debugging 'configure').
It can also use an optional file (typically called 'config.cache' and
enabled with '--cache-file=config.cache' or simply '-C') that saves the
results of its tests to speed up reconfiguring. Caching is disabled by
default to prevent problems with accidental use of stale cache files.
If you need to do unusual things to compile the package, please try
to figure out how 'configure' could check whether to do them, and mail
diffs or instructions to the address given in the 'README' so they can
be considered for the next release. If you are using the cache, and at
some point 'config.cache' contains results you don't want to keep, you
may remove or edit it.
The file 'configure.ac' (or 'configure.in') is used to create
'configure' by a program called 'autoconf'. You need 'configure.ac' if
you want to change it or regenerate 'configure' using a newer version of
'autoconf'.
The simplest way to compile this package is:
1. 'cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system.
Running 'configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type 'make' to compile the package.
3. Optionally, type 'make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type 'make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the 'make install' phase executed with root
privileges.
5. Optionally, type 'make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior 'make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing 'make clean'. To also remove the
files that 'configure' created (so you can compile the package for
a different kind of computer), type 'make distclean'. There is
also a 'make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type 'make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide 'make
distcheck', which can by used by developers to test that all other
targets like 'make install' and 'make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the 'configure' script does not know about. Run './configure --help'
for details on some of the pertinent environment variables.
You can give 'configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here is
an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU 'make'. 'cd' to the
directory where you want the object files and executables to go and run
the 'configure' script. 'configure' automatically checks for the source
code in the directory that 'configure' is in and in '..'. This is known
as a "VPATH" build.
With a non-GNU 'make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use 'make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple '-arch' options to the
compiler but only a single '-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the 'lipo' tool if you have problems.
Installation Names
==================
By default, 'make install' installs the package's commands under
'/usr/local/bin', include files under '/usr/local/include', etc. You
can specify an installation prefix other than '/usr/local' by giving
'configure' the option '--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like '--bindir=DIR' to specify different values for particular
kinds of files. Run 'configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the default
for these options is expressed in terms of '${prefix}', so that
specifying just '--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to 'configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
'make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, 'make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
'${prefix}'. Any directories that were specified during 'configure',
but not in terms of '${prefix}', must each be overridden at install time
for the entire installation to be relocated. The approach of makefile
variable overrides for each directory variable is required by the GNU
Coding Standards, and ideally causes no recompilation. However, some
platforms have known limitations with the semantics of shared libraries
that end up requiring recompilation when using this method, particularly
noticeable in packages that use GNU Libtool.
The second method involves providing the 'DESTDIR' variable. For
example, 'make install DESTDIR=/alternate/directory' will prepend
'/alternate/directory' before all installation names. The approach of
'DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of '${prefix}'
at 'configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving 'configure' the
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
Some packages pay attention to '--enable-FEATURE' options to
'configure', where FEATURE indicates an optional part of the package.
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
is something like 'gnu-as' or 'x' (for the X Window System). The
'README' should mention any '--enable-' and '--with-' options that the
package recognizes.
For packages that use the X Window System, 'configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the 'configure' options '--x-includes=DIR' and
'--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of 'make' will be. For these packages, running './configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with 'make V=1'; while running './configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with 'make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX 'make' updates targets which have the same time stamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
workaround. If GNU CC is not installed, it is therefore recommended to
try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
in your 'PATH', put it _after_ '/usr/bin'.
On Haiku, software installed for all users goes in '/boot/common',
not '/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features 'configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, 'configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
'--build=TYPE' option. TYPE can either be a short name for the system
type, such as 'sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file 'config.sub' for the possible values of each field. If
'config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option '--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with '--host=TYPE'.
Sharing Defaults
================
If you want to set default values for 'configure' scripts to share,
you can create a site shell script called 'config.site' that gives
default values for variables like 'CC', 'cache_file', and 'prefix'.
'configure' looks for 'PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script.
A warning: not all 'configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to 'configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the 'configure' command line, using 'VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified 'gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
Autoconf limitation. Until the limitation is lifted, you can use this
workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
'configure' Invocation
======================
'configure' recognizes the following options to control how it
operates.
'--help'
'-h'
Print a summary of all of the options to 'configure', and exit.
'--help=short'
'--help=recursive'
Print a summary of the options unique to this package's
'configure', and exit. The 'short' variant lists options used only
in the top level, while the 'recursive' variant lists options also
present in any nested packages.
'--version'
'-V'
Print the version of Autoconf used to generate the 'configure'
script, and exit.
'--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally 'config.cache'. FILE defaults to '/dev/null' to
disable caching.
'--config-cache'
'-C'
Alias for '--cache-file=config.cache'.
'--quiet'
'--silent'
'-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to '/dev/null' (any error
messages will still be shown).
'--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
'configure' can determine that directory automatically.
'--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names:: for
more details, including other options available for fine-tuning the
installation locations.
'--no-create'
'-n'
Run the configure checks, but stop before creating any output
files.
'configure' also accepts some other, not widely useful, options. Run
'configure --help' for more details.

View File

@ -0,0 +1,67 @@
## Included by top-level Makefile for Automake.
## Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## -------------------------------------------------------------------- ##
## Auxiliary scripts and files for use with "automake --add-missing". ##
## -------------------------------------------------------------------- ##
dist_pkgvdata_DATA = \
%D%/COPYING \
%D%/INSTALL \
%D%/texinfo.tex
# These must all be executable when installed. However, if we use
# _SCRIPTS, then the program transform will be applied, which is not
# what we want. So we make them executable by hand.
dist_script_DATA = \
%D%/config.guess \
%D%/config.sub \
%D%/install-sh \
%D%/mdate-sh \
%D%/missing \
%D%/mkinstalldirs \
%D%/ylwrap \
%D%/depcomp \
%D%/compile \
%D%/py-compile \
%D%/ar-lib \
%D%/test-driver \
%D%/tap-driver.sh
install-data-hook:
@$(POST_INSTALL)
@for f in $(dist_script_DATA); do echo $$f; done \
| sed 's,^%D%/,,' \
| ( st=0; \
while read f; do \
echo " chmod +x '$(DESTDIR)$(scriptdir)/$$f'"; \
chmod +x "$(DESTDIR)$(scriptdir)/$$f" || st=1; \
done; \
exit $$st )
installcheck-local: installcheck-executable-scripts
installcheck-executable-scripts:
@for f in $(dist_script_DATA); do echo $$f; done \
| sed 's,^%D%/,,' \
| while read f; do \
path="$(pkgvdatadir)/$$f"; \
test -x "$$path" || echo $$path; \
done \
| sed 's/$$/: not executable/' \
| grep . 1>&2 && exit 1; exit 0
# vim: ft=automake noet

View File

@ -0,0 +1,65 @@
## Included by top-level Makefile for Automake.
## Copyright (C) 1995-2017 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 <http://www.gnu.org/licenses/>.
## --------------------- ##
## Makefile fragments. ##
## --------------------- ##
amdir = @amdir@
dist_am_DATA = \
%D%/check.am \
%D%/check2.am \
%D%/clean-hdr.am \
%D%/clean.am \
%D%/compile.am \
%D%/configure.am \
%D%/data.am \
%D%/dejagnu.am \
%D%/depend.am \
%D%/depend2.am \
%D%/distdir.am \
%D%/footer.am \
%D%/header-vars.am \
%D%/header.am \
%D%/install.am \
%D%/inst-vars.am \
%D%/java.am \
%D%/lang-compile.am \
%D%/lex.am \
%D%/library.am \
%D%/libs.am \
%D%/libtool.am \
%D%/lisp.am \
%D%/ltlib.am \
%D%/ltlibrary.am \
%D%/mans-vars.am \
%D%/mans.am \
%D%/program.am \
%D%/progs.am \
%D%/python.am \
%D%/remake-hdr.am \
%D%/scripts.am \
%D%/subdirs.am \
%D%/tags.am \
%D%/texi-vers.am \
%D%/texibuild.am \
%D%/texinfos.am \
%D%/vala.am \
%D%/yacc.am
# vim: ft=automake noet

View File

@ -0,0 +1,573 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
am__tty_colors = { \
$(am__tty_colors_dummy); \
if test "X$(AM_COLOR_TESTS)" = Xno; then \
am__color_tests=no; \
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
am__color_tests=yes; \
## If stdout is a non-dumb tty, use colors. If test -t is not supported,
## then this check fails; a conservative approach. Of course do not
## redirect stdout here, just stderr.
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
am__color_tests=yes; \
fi; \
if test $$am__color_tests = yes; then \
red=''; \
grn=''; \
lgn=''; \
blu=''; \
mgn=''; \
brg=''; \
std=''; \
fi; \
}
.PHONY: check-TESTS
if !%?SERIAL_TESTS%
include inst-vars.am
## New parallel test driver.
##
## The first version of the code here was adapted from check.mk, which was
## originally written at EPITA/LRDE, further developed at Gostai, then made
## its way from GNU coreutils to end up, largely rewritten, in Automake.
## The current version is an heavy rewrite of that, to allow for support
## of more test metadata, and the use of custom test drivers and protocols
## (among them, TAP).
am__recheck_rx = ^[ ]*:recheck:[ ]*
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
# A command that, given a newline-separated list of test names on the
# standard input, print the name of the tests that are to be re-run
# upon "make recheck".
am__list_recheck_tests = $(AWK) '{ \
## By default, we assume the test is to be re-run.
recheck = 1; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
{ \
## If we've encountered an I/O error here, there are three possibilities:
##
## [1] The '.log' file exists, but the '.trs' does not; in this case,
## we "gracefully" recover by assuming the corresponding test is
## to be re-run (which will re-create the missing '.trs' file).
##
## [2] Both the '.log' and '.trs' files are missing; this means that
## the corresponding test has not been run, and is thus *not* to
## be re-run.
##
## [3] We have encountered some corner-case problem (e.g., a '.log' or
## '.trs' files somehow made unreadable, or issues with a bad NFS
## connection, or whatever); we don't handle such corner cases.
##
if ((getline line2 < ($$0 ".log")) < 0) \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
## A directive explicitly specifying the test is *not* to be re-run.
{ \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
{ \
## A directive explicitly specifying the test *is* to be re-run.
break; \
} \
## else continue with the next iteration.
}; \
if (recheck) \
print $$0; \
## Don't leak open file descriptors, as this could cause serious
## problems when there are many tests (yes, even on Linux).
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# A command that, given a newline-separated list of test names on the
# standard input, create the global log from their .trs and .log files.
am__create_global_log = $(AWK) ' \
function fatal(msg) \
{ \
print "fatal: making $@: " msg | "cat >&2"; \
exit 1; \
} \
function rst_section(header) \
{ \
print header; \
len = length(header); \
for (i = 1; i <= len; i = i + 1) \
printf "="; \
printf "\n\n"; \
} \
{ \
## By default, we assume the test log is to be copied in the global log,
## and that its result is simply "RUN" (i.e., we still don't know what
## it outcome was, but we know that at least it has run).
copy_in_global_log = 1; \
global_test_result = "RUN"; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".trs"); \
if (line ~ /$(am__global_test_result_rx)/) \
{ \
sub("$(am__global_test_result_rx)", "", line); \
sub("[ ]*$$", "", line); \
global_test_result = line; \
} \
else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
copy_in_global_log = 0; \
}; \
if (copy_in_global_log) \
{ \
rst_section(global_test_result ": " $$0); \
while ((rc = (getline line < ($$0 ".log"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".log"); \
print line; \
}; \
printf "\n"; \
}; \
## Don't leak open file descriptors, as this could cause serious
## problems when there are many tests (yes, even on Linux).
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# Restructured Text title.
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
# Solaris 10 'make', and several other traditional 'make' implementations,
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
# by disabling -e (using the XSI extension "set +e") if it's set.
am__sh_e_setup = case $$- in *e*) set +e;; esac
# Default flags passed to test drivers.
am__common_driver_flags = \
--color-tests "$$am__color_tests" \
--enable-hard-errors "$$am__enable_hard_errors" \
--expect-failure "$$am__expect_failure"
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log. Executes the
# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
# will run the test scripts (or their associated LOG_COMPILER, if
# thy have one).
am__check_pre = \
$(am__sh_e_setup); \
$(am__vpath_adj_setup) $(am__vpath_adj) \
$(am__tty_colors); \
srcdir=$(srcdir); export srcdir; \
case "$@" in \
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
*) am__odir=.;; \
esac; \
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
am__enable_hard_errors=no; \
else \
am__enable_hard_errors=yes; \
fi; \
## The use of $dir below is required to account for VPATH
## rewriting done by Sun make.
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
am__expect_failure=yes;; \
*) \
am__expect_failure=no;; \
esac; \
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
# A shell command to get the names of the tests scripts with any registered
# extension removed (i.e., equivalently, the names of the test logs, with
# the '.log' extension removed). The result is saved in the shell variable
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
# since that might cause problem with VPATH rewrites for suffix-less tests.
# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
## Trim away any extra whitespace. This has already proved useful
## in avoiding weird bug on lesser make implementations. It also
## works around the GNU make 3.80 bug where trailing whitespace in
## "TESTS = foo.test $(empty)" causes $(TESTS_LOGS) to erroneously
## expand to "foo.log .log".
bases=`echo $$bases`
# Recover from deleted '.trs' file; this should ensure that
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
# to avoid problems with "make -n".
.log.trs:
rm -f $< $@
$(MAKE) $(AM_MAKEFLAGS) $<
# Leading 'am--fnord' is there to ensure the list of targets does not
# expand to empty, as could happen e.g. with make check TESTS=''.
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
am--force-recheck:
@:
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__set_TESTS_bases); \
## Helper shell function, tells whether a path refers to an existing,
## regular, readable file.
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
## We need to ensures that all the required '.trs' and '.log' files will
## be present and readable. The direct dependencies of $(TEST_SUITE_LOG)
## only ensure that all the '.log' files exists; they don't ensure that
## the '.log' files are readable, and worse, they don't ensure that the
## '.trs' files even exist.
redo_bases=`for i in $$bases; do \
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
done`; \
if test -n "$$redo_bases"; then \
## Uh-oh, either some '.log' files were unreadable, or some '.trs' files
## were missing (or unreadable). We need to re-run the corresponding
## tests in order to re-create them.
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
if $(am__make_dryrun); then :; else \
## Break "rm -f" into two calls to minimize the possibility of exceeding
## command line length limits.
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
fi; \
## Use a trick to to ensure that we don't go into an infinite recursion
## in case a test log in $(TEST_LOGS) is the same as $(TEST_SUITE_LOG).
## Yes, this has already happened in practice. Sigh!
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
## Invoking this unconditionally could cause a useless "make all" to
## be invoked when '$redo_logs' expands to empty (automake bug#16302).
elif test -n "$$redo_logs"; then \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
## Sanity check: each unreadable or non-existent test result file should
## has been properly remade at this point, as should the corresponding log
## file.
st=0; \
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
for i in $$redo_bases; do \
test -f $$i.trs && test -r $$i.trs \
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
test -f $$i.log && test -r $$i.log \
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
done; \
test $$st -eq 0 || exit 1; \
fi
## We need a new subshell to work portably with "make -n", since the
## previous part of the recipe contained a $(MAKE) invocation.
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
ws='[ ]'; \
## List of test result files.
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
## Prepare data for the test suite summary. These do not take into account
## unreadable test results, but they'll be appropriately updated later if
## needed.
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
## Whether the testsuite was successful or not.
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
success=true; \
else \
success=false; \
fi; \
## Make $br a line of exactly 76 '=' characters, that will be used to
## enclose the testsuite summary report when displayed on the console.
br='==================='; br=$$br$$br$$br$$br; \
## When writing the test summary to the console, we want to color a line
## reporting the count of some result *only* if at least one test
## experienced such a result. This function is handy in this regard.
result_count () \
{ \
if test x"$$1" = x"--maybe-color"; then \
maybe_colorize=yes; \
elif test x"$$1" = x"--no-color"; then \
maybe_colorize=no; \
else \
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
shift; \
desc=$$1 count=$$2; \
if test $$maybe_colorize = yes && test $$count -gt 0; then \
color_start=$$3 color_end=$$std; \
else \
color_start= color_end=; \
fi; \
echo "$${color_start}# $$desc $$count$${color_end}"; \
}; \
## A shell function that creates the testsuite summary. We need it
## because we have to create *two* summaries, one for test-suite.log,
## and a possibly-colorized one for console output.
create_testsuite_report () \
{ \
result_count $$1 "TOTAL:" $$all "$$brg"; \
result_count $$1 "PASS: " $$pass "$$grn"; \
result_count $$1 "SKIP: " $$skip "$$blu"; \
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
result_count $$1 "FAIL: " $$fail "$$red"; \
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
## Write "global" testsuite log.
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
create_testsuite_report --no-color; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
for b in $$bases; do echo $$b; done \
| $(am__create_global_log); \
} >$(TEST_SUITE_LOG).tmp || exit 1; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
## Emit the test summary on the console.
if $$success; then \
col="$$grn"; \
else \
col="$$red"; \
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
## Multi line coloring is problematic with "less -R", so we really need
## to color each line individually.
echo "$${col}$$br$${std}"; \
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
echo "$${col}$$br$${std}"; \
## This is expected to go to the console, so it might have to be colorized.
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
if test -n "$(PACKAGE_BUGREPORT)"; then \
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
fi; \
echo "$$col$$br$$std"; \
fi; \
## Be sure to exit with the proper exit status. The use of "exit 1" below
## is required to work around a FreeBSD make bug (present only when running
## in concurrent mode). See automake bug#9245:
## <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9245>
## and FreeBSD PR bin/159730:
## <http://www.freebsd.org/cgi/query-pr.cgi?pr=159730>.
$$success || exit 1
RECHECK_LOGS = $(TEST_LOGS)
## ------------------------------------------ ##
## Running all tests, or rechecking failures. ##
## ------------------------------------------ ##
check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
## We always have to remove $(TEST_SUITE_LOG), to ensure its rule is run
## in any case even in lazy mode: otherwise, if no test needs rerunning,
## or a prior run plus reruns all happen within the same timestamp (can
## happen with a prior "make TESTS=<subset>"), then we get no log output.
## OTOH, this means that, in the rule for '$(TEST_SUITE_LOG)', we
## cannot use '$?' to compute the set of lazily rerun tests, lest
## we rely on .PHONY to work portably.
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
log_list=`for i in $$bases; do echo $$i.log; done`; \
trs_list=`for i in $$bases; do echo $$i.trs; done`; \
## Remove newlines and normalize whitespace. Trailing (and possibly
## leading) whitespace is known to cause segmentation faults on
## Solaris 10 XPG4 make.
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
## Be sure to exit with the proper exit status (automake bug#9245). See
## comments in the recipe of $(TEST_SUITE_LOG) above for more information.
exit $$?;
## Recheck must depend on $(check_SCRIPTS), $(check_PROGRAMS), etc.
## It must also depend on the 'all' target. See automake bug#11252.
recheck: all %CHECK_DEPS%
## See comments above in the check-TESTS recipe for why remove
## $(TEST_SUITE_LOG) here.
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
## We must only consider tests that had an unexpected outcome (FAIL
## or XPASS) in the earlier run.
bases=`for i in $$bases; do echo $$i; done \
| $(am__list_recheck_tests)` || exit 1; \
log_list=`for i in $$bases; do echo $$i.log; done`; \
## Remove newlines and normalize whitespace. Trailing (and possibly
## leading) whitespace is known to cause segmentation faults on
## Solaris 10 XPG4 make.
log_list=`echo $$log_list`; \
## Move the '.log' and '.trs' files associated with the tests to be
## re-run out of the way, so that those tests will be re-run by the
## "make test-suite.log" recursive invocation below.
## Two tricky requirements:
## - we must avoid extra files removal when running under "make -n";
## - in case the test is a compiled program whose compilation fails,
## we must ensure that any '.log' and '.trs' file referring to such
## test are preserved, so that future "make recheck" invocations
## will still try to re-compile and re-run it (automake bug#11791).
## The tricky recursive make invocation below should cater to such
## requirements.
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
## Be sure to exit with the proper exit status (automake bug#9245). See
## comments in the recipe of $(TEST_SUITE_LOG) above for more information.
exit $$?
AM_RECURSIVE_TARGETS += check recheck
.PHONY: recheck
else %?SERIAL_TESTS%
## Obsolescent serial testsuite driver.
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
## Make sure Solaris VPATH-expands all members of this list, even
## the first and the last one; thus the spaces around $(TESTS)
list=' $(TESTS) '; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
## Note: Solaris 2.7 seems to expand TESTS using VPATH. That's
## why we also try 'dir='.
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
## Success
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
## Failure
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
esac; \
else \
## Skipped
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
## Prepare the banner
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
## DASHES should contain the largest line of the banner.
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
col="$$grn"; \
else \
col="$$red"; \
fi; \
## Multi line coloring is problematic with "less -R", so we really need
## to color each line individually.
echo "$${col}$$dashes$${std}"; \
echo "$${col}$$banner$${std}"; \
test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
test -z "$$report" || echo "$${col}$$report$${std}"; \
echo "$${col}$$dashes$${std}"; \
test "$$failed" -eq 0; \
else :; fi
endif %?SERIAL_TESTS%

View File

@ -0,0 +1,60 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2008-2017 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 <http://www.gnu.org/licenses/>.
if %?FIRST%
## When BSD make is run in parallel mode, it apparently strips any
## leading directory component from the automatic variable '$*' (of
## course, against what POSIX mandates). Try to detect and work
## around this incompatibility.
am__set_b = \
case '$@' in \
*/*) \
case '$*' in \
*/*) b='$*';; \
*) b=`echo '$@' | sed 's/\.log$$//'`; \
esac;; \
*) \
b='$*';; \
esac
endif %?FIRST%
## From a test file to a .log and .trs file.
?GENERIC?%EXT%.log:
?!GENERIC?%OBJ%: %SOURCE%
@p='%SOURCE%'; \
## Another hack to support BSD make in parallel mode.
?!GENERIC? b='%BASE%'; \
?GENERIC? $(am__set_b); \
$(am__check_pre) %DRIVER% --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
"$$tst" $(AM_TESTS_FD_REDIRECT)
## If no programs are built in this package, then this rule is removed
## at automake time. Otherwise, %am__EXEEXT% expands to a configure time
## conditional, true if $(EXEEXT) is nonempty, thus this rule does not
## conflict with the previous one.
if %am__EXEEXT%
?GENERIC?%EXT%$(EXEEXT).log:
@p='%SOURCE%'; \
## Another hack to support BSD make in parallel mode.
?!GENERIC? b='%BASE%'; \
?GENERIC? $(am__set_b); \
$(am__check_pre) %DRIVER% --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
"$$tst" $(AM_TESTS_FD_REDIRECT)
endif %am__EXEEXT%

View File

@ -0,0 +1,20 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
.PHONY: distclean-hdr
distclean-am: distclean-hdr
distclean-hdr:
-rm -f %FILES%

View File

@ -0,0 +1,62 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
## We must test each macro because it might be empty, and an empty "rm
## -rf" command looks disturbing. Also, the Solaris 2.4 "rm" will
## return an error if there are no arguments other than "-f".
mostlyclean-am: mostlyclean-generic
mostlyclean-generic:
%MOSTLYCLEAN_RMS%
clean-am: clean-generic mostlyclean-am
clean-generic:
%CLEAN_RMS%
distclean-am: distclean-generic clean-am
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
%DISTCLEAN_RMS%
## Makefiles and their dependencies cannot be cleaned by
## an -am dependency, because that would prevent other distclean
## dependencies from calling make recursively. (The multilib
## cleaning rules do this.)
##
## If you change distclean here, you probably also want to change
## maintainer-clean below.
distclean:
-rm -f %MAKEFILE%
maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean-generic:
## FIXME: shouldn't we really print these messages before running
## the dependencies?
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
%MAINTAINER_CLEAN_RMS%
## See comment for distclean.
maintainer-clean:
-rm -f %MAKEFILE%
.PHONY: clean mostlyclean distclean maintainer-clean \
clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic
?!SUBDIRS?clean: clean-am
?!SUBDIRS?distclean: distclean-am
?!SUBDIRS?mostlyclean: mostlyclean-am
?!SUBDIRS?maintainer-clean: maintainer-clean-am

View File

@ -0,0 +1,29 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
DEFAULT_INCLUDES = %DEFAULT_INCLUDES%
mostlyclean-am: mostlyclean-compile
mostlyclean-compile:
-rm -f *.$(OBJEXT)
?MOSTLYRMS?%MOSTLYRMS%
distclean-am: distclean-compile
distclean-compile:
-rm -f *.tab.c
?DISTRMS?%DISTRMS%
.PHONY: mostlyclean-compile distclean-compile

View File

@ -0,0 +1,166 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
## This dummy rule is called from subdirectories whenever one of the
## top-level Makefile's dependencies must be updated. It does depend
## on %MAKEFILE% for the benefit of non-GNU make implementations (GNU
## make will always make sure %MAKEFILE% is updated before considering
## the am--refresh target anyway).
if %?TOPDIR_P%
.PHONY: am--refresh
am--refresh: %MAKEFILE%
@:
endif %?TOPDIR_P%
## --------------------- ##
## Building Makefile.*. ##
## --------------------- ##
## This rule remakes the Makefile.in.
%MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% $(am__configure_deps)
## If configure.ac or one of configure's dependencies has changed, all
## Makefile.in are to be updated; it is then more efficient to run
## automake on all the Makefiles at once. It also allow Automake to be
## run for newly added directories.
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
?TOPDIR_P? echo ' cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%'; \
?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
?TOPDIR_P? && exit 0; \
?!TOPDIR_P? ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
## If on the other hand, subdir/Makefile.in has been removed, then toplevel
## am--refresh will not be aware of any need to run. We still invoke it
## due to $? listing all prerequisites. Fix up for it by running the rebuild
## rule for this file only, below.
?!TOPDIR_P? && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
## Otherwise, rebuild only this file.
echo ' cd $(top_srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%
## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
## is interrupted. Otherwise, the user would need to know to rerun
## ./config.status to recreate the lost Makefile.
.PRECIOUS: %MAKEFILE%
## This rule remakes the Makefile.
%MAKEFILE%: %MAKEFILE-DEPS% $(top_builddir)/config.status
## If Makefile is to be updated because of config.status, then run
## config.status without argument in order to (i) rerun all the
## AC_CONFIG_COMMANDS including those that are not visible to
## Automake, and (ii) to save time by running config.status all with
## all the files, instead of once per file (iii) generate Makefiles
## in newly added directories.
@case '$?' in \
## Don't prefix $(top_builddir), because GNU make will strip it out
## when it's '.'.
*config.status*) \
?TOPDIR_P? echo ' $(SHELL) ./config.status'; \
?TOPDIR_P? $(SHELL) ./config.status;; \
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
## .P files. Ideally we wouldn't have to do this by hand.
echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \
esac;
## Avoid the "deleted header file" problem for the dependencies.
## Add the trailing "$(am__empty)" to trick Automake into not spuriously
## complaining about "duplicated targets" in case the %MAKEFILE-IN-DEPS%
## list expands to a single target that is also declared in some
## user-defined rule.
?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS% $(am__empty):
DIST_COMMON += %MAKEFILE-AM%
## --------------------------- ##
## config.status & configure. ##
## --------------------------- ##
if %?TOPDIR_P%
## Always require configure.ac and configure at top level, even if they
## don't exist. This is especially important for configure, since it
## won't be created until autoconf is run -- which might be after
## automake is run.
DIST_COMMON += $(top_srcdir)/configure $(am__configure_deps)
endif %?TOPDIR_P%
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
?TOPDIR_P? $(SHELL) ./config.status --recheck
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps)
?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOCONF)
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
## ------------ ##
## aclocal.m4. ##
## ------------ ##
## Whenever a configure dependency changes we need to rebuild
## aclocal.m4 too. Changing configure.ac, or any file included by
## aclocal.m4 might require adding more files to aclocal.m4. Hence
## the $(am__configure_deps) dependency.
## We still need $(ACLOCAL_AMFLAGS) for sake of backward-compatibility;
## we should hopefully be able to get rid of it in a not-so-distant
## future.
if %?REGEN-ACLOCAL-M4%
$(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
?TOPDIR_P? $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
## Avoid the "deleted header file" problem for the dependencies.
$(am__aclocal_m4_deps):
endif %?REGEN-ACLOCAL-M4%
## --------- ##
## cleanup. ##
## --------- ##
## We special-case config.status here. If we do it as part of the
## normal clean processing for this directory, then it might be
## removed before some subdir is cleaned. However, that subdir's
## Makefile depends on config.status.
if %?TOPDIR_P%
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
distclean:
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
## Note: you might think we should remove Makefile.in, configure, or
## aclocal.m4 here in a maintainer-clean rule. However, the GNU
## Coding Standards explicitly prohibit this.
maintainer-clean:
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
## autom4te.cache is created by Autoconf; the only valid target to
## remove it is maintainer-clean, not distclean.
## If you have an autom4te.cache that cause distcheck to fail, then
## it is good news: you finally discovered that autoconf and/or
## autoheader is needed to use your tarball, which is wrong.
-rm -rf $(top_srcdir)/autom4te.cache
endif %?TOPDIR_P%

View File

@ -0,0 +1,100 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
@$(NORMAL_INSTALL)
if %?BASE%
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
for p in $$list; do \
## A file can be in the source directory or the build directory.
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
## If the _%PRIMARY% variable has an entry like foo/bar, install it as
## $(destdir)/bar, not $(destdir)/foo/bar. The user can make a
## new dir variable or use a nobase_ target for the latter case.
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_%ONE_PRIMARY%) $$files '$(DESTDIR)$(%NDIR%dir)'"; \
$(INSTALL_%ONE_PRIMARY%) $$files "$(DESTDIR)$(%NDIR%dir)" || exit $$?; \
done
else !%?BASE%
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for file in $$files; do \
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
echo " $(INSTALL_%ONE_PRIMARY%) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(INSTALL_%ONE_PRIMARY%) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
done
endif !%?BASE%
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%%PRIMARY%
uninstall-%DIR%%PRIMARY%:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
## Nothing.
## -------------- ##
## Distributing. ##
## -------------- ##
if %?DIST%
DIST_COMMON += %DISTVAR%
endif %?DIST%

View File

@ -0,0 +1,93 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
## Name of tool to use. Default is the same as the package.
DEJATOOL = $(PACKAGE)
## Default flags to pass to dejagnu. The user can override this.
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
EXPECT = expect
RUNTEST = runtest
.PHONY: check-DEJAGNU
check-DEJAGNU: site.exp
## Life is easiest with an absolute srcdir, so do that.
srcdir='$(srcdir)'; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \
## If runtest can't be found, print a warning but don't die. It is
## pointless to cause a failure if the tests cannot be run at all.
if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
then :; else exit_status=1; fi; \
done; \
else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
fi; \
exit $$exit_status
## ------------------- ##
## Building site.exp. ##
## ------------------- ##
## Note that in the rule we don't directly generate site.exp to avoid
## the possibility of a corrupted site.exp if make is interrupted.
## Jim Meyering has some useful text on this topic.
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
@echo 'Making a new site.exp file ...'
@echo '## these variables are automatically generated by make ##' >site.tmp
@echo '# Do not edit here. If you wish to override these values' >>site.tmp
@echo '# edit the last section' >>site.tmp
@echo 'set srcdir "$(srcdir)"' >>site.tmp
@echo "set objdir `pwd`" >>site.tmp
## Quote the *_alias variables because they might be empty.
?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp
?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp
?HOST? @echo 'set host_alias "$(host_alias)"' >>site.tmp
?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp
?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp
?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp
## Allow the package author to extend site.exp.
@list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
echo "## Begin content included from file $$f. Do not modify. ##" \
&& cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
&& echo "## End content included from file $$f. ##" \
|| exit 1; \
done >> site.tmp
@echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
@if test -f site.exp; then \
sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
fi
@-rm -f site.bak
@test ! -f site.exp || mv site.exp site.bak
@mv site.tmp site.exp
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY distclean-am: distclean-DEJAGNU
distclean-DEJAGNU:
## Any other cleaning must be done by the user or by the test suite
## itself. We can't predict what dejagnu or the test suite might
## generate.
-rm -f site.exp site.bak
-l='$(DEJATOOL)'; for tool in $$l; do \
rm -f $$tool.sum $$tool.log; \
done

View File

@ -0,0 +1,27 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
am__mv = mv -f
## This Makefile depends on Depdirs' files, so we should never
## erase them in -am or -recursive rules; that would prevent any other
## rules from being recursive (for instance multilib clean rules are
## recursive).
distclean:
-rm -rf %DEPDIRS%
maintainer-clean:
-rm -rf %DEPDIRS%

View File

@ -0,0 +1,114 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
## This file is read several times:
## - once per *extension* (not per language) for generic compilation rules
## - once for each file which requires specific flags.
## Note it is on purpose we wrote "if %AMDEP%", since:
##
## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
## the "if FALSE" chunk is removed (automake-time conditionals).
##
## - if deps are on, %AMDEP% is mapped onto AMDEP, and therefore
## the "if AMDEP" chunk is prefix with @AMDEP_TRUE@ just like for any
## other configure-time conditional.
##
## We do likewise for %FASTDEP%; this expands to an ordinary configure-time
## conditional. %FASTDEP% is used to speed up the common case of building
## a package with gcc 3.x or later. In this case we can skip the use of
## depcomp and easily inline the dependency tracking.
if %?NONLIBTOOL%
?GENERIC?%EXT%.o:
?!GENERIC?%OBJ%: %SOURCE%
if %FASTDEP%
## In fast-dep mode, we can always use -o.
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??!SUBDIROBJ? %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE%
?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE% &&\
?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
else !%FASTDEP%
if %AMDEP%
%VERBOSE%source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
if %?GENERIC%
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%%SOURCE%
else !%?GENERIC%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
endif !%?GENERIC%
endif !%FASTDEP%
?GENERIC?%EXT%.obj:
?!GENERIC?%OBJOBJ%: %SOURCE%
if %FASTDEP%
## In fast-dep mode, we can always use -o.
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??!SUBDIROBJ? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'` &&\
?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
else !%FASTDEP%
if %AMDEP%
%VERBOSE%source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
if %?GENERIC%
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
else !%?GENERIC%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
endif !%?GENERIC%
endif !%FASTDEP%
endif %?NONLIBTOOL%
if %?LIBTOOL%
?GENERIC?%EXT%.lo:
?!GENERIC?%LTOBJ%: %SOURCE%
if %FASTDEP%
## In fast-dep mode, we can always use -o.
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
?GENERIC??!SUBDIROBJ? %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
?GENERIC??SUBDIROBJ? %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE% &&\
?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
else !%FASTDEP%
if %AMDEP%
%VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
## We can always use '-o' with Libtool.
?GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
endif !%FASTDEP%
endif %?LIBTOOL%

View File

@ -0,0 +1,561 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
DIST_COMMON += $(am__DIST_COMMON)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
if %?TOPDIR_P%
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
## On MSYS (1.0.17) it is not possible to remove a directory that is in
## use; so, if the first rm fails, we sleep some seconds and retry, to
## give pending processes some time to exit and "release" the directory
## before we remove it. The value of "some seconds" is 5 for the moment,
## which is mostly an arbitrary value, but seems high enough in practice.
## See automake bug#10470.
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
endif %?TOPDIR_P%
if %?SUBDIRS%
## computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2.
## Input:
## - DIR1 relative pathname, relative to the current directory
## - DIR2 relative pathname, relative to the current directory
## Output:
## - reldir relative pathname of DIR2, relative to DIR1
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
endif %?SUBDIRS%
.PHONY: distdir
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += distdir
endif %?SUBDIRS%
distdir: $(DISTFILES)
##
## For Gnits users, this is pretty handy. Look at 15 lines
## in case some explanatory text is desirable.
##
if %?TOPDIR_P%
if %?CK-NEWS%
@case `sed 15q $(srcdir)/NEWS` in \
*"$(VERSION)"*) : ;; \
*) \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1;; \
esac
endif %?CK-NEWS%
endif %?TOPDIR_P%
##
## Only for the top dir.
##
if %?TOPDIR_P%
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
endif %?TOPDIR_P%
##
##
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
##
## Yet another hack to support SUN make.
##
## Let's assume 'foo' appears in DISTFILES and is not a built file.
## When building with VPATH=$(srcdir), SUN make and OSF1/Tru64 will
## rewrite 'foo' as '$(srcdir)/foo'. An attempt to install the file
## with
## cp $file $(distdir)/$file
## will thus install $(srcdir)/foo as $(distdir)/$(srcdir)/foo
## instead of $(distdir)/foo.
##
## So let's strip this leading $(srcdir)/ when it exists. (As far we
## know, only SUN make and OSF1/Tru64 make add it.) Searching whether
## the file is to be found in the source or build directory will be
## done later.
##
## In case we are _not_ using SUN or OSF1/Tru64 make, how can we be sure
## we are not stripping a legitimate filename that starts with the
## same pattern as $(srcdir)?
## Well, it can't happen without the Makefile author distributing
## something out of the distribution (which is bad). As an example,
## consider "EXTRA_DIST = ../bar". This is an issue if $srcdir is
## '..', however getting this value for srcdir is impossible:
## "EXTRA_DIST = ../bar" implies we are in a subdirectory (so '../bar'
## is within the package), hence '$srcdir' is something like
## '../../subdir'.
##
## There is more to say about files which are above the current directory,
## like '../bar' in the previous example. The OSF1/Tru64 make
## implementation can simplify filenames resulting from a VPATH lookup.
## For instance if "VPATH = ../../subdir" and '../bar' is found in that
## VPATH directory, then occurrences of '../bar' will be replaced by
## '../../bar' (instead of '../../subdir/../bar'). This obviously defeats
## any attempt to strip a leading $srcdir. Presently we have no workaround
## for this. We avoid this issue by writing "EXTRA_DIST = $(srcdir)/../bar"
## instead of "EXTRA_DIST = ../bar". This prefixing is needed only for files
## above the current directory. Fortunately, apart from auxdir files which
## can be located in .. or ../.., this situation hardly occurs in practice.
##
## Also rewrite $(top_srcdir) (which sometimes appears in DISTFILES, and can
## be absolute) by $(top_builddir) (which is always relative). $(srcdir) will
## be prepended later.
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
## (The second 't' command clears the flag for the next round.)
##
## Make the subdirectories for the files.
##
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
##
##
for file in $$dist_files; do \
##
## Always look for the file in the build directory first. That way
## for something like yacc output we will correctly pick up the latest
## version. Also check for directories in the build directory first,
## so one can ship generated directories.
##
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
##
## Use cp, not ln. There are situations in which "ln" can fail. For
## instance a file to distribute could actually be a cross-filesystem
## symlink -- this can easily happen if "gettextize" was run on the
## distribution.
##
if test -d $$d/$$file; then \
## Don't mention $$file in the destination argument, since this fails if
## the destination directory already exists. Also, use '-R' and not '-r'.
## '-r' is almost always incorrect.
##
## If a directory exists both in '.' and $(srcdir), then we copy the
## files from $(srcdir) first and then install those from '.'. This
## can help people who distribute directories made of source files
## *and* generated files. It is also important when the directory
## exists only in $(srcdir), because some vendor Make (such as Tru64)
## will magically create an empty directory in '.'.
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
## If the destination directory already exists, it may contain read-only
## files, e.g., during "make distcheck".
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
## Test for file existence because sometimes a file gets included in
## DISTFILES twice. For example this happens when a single source
## file is used in building more than one program.
## See also test 'dist-repeated.sh'.
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
##
## Test for directory existence here because previous automake
## invocation might have created some directories. Note that we
## explicitly set distdir for the subdir make; that lets us mix-n-match
## many automake-using packages into one large package, and have "dist"
## at the top level do the right thing. If we're in the topmost
## directory, then we use 'distdir' instead of 'top_distdir'; this lets
## us work correctly with an enclosing package.
if %?SUBDIRS%
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
## Disable am__remove_distdir so that sub-packages do not clear a
## directory we have already cleared and might even have populated
## (e.g. shared AUX dir in the sub-package).
am__remove_distdir=: \
## Disable filename length check:
am__skip_length_check=: \
## No need to fix modes more than once:
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
endif %?SUBDIRS%
##
## We might have to perform some last second updates, such as updating
## info files.
## We must explicitly set distdir and top_distdir for these sub-makes.
##
if %?DIST-TARGETS%
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
%DIST-TARGETS%
endif %?DIST-TARGETS%
##
## This complex find command will try to avoid changing the modes of
## links into the source tree, in case they're hard-linked.
##
## Ignore return result from chmod, because it might give an error
## if we chmod a symlink.
##
## Another nastiness: if the file is unreadable by us, we make it
## readable regardless of the number of links to it. This only
## happens in perverse cases.
##
## We use $(install_sh) because that is a known-portable way to modify
## the file in place in the source tree.
##
## If we are being invoked recursively, then there is no need to walk
## the whole subtree again. This is a complexity reduction for a deep
## hierarchy of subpackages.
##
if %?TOPDIR_P%
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
if %?FILENAME_FILTER%
@if test -z "$(am__skip_length_check)" && find "$(distdir)" -type f -print | \
grep '^%FILENAME_FILTER%' 1>&2; then \
echo 'error: the above filenames are too long' 1>&2; \
exit 1; \
else :; fi
endif %?FILENAME_FILTER%
endif %?TOPDIR_P%
## --------------------------------------- ##
## Building various distribution flavors. ##
## --------------------------------------- ##
## Note that we don't use GNU tar's '-z' option. One reason (but not
## the only reason) is that some versions of tar (e.g., OSF1)
## interpret '-z' differently.
##
## The -o option of GNU tar used to exclude empty directories. This
## behavior was fixed in tar 1.12 (released on 1997-04-25). But older
## versions of tar are still used (for instance NetBSD 1.6.1 ships
## with tar 1.11.2). We do not do anything specific w.r.t. this
## incompatibility since packages where empty directories need to be
## present in the archive are really unusual.
##
## We order DIST_TARGETS by expected duration of the compressors,
## slowest first, for better parallelism in "make dist". Do not
## reorder DIST_ARCHIVES, users may expect gzip to be first.
##
## Traditionally, gzip prepended the contents of the GZIP environment
## variable to its arguments, and the commands below formerly used
## this by invoking 'GZIP=$(GZIP_ENV) gzip'. The GZIP environment
## variable is now considered to be obsolescent, so the commands below
## now use 'eval GZIP= gzip $(GZIP_ENV)' instead; this should work
## with both older and newer gzip implementations. The 'eval' is to
## support makefile assignments like 'GZIP_ENV = "-9 -n"' that quote
## the GZIP_ENV right-hand side because that was needed with the
## former invocation pattern.
if %?TOPDIR_P%
?GZIP?DIST_ARCHIVES += $(distdir).tar.gz
GZIP_ENV = --best
.PHONY: dist-gzip
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
.PHONY: dist-bzip2
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
.PHONY: dist-lzip
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
?XZ?DIST_ARCHIVES += $(distdir).tar.xz
.PHONY: dist-xz
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
.PHONY: dist-tarZ
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
.PHONY: dist-shar
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
?ZIP?DIST_ARCHIVES += $(distdir).zip
.PHONY: dist-zip
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
?LZIP?DIST_TARGETS += dist-lzip
?XZ?DIST_TARGETS += dist-xz
?SHAR?DIST_TARGETS += dist-shar
?BZIP2?DIST_TARGETS += dist-bzip2
?GZIP?DIST_TARGETS += dist-gzip
?ZIP?DIST_TARGETS += dist-zip
?COMPRESS?DIST_TARGETS += dist-tarZ
endif %?TOPDIR_P%
## ------------------------------------------------- ##
## Building all the requested distribution flavors. ##
## ------------------------------------------------- ##
## Currently we cannot use if/endif inside a rule. The file_contents
## parser needs work.
if %?TOPDIR_P%
.PHONY: dist dist-all
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += dist dist-all
endif %?SUBDIRS%
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
endif %?TOPDIR_P%
## ------------------------- ##
## Checking a distribution. ##
## ------------------------- ##
if %?TOPDIR_P%
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += distcheck
endif %?SUBDIRS%
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
.PHONY: distcheck
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
## Make the new source tree read-only. Distributions ought to work in
## this case. However, make the top-level directory writable so we
## can make our new subdirs.
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
## Undo the write access.
chmod a-w $(distdir)
## With GNU make, the following command will be executed even with "make -n",
## due to the presence of '$(MAKE)'. That is normally all well (and '$(MAKE)'
## is necessary for things like parallel distcheck), but here we don't want
## execution. To avoid MAKEFLAGS parsing hassles, use a witness file that a
## non-'-n' run would have just created.
test -d $(distdir)/_build || exit 0; \
## Compute the absolute path of '_inst'. Strip any leading DOS drive
## to allow DESTDIR installations. Otherwise "$(DESTDIR)$(prefix)" would
## expand to "c:/temp/am-dc-5668/c:/src/package/package-1.0/_inst".
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
## We will attempt a DESTDIR install in $dc_destdir. We don't
## create this directory under $dc_install_base, because it would
## create very long directory names.
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
?DISTCHECK-HOOK? && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
## Parallel BSD make may not start a new shell for each command in a recipe,
## so be sure to 'cd' back to the original directory after this.
&& am__cwd=`pwd` \
## If we merely used '$(distdir)/_build' here, "make distcheck" could
## sometimes fail to detect missing files in the distribution tarball,
## especially in those cases where both the generated files and their
## dependencies are explicitly in $(srcdir). See automake bug#18286.
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
?GETTEXT? --with-included-gettext \
## Additional flags for configure.
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
## At the moment, the code doesn't actually support changes in these --srcdir
## and --prefix values, so don't allow them to be overridden by the user or
## the developer. That used to be allowed, and caused issues in practice
## (in corner-case usages); see automake bug#14991.
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
## Make sure the package has proper DESTDIR support (we could not test this
## in the previous install/installcheck/uninstall test, because it's reasonable
## for installcheck to fail in a DESTDIR install).
## We make the '$dc_install_base' read-only because this is where files
## with missing DESTDIR support are likely to be installed.
&& chmod -R a-w "$$dc_install_base" \
## The logic here is quite convoluted because we must clean $dc_destdir
## whatever happens (it won't be erased by the next run of distcheck like
## $(distdir) is).
&& ({ \
## Build the directory, so we can cd into it even if "make install"
## didn't create it. Use mkdir, not $(MKDIR_P) because we want to
## fail if the directory already exists (PR/413).
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
## Make sure to remove the dists we created in the test build directory.
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
## Cater to parallel BSD make (see above).
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
## Define distuninstallcheck_listfiles and distuninstallcheck separately
## from distcheck, so that they can be overridden by the user.
.PHONY: distuninstallcheck
distuninstallcheck_listfiles = find . -type f -print
## The 'dir' file (created by install-info) might still exist after
## uninstall, so we must be prepared to account for it. The following
## check is not 100% strict, but is definitely good enough, and even
## accounts for overridden $(infodir).
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
## Define distcleancheck_listfiles and distcleancheck separately
## from distcheck, so that they can be overridden by the user.
.PHONY: distcleancheck
distcleancheck_listfiles = find . -type f -print
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
endif %?TOPDIR_P%

View File

@ -0,0 +1,19 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,168 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
VPATH = @srcdir@
@SET_MAKE@
## We used to define this. However, we don't because vendor makes
## (e.g., Solaris, Irix) won't correctly propagate variables that are
## defined in Makefile. This particular variable can't be correctly
## defined by configure (at least, not the current configure), so we
## simply avoid defining it to allow the user to use this feature with
## a vendor make.
## DESTDIR =
## Shell code that determines whether we are running under GNU make.
##
## Why the this needs to be so convoluted?
##
## (1) We can't unconditionally use make functions or special variables
## starting with a dot, as those cause non-GNU implmentations to
## crash hard.
##
## (2) We can't use $(MAKE_VERSION) here, as it is also defined in some
## non-GNU make implementations (e.g., FreeBSD make). But at least
## BSD make does *not* define the $(CURDIR) variable -- it uses
## $(.CURDIR) instead.
##
## (3) We can't use $(MAKEFILE_LIST) here, as in some situations it
## might cause the shell to die with "Arg list too long" (see
## automake bug#18744).
##
## (4) We can't use $(MAKE_HOST) unconditionally, as it is only
## defined in GNU make 4.0 or later.
##
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
## Shell code that determines whether the current make instance is
## running with a given one-letter option (e.g., -k, -n) that takes
## no argument.
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
## The format of $(MAKEFLAGS) is quite tricky with GNU make; the
## variable $(MFLAGS) behaves much better in that regard. So use it.
sane_makeflags=$$MFLAGS; \
else \
## Non-GNU make: we must rely on $(MAKEFLAGS). This is tricker and more
## brittle, but is the best we can do.
case $$MAKEFLAGS in \
## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS
## to " TESTS=foo\ nap", so that the simpler loop below (on word-split
## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
## misinterpret that as and indication that make is running in dry mode.
## This has already happened in practice. So we need this hack.
*\\[\ \ ]*) \
## Extra indirection with ${bs} required by FreeBSD 8.x make.
## Not sure why (so sorry for the cargo-cult programming here).
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
##
## GNU make 4.0 has changed the format of $MFLAGS, and removed the space
## between an option and its argument (e.g., from "-I dir" to "-Idir").
## So we need to handle both formats, at least for options valid in GNU
## make. OTOH, BSD make formats $(MAKEFLAGS) by separating all options,
## and separating any option from its argument, so things are easier
## there.
##
## For GNU make and BSD make.
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
## For GNU make >= 4.0.
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
## For GNU make (possibly overkill, this one).
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
## For BSD make.
-[dEDm]) skip_next=yes;; \
## For NetBSD make.
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
## Shell code that determines whether make is running in "dry mode"
## ("make -n") or not. Useful in rules that invoke make recursively,
## and are thus executed also with "make -n" -- either because they
## are declared as dependencies to '.MAKE' (NetBSD make), or because
## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
## Shell code that determines whether make is running in "keep-going mode"
## ("make -k") or not. Useful in rules that must recursively descend into
## subdirectories, and decide whether to stop at the first error or not.
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
## Some derived variables that have been found to be useful.
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
## These are defined because otherwise make on NetBSD V1.1 will print
## (eg): $(NORMAL_INSTALL) expands to empty string.
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
## dejagnu.am uses these variables. Some users might rely on them too.
?BUILD?build_triplet = @build@
?HOST?host_triplet = @host@
?TARGET?target_triplet = @target@

View File

@ -0,0 +1,19 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2017 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 <http://www.gnu.org/licenses/>.
## Exactly the same as data.am.
include data.am

View File

@ -0,0 +1,73 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2004-2017 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 <http://www.gnu.org/licenses/>.
if %?FIRST%
## These variables help stripping any $(VPATH) that some
## Make implementations prepend before VPATH-found files.
## The issue is discussed at length in distdir.am.
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
## Strip all directories.
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
## Number of files to install concurrently.
am__install_max = 40
## Take a $list of nobase files, strip $(srcdir) from them.
## Split apart in setup variable and an action that can be used
## in backticks or in a pipe.
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
## Take a $list of nobase files, collect them, indexed by their
## srcdir-stripped dirnames. For up to am__install_max files, output
## a line containing the dirname and the files, space-separated.
## The arbitrary limit helps avoid the quadratic scaling exhibited by
## string concatenation in most shells, and should avoid line length
## limitations, while still offering only negligible performance impact
## through spawning more install commands than absolutely needed.
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
## Collect up to 40 files per line from stdin.
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
## A shell code fragment to uninstall files from a given directory.
## It expects the $dir and $files shell variables to be defined respectively
## to the directory where the files to be removed are, and to the list of
## such files.
am__uninstall_files_from_dir = { \
## Some rm implementations complain if 'rm -f' is used without arguments.
test -z "$$files" \
## At least Solaris /bin/sh still lacks 'test -e', so we use the multiple
## tests below instead. We expect $dir to be either non-existent or a
## directory, so the failure we'll experience if it is a regular file
## is indeed desired and welcome (better to fail loudly thasn silently).
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
endif %?FIRST%

View File

@ -0,0 +1,105 @@
## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2017 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 <http://www.gnu.org/licenses/>.
## ----------------------------------------- ##
## installdirs -- Creating the installdirs. ##
## ----------------------------------------- ##
## The reason we loop over %am__installdirs% (instead of simply running
## $(MKDIR_P) %am__installdirs%) is that directories variable such as
## "$(DESTDIR)$(mydir)" can potentially expand to "" if $(mydir) is
## conditionally defined. BTW, those directories are quoted in order
## to support installation paths with spaces.
if %?SUBDIRS%
.PHONY: installdirs installdirs-am
RECURSIVE_TARGETS += installdirs-recursive
installdirs: installdirs-recursive
installdirs-am:%installdirs-local%
?am__installdirs? for dir in %am__installdirs%; do \
?am__installdirs? test -z "$$dir" || $(MKDIR_P) "$$dir"; \
?am__installdirs? done
else !%?SUBDIRS%
.PHONY: installdirs
installdirs:%installdirs-local%
?am__installdirs? for dir in %am__installdirs%; do \
?am__installdirs? test -z "$$dir" || $(MKDIR_P) "$$dir"; \
?am__installdirs? done
endif !%?SUBDIRS%
## ----------------- ##
## Install targets. ##
## ----------------- ##
.PHONY: install install-exec install-data uninstall
.PHONY: install-exec-am install-data-am uninstall-am
if %?SUBDIRS%
RECURSIVE_TARGETS += install-data-recursive install-exec-recursive \
install-recursive uninstall-recursive
install:%maybe_BUILT_SOURCES% install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
else !%?SUBDIRS%
install:%maybe_BUILT_SOURCES% install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
endif !%?SUBDIRS%
if %?maybe_BUILT_SOURCES%
.MAKE: install
endif %?maybe_BUILT_SOURCES%
.MAKE .PHONY: install-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
.PHONY: installcheck
?SUBDIRS?installcheck: installcheck-recursive
?!SUBDIRS?installcheck: installcheck-am
?!SUBDIRS?.PHONY: installcheck-am
?!SUBDIRS?installcheck-am:
## If you ever modify this, keep in mind that INSTALL_PROGRAM is used
## in subdirectories, so never set it to a value relative to the top
## directory.
.MAKE .PHONY: install-strip
install-strip:
## Beware that there are two variables used to install programs:
## INSTALL_PROGRAM is used for ordinary *_PROGRAMS
## install_sh_PROGRAM is used for nobase_*_PROGRAMS (because install-sh
## creates directories)
## It's OK to override both with INSTALL_STRIP_PROGRAM, because
## INSTALL_STRIP_PROGRAM uses install-sh (see m4/strip.m4 for a rationale).
##
## Use double quotes for the *_PROGRAM settings because we might need to
## interpolate some backquotes at runtime.
##
## The case for empty $(STRIP) is separate so that it is quoted correctly for
## multiple words, but does not expand to an empty words if STRIP is empty.
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi

Some files were not shown because too many files have changed in this diff Show More