libtool: vendor as full-fork recipe (path=source, patches baked)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/libtool"
|
||||
branch = "v2.5.4-redox"
|
||||
shallow_clone = true
|
||||
# Vendored local fork (full-fork model): builds from the committed source/
|
||||
# tree (offline, reproducible). source/ = pristine upstream + the patches below
|
||||
# BAKED IN. .patch files kept tracked so a version bump can re-apply them via
|
||||
# sync-recipe-source.sh.
|
||||
# upstream: https://gitlab.redox-os.org/redox-os/libtool
|
||||
path = "source"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ChangeLog merge=merge-changelog
|
||||
@@ -0,0 +1,75 @@
|
||||
*.aux
|
||||
*.cp
|
||||
*.cps
|
||||
*.dvi
|
||||
*.exe
|
||||
*.fn
|
||||
*.info*
|
||||
*.ky
|
||||
*.la
|
||||
*.lo
|
||||
*.log
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.pdf
|
||||
*.pg
|
||||
*.ps
|
||||
*.rej
|
||||
*.toc
|
||||
*.tp
|
||||
*.vr
|
||||
*~
|
||||
+build
|
||||
+dest
|
||||
+inst
|
||||
.#*
|
||||
.*.prcs_aux
|
||||
.DS_Store
|
||||
.deps
|
||||
.dirstamp
|
||||
.gdb_history
|
||||
.gitmodules
|
||||
.libs
|
||||
/.pc
|
||||
/.sc-start*
|
||||
/.serial
|
||||
/.version
|
||||
/COPYING
|
||||
/ChangeLog
|
||||
/GNUmakefile
|
||||
/INSTALL
|
||||
/README-release
|
||||
/gnulib-local
|
||||
/gnulib-tests
|
||||
/libtoolize
|
||||
/libtoolize.in
|
||||
/maint.mk
|
||||
/patches
|
||||
/release
|
||||
Makefile
|
||||
Makefile.in
|
||||
README
|
||||
\#*#
|
||||
_libs
|
||||
acinclude.m4
|
||||
aclocal.m4
|
||||
atconfig
|
||||
autom4te.cache
|
||||
config-h.in
|
||||
config.*
|
||||
configure
|
||||
conftest*
|
||||
libtool
|
||||
libtool-*.tar.bz2
|
||||
libtool-*.tar.gz
|
||||
libtool-*.tar.lzma
|
||||
libtool-*.tar.xz
|
||||
manual.html
|
||||
patches
|
||||
stamp-*
|
||||
testdir*
|
||||
testsuite
|
||||
testsuite.dir
|
||||
testsuite.log
|
||||
vc-diffs
|
||||
@@ -0,0 +1 @@
|
||||
2.5.3
|
||||
@@ -0,0 +1 @@
|
||||
libtool
|
||||
@@ -0,0 +1,3 @@
|
||||
ChangeLog.old
|
||||
\.diff$
|
||||
\.patch$
|
||||
@@ -0,0 +1,48 @@
|
||||
* GNU Libtool was conceived, designed and implemented by:
|
||||
|
||||
Gordon Matzigkeit gord@gnu.org
|
||||
|
||||
* GNU Libtool's Dynamic Loader library (libltdl) was conceived,
|
||||
designed and implemented by:
|
||||
|
||||
Thomas Tanner tanner@ffii.org
|
||||
|
||||
* GNU Libtool and libltdl have previously been maintained, enhanced,
|
||||
ported and otherwise advanced by:
|
||||
|
||||
Alexandre Oliva oliva@dcc.unicamp.br
|
||||
Ossama Othman ossama@debian.org
|
||||
Robert Boehne rboehne@ricardo-us.com
|
||||
Scott James Remnant scott@netsplit.com
|
||||
Peter O'Gorman peter@pogma.com
|
||||
Ralf Wildenhues Ralf.Wildenhues@gmx.de
|
||||
Gary V. Vaughan gary@vaughan.pe
|
||||
Bob Friesenhahn bfriesen@simple.dallas.tx.us
|
||||
Peter Rosin peda@lysator.liu.se
|
||||
Noah Misch noah@cs.caltech.edu
|
||||
Charles Wilson libtool@cwilson.fastmail.fm
|
||||
Brooks Moses bmoses@google.com
|
||||
Alex Ameen alex.ameen.tx@gmail.com
|
||||
|
||||
* GNU Libtool is currently being cajoled, bullied,
|
||||
rewritten and otherwise dragged into the future by:
|
||||
|
||||
Ileana Dumitrescu ileanadumitrescu95@gmail.com
|
||||
--
|
||||
Copyright (C) 1996, 1998-2019, 2021-2024 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
GNU Libtool 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.
|
||||
|
||||
GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,481 @@
|
||||
GNU Libtool
|
||||
***********
|
||||
|
||||
1. Introduction
|
||||
===============
|
||||
|
||||
This file attempts to describe the processes we use to maintain libtool,
|
||||
and is not part of a release distribution.
|
||||
|
||||
2. Maintenance Notes
|
||||
====================
|
||||
|
||||
* If you incorporate a change from somebody on the net:
|
||||
If it is a large change, you must make sure they have signed the
|
||||
appropriate paperwork, and be sure to add their name and email
|
||||
address to THANKS.
|
||||
|
||||
* If a change fixes a test, mention the test in the git log entry.
|
||||
|
||||
* If somebody reports a new bug, mention their name in the git log entry
|
||||
and in the test case you write.
|
||||
|
||||
* The correct response to most actual bugs is to write a new test case
|
||||
that demonstrates the bug. Then fix the bug, re-run the test suite,
|
||||
and check everything in.
|
||||
|
||||
* Always run the testsuite after applying a patch:
|
||||
make check syntax-check TESTSUITEFLAGS="--jobs=$(nproc)" -j$(nproc)
|
||||
|
||||
Ideally also verify the release process doesn't break:
|
||||
make distcheck TESTSUITEFLAGS="--jobs=$(nproc)" -j$(nproc)
|
||||
This will run check & syntax-check from above, but will take longer as
|
||||
builds & tests in different configurations.
|
||||
|
||||
* Some files in the libtool package are not owned by libtool. These
|
||||
files should never be edited here. These files are:
|
||||
COPYING
|
||||
INSTALL
|
||||
doc/
|
||||
+ gendocs_template
|
||||
+ gendocs_template_min
|
||||
+ fdl.texi
|
||||
libltdl/
|
||||
+ COPYING.LIB
|
||||
libltdl/config/
|
||||
+ compile
|
||||
+ config.guess
|
||||
+ config.sub
|
||||
+ depcomp
|
||||
+ install-sh
|
||||
+ mdate-sh
|
||||
+ missing
|
||||
+ texinfo.tex
|
||||
m4/
|
||||
+ 00gnulib.m4
|
||||
+ gnulib-cache.m4
|
||||
+ gnulib-common.m4
|
||||
+ gnu-comp.m4
|
||||
+ gnulib-tool.m4
|
||||
+ ltversion.m4
|
||||
+ zzgnulib.m4
|
||||
GNUmakefile
|
||||
maint.mk
|
||||
|
||||
The ones that are important for a release can be updated by ensuring
|
||||
gnulib is up-to-date, and running 'bootstrap' to recheck the links are
|
||||
correct.
|
||||
|
||||
* Changes other than bug fixes must be mentioned in NEWS.
|
||||
|
||||
|
||||
3. Test Suite
|
||||
=============
|
||||
|
||||
* When writing tests, make sure the link invocation (first argument to
|
||||
AT_CHECK) is on a single line so that 'testsuite -x' displays the
|
||||
whole thing. You can use m4_do or '[... ]dnl' to wrap long lines.
|
||||
|
||||
* To debug a failing or skipped range of tests, e.g. 13 to 14:
|
||||
make check-local TESTSUITEFLAGS="--debug 13-14"
|
||||
More generally, in the TESTSUITEFLAGS you can use the documented
|
||||
options for Autotest generated testsuites:
|
||||
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/testsuite-Invocation.html
|
||||
|
||||
* Run tests in parallel with
|
||||
make -k check TESTSUITEFLAGS="--jobs=$(nproc)"
|
||||
liberally, on as many platforms as you can. Use as many compilers and
|
||||
linkers you can. To run old and new testsuites separately, use:
|
||||
make check TESTSUITEFLAGS=-V
|
||||
make check-local
|
||||
|
||||
* The gnulib module also provides some maintainer-focused tests that only
|
||||
work when run from a git checkout.
|
||||
make syntax-check
|
||||
|
||||
* The new Autotest testsuite uses keywords to denote test features:
|
||||
autoconf needs Autoconf
|
||||
automake needs Automake
|
||||
libltdl exercises the 'libltdl' library
|
||||
libtool exercises the 'libtool' script
|
||||
libtoolize exercises the 'libtoolize' script
|
||||
recursive runs the suite recursively, with a modified
|
||||
'libtool' script and with '-k libtool'
|
||||
CXX F77 FC GCJ exercises a language other than C
|
||||
|
||||
|
||||
4. Naming
|
||||
=========
|
||||
|
||||
* We've adopted the convention that exported Autoconf macros should be
|
||||
named with a leading 'LT_' and be documented in the libtool manual.
|
||||
Internal macros begin with '_LT_' if they are visible to aclocal, or
|
||||
potentially part of an AC_DEFUN/AC_REQUIRE path, or else '_lt_' if
|
||||
they are very low level. This convention was only introduced just
|
||||
before libtool-2.0, so there may still be exceptions in the existing
|
||||
code. But all new code should use it.
|
||||
|
||||
* All shell variables used internally by libtool's Autoconf macros
|
||||
should be named with the a leading 'lt_' (not that they cannot clash
|
||||
with the '_lt_' macro namespace).
|
||||
|
||||
|
||||
5. Using git
|
||||
============
|
||||
|
||||
* ChangeLog is generated from git log messages, so you have to format
|
||||
the git log carefully. Use --author for the (first, main) author
|
||||
of changesets from others, and sign patches you have reviewed. If the
|
||||
changeset has additional authors that need to be mentioned in the
|
||||
generated ChangeLog, then add them to the git log message with:
|
||||
|
||||
Co-authored-by: A U Thor <email@example.com>
|
||||
|
||||
Similarly, if the ChangeLog will need a '(tiny change)' annotation,
|
||||
then you should indicate that in the git log message with:
|
||||
|
||||
Copyright-paperwork-exempt: Yes
|
||||
|
||||
Start the git log message with a short one line summary, then an empty
|
||||
line, then the rest of the log entry.
|
||||
|
||||
If you forgot to annotate correctly in the git log message, or made
|
||||
any other mistake that needs correcting in the distributed ChangeLog
|
||||
file, make an amendment against the SHA1 of the errored commit in
|
||||
$aux_dir/git-log-fix.
|
||||
|
||||
* You may find it useful to install the $aux_dir/git-hooks/commit-msg
|
||||
script to .git/hooks in your libtool working directory to help you
|
||||
make the best use of git log message metadata.
|
||||
|
||||
* Do not ever rewind the public master branch nor any public release
|
||||
branch on savannah, neither any release tags once they have been
|
||||
published. Other branches and tags may have different rules.
|
||||
|
||||
* Avoid merge commits on the master branch of the public git repository.
|
||||
For unpublished changes in your development tree, it's easiest to
|
||||
rebase against the current master before applying them, this preserves
|
||||
a linear history.
|
||||
|
||||
|
||||
6. Editing '.am' Files
|
||||
======================
|
||||
|
||||
* Always use $(...) and not ${...}.
|
||||
|
||||
* Use ':', not 'true'. Use 'exit 1', not 'false'.
|
||||
|
||||
* Use '##' comments liberally. Comment anything even remotely unusual.
|
||||
|
||||
* Never use basename or dirname. Instead use sed.
|
||||
|
||||
* Do not use 'cd' within back-quotes, use '$(lt__cd)' instead.
|
||||
Otherwise the directory name may be printed, depending on CDPATH.
|
||||
|
||||
* In general, if a loop is required, it should be silent. Then the body
|
||||
of the loop itself should print each "important" command it runs.
|
||||
|
||||
* Use 4 extra spaces to indent continued dependencies.
|
||||
|
||||
* One needs to remember that for our whole logic for the different
|
||||
libltdl modes to function correctly, the thing we need to ensure
|
||||
*before the client runs libtoolize*, is that the subpackage case is
|
||||
correct (because all files may be symlinked there). All others can
|
||||
and will be fixed in the 'libtoolize --ltdl --(non)recursive' stage.
|
||||
|
||||
|
||||
7. Editing '.m4' Files
|
||||
======================
|
||||
|
||||
* Be careful with both 'echo' and '$ECHO'. As the latter may be one of
|
||||
print -r --
|
||||
printf %s\n
|
||||
func_fallback_echo
|
||||
it may not have more than one argument and its value may not be
|
||||
eval'ed. However, the argument may start with a '-' and contain
|
||||
backslashes. As a rule of thumb, use
|
||||
echo .. for literal (constant) strings without leading
|
||||
hyphen and no backslashes within,
|
||||
$ECHO ".." otherwise.
|
||||
func_echo_all when multiple arguments are present, or when
|
||||
placed in an eval'ed variable.
|
||||
|
||||
* The Autoconf manual says that giving an empty parameter is equivalent
|
||||
to not giving it at all. (In particular, the Autoconf manual doesn't
|
||||
explain that "FOO()" is calling macro FOO with one empty parameter.)
|
||||
To prevent misunderstanding, we should use m4_ifval to check whether
|
||||
a parameter is empty, and not $# to check for the number of parameters.
|
||||
|
||||
* Any time we add a macro to an older version, lt~obsolete.m4 needs to
|
||||
be updated in all newer versions.
|
||||
|
||||
|
||||
8. Abstraction layers in libltdl
|
||||
================================
|
||||
|
||||
* The libltdl API uses a layered approach to differentiate internal and
|
||||
external interfaces, among other things. To keep the abstraction
|
||||
consistent, files in a given layer may only use APIs from files in the
|
||||
lower layers. The ASCII art boxes below represent this stack, from
|
||||
top to bottom...
|
||||
|
||||
* But first, outside of the stack, there is a convenience header that
|
||||
defines the internal interfaces (as evidenced by the 'lt__' prefix to
|
||||
the filename!) shared between implementation files in the stack, that
|
||||
are however not exported to libltdl clients:
|
||||
|
||||
,-------------.
|
||||
|lt__private.h|
|
||||
`-------------'
|
||||
|
||||
* The top layer of the stack is the libltdl API proper, which includes
|
||||
the relevant subsystems automatically. Clients of libltdl need only
|
||||
invoke:
|
||||
|
||||
#include <ltdl.h>
|
||||
|
||||
,------.
|
||||
|ltdl.h|
|
||||
+------+
|
||||
|ltdl.c|
|
||||
`------'
|
||||
|
||||
* The next layer is comprised of the subsystems of the exported libltdl
|
||||
API, which are implemented by files that are named with a leading 'lt_'
|
||||
(single underscore!):
|
||||
|
||||
,------------v---------------.
|
||||
| lt_error.h | lt_dlloader.h |
|
||||
+------------+---------------+
|
||||
| lt_error.c | lt_dlloader.c |
|
||||
`------------^---------------'
|
||||
|
||||
* The next file is used both by the headers that implement it (in which
|
||||
case its function is to avoid namespace clashes when linking with the
|
||||
GNU C library proper) and is included by code that wants to program
|
||||
against a glibc-like interface, in which case it serves to pull in all
|
||||
the glibc-like functionality used by libltdl with a simple:
|
||||
|
||||
#include <libltdl/lt__glibc.h>
|
||||
|
||||
It consists of a single file:
|
||||
|
||||
,-----------.
|
||||
|lt__glibc.h|
|
||||
`-----------'
|
||||
|
||||
* Next to last is the libc abstraction layer, which provides a uniform
|
||||
API to various system libc interfaces that differ between hosts
|
||||
supported by libtool. Typically, the files that implement this layer
|
||||
begin:
|
||||
|
||||
#if defined(LT_CONFIG_H)
|
||||
# include LT_CONFIG_H
|
||||
#else
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "lt_system.h"
|
||||
|
||||
Or if they are installed headers that must work outside the libtool
|
||||
source tree, simply:
|
||||
|
||||
#include <libltdl/lt_system.h>
|
||||
|
||||
This layer's interface is defined by files that are usually named with
|
||||
a leading 'lt__':
|
||||
|
||||
,--------------v-------------v------------v--------v---------.
|
||||
| lt__dirent.h | lt__alloc.h | lt__strl.h | argz.h | slist.h |
|
||||
+--------------+-------------+------------+--------+---------+
|
||||
| lt__dirent.c | lt__alloc.c | lt__strl.c | argz.c | slist.c |
|
||||
`--------------^-------------^------------^--------^---------'
|
||||
|
||||
(argz.h and slist.h are used independently of libltdl in other projects)
|
||||
|
||||
* At the bottom of the stack we have the system abstraction layer,
|
||||
which tries to smooth over the cracks where there are differences
|
||||
between host systems and compilers. config.h is generated at
|
||||
configure time and is not installed; lt_system.h is an installed
|
||||
file and cannot use macros from config.h:
|
||||
|
||||
,-----------.
|
||||
|../config.h|
|
||||
`-----------'
|
||||
|
||||
,-----------.
|
||||
|lt_system.h|
|
||||
`-----------'
|
||||
|
||||
* Tacked on the side of this stack, attached via the lt_dlloader.h
|
||||
definitions are the various implementation modules for run-time module
|
||||
loading: preopen.c, dlopen.c etc.
|
||||
|
||||
|
||||
9. Licensing Rules
|
||||
==================
|
||||
|
||||
GNU Libtool uses 3 different licenses for the files distributed herein,
|
||||
with several variations on license text. It is important that you use
|
||||
the correct license text in each new file added. Here are the texts
|
||||
along with some notes on when each is appropriate. Appropriate
|
||||
commenting (shell, C etc) and decoration (m4 etc) assumed throughout.
|
||||
|
||||
|
||||
|
||||
9.1. Notice preservation
|
||||
|
||||
Autoconf macros and files used to generate them need this license, along
|
||||
with files such as HACKING, NEWS, README, README.alpha, TODO and
|
||||
ChangeLogs:
|
||||
|
||||
Copyright (C) <year list> Free Software Foundation, Inc.
|
||||
Written by <author>, <year>
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
9.2. GPL
|
||||
|
||||
Everything else in the distribution has the following license text
|
||||
unless there is good reason to use one of the other license texts
|
||||
below:
|
||||
|
||||
Copyright (C) <year list> Free Software Foundation, Inc.
|
||||
Written by <author>, <year>
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
GNU Libtool 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.
|
||||
|
||||
GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
9.3. GPL with self extracting version
|
||||
|
||||
Some of the sources built atop the options-parser framework use
|
||||
func_version() to extract their --version output from the copyright
|
||||
block. Those files also need the --version copyright text paragraph as
|
||||
follows:
|
||||
|
||||
<program name> (GNU @PACKAGE@) <version number>
|
||||
Written by <author> <email address>.
|
||||
|
||||
This file is part of <parent package name>.
|
||||
|
||||
Copyright (C) <year list> 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.
|
||||
|
||||
<program name> 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.
|
||||
|
||||
<program name> 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 <program name>. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
9.4. GPL with self extracting version and Libtool exception clause
|
||||
|
||||
Although the libtool script is generated from 'ltmain.in' according
|
||||
to the rules in the preceding subsection, it also needs the Libtool
|
||||
exception clause so that it can be redistributed by other projects
|
||||
that use libtool:
|
||||
|
||||
<program name> (GNU @PACKAGE@@TIMESTAMP@) <version number>
|
||||
Written by <author> <email address>.
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
Copyright (C) <year list> 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.
|
||||
|
||||
<program name> 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.
|
||||
|
||||
As a special exception to the GNU General Public License,
|
||||
if you distribute this file as part of a program or library that
|
||||
is built using GNU Libtool, you may include this file under the
|
||||
same distribution terms that you use for the rest of that program.
|
||||
|
||||
<program name> 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 <program name>. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
9.5. LGPL with Libtool exception clause
|
||||
|
||||
Finally, not only is Libltdl is LGPLed, but it is routinely
|
||||
redistributed inside projects that use it, so its sources need to use
|
||||
the following license text citing the LGPL along with Libtool's special
|
||||
exception clause:
|
||||
|
||||
Copyright (C) <year list> Free Software Foundation, Inc.
|
||||
Written by <author>, <year>
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the
|
||||
GNU Libtool package. Report bugs to bug-libtool@gnu.org.
|
||||
|
||||
GNU Libltdl is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
As a special exception to the GNU Lesser General Public License,
|
||||
if you distribute this file as part of a program or library that
|
||||
is built using GNU Libtool, you may include this file under the
|
||||
same distribution terms that you use for the rest of that program.
|
||||
|
||||
GNU Libltdl 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with GNU Libltdl. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
--
|
||||
Copyright (C) 2004-2008, 2010-2019, 2021-2024 Free Software
|
||||
Foundation, Inc.
|
||||
Written by Gary V. Vaughan, 2004
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
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.
|
||||
|
||||
Local Variables:
|
||||
mode: text
|
||||
fill-column: 72
|
||||
End:
|
||||
vim:tw=72
|
||||
@@ -0,0 +1,836 @@
|
||||
## Makefile.am -- Process this file with automake to produce Makefile.in
|
||||
##
|
||||
## Copyright (C) 2003-2019, 2021-2024 Free Software Foundation, Inc.
|
||||
## Written by Gary V. Vaughan, 2003
|
||||
##
|
||||
## This file is part of GNU Libtool.
|
||||
##
|
||||
## GNU Libtool 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.
|
||||
##
|
||||
## GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
#####
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
AM_CPPFLAGS =
|
||||
AM_LDFLAGS =
|
||||
|
||||
SUBDIRS = . gnulib-tests
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
EXTRA_DIST =
|
||||
|
||||
BUILT_SOURCES = libtool libtoolize
|
||||
|
||||
CLEANFILES =
|
||||
MOSTLYCLEANFILES =
|
||||
DISTCLEANFILES =
|
||||
MAINTAINERCLEANFILES =
|
||||
|
||||
include_HEADERS =
|
||||
noinst_LTLIBRARIES =
|
||||
lib_LTLIBRARIES =
|
||||
EXTRA_LTLIBRARIES =
|
||||
|
||||
# Using 'cd' in backquotes may print the directory name, use this instead:
|
||||
lt__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
|
||||
git_version_gen = '$(SHELL)' '$(aux_dir)/git-version-gen' '--fallback' '$(VERSION)' '.tarball-version'
|
||||
rebuild = rebuild=:; revision=`$(lt__cd) $(srcdir) && $(git_version_gen) | $(SED) 's|-.*$$||'`
|
||||
|
||||
|
||||
# ---------- #
|
||||
# Bootstrap. #
|
||||
# ---------- #
|
||||
|
||||
SCRIPT_ENV = GREP='$(GREP)' SED='$(SED)'
|
||||
|
||||
build_scripts = $(srcdir)/$(aux_dir)/announce-gen \
|
||||
$(srcdir)/$(aux_dir)/do-release-commit-and-tag \
|
||||
$(srcdir)/$(aux_dir)/gendocs.sh \
|
||||
$(srcdir)/$(aux_dir)/git-version-gen \
|
||||
$(srcdir)/$(aux_dir)/gnu-web-doc-update \
|
||||
$(srcdir)/$(aux_dir)/gnupload \
|
||||
$(srcdir)/$(aux_dir)/useless-if-before-free \
|
||||
$(srcdir)/$(aux_dir)/vc-list-files
|
||||
|
||||
EXTRA_DIST += bootstrap bootstrap.conf $(build_scripts) cfg.mk maint.mk \
|
||||
GNUmakefile
|
||||
CLEANFILES += libtool libtoolize
|
||||
|
||||
## If a file is named several times below, and especially if it
|
||||
## is a distributed file created during Libtool bootstrap, we
|
||||
## put it in a variable in accordance with the DRY principle.
|
||||
## Use '$(srcdir)' for the benefit of non-GNU makes: referring
|
||||
## to them by their variable makes sure they appear as targets
|
||||
## and dependencies with '$(srcdir)' consistently.
|
||||
configure_ac = $(srcdir)/configure.ac
|
||||
config_status = $(top_builddir)/config.status
|
||||
extract_trace = $(srcdir)/$(aux_dir)/extract-trace
|
||||
funclib_sh = $(srcdir)/$(aux_dir)/funclib.sh
|
||||
inline_source = $(srcdir)/$(aux_dir)/inline-source
|
||||
libtoolize_in = $(srcdir)/libtoolize.in
|
||||
ltmain_sh = $(srcdir)/$(aux_dir)/ltmain.sh
|
||||
ltmain_in = $(srcdir)/$(aux_dir)/ltmain.in
|
||||
libtool_m4 = $(srcdir)/$(macro_dir)/libtool.m4
|
||||
ltversion_in = $(srcdir)/$(macro_dir)/ltversion.in
|
||||
ltversion_m4 = $(srcdir)/$(macro_dir)/ltversion.m4
|
||||
no_bogus_macros = $(srcdir)/$(aux_dir)/no-bogus-m4-defines
|
||||
options_parser = $(srcdir)/$(aux_dir)/options-parser
|
||||
u2d_copyright = $(srcdir)/$(aux_dir)/update-copyright
|
||||
|
||||
EXTRA_DIST += $(extract_trace) $(funclib_sh) $(inline_source) \
|
||||
$(libtoolize_in) $(ltmain_in) $(ltmain_sh) \
|
||||
$(ltversion_in) $(ltversion_m4) $(no_bogus_macros) \
|
||||
$(options_parser) $(u2d_copyright)
|
||||
|
||||
## These are the replacements that need to be made at bootstrap time,
|
||||
## because they must be static in distributed files, and not accidentally
|
||||
## changed by configure running on the build machine.
|
||||
bootstrap_edit = $(SED) \
|
||||
-e 's|@MACRO_VERSION\@|$(VERSION)|g' \
|
||||
-e "s|@MACRO_REVISION\@|$$revision|g" \
|
||||
-e "s|@MACRO_SERIAL\@|$$serial|g" \
|
||||
-e 's|@PACKAGE\@|$(PACKAGE)|g' \
|
||||
-e 's|@PACKAGE_BUGREPORT\@|$(PACKAGE_BUGREPORT)|g' \
|
||||
-e 's|@PACKAGE_URL\@|$(PACKAGE_URL)|g' \
|
||||
-e 's|@PACKAGE_NAME\@|$(PACKAGE_NAME)|g' \
|
||||
-e "s|@package_revision\@|$$revision|g" \
|
||||
-e 's|@PACKAGE_STRING\@|$(PACKAGE_NAME) $(VERSION)|g' \
|
||||
-e 's|@PACKAGE_TARNAME\@|$(PACKAGE)|g' \
|
||||
-e 's|@PACKAGE_VERSION\@|$(VERSION)|g' \
|
||||
-e 's|@VERSION\@|$(VERSION)|g'
|
||||
|
||||
## We build ltversion.m4 here, instead of from config.status,
|
||||
## because config.status is rerun each time one of configure's
|
||||
## dependencies change and ltversion.m4 happens to be a configure
|
||||
## dependency. configure and ltversion.m4 would be rebuilt in
|
||||
## a loop otherwise.
|
||||
## We used to do this with a 'stamp-vcl' file, but non-gmake builds
|
||||
## would rerun configure on every invocation, so now we manually
|
||||
## check the version numbers from the build rule when necessary.
|
||||
$(ltversion_m4): $(ltversion_in) $(dotversion)
|
||||
@$(rebuild); \
|
||||
if test -f '$@'; then \
|
||||
eval `'$(SED)' -n '/^macro_revision=/p' '$@'`; \
|
||||
test "x$$macro_revision" = "x$$revision" && rebuild=false; \
|
||||
fi; \
|
||||
for prereq in $?; do \
|
||||
case $$prereq in *.version);; *) rebuild=:;; esac; \
|
||||
done; \
|
||||
if $$rebuild; then \
|
||||
rm -f '$@'; \
|
||||
if test -d '$(srcdir)/.git' && git --version >/dev/null 2>&1; then \
|
||||
$(git_commit_count) > '$(srcdir)/.serial'; \
|
||||
fi; \
|
||||
serial=`cat '$(srcdir)/.serial'`; \
|
||||
if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \
|
||||
then echo " GEN " $@; \
|
||||
else echo $(bootstrap_edit) "'$(ltversion_in)' > '$@'"; fi; \
|
||||
$(bootstrap_edit) '$(ltversion_in)' > '$@'; \
|
||||
chmod a-w '$@'; \
|
||||
fi
|
||||
|
||||
## And for similar reasons, ltmain.sh can't be built from config.status.
|
||||
## We used to do this with a 'stamp-vcl' file, but non-gmake builds
|
||||
## would rerun configure on every invocation, so now we manually
|
||||
## check the version numbers from the build rule when necessary.
|
||||
## !WARNING! If you edit this rule to change the contents of ltmain.sh,
|
||||
## you must 'touch $(aux_dir)/ltmain.in' from the
|
||||
## shell if you need ltmain.sh to be regenerated. Ideally, we
|
||||
## should make this rule depend on Makefile but that will break
|
||||
## distcheck (at least) by rebuilding ltmain.sh in the source
|
||||
## tree whenever config.status regenerates the Makefile.
|
||||
$(ltmain_sh): $(ltmain_in) $(dotversion)
|
||||
@$(rebuild); \
|
||||
if test -f '$@'; then \
|
||||
eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
|
||||
test "x$$package_revision" = "x$$revision" && rebuild=false; \
|
||||
fi; \
|
||||
for prereq in $?; do \
|
||||
case $$prereq in *.version);; *) rebuild=:;; esac; \
|
||||
done; \
|
||||
if $$rebuild; then \
|
||||
rm -f '$@'; \
|
||||
if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \
|
||||
then echo " GEN " $@; \
|
||||
else echo "$(inline_source) '$(ltmain_in)' |" $(bootstrap_edit) "> '$@'"; fi; \
|
||||
$(SCRIPT_ENV) '$(inline_source)' '$(ltmain_in)' | $(bootstrap_edit) > '$@'; \
|
||||
chmod a-w '$@'; \
|
||||
fi
|
||||
|
||||
lt_Makefile_am = $(srcdir)/$(ltdl_dir)/Makefile.am
|
||||
lt_Makefile_in = $(srcdir)/$(ltdl_dir)/Makefile.in
|
||||
ltdl_mk = $(srcdir)/$(ltdl_dir)/ltdl.mk
|
||||
|
||||
$(lt_Makefile_am): $(ltdl_mk)
|
||||
$(AM_V_at)rm -f '$@'
|
||||
$(AM_V_GEN)( '$(SED)' -n '1,/^.. DO NOT REMOVE THIS LINE -- /p' \
|
||||
'$(ltdl_mk)'; \
|
||||
{ echo 'ACLOCAL_AMFLAGS = -I ../m4'; \
|
||||
echo 'AUTOMAKE_OPTIONS = foreign'; \
|
||||
echo 'AM_CPPFLAGS ='; \
|
||||
echo 'AM_LDFLAGS ='; \
|
||||
echo 'BUILT_SOURCES ='; \
|
||||
echo 'include_HEADERS ='; \
|
||||
echo 'noinst_LTLIBRARIES ='; \
|
||||
echo 'lib_LTLIBRARIES ='; \
|
||||
echo 'EXTRA_LTLIBRARIES ='; \
|
||||
echo 'EXTRA_DIST ='; \
|
||||
echo 'CLEANFILES ='; \
|
||||
echo 'MOSTLYCLEANFILES ='; \
|
||||
}; \
|
||||
'$(SED)' -n '/^.. DO NOT REMOVE THIS LINE -- /,$$p' \
|
||||
'$(ltdl_mk)' \
|
||||
|'$(SED)' -e 's|libltdl_||; s|libltdl/||; s|: libltdl/|: |' \
|
||||
-e '/^[ ]*-I\$$(srcdir)\/libltdl -Ilibltdl \\/d' \
|
||||
-e 's|\$$(libltdl_|$$(|' \
|
||||
) |'$(SED)' -e '/^.. DO NOT REMOVE THIS LINE -- /d' \
|
||||
-e '1s,^\(.. Makefile.\)inc.*,\1am -- Process this file with automake to produce Makefile.in,' > '$@'
|
||||
$(AM_V_at)chmod a-w '$@'
|
||||
|
||||
## Document the make macros that are needed to build bootstrap-deps
|
||||
## dependencies when called from 'bootstrap' (developer's machine),
|
||||
## where the Makefile.am is fed to make in its raw format before
|
||||
## 'configure' has found the correct values (on the build machine).
|
||||
bootstrap_files = \
|
||||
$(lt_Makefile_am) \
|
||||
$(ltmain_sh) \
|
||||
$(ltversion_m4)
|
||||
|
||||
.PHONY: bootstrap-deps bootstrap-deps-prep
|
||||
bootstrap-deps: bootstrap-deps-prep
|
||||
$(MAKE) $(bootstrap_files)
|
||||
|
||||
bootstrap-deps-prep:
|
||||
## The following variables are substituted by 'bootstrap-dep-preps'
|
||||
@exit_cmd=:; \
|
||||
test -z '$(srcdir)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with srcdir unset." \
|
||||
&& exit_cmd=exit; \
|
||||
test -z '$(PACKAGE)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with PACKAGE unset." \
|
||||
&& exit_cmd=exit; \
|
||||
test -z '$(PACKAGE_BUGREPORT)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with PACKAGE_BUGREPORT unset." \
|
||||
&& exit_cmd=exit; \
|
||||
test -z '$(PACKAGE_NAME)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with PACKAGE_NAME unset." \
|
||||
&& exit_cmd=exit; \
|
||||
test -z '$(PACKAGE_URL)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with PACKAGE_URL unset." \
|
||||
&& exit_cmd=exit; \
|
||||
test -z '$(SED)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with SED unset." \
|
||||
&& exit_cmd=exit; \
|
||||
test -z '$(VERSION)' \
|
||||
&& echo "ERROR: don't call $(MAKE) with VERSION unset." \
|
||||
&& exit_cmd=exit; \
|
||||
$$exit_cmd 1
|
||||
$(AM_V_at)rm -f $(bootstrap_files)
|
||||
|
||||
## Unfortunately, all this bogeyness means that we have to manually
|
||||
## keep the generated files in libltdl up to date.
|
||||
LTDL_BOOTSTRAP_DEPS = \
|
||||
$(stamp_mk) \
|
||||
$(lt_aclocal_m4) \
|
||||
$(lt_config_h_in) \
|
||||
$(lt_configure)
|
||||
|
||||
all-local: $(LTDL_BOOTSTRAP_DEPS)
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Libtool scripts. ##
|
||||
## ---------------- ##
|
||||
|
||||
abs_aux_dir = `$(lt__cd) '$(srcdir)/$(aux_dir)' && pwd`
|
||||
ltdl_ac_aux_dir = `$(SCRIPT_ENV) $(extract_trace) AC_CONFIG_AUX_DIR $(srcdir)/libltdl/configure.ac`
|
||||
|
||||
configure_edit = $(bootstrap_edit) \
|
||||
-e '/^\. /s|@auxscriptsdir\@|'$(abs_aux_dir)'|g' \
|
||||
-e 's|@aclocaldir\@|$(aclocaldir)|g' \
|
||||
-e 's|@aux_dir\@|$(aux_dir)|g' \
|
||||
-e 's|@datadir\@|$(datadir)|g' \
|
||||
-e 's|@EGREP\@|$(EGREP)|g' \
|
||||
-e 's|@FGREP\@|$(FGREP)|g' \
|
||||
-e 's|@GREP\@|$(GREP)|g' \
|
||||
-e 's|@host_triplet\@|$(host_triplet)|g' \
|
||||
-e 's|@LN_S\@|$(LN_S)|g' \
|
||||
-e "s|@ltdl_ac_aux_dir\@|$(ltdl_ac_aux_dir)|g" \
|
||||
-e 's|@macro_dir\@|$(macro_dir)|g' \
|
||||
-e 's|@pkgauxdir\@|$(pkgauxdir)|g' \
|
||||
-e 's|@pkgaux_files\@|$(pkgaux_scripts) $(pkgaux_data_files)|g' \
|
||||
-e 's|@pkgaux_install_files\@|$(pkgaux_install_files)|g' \
|
||||
-e 's|@pkgaux_parent_files\@|$(pkgaux_parent_files)|g' \
|
||||
-e 's|@pkgdatadir\@|$(pkgdatadir)|g' \
|
||||
-e 's|@pkgltdl_files\@|$(pkgltdl_files)|g' \
|
||||
-e 's|@pkgmacro_files\@|$(pkgmacro_files)|g' \
|
||||
-e 's|@prefix\@|$(prefix)|g' \
|
||||
-e 's|@SED\@|$(SED)|g' \
|
||||
-e 's|@srcdir\@|$(srcdir)|g'
|
||||
|
||||
# The libtool distributor and the standalone libtool script.
|
||||
bin_SCRIPTS = libtool
|
||||
|
||||
libtoolize: $(libtoolize_in) $(config_status)
|
||||
$(AM_V_at)rm -f '$@'
|
||||
$(AM_V_GEN)$(configure_edit) '$(libtoolize_in)' > '$@'
|
||||
$(AM_V_at)chmod a+x '$@'
|
||||
$(AM_V_at)chmod a-w '$@'
|
||||
|
||||
# We used to do this with a 'stamp-vcl' file, but non-gmake builds
|
||||
# would rerun configure on every invocation, so now we manually
|
||||
# check the version numbers from the build rule when necessary.
|
||||
libtool: $(ltmain_sh) $(config_status) $(dotversion)
|
||||
@$(rebuild); \
|
||||
if test -f '$@'; then \
|
||||
eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
|
||||
test "$$package_revision" = "$$revision" && rebuild=false; \
|
||||
fi; \
|
||||
for prereq in $?; do \
|
||||
case $$prereq in *.version);; *) rebuild=:;; esac; \
|
||||
done; \
|
||||
if $$rebuild; then \
|
||||
if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \
|
||||
then echo " GEN " $@; \
|
||||
else echo '$(SHELL) $(top_builddir)/config.status "$@"'; fi; \
|
||||
cd '$(top_builddir)' && '$(SHELL)' ./config.status '$@'; \
|
||||
fi
|
||||
|
||||
|
||||
## -------- ##
|
||||
## Libltdl. ##
|
||||
## -------- ##
|
||||
|
||||
include libltdl/ltdl.mk
|
||||
|
||||
lt_aclocal_m4 = $(srcdir)/$(ltdl_dir)/aclocal.m4
|
||||
lt_config_h_in = $(srcdir)/$(ltdl_dir)/config-h.in
|
||||
lt_configure = $(srcdir)/$(ltdl_dir)/configure
|
||||
lt_configure_ac = $(srcdir)/$(ltdl_dir)/configure.ac
|
||||
stamp_mk = $(srcdir)/$(ltdl_dir)/stamp-mk
|
||||
|
||||
lt_obsolete_m4 = $(srcdir)/$(macro_dir)/lt~obsolete.m4
|
||||
|
||||
EXTRA_DIST += $(lt_aclocal_m4) \
|
||||
$(lt_configure) \
|
||||
$(lt_configure_ac) \
|
||||
$(lt_config_h_in) \
|
||||
$(lt_Makefile_am) \
|
||||
$(lt_Makefile_in) \
|
||||
$(lt_obsolete_m4) \
|
||||
$(stamp_mk)
|
||||
|
||||
$(lt_Makefile_in): $(lt_Makefile_am) $(lt_aclocal_m4) $(lt_config_h_in)
|
||||
$(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(AUTOMAKE) Makefile
|
||||
|
||||
# Don't let unused scripts leak into the libltdl Makefile
|
||||
$(stamp_mk): $(lt_Makefile_in)
|
||||
$(AM_V_at)T='$(srcdir)/$(aux_dir)/Makefile.tmp'; \
|
||||
for p in $(srcdir)/$(aux_dir)/*; do \
|
||||
test -f "$$p" || continue; \
|
||||
f=`echo "$$p" | $(SED) 's|^$(srcdir)/$(aux_dir)/||'`; \
|
||||
case " $(pkgaux_scripts) ltmain.sh " in \
|
||||
*" $$f "*) ;; \
|
||||
*) '$(SED)' \
|
||||
-e 's|\(\$$([^)]*)/\)*'"$(ltdl_ac_aux_dir)/$$f"'\$$||' \
|
||||
-e 's|\(\$$([^)]*)/\)*'"$(ltdl_ac_aux_dir)/$$f"' ||' \
|
||||
-e '/^[ ]*\\$$/d' \
|
||||
'$(lt_Makefile_in)' > "$$T" \
|
||||
&& mv -f "$$T" '$(lt_Makefile_in)';; \
|
||||
esac; \
|
||||
done
|
||||
$(AM_V_GEN)echo stamp > '$@'
|
||||
|
||||
lt_aclocal_m4_deps = \
|
||||
$(lt_obsolete_m4) \
|
||||
$(ltversion_m4) \
|
||||
$(libtool_m4) \
|
||||
$(srcdir)/$(macro_dir)/ltargz.m4 \
|
||||
$(srcdir)/$(macro_dir)/ltdl.m4 \
|
||||
$(srcdir)/$(macro_dir)/ltoptions.m4 \
|
||||
$(srcdir)/$(macro_dir)/ltsugar.m4 \
|
||||
$(srcdir)/$(macro_dir)/m4.m4 \
|
||||
$(srcdir)/$(ltdl_dir)/configure.ac
|
||||
|
||||
lt_configure_deps = $(lt_aclocal_m4) $(lt_aclocal_m4_deps)
|
||||
|
||||
$(lt_aclocal_m4): $(lt_aclocal_m4_deps)
|
||||
$(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(ACLOCAL) -I ../m4
|
||||
|
||||
$(lt_configure): $(lt_configure_deps) $(lt_config_h_in)
|
||||
$(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(AUTOCONF)
|
||||
|
||||
$(lt_config_h_in): $(lt_configure_deps)
|
||||
$(AM_V_GEN)cd '$(srcdir)/$(ltdl_dir)' && $(AUTOHEADER)
|
||||
$(AM_V_at)touch '$@'
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Documentation. ##
|
||||
## -------------- ##
|
||||
|
||||
doc_dir = $(srcdir)/doc
|
||||
|
||||
libtool_1 = $(doc_dir)/libtool.1
|
||||
libtoolize_1 = $(doc_dir)/libtoolize.1
|
||||
notes_texi = $(doc_dir)/notes.texi
|
||||
notes_txt = $(doc_dir)/notes.txt
|
||||
|
||||
EXTRA_DIST += $(doc_dir)/gendocs_template
|
||||
|
||||
# A bug in automake 1.11.1 (at least) prevents us from using:
|
||||
#
|
||||
# info_TEXINFOS = $(doc_dir)/libtool.texi
|
||||
#
|
||||
# Producing the following error, even though srcdir is implicitly set:
|
||||
# "cannot open < ./$(srcdir)/doc/libtool.texi: No such file or directory"
|
||||
info_TEXINFOS = doc/libtool.texi
|
||||
doc_libtool_TEXINFOS = $(doc_dir)/PLATFORMS $(doc_dir)/fdl.texi \
|
||||
$(notes_texi)
|
||||
EXTRA_DIST += $(notes_txt)
|
||||
## Workaround for a texinfo bug described here:
|
||||
## http://thread.gmane.org/gmane.comp.tex.texinfo.bugs/3930
|
||||
DISTCLEANFILES += libtool.dvi
|
||||
|
||||
all-local: $(notes_txt)
|
||||
|
||||
$(notes_txt): $(notes_texi)
|
||||
$(AM_V_GEN)$(MAKEINFO) -P '$(srcdir)/doc' --no-headers \
|
||||
$(MAKEINFOFLAGS) -o '$@' '$(notes_texi)'
|
||||
|
||||
dist_man1_MANS = $(libtool_1) $(libtoolize_1)
|
||||
MAINTAINERCLEANFILES += $(dist_man1_MANS)
|
||||
update_mans = \
|
||||
PATH=".$(PATH_SEPARATOR)$$PATH"; export PATH; \
|
||||
$(HELP2MAN) --output='$@'
|
||||
|
||||
# It's wrong to make distributed files (e.g. $(libtool_1)) rely on
|
||||
# files created in the build tree, so instead we regenerate the
|
||||
# manual pages if the sources for the build-tree files we want to
|
||||
# run have changed.
|
||||
$(libtool_1): $(ltmain_sh)
|
||||
$(AM_V_GEN)$(update_mans) -n 'Provide generalized library-building support services' --help-option=--help-all libtool
|
||||
$(libtoolize_1): $(libtoolize_in)
|
||||
$(AM_V_GEN)$(update_mans) -n 'Prepare a package to use libtool' libtoolize
|
||||
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Installation. ##
|
||||
## ------------- ##
|
||||
|
||||
ltdldir = $(srcdir)/libltdl
|
||||
pkgauxdir = $(pkgdatadir)/build-aux
|
||||
|
||||
# The timestamps on these files must be preserved carefully so we install,
|
||||
# uninstall and set executable with custom rules here.
|
||||
pkgaux_parent_files = ltmain.sh
|
||||
pkgaux_install_files = config.guess config.sub install-sh
|
||||
pkgaux_data_files = $(pkgaux_parent_files)
|
||||
|
||||
# Everything that gets picked up by aclocal is automatically distributed,
|
||||
# this is the list of macro files we install on the user's system.
|
||||
pkgmacro_files = libtool.m4 ltargz.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 \
|
||||
ltversion.m4 lt~obsolete.m4
|
||||
|
||||
## These are installed as a subdirectory of pkgdatadir so that
|
||||
## libtoolize --ltdl can find them later. Note that this list requires
|
||||
## specific order to avoid unnecessary re-autotooling after libtoolize run.
|
||||
pkgltdl_files = COPYING.LIB \
|
||||
Makefile.am \
|
||||
README \
|
||||
configure.ac \
|
||||
aclocal.m4 \
|
||||
Makefile.in \
|
||||
config-h.in \
|
||||
configure \
|
||||
libltdl/lt__alloc.h \
|
||||
libltdl/lt__argz_.h \
|
||||
libltdl/lt__dirent.h \
|
||||
libltdl/lt__glibc.h \
|
||||
libltdl/lt__private.h \
|
||||
libltdl/lt__strl.h \
|
||||
libltdl/lt_dlloader.h \
|
||||
libltdl/lt_error.h \
|
||||
libltdl/lt_system.h \
|
||||
libltdl/slist.h \
|
||||
loaders/dld_link.c \
|
||||
loaders/dlopen.c \
|
||||
loaders/dyld.c \
|
||||
loaders/load_add_on.c \
|
||||
loaders/loadlibrary.c \
|
||||
loaders/preopen.c \
|
||||
loaders/shl_load.c \
|
||||
lt__alloc.c \
|
||||
lt__argz.c \
|
||||
lt__dirent.c \
|
||||
lt__strl.c \
|
||||
lt_dlloader.c \
|
||||
lt_error.c \
|
||||
ltdl.c \
|
||||
ltdl.h \
|
||||
ltdl.mk \
|
||||
slist.c
|
||||
|
||||
install-data-local: $(lt_Makefile_in) install-scripts-local
|
||||
@$(NORMAL_INSTALL)
|
||||
## Don't install over the top of an old pkgdatadir
|
||||
-rm -rf '$(DESTDIR)$(pkgdatadir)'/*
|
||||
## First, put a copy of the libtool m4 macros in the aclocal dir
|
||||
@list='$(pkgmacro_files)'; for p in $$list; do \
|
||||
d=`echo "$(DESTDIR)$(aclocaldir)/$$p" |$(SED) 's|[^/]*$$||'`; \
|
||||
test -d "$$d" || $(mkinstalldirs) "$$d"; \
|
||||
echo " $(INSTALL_DATA) '$(srcdir)/$(macro_dir)/$$p' '$(DESTDIR)$(aclocaldir)/$$p'"; \
|
||||
$(INSTALL_DATA) "$(srcdir)/$(macro_dir)/$$p" "$(DESTDIR)$(aclocaldir)/$$p"; \
|
||||
done
|
||||
## install the helper scripts
|
||||
@list='$(pkgaux_scripts)' && \
|
||||
for p in $$list; do \
|
||||
d=`echo "$(DESTDIR)$(pkgauxdir)/$$p" |$(SED) 's|[^/]*$$||'`; \
|
||||
test -d "$$d" || $(mkinstalldirs) "$$d"; \
|
||||
echo " $(INSTALL_SCRIPT) '$(srcdir)/$(aux_dir)/$$p' '$(DESTDIR)$(pkgauxdir)/$$p'"; \
|
||||
$(INSTALL_SCRIPT) "$(srcdir)/$(aux_dir)/$$p" "$(DESTDIR)$(pkgauxdir)/$$p"; \
|
||||
done
|
||||
@list='$(pkgaux_data_files)' && for p in $$list; do \
|
||||
d=`echo "$(DESTDIR)$(pkgauxdir)/$$p" |$(SED) 's|[^/]*$$||'`; \
|
||||
test -d "$$d" || $(mkinstalldirs) "$$d"; \
|
||||
echo " $(INSTALL_DATA) '$(srcdir)/$(aux_dir)/$$p' '$(DESTDIR)$(pkgauxdir)/$$p'"; \
|
||||
$(INSTALL_DATA) "$(srcdir)/$(aux_dir)/$$p" "$(DESTDIR)$(pkgauxdir)/$$p"; \
|
||||
done
|
||||
## install the libltdl files
|
||||
@list='$(pkgltdl_files)' && for p in $$list; do \
|
||||
d=`echo "$(DESTDIR)$(pkgdatadir)/$$p" |$(SED) 's|[^/]*$$||'`; \
|
||||
test -d "$$d" || $(mkinstalldirs) "$$d"; \
|
||||
echo " $(INSTALL_DATA) '$(ltdldir)/$$p' '$(DESTDIR)$(pkgdatadir)/$$p'"; \
|
||||
$(INSTALL_DATA) "$(ltdldir)/$$p" "$(DESTDIR)$(pkgdatadir)/$$p"; \
|
||||
done
|
||||
chmod a+x '$(DESTDIR)$(pkgdatadir)/configure'
|
||||
|
||||
.PHONY: install-scripts-local
|
||||
install-scripts-local: $(lt_Makefile_in)
|
||||
## Inline helper-scripts for installed libtoolize script
|
||||
@p=`echo libtoolize |sed -e '$(transform)'`; \
|
||||
echo " $(SCRIPT_ENV) '$(inline_source)' libtoolize > '$(DESTDIR)$(bindir)/$$p'"; \
|
||||
d=`echo "$(DESTDIR)$(bindir)/$$p" |$(SED) 's|[^/]*$$||'`; \
|
||||
test -d "$$d" || $(mkinstalldirs) "$$d"; \
|
||||
$(SCRIPT_ENV) '$(inline_source)' libtoolize > "$(DESTDIR)$(bindir)/$$p"; \
|
||||
chmod a+x "$(DESTDIR)$(bindir)/$$p"
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Distribution. ##
|
||||
## ------------- ##
|
||||
|
||||
edit_readme_alpha = $(srcdir)/$(aux_dir)/edit-readme-alpha
|
||||
gitlog_to_changelog = $(srcdir)/$(aux_dir)/gitlog-to-changelog
|
||||
git_log_fix = $(srcdir)/$(aux_dir)/git-log-fix
|
||||
thanks_gen = $(srcdir)/$(aux_dir)/thanks-gen
|
||||
|
||||
dotserial = $(distdir)/.serial
|
||||
dotversion = $(top_srcdir)/.version
|
||||
tarball_version = $(distdir)/.tarball-version
|
||||
readme = $(distdir)/README
|
||||
changelog = $(distdir)/ChangeLog
|
||||
changelog_old = $(srcdir)/ChangeLog.old
|
||||
thanks = $(distdir)/THANKS
|
||||
no_thanks = $(srcdir)/NO-THANKS
|
||||
|
||||
# Generate ChangeLog using git log entries for as far back as
|
||||
# they are in good shape, appending manual records from earlier.
|
||||
changelog_start_date = 2011-01-01
|
||||
$(changelog): FORCE
|
||||
$(AM_V_GEN)if test -d '$(srcdir)/.git'; then \
|
||||
TZ=UTC $(gitlog_to_changelog) --amend=$(git_log_fix) \
|
||||
--ignore-matching=Omit-from-ChangeLog. \
|
||||
--format='%s%n%n%b%n' \
|
||||
--since=$(changelog_start_date) > '$@T'; \
|
||||
rm -f '$@'; mv '$@T' '$@'; \
|
||||
cat '$(changelog_old)' >> '$@'; \
|
||||
fi
|
||||
|
||||
# Sort in traditional ASCII order, regardless of the current locale;
|
||||
# otherwise we may get into trouble with distinct strings that the
|
||||
# current locale considers to be equal.
|
||||
ASSORT = LC_ALL=C sort
|
||||
|
||||
# Extract all lines up to the first one starting with "##".
|
||||
prologue = perl -ne '/^\#\#/ and exit; print' $(no_thanks)
|
||||
|
||||
# Generate THANKS using git log entries as far as possible, fixing
|
||||
# up omissions and errors from NO-THANKS configuration.
|
||||
$(thanks): FORCE
|
||||
$(AM_V_GEN)if test -d '$(srcdir)/.git'; then \
|
||||
{ \
|
||||
$(prologue); echo; \
|
||||
{ perl -ne '/^$$/.../^$$/ and print' $(no_thanks) \
|
||||
| grep -v '^$$' | perl -pe 's/ +/\0/'; \
|
||||
{ sed -e '1,/\#\# /d' -e '/^\#\# /d' \
|
||||
-e 's|[ ][ ]*| |' < $(no_thanks) \
|
||||
| tr '\t' '\0'; \
|
||||
git log --pretty=format:'%aN%x00%aE'; \
|
||||
} | $(ASSORT) -u; \
|
||||
} | $(thanks_gen) \
|
||||
| LC_ALL=en_US.UTF-8 sort -f; \
|
||||
echo; \
|
||||
printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \
|
||||
} > '$@'; \
|
||||
fi
|
||||
|
||||
## Arrange so that .version appears only in the distribution
|
||||
## tarball, and never in a checked-out repository.
|
||||
EXTRA_DIST += $(dotversion)
|
||||
BUILT_SOURCES += $(dotversion)
|
||||
$(dotversion):
|
||||
$(AM_V_GEN)echo '$(VERSION)' > '$@T' && mv '$@T' '$@'
|
||||
|
||||
## Edit the README file for alpha releases.
|
||||
EXTRA_DIST += $(edit_readme_alpha)
|
||||
re_alpha_version = '\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[-\.][-\.0-9a-z]*\)'
|
||||
$(readme): FORCE
|
||||
@if test -n "`expr $(VERSION) : $(re_alpha_version)`"; then \
|
||||
if test 0 = '$(AM_DEFAULT_VERBOSITY)' && test 1 != '$(V)'; \
|
||||
then echo " GEN " $@; \
|
||||
else echo "$(SHELL) $(edit_readme_alpha) $@"; fi; \
|
||||
$(SHELL) $(edit_readme_alpha) '$@'; \
|
||||
fi
|
||||
|
||||
git_commit_count = git log --pretty=oneline |wc -l |$(SED) 's|[ ]||g'
|
||||
|
||||
dist-hook: $(changelog) $(thanks) $(dotversion) $(readme)
|
||||
## Arrange so that .tarball-version appears only in the distribution
|
||||
## tarball, and never in a checked-out repository.
|
||||
echo '$(VERSION)' > $(tarball_version)
|
||||
## ...and similarly for .serial.
|
||||
$(git_commit_count) > $(dotserial)
|
||||
## Ensure aclocal has not wrongly picked up old macro definitions.
|
||||
$(no_bogus_macros)
|
||||
|
||||
distcheck-hook: syntax-check
|
||||
|
||||
uninstall-hook:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgltdl_files)'; \
|
||||
for f in $$list; do \
|
||||
echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
|
||||
done
|
||||
@list='$(pkgaux_scripts) $(pkgaux_data_files)'; \
|
||||
for f in $$list; do \
|
||||
echo " rm -f '$(DESTDIR)$(pkgauxdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgauxdir)/$$f"; \
|
||||
done
|
||||
@for p in $(pkgmacro_files); do \
|
||||
f=`echo "$$p" |$(SED) 's|^.*/||'`; \
|
||||
echo " rm -f '$(DESTDIR)$(aclocaldir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(aclocaldir)/$$f"; \
|
||||
done
|
||||
@p=`echo libtoolize |sed -e '$(transform)'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$p'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$p"
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Test suite. ##
|
||||
## ----------- ##
|
||||
|
||||
tests_dir = $(top_srcdir)/tests
|
||||
package_m4 = $(tests_dir)/package.m4
|
||||
testsuite = $(tests_dir)/testsuite
|
||||
|
||||
# The testsuite files are evaluated in the order given here. When
|
||||
# adding new tests, make sure cmdline_wrap.at stays at the end so
|
||||
# that it can check for previous failures and skip if necessary.
|
||||
TESTSUITE = tests/testsuite
|
||||
TESTSUITE_AT = tests/testsuite.at \
|
||||
tests/configure-funcs.at \
|
||||
tests/libtoolize.at \
|
||||
tests/libtool.at \
|
||||
tests/demo.at \
|
||||
tests/pic_flag.at \
|
||||
tests/with-pic.at \
|
||||
tests/cdemo.at \
|
||||
tests/convenience.at \
|
||||
tests/depdemo.at \
|
||||
tests/help.at \
|
||||
tests/duplicate_members.at \
|
||||
tests/duplicate_conv.at \
|
||||
tests/duplicate_deps.at \
|
||||
tests/flags.at \
|
||||
tests/inherited_flags.at \
|
||||
tests/link-order.at \
|
||||
tests/link-order2.at \
|
||||
tests/fail.at \
|
||||
tests/shlibpath.at \
|
||||
tests/runpath-in-lalib.at \
|
||||
tests/static.at \
|
||||
tests/export.at \
|
||||
tests/export-def.at \
|
||||
tests/search-path.at \
|
||||
tests/indirect_deps.at \
|
||||
tests/archive-in-archive.at \
|
||||
tests/exeext.at \
|
||||
tests/execute-mode.at \
|
||||
tests/bindir.at \
|
||||
tests/cwrapper.at \
|
||||
tests/deplib-in-subdir.at \
|
||||
tests/infer-tag.at \
|
||||
tests/localization.at \
|
||||
tests/nocase.at \
|
||||
tests/install.at \
|
||||
tests/versioning.at \
|
||||
tests/destdir.at \
|
||||
tests/old-m4-iface.at \
|
||||
tests/am-subdir.at \
|
||||
tests/lt_dlexit.at \
|
||||
tests/lt_dladvise.at \
|
||||
tests/lt_dlopen.at \
|
||||
tests/lt_dlopen_a.at \
|
||||
tests/lt_dlopenext.at \
|
||||
tests/ltdl-libdir.at \
|
||||
tests/ltdl-api.at \
|
||||
tests/dlloader-api.at \
|
||||
tests/loadlibrary.at \
|
||||
tests/lalib-syntax.at \
|
||||
tests/resident.at \
|
||||
tests/slist.at \
|
||||
tests/need_lib_prefix.at \
|
||||
tests/mdemo.at \
|
||||
tests/standalone.at \
|
||||
tests/subproject.at \
|
||||
tests/nonrecursive.at \
|
||||
tests/recursive.at \
|
||||
tests/tagdemo.at \
|
||||
tests/template.at \
|
||||
tests/ctor.at \
|
||||
tests/exceptions.at \
|
||||
tests/early-libtool.at \
|
||||
tests/no-executables.at \
|
||||
tests/deplibs-ident.at \
|
||||
tests/configure-iface.at \
|
||||
tests/f77demo.at \
|
||||
tests/fcdemo.at \
|
||||
tests/darwin.at \
|
||||
tests/dumpbin-symbols.at \
|
||||
tests/deplibs-mingw.at \
|
||||
tests/sysroot.at \
|
||||
tests/stresstest.at \
|
||||
tests/cmdline_wrap.at \
|
||||
tests/bug_62343.at \
|
||||
tests/bug_71489.at \
|
||||
tests/bug_42313.at \
|
||||
$(NOTHING_ELSE)
|
||||
|
||||
EXTRA_DIST += $(testsuite) $(TESTSUITE_AT) $(package_m4)
|
||||
|
||||
# Be sure to reexport important environment variables:
|
||||
TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
|
||||
CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
|
||||
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
|
||||
AR="$(AR)" \
|
||||
EGREP="$(EGREP)" FGREP="$(FGREP)" GREP="$(GREP)" SED="$(SED)" \
|
||||
STRIP="$(STRIP)" lt_INSTALL="$(INSTALL)" \
|
||||
MANIFEST_TOOL="$(MANIFEST_TOOL)" \
|
||||
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
|
||||
SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
|
||||
CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
|
||||
F77="$(F77)" FFLAGS="$(FFLAGS)" \
|
||||
FC="$(FC)" FCFLAGS="$(FCFLAGS)" \
|
||||
GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)" \
|
||||
lt_cv_with_aix_soname="$(with_aix_soname)" \
|
||||
lt_cv_to_host_file_cmd="$(to_host_file_cmd)" \
|
||||
lt_cv_to_tool_file_cmd="$(to_tool_file_cmd)"
|
||||
|
||||
BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
|
||||
LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
|
||||
LIBTOOL="$(abs_top_builddir)/libtool" \
|
||||
tst_aclocaldir="$(abs_top_srcdir)/m4"
|
||||
|
||||
INSTALLCHECK_ENVIRONMENT = \
|
||||
LIBTOOLIZE="$(bindir)/`echo libtoolize |$(SED) '$(program_transform_name)'`" \
|
||||
LIBTOOL="$(bindir)/`echo libtool |$(SED) '$(program_transform_name)'`" \
|
||||
LTDLINCL="-I$(includedir)" \
|
||||
LIBLTDL="$(libdir)/libltdl.la" \
|
||||
tst_aclocaldir="$(aclocaldir)"
|
||||
|
||||
$(testsuite): $(package_m4) $(TESTSUITE_AT) Makefile.am
|
||||
$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -I '$(srcdir)/tests' $(TESTSUITE_AT) -o '$@'
|
||||
|
||||
$(package_m4): $(dotversion) Makefile.am
|
||||
$(AM_V_GEN){ \
|
||||
echo '# Signature of the current package.'; \
|
||||
echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
|
||||
echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \
|
||||
echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
|
||||
echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
|
||||
echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
|
||||
echo 'm4_define([AT_PACKAGE_URL], [$(PACKAGE_URL)])'; \
|
||||
} > '$@'
|
||||
|
||||
tests/atconfig: $(config_status)
|
||||
$(AM_V_GEN)$(SHELL) '$(config_status)' '$@'
|
||||
|
||||
DISTCLEANFILES += tests/atconfig
|
||||
|
||||
CD_TESTDIR = abs_srcdir=`$(lt__cd) $(srcdir) && pwd`; cd tests
|
||||
|
||||
testsuite_deps = tests/atconfig $(srcdir)/$(TESTSUITE)
|
||||
testsuite_deps_uninstalled = $(testsuite_deps) libltdl/libltdlc.la \
|
||||
$(bin_SCRIPTS) $(LTDL_BOOTSTRAP_DEPS)
|
||||
|
||||
# Hook the test suite into the check rule
|
||||
check-local: $(testsuite_deps_uninstalled)
|
||||
$(AM_V_at)$(CD_TESTDIR); \
|
||||
CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
|
||||
$(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) $(TESTSUITEFLAGS)
|
||||
|
||||
# Run the test suite on the *installed* tree.
|
||||
installcheck-local: $(testsuite_deps)
|
||||
$(AM_V_at)$(CD_TESTDIR); \
|
||||
CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
|
||||
$(TESTS_ENVIRONMENT) $(INSTALLCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) \
|
||||
AUTOTEST_PATH='$(exec_prefix)/bin'
|
||||
|
||||
.PHONY: check-noninteractive-old
|
||||
check-noninteractive-old:
|
||||
$(AM_V_at)'$(MAKE)' $(AM_MAKEFLAGS) check-TESTS TESTS='$(TESTS)'
|
||||
|
||||
# Run only noninteractive parts of the new testsuite.
|
||||
.PHONY: check-noninteractive-new
|
||||
check-noninteractive-new: $(testsuite_deps_uninstalled)
|
||||
$(AM_V_at)$(CD_TESTDIR); \
|
||||
CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
|
||||
$(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \
|
||||
-k '!interactive' INNER_TESTSUITEFLAGS=',!interactive' \
|
||||
$(TESTSUITEFLAGS)
|
||||
|
||||
# Run only interactive parts of the new testsuite.
|
||||
.PHONY: check-interactive
|
||||
check-interactive: $(testsuite_deps_uninstalled)
|
||||
$(AM_V_at)$(CD_TESTDIR); \
|
||||
CONFIG_SHELL='$(SHELL)' '$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" \
|
||||
$(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) \
|
||||
-k interactive -k recursive INNER_TESTSUITEFLAGS=',interactive' \
|
||||
$(TESTSUITEFLAGS)
|
||||
|
||||
.PHONY: check-noninteractive
|
||||
check-noninteractive: check-noninteractive-old check-noninteractive-new
|
||||
|
||||
# We need to remove any file droppings left behind by testsuite
|
||||
clean-local:
|
||||
-$(CD_TESTDIR); \
|
||||
test -f "$$abs_srcdir/$(TESTSUITE)" && \
|
||||
'$(SHELL)' "$$abs_srcdir/$(TESTSUITE)" --clean
|
||||
|
||||
## An empty target to depend on when a rule needs to always run
|
||||
## whenever it is visited.
|
||||
FORCE:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,162 @@
|
||||
These people have contributed to GNU Libtool. Some have reported problems,
|
||||
others have contributed improvements to the documentation and actual code.
|
||||
The particular contributions are described in the version control logs and
|
||||
ChangeLog files. If your name has been left out, if you'd rather not be
|
||||
listed, or if you'd prefer a different address be used, please send a
|
||||
note to the bug-report mailing list (as seen at end of e.g., libtool --help).
|
||||
##
|
||||
## There is no need to list here any name that appears as an Author in
|
||||
## "git log" output. Those are automatically added when this template
|
||||
## is used to generate the THANKS file. You will still need to add
|
||||
## contributors who are not a git log Author - e.g. bug reporters.
|
||||
##
|
||||
## Folks already promoted to AUTHORS:
|
||||
##
|
||||
!Alexandre Oliva
|
||||
!Bob Friesenhahn
|
||||
!Charles Wilson
|
||||
!Gary V. Vaughan
|
||||
!Gordon Matzigkeit
|
||||
!Ossama Othman
|
||||
!Peter O'Gorman
|
||||
!Ralf Wildenhues
|
||||
!Robert Boehne
|
||||
!Scott James Remnant
|
||||
!Thomas Tanner
|
||||
##
|
||||
## Remove duplicates under alternate names, and add preferred email
|
||||
## addresses from contributors that don't match git log output here:
|
||||
##
|
||||
Akim Demaille akim@epita.fr
|
||||
!Albert Chin
|
||||
Albert Chin-A-Young china@thewrittenword.com
|
||||
Alexander Hass alexander.hass@sap.com
|
||||
Andreas Schwab schwab@suse.de
|
||||
Brian Barrett brbarret@osl.iu.edu
|
||||
!Brian W. Barret
|
||||
Bruno Haible haible@ilog.fr
|
||||
Dalibor Topic robilad@kaffe.org
|
||||
David Edelsohn edelsohn@gnu.org
|
||||
DJ Delorie dj@delorie.com
|
||||
Ed Maste emaste@freebsd.org
|
||||
Erez Zadok ezk@cs.columbia.edu
|
||||
Eric Blake ebb9@byu.net
|
||||
H.J. Lu hjl@gnu.org
|
||||
Ian Lance Taylor iant@google.com
|
||||
Jeff Squyres jsquyres@cisco.com
|
||||
John David Anglin dave.anglin@nrc.ca
|
||||
Juergen Reuter reuter@theoc01.desy.de
|
||||
Karl Berry karl@gnu.org
|
||||
Maciej W. Rozycki macro@linux-mips.org
|
||||
Manfred Weichel weichel@global.nacamar.de
|
||||
Michael Pratt mcpratt@pm.me
|
||||
Mike Gorchak mike@malva.ua
|
||||
Mo DeJong mdejong@redhat.com
|
||||
Nick Hudson skrll@netbsd.org
|
||||
Olly Betts olly@muscat.co.uk
|
||||
Paul Eggert eggert@cs.ucla.edu
|
||||
Pavel Roskin proskin@gnu.org
|
||||
Peter Ekberg peda@lysator.liu.se
|
||||
Rainer Orth ro@TechFak.Uni-Bielefeld.de
|
||||
Robert Millan robertmh@gnu.org
|
||||
Samuel Thibault samuel.thibault@gnu.org
|
||||
Simon Josefsson jas@extundo.com
|
||||
Steve Ellcey sellcey@mips.com
|
||||
Todd Vierling tv@netbsd.org
|
||||
Vincent Torri vtorri@univ-evry.fr
|
||||
##
|
||||
## Add bug reporters, patch Authors you forgot to attribute at commit
|
||||
## time with 'git commit --author=...' and other non-patch contributors
|
||||
## below:
|
||||
##
|
||||
Alex lx_op@orcon.net.nz
|
||||
Allan McRae allan@archlinux.org
|
||||
Andreas Schiffler aschiffler@ferzkopp.net
|
||||
Andreas Stieger Andreas.Stieger@gmx.de
|
||||
Anton Shterenlikht shterenlikht@par-tec.com
|
||||
Brent Leback brent.leback@st.com
|
||||
Camilo La Rota camilo.larota@ens-lyon.fr
|
||||
Carl D. Roth roth@cse.ucsc.edu
|
||||
Carlo Cabrera carlo.antonio.cabrera@gmail.com
|
||||
Chris P. Ross cross@eng.us.uu.net
|
||||
Christian Rössel christian.roessel@gmx.de
|
||||
Christopher Hulbert cchgroupmail@gmail.com
|
||||
Craig Tierney Craig.Tierney@noaa.gov
|
||||
Dan McMahill mcmahill@mtl.mit.edu
|
||||
Daniel Richard G. skunk@iSKUNK.ORG
|
||||
Dave Allured dave.allured@noaa.gov
|
||||
Dave Yost Dave@Yost.com
|
||||
Dimitri Papadopoulos dpo@sfr.fr
|
||||
Donn Washburn n5xwb@comcast.net
|
||||
Erik van Pienbroek erik-gnu@vanpienbroek.nl
|
||||
Ethan Mallove ethan.mallove@sun.com
|
||||
Fred Cox sailorfred@yahoo.com
|
||||
Frediano Ziglio freddy77@gmail.com
|
||||
FX Coudert fxcoudert@gcc.gnu.org
|
||||
Hiroyuki Sato hiroysato@gmail.com
|
||||
Jakub Bogusz qboosh@pld-linux.org
|
||||
James Su james.su@gmail.com
|
||||
Jay Krell jay.krell@cornell.edu
|
||||
Jeremy C. Reed reed@reedmedia.net
|
||||
Jim Meyering jim@meyering.net
|
||||
Joakim Tjernlund joakim.tjernlund@transmode.se
|
||||
Joel N. Weber II devnull@gnu.org
|
||||
Joerg Sonnenberger joerg@netbsd.org
|
||||
John R. Cary cary@txcorp.com
|
||||
John Wolfe jlw@sco.com
|
||||
Joseph Beckenbach III jrb3@best.com
|
||||
Kenneth Albanowski kjahds@kjahds.com
|
||||
Khem Raj raj.khem@gmail.com
|
||||
Kirill Makurin maiddaisuki@outlook.com
|
||||
Kurt D. Zeilenga Kurt@OpenLDAP.Org
|
||||
Lawrence Velázquez larryv@macports.org
|
||||
Lionel Landwerlin llandwerlin@gmail.com
|
||||
Maciej Helminiak dion2@wp.pl
|
||||
Mahesh Narayanamurthi mahesh.mach@gmail.com
|
||||
Marc Glisse marc.glisse@inria.fr
|
||||
Marcel Loose loose@astron.nl
|
||||
Markus Duft markus.duft@salomon.at
|
||||
Martin Doucha doucha@integri.cz
|
||||
Matthijs Kooijman matthijs@stdin.nl
|
||||
Micheal E. Faenza mfaenza@mitre.org
|
||||
Mike Miller mtmiller@ieee.org
|
||||
Misty De Meo misty@brew.sh
|
||||
Nick Bowler nbowler@draconx.ca
|
||||
Nix nix@esperi.org.uk
|
||||
Olaf Lenz olenz@fias.uni-frankfurt.de
|
||||
Ozkan Sezer sezeroz@gmail.com
|
||||
Patrice Fromy patrice.fromy@u-psud.fr
|
||||
Paul Biggar paul.biggar@gmail.com
|
||||
Paul Laight plaight@quantxautomation.co.uk
|
||||
Paul Seidler sepek@lavabit.com
|
||||
Pavel Raiskup praiskup@redhat.com
|
||||
Paweł Daniluk pawel@bioexploratorium.pl
|
||||
Peter Fritzsche peter.fritzsche@gmx.de
|
||||
Peter Jeremy peterjeremy@optushome.com.au
|
||||
Peter Johansson trojkan@gmail.com
|
||||
Peter Kjellerstedt peter.kjellerstedt@axis.com
|
||||
Pádraig Brady P@draigBrady.com
|
||||
Richard B. Kreckel kreckel@ginac.de
|
||||
Richard Purdie rpurdie@rpsys.net
|
||||
Richard W.M. Jones rjones@redhat.com
|
||||
Rico Tzschichholz ricotz@ubuntu.com
|
||||
Robert Garron Robert.Garron@Access3000.net
|
||||
Robert Ögren lists@roboros.com
|
||||
Robert Yang liezhi.yang@windriver.com
|
||||
Roberto Bagnara bagnara@cs.unipr.it
|
||||
Roland Mainz roland.mainz@nrubsig.org
|
||||
Rudolf Leitgeb r.leitgeb@x-pin.com
|
||||
Ryan Hill dirtyepic@gentoo.org
|
||||
Sebastian Wilhelmi wilhelmi@ira.uka.de
|
||||
Simon Sobisch
|
||||
Sven Verdoolaege skimo@liacs.nl
|
||||
Terry D. Dontje Terry.Dontje@Sun.COM
|
||||
Tobias Stoeckmann tobias@stoeckmann.org
|
||||
Tom Tromey tromey@cygnus.com
|
||||
Ulrich Drepper drepper@ipd.info.uni-karlsruhe.de
|
||||
Václav Zeman vhaisman@gmail.com
|
||||
Warren Dodge warren.l.dodge@Tektronix.com
|
||||
Xavier Pianet xavier@xingo.com
|
||||
Xin Li d@delphij.net
|
||||
Юрий Андреевич Пухальский pooh@cryptopro.ru
|
||||
Дилян Палаузов dilyan.palauzov@aegee.org
|
||||
@@ -0,0 +1,6 @@
|
||||
In order to port libtool to a new platform, start by reading the node
|
||||
'New ports' in the info document (i.e., the libtool manual).
|
||||
|
||||
If you find that any porting documentation is missing, please
|
||||
complain! :-) Complaints with patches and improvements to the
|
||||
documentation, or to libtool itself, are more than welcome. :-) :-)
|
||||
@@ -0,0 +1,265 @@
|
||||
# GNU Libtool
|
||||
|
||||
1. Introduction
|
||||
===============
|
||||
|
||||
[GNU Libtool][libtool] is a generic library support script.
|
||||
[Libtool][] hides the complexity of using shared libraries behind a
|
||||
consistent, portable interface.
|
||||
|
||||
Libtool's home page is:
|
||||
|
||||
https://www.gnu.org/software/libtool/libtool.html
|
||||
|
||||
See the file [NEWS][] for a description of recent changes to Libtool.
|
||||
|
||||
Please note that you can build GNU Libtool from this directory using a
|
||||
vendor Make program as long as this is an official release tarball;
|
||||
otherwise you will need GNU Make for sane VPATH support. See the file
|
||||
[INSTALL][] for complete generic instructions on how to build and install
|
||||
Libtool. Also, see the file [doc/notes.txt][notes] for some platform-
|
||||
specific information.
|
||||
|
||||
See the info node (libtool)Tested Platforms. (or the file
|
||||
[doc/PLATFORMS][platforms]) for a list of platforms that Libtool already
|
||||
supports.
|
||||
|
||||
Please try it on all the platforms you have access to:
|
||||
|
||||
* If it builds and passes the test suite (`gmake check`), please send
|
||||
a short note to the [libtool mailing list][libtool list] with a
|
||||
subject line including the string `[PLATFORM]`, and containing the
|
||||
details from the end of `./libtool --help` in the body.
|
||||
* Otherwise, see _Reporting Bugs_ below for how to help us fix any
|
||||
problems you discover.
|
||||
|
||||
To use Libtool, add the new generic library building commands to your
|
||||
`Makefile`, `Makefile.in`, or `Makefile.am`. See the documentation for
|
||||
details.
|
||||
|
||||
[install]: https://git.savannah.gnu.org/cgit/automake.git/tree/INSTALL
|
||||
[libtool]: https://www.gnu.org/s/libtool
|
||||
[libtool list]: mailto:libtool@gnu.org
|
||||
[news]: https://git.savannah.gnu.org/cgit/libtool.git/tree/NEWS
|
||||
[notes]: https://git.savannah.gnu.org/cgit/libtool.git/tree/doc/notes.texi
|
||||
[platforms]: https://git.savannah.gnu.org/cgit/libtool.git/tree/doc/PLATFORMS
|
||||
|
||||
|
||||
2. Reporting Bugs
|
||||
=================
|
||||
|
||||
If this distribution doesn't work for you, before you report the
|
||||
problem, at least try upgrading to the latest released version first,
|
||||
and see whether the issue persists. If you feel able, you can also
|
||||
check whether the issue has been fixed in the development sources for
|
||||
the next release (see _Obtaining the Latest Sources_ below).
|
||||
|
||||
Once you've determined that your bug is still not fixed in the latest
|
||||
version, please send a full report to the libtool [bug mailing list][],
|
||||
including:
|
||||
|
||||
1. the information from the end of the help message given by
|
||||
`./libtool --help`, and the verbose output of any failed tests
|
||||
(see _The Test Suites_ immediately below);
|
||||
2. complete instructions for how to reproduce your bug, along with
|
||||
the results you were expecting, and how they differ from what you
|
||||
actually see;
|
||||
3. a workaround or full fix for the bug, if you have it;
|
||||
4. a copy of `tests/testsuite.log` if you are experiencing failures
|
||||
in the Autotest testsuite.
|
||||
5. new test cases for the testsuite that demonstrate the bug are
|
||||
especially welcome, and will help to ensure that future releases
|
||||
don't reintroduce the problem - if you're not able to write a
|
||||
complete testsuite case, a simple standalone shell script is
|
||||
usually good enough to help us write a test for you.
|
||||
|
||||
If you have any other suggestions, or if you wish to port Libtool to a
|
||||
new platform, please send email to the [mailing list][libtool list].
|
||||
|
||||
Please note that if you send us an non-trivial code for inclusion in a
|
||||
future release, we may ask you for a copyright assignment (for brief
|
||||
details see the 'Copyright Assignment' section on our
|
||||
[Contributing][contribute] webpage.
|
||||
|
||||
[bug mailing list]: mailto:bug-libtool@gnu.org
|
||||
[contribute]: https://www.gnu.org/software/libtool/contribute.html
|
||||
|
||||
|
||||
3. The Test Suite
|
||||
=================
|
||||
|
||||
Libtool comes an integrated sets of tests to check that your build
|
||||
is sane. You can run like this, assuming that `gmake` refers to GNU
|
||||
make:
|
||||
|
||||
gmake check
|
||||
|
||||
The new, Autotest-driven testsuite is documented in:
|
||||
|
||||
info Autoconf 'testsuite Invocation'
|
||||
|
||||
but simple help may also be obtained through:
|
||||
|
||||
gmake check TESTSUITEFLAGS='--help'
|
||||
|
||||
For verbose output, add the flag '-v', for running only a subset of the
|
||||
independent tests, merely specify them by number or by keyword, both of
|
||||
which are displayed with the '--list' flag. For example, the 'libtool'
|
||||
keyword is used for the tests that exercise only this script. So it is
|
||||
possible to test an installed script, possibly from a different Libtool
|
||||
release, with:
|
||||
|
||||
gmake check \
|
||||
TESTSUITEFLAGS="-k libtool LIBTOOL=/path/to/libtool"
|
||||
|
||||
Some tests, like the one exercising `max_cmd_len` limits, make use of
|
||||
this to invoke the testsuite recursively on a subset of tests. For these
|
||||
tests, the variable `INNER_TESTSUITEFLAGS` may be used. It will be
|
||||
expanded right after the `-k libtool`, without separating whitespace, so
|
||||
that further limiting of the recursive set of tests is possible. For
|
||||
example, to run only the template tests within the `max_cmd_len`, use:
|
||||
|
||||
gmake check TESTSUITEFLAGS="-v -x -k max_cmd_len \
|
||||
INNER_TESTSUITEFLAGS=',template -v -x'"
|
||||
|
||||
If you wish to report test failures to the libtool list, you need to
|
||||
send the file `tests/testsuite.log` to the [bug mailing list][].
|
||||
|
||||
|
||||
4. Obtaining the Latest Sources
|
||||
===============================
|
||||
|
||||
* With the exception of ancient releases, all official GNU Libtool
|
||||
releases have a detached GPG signature file. With this you can verify
|
||||
that the corresponding file (i.e. without the `.sig` suffix) is the
|
||||
same file that was released by the owner of it's GPG key ID. First,
|
||||
be sure to download both the .sig file and the corresponding release,
|
||||
then run a command like this:
|
||||
|
||||
gpg --verify libtool-x.y.z.tar.gz.sig
|
||||
|
||||
If that command fails because you don't have the required public key,
|
||||
then run this command to import it:
|
||||
|
||||
gpg --keyserver keys.gnupg.net --recv-keys 2983D606
|
||||
|
||||
and then rerun the `gpg --verify` command.
|
||||
|
||||
* Official stable releases of GNU Libtool, along with these detached
|
||||
signature files are available from:
|
||||
|
||||
ftp://ftp.gnu.org/gnu/libtool
|
||||
|
||||
To reduce load on the main server, please use one of the mirrors
|
||||
listed at:
|
||||
|
||||
https://www.gnu.org/order/ftp.html
|
||||
|
||||
* Alpha quality pre-releases of GNU Libtool, also with detached
|
||||
signature files are available from:
|
||||
|
||||
ftp://alpha.gnu.org/gnu/libtool
|
||||
|
||||
and some of the mirrors listed at:
|
||||
|
||||
https://www.gnu.org/order/ftp.html
|
||||
|
||||
* The master libtool repository is stored in git.
|
||||
|
||||
Development and testing is primarily done on the 'development' git
|
||||
branch. 'master' is used for release ready code. Periodically,
|
||||
commits are cherry-picked from 'development' to 'master'.
|
||||
|
||||
If you are a member of the savannah group for GNU Libtool, a writable
|
||||
copy of the libtool repository can be obtained by:
|
||||
|
||||
git clone <savannah-user>@git.sv.gnu.org:/srv/git/libtool.git
|
||||
|
||||
If you are behind a firewall that blocks the git protocol, you may
|
||||
find it useful to use
|
||||
|
||||
git config --global url.https://git.sv.gnu.org/r/.insteadof \
|
||||
git://git.sv.gnu.org/
|
||||
|
||||
to force git to transparently rewrite all savannah git references to
|
||||
use http.
|
||||
|
||||
If you are not a member of the savannah group for GNU Libtool, you can
|
||||
still fetch a read-only copy with either:
|
||||
|
||||
git clone git://git.sv.gnu.org/libtool.git
|
||||
|
||||
or using the CVS pserver protocol:
|
||||
|
||||
cvs -d:pserver:anonymous@pserver.git.sv.gnu.org:/srv/git/libtool.git \
|
||||
co -d libtool HEAD
|
||||
|
||||
* Before you can build from git, you need to bootstrap. This requires:
|
||||
- Autoconf 2.64 or later
|
||||
- Automake 1.11.1 or later
|
||||
- Help2man 1.29 or later
|
||||
- Xz 4.999.8beta or later (from [tukaani.org](https://tukaani.org/xz))
|
||||
- Texinfo 4.8 or later
|
||||
- Any prerequisites of the above (such as m4, perl, tex)
|
||||
|
||||
Note that these bootstrapping dependencies are much stricter than
|
||||
those required to use a distributed release for your own packages.
|
||||
After installation, GNU Libtool is designed to work either standalone,
|
||||
or optionally with:
|
||||
- Autoconf 2.59 or later
|
||||
- Automake 1.9.6 or later
|
||||
|
||||
* The `bootstrap` script sets up the source directory for you to hack.
|
||||
|
||||
|
||||
5. Version Numbering
|
||||
====================
|
||||
|
||||
People have complained that they find the version numbering scheme under
|
||||
which libtool is released confusing... so we've changed it!
|
||||
|
||||
It works like this:
|
||||
|
||||
<major-number>.<minor-number>
|
||||
|
||||
Releases with a **major-number** less than 1 were not yet feature
|
||||
complete. Releases with a **major-number** of 1 used the old numbering
|
||||
scheme that everyone disliked so much. Releases with a **major-number**
|
||||
of 2 us the new scheme described here. If libtool ever undergoes a
|
||||
major rewrite or substantial restructuring, the **major-number** will be
|
||||
incremented again.
|
||||
|
||||
If we make a patch release to fix bugs in a stable release, we use a
|
||||
third number, so:
|
||||
|
||||
2.4.2
|
||||
|
||||
If we make an alpha quality prerelease, we use a fourth number for the
|
||||
number of changsets applied since the version it's based on:
|
||||
|
||||
2.4.2.418
|
||||
|
||||
And finally, if you build an unreleased version it will have a short git
|
||||
revision hash string in hexadecimal appended to all of that:
|
||||
|
||||
2.4.2.418.3-30eaa
|
||||
|
||||
--
|
||||
Copyright (C) 2004-2010, 2015-2019, 2021-2024 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
Written by Gary V. Vaughan, 2004
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
Local Variables:
|
||||
mode: text
|
||||
fill-column: 72
|
||||
End:
|
||||
vim:tw=72
|
||||
@@ -0,0 +1,342 @@
|
||||
GNU Libtool
|
||||
***********
|
||||
|
||||
1. In the near future
|
||||
=====================
|
||||
|
||||
1.1. libtool
|
||||
------------
|
||||
|
||||
* Rather than looking up the linker's hardcode characteristics in a
|
||||
table of shell code, use objdump or equivalent to probe a test program
|
||||
at configure time.
|
||||
|
||||
* Eliminate the warnings from autoconf -Wobsolete.
|
||||
|
||||
* Hook the various language dependencies into the autoconf _AC_LANG
|
||||
framework.
|
||||
|
||||
* Work out what to do when the dynamic linker loads needed dependencies.
|
||||
|
||||
* We could have an option to hardcode paths into libraries, as well as
|
||||
binaries: '... -Wl,-soname -Wl,/tmp/libtest.so.0 ...'. This is not
|
||||
possible on all platforms, and is in part obviated by the ability of
|
||||
linking libtool libraries specified with -lname, but it might still
|
||||
be desirable.
|
||||
|
||||
* Lists of exported symbols should be stored in the pseudo library
|
||||
so that the size of lt_preloaded_symbols can be reduced.
|
||||
|
||||
* Have some option to tell libtool not to include -L flags that point
|
||||
into a certain tree in the dependence list of an installed library.
|
||||
For example: -L-$top_builddir would let one link with libtool
|
||||
libraries in sibling subdirectories within a project, using the -L
|
||||
notation, without getting builddir pathnames ever mentioned in .la
|
||||
files that get installed.
|
||||
|
||||
* Eric Lemings <elemings@cyberia.lemings.com> writes:
|
||||
Because of a growing number of config scripts for packages in GNOME 1.2
|
||||
(e.g. glib-config, xml-config, orbit-config. etc), development of GNOME
|
||||
2.0 spawned a separate tool called pkg-config that allows all packages
|
||||
to use one tool rather than several different scripts to query compile
|
||||
flags, link flags, and other configuration data.
|
||||
|
||||
The functionality of pkg-config seems to me to have a lot of overlap
|
||||
with the goals of libtool. I was wondering if anyone had considered
|
||||
adding an eighth mode to libtool that just queries the installed
|
||||
library for the same information that pkg-config provides. Since
|
||||
most packages that use pkg-config also use libtool, I think this
|
||||
would be a good way to reduce maintainer and developer dependencies.
|
||||
|
||||
* Have libtoolize install 'install-sh' if a newer version is available,
|
||||
and/or Automake is not used.
|
||||
|
||||
* Allow to specify linking some dependent libraries statically and some
|
||||
dynamically, where possible.
|
||||
|
||||
* Improve support for C++ with templates.
|
||||
|
||||
* Audit file listing in libtool.m4.
|
||||
|
||||
* Fix deplibs_check_method=pass_all (which is wrong!) on GNU/Linux.
|
||||
|
||||
* Fix -dlopen "self" on AIX. Reported by Gary Kumfert <kumfert@llnl.gov>.
|
||||
|
||||
* Fix denial of service if using installed 'libtool' on a different mount point
|
||||
together with a compiler that does not understand '-c -o'.
|
||||
Reported by Marcin Siennicki.
|
||||
|
||||
* Look at better -no-undefined support, maybe along the idea of
|
||||
[support #103719] for CC.
|
||||
|
||||
|
||||
1.2. libltdl
|
||||
------------
|
||||
|
||||
* Change libltdl interface: add separate functions for function
|
||||
pointers. This will allow porting to systems where function pointers
|
||||
are incompatible with data pointer C-wise.
|
||||
|
||||
* Fix the following bugs in libltdl:
|
||||
- error reporting of tryall_dlopen():
|
||||
if the file actually doesn't exist (stat() fails or it wasn't dlpreopened)
|
||||
-> report 'file not found'
|
||||
if it cannot be loaded (e.g. due to missing dependencies)
|
||||
-> report dlerror
|
||||
open question: what error should be reported if all dlloaders fail
|
||||
or if a specific module type can only be loaded by one of them, how report its dlerror?
|
||||
Also report dlerror() for dlclose and dlsym if available
|
||||
- Make sure that the dependency_libs of a dlpreopened module won't be loaded.
|
||||
|
||||
- Fix mdemo failures on mingw.
|
||||
|
||||
- Fix the last memleak. Reported by Jeff Squyres <jsquyres@lam-mpi.org>.
|
||||
|
||||
- Fix LTDL_CONVENIENCE. Reported by Bob Friesenhahn
|
||||
and Patrick Welche <prlw1@newn.cam.ac.uk>.
|
||||
|
||||
|
||||
1.3. libtoolize
|
||||
---------------
|
||||
|
||||
* Rewrite the func_copy_* functions so that instead of forking 2 tar
|
||||
processes per copied file, a list of files to copy is built and all
|
||||
files copied with a single pair of tar processes.
|
||||
|
||||
* Write test case that adds libtool macros to aclocal.m4.
|
||||
|
||||
|
||||
2. In the future
|
||||
================
|
||||
|
||||
2.1. Documentation
|
||||
------------------
|
||||
|
||||
* Need to finalize the documentation, and give a specification of
|
||||
'.la' files so that people can depend on their format. This would be
|
||||
a good thing to put before the maintenance notes.
|
||||
|
||||
* Document the installed 'libtool' and its limitations clearly (maybe implement
|
||||
--disable-script-install as well). Or, even better, remove its limitations.
|
||||
|
||||
* Platform notes redo.
|
||||
|
||||
2.2. test suite
|
||||
---------------
|
||||
|
||||
* We should include tests with reloadable objects in the testsuite.
|
||||
|
||||
* Write a test case for linkage with gnu ld scripts (per 2004-08-25 patch
|
||||
from Paolo Bonzini).
|
||||
|
||||
* Test everything:
|
||||
- cross compile
|
||||
- dirs with ~
|
||||
- multiple input files
|
||||
|
||||
2.3. libtool
|
||||
------------
|
||||
|
||||
* Fix cross-compiling.
|
||||
|
||||
* Fix threads.
|
||||
|
||||
* Support multilibbing.
|
||||
|
||||
* If not cross-compiling, have the static flag test run the resulting
|
||||
binary to make sure everything works.
|
||||
|
||||
* Another form of convenience library is to have undocumented utility
|
||||
libraries, where only the shared version is installed.
|
||||
|
||||
* We could use libtool object convenience libraries that resolve
|
||||
symbols to be included in a libtool archive. This would require some
|
||||
sort of -whole-archive option, as well.
|
||||
|
||||
* Currently, convenience libraries (.al) are built from .lo objects,
|
||||
except when --disable-shared. When we can build both shared and
|
||||
static libraries, we should probably create a .al out of .lo objects
|
||||
and also a .a out of .o objects. The .al would only be used to create
|
||||
shared libraries, whereas the .a would be used for creating static
|
||||
libraries and programs. We could also explicitly support 'empty'
|
||||
convenience libraries, that behave as macros that expand to a set of
|
||||
-Rs, -Ls and -ls switches.
|
||||
|
||||
* Audit use of object names so we can allow '$' not only within
|
||||
source file names. Necessary especially for java.
|
||||
|
||||
* We could introduce a mechanism to allow for soname rewriting, to
|
||||
ease multi-libc support. Installers could specify a prefix, suffix or
|
||||
sed command to modify the soname, and libtool would create the
|
||||
corresponding link. This would allow for rebuilding a library with
|
||||
the same version number, but depending on different versions of libc,
|
||||
for example. In the future, we might even have an option to encode
|
||||
the sonames of all dependencies of a library into its soname.
|
||||
|
||||
* Look again at a binary C libtool, or byte-compiled libtool to improve
|
||||
speed.
|
||||
|
||||
* Generate some "platform specific" shell functions with config.status,
|
||||
for example, there is no need to have the C source code for the
|
||||
wrapper script on non-windows platforms, this will make the generated
|
||||
libtool script smaller and easier to follow, maybe a little faster
|
||||
too?
|
||||
|
||||
* Audit the GCJ tag section in libtool.m4.
|
||||
|
||||
* Add caching mechanism. Look at 'libtool-cache' from Robert Ögren.
|
||||
|
||||
|
||||
2.4. libtool autoconf macros
|
||||
----------------------------
|
||||
|
||||
* Sort out the macro mess in libtool.m4. We've started this already
|
||||
by refactoring chunks into separate files, but I never did completely
|
||||
untangle the mess of macros imported from ltconfig.
|
||||
|
||||
* The definitions for LT_SYS_MODULE_EXT, LT_SYS_MODULE_PATH and
|
||||
LT_SYS_DLSEARCH_PATH should not rely on the _LT_SYS_DYNAMIC_LINKER
|
||||
macro. This involves moving the code that sets the variables
|
||||
library_names_spec, shlibpath_var and sys_lib_dlsearch_path_spec from
|
||||
into a separate macro, and AC_REQUIRING the newly extracted macro in the
|
||||
respective ltdl.m4 macros.
|
||||
|
||||
2.5. libtool automake integration
|
||||
---------------------------------
|
||||
|
||||
* Unify locks between libtool and compile.
|
||||
|
||||
* Fix relinking.
|
||||
|
||||
2.6. libltdl
|
||||
------------
|
||||
|
||||
* Finish the rewrite of the core libltdl. The loaders are fine, and
|
||||
the outlying code is now good. Ralf is starting to pick away at a lot
|
||||
of the remaining nasties already, but the code for finding .la/.so files
|
||||
and reading/loading them could use a lot more improvement.
|
||||
|
||||
* I think we could factor out a little path management support module
|
||||
from existing libltdl. This would be useful for M4 at least -- keeping
|
||||
track of FOO_PATH environment contents, searching for files in paths
|
||||
etc.
|
||||
|
||||
* Try to find a work-around for -[all-]static and libltdl on platforms
|
||||
that will fail to find dlopening functions in this case. Maybe
|
||||
creating an alternate libltdl that provides only for dlpreopening, or
|
||||
creating an additional static library to provide dummy implementations
|
||||
of the functions that can't be linked statically. This could hardly
|
||||
be made completely transparent, though.
|
||||
|
||||
* In conjunction with above, fix the failures on *BSD when linked to
|
||||
static libc. Reported by Guilhem Lavaux <guilhem@kaffe.org>.
|
||||
|
||||
* Add i18n strings to libltdl, ensuring that package developers can
|
||||
ignore any i18n when they libtoolize.
|
||||
|
||||
2.7. win32 support
|
||||
------------------
|
||||
|
||||
* Arrange that EXEEXT suffixes are stripped from wrapper script names
|
||||
only when needed, and that a timestamp file or a wrapper program is
|
||||
created with the EXEEXT suffix, so that 'make' doesn't build it every
|
||||
time.
|
||||
|
||||
* Figure out how to use data items in dlls with win32.
|
||||
The difficult part is compiling each object that will be linked with an
|
||||
import lib differently than if it will be linked with a static lib. This
|
||||
will almost definitely require that automake pass some hints about linkage
|
||||
in to each object compilation line.
|
||||
|
||||
* jeffdb@goodnet.com writes:
|
||||
all you need to do for mutually dependent .dll's is to create an implib from
|
||||
a .def file so it appears that we might need to detect and handle mutual
|
||||
dependencies specially on win32 =(O|
|
||||
|
||||
* QoI for file name and path conversion functions. Currently, these are
|
||||
implemented as MxN different functions; this has quadratic complexity. If
|
||||
possible, it would be preferred to implement then as M+N functions. However:
|
||||
http://lists.gnu.org/archive/html/libtool-patches/2010-08/msg00224.html
|
||||
The main issue is you don't know what the "native" (e.g. "central")
|
||||
path-type is; e.g. "from-X (to what?)" and "(from what?) to-Y". Right
|
||||
now there are only four "platforms" involved: *nix, mingw, msys, and
|
||||
cygwin. That's actually the break-even point, given the vagaries and
|
||||
optimizations involved in these particular four platforms.
|
||||
|
||||
We have exactly five basic file name conversion functions (not counting
|
||||
the wrappers that handle paths). For a non-quadratic M+N (from-X|to-Y)
|
||||
solution, we'd need, I think, the same number of conversion functions: brute
|
||||
force suggests nine (four to_*, four from_*, plus the noop), but then many
|
||||
of the from_* and to_* would actually BE noop.
|
||||
|
||||
I'm assuming here that the "central" path-type is implicitly some sort of
|
||||
unixish -- maybe cyg, maybe msys, maybe unix -- path-type. The issue is
|
||||
that each of the five conversion functions use a different TOOL to perform
|
||||
the conversion, with different syntax. So, trying to combine, e.g.
|
||||
msys_to_mingw
|
||||
cygwin_to_mingw
|
||||
unix_to_mingw
|
||||
into an all-encompassing "central_unixish_to_mingw" would require additional
|
||||
m4 magic to basically replace the guts depending on whether $build was msys,
|
||||
cygwin, or unix. Worse, you can't really do a set of
|
||||
{msys|cygwin|unix}_to_central_unixish that isn't simply a no-op -- because
|
||||
(A) they already are all unixish, and (B) what tool would you use? How would
|
||||
the later to_mingw function "know" how to convert this new representation to
|
||||
mingw. So, {msys|cygwin|unix}_to_central_unixish would simply be a no-op
|
||||
and central_unixish_to_mingw would still do all the work (with its guts
|
||||
customized based on $build).
|
||||
|
||||
For more reasonable cross environments (e.g. linux-gnu->some_embedded) I
|
||||
think you could probably work out a general M+N scheme, since most embedded
|
||||
$hosts aren't as strange as the win32 variants -- even VxWorks and INTEGRITY
|
||||
have basic, unix-like file systems (although INTEGRITY does have multiple
|
||||
roots). Aggressive use of the m4 function_replace machinery WOULD be
|
||||
appropriate for /these/ conversion functions. OTOH...(a) you can't run the
|
||||
$host apps on $build anyway, in these embedded situations. At best you'd use
|
||||
$TARGETSHELL and "run" them via a remote connection, and (b) they don't use
|
||||
the C wrapper!
|
||||
|
||||
So...I don't think it makes much difference *right now* in the amount of
|
||||
code required, or the number of functions implemented. At some point in the
|
||||
future we might want to generalize to an M+N scheme. For the existing win32
|
||||
$hosts, all of the functionality would be on "one side" of the 2-step
|
||||
conversion; the "other side" would be noop. But we won't worry about the
|
||||
implicit quadratic complexity of the existing scheme for now.
|
||||
|
||||
3. Wish List
|
||||
============
|
||||
|
||||
* Maybe implement full support for other orthogonal library types
|
||||
(libhello_g, libhello_p, 64 vs 32-bit ABI's, etc). Make these types
|
||||
configurable.
|
||||
|
||||
* Perhaps the use of libltdl could be made cleaner by allowing
|
||||
registration of hook functions to call at various points. This would
|
||||
hopefully free the user from having to maintain a parallel module
|
||||
list with user data. This would likely involve being able to carry
|
||||
additional per user module data in the lt_dlmodule structure -- perhaps
|
||||
in the form of an associative array keyed by user name?
|
||||
|
||||
* Figure out how to make pkg-config aware of the information libtool
|
||||
knows about libraries and their dependencies, and send a patch.
|
||||
|
||||
* Generate a libtool.m4 from a bunch of individual files, one per
|
||||
platform, to make the job of a "platform maintainer" easier and make
|
||||
it easier to add new platforms.
|
||||
|
||||
--
|
||||
Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software
|
||||
Foundation, Inc.
|
||||
Written by Gary V. Vaughan, 2004
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
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.
|
||||
|
||||
Local Variables:
|
||||
mode: text
|
||||
fill-column: 72
|
||||
End:
|
||||
Executable
+5470
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,410 @@
|
||||
# bootstrap.conf (GNU Libtool) version 2014-11-18
|
||||
#
|
||||
# Copyright (C) 2010-2019, 2021-2024 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2010
|
||||
|
||||
# This is free software; see the source for copying conditions. There is NO
|
||||
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# GNU Libtool 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.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
## -------------------------------- ##
|
||||
## User overridable command paths. ##
|
||||
## -------------------------------- ##
|
||||
|
||||
: "${MAKE=make}"
|
||||
|
||||
export MAKE
|
||||
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Configuration. ##
|
||||
## -------------- ##
|
||||
|
||||
# File that should exist in the top directory of a checked out hierarchy,
|
||||
# but not in a distribution tarball.
|
||||
checkout_only_file=HACKING
|
||||
|
||||
# List of programs (and minimum versions) required to bootstrap, maintain
|
||||
# and release Libtool.
|
||||
buildreq="
|
||||
help2man 1.29 https://www.gnu.org/s/help2man
|
||||
make 3.81 https://www.gnu.org/s/make
|
||||
makeinfo 4.8 https://www.gnu.org/s/texinfo
|
||||
xz 4.999.8beta https://tukaani.org/xz
|
||||
"
|
||||
|
||||
# Instructions on how to install packages in $buildreq.
|
||||
buildreq_readme=HACKING
|
||||
|
||||
# Non-default gnulib directories.
|
||||
local_gl_path=gl:gl-mod/bootstrap
|
||||
|
||||
# We don't need the whole copy of gnulib.
|
||||
gnulib_clone_since=2019-02-19
|
||||
|
||||
# Additional gnulib-tool options to use.
|
||||
gnulib_tool_options=$gnulib_tool_options"
|
||||
--avoid=dummy
|
||||
--libtool
|
||||
--macro-prefix=GL
|
||||
--with-tests --tests-base=gnulib-tests
|
||||
"
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules='
|
||||
announce-gen
|
||||
bootstrap
|
||||
do-release-commit-and-tag
|
||||
extract-trace
|
||||
gendocs
|
||||
git-version-gen
|
||||
gitlog-to-changelog
|
||||
gnu-web-doc-update
|
||||
gnupload
|
||||
inline-source
|
||||
maintainer-makefile
|
||||
options-parser
|
||||
readme-release
|
||||
update-copyright
|
||||
'
|
||||
|
||||
gnulib_git_submodules='
|
||||
gl-mod/bootstrap
|
||||
'
|
||||
|
||||
# Extra gnulib files that are not in modules, which override files of
|
||||
# the same name installed by other bootstrap tools.
|
||||
gnulib_non_module_files=$gnulib_non_module_files'
|
||||
doc/COPYINGv2
|
||||
doc/fdl.texi
|
||||
'
|
||||
|
||||
# What ignore files to maintain.
|
||||
vc_ignore=.gitignore
|
||||
|
||||
# Running the installed 'libtoolize' will trash the local (newer) libtool.m4
|
||||
# among others. Don't use ':', since autoreconf can't exec it!
|
||||
LIBTOOLIZE=true
|
||||
|
||||
# List of file droppings from old releases of Libtool.
|
||||
libtool_obsolete_files="
|
||||
acinclude.m4
|
||||
argz.c
|
||||
libltdl/config.h
|
||||
lt__dirent.c
|
||||
lt__strl.c
|
||||
"
|
||||
|
||||
|
||||
## ------------------- ##
|
||||
## Override functions. ##
|
||||
## ------------------- ##
|
||||
|
||||
# func_autopoint
|
||||
# --------------
|
||||
# Libtool does not use autopoint.
|
||||
func_autopoint ()
|
||||
{
|
||||
$debug_cmd
|
||||
}
|
||||
|
||||
|
||||
# func_libtoolize
|
||||
# ---------------
|
||||
# Libtoolize is part of Libtool!
|
||||
func_libtoolize ()
|
||||
{
|
||||
$debug_cmd
|
||||
}
|
||||
|
||||
|
||||
|
||||
## ---------------------------- ##
|
||||
## Libtool bootstrap functions. ##
|
||||
## ---------------------------- ##
|
||||
|
||||
# libtool_prep
|
||||
# ------------
|
||||
# Libtool bootstrap initialisation after successful option parse and
|
||||
# validation.
|
||||
libtool_prep ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
# initial clean-up of checked out tree
|
||||
find . -depth \( -name autom4te.cache -o -name libtool \) -print \
|
||||
| grep -v '{arch}' \
|
||||
| xargs rm -rf
|
||||
|
||||
# remove obsolete file droppings from old Libtool versions
|
||||
for file in $libtool_obsolete_files; do
|
||||
rm -f $file
|
||||
done
|
||||
}
|
||||
func_add_hook func_prep libtool_prep
|
||||
|
||||
|
||||
# libtool_add_libltdl_copying
|
||||
# ---------------------------
|
||||
# Use the canonical COPYING.LESSERv2 from gnulib.
|
||||
libtool_add_libltdl_copying ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_gnulib_tool_copy_file doc/COPYING.LESSERv2 libltdl/COPYING.LIB
|
||||
}
|
||||
func_add_hook func_gnulib_tool libtool_add_libltdl_copying
|
||||
|
||||
|
||||
# libtool_build_prerequisites
|
||||
# ---------------------------
|
||||
# Libtool generates some files that are required before any autotools
|
||||
# can be run successfully.
|
||||
libtool_build_prerequisites ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
$require_build_aux
|
||||
$require_ltdl_dir
|
||||
$require_macro_dir
|
||||
$require_package
|
||||
$require_package_bugreport
|
||||
$require_package_name
|
||||
$require_package_url
|
||||
$require_package_version
|
||||
|
||||
# Whip up a dirty Makefile:
|
||||
makes='Makefile.am libltdl/ltdl.mk'
|
||||
rm -f Makefile
|
||||
{
|
||||
echo "aux_dir = $build_aux"
|
||||
echo "ltdl_dir = $ltdl_dir"
|
||||
echo "macro_dir = $macro_dir"
|
||||
|
||||
# The following allow us to tie bootstrap-deps output verbosity
|
||||
# into the bootstrap --verbose option:
|
||||
echo 'AM_V_GEN = $(am__v_GEN_$(V))'
|
||||
echo 'am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))'
|
||||
echo 'am__v_GEN_0 = @echo " GEN " $@;'
|
||||
echo 'AM_V_at = $(am__v_at_$(V))'
|
||||
echo 'am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))'
|
||||
echo 'am__v_at_0 = @'
|
||||
|
||||
$SED '/^if /,/^endif$/d;/^else$/,/^endif$/d;/^include /d' $makes
|
||||
} > Makefile
|
||||
|
||||
# Building distributed files from configure is bad for automake, so we
|
||||
# generate them here, and have Makefile rules to keep them up to date.
|
||||
func_show_eval "$MAKE bootstrap-deps \
|
||||
AM_DEFAULT_VERBOSITY=0 `$opt_verbose && echo V=1` \
|
||||
PACKAGE='$package' PACKAGE_BUGREPORT='$package_bugreport' \
|
||||
PACKAGE_NAME='$package_name' PACKAGE_URL='$package_url' \
|
||||
SED='$SED' srcdir=. VERSION='$package_version'"
|
||||
status=$?
|
||||
|
||||
rm -f Makefile
|
||||
test 0 -eq "$status" ||exit $EXIT_FAILURE
|
||||
}
|
||||
func_add_hook func_gnulib_tool libtool_build_prerequisites
|
||||
|
||||
|
||||
# libtool_autoreconf_libltdl
|
||||
# --------------------------
|
||||
# Libtldl directory needs to be autoreconfed too.
|
||||
libtool_autoreconf_libltdl ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
# Also bootstrap libltdl ready for installation.
|
||||
func_autoreconf libltdl
|
||||
}
|
||||
func_add_hook func_reconfigure libtool_autoreconf_libltdl
|
||||
|
||||
|
||||
# libtool_readme_release_package_substitutions
|
||||
# --------------------------------------------
|
||||
# Show our own package details instead of generic strings.
|
||||
libtool_readme_release_package_substitutions ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
$require_build_aux
|
||||
$require_package
|
||||
|
||||
my_readme=README-release
|
||||
|
||||
test -f "$my_readme" \
|
||||
|| func_fatal_error "error: '$my_readme' does not exist"
|
||||
|
||||
# Perform substitutions to a temporary file
|
||||
$SED -e "\
|
||||
s|\@PACKAGE\@|$package|g
|
||||
" "$my_readme" > "${my_readme}T" \
|
||||
&& mv "${my_readme}T" "$my_readme"
|
||||
}
|
||||
func_add_hook func_fini libtool_readme_release_package_substitutions
|
||||
|
||||
|
||||
# libtool_fudge_timestamps
|
||||
# ------------------------
|
||||
# Autoheader valiantly tries to prevent needless reconfigurations by
|
||||
# not changing the timestamp of config-h.in unless the file contents
|
||||
# are updated. Unfortunately config-h.in depends on aclocal.m4, which
|
||||
# *is* updated, so running 'libtoolize --ltdl=. && configure && make'
|
||||
# causes autoheader to be called... undesirable for users that do not
|
||||
# have it! Fudge the timestamp to prevent that. But only fudge it as
|
||||
# much as configure since configure depends on config-h.in and we don't
|
||||
# want to require autoconf either.
|
||||
libtool_fudge_timestamps ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
(
|
||||
cd libltdl
|
||||
touch -r configure config-h.in
|
||||
)
|
||||
}
|
||||
func_add_hook func_fini libtool_fudge_timestamps
|
||||
|
||||
|
||||
# libtool_cleanup
|
||||
# ---------------
|
||||
libtool_cleanup ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
# These files can cause an infinite configure loop if left behind.
|
||||
rm -f Makefile libltdl/Makefile libtool vcl.tmp
|
||||
}
|
||||
func_add_hook func_fini libtool_cleanup
|
||||
|
||||
|
||||
# libtool_check_for_bogus_macros
|
||||
# ------------------------------
|
||||
# Try to catch the case where 'aclocal' pulls installed libtool macro
|
||||
# file contents from another version of libtool into the current package
|
||||
# 'aclocal.m4'.
|
||||
libtool_check_for_bogus_macros ()
|
||||
{
|
||||
$debug_cmd
|
||||
$require_build_aux
|
||||
$build_aux/no-bogus-m4-defines || exit 1
|
||||
}
|
||||
func_add_hook func_fini libtool_check_for_bogus_macros
|
||||
|
||||
|
||||
# libtool_cleanup_empty_dirs
|
||||
# --------------------------
|
||||
# Gnulib leaves behind a few files we don't need.
|
||||
libtool_cleanup_empty_dirs ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
my_gnulib_source=${source_base:-'lib'}
|
||||
|
||||
if test -d "$my_gnulib_source"; then
|
||||
rm -f "$my_gnulib_source/.gitignore" "$my_gnulib_source/Makefile.am" || exit 1
|
||||
rmdir "$my_gnulib_source" || exit 1
|
||||
fi
|
||||
}
|
||||
func_add_hook func_fini libtool_cleanup_empty_dirs
|
||||
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
## Resource management. ##
|
||||
## -------------------- ##
|
||||
|
||||
# require_ltdl_dir
|
||||
# ----------------
|
||||
# Extract libtool's ltdl directory from configure.ac.
|
||||
require_ltdl_dir=func_require_ltdl_dir
|
||||
func_require_ltdl_dir ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
$require_configure_ac
|
||||
|
||||
func_extract_trace LT_CONFIG_LTDL_DIR
|
||||
|
||||
save_ifs=$IFS
|
||||
IFS=:
|
||||
set dummy $func_extract_trace_result
|
||||
IFS=$save_ifs
|
||||
shift
|
||||
|
||||
ltdl_dir=$1
|
||||
func_check_configuration ltdl_dir \
|
||||
"LT_CONFIG_LTDL_DIR([name of your libltdl directory])"
|
||||
|
||||
func_verbose "ltdl_dir='$ltdl_dir'"
|
||||
|
||||
require_ltdl_dir=:
|
||||
}
|
||||
|
||||
|
||||
# require_package_url
|
||||
# -------------------
|
||||
# Ensure that package_url has a sensible default.
|
||||
require_package_url=libtool_require_package_url
|
||||
libtool_require_package_url ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
$require_configure_ac
|
||||
|
||||
func_extract_trace AC_INIT
|
||||
|
||||
save_IFS=$IFS
|
||||
IFS=:
|
||||
set dummy $func_extract_trace_result
|
||||
IFS=$save_IFS
|
||||
shift
|
||||
|
||||
test -n "$package_url " || package_url=$5
|
||||
test -n "$package_url" || {
|
||||
# How to extract the parameters for 'make bootstrap-deps' from
|
||||
# configure.ac. This is very specific to the way Libtool's
|
||||
# configure.ac layout.
|
||||
sed_extract_package_url='s|#.*$||; s|^dnl .*$||; s| dnl .*$||;
|
||||
/AC_SUBST([[]*PACKAGE_URL/{
|
||||
s|.*AC_SUBST([[ ]*PACKAGE_URL[] ]*,[[ ]*|package_url="|
|
||||
s|[]) ]*$|"|
|
||||
p
|
||||
}'
|
||||
|
||||
# Extract package_url setting from configure.ac.
|
||||
eval `$SED -n "$sed_extract_package_url" < configure.ac`
|
||||
}
|
||||
|
||||
test -n "$package_url" \
|
||||
|| func_fatal_error "unable to determine 'package_url' from '$configure_ac'."
|
||||
|
||||
func_verbose "package_url='$package_url'"
|
||||
|
||||
require_package_url=:
|
||||
}
|
||||
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "# bootstrap.conf (GNU Libtool) version "
|
||||
# time-stamp-format: "%:y-%02m-%02d"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
@@ -0,0 +1,25 @@
|
||||
/announce-gen
|
||||
/ar-lib
|
||||
/compile
|
||||
/depcomp
|
||||
/do-release-commit-and-tag
|
||||
/gendocs.sh
|
||||
/git-version-gen
|
||||
/gnu-web-doc-update
|
||||
/gnupload
|
||||
/install-sh
|
||||
/ltmain.sh
|
||||
/mdate-sh
|
||||
/missing
|
||||
/mkinstalldirs
|
||||
/test-driver
|
||||
/texinfo.tex
|
||||
/useless-if-before-free
|
||||
/vc-list-files
|
||||
/gitlog-to-changelog
|
||||
/update-copyright
|
||||
/extract-trace
|
||||
/options-parser
|
||||
/funclib.sh
|
||||
/inline-source
|
||||
/bootstrap.in
|
||||
@@ -0,0 +1,93 @@
|
||||
#! /bin/sh
|
||||
|
||||
# edit-readme-alpha - edit README file for alpha releases
|
||||
# Copyright (C) 2010-2019, 2021-2024 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2010
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
####
|
||||
|
||||
# We used to maintain separate (but extremely similar!) README and
|
||||
# README.alpha files, and had 'make dist' include the right one in a
|
||||
# distribution based on the contests of '$(VERSION)'.
|
||||
#
|
||||
# Now, we have 'make dist' call this script to tweak the first paragraph
|
||||
# of README in situ, to be more suitable for an alpha quality release.
|
||||
|
||||
EXIT_SUCCESS=0
|
||||
EXIT_FAILURE=1
|
||||
|
||||
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
|
||||
# is ksh but when the shell is invoked as "sh" and the current value of
|
||||
# the _XPG environment variable is not equal to 1 (one), the special
|
||||
# positional parameter $0, within a function call, is the name of the
|
||||
# function.
|
||||
progpath=$0
|
||||
|
||||
# The name of this program:
|
||||
progname=`echo "$progpath" |sed 's|^.*/||'`
|
||||
|
||||
|
||||
# func_fatal_error ARG...
|
||||
# -----------------------
|
||||
# Echo program name prefixed message to standard error, and exit.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "$progname: $*" >&2
|
||||
exit $EXIT_FAILURE
|
||||
}
|
||||
|
||||
|
||||
for file in "$@"; do
|
||||
# Assume that read-only README indicates that we are running inside
|
||||
# the latter part of a 'make distcheck'.
|
||||
test -w "$file" || {
|
||||
echo "$progname: not editing non-writeable '$file' (distcheck?)" >&2
|
||||
continue
|
||||
}
|
||||
|
||||
# Did we already in-place edited this file?
|
||||
matched=`sed -n -e '/^This is an alpha testing release/,/a consistent, portable interface\.$/p' $file \
|
||||
|wc -l |sed 's|^ *||'`
|
||||
test 3 = "$matched" && {
|
||||
echo "$progname: $file already edited" >&2
|
||||
continue
|
||||
}
|
||||
|
||||
# Make sure the paragraph we are matching has not been edited since
|
||||
# this script was written.
|
||||
matched=`sed -n -e '/^\[GNU Libtool\]\[libtool\] is/,/^consistent, portable interface\.$/p' $file \
|
||||
|wc -l |sed 's|^ *||'`
|
||||
test 3 = "$matched" \
|
||||
|| func_fatal_error "$file format has changed, please fix '$0'"
|
||||
|
||||
# Don't leave file droppings.
|
||||
trap 'x=$?; rm $file.T; exit $x' 1 2 13 15
|
||||
|
||||
# Edit the first paragraph to be suitable for an alpha release.
|
||||
sed '/^\[GNU Libtool\]\[libtool\] is/,/^consistent, portable interface\.$/c\
|
||||
This is an alpha testing release of [GNU Libtool][libtool], a generic\
|
||||
library support script. [Libtool][] hides the complexity of using shared\
|
||||
libraries behind a consistent, portable interface.' $file > $file.T
|
||||
|
||||
# Diagnose redirection failure.
|
||||
test -f "$file.T" || func_fatal_error "Unable to write $file.T"
|
||||
|
||||
# Overwrite the original file with our edited version.
|
||||
mv $file.T $file || func_fatal_error "Unable to edit $file"
|
||||
done
|
||||
|
||||
exit $EXIT_SUCCESS
|
||||
@@ -0,0 +1,130 @@
|
||||
#!/bin/sh
|
||||
|
||||
# An example hook script for catching duplicate or malformed Co-authored-by
|
||||
# or Copyright-paperwork-exempt lines in the commit message.
|
||||
# Written by Gary V. Vaughan <gary@gnu.org>, 2011
|
||||
|
||||
# Copyright (C) 2011-2019, 2021-2024 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.
|
||||
|
||||
# Libtoolize 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.
|
||||
#
|
||||
# Libtoolize 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/>.
|
||||
|
||||
|
||||
: ${SED="sed"}
|
||||
test "${ECHO+set}" = set || ECHO='printf %s\n'
|
||||
|
||||
basename='s|^.*/||'
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
progpath=$0
|
||||
progname=`$ECHO "$progpath" |$SED -e "$basename"`
|
||||
|
||||
log_file=$1
|
||||
export log_file
|
||||
|
||||
fn_error ()
|
||||
{
|
||||
prefix="$progname: error: "
|
||||
|
||||
save_IFS=$IFS
|
||||
IFS=$nl
|
||||
for line in $*; do
|
||||
IFS=$save_IFS
|
||||
$ECHO "$prefix$line" 1>&2
|
||||
prefix="$progname: "
|
||||
done
|
||||
IFS=$save_IFS
|
||||
}
|
||||
|
||||
fn_re_edit ()
|
||||
{
|
||||
$ECHO 'Press return to edit. Ctrl-C to abort...' >&2
|
||||
read v
|
||||
${EDITOR-'vi'} "$log_file"
|
||||
}
|
||||
|
||||
fn_rewrite ()
|
||||
{
|
||||
# Output once to stderr
|
||||
fn_error "$*"
|
||||
|
||||
# And again as a comment in the log_file ready for re-editing
|
||||
$ECHO "$*" |$SED 's|^|# |'
|
||||
echo
|
||||
cat "$log_file"
|
||||
}
|
||||
|
||||
fn_check_msg ()
|
||||
{
|
||||
return_status=0
|
||||
|
||||
CAB_re='^Co-authored-by: '
|
||||
CPR_re='^Copyright-paperwork-exempt: '
|
||||
|
||||
# Flag duplicated Co-authored-by lines.
|
||||
dups=`grep "$CAB_re" "$log_file" 2>/dev/null \
|
||||
|sort |uniq -c |sed -e '/^[ ]*1[ ]/d'`
|
||||
|
||||
test -n "$dups" && {
|
||||
$ECHO 'Duplicate Co-authored-by lines:
|
||||
'"$dups"
|
||||
return_status=1
|
||||
}
|
||||
|
||||
# Make sure each Co-authored-by line contains a valid email.
|
||||
email_re='<.*@.*\..*>'
|
||||
|
||||
grep "$CAB_re" "$log_file" 2>/dev/null \
|
||||
|while read CAB; do
|
||||
test 0 -eq `expr "$CAB" : ".*$email_re"` && {
|
||||
echo "Malformed or missing email in '$CAB'"
|
||||
return_status=1
|
||||
}
|
||||
done
|
||||
|
||||
# Flag duplicated Copyright-paperwork-exempt lines.
|
||||
count=`grep "$CPR_re" "$log_file" 2>/dev/null \
|
||||
|wc |sed -e 's|^[ ]*||;s|[ ].*$||'`
|
||||
|
||||
test 2 -gt "$count" || {
|
||||
$ECHO 'More than one Copyright-paperwork-exempt line.'
|
||||
return_status=1
|
||||
}
|
||||
|
||||
# Make sure Copyright-paperwork-exempt line is valid.
|
||||
if grep "$CPR_re[Nn]" "$log_file" >/dev/null 2>&1; then
|
||||
$ECHO "\
|
||||
'Copyright-paperwork-exempt: No' is redundant, please remove."
|
||||
return_status=1
|
||||
else
|
||||
not_yes=`grep "$CPR_re" "$log_file" 2>/dev/null \
|
||||
|grep -v "${CPR_re}Yes\$"`
|
||||
|
||||
test -n "$not_yes" && {
|
||||
$ECHO "'Copyright-paperwork-exempt' setting must be 'Yes'."
|
||||
return_status=1
|
||||
}
|
||||
fi
|
||||
|
||||
return $return_status
|
||||
}
|
||||
|
||||
while :; do
|
||||
err=`fn_check_msg` && break
|
||||
fn_rewrite "$err" > "${log_file}T" && mv "${log_file}T" "$log_file"
|
||||
fn_re_edit
|
||||
done
|
||||
@@ -0,0 +1,437 @@
|
||||
# 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.
|
||||
|
||||
0f84217752fe50155f1f00fd14efbbbbdfaaed24
|
||||
s|Subjecŧ|Subject|
|
||||
|
||||
8c2154fb4e80967b50b98c7327ff1465d3315f3f
|
||||
# Date: Tue Nov 18 16:14:35 2014 +0000
|
||||
# Fox a resent smelling mystique.
|
||||
s|mistake,\n|mistake.\n|;
|
||||
s|progagote\.|propagate/.|
|
||||
|
||||
2636f57059967d3438250234279edac7cfd13d35
|
||||
# Date: Wed Sep 4 18:47:08 2013 -0700
|
||||
# Separate summary and file change description.
|
||||
s|(\* )|maint: add Brooks Moses to AUTHORS file.\n$1|
|
||||
|
||||
8b6f961a68c73fc7d6c61ef9cd55ffa41dbbf028
|
||||
# Date: Tue Jan 1 19:39:24 2013 +0100
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
109bc05e0d356ab48cc363521b8cd0abc943a6f5
|
||||
# Date: Wed Dec 19 11:20:28 2012 +0100
|
||||
# Remove unsupported tag.
|
||||
s|Tested-by:[\s\S]*$||
|
||||
|
||||
c82eaf360b1d2797054296c5e894c1271fffb7cf
|
||||
# Date: Sun Oct 21 18:17:52 2012 -0500
|
||||
# Add file reference.
|
||||
s|(Fixed)|* gl/build-aux/options-parser (func_split_equals): $1|;
|
||||
# Add summary line.
|
||||
s|(\* gl)|options-parser: fix regexp quoting error.\n$1|;
|
||||
# Refill to 64 columns.
|
||||
s|func_split_equals shell|expr\nregexp|;
|
||||
s|\. |.\n|
|
||||
|
||||
b3e96ce7d1566d6120112f3b10e7782cc62cff8d
|
||||
# Date: Mon Oct 8 17:59:51 2012 +0200
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g;
|
||||
# Move Report attribution to the end of the entry.
|
||||
s|Report by .*\.\n||;
|
||||
s|$|\nReported by Roumen Petrov.|
|
||||
|
||||
0f31e375104b00a181557d3809e556066b3d98b1
|
||||
# Date: Mon Oct 8 13:10:02 2012 +0200
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g;
|
||||
# Move Report attribution to the end of the entry.
|
||||
s|Report by .*\.\n||;
|
||||
s|$|\nReported by Roumen Petrov.|
|
||||
|
||||
b78fd9740ef6a2ed67a1ef14e76483af784fb5f0
|
||||
# Date: Sun Oct 7 00:57:26 2012 +0200
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
82791b3fb7043f81391bb36047f8533f4dd11b7b
|
||||
# Date: Sun Oct 7 00:57:10 2012 +0200
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
a61a1114ae1464c39b54e88d1a30735c7daca4b2
|
||||
# Date: Fri Oct 5 21:43:45 2012 +0200
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
0b1b67186407f1b03cc0c5bf1882a8db8e0ee2e2
|
||||
# Date: Wed Oct 3 11:49:27 2012 +0700
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
## Elide duplicate log entries from merge of gary/reredo-test-operand-order
|
||||
## branch.
|
||||
# Date: Tue Oct 2 21:05:53 2012 +0700
|
||||
4440d6523bf9c668720f9ffa66fb89e91912a504
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n\n|
|
||||
|
||||
0fc275469ef020177d8dff2c041456f6b6155537
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
692bc68dc9a580647a164d6338ca7e13cb593966
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
6cb0d0d771bc1e3be402929b900000ca7a8a16d4
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
d50e123595d80b5582d0663ad50e3454051c482d
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
e0f66dc54d2f7906a2513c68d76362be4bcbbef3
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
ae68608314993e81836257ac1eec449256decd53
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
d576fa9da144f2e9ab14337c9590d4abfdea985f
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
3cbc0e26f0a7f0bbea559912c3da920b4ead8e5e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
83d52fd6d2039c048f731133bec0ae8a1bf9382d
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
1e70622d7c127b4dd90b3a5b0650d323ec2305fc
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
1fcb9bc4e4b7b7166a6f45da633f813faee6e00f
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
bf6aa3082089d12bf4500b469c096263823a75b4
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
43acd6749a29f079452cfb70b6c6e1c8f1469128
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
8c6e33197e36463cb7fcf5d575a53c3f414ec4ff
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
7db681a2696c75dc6c55261ea8fd11f92e42db2b
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
59f8a3a6e1a26d501e5865f7611d8828aac5579c
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
f2a640f7e03e5dcf1510833a0e1e4991032b5f96
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
90529a55ef40653051730d3c20203fa2ad5e8f7f
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
d702946c65b309c389ae717a4d2d6fe158c3ee5f
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
8392cd263e847a22b2409c35bf03d7c9e68d2cd0
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
430e782755bbe8061a5e7f9d856b33e3b7da3ac8
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
d60b4387c178100b0bd3835c61d0f4771330bf6a
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
47a889a4ca2009e2147fa5b2f95baefe1dca8288
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
8f975a1368594126e37d85511f1f96164e466d93
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
f8a4b90f9a712f47b7627d2cf96eed74825df91f
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
b25625e6b25427dba80051b2924060b1e84ea73e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
3467227ccb6c99f4c2122b9fb3fa67d54b5bd54b
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
8bfac9e3e82646868907aede4ebe4deb158a2e8a
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
baffe661910947df0dcd5a5bbd6512fc0bce59b9
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
822881fe3c69ca474b8e13d60243dd9c1a1c3fea
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
f7f249a0e6b5093b8752f1ba863345bfcd5a237e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
c03789b8ee33f136d3bbd7f7a111ad863bb4c7e8
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
78385ffd8af73b927549c3596da67233f2f92f0e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
7d25536e80b68042a6d999c11a0c5c9dc948f82e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
7a2a8f32bb83d6b16db8436b530ec5e88fbd0751
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
c5dec32e37e90ce46813efe7dfe8c5500cc55bbc
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
a2445f0fdbeaa72c18a893714e4437ea01faa08a
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
0c953ba5cc71bd1de615df28fbf16e27be62244e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
f32a760fbd40796be0b7e3be41226a82db1748d4
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
a80878742dfd0f5127c1ddc5f803fab980eb816a
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
d56683630a6415e59f1be7a6540c4733e9671bd8
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
ca821436009a93c2e8f3c5ce07ed23d90bbba49e
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
c7d7e46fbea7d6249680da71ecda1d84bdec858a
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
156a851bc5d758f2d4d7fd89cef678ae72f35e77
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
87c4cffb19cf5ba8dc088e0ad357e5c3d4be2433
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
c5230035e5df31976285bf36141d89236416230d
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
cb4ed2559e89354ea846a686543206d3445ea5ec
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
9f3cec5b2ec476bd4fd978c1e23398b25d36cd2f
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
5f27eeb0a37f15b32ccb1b97b2ed9022f5df9a60
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
013c91874e974543d2f58843c1e839ba102d6ee0
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
006695fed2e9cd10664c97c69880a82545dde1ef
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
ff3b32aed7db925a7390d92ffede055b4c8ccf18
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
d43b40113ec1e8289e48d77f00e8947f2fd98fd4
|
||||
# Date: Tue Oct 2 21:02:16 2012 +0700
|
||||
# Refill to 64 columns.
|
||||
s|( sc_prohibit_test_)|\n$1|
|
||||
|
||||
303040ad8167d2e608b15a7b22e054659d6d409f
|
||||
# Date: Sun Sep 16 17:43:05 2012 +0700
|
||||
# Refill to 64 columns.
|
||||
s|( prohibit_undesirable_word_seq\.)|\n$1|
|
||||
|
||||
6370af6d4abaa9aa9d03984248229f1b8d143d52
|
||||
# Date: Sun Sep 16 14:35:55 2012 +0700
|
||||
# Add category tag to summary line.
|
||||
s|\n(Revert )|\nmaint: $1|;
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
cf86b942c893da74d6e9faf0125364a9f114ea01
|
||||
# Date: Tue Aug 21 21:06:45 2012 -0500
|
||||
# Add category tag to summary line.
|
||||
s|\n(Add )|\nlibtool: $1|;
|
||||
# Spell Report attribution correctly.
|
||||
s|Thanks to (.*) for .*\n|Reported by $1.\n|
|
||||
|
||||
9b726f35db98da01a7edaf143788cba2c2ae900a
|
||||
# Date: Tue Aug 21 20:17:04 2012 -0500
|
||||
# Add category tag to summary line.
|
||||
s|\n(Pass )|\nlibtool: $1|
|
||||
|
||||
70bac1d7cc3e2c955bfd0769d448c4d818a1e2b8
|
||||
# Date: Tue Aug 21 20:14:55 2012 -0500
|
||||
# Add category tag to summary line.
|
||||
s|\n(AIX )|\nlibtool: $1|
|
||||
|
||||
c03e516bd2f8e730deaf214ac7978abe429cebfe
|
||||
# Date: Tue Aug 21 20:12:01 2012 -0500
|
||||
# Add category tag to summary line.
|
||||
s|\n(Update/)|\nlibtool: $1|
|
||||
|
||||
00ed0187c1c6cc3519188bc47d5ed0ff85f2d950
|
||||
# Date: Sun Aug 19 22:14:13 2012 +0200
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
37a284f50a93b772d86e8c68a346266aab5de7a5
|
||||
# Date: Wed Apr 18 23:14:50 2012 -0500
|
||||
# Add category tag to summary line.
|
||||
s|\n(Handle )|\nlibtool: $1|
|
||||
|
||||
fbe09b44b5052273fe79ea24365c554a5d54d8ce
|
||||
# Date: Fri Mar 16 13:23:13 2012 -0500
|
||||
# Add category tag to summary line.
|
||||
s|\n(Fix )|\nlibtool: $1|;
|
||||
# Email address of Reporters is in THANKS.
|
||||
s|(Reported by .*?) *<.*>|$1.|
|
||||
|
||||
3b94c2d8e804d485cf6124adb1572f45ae697216
|
||||
# Date: Tue Feb 21 11:10:39 2012 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Improve )|\nlibtool: $1|
|
||||
|
||||
9333e74fc7b76a11ed04a19343eb5dd75a1035f3
|
||||
# Date: Sun Feb 19 16:21:00 2012 -0600
|
||||
# Elide duplicate log entries.
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
c0c49f289f22ae670066657c60905986da3b555f
|
||||
# Date: Sun Feb 19 15:33:48 2012 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Accept )|\nlibtool: $1|
|
||||
|
||||
96cc27eff32481be89bca4e37f43a11bf953a326
|
||||
# Date: Sun Feb 19 14:56:33 2012 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Enable )|\nlibtool: $1|
|
||||
|
||||
f16abb06f7425b6468b01324740a5dad8a97ec59
|
||||
# Date: Sun Feb 19 14:55:06 2012 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Fixing )|\nlibtool: $1|
|
||||
|
||||
e444159cc04dc6721d509d9d3d6ba0bc6f9e5048
|
||||
# Date: Sun Feb 19 14:18:19 2012 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Improve )|\nltdl: $1|
|
||||
|
||||
b2ccf68b01d3e6092e2b505386c50486b71e7dd6
|
||||
# Date: Sun Feb 19 14:18:19 2012 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Deleted )|\nmaint: $1|
|
||||
|
||||
7a78cca31bca68f3cf2e398d26b03f3980331d72
|
||||
# Date: Sat Dec 24 09:05:19 2011 +0700
|
||||
# Fix typo.
|
||||
s|options-parses|options-parser|
|
||||
|
||||
88992fe6771ec3258bde1b03314ce579da0ac2d5
|
||||
# Date: Mon Dec 12 21:24:14 2011 -0600
|
||||
# Add category tag to summary line.
|
||||
s|\n(Support )|\nlibtool: $1|
|
||||
|
||||
962aa919f51cdf8e2cee4fb2d1d9bafa34d50887
|
||||
# Date: Fri Nov 25 14:53:42 2011 +0700
|
||||
# Elide duplicate log entries.
|
||||
s|\n\n|\nOmit-from-ChangeLog.\n|
|
||||
|
||||
11d16ab06c36948c053c507f5f9e06ff3de221c7
|
||||
# Date: Fri Nov 25 14:39:57 2011 +0700
|
||||
# Spell Stefano's name correctly.
|
||||
s|Steffano|Stefano|
|
||||
|
||||
a5ef08182ce0fb80b8adcff5872f190afd915908
|
||||
# Date: Wed Nov 16 12:13:55 2011 +0700
|
||||
# Fix a typo.
|
||||
s|bootstraps|bootstrap's|
|
||||
|
||||
88224124e4f57166cdcc78be29730372762a147e
|
||||
# Date: Tue Nov 15 16:44:15 2011 +0700
|
||||
# Fix a typo.
|
||||
s|todays|today's|
|
||||
|
||||
e8db92c345b99acd9c6984a321fc241ed1d01d23
|
||||
# Date: Tue Nov 15 13:26:53 2011 +0700
|
||||
# Email address of Reporters is in THANKS.
|
||||
s|(Reported by .*?) *<.*>|$1.|
|
||||
|
||||
c188507816c4b43f3411677116ce4ab4b926958e
|
||||
# Date: Mon Nov 7 23:43:56 2011 +0700
|
||||
# Use canonical gnu email address.
|
||||
s|vaughan\.pe|gnu.org|g
|
||||
|
||||
fdb4c546784aebacaf697ebd5f96e0d91c566597
|
||||
# Date: Tue Oct 18 13:20:53 2011 +0700
|
||||
# Use canonical gnu email address.
|
||||
s|vaughan\.pe|gnu.org|g
|
||||
|
||||
0fe4d0740effaec9d08ee9683fb493d8ad0bd8b5
|
||||
# Date: Mon Oct 17 16:43:18 2011 +0700
|
||||
# Use canonical gnu email address.
|
||||
s|vaughan\.pe|gnu.org|g;
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g;
|
||||
# Fix a typo.
|
||||
s|soure|source|
|
||||
|
||||
789817d512111d063981446efc7493ce87696bb3
|
||||
# Date: Mon Oct 17 12:40:55 2011 +0700
|
||||
# Use canonical gnu email address.
|
||||
s|vaughan\.pe|gnu.org|g;
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
49ae2888b43cad358e2ff60a69722341116e7b40
|
||||
# Date: Sun Oct 2 10:02:18 2011 -0500
|
||||
# No leading tabs in git log message.
|
||||
s|\n\t|\n|g
|
||||
|
||||
920da81be698974faa50bd36a60248e2c18c4fd5
|
||||
# Date: Sun Sep 25 17:39:04 2011 -0500
|
||||
# No leading tabs in git log message.
|
||||
s|\n\t|\n|g;
|
||||
# No empty lines in a single commit.
|
||||
s|\n\n|\n|g
|
||||
|
||||
dc28c2bfbcb4879bc04a73186d72ec0e7ef2ad4c
|
||||
# Date: Thu Sep 1 18:45:03 2011 -0500
|
||||
# Typo in name.
|
||||
s|Davd|David|
|
||||
|
||||
1ea9302bd1eadf25b466fcd7e8697e4bef111493
|
||||
# Date: Sun Apr 10 10:17:21 2011 +0200
|
||||
# Add back missing annotation:
|
||||
s|$|\nCopyright-paperwork-exempt: Yes|
|
||||
|
||||
1b76054f4763a28ae1b01fbeee86ba0c524d1923
|
||||
# Date: Mon Mar 14 08:40:50 2011 +0100
|
||||
# Refill to 64 columns (72 in ChangeLog including leading \t):
|
||||
s|to add all\nnecessary|to\nadd all necessary|;
|
||||
s|support\. Currently|support.\nCurrently|;
|
||||
s|filters\n|filters |;
|
||||
s|the case with|the\ncase with|;
|
||||
s|This change\nhandles|This change handles|;
|
||||
s|the situation for|the situation\nfor|;
|
||||
s|thread\nsupport was|thread support\nwas|;
|
||||
# Indent urls slightly:
|
||||
s|\nhttp://|\n http://|g;
|
||||
# No empty lines in a single commit:
|
||||
s|\n\n|\n|g;
|
||||
# Add back missing annotation, and co-author:
|
||||
s|$|\nCopyright-paperwork-exempt: Yes|;
|
||||
s|$|\nCo-authored-by: Rhys Ulerich <rhys.ulerich\@gmail.com>|;
|
||||
|
||||
e94c6d6e0359d92f08f491f57e0ef3371e978952
|
||||
# Date: Thu Jan 20 19:35:14 2011 +0100
|
||||
# Add back missing annotation:
|
||||
s|$|\nCopyright-paperwork-exempt: Yes|
|
||||
|
||||
9167aecabd12c5afe7a65d45dc73f8c92ab42f05
|
||||
# Date: Sun Jan 9 19:51:28 2011 +0100
|
||||
# Add back missing annotation:
|
||||
s|$|\nCopyright-paperwork-exempt: Yes|
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
#! /bin/sh
|
||||
|
||||
# no-bogus-m4-defines - detect wrong m4 definitions
|
||||
# -------------------------------------------------
|
||||
# Try to catch the case where 'aclocal' pulls installed libtool
|
||||
# macro file contents from another version of libtool into the
|
||||
# current package 'aclocal.m4'. Currently used by 'make dist'
|
||||
# and by ./bootstrap (bootstrap.conf).
|
||||
#
|
||||
# Copyright (C) 2015-2019, 2021-2024 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Please report bugs or propose patches to bug-libtool@gnu.org.
|
||||
|
||||
. `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh
|
||||
# source this for "GNU m4" detection methods
|
||||
. `echo "$0" |${SED-sed} 's|[^/]*$||'`/extract-trace
|
||||
|
||||
$require_gnu_m4
|
||||
|
||||
bogus_macros='LT_INIT AC_PROG_LIBTOOL AM_PROG_LIBTOOL'
|
||||
|
||||
bogus_macros_grep=''
|
||||
for macro in $bogus_macros; do
|
||||
func_append bogus_macros_grep "/$macro/p;"
|
||||
done
|
||||
|
||||
clean_false_alarms="pushdef(\`AC_BEFORE', \`')"
|
||||
|
||||
bogus_macros_check_output=`$ECHO "$clean_false_alarms" \
|
||||
|$M4 - aclocal.m4 libltdl/aclocal.m4 \
|
||||
|$SED -n "$bogus_macros_grep"`
|
||||
|
||||
exit_val=0
|
||||
for macro in $bogus_macros; do
|
||||
case $bogus_macros_check_output in
|
||||
*$macro*)
|
||||
func_error "Bogus $macro macro definition in an aclocal.m4 file"
|
||||
exit_val=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
exit $exit_val
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/perl -nl
|
||||
# Use Perl's multi-byte alignment code, via sprintf, while
|
||||
# performing a rudimentary check for duplicate names and
|
||||
# removing duplicate name,email pairs.
|
||||
use Encode;
|
||||
|
||||
BEGIN { my (%elide, %seen, %name) }
|
||||
|
||||
chomp;
|
||||
my ($name, $email) = split '\0', decode ('UTF-8', $_);
|
||||
|
||||
if ($elide{"!$name"}) {
|
||||
; # ignore this author
|
||||
} elsif (index ($name, '!') == 0) {
|
||||
$elide{$name}++;
|
||||
} elsif ($seen{$name}++) {
|
||||
warn "$0: NO-THANKS: duplicate name: $name\n";
|
||||
} else {
|
||||
print encode ('UTF-8', sprintf ('%-36s', $name)), $email;
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
# cfg.mk -- Configuration for maintainer-makefile
|
||||
#
|
||||
# Copyright (c) 2011-2019, 2021-2024 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2011
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
update-copyright-env := UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
|
||||
|
||||
update-copyright: update-release-year
|
||||
update-release-year:
|
||||
$(AM_V_GEN)year=`date +%Y`; \
|
||||
sed -i \
|
||||
-e "/_LT_COPY/,+1 { /Copyright/ {s:[0-9][0-9][0-9][0-9]:$$year:} }" \
|
||||
-e "/^Copyright/ {s:[0-9][0-9][0-9][0-9]:$$year:} " \
|
||||
m4/libtool.m4
|
||||
|
||||
# Set format of NEWS.
|
||||
old_NEWS_hash := 61ef5bb8af40dc806027f40d99f8c980
|
||||
|
||||
manual_title = Portable Dynamic Shared Object Management
|
||||
|
||||
# Set the release announcement email addresses, maint.mk will email the
|
||||
# translation-project instead of autotools-announce otherwise.
|
||||
ifeq ($(RELEASE_TYPE),stable)
|
||||
announcement_Cc_ = autotools-announce@gnu.org
|
||||
else
|
||||
announcement_Cc_ = autotools-announce@gnu.org, $(PACKAGE_BUGREPORT)
|
||||
endif
|
||||
|
||||
# Don't syntax check the mail subdirectory or patches to gnulib itself.
|
||||
VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(mail|gl)/
|
||||
|
||||
local-checks-to-fix = \
|
||||
sc_require_config_h \
|
||||
sc_require_config_h_first
|
||||
|
||||
local-checks-to-skip = \
|
||||
$(local-checks-to-fix) \
|
||||
sc_GPL_version \
|
||||
sc_cast_of_x_alloc_return_value \
|
||||
sc_indent \
|
||||
sc_prohibit_always-defined_macros \
|
||||
sc_prohibit_always_true_header_tests \
|
||||
sc_prohibit_strncpy \
|
||||
sc_trailing_blank \
|
||||
sc_unmarked_diagnostics
|
||||
|
||||
# GPL_version: checks for GPLv3, which we don't use
|
||||
# cast_of_x_alloc_return_value:
|
||||
# We support C++ compilation, which does require casting here.
|
||||
# prohibit_always-defined_macros:
|
||||
# we have our own argz and dirent, which use the same macros but
|
||||
# are not always-defined in our case.
|
||||
# prohibit_always_true_header_tests:
|
||||
# we have our own argz and dirent, which are not *always* true,
|
||||
# so the guards cannot be removed in our case.
|
||||
# prohibit_strncpy:
|
||||
# what's so bad about strncpy anyway?
|
||||
# trailing_blank: flags valid rfc3676 separators
|
||||
# unmarked_diagnostics: libtool isn't internationalized
|
||||
|
||||
|
||||
# Check for correct usage of $cc_basename in libtool.m4.
|
||||
sc_libtool_m4_cc_basename:
|
||||
@$(SED) -n "/case \\\$$cc_basename in/,/esac/ { \
|
||||
/^[ ]*[a-zA-Z][a-zA-Z0-9+]*[^*][ ]*)/p; \
|
||||
}" '$(srcdir)/$(macro_dir)/libtool.m4' | grep . && { \
|
||||
msg="\$$cc_basename matches should include a trailing '*'." \
|
||||
$(_sc_say_and_exit) } || :
|
||||
|
||||
# Check for old-style `quoting'.
|
||||
exclude_file_name_regexp--sc_old_style_quoting = (^bootstrap|^cfg.mk|\.texi)$$
|
||||
sc_old_style_quoting:
|
||||
@prohibit="^[^\`]*[^=]\`[^'\`]*[a-zA-Z0-9][^'\`]*'[^\`]*[^\\\`]$$" \
|
||||
halt="quote 'like this' not \`like this' in comments and output" \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for uses of Xsed without corresponding echo "X
|
||||
exclude_file_name_regexp--sc_prohibit_Xsed_without_X = ^cfg.mk$$
|
||||
sc_prohibit_Xsed_without_X:
|
||||
@files=$$($(VC_LIST_EXCEPT)); \
|
||||
if test -n "$$files"; then \
|
||||
grep -nE '\$$Xsed' $$files | grep -vE '(func_echo_all|\$$ECHO) \\*"X' && { \
|
||||
msg="occurrences of '\$$Xsed' without '\$$ECHO "\""X' on the same line" \
|
||||
$(_sc_say_and_exit) } || :; \
|
||||
else :; \
|
||||
fi || :
|
||||
|
||||
# Use a consistent dirname and basename idiom.
|
||||
sc_prohibit_bare_basename:
|
||||
@prohibit='\|[ ]*\$$(base|dir)name' \
|
||||
halt='use '\''|$$SED "$$basename"'\'' instead of '\''|$$basename'\' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit_basename_with_dollar_sed:
|
||||
@prohibit='(base|dir)name="?(\$$SED|sed)[ "]' \
|
||||
halt='use '\''basename='\''s|^.*/||'\'' instead of '\''basename="$$SED...' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for using '[' instead of 'test'.
|
||||
exclude_file_name_regexp--sc_prohibit_bracket_as_test = ^cfg.mk$$
|
||||
sc_prohibit_bracket_as_test:
|
||||
@prohibit='if[ ]+\[' \
|
||||
halt="use 'if test' instead of 'if ['" \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# : ${foo=`bar`} is not perfectly portable (see Shellology in autoconf's manual)
|
||||
exclude_file_name_regexp--sc_prohibit_command_in_subst = ^cfg.mk$$
|
||||
sc_prohibit_command_in_subst:
|
||||
@prohibit='\$$\{[^`}]*`[^`]*`[^}]*}' \
|
||||
halt='do not use `command` in $${ } substitution`' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for quotes within backquotes within quotes "`"bar"`"
|
||||
exclude_file_name_regexp--sc_prohibit_nested_quotes = ^cfg.mk$$
|
||||
sc_prohibit_nested_quotes:
|
||||
@prohibit='"[^`"]*`[^"`]*"[^"`]*".*`[^`"]*"' \
|
||||
halt='found nested double quotes' \
|
||||
$(_sc_search_regexp_or_exclude)
|
||||
|
||||
# Commas in filenames are quite common, so using them routinely for sed is
|
||||
# asking for trouble!
|
||||
sc_prohibit_sed_s_comma:
|
||||
@explicit='($$SED|sed)[ ]+(-e[ ]+)?['\''"]?s,' \
|
||||
implicit='['\''";][ ]*s,[^,]*,[^,]*,g?['\''";]' \
|
||||
literal='^[ ]*s,[^,]*,[^,]*,g?['\''";]?$$' \
|
||||
prohibit='('$$implicit'|'$$explicit'|'$$literal')' \
|
||||
halt='found use of comma separator in sed substitution' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for using shift after set dummy (same or following line).
|
||||
exclude_file_name_regexp--sc_prohibit_set_dummy_without_shift = ^cfg.mk$$
|
||||
sc_prohibit_set_dummy_without_shift:
|
||||
@files=$$($(VC_LIST_EXCEPT)); \
|
||||
if test -n "$$files"; then \
|
||||
grep -nE '(set dummy|shift)' $$files | \
|
||||
$(SED) -n "/set[ ][ ]*dummy/{ \
|
||||
/set.*dummy.*;.*shift/d; \
|
||||
N; \
|
||||
/\n.*shift/D; \
|
||||
p; \
|
||||
}" | grep -n . && { \
|
||||
msg="use 'shift' after 'set dummy'" \
|
||||
$(_sc_say_and_exit) } || :; \
|
||||
else :; \
|
||||
fi || :
|
||||
|
||||
# Check for using set -- instead of set dummy
|
||||
exclude_file_name_regexp--sc_prohibit_set_minus_minus = ^cfg.mk$$
|
||||
sc_prohibit_set_minus_minus:
|
||||
@prohibit='set[ ]+--[ ]+' \
|
||||
halt="use 'set dummy ...' instead of 'set -- ...'" \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Make sure there is no spurious whitespace before trailing semi-colons
|
||||
sc_prohibit_space_semicolon:
|
||||
@prohibit='[^ ][ ]+;[ ]*((do|done|elif|else|then)[ ]*)?$$' \
|
||||
halt='found spurious whitespace before trailing semi-colon' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for using test X"... instead of test "X...
|
||||
exclude_file_name_regexp--sc_prohibit_test_X = ^cfg.mk$$
|
||||
sc_prohibit_test_X:
|
||||
@prohibit='test[ ]+(![ ])?(-.[ ]+)?[Xx]["'\'']' \
|
||||
halt='use '\''test "X..."'\'' instead of '\''test X"'\' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for bad binary operators.
|
||||
sc_prohibit_test_binary_operators:
|
||||
@prohibit='if[ ]+["'\'']?\$$[^ ]+[ ]+(=|-[lg][te]|-eq|-ne)' \
|
||||
halt="Use 'if test \$$something =' instead of 'if \$$something ='" \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for using test $... instead of test "$...
|
||||
exclude_file_name_regexp--sc_prohibit_test_dollar = ^cfg.mk$$
|
||||
sc_prohibit_test_dollar:
|
||||
@prohibit='test[ ]+(![ ])?(-.[ ]+)?X?\$$[^?#]' \
|
||||
exclude='test \$${[A-Za-z_][A-Za-z0-9_]+\+y}' \
|
||||
halt='use '\''test "$$..."'\'' instead of '\''test $$'\' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Never use test -e.
|
||||
exclude_file_name_regexp--sc_prohibit_test_minus_e = ^cfg.mk$$
|
||||
sc_prohibit_test_minus_e:
|
||||
@prohibit='test[ ]+(![ ])?-e' \
|
||||
halt="use 'test -f' instead of 'test -e'" \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for bad unary operators.
|
||||
sc_prohibit_test_unary_operators:
|
||||
@prohibit='if[ ]+-[a-z]' \
|
||||
halt="use 'if test -X' instead of 'if -X'" \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Don't add noisy characters on the front of the left operand of a test
|
||||
# to prevent arguments being passed inadvertently (e.g. LHS is '-z'),
|
||||
# when the other operand is a constant -- just swap them, and remove the
|
||||
# spurious leading 'x'.
|
||||
sc_prohibit_test_const_follows_var:
|
||||
@var='[ ]+"[^$$"]*\$$[0-9A-Za-z_][^"]*"' \
|
||||
op='[ ]+(!?=|-[lgn][et]|-eq)' \
|
||||
const='[ ]+[^-$$][^$$; ]*' \
|
||||
prohibit='test'$$var$$op$$const'[ ]*(&&|\|\||;|\\?$$)' \
|
||||
halt='use '\''test a = "$$b"'\'' instead of '\''test "x$$b" = xa'\' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Check for opening brace on next line in shell function definition.
|
||||
exclude_file_name_regexp--sc_require_function_nl_brace = (^HACKING|\.[ch]|\.texi)$$
|
||||
sc_require_function_nl_brace:
|
||||
@for file in $$($(VC_LIST_EXCEPT)); do \
|
||||
$(SED) -n "/^func_[^ ]*[ ]*(/{ \
|
||||
N; \
|
||||
/^func_[^ ]* ()\n{$$/d; \
|
||||
p; \
|
||||
}" $$file | grep -E . && { \
|
||||
msg="found malformed function_definition in $$file" \
|
||||
$(_sc_say_and_exit) } || :; \
|
||||
done
|
||||
|
||||
sc_trailing_blank-non-rfc3676:
|
||||
@prohibit='([^-][^-][ ][ ]*|^[ ][ ]*)$$' \
|
||||
halt='found trailing blank(s)' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Avoid useless quotes around assignments with no shell metacharacters.
|
||||
# Backtick and dollar expansions are not resplit on the RHS of an
|
||||
# assignment, so those metachars are not listed in the prohibit regex,
|
||||
# although @ is listed, since it most likely indicates that something
|
||||
# will be spliced in before the shell executes, and it may need to be
|
||||
# quoted if it contains any metacharacters after splicing.
|
||||
define _sc_search_regexp_or_exclude
|
||||
files=$$($(VC_LIST_EXCEPT)); \
|
||||
if test -n "$$files"; then \
|
||||
grep -nE "$$prohibit" $$files | grep -v '## exclude from $@' \
|
||||
&& { msg="$$halt" $(_sc_say_and_exit) } || :; \
|
||||
else :; \
|
||||
fi || :;
|
||||
endef
|
||||
|
||||
exclude_file_name_regexp--sc_useless_braces_in_variable_derefs = \
|
||||
test-funclib-quote.sh$$
|
||||
sc_useless_braces_in_variable_derefs:
|
||||
@prohibit='\$${[0-9A-Za-z_]+}[^0-9A-Za-z_]' \
|
||||
halt='found spurious braces around variable dereference' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_useless_quotes_in_assignment:
|
||||
@prohibit='^[ ]*[A-Za-z_][A-Za-z0-9_]*="[^ !#&()*;<>?@~^{|}]*"$$' \
|
||||
halt='found spurious quotes around assignment value' \
|
||||
$(_sc_search_regexp_or_exclude)
|
||||
|
||||
# Avoid useless quotes around case arguments such as:
|
||||
# case "$foo" in ...
|
||||
exclude_file_name_regexp--sc_useless_quotes_in_case = ^cfg.mk$$
|
||||
sc_useless_quotes_in_case:
|
||||
@prohibit='case "[^ "]*"[ ][ ]*in' \
|
||||
halt='found spurious quotes around case argument' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# List syntax-check exempted files.
|
||||
exclude_file_name_regexp--sc_prohibit_strcmp = \
|
||||
^doc/libtool.texi$$
|
||||
exclude_file_name_regexp--sc_prohibit_test_minus_ao = \
|
||||
^m4/libtool.m4$$
|
||||
exclude_file_name_regexp--sc_space_tab = (\.diff|test-funclib-quote.sh)$$
|
||||
exclude_file_name_regexp--sc_trailing_blank-non-rfc3676 = \.diff$$
|
||||
@@ -0,0 +1,183 @@
|
||||
# Process this file with autoconf to create configure. -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2004-2005, 2008, 2010-2019, 2021-2024 Free
|
||||
# Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2001
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
||||
####
|
||||
|
||||
|
||||
AC_PREREQ(2.64)
|
||||
dnl Oldest automake required for bootstrap is below in AM_INIT_AUTOMAKE.
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
## Autoconf initialisation. ##
|
||||
## ------------------------ ##
|
||||
AC_INIT([GNU Libtool],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[bug-libtool@gnu.org])
|
||||
m4_ifndef([AC_PACKAGE_URL],
|
||||
[AC_SUBST([PACKAGE_URL], [https://www.gnu.org/s/libtool/])])
|
||||
|
||||
# Remove this when a released Autoconf is capable of bootstrapping
|
||||
# Libtool without it (probably after autoconf-2.70).
|
||||
m4_ifndef([AC_CONFIG_MACRO_DIRS],
|
||||
[m4_define([AC_CONFIG_MACRO_DIRS], m4_defn([AC_CONFIG_MACRO_DIR]))])
|
||||
|
||||
# Since we already declare these directories in this file, save those
|
||||
# choices, and push the results into Makefile.am to avoid declaring
|
||||
# them in two places making renames error prone, and where copies
|
||||
# might get out of sync.
|
||||
m4_define([AC_CONFIG_AUX_DIR],
|
||||
m4_defn([AC_CONFIG_AUX_DIR])[AC_SUBST([aux_dir], [$1])])
|
||||
m4_define([LT_CONFIG_LTDL_DIR],
|
||||
m4_defn([LT_CONFIG_LTDL_DIR])[AC_SUBST([ltdl_dir], [$1])])
|
||||
m4_define([AC_CONFIG_MACRO_DIRS],
|
||||
m4_defn([AC_CONFIG_MACRO_DIRS])[AC_SUBST([macro_dir], [$1])])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h:config-h.in])
|
||||
AC_CONFIG_SRCDIR([libtoolize.in])
|
||||
LT_CONFIG_LTDL_DIR([libltdl], [nonrecursive])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
AC_CONFIG_LIBOBJ_DIR([libltdl])
|
||||
|
||||
package_revision=`$SHELL $ac_aux_dir/git-version-gen .tarball-version`
|
||||
AC_SUBST([package_revision])
|
||||
|
||||
## ------------------------ ##
|
||||
## Autotest initialisation. ##
|
||||
## ------------------------ ##
|
||||
|
||||
AC_CONFIG_TESTDIR([tests])
|
||||
AC_SUBST([AUTOM4TE], [${AUTOM4TE=autom4te}])
|
||||
AC_SUBST([AUTOTEST], ['$(AUTOM4TE) --language=autotest'])
|
||||
|
||||
|
||||
## ---------------------------------------- ##
|
||||
## Display a configure time version banner. ##
|
||||
## ---------------------------------------- ##
|
||||
|
||||
# This is a sanity check so we can see what version is used in bug reports.
|
||||
AS_BOX([Configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION])
|
||||
echo
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Shell tools. ##
|
||||
## ------------ ##
|
||||
|
||||
AC_PROG_GNU_M4
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
## Automake Initialisation. ##
|
||||
## ------------------------ ##
|
||||
|
||||
dnl These are bootstrap requirements! Once built, libtool may work with
|
||||
dnl much older releases of autoconf and automake. See release notes.
|
||||
dnl 1.11 is needed for color-tests, 1.11.1 fixes a security issue.
|
||||
AM_INIT_AUTOMAKE([1.11.1 gnu subdir-objects dist-xz])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Autobuild initialisation. ##
|
||||
## ------------------------- ##
|
||||
|
||||
# You can set autobuild_mode at configure time to specify a "unique"
|
||||
# string for this build.
|
||||
: ${autobuild_mode=default}
|
||||
AB_VERSION='AC_PACKAGE_VERSION'
|
||||
AB_INIT([$autobuild_mode])
|
||||
|
||||
|
||||
dnl Make sure config.status is regenerated when the version timestamp changes
|
||||
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(dotversion)'])
|
||||
|
||||
|
||||
## ------------------------------- ##
|
||||
## Libtool specific configuration. ##
|
||||
## ------------------------------- ##
|
||||
|
||||
AC_SUBST([aclocaldir], ["\$(datadir)/aclocal"])
|
||||
AC_SUBST([pkgdatadir], ["\$(datadir)/$PACKAGE"])
|
||||
|
||||
AC_ARG_ENABLE(ltdl-install,
|
||||
[AS_HELP_STRING([--disable-ltdl-install], [do not install libltdl])])
|
||||
if test set != "${enable_ltdl_install+set}"; then
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
|
||||
# The list of scripts required to build libltdl, and which need to be
|
||||
# installed by libtoolize --ltdl, and consequently need to be placed in
|
||||
# $pkgdatadir by our make install rule.
|
||||
pkgaux_scripts="compile config.guess config.sub depcomp install-sh missing"
|
||||
AC_SUBST([pkgaux_scripts])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## compiler checks. ##
|
||||
## ---------------- ##
|
||||
|
||||
# Need to be sure that we have a working C compiler, otherwise even with
|
||||
# a good C compiler: if the following C++ tests fail, the whole libtool
|
||||
# build fails!
|
||||
AC_PROG_CC
|
||||
GL_EARLY
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CPP
|
||||
|
||||
## ----------------------- ##
|
||||
## Libtool initialisation. ##
|
||||
## ----------------------- ##
|
||||
LT_INIT([dlopen win32-dll])
|
||||
_LT_SET_OPTION([LTDL_INIT], [nonrecursive])
|
||||
_LTDL_SETUP
|
||||
|
||||
# Enable all the language support we can
|
||||
LT_LANG(C++)
|
||||
LT_LANG(Fortran 77)
|
||||
LT_LANG(Fortran)
|
||||
LT_LANG(Go)
|
||||
LT_LANG(Java)
|
||||
LT_LANG(Windows Resource)
|
||||
|
||||
# Ensure the correct file name (and path) conversion function
|
||||
# is available to the test suite.
|
||||
AC_SUBST([to_host_file_cmd])dnl
|
||||
AC_SUBST([to_tool_file_cmd])dnl
|
||||
|
||||
# Propagate --enable-aix-soname option to the testsuite.
|
||||
AC_SUBST([with_aix_soname])dnl
|
||||
|
||||
## ---------------------- ##
|
||||
## Gnulib initialisation. ##
|
||||
## ---------------------- ##
|
||||
GL_INIT
|
||||
|
||||
## ------------- ##
|
||||
## Documentation ##
|
||||
## ------------- ##
|
||||
AM_MISSING_PROG([HELP2MAN], [help2man])
|
||||
|
||||
## -------- ##
|
||||
## Outputs. ##
|
||||
## -------- ##
|
||||
AC_CONFIG_FILES([Makefile gnulib-tests/Makefile])
|
||||
AC_OUTPUT
|
||||
@@ -0,0 +1,8 @@
|
||||
/*.1
|
||||
/*.html
|
||||
/fdl.texi
|
||||
/gendocs_template
|
||||
/manual
|
||||
/notes.txt
|
||||
/version.texi
|
||||
/gendocs_template_min
|
||||
@@ -0,0 +1,162 @@
|
||||
-------------------------------------------------------
|
||||
canonical host name compiler libtool results
|
||||
(tools versions) release
|
||||
-------------------------------------------------------
|
||||
alpha-dec-osf5.1 cc 1.3e ok (1.910)
|
||||
alpha-dec-osf4.0f gcc 1.3e ok (1.910)
|
||||
alpha-dec-osf4.0f cc 1.3e ok (1.910)
|
||||
alpha-dec-osf3.2 gcc 0.8 ok
|
||||
alpha-dec-osf3.2 cc 0.8 ok
|
||||
alpha-dec-osf2.1 gcc 1.2f NS
|
||||
alpha*-unknown-linux-gnu gcc 1.3b ok
|
||||
(egcs-1.1.2, GNU ld 2.9.1.0.23)
|
||||
hppa2.0w-hp-hpux11.00 cc 1.2f ok
|
||||
hppa2.0-hp-hpux10.20 cc 1.3.2 ok
|
||||
hppa1.1-hp-hpux10.20 gcc 1.2f ok
|
||||
hppa1.1-hp-hpux10.20 cc 1.3c ok (1.821)
|
||||
hppa1.1-hp-hpux10.10 gcc 1.2f ok
|
||||
hppa1.1-hp-hpux10.10 cc 1.2f ok
|
||||
hppa1.1-hp-hpux9.07 gcc 1.2f ok
|
||||
hppa1.1-hp-hpux9.07 cc 1.2f ok
|
||||
hppa1.1-hp-hpux9.05 gcc 1.2f ok
|
||||
hppa1.1-hp-hpux9.05 cc 1.2f ok
|
||||
hppa1.1-hp-hpux9.01 gcc 1.2f ok
|
||||
hppa1.1-hp-hpux9.01 cc 1.2f ok
|
||||
i*86-*-beos gcc 1.2f ok
|
||||
i*86-*-bsdi4.0.1 gcc 1.3c ok
|
||||
(gcc-2.7.2.1)
|
||||
i*86-*-bsdi4.0 gcc 1.2f ok
|
||||
i*86-*-bsdi3.1 gcc 1.2e NS
|
||||
i*86-*-bsdi3.0 gcc 1.2e NS
|
||||
i*86-*-bsdi2.1 gcc 1.2e NS
|
||||
i*86-pc-cygwin gcc 1.3b NS
|
||||
(egcs-1.1 stock b20.1 compiler)
|
||||
i*86-*-dguxR4.20MU01 gcc 1.2 ok
|
||||
i*86-*-freebsd4.3 gcc 1.3e ok (1.912)
|
||||
i*86-*-freebsdelf4.0 gcc 1.3c ok
|
||||
(egcs-1.1.2)
|
||||
i*86-*-freebsdelf3.2 gcc 1.3c ok
|
||||
(gcc-2.7.2.1)
|
||||
i*86-*-freebsdelf3.1 gcc 1.3c ok
|
||||
(gcc-2.7.2.1)
|
||||
i*86-*-freebsdelf3.0 gcc 1.3c ok
|
||||
i*86-*-freebsd3.0 gcc 1.2e ok
|
||||
i*86-*-freebsd2.2.8 gcc 1.3c ok
|
||||
(gcc-2.7.2.1)
|
||||
i*86-*-freebsd2.2.6 gcc 1.3b ok
|
||||
(egcs-1.1 & gcc-2.7.2.1, native ld)
|
||||
i*86-*-freebsd2.1.5 gcc 0.5 ok
|
||||
i*86-*-netbsd1.5 gcc 1.3e ok (1.901)
|
||||
(egcs-1.1.2)
|
||||
i*86-*-netbsd1.4 gcc 1.3c ok
|
||||
(egcs-1.1.1)
|
||||
i*86-*-netbsd1.4.3A gcc 1.3e ok (1.901)
|
||||
i*86-*-netbsd1.3.3 gcc 1.3c ok
|
||||
(gcc-2.7.2.2+myc2)
|
||||
i*86-*-netbsd1.3.2 gcc 1.2e ok
|
||||
i*86-*-netbsd1.3I gcc 1.2e ok
|
||||
(egcs 1.1?)
|
||||
i*86-*-netbsd1.2 gcc 0.9g ok
|
||||
i*86-*-linux-gnu gcc 1.3e ok (1.901)
|
||||
(Red Hat 7.0, gcc "2.96")
|
||||
i*86-*-linux-gnu gcc 1.3e ok (1.911)
|
||||
(SuSE 7.0, gcc 2.95.2)
|
||||
i*86-*-linux-gnulibc1 gcc 1.2f ok
|
||||
i*86-*-openbsd2.5 gcc 1.3c ok
|
||||
(gcc-2.8.1)
|
||||
i*86-*-openbsd2.4 gcc 1.3c ok
|
||||
(gcc-2.8.1)
|
||||
i*86-*-solaris2.7 gcc 1.3b ok
|
||||
(egcs-1.1.2, native ld)
|
||||
i*86-*-solaris2.6 gcc 1.2f ok
|
||||
i*86-*-solaris2.5.1 gcc 1.2f ok
|
||||
i*86-ncr-sysv4.3.03 gcc 1.2f ok
|
||||
i*86-ncr-sysv4.3.03 cc 1.2e ok
|
||||
(cc -Hnocopyr)
|
||||
i*86-pc-sco3.2v5.0.5 cc 1.3c ok
|
||||
i*86-pc-sco3.2v5.0.5 gcc 1.3c ok
|
||||
(gcc 95q4c)
|
||||
i*86-pc-sco3.2v5.0.5 gcc 1.3c ok
|
||||
(egcs-1.1.2)
|
||||
i*86-sco-sysv5uw7.1.1 gcc 1.3e ok (1.901)
|
||||
(gcc-2.95.2, SCO linker)
|
||||
i*86-UnixWare7.1.0-sysv5 cc 1.3c ok
|
||||
i*86-UnixWare7.1.0-sysv5 gcc 1.3c ok
|
||||
(egcs-1.1.1)
|
||||
m68k-next-nextstep3 gcc 1.2f NS
|
||||
m68k-sun-sunos4.1.1 gcc 1.2f NS
|
||||
(gcc-2.5.7)
|
||||
m88k-dg-dguxR4.12TMU01 gcc 1.2 ok
|
||||
m88k-motorola-sysv4 gcc 1.3 ok
|
||||
(egcs-1.1.2)
|
||||
mips-sgi-irix6.5 gcc 1.2f ok
|
||||
(gcc-2.8.1)
|
||||
mips-sgi-irix6.4 gcc 1.2f ok
|
||||
mips-sgi-irix6.3 gcc 1.3b ok
|
||||
(egcs-1.1.2, native ld)
|
||||
mips-sgi-irix6.3 cc 1.3b ok
|
||||
(cc 7.0)
|
||||
mips-sgi-irix6.2 gcc 1.2f ok
|
||||
mips-sgi-irix6.2 cc 0.9 ok
|
||||
mips-sgi-irix5.3 gcc 1.2f ok
|
||||
(egcs-1.1.1)
|
||||
mips-sgi-irix5.3 gcc 1.2f NS
|
||||
(gcc-2.6.3)
|
||||
mips-sgi-irix5.3 cc 0.8 ok
|
||||
mips-sgi-irix5.2 gcc 1.3b ok
|
||||
(egcs-1.1.2, native ld)
|
||||
mips-sgi-irix5.2 cc 1.3b ok
|
||||
(cc 3.18)
|
||||
mips-sni-sysv4 cc 1.3.5 ok
|
||||
(Siemens C-compiler)
|
||||
mips-sni-sysv4 gcc 1.3.5 ok
|
||||
(gcc-2.7.2.3, GNU assembler 2.8.1, native ld)
|
||||
mipsel-unknown-openbsd2.1 gcc 1.0 ok
|
||||
powerpc-apple-darwin6.4 gcc 1.5 ok
|
||||
(apple dev tools released 12/2002)
|
||||
powerpc-ibm-aix4.3.1.0 gcc 1.2f ok
|
||||
(egcs-1.1.1)
|
||||
powerpc-ibm-aix4.2.1.0 gcc 1.2f ok
|
||||
(egcs-1.1.1)
|
||||
powerpc-ibm-aix4.1.5.0 gcc 1.2f ok
|
||||
(egcs-1.1.1)
|
||||
powerpc-ibm-aix4.1.5.0 gcc 1.2f NS
|
||||
(gcc-2.8.1)
|
||||
powerpc-ibm-aix4.1.4.0 gcc 1.0 ok
|
||||
powerpc-ibm-aix4.1.4.0 xlc 1.0i ok
|
||||
rs6000-ibm-aix4.1.5.0 gcc 1.2f ok
|
||||
(gcc-2.7.2)
|
||||
rs6000-ibm-aix4.1.4.0 gcc 1.2f ok
|
||||
(gcc-2.7.2)
|
||||
rs6000-ibm-aix3.2.5 gcc 1.0i ok
|
||||
rs6000-ibm-aix3.2.5 xlc 1.0i ok
|
||||
sparc-sun-solaris2.8 gcc 1.3e ok (1.913)
|
||||
(gcc-2.95.3 & native ld)
|
||||
sparc-sun-solaris2.7 gcc 1.3e ok (1.913)
|
||||
(gcc-2.95.3 & native ld)
|
||||
sparc-sun-solaris2.6 gcc 1.3e ok (1.913)
|
||||
(gcc-2.95.3 & native ld)
|
||||
sparc-sun-solaris2.5.1 gcc 1.3e ok (1.911)
|
||||
sparc-sun-solaris2.5 gcc 1.3b ok
|
||||
(egcs-1.1.2, GNU ld 2.9.1 & native ld)
|
||||
sparc-sun-solaris2.5 cc 1.3b ok
|
||||
(SC 3.0.1)
|
||||
sparc-sun-solaris2.4 gcc 1.0a ok
|
||||
sparc-sun-solaris2.4 cc 1.0a ok
|
||||
sparc-sun-solaris2.3 gcc 1.2f ok
|
||||
sparc-sun-sunos4.1.4 gcc 1.2f ok
|
||||
sparc-sun-sunos4.1.4 cc 1.0f ok
|
||||
sparc-sun-sunos4.1.3_U1 gcc 1.2f ok
|
||||
sparc-sun-sunos4.1.3C gcc 1.2f ok
|
||||
sparc-sun-sunos4.1.3 gcc 1.3b ok
|
||||
(egcs-1.1.2, GNU ld 2.9.1 & native ld)
|
||||
sparc-sun-sunos4.1.3 cc 1.3b ok
|
||||
sparc-unknown-bsdi4.0 gcc 1.2c ok
|
||||
sparc-unknown-linux-gnulibc1 gcc 1.2f ok
|
||||
sparc-unknown-linux-gnu gcc 1.3b ok
|
||||
(egcs-1.1.2, GNU ld 2.9.1.0.23)
|
||||
sparc64-unknown-linux-gnu gcc 1.2f ok
|
||||
|
||||
Notes:
|
||||
- "ok" means "all tests passed".
|
||||
- "NS" means "Not Shared", but OK for static libraries
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,85 @@
|
||||
@itemize
|
||||
|
||||
@item
|
||||
You currently need GNU make to build the Libtool package itself.
|
||||
|
||||
@item
|
||||
On AIX there are two different styles of shared linking, one where symbols
|
||||
are bound at link-time and one where symbols are bound at runtime only,
|
||||
similar to ELF@. In case of doubt use @code{LDFLAGS=-Wl,-brtl} for the latter style.
|
||||
|
||||
@item
|
||||
On AIX, native tools are to be preferred over binutils; especially for C++ code,
|
||||
if using the AIX Toolbox GCC 4.0 and binutils, configure with
|
||||
@code{AR=/usr/bin/ar LD=/usr/bin/ld NM='/usr/bin/nm -B'}.
|
||||
|
||||
@item
|
||||
On AIX, the @command{/bin/sh} is very slow due to its inefficient handling
|
||||
of here-documents. A modern shell is preferable:
|
||||
@example
|
||||
CONFIG_SHELL=/bin/bash; export $CONFIG_SHELL
|
||||
$CONFIG_SHELL ./configure [...]
|
||||
@end example
|
||||
|
||||
@item
|
||||
For C++ code with templates, it may be necessary to specify the way the compiler
|
||||
will generate the instantiations. For Portland pgCC version5, use
|
||||
@code{CXX='pgCC --one_instantiation_per_object'} and avoid parallel @command{make}.
|
||||
|
||||
@item
|
||||
For C++ code, it may be necessary to specify a library if it is a dependency
|
||||
of a link/compile flag. For example in GNU G++, if you want to use
|
||||
@code{-fsanitize=address} you need to specify the @code{-lasan} library,
|
||||
like so: @code{g++ -o libx.la -fsanitize=address -lasan -rpath [...]}.
|
||||
|
||||
@item
|
||||
On Darwin, for C++ code with templates you need two level shared libraries.
|
||||
Libtool builds these by default if @env{MACOSX_DEPLOYMENT_TARGET} is set to
|
||||
10.3 or later at @command{configure} time. See @url{rdar://problem/4135857}
|
||||
for more information on this issue.
|
||||
|
||||
@c @item
|
||||
@c FreeBSD @command{make} does not conform to @sc{posix} in its handling
|
||||
@c of file modification times, which causes it to loop while building libtool.
|
||||
@c Consider using a different @command{such} as GNU make instead.
|
||||
|
||||
@item
|
||||
The default shell on UNICOS 9, a ksh 88e variant, is too buggy to
|
||||
correctly execute the libtool script. Users are advised to install a
|
||||
modern shell such as GNU bash.
|
||||
|
||||
@item
|
||||
Some HP-UX @command{sed} programs are horribly broken, and cannot handle
|
||||
libtool's requirements, so users may report unusual problems. There
|
||||
is no workaround except to install a working @command{sed} (such as GNU sed)
|
||||
on these systems.
|
||||
|
||||
@item
|
||||
The vendor-distributed NCR MP-RAS @command{cc} programs emits copyright
|
||||
on standard error that confuse tests on size of @file{conftest.err}. The
|
||||
workaround is to specify @env{CC} when run configure with
|
||||
@code{CC='cc -Hnocopyr'}.
|
||||
|
||||
@item
|
||||
Any earlier DG/UX system with ELF executables, such as R3.10 or
|
||||
R4.10, is also likely to work, but hasn't been explicitly tested.
|
||||
|
||||
@item
|
||||
On Reliant Unix libtool has only been tested with the Siemens C-compiler
|
||||
and an old version of @command{gcc} provided by Marco Walther.
|
||||
|
||||
@item
|
||||
@file{libtool.m4}, @file{ltdl.m4} and the @file{configure.ac} files are marked
|
||||
to use autoconf-mode, which is distributed with GNU Emacs 21, Autoconf itself,
|
||||
and all recent releases of XEmacs.
|
||||
|
||||
@item
|
||||
When building on some GNU/Linux systems for multilib targets @command{libtool}
|
||||
sometimes guesses the wrong paths that the linker and dynamic linker search by
|
||||
default. If this occurs for the dynamic library path, you may use the
|
||||
@code{LT_SYS_LIBRARY_PATH} environment variable to adjust. Otherwise, at
|
||||
@command{configure} time you may override libtool's guesses by setting the
|
||||
@command{autoconf} cache variables @code{lt_cv_sys_lib_search_path_spec} and
|
||||
@code{lt_cv_sys_lib_dlsearch_path_spec} respectively.
|
||||
|
||||
@end itemize
|
||||
@@ -0,0 +1,369 @@
|
||||
You must choose one of the two license texts below to apply when using
|
||||
or redistributing the files in this software project:
|
||||
|
||||
------------------------------------------------------------------------
|
||||
<https://opensource.org/licenses/MIT>
|
||||
|
||||
Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGE-
|
||||
MENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
<https://www.gnu.org/licenses/gpl-2.0.html>
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,101 @@
|
||||
BOOTSTRAP
|
||||
=========
|
||||
|
||||
Run all the Autotools scripts in a sane order according to the contents
|
||||
of `configure.ac` (or `configure.in`) and `Makefile.am` (if any).
|
||||
|
||||
This is a complete rewrite of the [GNU Gnulib][] `bootstrap` script, for
|
||||
figuring out what autotools need to be run, in what order, and with what
|
||||
arguments to bootstrap a newly checked out working copy. This version is
|
||||
much more robust, a lot more user friendly, slightly faster, and a little
|
||||
more portable than the GNU version. It's also quite a lot larger than
|
||||
the GNU implementation.
|
||||
|
||||
The original idea behind the rewrite is that the incumbent Gnulib
|
||||
implementation was not flexible enough to bootstrap either of GNU M4,
|
||||
nor GNU Libtool - and rather than copying and editing the upstream
|
||||
version and merging changes back downstream as bugs were found and
|
||||
squashed, I decided the neighbourly thing to do would be to rewrite the
|
||||
whole messy thing with it's accreted features and piecemeal merges from
|
||||
other projects with scriptable extensibility designed in from the
|
||||
outset.
|
||||
|
||||
This version was never merged back into gnulib proper, where the feature
|
||||
accreted incumbent script still resides (albeit carrying fixes to many of
|
||||
the outright bugs and misfeatures fixed by this version). However, I've
|
||||
found this version considerably more reliable, and infinitely more
|
||||
malleable when it comes to extending the existing functionality for the
|
||||
unusual requirements of other projects that the Gnulib `bootstrap` cannot
|
||||
handle. It is very widely deployed, and extremely well tested in all of
|
||||
my own projects, and many others besides.
|
||||
|
||||
Thanks
|
||||
------
|
||||
|
||||
My sincere thanks to Pavel Raiskup for considerable help in speeding up
|
||||
the hook functions mechanism and the quote for re-evaluation functions
|
||||
at the core of these shell scripts.
|
||||
|
||||
My sincere thanks also to Bruno Haible, Jim Meyering and Paul Eggert on
|
||||
the gnulib developers list for encouragement and input during the design
|
||||
and implementation stages.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
There are two ways to incorporate this bootstrap into your own projects:
|
||||
|
||||
1. If your project already uses [GNU Gnulib], then you can copy this
|
||||
entire repository into your project, let's say under
|
||||
`gl-mod/bootstrap` directory. If you are using the `git` version control
|
||||
system, you are encouraged to add this source repository as a
|
||||
[git submodule][] instead of copying it:
|
||||
|
||||
`git submodule add -- https://github.com/gnulib-modules/bootstrap.git gl-mod/bootstrap`
|
||||
|
||||
This configuration options should be added into your project's
|
||||
`bootstrap.conf` file:
|
||||
|
||||
* Specify `local_gl_path=gl-mod/bootstrap` option. This causes that
|
||||
`gnulib-tool` will be automatically called with
|
||||
`--local-dir gl-mod/bootstrap` option.
|
||||
|
||||
* Add `bootstrap` to `gnulib_modules` option.
|
||||
|
||||
* If your project already uses some other gnulib's local override
|
||||
directories, simply mention those directories in `local_gl_path` too (colon
|
||||
separated list of directories), for example
|
||||
`local_gl_path=gl-local:gl-mod/bootstrap.
|
||||
|
||||
* (Only) if you added this `bootstrap` repository as a git submodule, you
|
||||
want to let it be automatically initialized during the first `./bootstrap`
|
||||
invocation. To achieve this, use `gnulib_git_submodules=gl-mod/bootstrap`
|
||||
option.
|
||||
|
||||
Initialise your actual bootstrap script from the subproject with:
|
||||
|
||||
```
|
||||
aux_src=gl-mod/bootstrap/build-aux
|
||||
$aux_src/inline-source $aux_src/bootstrap.in > bootstrap
|
||||
chmod +x bootstrap
|
||||
```
|
||||
|
||||
The resulting script will then keep track of changes to the
|
||||
subproject and warn you of upstream changes.
|
||||
|
||||
2. You can simply copy the top-level `bootstrap` script (which is
|
||||
pregenerated whenever the constituent scripts are updated) directly
|
||||
into the top-level directory of your project, and update it manually
|
||||
whenever necessary.
|
||||
|
||||
Either way, once you have installed `bootstrap`, use it to run the
|
||||
appropriate project-specific autotools and customisations with
|
||||
`./bootstrap`.
|
||||
|
||||
You can customize the behaviour of this script with a `bootstrap.conf` file,
|
||||
as described in the `bootstrap.texi` documentation, and the bootstrap
|
||||
script itself.
|
||||
|
||||
|
||||
[gnu gnulib]: http://gnu.org/s/gnulib
|
||||
[git submodule]: https://git-scm.com/docs/git-submodule
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,486 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Extract macro arguments from autotools input with GNU M4.
|
||||
# Written by Gary V. Vaughan, 2010
|
||||
#
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
# Make sure we've evaluated scripts we depend on.
|
||||
test -z "$progpath" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh
|
||||
test extract-trace = "$progname" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/options-parser
|
||||
|
||||
# Set a version string.
|
||||
scriptversion=2019-02-19.15; # UTC
|
||||
|
||||
|
||||
## ------ ##
|
||||
## Usage. ##
|
||||
## ------ ##
|
||||
|
||||
# Run './extract-trace --help' for help with using this script from the
|
||||
# command line.
|
||||
#
|
||||
# Or source first 'options-parser' and then this file into your own
|
||||
# scripts in order to make use of the function and variable framework
|
||||
# they define, and also to avoid the overhead of forking to run this
|
||||
# script in its own process on every call.
|
||||
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Helper functions. ##
|
||||
## ----------------- ##
|
||||
|
||||
# This section contains the helper functions used by the rest of
|
||||
# 'extract-trace'.
|
||||
|
||||
|
||||
# func_autoconf_configure MAYBE-CONFIGURE-FILE
|
||||
# --------------------------------------------
|
||||
# Ensure that MAYBE-CONFIGURE-FILE is the name of a file in the current
|
||||
# directory that contains an uncommented call to AC_INIT.
|
||||
func_autoconf_configure ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
_G_sed_no_comment='
|
||||
s|#.*$||
|
||||
s|^dnl .*$||
|
||||
s| dnl .*$||'
|
||||
_G_ac_init=
|
||||
|
||||
# If we were passed a genuine file, make sure it calls AC_INIT.
|
||||
test -f "$1" \
|
||||
&& _G_ac_init=`$SED "$_G_sed_no_comment" "$1" |$GREP AC_INIT`
|
||||
|
||||
# Otherwise it is not a genuine Autoconf input file.
|
||||
test -n "$_G_ac_init"
|
||||
_G_status=$?
|
||||
|
||||
test 0 -ne "$_G_status" \
|
||||
&& func_verbose "'$1' not using Autoconf"
|
||||
|
||||
(exit $_G_status)
|
||||
}
|
||||
|
||||
|
||||
# func_tool_version_output CMD [FATAL-ERROR-MSG]
|
||||
# ----------------------------------------------
|
||||
# Attempt to run 'CMD --version', discarding errors. The output can be
|
||||
# ignored by redirecting stdout, and this function used simply to test
|
||||
# whether the command exists and exits normally when passed a
|
||||
# '--version' argument.
|
||||
# When FATAL-ERROR-MSG is given, then this function will display the
|
||||
# message and exit if running 'CMD --version' returns a non-zero exit
|
||||
# status.
|
||||
func_tool_version_output ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
_G_cmd=$1
|
||||
_G_fatal_error_msg=$2
|
||||
|
||||
# Some tools, like 'git2cl' produce thousands of lines of output
|
||||
# unless stdin is /dev/null - in that case we want to return
|
||||
# successfully without saving all of that output. Other tools,
|
||||
# such as 'help2man' exit with a non-zero status when stdin comes
|
||||
# from /dev/null, so we re-execute without /dev/null if that
|
||||
# happens. This means that occasionally, the output from both calls
|
||||
# ends up in the result, but the alternative would be to discard the
|
||||
# output from one call, and hope the other produces something useful.
|
||||
{ $_G_cmd --version </dev/null || $_G_cmd --version; } 2>/dev/null
|
||||
_G_status=$?
|
||||
|
||||
test 0 -ne "$_G_status" && test -n "$_G_fatal_error_msg" \
|
||||
&& func_fatal_error "$_G_fatal_error_msg"
|
||||
|
||||
(exit $_G_status)
|
||||
}
|
||||
|
||||
|
||||
# func_tool_version_number CMD [FATAL-ERROR-MSG]
|
||||
# ----------------------------------------------
|
||||
# Pass arguments to func_tool_version_output, but set
|
||||
# $func_tool_version_number_result to the last dot delimited digit string
|
||||
# on the first line of output.
|
||||
func_tool_version_number ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
_G_verout=`func_tool_version_output "$@"`
|
||||
_G_status=$?
|
||||
|
||||
# A version number starts with a digit following a space on the first
|
||||
# line of output from `--version`.
|
||||
_G_verout=`echo "$_G_verout" |sed 1q`
|
||||
if test -n "$_G_verout"; then
|
||||
_G_vernum=`expr "$_G_verout" : '.* \([0-9][^ ]*\)'`
|
||||
fi
|
||||
|
||||
if test -n "$_G_vernum"; then
|
||||
printf '%s\n' "$_G_vernum"
|
||||
else
|
||||
printf '%s\n' "$_G_verout"
|
||||
fi
|
||||
|
||||
(exit $_G_status)
|
||||
}
|
||||
|
||||
|
||||
# func_find_tool ENVVAR NAMES...
|
||||
# ------------------------------
|
||||
# Search for a required program. Use the value of ENVVAR, if set,
|
||||
# otherwise find the first of the NAMES that can be run (i.e.,
|
||||
# supports --version). If found, set ENVVAR to the program name,
|
||||
# die otherwise.
|
||||
func_find_tool ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
_G_find_tool_envvar=$1
|
||||
shift
|
||||
_G_find_tool_names=$@
|
||||
eval "_G_find_tool_res=\$$_G_find_tool_envvar"
|
||||
if test -n "$_G_find_tool_res"; then
|
||||
_G_find_tool_error_prefix="\$$find_tool_envvar: "
|
||||
else
|
||||
_G_find_tool_res=
|
||||
_G_bestver=
|
||||
for _G_prog
|
||||
do
|
||||
_G_find_tool_save_IFS=$IFS
|
||||
IFS=${PATH_SEPARATOR-:}
|
||||
for _G_dir in $PATH; do
|
||||
IFS=$_G_find_tool_save_IFS
|
||||
_G_progpath=$_G_dir/$_G_prog
|
||||
test -r "$_G_progpath" && {
|
||||
_G_curver=`func_tool_version_number $_G_progpath`
|
||||
case $_G_bestver,$_G_curver in
|
||||
,)
|
||||
# first non--version responsive prog sticks!
|
||||
test -n "$_G_progpath" || _G_find_tool_res=$_G_progpath
|
||||
;;
|
||||
,*)
|
||||
# first --version responsive prog beats non--version responsive!
|
||||
_G_find_tool_res=$_G_progpath
|
||||
_G_bestver=$_G_curver
|
||||
;;
|
||||
*,*)
|
||||
# another --version responsive prog must be newer to beat previous one!
|
||||
test "x$_G_curver" = "x$_G_bestver" \
|
||||
|| func_lt_ver "$_G_curver" "$_G_bestver" \
|
||||
|| {
|
||||
_G_find_tool_res=$_G_progpath
|
||||
_G_bestver=$_G_curver
|
||||
}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
done
|
||||
IFS=$_G_find_tool_save_IFS
|
||||
done
|
||||
fi
|
||||
if test -n "$_G_find_tool_res"; then
|
||||
func_tool_version_number >/dev/null $_G_find_tool_res "\
|
||||
${_G_find_tool_error_prefix}Cannot run '$_G_find_tool_res --version'"
|
||||
|
||||
# Make sure the result is exported to the environment for children
|
||||
# to use.
|
||||
eval "$_G_find_tool_envvar=\$_G_find_tool_res"
|
||||
eval "export $_G_find_tool_envvar"
|
||||
else
|
||||
func_error "\
|
||||
One of these is required:
|
||||
$_G_find_tool_names"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
## Resource management. ##
|
||||
## -------------------- ##
|
||||
|
||||
# This section contains definitions for functions that each ensure a
|
||||
# particular resource (a file, or a non-empty configuration variable for
|
||||
# example) is available, and if appropriate to extract default values
|
||||
# from pertinent package files. Where a variable already has a non-
|
||||
# empty value (as set by the package's 'bootstrap.conf'), that value is
|
||||
# used in preference to deriving the default. Call them using their
|
||||
# associated 'require_*' variable to ensure that they are executed, at
|
||||
# most, once.
|
||||
#
|
||||
# It's entirely deliberate that calling these functions can set
|
||||
# variables that don't obey the namespace limitations obeyed by the rest
|
||||
# of this file, in order that that they be as useful as possible to
|
||||
# callers.
|
||||
|
||||
|
||||
# require_configure_ac
|
||||
# --------------------
|
||||
# Ensure that there is a 'configure.ac' or 'configure.in' file in the
|
||||
# current directory that contains an uncommented call to AC_INIT, and
|
||||
# that '$configure_ac' contains its name.
|
||||
require_configure_ac=func_require_configure_ac
|
||||
func_require_configure_ac ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
test -z "$configure_ac" \
|
||||
&& func_autoconf_configure configure.ac && configure_ac=configure.ac
|
||||
test -z "$configure_ac" \
|
||||
&& func_autoconf_configure configure.in && configure_ac=configure.in
|
||||
test -z "$configure_ac" \
|
||||
|| func_verbose "found '$configure_ac'"
|
||||
|
||||
require_configure_ac=:
|
||||
}
|
||||
|
||||
|
||||
# require_gnu_m4
|
||||
# --------------
|
||||
# Search for GNU M4, and export it in $M4.
|
||||
require_gnu_m4=func_require_gnu_m4
|
||||
func_require_gnu_m4 ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
test -n "$M4" || {
|
||||
# Find the first m4 binary that responds to --version.
|
||||
func_find_tool M4 gm4 gnum4 m4
|
||||
}
|
||||
|
||||
test -n "$M4" || func_fatal_error "\
|
||||
Please install GNU M4, or 'export M4=/path/to/gnu/m4'."
|
||||
|
||||
func_verbose "export M4='$M4'"
|
||||
|
||||
# Make sure the search result is visible to subshells
|
||||
export M4
|
||||
|
||||
require_gnu_m4=:
|
||||
}
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Core functions. ##
|
||||
## --------------- ##
|
||||
|
||||
# This section contains the high level functions used when calling this
|
||||
# file as a script. 'func_extract_trace' is probably the only one that you
|
||||
# won't want to replace if you source this file into your own script.
|
||||
|
||||
|
||||
# func_extract_trace MACRO_NAMES [FILENAME]...
|
||||
# --------------------------------------------
|
||||
# set '$func_extract_trace_result' to a colon delimited list of arguments
|
||||
# to any of the comma separated list of MACRO_NAMES in FILENAME. If no
|
||||
# FILENAME is given, then '$configure_ac' is assumed.
|
||||
func_extract_trace ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
$require_configure_ac
|
||||
$require_gnu_m4
|
||||
|
||||
_G_m4_traces=`$ECHO "--trace=$1" |$SED 's%,% --trace=%g'`
|
||||
_G_re_macros=`$ECHO "($1)" |$SED 's%,%|%g'`
|
||||
_G_macros="$1"; shift
|
||||
test $# -gt 0 || {
|
||||
set dummy $configure_ac
|
||||
shift
|
||||
}
|
||||
|
||||
# Generate an error if the first file is missing
|
||||
<"$1"
|
||||
|
||||
# Sadly, we can't use 'autom4te' tracing to extract macro arguments,
|
||||
# because it complains about things we want to ignore at bootstrap
|
||||
# time - like missing m4_include files; AC_PREREQ being newer than
|
||||
# the installed autoconf; and returns nothing when tracing
|
||||
# 'AM_INIT_AUTOMAKE' when aclocal hasn't been generated yet.
|
||||
#
|
||||
# The following tries to emulate a less persnickety version of (and
|
||||
# due to not having to wait for Perl startup on every invocation,
|
||||
# it's probably faster too):
|
||||
#
|
||||
# autom4te --language=Autoconf --trace=$my_macro:\$% "$@"
|
||||
#
|
||||
# First we give a minimal set of macro declarations to M4 to prime
|
||||
# it for reading Autoconf macros, while still providing some of the
|
||||
# functionality generally used at m4-time to supply dynamic
|
||||
# arguments to Autocof functions, but without following
|
||||
# 'm4_s?include' files.
|
||||
_G_mini='
|
||||
dnl Initialisation.
|
||||
m4_changequote([,])
|
||||
m4_define([m4_copy], [m4_define([$2], m4_defn([$1]))])
|
||||
m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])])
|
||||
|
||||
dnl Replace macros which may abort m4 with a no-op variant.
|
||||
m4_pushdef([m4_assert])
|
||||
m4_pushdef([m4_exit])
|
||||
m4_pushdef([m4_fatal])
|
||||
m4_pushdef([m4_m4exit])
|
||||
|
||||
dnl Replace macros that might break stderr of m4.
|
||||
m4_pushdef([m4_errprint])
|
||||
m4_pushdef([m4_errprintn])
|
||||
m4_pushdef([m4_include])
|
||||
m4_pushdef([m4_warn])
|
||||
|
||||
dnl Avoid side-effects of tracing by extract-trace.
|
||||
m4_pushdef([m4_maketemp])
|
||||
m4_pushdef([m4_mkstemp])
|
||||
|
||||
dnl TODO: reasons for this
|
||||
m4_pushdef([m4_dnl])
|
||||
m4_pushdef([m4_m4wrap])
|
||||
|
||||
dnl Copy and rename macros not handled by "m4 --prefix".
|
||||
m4_define([dnl], [m4_builtin([dnl])])
|
||||
m4_copy([m4_define], [m4_defun])
|
||||
m4_rename([m4_ifelse], [m4_if])
|
||||
m4_rename([m4_patsubst], [m4_bpatsubst])
|
||||
m4_rename([m4_regexp], [m4_bregexp])
|
||||
|
||||
dnl "m4sugar.mini" - useful m4-time macros for dynamic arguments.
|
||||
dnl If we discover packages that need more m4 macros defined in
|
||||
dnl order to bootstrap correctly, add them here:
|
||||
m4_define([m4_bmatch],
|
||||
[m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2],
|
||||
[m4_if(m4_bregexp([$1], [$2]), -1,
|
||||
[$0([$1], m4_shift3($@))], [$3])])])
|
||||
m4_define([m4_ifndef], [m4_ifdef([$1], [$3], [$2])])
|
||||
m4_define([m4_ifset],
|
||||
[m4_ifdef([$1], [m4_ifval(m4_defn([$1]), [$2], [$3])], [$3])])
|
||||
m4_define([m4_require], [$1])
|
||||
m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))])
|
||||
|
||||
dnl "autoconf.mini" - things from autoconf macros we care about.
|
||||
m4_copy([m4_defun], [AC_DEFUN])
|
||||
|
||||
dnl Dummy definitions for the macros we want to trace.
|
||||
dnl AM_INIT_AUTOMAKE at least produces no trace without this.
|
||||
'
|
||||
|
||||
_G_save=$IFS
|
||||
IFS=,
|
||||
for _G_macro in $_G_macros; do
|
||||
IFS=$_G_save
|
||||
func_append _G_mini "AC_DEFUN([$_G_macro])$nl"
|
||||
done
|
||||
IFS=$_G_save
|
||||
|
||||
# We discard M4's stdout, but the M4 trace output from reading our
|
||||
# "autoconf.mini" followed by any other files passed to this
|
||||
# function is then scanned by sed to transform it into a colon
|
||||
# delimited argument list assigned to a shell variable.
|
||||
_G_transform='s|#.*$||; s|^dnl .*$||; s| dnl .*$||;'
|
||||
|
||||
# Unfortunately, alternation in regexp addresses doesn't work in at
|
||||
# least BSD (and hence Mac OS X) sed, so we have to append a capture
|
||||
# and print block for each traced macro to the sed transform script.
|
||||
_G_save=$IFS
|
||||
IFS=,
|
||||
for _G_macro in $_G_macros; do
|
||||
IFS=$_G_save
|
||||
func_append _G_transform '
|
||||
/^m4trace: -1- '"$_G_macro"'/ {
|
||||
s|^m4trace: -1- '"$_G_macro"'[([]*||
|
||||
s|], [[]|:|g
|
||||
s|[])]*$|:|
|
||||
s|\(.\):$|\1|
|
||||
p
|
||||
}'
|
||||
done
|
||||
IFS=$_G_save
|
||||
|
||||
# Save the command pipeline results for further use by callers of
|
||||
# this function.
|
||||
func_extract_trace_result=`$ECHO "$_G_mini" \
|
||||
|$M4 -daq --prefix $_G_m4_traces - "$@" 2>&1 1>/dev/null \
|
||||
|$SED -n -e "$_G_transform"`
|
||||
}
|
||||
|
||||
|
||||
# func_extract_trace_first MACRO_NAMES [FILENAME]...
|
||||
# --------------------------------------------------
|
||||
# Exactly like func_extract_trace, except that only the first argument
|
||||
# to the first invocation of one of the comma separated MACRO_NAMES is
|
||||
# returned in '$func_extract_trace_first_result'.
|
||||
func_extract_trace_first ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_extract_trace ${1+"$@"}
|
||||
func_extract_trace_first_result=`$ECHO "$func_extract_trace_result" \
|
||||
|$SED -e 's|:.*$||g' -e 1q`
|
||||
}
|
||||
|
||||
|
||||
# func_main [ARG]...
|
||||
# ------------------
|
||||
func_main ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
# Configuration.
|
||||
usage='$progname MACRO_NAME FILE [...]'
|
||||
|
||||
long_help_message='
|
||||
The first argument to this program is the name of an autotools macro
|
||||
whose arguments you want to extract by examining the files listed in the
|
||||
remaining arguments using the same tool that Autoconf and Automake use,
|
||||
GNU M4.
|
||||
|
||||
The arguments are returned separated by colons, with each traced call
|
||||
on a separate line.'
|
||||
|
||||
# Option processing.
|
||||
func_options "$@"
|
||||
eval set dummy "$func_options_result"; shift
|
||||
|
||||
# Validate remaining non-option arguments.
|
||||
test $# -gt 1 \
|
||||
|| func_fatal_help "not enough arguments"
|
||||
|
||||
# Pass non-option arguments to extraction function.
|
||||
func_extract_trace "$@"
|
||||
|
||||
# Display results.
|
||||
test -n "$func_extract_trace_result" \
|
||||
&& $ECHO "$func_extract_trace_result"
|
||||
|
||||
# The End.
|
||||
exit $EXIT_SUCCESS
|
||||
}
|
||||
|
||||
|
||||
## --------------------------- ##
|
||||
## Actually perform the trace. ##
|
||||
## --------------------------- ##
|
||||
|
||||
# Only call 'func_main' if this script was called directly.
|
||||
test extract-trace = "$progname" && func_main "$@"
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-pattern: "50/scriptversion=%:y-%02m-%02d.%02H; # UTC"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# End:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,159 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Output the contents of a shell script with sourced files inlined.
|
||||
# Written by Gary V. Vaughan, 2012
|
||||
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2012-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
# Source required external libraries:
|
||||
. `echo "$0" |${SED-sed} 's|[^/]*$||'`"funclib.sh"
|
||||
. `echo "$0" |${SED-sed} 's|[^/]*$||'`"options-parser"
|
||||
|
||||
# Set a version string for *this* script.
|
||||
scriptversion=2019-02-19.15; # UTC
|
||||
|
||||
|
||||
## ------ ##
|
||||
## Usage. ##
|
||||
## ------ ##
|
||||
|
||||
# Run 'build-aux/inline-source --help' for help with using this script
|
||||
# from the command line.
|
||||
|
||||
# Recursively scan through a FILE passed on the command line, replacing
|
||||
# either of the following:
|
||||
# . "relative/file"
|
||||
# . `echo "$0" |edit`"relative/file"
|
||||
# with the contents of the referenced files.
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Options parsing. ##
|
||||
## ---------------- ##
|
||||
|
||||
usage='$progpath [OPTION]... FILE'
|
||||
|
||||
# Short help message in response to '-h'.
|
||||
usage_message='Options:
|
||||
--debug enable verbose shell tracing
|
||||
--version print version information and exit
|
||||
-h, --help print help message and exit
|
||||
'
|
||||
|
||||
long_help_message="\
|
||||
Report bugs to <bug-libtool@gnu.org>
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
||||
|
||||
func_options ${1+"$@"}
|
||||
eval set dummy "$func_options_result"; shift
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
## Resource management. ##
|
||||
## -------------------- ##
|
||||
|
||||
# require_AWK
|
||||
# -----------
|
||||
# Search for a "not hopeless" awk.
|
||||
require_AWK=func_require_AWK
|
||||
func_require_AWK ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
test -n "$AWK" || {
|
||||
# Find the first executable in the list.
|
||||
for _G_prog in gawk mawk nawk awk
|
||||
do
|
||||
require_AWK_IFS=$IFS
|
||||
IFS=${PATH_SEPARATOR-:}
|
||||
for _G_dir in $PATH
|
||||
do
|
||||
IFS=$require_AWK_IFS
|
||||
if test -f "$_G_dir/$_G_prog" && test -x "$_G_dir/$_G_prog"
|
||||
then
|
||||
AWK=$_G_dir/$_G_prog
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
IFS=$require_AWK_IFS
|
||||
done
|
||||
}
|
||||
|
||||
test -n "$AWK" || func_fatal_error "\
|
||||
Please install GNU Awk, or 'export AWK=/path/to/gnu/awk'."
|
||||
|
||||
func_verbose "found '$AWK'."
|
||||
|
||||
require_AWK=:
|
||||
}
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Core functions. ##
|
||||
## --------------- ##
|
||||
|
||||
# func_include LINE
|
||||
# -----------------
|
||||
# Output the contents of file included by LINE.
|
||||
func_include ()
|
||||
{
|
||||
$require_AWK
|
||||
|
||||
test -f "$1" \
|
||||
|| func_fatal_error "file '$1' not found"
|
||||
|
||||
_G_scriptdir=`echo "$1" |$SED 's|[^/]*$||'`
|
||||
test -n "$_G_scriptdir" || _G_scriptdir="./"
|
||||
|
||||
$AWK '
|
||||
BEGIN { magic = '${_RECURSE_MAGIC-0}'; }
|
||||
|
||||
/^#!/ && magic == 0 {
|
||||
print $0;
|
||||
print "## DO NOT EDIT - This file generated from '$1'";
|
||||
print "## by '$progname' v'$scriptversion'";
|
||||
magic++;
|
||||
next;
|
||||
}
|
||||
|
||||
/^\. ['\''"].*['\''"]$/ {
|
||||
file = substr ($2, 2, length ($2) -2);
|
||||
system (sprintf ("env _RECURSE_MAGIC=%d '$progpath' %s", magic, file));
|
||||
next;
|
||||
}
|
||||
|
||||
/^\. `echo [^`]*`['\''"][^'\''"]*['\''"]$/ {
|
||||
tail = substr ($0, match ($0, /`['\''"]/));
|
||||
file = substr (tail, 3, length (tail) -3);
|
||||
system (sprintf ("env _RECURSE_MAGIC=%d '$progpath' '"$_G_scriptdir"'%s", magic, file));
|
||||
next;
|
||||
}
|
||||
|
||||
{ print; }
|
||||
' < "$1"
|
||||
}
|
||||
|
||||
func_include "$1"
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,685 @@
|
||||
#! /bin/sh
|
||||
|
||||
# A portable, pluggable option parser for Bourne shell.
|
||||
# Written by Gary V. Vaughan, 2010
|
||||
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
# Set a version string for this script.
|
||||
scriptversion=2019-02-19.15; # UTC
|
||||
|
||||
|
||||
## ------ ##
|
||||
## Usage. ##
|
||||
## ------ ##
|
||||
|
||||
# This file is a library for parsing options in your shell scripts along
|
||||
# with assorted other useful supporting features that you can make use
|
||||
# of too.
|
||||
#
|
||||
# For the simplest scripts you might need only:
|
||||
#
|
||||
# #!/bin/sh
|
||||
# . relative/path/to/funclib.sh
|
||||
# . relative/path/to/options-parser
|
||||
# scriptversion=1.0
|
||||
# func_options ${1+"$@"}
|
||||
# eval set dummy "$func_options_result"; shift
|
||||
# ...rest of your script...
|
||||
#
|
||||
# In order for the '--version' option to work, you will need to have a
|
||||
# suitably formatted comment like the one at the top of this file
|
||||
# starting with '# Written by ' and ending with '# Copyright'.
|
||||
#
|
||||
# For '-h' and '--help' to work, you will also need a one line
|
||||
# description of your script's purpose in a comment directly above the
|
||||
# '# Written by ' line, like the one at the top of this file.
|
||||
#
|
||||
# The default options also support '--debug', which will turn on shell
|
||||
# execution tracing (see the comment above debug_cmd below for another
|
||||
# use), and '--verbose' and the func_verbose function to allow your script
|
||||
# to display verbose messages only when your user has specified
|
||||
# '--verbose'.
|
||||
#
|
||||
# After sourcing this file, you can plug in processing for additional
|
||||
# options by amending the variables from the 'Configuration' section
|
||||
# below, and following the instructions in the 'Option parsing'
|
||||
# section further down.
|
||||
|
||||
## -------------- ##
|
||||
## Configuration. ##
|
||||
## -------------- ##
|
||||
|
||||
# You should override these variables in your script after sourcing this
|
||||
# file so that they reflect the customisations you have added to the
|
||||
# option parser.
|
||||
|
||||
# The usage line for option parsing errors and the start of '-h' and
|
||||
# '--help' output messages. You can embed shell variables for delayed
|
||||
# expansion at the time the message is displayed, but you will need to
|
||||
# quote other shell meta-characters carefully to prevent them being
|
||||
# expanded when the contents are evaled.
|
||||
usage='$progpath [OPTION]...'
|
||||
|
||||
# Short help message in response to '-h' and '--help'. Add to this or
|
||||
# override it after sourcing this library to reflect the full set of
|
||||
# options your script accepts.
|
||||
usage_message="\
|
||||
--debug enable verbose shell tracing
|
||||
-W, --warnings=CATEGORY
|
||||
report the warnings falling in CATEGORY [all]
|
||||
-v, --verbose verbosely report processing
|
||||
--version print version information and exit
|
||||
-h, --help print short or long help message and exit
|
||||
"
|
||||
|
||||
# Additional text appended to 'usage_message' in response to '--help'.
|
||||
long_help_message="
|
||||
Warning categories include:
|
||||
'all' show all warnings
|
||||
'none' turn off all the warnings
|
||||
'error' warnings are treated as fatal errors"
|
||||
|
||||
# Help message printed before fatal option parsing errors.
|
||||
fatal_help="Try '\$progname --help' for more information."
|
||||
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Hook function management. ##
|
||||
## ------------------------- ##
|
||||
|
||||
# This section contains functions for adding, removing, and running hooks
|
||||
# in the main code. A hook is just a list of function names that can be
|
||||
# run in order later on.
|
||||
|
||||
# func_hookable FUNC_NAME
|
||||
# -----------------------
|
||||
# Declare that FUNC_NAME will run hooks added with
|
||||
# 'func_add_hook FUNC_NAME ...'.
|
||||
func_hookable ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_append hookable_fns " $1"
|
||||
}
|
||||
|
||||
|
||||
# func_add_hook FUNC_NAME HOOK_FUNC
|
||||
# ---------------------------------
|
||||
# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
|
||||
# first have been declared "hookable" by a call to 'func_hookable'.
|
||||
func_add_hook ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
case " $hookable_fns " in
|
||||
*" $1 "*) ;;
|
||||
*) func_fatal_error "'$1' does not accept hook functions." ;;
|
||||
esac
|
||||
|
||||
eval func_append ${1}_hooks '" $2"'
|
||||
}
|
||||
|
||||
|
||||
# func_remove_hook FUNC_NAME HOOK_FUNC
|
||||
# ------------------------------------
|
||||
# Remove HOOK_FUNC from the list of hook functions to be called by
|
||||
# FUNC_NAME.
|
||||
func_remove_hook ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
|
||||
}
|
||||
|
||||
|
||||
# func_propagate_result FUNC_NAME_A FUNC_NAME_B
|
||||
# ---------------------------------------------
|
||||
# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
|
||||
# *_result variable of FUNC_NAME_B.
|
||||
func_propagate_result ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_propagate_result_result=:
|
||||
if eval "test \"\${${1}_result+set}\" = set"
|
||||
then
|
||||
eval "${2}_result=\$${1}_result"
|
||||
else
|
||||
func_propagate_result_result=false
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# func_run_hooks FUNC_NAME [ARG]...
|
||||
# ---------------------------------
|
||||
# Run all hook functions registered to FUNC_NAME.
|
||||
# It's assumed that the list of hook functions contains nothing more
|
||||
# than a whitespace-delimited list of legal shell function names, and
|
||||
# no effort is wasted trying to catch shell meta-characters or preserve
|
||||
# whitespace.
|
||||
func_run_hooks ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
case " $hookable_fns " in
|
||||
*" $1 "*) ;;
|
||||
*) func_fatal_error "'$1' does not support hook functions." ;;
|
||||
esac
|
||||
|
||||
eval _G_hook_fns=\$$1_hooks; shift
|
||||
|
||||
for _G_hook in $_G_hook_fns; do
|
||||
func_unset "${_G_hook}_result"
|
||||
eval $_G_hook '${1+"$@"}'
|
||||
func_propagate_result $_G_hook func_run_hooks
|
||||
if $func_propagate_result_result; then
|
||||
eval set dummy "$func_run_hooks_result"; shift
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Option parsing. ##
|
||||
## --------------- ##
|
||||
|
||||
# In order to add your own option parsing hooks, you must accept the
|
||||
# full positional parameter list from your hook function. You may remove
|
||||
# or edit any options that you action, and then pass back the remaining
|
||||
# unprocessed options in '<hooked_function_name>_result', escaped
|
||||
# suitably for 'eval'.
|
||||
#
|
||||
# The '<hooked_function_name>_result' variable is automatically unset
|
||||
# before your hook gets called; for best performance, only set the
|
||||
# *_result variable when necessary (i.e. don't call the 'func_quote'
|
||||
# function unnecessarily because it can be an expensive operation on some
|
||||
# machines).
|
||||
#
|
||||
# Like this:
|
||||
#
|
||||
# my_options_prep ()
|
||||
# {
|
||||
# $debug_cmd
|
||||
#
|
||||
# # Extend the existing usage message.
|
||||
# usage_message=$usage_message'
|
||||
# -s, --silent don'\''t print informational messages
|
||||
# '
|
||||
# # No change in '$@' (ignored completely by this hook). Leave
|
||||
# # my_options_prep_result variable intact.
|
||||
# }
|
||||
# func_add_hook func_options_prep my_options_prep
|
||||
#
|
||||
#
|
||||
# my_silent_option ()
|
||||
# {
|
||||
# $debug_cmd
|
||||
#
|
||||
# args_changed=false
|
||||
#
|
||||
# # Note that, for efficiency, we parse as many options as we can
|
||||
# # recognise in a loop before passing the remainder back to the
|
||||
# # caller on the first unrecognised argument we encounter.
|
||||
# while test $# -gt 0; do
|
||||
# opt=$1; shift
|
||||
# case $opt in
|
||||
# --silent|-s) opt_silent=:
|
||||
# args_changed=:
|
||||
# ;;
|
||||
# # Separate non-argument short options:
|
||||
# -s*) func_split_short_opt "$_G_opt"
|
||||
# set dummy "$func_split_short_opt_name" \
|
||||
# "-$func_split_short_opt_arg" ${1+"$@"}
|
||||
# shift
|
||||
# args_changed=:
|
||||
# ;;
|
||||
# *) # Make sure the first unrecognised option "$_G_opt"
|
||||
# # is added back to "$@" in case we need it later,
|
||||
# # if $args_changed was set to 'true'.
|
||||
# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
|
||||
# esac
|
||||
# done
|
||||
#
|
||||
# # Only call 'func_quote' here if we processed at least one argument.
|
||||
# if $args_changed; then
|
||||
# func_quote eval ${1+"$@"}
|
||||
# my_silent_option_result=$func_quote_result
|
||||
# fi
|
||||
# }
|
||||
# func_add_hook func_parse_options my_silent_option
|
||||
#
|
||||
#
|
||||
# my_option_validation ()
|
||||
# {
|
||||
# $debug_cmd
|
||||
#
|
||||
# $opt_silent && $opt_verbose && func_fatal_help "\
|
||||
# '--silent' and '--verbose' options are mutually exclusive."
|
||||
# }
|
||||
# func_add_hook func_validate_options my_option_validation
|
||||
#
|
||||
# You'll also need to manually amend $usage_message to reflect the extra
|
||||
# options you parse. It's preferable to append if you can, so that
|
||||
# multiple option parsing hooks can be added safely.
|
||||
|
||||
|
||||
# func_options_finish [ARG]...
|
||||
# ----------------------------
|
||||
# Finishing the option parse loop (call 'func_options' hooks ATM).
|
||||
func_options_finish ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_run_hooks func_options ${1+"$@"}
|
||||
func_propagate_result func_run_hooks func_options_finish
|
||||
}
|
||||
|
||||
|
||||
# func_options [ARG]...
|
||||
# ---------------------
|
||||
# All the functions called inside func_options are hookable. See the
|
||||
# individual implementations for details.
|
||||
func_hookable func_options
|
||||
func_options ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
_G_options_quoted=false
|
||||
|
||||
for my_func in options_prep parse_options validate_options options_finish
|
||||
do
|
||||
func_unset func_${my_func}_result
|
||||
func_unset func_run_hooks_result
|
||||
eval func_$my_func '${1+"$@"}'
|
||||
func_propagate_result func_$my_func func_options
|
||||
if $func_propagate_result_result; then
|
||||
eval set dummy "$func_options_result"; shift
|
||||
_G_options_quoted=:
|
||||
fi
|
||||
done
|
||||
|
||||
$_G_options_quoted || {
|
||||
# As we (func_options) are top-level options-parser function and
|
||||
# nobody quoted "$@" for us yet, we need to do it explicitly for
|
||||
# caller.
|
||||
func_quote eval ${1+"$@"}
|
||||
func_options_result=$func_quote_result
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# func_options_prep [ARG]...
|
||||
# --------------------------
|
||||
# All initialisations required before starting the option parse loop.
|
||||
# Note that when calling hook functions, we pass through the list of
|
||||
# positional parameters. If a hook function modifies that list, and
|
||||
# needs to propagate that back to rest of this script, then the complete
|
||||
# modified list must be put in 'func_run_hooks_result' before returning.
|
||||
func_hookable func_options_prep
|
||||
func_options_prep ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
# Option defaults:
|
||||
opt_verbose=false
|
||||
opt_warning_types=
|
||||
|
||||
func_run_hooks func_options_prep ${1+"$@"}
|
||||
func_propagate_result func_run_hooks func_options_prep
|
||||
}
|
||||
|
||||
|
||||
# func_parse_options [ARG]...
|
||||
# ---------------------------
|
||||
# The main option parsing loop.
|
||||
func_hookable func_parse_options
|
||||
func_parse_options ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
_G_parse_options_requote=false
|
||||
# this just eases exit handling
|
||||
while test $# -gt 0; do
|
||||
# Defer to hook functions for initial option parsing, so they
|
||||
# get priority in the event of reusing an option name.
|
||||
func_run_hooks func_parse_options ${1+"$@"}
|
||||
func_propagate_result func_run_hooks func_parse_options
|
||||
if $func_propagate_result_result; then
|
||||
eval set dummy "$func_parse_options_result"; shift
|
||||
# Even though we may have changed "$@", we passed the "$@" array
|
||||
# down into the hook and it quoted it for us (because we are in
|
||||
# this if-branch). No need to quote it again.
|
||||
_G_parse_options_requote=false
|
||||
fi
|
||||
|
||||
# Break out of the loop if we already parsed every option.
|
||||
test $# -gt 0 || break
|
||||
|
||||
# We expect that one of the options parsed in this function matches
|
||||
# and thus we remove _G_opt from "$@" and need to re-quote.
|
||||
_G_match_parse_options=:
|
||||
_G_opt=$1
|
||||
shift
|
||||
case $_G_opt in
|
||||
--debug|-x) debug_cmd='set -x'
|
||||
func_echo "enabling shell trace mode" >&2
|
||||
$debug_cmd
|
||||
;;
|
||||
|
||||
--no-warnings|--no-warning|--no-warn)
|
||||
set dummy --warnings none ${1+"$@"}
|
||||
shift
|
||||
;;
|
||||
|
||||
--warnings|--warning|-W)
|
||||
if test $# = 0 && func_missing_arg $_G_opt; then
|
||||
_G_parse_options_requote=:
|
||||
break
|
||||
fi
|
||||
case " $warning_categories $1" in
|
||||
*" $1 "*)
|
||||
# trailing space prevents matching last $1 above
|
||||
func_append_uniq opt_warning_types " $1"
|
||||
;;
|
||||
*all)
|
||||
opt_warning_types=$warning_categories
|
||||
;;
|
||||
*none)
|
||||
opt_warning_types=none
|
||||
warning_func=:
|
||||
;;
|
||||
*error)
|
||||
opt_warning_types=$warning_categories
|
||||
warning_func=func_fatal_error
|
||||
;;
|
||||
*)
|
||||
func_fatal_error \
|
||||
"unsupported warning category: '$1'"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
;;
|
||||
|
||||
--verbose|-v) opt_verbose=: ;;
|
||||
--version) func_version ;;
|
||||
-\?|-h) func_usage ;;
|
||||
--help) func_help ;;
|
||||
|
||||
# Separate optargs to long options (plugins may need this):
|
||||
--*=*) func_split_equals "$_G_opt"
|
||||
set dummy "$func_split_equals_lhs" \
|
||||
"$func_split_equals_rhs" ${1+"$@"}
|
||||
shift
|
||||
;;
|
||||
|
||||
# Separate optargs to short options:
|
||||
-W*)
|
||||
func_split_short_opt "$_G_opt"
|
||||
set dummy "$func_split_short_opt_name" \
|
||||
"$func_split_short_opt_arg" ${1+"$@"}
|
||||
shift
|
||||
;;
|
||||
|
||||
# Separate non-argument short options:
|
||||
-\?*|-h*|-v*|-x*)
|
||||
func_split_short_opt "$_G_opt"
|
||||
set dummy "$func_split_short_opt_name" \
|
||||
"-$func_split_short_opt_arg" ${1+"$@"}
|
||||
shift
|
||||
;;
|
||||
|
||||
--) _G_parse_options_requote=: ; break ;;
|
||||
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
|
||||
*) set dummy "$_G_opt" ${1+"$@"}; shift
|
||||
_G_match_parse_options=false
|
||||
break
|
||||
;;
|
||||
esac
|
||||
|
||||
if $_G_match_parse_options; then
|
||||
_G_parse_options_requote=:
|
||||
fi
|
||||
done
|
||||
|
||||
if $_G_parse_options_requote; then
|
||||
# save modified positional parameters for caller
|
||||
func_quote eval ${1+"$@"}
|
||||
func_parse_options_result=$func_quote_result
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# func_validate_options [ARG]...
|
||||
# ------------------------------
|
||||
# Perform any sanity checks on option settings and/or unconsumed
|
||||
# arguments.
|
||||
func_hookable func_validate_options
|
||||
func_validate_options ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
# Display all warnings if -W was not given.
|
||||
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
|
||||
|
||||
func_run_hooks func_validate_options ${1+"$@"}
|
||||
func_propagate_result func_run_hooks func_validate_options
|
||||
|
||||
# Bail if the options were screwed!
|
||||
$exit_cmd $EXIT_FAILURE
|
||||
}
|
||||
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Helper functions. ##
|
||||
## ----------------- ##
|
||||
|
||||
# This section contains the helper functions used by the rest of the
|
||||
# hookable option parser framework in ascii-betical order.
|
||||
|
||||
|
||||
# func_fatal_help ARG...
|
||||
# ----------------------
|
||||
# Echo program name prefixed message to standard error, followed by
|
||||
# a help hint, and exit.
|
||||
func_fatal_help ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
eval \$ECHO \""Usage: $usage"\"
|
||||
eval \$ECHO \""$fatal_help"\"
|
||||
func_error ${1+"$@"}
|
||||
exit $EXIT_FAILURE
|
||||
}
|
||||
|
||||
|
||||
# func_help
|
||||
# ---------
|
||||
# Echo long help message to standard output and exit.
|
||||
func_help ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_usage_message
|
||||
$ECHO "$long_help_message"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
# func_missing_arg ARGNAME
|
||||
# ------------------------
|
||||
# Echo program name prefixed message to standard error and set global
|
||||
# exit_cmd.
|
||||
func_missing_arg ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_error "Missing argument for '$1'."
|
||||
exit_cmd=exit
|
||||
}
|
||||
|
||||
|
||||
# func_split_equals STRING
|
||||
# ------------------------
|
||||
# Set func_split_equals_lhs and func_split_equals_rhs shell variables
|
||||
# after splitting STRING at the '=' sign.
|
||||
test -z "$_G_HAVE_XSI_OPS" \
|
||||
&& (eval 'x=a/b/c;
|
||||
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
|
||||
&& _G_HAVE_XSI_OPS=yes
|
||||
|
||||
if test yes = "$_G_HAVE_XSI_OPS"
|
||||
then
|
||||
# This is an XSI compatible shell, allowing a faster implementation...
|
||||
eval 'func_split_equals ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_split_equals_lhs=${1%%=*}
|
||||
func_split_equals_rhs=${1#*=}
|
||||
if test "x$func_split_equals_lhs" = "x$1"; then
|
||||
func_split_equals_rhs=
|
||||
fi
|
||||
}'
|
||||
else
|
||||
# ...otherwise fall back to using expr, which is often a shell builtin.
|
||||
func_split_equals ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
|
||||
func_split_equals_rhs=
|
||||
test "x$func_split_equals_lhs=" = "x$1" \
|
||||
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
|
||||
}
|
||||
fi #func_split_equals
|
||||
|
||||
|
||||
# func_split_short_opt SHORTOPT
|
||||
# -----------------------------
|
||||
# Set func_split_short_opt_name and func_split_short_opt_arg shell
|
||||
# variables after splitting SHORTOPT after the 2nd character.
|
||||
if test yes = "$_G_HAVE_XSI_OPS"
|
||||
then
|
||||
# This is an XSI compatible shell, allowing a faster implementation...
|
||||
eval 'func_split_short_opt ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_split_short_opt_arg=${1#??}
|
||||
func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
|
||||
}'
|
||||
else
|
||||
# ...otherwise fall back to using expr, which is often a shell builtin.
|
||||
func_split_short_opt ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
|
||||
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
|
||||
}
|
||||
fi #func_split_short_opt
|
||||
|
||||
|
||||
# func_usage
|
||||
# ----------
|
||||
# Echo short help message to standard output and exit.
|
||||
func_usage ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
func_usage_message
|
||||
$ECHO "Run '$progname --help |${PAGER-more}' for full usage"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
# func_usage_message
|
||||
# ------------------
|
||||
# Echo short help message to standard output.
|
||||
func_usage_message ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
eval \$ECHO \""Usage: $usage"\"
|
||||
echo
|
||||
$SED -n 's|^# ||
|
||||
/^Written by/{
|
||||
x;p;x
|
||||
}
|
||||
h
|
||||
/^Written by/q' < "$progpath"
|
||||
echo
|
||||
eval \$ECHO \""$usage_message"\"
|
||||
}
|
||||
|
||||
|
||||
# func_version
|
||||
# ------------
|
||||
# Echo version message to standard output and exit.
|
||||
# The version message is extracted from the calling file's header
|
||||
# comments, with leading '# ' stripped:
|
||||
# 1. First display the progname and version
|
||||
# 2. Followed by the header comment line matching /^# Written by /
|
||||
# 3. Then a blank line followed by the first following line matching
|
||||
# /^# Copyright /
|
||||
# 4. Immediately followed by any lines between the previous matches,
|
||||
# except lines preceding the intervening completely blank line.
|
||||
# For example, see the header comments of this file.
|
||||
func_version ()
|
||||
{
|
||||
$debug_cmd
|
||||
|
||||
printf '%s\n' "$progname $scriptversion"
|
||||
$SED -n '
|
||||
/^# Written by /!b
|
||||
s|^# ||; p; n
|
||||
|
||||
:fwd2blnk
|
||||
/./ {
|
||||
n
|
||||
b fwd2blnk
|
||||
}
|
||||
p; n
|
||||
|
||||
:holdwrnt
|
||||
s|^# ||
|
||||
s|^# *$||
|
||||
/^Copyright /!{
|
||||
/./H
|
||||
n
|
||||
b holdwrnt
|
||||
}
|
||||
|
||||
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
|
||||
G
|
||||
s|\(\n\)\n*|\1|g
|
||||
p; q' < "$progpath"
|
||||
|
||||
exit $?
|
||||
}
|
||||
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,490 @@
|
||||
@node Bootstrap
|
||||
@chapter Bootstrap
|
||||
|
||||
The process of executing the various tools required to bring all the
|
||||
generated files up to date in a directory freshly checked out from
|
||||
source control can be quite involved. Many GNU projects use a
|
||||
@command{bootstrap} script to execute some or all of the following in the
|
||||
correct order: @command{gnulib-tool}, @command{autopoint},
|
||||
@command{libtoolize}, @command{autoreconf}. Often there's also
|
||||
additional file-processing and assorted book-keeping that also falls
|
||||
under the control of @command{bootstrap}, but it's wasteful for the
|
||||
maintainers of all these projects to manually reinvent a custom script
|
||||
on a case-by-case basis.
|
||||
|
||||
Gnulib is designed to provide a central library of exemplar
|
||||
implementations to promote the sharing of useful common code among
|
||||
GNU project maintainers. However, the bootstrapping needs of these
|
||||
projects vary enormously, so Gnulib's @command{bootstrap} needs to be
|
||||
extremely @strong{customisable} and extensible, with less effort than
|
||||
would be otherwise required to invent an ad-hoc solution.
|
||||
Unfortunately, Gnulib's @command{bootstrap} is not at all extensible,
|
||||
and makes it very hard to customize for any additional book-keeping or
|
||||
other tasks required at bootstrap-time. This version of
|
||||
@command{bootstrap} does not have any of those short-comings -- in
|
||||
addition to the basic bootstrapping facilities provided by Gnulib's
|
||||
implementation, this version can be changed and upgraded on the fly by
|
||||
overriding or appending to existing functions in @file{bootstrap.conf}.
|
||||
|
||||
|
||||
@menu
|
||||
* Customisation::
|
||||
* Usage Patterns::
|
||||
* Known Bugs::
|
||||
@end menu
|
||||
|
||||
|
||||
@node Customisation
|
||||
@section Customisation
|
||||
|
||||
There are four distinct ways to customize the functionality of
|
||||
@command{bootstrap}, all requiring creation of a @file{bootstrap.conf}
|
||||
file in the same directory as the imported @command{bootstrap} script
|
||||
itself.
|
||||
|
||||
@menu
|
||||
* Configuration Variables::
|
||||
* Require Variables::
|
||||
* Hook Functions::
|
||||
* Function Replacement::
|
||||
@end menu
|
||||
|
||||
|
||||
@node Configuration Variables
|
||||
@subsection Configuration Variables
|
||||
|
||||
For all but the more complex customisations, you need only change
|
||||
the value of a selection of the following shell variables in
|
||||
@file{bootstrap.conf}, to reflect whatever is appropriate to your
|
||||
package.
|
||||
|
||||
@example
|
||||
vc_ignore=.gitignore
|
||||
@end example
|
||||
|
||||
@table @code
|
||||
|
||||
@cnindex buildreq
|
||||
@item buildreq
|
||||
A newline-delimited list of triples of @strong{programs} (which must
|
||||
accept the option @option{--version} without hanging or failing), the
|
||||
@strong{minimum version required} (or just `-' in the version field if
|
||||
any version will be sufficient) and @strong{homepage URL (to
|
||||
help users locate missing packages)
|
||||
|
||||
@smallexample
|
||||
buildreq='
|
||||
git 1.5.5 http://git-scm.com
|
||||
help2man 1.29 https://www.gnu.org/s/help2man
|
||||
'
|
||||
@end smallexample
|
||||
|
||||
If you specify a minimum version of Autoconf with @code{AC_PREREQ},
|
||||
that version will be checked automatically without needing to be
|
||||
listed in @code{buildreq}. Similarly for a minimum Automake version
|
||||
declared with @code{AM_INIT_AUTOMAKE}, Libtool version with
|
||||
@code{LT_PREREQ}, or Autopoint version with @code{AM_GNU_GETTEXT_VERSION}.
|
||||
|
||||
If @code{AB_INIT} is declared in @file{configure.ac}, then a versionless
|
||||
requirement for Autobuild is added automatically, and finally if there
|
||||
are any diff files under @code{local_gl_path}, then a versionless
|
||||
requirement for patch is also added.
|
||||
|
||||
When @command{bootstrap} is invoked, it will check that all the listed
|
||||
and automatically added tools are available at the given minimum version,
|
||||
or else bail out with a diagnostic.
|
||||
|
||||
|
||||
@cnindex buildreq_readme
|
||||
@item buildreq_readme
|
||||
Name of a file containing instructions on installing missing packages
|
||||
required in @code{buildreq}. Usually, the instructions at the given
|
||||
URL should be sufficient, though some projects add additional notes
|
||||
in @file{HACKING}.
|
||||
|
||||
@smallexample
|
||||
buildreq_readme=README-hacking
|
||||
@end smallexample
|
||||
|
||||
|
||||
@cnindex build_aux
|
||||
@item build_aux
|
||||
This is automatically extracted from the @code{AC_CONFIG_AUX_DIR}
|
||||
declaration in @file{configure.ac}, though you can specify it in
|
||||
@file{bootstrap.conf} if you don't otherwise want to declare
|
||||
@code{AC_CONFIG_AUX_DIR} in @file{configure.ac}.
|
||||
|
||||
@cnindex macro_dir
|
||||
@item macro_dir
|
||||
This is automatically extracted from @file{configure.ac}, or if
|
||||
neither @code{AC_CONFIG_MACRO_DIRS} nor @code{AC_CONFIG_MACRO_DIR} is
|
||||
declared there, the option immediately following the first @samp{-I}
|
||||
from @code{ACLOCAL_AMFLAGS} in @file{Makefile.am} is used as a last
|
||||
resort. If you don't want to declare the macro directory in any of
|
||||
those places, then you can specify it in @file{bootstrap.conf} by
|
||||
using the @code{macro_dir} variable.
|
||||
|
||||
@smallexample
|
||||
macro_dir=acm4
|
||||
@end smallexample
|
||||
|
||||
|
||||
@cnindex package
|
||||
@item package
|
||||
This is automatically extracted by downcasing the first argument to
|
||||
@code{AC_INIT} in @file{configure.ac}, though you can override it here
|
||||
if you prefer.
|
||||
|
||||
@cnindex package_name
|
||||
@item package_name
|
||||
This is automatically extracted from the first argument to
|
||||
@code{AC_INIT} in @file{configure.ac}, though you can override it here
|
||||
if you prefer.
|
||||
|
||||
@cnindex package_version
|
||||
@item package_version
|
||||
This is automatically extracted from the second argument to
|
||||
@code{AC_INIT} in @file{configure.ac}, though you can override it here
|
||||
if you prefer.
|
||||
|
||||
@cnindex package_bugreport
|
||||
@item package_bugreport
|
||||
This is automatically extracted from the third argument to
|
||||
@code{AC_INIT} in @file{configure.ac} if given, though you can override
|
||||
it here if you prefer.
|
||||
|
||||
|
||||
@cnindex doc_base
|
||||
@cnindex gnulib_mk
|
||||
@cnindex gnulib_name
|
||||
@cnindex local_gl_path
|
||||
@cnindex source_base
|
||||
@cnindex tests_base
|
||||
@item doc_base
|
||||
@itemx gnulib_mk
|
||||
@itemx gnulib_name
|
||||
@itemx local_gl_path
|
||||
@itemx source_base
|
||||
@itemx tests_base
|
||||
These are normally extracted from @file{gnulib-cache.m4}, regardless of
|
||||
their values in @file{bootstrap.conf}.
|
||||
|
||||
When that file is not yet created, then @command{bootstrap} will
|
||||
fall-back automatically to the gnulib defaults; unless you set
|
||||
alternative values here in @file{bootstrap.conf}.
|
||||
|
||||
If you check @file{gnulib-cache.m4} into your repository, then these
|
||||
values will be extracted automatically. @xref{Usage Patterns}, for more
|
||||
details.
|
||||
|
||||
|
||||
@cnindex gnulib_modules
|
||||
@item gnulib_modules
|
||||
The list of gnulib modules required at @command{gnulib-tool} time.
|
||||
|
||||
If you check @file{gnulib-cache.m4} into your repository, then this list
|
||||
will be extracted automatically. @xref{Usage Patterns}, for more
|
||||
details.
|
||||
|
||||
|
||||
@cnindex gnulib_non_module_files
|
||||
@item gnulib_non_module_files
|
||||
Extra gnulib files that are not part of a gnulib module, but which
|
||||
override files of the same name installed by other bootstrap tools, such
|
||||
as @command{automake}.
|
||||
|
||||
@smallexample
|
||||
gnulib_non_module_files="$gnulib_non_module_files"'
|
||||
doc/COPYINGv3
|
||||
'
|
||||
@end smallexample
|
||||
|
||||
|
||||
@cnindex gnulib_path
|
||||
@cnindex gnulib_url
|
||||
@item gnulib_path
|
||||
@itemx gnulib_url
|
||||
Relative path to the local gnulib submodule, and url to the upstream
|
||||
git repository for gnulib. These are only used if a new gnulib submodule
|
||||
needs to be created, otherwise they are ignored and the values stored in
|
||||
@file{.gitmodules} are used instead.
|
||||
|
||||
Normally, you can leave these untouched, and @command{bootstrap} will
|
||||
correctly check out a gnulib submodule from the directory passed with
|
||||
@option{--gnulib-srcdir}, or else from the upstream repository at GNU
|
||||
savannah.
|
||||
|
||||
|
||||
@cnindex gnulib_tool_options
|
||||
@item gnulib_tool_options
|
||||
Additional options to pass to @command{gnulib-tool} when it is called.
|
||||
|
||||
@smallexample
|
||||
gnulib_tool_options='
|
||||
--no-changelog
|
||||
--libtool
|
||||
'
|
||||
@end smallexample
|
||||
|
||||
|
||||
@cnindex gnulib_precious
|
||||
@item gnulib_precious
|
||||
Normally, @command{bootstrap} removes any macro-files that are not
|
||||
included by @file{aclocal.m4} before it returns, except for files listed
|
||||
in this variable which are always kept.
|
||||
|
||||
@smallexample
|
||||
gnulib_precious='
|
||||
gnulib-cache.m4
|
||||
'
|
||||
@end smallexample
|
||||
|
||||
|
||||
@cnindex min_cmd_len
|
||||
@item min_cmd_len
|
||||
When truncating long commands for display at runtime, always allow at
|
||||
least this many characters before truncating.
|
||||
|
||||
|
||||
@cnindex po_download_command_format
|
||||
@item po_download_command_format
|
||||
The command to download all @samp{.po} files for a specified domain into
|
||||
a specified directory, where the first %s is filled in with the
|
||||
@emph{domain name}, and the second with the @emph{destination
|
||||
directory}. Use @command{rsync}'s @option{-L} and @option{-r} options
|
||||
because the latest @samp{/%s} directory and the @samp{.po} files within
|
||||
are all symlinks.
|
||||
|
||||
@smallexample
|
||||
po_download_command_format=\
|
||||
"rsync --delete --exclude '*.s1' -Lrtvz \
|
||||
'translationproject.org::tp/latest/%s/' '%s'"
|
||||
@end smallexample
|
||||
|
||||
This variable is only interesting to projects with NLS support, and even
|
||||
then, Usually, the default setting will be sufficient.
|
||||
|
||||
|
||||
@cnindex extra_locale_categories
|
||||
@item extra_locale_categories
|
||||
Other locale categories that need message catalogs. This variable is
|
||||
only interesting to projects with NLS support.
|
||||
|
||||
|
||||
@cnindex xgettext_options
|
||||
@item xgettext_options
|
||||
Additional @command{xgettext} options to use. Gnulib might provide you
|
||||
with an extensive list of additional options to append to this, but
|
||||
gettext 0.16.1 and newer already appends those automatically, so you can
|
||||
safely ignore the complaints from @command{gnulib-tool} as long as your
|
||||
@file{configure.ac} declares @code{AM_GNU_GETTEXT_VERSION([0.16.1])}.
|
||||
|
||||
@smallexample
|
||||
xgettext_options='
|
||||
--flag=_:1:pass-c-format
|
||||
--flag=N_:1:pass-c-format
|
||||
'
|
||||
@end smallexample
|
||||
|
||||
As with the previous two variables, you can safely ignore this one if
|
||||
your project does not have NLS support.
|
||||
|
||||
|
||||
@cnindex copyright_holder
|
||||
@item copyright_holder
|
||||
Package copyright holder for gettext files. Defaults to @samp{FSF} if
|
||||
unset.
|
||||
|
||||
@cnindex checkout_only_file
|
||||
@item checkout_only_file
|
||||
If you want @command{bootstrap} to abort if it is executed outside of
|
||||
a version controlled tree, this variable must hold the name of some file
|
||||
that is present only in a checked out tree, and is not in a distribution
|
||||
tarball.
|
||||
|
||||
@smallexample
|
||||
checkout_only_file=HACKING
|
||||
@end smallexample
|
||||
|
||||
@cnindex copy
|
||||
@item copy
|
||||
If set to @samp{true}, then make copies when adding files to this
|
||||
package, otherwise make symlinks by default. If set to @samp{true},
|
||||
then the @option{--copy} option to @command{bootstrap} will have no
|
||||
further effect.
|
||||
|
||||
|
||||
@cnindex vc_ignore
|
||||
@item vc_ignore
|
||||
Set this to @samp{.cvsignore .gitignore} if you want both of those files
|
||||
to be generated in directories such as @file{lib/}, @file{m4/}, and
|
||||
@file{po/}, or set it to @samp{auto} to make @command{bootstrap} select
|
||||
which to use based on which version control system (if any) is used in
|
||||
the source directory. Or set it to @samp{none} to disregard VCS ignore
|
||||
files entirely. Default is @samp{auto}.
|
||||
|
||||
@smallexample
|
||||
vc_ignore='.cvsignore .gitignore'
|
||||
@end smallexample
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@node Require Variables
|
||||
@subsection Require Variables
|
||||
|
||||
Many of the functions in @command{bootstrap} should not be executed more
|
||||
than once, which is achieved by storing the name of that function in a
|
||||
variable and then calling it with:
|
||||
|
||||
@smallexample
|
||||
$require_gnulib_tool
|
||||
@end smallexample
|
||||
|
||||
At this stage, the value of the variable is interpreted as a function
|
||||
call by the shell, and the named function then runs. Under normal
|
||||
circumstances, functions that are called in this way always set their
|
||||
associated variable name to simply @samp{:} so that subsequent
|
||||
occurrences of, in this instance, @code{$require_gnulib_tool} have no
|
||||
further effect.
|
||||
|
||||
That means you can easily skip any functions that are called like this
|
||||
by unconditionally setting the require variable to @samp{:} in your
|
||||
@file{bootstrap.conf}. So, for example, if your package makes no use of
|
||||
@command{gnulib-tool}, you can add the following to your
|
||||
@file{bootstrap.conf}:
|
||||
|
||||
@smallexample
|
||||
require_gnulib_tool=:
|
||||
@end smallexample
|
||||
|
||||
You should be aware, however, that the function calls managed by this
|
||||
mechanism are designed to be called one time to ensure that some
|
||||
resource is available for use by the rest of any function that uses a
|
||||
@code{$require_some_resource} call. Be careful to ensure that you
|
||||
remove any code paths that try to use that resource if you have
|
||||
effectively disabled it by setting its variable to @samp{:} early on.
|
||||
|
||||
|
||||
@node Hook Functions
|
||||
@subsection Hook Functions
|
||||
|
||||
Many of the key functions in @command{bootstrap} will run one or more hook
|
||||
functions before they return. Essentially, all that the entire script
|
||||
does is to define a lot of functions (some of which will run hooks),
|
||||
then source the contents of your @file{bootstrap.conf} customisations,
|
||||
and then finally run the @code{func_bootstrap} function. Read the
|
||||
doc-comments above @code{func_bootstrap} in the @command{bootstrap} file,
|
||||
as well as the functions that it calls to find where you can hook your
|
||||
own functions, in order to be called during your customised execution of
|
||||
@command{bootstrap}.
|
||||
|
||||
One of the trickier hook functions is set up to allow you to add
|
||||
additional arguments to the option parser for @command{bootstrap} without
|
||||
having to replace @code{func_parse_options} in its entirety:
|
||||
|
||||
@smallexample
|
||||
my_silent_option ()
|
||||
@{
|
||||
$debug_cmd
|
||||
|
||||
case $1 in
|
||||
--silent|-s) opt_silent=:; shift ;;
|
||||
esac
|
||||
|
||||
# return modified option list
|
||||
func_quote eval $@{1+"$@@"@}
|
||||
func_run_hooks_result=$func_quote_result
|
||||
@}
|
||||
func_add_hook func_parse_options my_silent_option
|
||||
@end smallexample
|
||||
|
||||
|
||||
@node Function Replacement
|
||||
@subsection Function Replacement
|
||||
|
||||
In a few complex packages, you might find that some selection of
|
||||
functions called during the normal execution of @command{bootstrap} are
|
||||
wholly inappropriate for your project, where simply disabling
|
||||
@code{$require_some_resource} functions and hooking in additional code
|
||||
is not powerful enough to avoid or radically alter the parts of
|
||||
@command{bootstrap} you do not want.
|
||||
|
||||
In that case you can simply write an entirely custom implementation of
|
||||
whatever function(s) you want to replace inside your
|
||||
@file{bootstrap.conf}, so that by the time @code{func_bootstrap} is
|
||||
called at the end of @command{bootstrap}, your new implementation is
|
||||
already in place.
|
||||
|
||||
@example
|
||||
func_echo ()
|
||||
@{
|
||||
# respect new --silent option
|
||||
$opt_silent || echo "$progname: $*"
|
||||
@}
|
||||
@end example
|
||||
|
||||
|
||||
@node Usage Patterns
|
||||
@section Usage Patterns
|
||||
|
||||
There are two ways to incorporate gnulib into your package, which are
|
||||
both supported by the @command{bootstrap} script. Be sure that everyone
|
||||
working on your package is employing the same usage pattern, or things
|
||||
will turn bad!
|
||||
|
||||
@menu
|
||||
* Configuration all kept in @file{bootstrap.conf}
|
||||
* Gnulib configuration stored in @file{gnulib-cache.m4}
|
||||
@end menu
|
||||
|
||||
|
||||
@node Configuration all kept in @file{bootstrap.conf}
|
||||
@subsection Configuration all kept in @file{bootstrap.conf}
|
||||
|
||||
All the parameters for running @command{gnulib-tool} and other bootstrap-
|
||||
time commands are maintained in @file{bootstrap.conf}. This is the
|
||||
default usage pattern.
|
||||
|
||||
In order for this to work, when you wish to add or remove a gnulib
|
||||
module from your package, amend the value of @var{gnulib_modules} in
|
||||
@file{bootstrap.conf} (and similarly for any other parameters) and rerun
|
||||
@command{bootstrap} to import everything anew.
|
||||
|
||||
To avoid things getting out of sync, you should never run
|
||||
@command{gnulib-tool} directly.
|
||||
|
||||
|
||||
@node Gnulib configuration stored in @file{gnulib-cache.m4}
|
||||
@subsection Gnulib configuration stored in @file{gnulib-cache.m4}
|
||||
|
||||
To implement this usage pattern, leave the value of @var{gnulib_modules}
|
||||
and the various @var{gl_xxx} variables empty in @file{bootstrap.conf}
|
||||
and call @command{gnulib-tool --import ...} from your shell, checking
|
||||
that @file{gnulib-cache.m4} reflects the values you wanted. From now on
|
||||
you can either call @command{gnulib-tool --update} or rerun
|
||||
@command{bootstrap} whenever you want to resync the package modules with
|
||||
your local gnulib checkout.
|
||||
|
||||
If you wish to add or remove a gnulib module from your package, call
|
||||
@command{gnulib-tool --import-add ...} or @command{gnulib-tool --import-
|
||||
remove} respectively.
|
||||
|
||||
@node Known Bugs
|
||||
@section Known Bugs
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
gnulib-tool has no @option{--force} option, so sometimes symlinks are
|
||||
left pointing to an old gnulib tree (even with @command{./bootstrap
|
||||
--force}):
|
||||
|
||||
@smallexample
|
||||
$ ./bootstrap --skip-git --gnulib-srcdir=../gnulib
|
||||
$ ./bootstrap --gnulib-srcdir=../gnulib --force
|
||||
@end smallexample
|
||||
|
||||
Note that now, plenty of symlinks still point to @file{../gnulib}
|
||||
instead of having being retargeted to the submodule in @file{./gnulib}.
|
||||
@end item
|
||||
@end itemize
|
||||
@@ -0,0 +1,10 @@
|
||||
Files:
|
||||
tests/test-all-shells.sh
|
||||
|
||||
Depends-on:
|
||||
funclib.sh
|
||||
|
||||
Makefile.am:
|
||||
TESTS_ENVIRONMENT += \
|
||||
abs_aux_dir='$(abs_aux_dir)' \
|
||||
abs_srcdir='$(abs_srcdir)'
|
||||
@@ -0,0 +1,23 @@
|
||||
Description:
|
||||
Bootstrap an Autotooled package from checked-out sources.
|
||||
|
||||
Files:
|
||||
build-aux/bootstrap.in
|
||||
|
||||
Depends-on:
|
||||
extract-trace
|
||||
funclib.sh
|
||||
inline-source
|
||||
options-parser
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
|
||||
License:
|
||||
GPLed build tool
|
||||
|
||||
Maintainer:
|
||||
Gary V. Vaughan <gary@gnu.org>
|
||||
@@ -0,0 +1,21 @@
|
||||
Description:
|
||||
Extract macro arguments from autotools input with GNU M4.
|
||||
|
||||
Files:
|
||||
build-aux/extract-trace
|
||||
|
||||
Depends-on:
|
||||
options-parser
|
||||
funclib.sh
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
|
||||
License:
|
||||
GPLed build tool
|
||||
|
||||
Maintainer:
|
||||
Gary V. Vaughan <gary@gnu.org>
|
||||
@@ -0,0 +1,19 @@
|
||||
Description:
|
||||
General shell script boiler plate, and helper functions.
|
||||
|
||||
Files:
|
||||
build-aux/funclib.sh
|
||||
|
||||
Depends-on:
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
|
||||
License:
|
||||
GPLed build tool
|
||||
|
||||
Maintainer:
|
||||
Gary V. Vaughan <gary@gnu.org>
|
||||
@@ -0,0 +1,12 @@
|
||||
Files:
|
||||
tests/test-funclib-quote.sh
|
||||
|
||||
Depends-on:
|
||||
test-framework-sh
|
||||
all-shells-tests
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
TESTS += \
|
||||
test-funclib-quote.sh
|
||||
@@ -0,0 +1,21 @@
|
||||
Description:
|
||||
Output the contents of a shell script with sourced files inlined.
|
||||
|
||||
Files:
|
||||
build-aux/inline-source
|
||||
|
||||
Depends-on:
|
||||
options-parser
|
||||
funclib.sh
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
|
||||
License:
|
||||
GPLed build tool
|
||||
|
||||
Maintainer:
|
||||
Gary V. Vaughan <gary@gnu.org>
|
||||
@@ -0,0 +1,20 @@
|
||||
Description:
|
||||
A portable, pluggable option parser for Bourne shell.
|
||||
|
||||
Files:
|
||||
build-aux/options-parser
|
||||
|
||||
Depends-on:
|
||||
funclib.sh
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
|
||||
License:
|
||||
GPLed build tool
|
||||
|
||||
Maintainer:
|
||||
Gary V. Vaughan <gary@gnu.org>
|
||||
@@ -0,0 +1,13 @@
|
||||
Files:
|
||||
tests/test-option-parser.sh
|
||||
tests/test-option-parser-helper
|
||||
|
||||
Depends-on:
|
||||
test-framework-sh
|
||||
all-shells-tests
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
TESTS += \
|
||||
test-option-parser.sh
|
||||
@@ -0,0 +1,103 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Unit test helper.
|
||||
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2015-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
|
||||
# This shell snippet (when sourced) tries to find as many /bin/sh compatible
|
||||
# shells as possible on tested box -- and then re-executes the calling script
|
||||
# in all of them. At the end, the default shell (/bin/sh usually) is also
|
||||
# tested.
|
||||
#
|
||||
# To write compatible test-case, you usually need only those lines:
|
||||
#
|
||||
# #! /bin/sh
|
||||
#
|
||||
# all_shells_script=$0
|
||||
# . "$abs_srcdir/test-all-shells.sh"
|
||||
#
|
||||
# your_check && all_shells_error "failed your_check"
|
||||
#
|
||||
# $all_shells_exit_cmd
|
||||
|
||||
|
||||
# List of shells we try to check in.
|
||||
: ${GL_ALL_SHELLS='ash bash dash ksh ksh88 mksh zsh busybox'}
|
||||
|
||||
# List of directories to search for the shell interpreter.
|
||||
: ${GL_ALL_SHELLS_DIRS='/bin /sbin'}
|
||||
|
||||
# List of shell emulations to test with BusyBox.
|
||||
: ${GL_ALL_SHELLS_BBE='sh ash'}
|
||||
|
||||
. "$abs_aux_dir"/funclib.sh || exit 1
|
||||
|
||||
all_shells_exit_cmd=:
|
||||
|
||||
: ${all_shells_script=false}
|
||||
|
||||
|
||||
all_shells_error ()
|
||||
{
|
||||
$ECHO "error: $*" >&2
|
||||
all_shells_exit_cmd=false
|
||||
}
|
||||
|
||||
|
||||
__notify_shell ()
|
||||
{
|
||||
$ECHO "== running in '$*' ==" >&2
|
||||
}
|
||||
|
||||
|
||||
__reexec_in_all_shells ()
|
||||
{
|
||||
for _G_dir in $GL_ALL_SHELLS_DIRS
|
||||
do
|
||||
for _G_shell in $GL_ALL_SHELLS
|
||||
do
|
||||
_G_abs_shell=$_G_dir/$_G_shell
|
||||
test -f "$_G_abs_shell" || continue
|
||||
|
||||
case $_G_abs_shell in
|
||||
*busybox)
|
||||
for _G_bbe in $GL_ALL_SHELLS_BBE
|
||||
do
|
||||
_G_full_bb="$_G_abs_shell $_G_bbe"
|
||||
__notify_shell "$_G_full_bb"
|
||||
__GL_ALL_SHELLS_SHELL="$_G_full_bb" \
|
||||
"$_G_abs_shell" "$_G_bbe" "$all_shells_script" ${1+"$@"} \
|
||||
|| all_shells_error "can't run in $_G_bbe"
|
||||
done
|
||||
;;
|
||||
*)
|
||||
__notify_shell "$_G_abs_shell"
|
||||
__GL_ALL_SHELLS_SHELL="$_G_abs_shell" \
|
||||
"$_G_abs_shell" "$all_shells_script" ${1+"$@"} \
|
||||
|| all_shells_error "can't run in $_G_abs_shell"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
test x = "x$__GL_ALL_SHELLS_SHELL" \
|
||||
&& __reexec_in_all_shells ${1+"$@"} \
|
||||
&& __notify_shell "default shell"
|
||||
|
||||
:
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Unit tests for funclib.sh
|
||||
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2015-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
|
||||
all_shells_script=$0
|
||||
. "$abs_srcdir/test-all-shells.sh" || exit 1
|
||||
|
||||
|
||||
_compare_or_error ()
|
||||
{
|
||||
_G_msg="$1: strings differ:
|
||||
a: $2
|
||||
b: $3"
|
||||
test "$2" = "$3" || all_shells_error "$_G_msg"
|
||||
}
|
||||
|
||||
|
||||
dump_args ()
|
||||
{
|
||||
dump_args_result=
|
||||
_separator=
|
||||
for arg
|
||||
do
|
||||
func_append dump_args_result "$_separator$arg"
|
||||
_separator=' '
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# test_q_eval DESC ARGs...
|
||||
# ------------------------
|
||||
# Apply 'func_quote eval' on ARGs and eval the result. The eval-ed result must
|
||||
# 100% match the original ARGs.
|
||||
test_q_eval ()
|
||||
{
|
||||
description="$1" ; shift
|
||||
|
||||
dump_args ${1+"$@"}
|
||||
original=$dump_args_result
|
||||
|
||||
$ECHO "~> func_quote eval: $description: $original"
|
||||
|
||||
# Pretty implementation
|
||||
func_quote eval,pretty ${1+"$@"} \
|
||||
|| all_shells_error "can't pretty func_quote args '$*'"
|
||||
eval "set dummy $func_quote_result" ; shift
|
||||
dump_args ${1+"$@"}
|
||||
pretty=$dump_args_result
|
||||
|
||||
# Fast implementation (if available)
|
||||
func_quote eval ${1+"$@"} || all_shells_error "can't fast func_quote args '$*'"
|
||||
eval "set dummy $func_quote_result" ; shift
|
||||
dump_args ${1+"$@"}
|
||||
fast=$dump_args_result
|
||||
|
||||
_compare_or_error "$description (pretty)" "$original" "$pretty"
|
||||
_compare_or_error "$description (fast)" "$original" "$fast"
|
||||
}
|
||||
|
||||
|
||||
# test_q_arg_eval DESC ARG
|
||||
# ------------------------
|
||||
# Apply 'func_quote_arg eval' on ARG and eval the result. Echo-ed result within
|
||||
# eval must match original echo-ed ARG.
|
||||
test_q_arg_eval ()
|
||||
{
|
||||
description=$1
|
||||
original=$2
|
||||
original_echo=`$ECHO "$original"`
|
||||
|
||||
$ECHO "~> func_quote_arg eval: $description: $original_echo"
|
||||
|
||||
func_quote_arg pretty,unquoted "$original" \
|
||||
|| all_shells_error "can't quote_arg: $original"
|
||||
pretty=$func_quote_arg_result
|
||||
pretty_unquoted=$func_quote_arg_unquoted_result
|
||||
pretty_echo=`eval '$ECHO '"$pretty"` \
|
||||
|| all_shells_error "can't eval: $pretty"
|
||||
|
||||
pretty_unquoted_echo=`eval '$ECHO '"\"$pretty_unquoted\""` \
|
||||
|| all_shells_error "can't eval: $pretty"
|
||||
|
||||
# Fast implementation.
|
||||
func_quote_arg eval "$original"
|
||||
fast=$func_quote_arg_result
|
||||
fast_echo=`eval '$ECHO '"$fast"` || all_shells_error "can't eval: $pretty"
|
||||
|
||||
_compare_or_error "$description (pretty)" \
|
||||
"$original_echo" "$pretty_echo"
|
||||
_compare_or_error "$description (pretty_unquoted)" \
|
||||
"$original_echo" "$pretty_unquoted_echo"
|
||||
_compare_or_error "$description (fast)" \
|
||||
"$original_echo" "$fast_echo"
|
||||
}
|
||||
|
||||
|
||||
# test_q_expand DESC EXP_RESULT ARG
|
||||
# ---------------------------------
|
||||
# Test that 'func_quote expand' works fine --> all shell special characters are
|
||||
# quoted except '$' -- while all variables are expanded.
|
||||
test_q_expand ()
|
||||
{
|
||||
description=$1 ; shift
|
||||
exp_result=$1 ; shift
|
||||
|
||||
dump_args ${1+"$@"}
|
||||
$ECHO "~> func_quote expand: $description: $dump_args_result"
|
||||
|
||||
func_quote expand ${1+"$@"}
|
||||
eval "set dummy $func_quote_result" ; shift
|
||||
dump_args ${1+"$@"}
|
||||
|
||||
_compare_or_error "$description (expand)" "$exp_result" "$dump_args_result"
|
||||
}
|
||||
|
||||
|
||||
## ============== ##
|
||||
## Start testing! ##
|
||||
## ============== ##
|
||||
|
||||
aaa=aaa ; bbb=bbb ; ccc=ccc ; ddd=ddd
|
||||
|
||||
# Needed for later testing of globbing.
|
||||
touch fltestA fltestB
|
||||
|
||||
test_q_eval basic a b c
|
||||
# TODO: Intentionally not checking newline here yet, it never worked.
|
||||
test_q_eval spaces 'space space' 'tab tab'
|
||||
test_q_eval empty_arg '' '' ''
|
||||
test_q_eval globs '*' '.*' '[a-zA-Z0-9_]' '?' '~'
|
||||
test_q_eval variables '$aaa' '${bbb}' '"${ccc} $ddd"'
|
||||
test_q_eval exclamation-mark '$!' '!$' '!'
|
||||
test_q_eval tilde '"~"'
|
||||
test_q_eval single-quotes "'a'" "'"'$bbb'"'"
|
||||
test_q_eval shell-vars '$1' '$@' '$*' 'ending$'
|
||||
test_q_eval complicated-cmd grep b '>' /noperm '<' /noperm
|
||||
|
||||
test_q_arg_eval basic a
|
||||
test_q_arg_eval single-quotes "'''"
|
||||
test_q_arg_eval double-quotes '"""'
|
||||
test_q_arg_eval tilde '~'
|
||||
test_q_arg_eval ampersand '&'
|
||||
test_q_arg_eval pipe '|'
|
||||
test_q_arg_eval questionmark 'fltest?'
|
||||
test_q_arg_eval glob-bracket 'fltest[A-Z]'
|
||||
test_q_arg_eval space 'space space'
|
||||
test_q_arg_eval tab 'tab tab'
|
||||
test_q_arg_eval '`command`' '`false command`'
|
||||
test_q_arg_eval '$(command)' '$(false command)'
|
||||
test_q_arg_eval semicolon '; false'
|
||||
test_q_arg_eval vars '$aaa ${bbb} "${ccc} $ddd"'
|
||||
test_q_arg_eval if-then-else 'if false; then false; else false; fi'
|
||||
test_q_arg_eval file-redirect 'echo a > /no-perm 2> /no-perm'
|
||||
test_q_arg_eval case-stmt 'case $empty in "") false;; a) broken ;; esac'
|
||||
test_q_arg_eval comment 'unexistent #'
|
||||
test_q_arg_eval func 'func () { } # syntax error'
|
||||
|
||||
test_q_expand basic 'a b c aaa d' a b c '$aaa' d
|
||||
test_q_expand double-quotes '" " " "bbb"' '"' '" "' '"$bbb"'
|
||||
test_q_expand spaces ' ccc' ' ' ' ' '${ccc}'
|
||||
# Note the *no expected space* here!
|
||||
test_q_expand non-existent '' '$empty' '${empty}'
|
||||
test_q_expand non-existent-2 '"" ""' '"$empty"' '"${empty}"'
|
||||
# TODO: Intentionally not checking '$(cmd)' yet.
|
||||
test_q_expand '`command`' '`aaa bbb`' '`$aaa $empty${bbb}`'
|
||||
|
||||
$all_shells_exit_cmd && rm -rf fltest*
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Unit tests for funclib.sh
|
||||
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2015-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
. "$abs_aux_dir"/funclib.sh || exit 1
|
||||
. "$abs_aux_dir"/options-parser || exit 1
|
||||
|
||||
set -e
|
||||
|
||||
scriptversion='test-version'
|
||||
|
||||
func_help ()
|
||||
{
|
||||
$ECHO "HELP"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
# Make sure that setting <func_name>_result has no effect if we return non-zero
|
||||
# return value.
|
||||
test_prep_do_nothing ()
|
||||
{
|
||||
:
|
||||
}
|
||||
func_add_hook func_options_prep test_prep_do_nothing
|
||||
|
||||
|
||||
test_prep_shortcuts ()
|
||||
{
|
||||
debug_on=
|
||||
test x--debug = "x$1" && debug_on=--debug && shift
|
||||
|
||||
case $1 in
|
||||
short|shortc|shortcu|shortcut)
|
||||
shift
|
||||
func_quote eval --test SHORTCUT $debug_on ${1+"$@"}
|
||||
test_prep_shortcuts_result=$func_quote_result
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
func_add_hook func_options_prep test_prep_shortcuts
|
||||
|
||||
|
||||
test_parse_split_short ()
|
||||
{
|
||||
while test $# -gt 0
|
||||
do
|
||||
_G_opt=$1 ; shift
|
||||
case $_G_opt in
|
||||
-t?*)
|
||||
func_split_short_opt "$_G_opt"
|
||||
set dummy "$func_split_short_opt_name" \
|
||||
"$func_split_short_opt_arg" ${1+"$@"}
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set dummy "$_G_opt" ${1+"$@"} ; shift
|
||||
;;
|
||||
esac
|
||||
break
|
||||
done
|
||||
|
||||
func_quote eval ${1+"$@"}
|
||||
test_parse_split_short_result=$func_quote_result
|
||||
}
|
||||
func_add_hook func_parse_options test_parse_split_short
|
||||
|
||||
|
||||
test_parse_subst_equal_signs ()
|
||||
{
|
||||
_G_opt=$1 ; shift
|
||||
case $_G_opt in
|
||||
--*=*)
|
||||
func_split_equals "$_G_opt"
|
||||
set dummy "$func_split_equals_lhs" \
|
||||
"$func_split_equals_rhs" ${1+"$@"}
|
||||
shift
|
||||
func_quote eval ${1+"$@"}
|
||||
test_parse_subst_equal_signs_result=$func_quote_result
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
func_add_hook func_parse_options test_parse_subst_equal_signs
|
||||
|
||||
|
||||
test_parse_do_nothing ()
|
||||
{
|
||||
:
|
||||
}
|
||||
func_add_hook func_parse_options test_parse_do_nothing
|
||||
|
||||
|
||||
test_parse_eat_test ()
|
||||
{
|
||||
_t_parse_match=false
|
||||
_G_opt=$1 ; shift
|
||||
case $_G_opt in
|
||||
--test|-t)
|
||||
_t_parse_match=:
|
||||
if test $# = 0; then
|
||||
func_missing_arg $_G_opt
|
||||
else
|
||||
opt_test=$1
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if $_t_parse_match; then
|
||||
func_quote eval ${1+"$@"}
|
||||
test_parse_eat_test_result=$func_quote_result
|
||||
fi
|
||||
}
|
||||
func_add_hook func_parse_options test_parse_eat_test
|
||||
|
||||
|
||||
test_validate_do_nothing ()
|
||||
{
|
||||
:
|
||||
}
|
||||
func_add_hook func_validate_options test_validate_do_nothing
|
||||
|
||||
|
||||
test_validate_eat_sth ()
|
||||
{
|
||||
if test validate_out = "$1"; then
|
||||
shift
|
||||
func_quote eval ${1+"$@"}
|
||||
test_validate_eat_sth_result=$func_quote_result
|
||||
fi
|
||||
}
|
||||
func_add_hook func_validate_options test_validate_eat_sth
|
||||
|
||||
|
||||
unset_test_opt ()
|
||||
{
|
||||
case $# in
|
||||
0)
|
||||
$ECHO UNSET_TEST
|
||||
;;
|
||||
1)
|
||||
$ECHO "ONE_ARG $*"
|
||||
;;
|
||||
2)
|
||||
case $1 in
|
||||
eval)
|
||||
eval "$2"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
3)
|
||||
$ECHO THREE_ARGS
|
||||
;;
|
||||
*)
|
||||
$ECHO MORE_ARGS
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
func_options ${1+"$@"}
|
||||
eval set dummy "$func_options_result"; shift
|
||||
|
||||
case ${opt_test-unset} in
|
||||
'')
|
||||
$ECHO "EMPTY_TEST"
|
||||
;;
|
||||
unset)
|
||||
unset_test_opt ${1+"$@"}
|
||||
;;
|
||||
false)
|
||||
$ECHO "FALSE_TEST"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
$ECHO $opt_test
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Unit tests for option-parser
|
||||
|
||||
# This is free software. There is NO warranty; not even for
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Copyright (C) 2015-2019, 2021, 2023-2024 Bootstrap Authors
|
||||
#
|
||||
# This file is dual licensed under the terms of the MIT license
|
||||
# <https://opensource.org/licenses/MIT>, and GPL version 2 or later
|
||||
# <https://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
||||
# these licenses when using or redistributing this software or any of
|
||||
# the files within it. See the URLs above, or the file `LICENSE`
|
||||
# included in the Bootstrap distribution for the full license texts.
|
||||
|
||||
# Please report bugs or propose patches to:
|
||||
# <https://github.com/gnulib-modules/bootstrap/issues>
|
||||
|
||||
all_shells_script=$0
|
||||
. "$abs_srcdir/test-all-shells.sh"
|
||||
|
||||
. "$abs_aux_dir"/options-parser || exit 1
|
||||
|
||||
helper="$__GL_ALL_SHELLS_SHELL $abs_srcdir/test-option-parser-helper"
|
||||
|
||||
check_output_inner ()
|
||||
{
|
||||
exp_output=$1 ; shift
|
||||
exp_retval=$1 ; shift
|
||||
|
||||
func_quote pretty ${1+"$@"}
|
||||
$ECHO "[[ output check ]] args: $func_quote_result"
|
||||
|
||||
output=`$helper ${1+"$@"} 2>/dev/null`
|
||||
rc=$?
|
||||
test "$rc" -eq "$exp_retval" \
|
||||
|| all_shells_error "unexpected exit status $rc $exp_retval"
|
||||
|
||||
if test "$exp_output" = "$output"
|
||||
then
|
||||
:
|
||||
else
|
||||
$ECHO "expected:"
|
||||
$ECHO "$exp_output"
|
||||
$ECHO "given:"
|
||||
$ECHO "$output"
|
||||
all_shells_error "unexpected output"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
check_output ()
|
||||
{
|
||||
_co_exp_output=$1 ; shift
|
||||
_co_exp_retval=$1 ; shift
|
||||
check_output_inner "$_co_exp_output" "$_co_exp_retval" ${1+"$@"}
|
||||
check_output_inner "$_co_exp_output" "$_co_exp_retval" --debug ${1+"$@"}
|
||||
}
|
||||
|
||||
|
||||
check_retval ()
|
||||
{
|
||||
exp_retval=$1 ; shift
|
||||
func_quote pretty ${1+"$@"}
|
||||
$ECHO "[[ retval check ]] args: $func_quote_result"
|
||||
$helper ${1+"$@"} >/dev/null 2>/dev/null
|
||||
rc=$?
|
||||
test "$rc" -eq "$exp_retval" \
|
||||
|| all_shells_error "unexpected retval $rc (should be $exp_retval)"
|
||||
}
|
||||
|
||||
|
||||
grep_output ()
|
||||
{
|
||||
grep_for=$1 ; shift
|
||||
exp_retval=$1 ; shift
|
||||
|
||||
func_quote pretty ${1+"$@"}
|
||||
$ECHO "[[ grep for '$grep_for' ]] args: $func_quote_result"
|
||||
|
||||
output=`$helper ${1+"$@"} 2>/dev/null`
|
||||
rc=$?
|
||||
case $output in
|
||||
*$grep_for*) : ;;
|
||||
*) all_shells_error "$grep_for is not in stdout $output" ;;
|
||||
esac
|
||||
|
||||
test "$rc" -eq "$exp_retval" \
|
||||
|| all_shells_error "unexpected retval $rc (should be $exp_retval)"
|
||||
}
|
||||
|
||||
|
||||
check_output HELP 0 --help
|
||||
check_output HELP 0 --test jej --help
|
||||
check_output HELP 0 --test=jej --help
|
||||
check_output HELP 0 --test= --help
|
||||
|
||||
check_output EMPTY_TEST 0 --test=
|
||||
check_output EMPTY_TEST 0 -t ''
|
||||
check_output EMPTY_TEST 0 --test ''
|
||||
check_output FALSE_TEST 1 --test=false
|
||||
check_output FALSE_TEST 1 -tfalse
|
||||
check_output FALSE_TEST 1 -t false
|
||||
check_output UNSET_TEST 0
|
||||
check_output 'ONE_ARG a' 0 a
|
||||
check_output THREE_ARGS 0 a b c
|
||||
check_output MORE_ARGS 0 a b c d
|
||||
|
||||
check_output SHORTCUT 0 short
|
||||
check_output SHORTCUT 0 shortcut
|
||||
check_output HELP 0 short --help
|
||||
|
||||
check_output eval 4 eval 'echo eval ; exit 4'
|
||||
check_output eval 4 validate_out eval 'echo eval ; exit 4'
|
||||
|
||||
# No argument.
|
||||
check_retval 1 --test
|
||||
check_retval 1 --not-existent
|
||||
check_retval 1 short --not-existent
|
||||
|
||||
grep_output test-version 0 --version
|
||||
grep_output test-version 0 --version --whatever
|
||||
grep_output test-version 0 --debug --version
|
||||
|
||||
# TODO: Shouldn't this code be able to parse multiple occurrences of
|
||||
# single option (IOW, hooks should be called in loop..)?
|
||||
# check_output FALSE_TEST 1 short --test false
|
||||
# check_output FALSE_TEST 1 --test a --test false
|
||||
|
||||
$all_shells_exit_cmd
|
||||
@@ -0,0 +1,30 @@
|
||||
--- gnulib/build-aux/announce-gen 2011-10-19 01:26:27.000000000 +0700
|
||||
+++ gl/build-aux/announce-gen 2011-10-19 16:54:12.000000000 +0700
|
||||
@@ -449,7 +449,14 @@
|
||||
|
||||
<\#secure method=pgpmime mode=sign>
|
||||
|
||||
-FIXME: put comments here
|
||||
+Libtoolers!
|
||||
+
|
||||
+The Libtool Team is pleased to announce the release of $package_name $curr_version.
|
||||
+
|
||||
+GNU Libtool hides the complexity of using shared libraries behind a
|
||||
+consistent, portable interface. GNU Libtool ships with GNU libltdl, which
|
||||
+hides the complexity of loading dynamic runtime libraries (modules)
|
||||
+behind a consistent, portable interface.
|
||||
|
||||
EOF
|
||||
|
||||
@@ -497,6 +504,11 @@
|
||||
$release_type eq 'stable'
|
||||
or print_changelog_deltas ($package_name, $prev_version);
|
||||
|
||||
+ print <<EOF;
|
||||
+
|
||||
+Enjoy!
|
||||
+EOF
|
||||
+
|
||||
exit 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--- ./gnulib/build-aux/do-release-commit-and-tag
|
||||
+++ gl/build-aux/do-release-commit-and-tag
|
||||
@@ -5,6 +5,9 @@
|
||||
# will serve to identify the release, so apply a signed tag to it as well.
|
||||
VERSION=2018-03-07.03 # UTC
|
||||
|
||||
+# Make sure we've evaluated scripts we depend on.
|
||||
+test -z "$progpath" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh
|
||||
+
|
||||
# Note: this is a bash script (could be zsh or dash)
|
||||
|
||||
# Copyright (C) 2009-2024 Free Software Foundation, Inc.
|
||||
@@ -125,10 +128,8 @@
|
||||
|| die 'failed to determine previous version number from .prev-version'
|
||||
|
||||
# Verify that $ver is sensible (> .prev-version).
|
||||
-case $(printf "%s\n%s\n" "$prev_ver" "$ver"|sort -V -u|tr '\n' ':') in
|
||||
- "$prev_ver:$ver:") ;;
|
||||
- *) die "invalid version: $ver (<= $prev_ver)";;
|
||||
-esac
|
||||
+func_lt_ver "$prev_ver" "$ver" \
|
||||
+ || die "invalid version: $ver (<= $prev_ver)"
|
||||
|
||||
case $type in
|
||||
alpha|beta|stable) ;;
|
||||
@@ -0,0 +1,51 @@
|
||||
--- gnulib/top/README-release
|
||||
+++ README-release
|
||||
@@ -1,5 +1,9 @@
|
||||
Here are most of the steps we (maintainers) follow when making a release.
|
||||
|
||||
+* If you don't yet have gnu ftp upload rights, read this:
|
||||
+
|
||||
+ https://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html#Automated-Upload-Registration
|
||||
+
|
||||
* Start from a clean, up-to-date git directory on "master":
|
||||
|
||||
make -k maintainer-clean || { ./configure && make maintainer-clean; }
|
||||
@@ -27,10 +31,25 @@ Here are most of the steps we (maintainers) follow when making a release.
|
||||
|
||||
./bootstrap && ./configure
|
||||
|
||||
+* Double check that serial number updates in public m4 files weren't
|
||||
+ forgotten since last release (they should be updated in git along with
|
||||
+ commits that require it so that users can work with git snapshots).
|
||||
+
|
||||
+* Update the LTDL_VERSION_INFO in libltdl/ltdl.mk for changes since
|
||||
+ the last release.
|
||||
+
|
||||
+* Run "./bootstrap && ./configure".
|
||||
+
|
||||
* Pre-release testing: ensure that the following commands succeed:
|
||||
|
||||
c=check ve=check-very-expensive; git grep -q "^$ve:\$" && c=$ve
|
||||
make $c syntax-check distcheck
|
||||
+ make distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-ltdl-install
|
||||
+ make distcheck DISTCHECK_CONFIGURE_FLAGS=--program-prefix=g
|
||||
+ make distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-shared
|
||||
+ make distcheck CXX=g++
|
||||
+
|
||||
+ If there are any problems, fix them and start again.
|
||||
|
||||
* To (i) set the date, version number, and release TYPE on line 3 of
|
||||
NEWS, (ii) commit that, and (iii) tag the release, run
|
||||
@@ -98,4 +115,12 @@
|
||||
|
||||
to update the on-line manual accessible at
|
||||
|
||||
https://www.gnu.org/software/@PACKAGE@/manual/
|
||||
+
|
||||
+ Ensure that the on-line documentation links to the latest stable release:
|
||||
+
|
||||
+ https://www.gnu.org/software/@PACKAGE@/
|
||||
+
|
||||
+ On-line documentation is updated through the CVS repository:
|
||||
+
|
||||
+ https://savannah.gnu.org/cvs/?group=@PACKAGE@
|
||||
@@ -0,0 +1,13 @@
|
||||
# See lib/git-merge-changelog.c for making this useful.
|
||||
ChangeLog merge=merge-changelog
|
||||
|
||||
# Run this to make 'git diff' on texinfo files give nicer hunk context:
|
||||
# git config diff.texinfo.funcname '^@node[ ][ ]*\\([^,][^,]*\\)'
|
||||
*.texi* diff=texinfo
|
||||
|
||||
# Run this to make 'git diff' on .m4 files give nicer hunk context:
|
||||
# git config diff.m4.xfuncname '^((AC_DEFUN|m4_define)[^,)]*)'
|
||||
*.m4 diff=m4
|
||||
|
||||
# Improve diff hunk context on Python files.
|
||||
*.py diff=python
|
||||
@@ -0,0 +1,8 @@
|
||||
*.orig
|
||||
*.rej
|
||||
*~
|
||||
.#*
|
||||
\#*#
|
||||
allsnippets.tmp
|
||||
amsnippet.tmp
|
||||
testdir*
|
||||
@@ -0,0 +1,30 @@
|
||||
# Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# This file exists to satisfy the standard layout of a Python program:
|
||||
# - a single .py file in the parent directory,
|
||||
# - any number of .py files in a subdirectory.
|
||||
# Explanation: https://stackoverflow.com/questions/16981921/relative-imports-in-python-3
|
||||
# Without this standard layout, we got
|
||||
# - errors at runtime:
|
||||
# from . import constants => ImportError: attempted relative import with no known parent package
|
||||
# from pygnulib import constants => ModuleNotFoundError: No module named 'pygnulib'
|
||||
# - error markers in Eclipse + PyDev.
|
||||
|
||||
from pygnulib import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
main.main_with_exception_handling()
|
||||
@@ -0,0 +1,18 @@
|
||||
$Id: COPYING,v 1.3 2006-10-26 16:20:28 eggert Exp $
|
||||
The files in here are mostly copyright (C) Free Software Foundation, and
|
||||
are under assorted licenses. Mostly, but not entirely, GPL.
|
||||
|
||||
Many modules are provided dual-license, either GPL or LGPL at your
|
||||
option. The headers of files in the lib directory (e.g., lib/error.c)
|
||||
state GPL for convenience, since the bulk of current gnulib users are
|
||||
GPL'd programs. But the files in the modules directory (e.g.,
|
||||
modules/error) state the true license of each file, and when you use
|
||||
'gnulib-tool --lgpl --import <modules>', gnulib-tool either rewrites
|
||||
the files to have an LGPL header as part of copying them from gnulib
|
||||
to your project directory, or fails because the modules you requested
|
||||
were not licensed under LGPL.
|
||||
|
||||
Some of the source files in lib/ have different licenses. Also, the
|
||||
copy of maintain.texi in doc/ has a verbatim-copying license, and
|
||||
doc/standards.texi and make-stds.texi are GFDL. Most (but not all)
|
||||
m4/*.m4 files have nearly unlimited licenses.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,468 @@
|
||||
Table of contents:
|
||||
1) Dependencies for using gnulib-tool (maintainer environment)
|
||||
2) Dependencies for building the imported code (target environment)
|
||||
|
||||
|
||||
1) Dependencies for using gnulib-tool (maintainer environment)
|
||||
**************************************************************
|
||||
|
||||
The following packages are needed by maintainers for using 'gnulib-tool'.
|
||||
We call this the "maintainer environment", although it is not necessarily
|
||||
a maintainer's or developer's machine; it can also be some containerized
|
||||
environment.
|
||||
|
||||
In general, Gnulib prefers the latest stable version of each package,
|
||||
but in some cases it also supports older versions; this caters to
|
||||
commonly-used software distributions that may lag behind the latest
|
||||
stable package. Support for older versions is not guaranteed, though,
|
||||
and the version numbers in the following list may be incremented
|
||||
at any time.
|
||||
|
||||
* A C runtime, compiler, linker, etc.
|
||||
+ Mandatory. Using the platform's native 'cc' gives good portability
|
||||
exposure, but you can also use GCC 3.1 or newer.
|
||||
+ GCC Homepage:
|
||||
https://gcc.gnu.org/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gcc/
|
||||
|
||||
* A 'make' utility.
|
||||
+ Mandatory. Using the platform's native 'make' gives good portability
|
||||
exposure for in-tree builds, but VPATH builds on OpenBSD or Solaris
|
||||
require GNU Make 3.79.1 or newer.
|
||||
+ GNU Make Homepage:
|
||||
https://www.gnu.org/software/make/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/make/
|
||||
|
||||
* GNU M4 1.4.5 or newer.
|
||||
+ Mandatory.
|
||||
1.4.5 or newer is mandatory, but 1.4.9 or newer is recommended.
|
||||
If you want to build it from source, use the tarball from
|
||||
https://gitlab.com/gnu-m4/ci-distcheck/-/jobs/artifacts/master/raw/m4-snapshot.tar?job=check-optimized
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/m4/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/m4/
|
||||
|
||||
* Autoconf 2.64 or newer.
|
||||
+ Mandatory.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/autoconf/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/autoconf/
|
||||
|
||||
* Automake 1.14 or newer.
|
||||
+ Mandatory.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/automake/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/automake/
|
||||
|
||||
* A shell
|
||||
+ Mandatory. Using the platform's native 'sh' gives good portability
|
||||
exposure, but you can also use Bash.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/bash/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/bash/
|
||||
|
||||
* Core POSIX utilities, including:
|
||||
[ basename cat chgrp chmod chown cp dd echo expand expr
|
||||
false hostname install join kill ln ls md5sum mkdir mkfifo
|
||||
mknod mv printenv pwd rm rmdir sleep sort tee test touch
|
||||
true uname
|
||||
+ Mandatory. Using the platform's native utilities gives good portability
|
||||
exposure, but you can also use GNU coreutils.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/coreutils/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/coreutils/
|
||||
|
||||
* The comparison utilities 'cmp' and 'diff'.
|
||||
+ Mandatory. Using the platform's native utilities gives good portability
|
||||
exposure, but you can also use GNU diffutils.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/diffutils/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/diffutils/
|
||||
|
||||
* The patch utility 'patch'.
|
||||
+ Mandatory if you use gnulib-local diffs. Using the platform's native
|
||||
utilities gives good portability exposure, but you can also use GNU
|
||||
patch.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/patch/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/patch/
|
||||
|
||||
* Grep.
|
||||
+ Mandatory. Using the platform's native grep gives good portability
|
||||
exposure, but you can also use GNU grep.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/grep/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/grep/
|
||||
|
||||
* Awk.
|
||||
+ Mandatory.
|
||||
Using the platform's native awk, mawk, or nawk gives good portability
|
||||
exposure, but you can also use GNU awk.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/gawk/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gawk/
|
||||
|
||||
* Python 3.7 or newer.
|
||||
* Recommended.
|
||||
Without it, gnulib-tool is between 8 times and 100 times slower and may lack
|
||||
functionality added after April 2024.
|
||||
+ Homepage:
|
||||
https://www.python.org/
|
||||
+ Download:
|
||||
https://www.python.org/downloads/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: python3,
|
||||
- On Red Hat distributions: python3.
|
||||
- Other: https://repology.org/project/python/versions
|
||||
|
||||
* GNU gettext.
|
||||
+ If your project wants to follow GNU Coding Standards:
|
||||
+ Always use the newest available gettext release, see
|
||||
<https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html>.
|
||||
+ Use the 'gettext' module.
|
||||
+ If your project cares more about ease of development on older platforms:
|
||||
+ gettext 0.17 or newer.
|
||||
+ Use the 'gettext-h' module.
|
||||
+ Recommended.
|
||||
Needed if you use modules that use internationalization (many do).
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/gettext/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gettext/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: gettext,
|
||||
- On Red Hat distributions: gettext.
|
||||
- Other: https://repology.org/project/gettext/versions
|
||||
|
||||
* Bison 2.0 or newer.
|
||||
+ Recommended.
|
||||
Needed if you use the 'parse-datetime' module.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/bison/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/bison/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: bison,
|
||||
- On Red Hat distributions: bison.
|
||||
- Other: https://repology.org/project/bison/versions
|
||||
|
||||
* GNU gperf 3.0.1 or newer.
|
||||
+ 3.0.1 or newer is mandatory, but 3.1 or newer is recommended.
|
||||
Needed if you use the 'iconv_open' module or some of the
|
||||
unictype/*, unicase/*, uninorm/* modules.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/gperf/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gperf/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: gperf,
|
||||
- On Red Hat distributions: gperf.
|
||||
- Other: https://repology.org/project/gperf/versions
|
||||
|
||||
* Texinfo 4.6 or newer.
|
||||
+ Recommended.
|
||||
Needed if you use modules that include documentation.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/texinfo/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/texinfo/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: texinfo,
|
||||
- On Red Hat distributions: texinfo.
|
||||
- Other: https://repology.org/project/texinfo/versions
|
||||
|
||||
* GNU sed.
|
||||
+ Recommended.
|
||||
Needed on platforms where the vendor's 'sed' program is too buggy.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/sed/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/sed/
|
||||
|
||||
* GNU libtool 1.5.22 or newer.
|
||||
+ Optional.
|
||||
Needed if you want to invoke gnulib-tool with option --libtool.
|
||||
libtool 2.2.x or newer is needed if you want to invoke gnulib-tool
|
||||
with options --create-testdir/--test and --libtool.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/libtool/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/libtool/
|
||||
|
||||
* GNU tar 1.28 or newer.
|
||||
+ Optional.
|
||||
Needed if you use the 'gnumakefile' module, which sets TAR_OPTIONS
|
||||
to --sort=names (added in version 1.28) in GNUmakefile for 'make dist'.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/tar/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/tar/
|
||||
|
||||
Note: Solaris 10 is no longer supported as maintainer environment.
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00076.html>
|
||||
|
||||
|
||||
2) Dependencies for building the imported code (target environment)
|
||||
*******************************************************************
|
||||
|
||||
The following packages are needed for building the package that imports
|
||||
code from Gnulib.
|
||||
|
||||
* A C runtime, compiler, linker, etc.
|
||||
+ Mandatory. Using the platform's native 'cc' gives good portability
|
||||
exposure, but you can also use GCC 3.1 or newer.
|
||||
+ GCC Homepage:
|
||||
https://gcc.gnu.org/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gcc/
|
||||
|
||||
* A 'make' utility.
|
||||
+ Mandatory. Using the platform's native 'make' gives good portability
|
||||
exposure for in-tree builds, but VPATH builds on OpenBSD or Solaris
|
||||
require GNU Make 3.79.1 or newer.
|
||||
+ GNU Make Homepage:
|
||||
https://www.gnu.org/software/make/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/make/
|
||||
|
||||
* A shell
|
||||
+ Mandatory. Using the platform's native 'sh' gives good portability
|
||||
exposure, but you can also use Bash.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/bash/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/bash/
|
||||
|
||||
* Core POSIX utilities, including:
|
||||
[ basename cat chgrp chmod chown cp dd echo expand expr
|
||||
false hostname install kill ln ls md5sum mkdir mkfifo
|
||||
mknod mv printenv pwd rm rmdir sleep sort tee test touch
|
||||
true uname
|
||||
+ Mandatory. Using the platform's native utilities gives good portability
|
||||
exposure, but you can also use GNU coreutils.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/coreutils/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/coreutils/
|
||||
|
||||
* The comparison utilities 'cmp' and 'diff'.
|
||||
+ Mandatory. Using the platform's native utilities gives good portability
|
||||
exposure, but you can also use GNU diffutils.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/diffutils/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/diffutils/
|
||||
|
||||
* Grep.
|
||||
+ Mandatory. Using the platform's native grep gives good portability
|
||||
exposure, but you can also use GNU grep.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/grep/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/grep/
|
||||
|
||||
* Awk.
|
||||
+ Mandatory.
|
||||
Using the platform's native awk, mawk, or nawk gives good portability
|
||||
exposure, but you can also use GNU awk.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/gawk/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gawk/
|
||||
|
||||
Prerequisites on Windows
|
||||
------------------------
|
||||
|
||||
* Cygwin
|
||||
+ Required.
|
||||
Provides a POSIX-like environment and binary packages necessary to
|
||||
build and run software. Native Windows binaries can be built with
|
||||
a packaged mingw tool chain. This method is preferred over MSYS2.
|
||||
+ Homepage:
|
||||
https://cygwin.com/
|
||||
+ Download:
|
||||
https://cygwin.com/install.html
|
||||
|
||||
Libraries
|
||||
---------
|
||||
|
||||
Various modules work best with certain libraries installed. These are runtime
|
||||
dependencies that are also build dependencies.
|
||||
|
||||
For modules 'abort-debug' and 'stack-trace':
|
||||
* libbacktrace
|
||||
+ Recommended.
|
||||
Needed for producing C stack traces with source file names and
|
||||
line numbers.
|
||||
+ Homepage:
|
||||
https://github.com/ianlancetaylor/libbacktrace
|
||||
+ Download:
|
||||
https://github.com/ianlancetaylor/libbacktrace
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libgcc-N-dev,
|
||||
- On Red Hat distributions: --.
|
||||
- Other: https://repology.org/project/libbacktrace/versions
|
||||
|
||||
For module 'acl':
|
||||
* libacl
|
||||
+ Recommended on Linux systems.
|
||||
Needed so that the creation of backup files respects the access control
|
||||
lists (ACLs) set on the original files.
|
||||
+ Homepage:
|
||||
https://savannah.nongnu.org/projects/acl/
|
||||
+ Download:
|
||||
https://download.savannah.nongnu.org/releases/acl/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libacl1-dev,
|
||||
- On Red Hat distributions: libacl-devel.
|
||||
- Other: https://repology.org/project/acl/versions
|
||||
* libattr
|
||||
+ Recommended on Linux systems.
|
||||
Needed so that the creation of backup files respects the access control
|
||||
lists (ACLs) set on the original files, with fewer system calls.
|
||||
+ Homepage:
|
||||
https://savannah.nongnu.org/projects/attr/
|
||||
+ Download:
|
||||
https://download.savannah.nongnu.org/releases/attr/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libattr1-dev,
|
||||
- On Red Hat distributions: libattr-devel.
|
||||
- Other: https://repology.org/project/attr/versions
|
||||
|
||||
For module 'gettext-h':
|
||||
* libintl, part of GNU gettext
|
||||
+ Not needed on systems with glibc.
|
||||
But highly recommended on all other systems.
|
||||
Needed for localization (translation) of messages to the user's
|
||||
native language.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/gettext/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gettext/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: --,
|
||||
- On Red Hat distributions: --.
|
||||
- Other: https://repology.org/project/gettext/versions
|
||||
+ If it is installed in a nonstandard directory, pass the option
|
||||
--with-libintl-prefix=DIR to 'configure'.
|
||||
|
||||
For module 'iconv':
|
||||
* GNU libiconv
|
||||
+ Not needed on systems with glibc and on NetBSD.
|
||||
But highly recommended on all other systems.
|
||||
Needed for character set conversion of strings from/to Unicode.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/libiconv/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/libiconv/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: --,
|
||||
- On Red Hat distributions: --.
|
||||
- Other: https://repology.org/project/libiconv/versions
|
||||
+ If it is installed in a nonstandard directory, pass the option
|
||||
--with-libiconv-prefix=DIR to 'configure'.
|
||||
+ On mingw, a slim alternative is the 'win-iconv' package version 0.0.8
|
||||
from https://github.com/win-iconv/win-iconv .
|
||||
|
||||
For module 'libgmp':
|
||||
* GNU gmp.
|
||||
+ Recommended.
|
||||
Needed for fast multiprecision computations.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/gmp/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/gmp/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libgmp-dev,
|
||||
- On Red Hat distributions: gmp-devel.
|
||||
- Other: https://repology.org/project/gmp/versions
|
||||
+ If it is installed in a nonstandard directory, pass the option
|
||||
--with-libgmp-prefix to 'configure'.
|
||||
|
||||
For module 'readline':
|
||||
* GNU readline
|
||||
+ Recommended.
|
||||
Needed for interactive editing of textual input.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/readline/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/readline/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libreadline-dev,
|
||||
- On Red Hat distributions: readline-devel.
|
||||
- Other: https://repology.org/project/readline/versions
|
||||
+ If it is installed in a nonstandard directory, pass the option
|
||||
--with-libreadline-prefix=DIR to 'configure'.
|
||||
|
||||
For modules 'terminfo' and 'termcap':
|
||||
* GNU ncurses (preferred)
|
||||
or libtermcap (discouraged) or a curses library (legacy).
|
||||
+ Recommended.
|
||||
Needed for fancy input/output in terminal emulators.
|
||||
+ Homepage:
|
||||
https://www.gnu.org/software/ncurses/
|
||||
+ Download:
|
||||
https://ftp.gnu.org/gnu/ncurses/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libncurses-dev,
|
||||
- On Red Hat distributions: ncurses-devel.
|
||||
- Other: https://repology.org/project/ncurses/versions
|
||||
+ If it is installed in a nonstandard directory, pass the option
|
||||
--with-libncurses-prefix=DIR or --with-libtermcap-prefix to 'configure'.
|
||||
|
||||
For modules 'crypto/md5-buffer', 'crypto/sha*-buffer':
|
||||
* OpenSSL.
|
||||
+ Optional.
|
||||
Needed for optimized crypto hash sums.
|
||||
+ Homepage:
|
||||
https://www.openssl.org/
|
||||
+ Download:
|
||||
https://www.openssl.org/source/
|
||||
+ Pre-built package name:
|
||||
- On Debian and Debian-based systems: libssl-dev,
|
||||
- On Red Hat distributions: openssl-devel.
|
||||
- Other: https://repology.org/project/openssl/versions
|
||||
|
||||
Locales
|
||||
-------
|
||||
|
||||
If your package includes the tests for the Gnulib modules that you imported,
|
||||
you will want to maximize the test coverage of these tests, that is, to
|
||||
minimize the number of tests that are skipped. To this effect, you need to
|
||||
install a couple of locales, used by the tests.
|
||||
|
||||
You can get a listing of the locales installed by default through
|
||||
$ locale -a
|
||||
(Note: On glibc systems, this command displays the encoding names in a
|
||||
mutilated form, e.g. it transforms "en_US.UTF-8" to "en_US.utf8".)
|
||||
|
||||
To install the needed locales on glibc systems:
|
||||
|
||||
$ sudo localedef -i en_US -f UTF-8 en_US.UTF-8
|
||||
$ sudo localedef -i ar_SA -f ISO-8859-6 ar_SA.ISO-8859-6
|
||||
$ sudo localedef -i de_DE -f UTF-8 de_DE.UTF-8
|
||||
$ sudo localedef -i es_ES -f UTF-8 es_ES.UTF-8
|
||||
$ sudo localedef -i fa_IR -f UTF-8 fa_IR
|
||||
$ sudo localedef -i fr_FR -f ISO-8859-1 fr_FR.ISO-8859-1
|
||||
$ sudo localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
|
||||
$ sudo localedef -i ja_JP -f EUC-JP ja_JP.EUC-JP
|
||||
$ sudo localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
|
||||
$ sudo localedef -i zh_CN -f GB18030 zh_CN.GB18030
|
||||
$ sudo localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS
|
||||
|
||||
On Debian and Debian-based systems, if you want these locales to be
|
||||
persistent across automatic system updates, the approach is different:
|
||||
There, you need to enable the locales in the file /etc/locale.gen and
|
||||
then run
|
||||
$ sudo locale-gen
|
||||
@@ -0,0 +1,715 @@
|
||||
Information for GNU Gnulib maintainers and contributors
|
||||
*******************************************************
|
||||
|
||||
Using git
|
||||
=========
|
||||
|
||||
* We don't use topic branches. Changes are usually small enough that
|
||||
they can be committed directly to the master branch, after appropriate
|
||||
testing.
|
||||
|
||||
* We maintain stable branches, though, as described in the documentation:
|
||||
https://www.gnu.org/software/gnulib/manual/html_node/Stable-Branches.html
|
||||
When backporting a commit to a stable branch of the last year, be sure
|
||||
to update the copyright year of each modified file (since we don't run
|
||||
"make update-copyright" on the stable branches).
|
||||
|
||||
* We use a linear git history — no merges. To work in this setting, it's
|
||||
recommended that you configure git with 'git config pull.rebase = true'.
|
||||
|
||||
* Before pushing a commit, it is highly recommended that you review it in
|
||||
its entirety. The easiest ways to do so are
|
||||
* to run
|
||||
$ git format-patch -1
|
||||
and then read the patch in an editor that has syntax-colouring of patch
|
||||
files, or
|
||||
* to run
|
||||
$ gitk
|
||||
|
||||
* We update the ChangeLog by hand. The commit message is usually identical
|
||||
to the ChangeLog entry, with the date and author line removed, with
|
||||
the leading tabs removed, and with a blank line after the commit's
|
||||
summary line.
|
||||
In order to work efficiently with ChangeLog files, it is recommended that
|
||||
you configure git to use the git-merge-changelog driver; see the instructions
|
||||
in the lib/git-merge-changelog.c file.
|
||||
Note: This driver reasonably keeps the ChangeLog entries together; however,
|
||||
it does not always keep them in the order you would desire. For example,
|
||||
when you had prepared a commit, you try to "git push" it but that fails due
|
||||
to someone else's commit that came earlier, what you need to do is:
|
||||
1. $ git pull
|
||||
2. Verify that your ChangeLog entry is still the top-most one.
|
||||
3. If it is not, then edit ChangeLog to move it to the top, and
|
||||
$ git commit --amend ChangeLog
|
||||
4. $ gitk
|
||||
5. $ git push
|
||||
|
||||
* When you commit a contributor's patch, please
|
||||
- add a reasonable ChangeLog entry in the usual style (meaningful
|
||||
summary line and detailed change list),
|
||||
- if the contribution is so small that it does not require a
|
||||
copyright assignment (cf.
|
||||
https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html )
|
||||
add a line:
|
||||
Copyright-paperwork-exempt: Yes
|
||||
- use the 'git commit' option --author="Contributor Name <email@address>"
|
||||
|
||||
|
||||
License Notices
|
||||
===============
|
||||
|
||||
In *.m4 files, use a notice like this:
|
||||
dnl Copyright (C) YEARS Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
dnl This file is offered as-is, without any warranty.
|
||||
|
||||
In lib/, tests/, build-aux/ files, except those that are shared with glibc,
|
||||
use the license notices from etc/license-notices/ . This avoids gratuitous
|
||||
differences in wording, as well misunderstandings when a license notice
|
||||
would say "This program ...".
|
||||
|
||||
|
||||
Test Suite
|
||||
==========
|
||||
|
||||
When adding a module, add a unit test module as well. This is our best
|
||||
chance to catch portability problems.
|
||||
|
||||
A unit test can have many sub-tests. Try to make the sub-tests independent
|
||||
of each other, so that it becomes easy to disable some sub-tests by enclosing
|
||||
them in #if 0 ... #endif.
|
||||
|
||||
The main() function's exit code meaning is:
|
||||
- 0: PASS
|
||||
- 77: SKIP; you should print the reason why the test is skipped.
|
||||
- 99: ERROR, i.e. test framework error
|
||||
- any other exit code < 126: FAIL
|
||||
|
||||
In tests that #include "macros.h" and use the ASSERT macro:
|
||||
The main() function should, before it returns 0 (for PASS) or 77 (for SKIP)
|
||||
test the value of test_exit_status and return that instead. So:
|
||||
- not
|
||||
return 0;
|
||||
but instead
|
||||
return test_exit_status;
|
||||
- not
|
||||
return result; // where result can be 0 or 1
|
||||
but instead
|
||||
return (result ? result : test_exit_status);
|
||||
- not
|
||||
fputs ("Skipping test: <reason>\n", stderr);
|
||||
return 77;
|
||||
but instead
|
||||
if (test_exit_status != EXIT_SUCCESS)
|
||||
return test_exit_status;
|
||||
fputs ("Skipping test: <reason>\n", stderr);
|
||||
return 77;
|
||||
Only at the beginning of the main() function, when ASSERT has not yet been
|
||||
invoked, we know that test_exit_status must be zero and can therefore write
|
||||
fputs ("Skipping test: <reason>\n", stderr);
|
||||
return 77;
|
||||
directly.
|
||||
|
||||
|
||||
Maintaining high quality
|
||||
========================
|
||||
|
||||
It is a good idea to occasionally create a testdir of all of Gnulib:
|
||||
$ rm -rf ../testdir-all; ./gnulib-tool --create-testdir --dir=../testdir-all --with-c++-tests --without-privileged-tests --single-configure `./all-modules`
|
||||
and test this directory on various platforms:
|
||||
- Linux/glibc systems,
|
||||
- Linux/musl systems,
|
||||
- macOS,
|
||||
- FreeBSD,
|
||||
- NetBSD,
|
||||
- OpenBSD,
|
||||
- AIX,
|
||||
- Solaris 10 and 11,
|
||||
- Cygwin,
|
||||
- Haiku,
|
||||
- Android,
|
||||
- and other platforms of your choice.
|
||||
|
||||
There are two continuous integrations that regularly perform this testing:
|
||||
* On a Linux/glibc system only:
|
||||
https://gitlab.com/gnulib/gnulib-ci
|
||||
This one will catch only the most blatant mistakes.
|
||||
* On many platforms:
|
||||
https://github.com/gnu-gnulib/ci-testdir-check/actions
|
||||
This one runs on many platforms, currently (as of June 2024):
|
||||
- Ubuntu GNU/Linux 22.04
|
||||
- CentOS GNU/Linux 7
|
||||
- Alpine Linux
|
||||
- macOS 11, 12, 13 (all x86_64)
|
||||
- macOS 14 (arm64)
|
||||
- FreeBSD 14.0
|
||||
- NetBSD 10.0
|
||||
- OpenBSD 7.5
|
||||
- Solaris 11.4
|
||||
- Solaris 11 OmniOS
|
||||
- Cygwin 3.3.6 (32 bit) and 3.5.3 (64 bit)
|
||||
- mingw (32 bit and 64 bit)
|
||||
- MSVC (32 bit and 64 bit)
|
||||
and also
|
||||
- on Ubuntu GNU/Linux 22.04 with clang's UBSAN and ASAN sanitizers.
|
||||
This one catches real portability problems.
|
||||
Note that the following platforms are not covered and thus still require
|
||||
occasional manual testing:
|
||||
- AIX
|
||||
- Solaris 10
|
||||
- Haiku
|
||||
- Android
|
||||
- and other platforms of your choice.
|
||||
|
||||
|
||||
Warning Options
|
||||
===============
|
||||
|
||||
For packages that use Gnulib, we recommend to use the 'warnings' or
|
||||
'manywarnings' module, as documented in
|
||||
https://www.gnu.org/software/gnulib/manual/html_node/warnings.html
|
||||
https://www.gnu.org/software/gnulib/manual/html_node/manywarnings.html
|
||||
|
||||
When building Gnulib testdirs, e.g. when preparing a Gnulib patch,
|
||||
there are three possible approaches:
|
||||
|
||||
* The simplest approach, which warns about the most common mistakes, is to
|
||||
use GCC's -Wall option, both for C and C++ compilation units. Just set
|
||||
$ ./configure CPPFLAGS="-Wall"
|
||||
$ make
|
||||
You should generally fix all compiler warnings that you see from this
|
||||
approach.
|
||||
|
||||
* If you are developing on a glibc system and have GCC version 13 binaries
|
||||
available, here's a recipe that will find more mistakes, but is nearly
|
||||
as easy to use. Here, different warning options are needed for C and
|
||||
for C++:
|
||||
$ WARN_GCC13=`echo '
|
||||
-fanalyzer
|
||||
-Wall
|
||||
-Warith-conversion
|
||||
-Wcast-align=strict
|
||||
-Wdate-time
|
||||
-Wdisabled-optimization
|
||||
-Wduplicated-cond
|
||||
-Wextra
|
||||
-Wformat-signedness
|
||||
-Winit-self
|
||||
-Winvalid-pch
|
||||
-Wlogical-op
|
||||
-Wmissing-include-dirs
|
||||
-Wopenmp-simd
|
||||
-Woverlength-strings
|
||||
-Wpacked
|
||||
-Wpointer-arith
|
||||
-Wstrict-overflow
|
||||
-Wsuggest-final-methods
|
||||
-Wsuggest-final-types
|
||||
-Wsync-nand
|
||||
-Wsystem-headers
|
||||
-Wtrampolines
|
||||
-Wuninitialized
|
||||
-Wunknown-pragmas
|
||||
-Wunsafe-loop-optimizations
|
||||
-Wvariadic-macros
|
||||
-Wvector-operation-performance
|
||||
-Wwrite-strings
|
||||
-Warray-bounds=2
|
||||
-Wattribute-alias=2
|
||||
-Wformat-overflow=2
|
||||
-Wformat-truncation=2
|
||||
-Wshift-overflow=2
|
||||
-Wunused-const-variable=2
|
||||
-Wvla-larger-than=4031
|
||||
-Wno-empty-body
|
||||
-Wno-analyzer-allocation-size
|
||||
-Wno-analyzer-fd-double-close
|
||||
-Wno-analyzer-double-fclose
|
||||
-Wno-analyzer-double-free
|
||||
-Wno-analyzer-fd-leak
|
||||
-Wno-analyzer-fd-use-after-close
|
||||
-Wno-analyzer-fd-use-without-check
|
||||
-Wno-analyzer-free-of-non-heap
|
||||
-Wno-analyzer-malloc-leak
|
||||
-Wno-analyzer-mismatching-deallocation
|
||||
-Wno-analyzer-null-argument
|
||||
-Wno-analyzer-null-dereference
|
||||
-Wno-analyzer-out-of-bounds
|
||||
-Wno-analyzer-possible-null-argument
|
||||
-Wno-analyzer-possible-null-dereference
|
||||
-Wno-analyzer-use-after-free
|
||||
-Wno-analyzer-use-of-pointer-in-stale-stack-frame
|
||||
-Wno-analyzer-use-of-uninitialized-value
|
||||
-Wno-analyzer-va-arg-type-mismatch
|
||||
-Wno-attribute-warning
|
||||
-Wno-cast-align
|
||||
-Wno-clobbered
|
||||
-Wno-dangling-pointer
|
||||
-Wno-format
|
||||
-Wno-implicit-fallthrough
|
||||
-Wno-maybe-uninitialized
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-restrict
|
||||
-Wno-sign-compare
|
||||
-Wno-switch
|
||||
-Wno-type-limits
|
||||
-Wno-unused-parameter
|
||||
' | tr -d '\n' | sed -e 's/ */ /g'`
|
||||
$ WARN_CFLAGS_GCC13="$WARN_GCC13 -Wnested-externs -Wshadow=local -Wno-discarded-qualifiers"
|
||||
$ WARN_CXXFLAGS_GCC13="$WARN_GCC13 -Wno-cpp"
|
||||
$ ./configure CFLAGS="-O2 -g $WARN_CFLAGS_GCC13" CXXFLAGS="-O2 -g $WARN_CXXFLAGS_GCC13"
|
||||
$ make
|
||||
You should generally fix all compiler warnings that you see from this
|
||||
approach, or report when this approach produced a pointless warning
|
||||
(so that we can fix the value of WARN_GCC13 above).
|
||||
|
||||
* If you are developing on a glibc system and have GCC version 13 binaries
|
||||
available: Here's a recipe that will find even more mistakes, but it
|
||||
requires that you are willing to filter out and ignore pointless warnings.
|
||||
$ WARN_GCC13=`echo '
|
||||
-fanalyzer
|
||||
-Wall
|
||||
-Warith-conversion
|
||||
-Wcast-align=strict
|
||||
-Wdate-time
|
||||
-Wdisabled-optimization
|
||||
-Wduplicated-cond
|
||||
-Wextra
|
||||
-Wformat-signedness
|
||||
-Winit-self
|
||||
-Winvalid-pch
|
||||
-Wlogical-op
|
||||
-Wmissing-include-dirs
|
||||
-Wnull-dereference
|
||||
-Wopenmp-simd
|
||||
-Woverlength-strings
|
||||
-Wpacked
|
||||
-Wpointer-arith
|
||||
-Wstrict-overflow
|
||||
-Wsuggest-attribute=format
|
||||
-Wsuggest-final-methods
|
||||
-Wsuggest-final-types
|
||||
-Wsync-nand
|
||||
-Wsystem-headers
|
||||
-Wtrampolines
|
||||
-Wuninitialized
|
||||
-Wunknown-pragmas
|
||||
-Wunsafe-loop-optimizations
|
||||
-Wvariadic-macros
|
||||
-Wvector-operation-performance
|
||||
-Wwrite-strings
|
||||
-Warray-bounds=2
|
||||
-Wattribute-alias=2
|
||||
-Wformat-overflow=2
|
||||
-Wformat=2
|
||||
-Wformat-truncation=2
|
||||
-Wimplicit-fallthrough=5
|
||||
-Wshift-overflow=2
|
||||
-Wunused-const-variable=2
|
||||
-Wvla-larger-than=4031
|
||||
-Wno-empty-body
|
||||
-Wno-analyzer-double-fclose
|
||||
-Wno-analyzer-double-free
|
||||
-Wno-analyzer-free-of-non-heap
|
||||
-Wno-analyzer-malloc-leak
|
||||
-Wno-analyzer-null-argument
|
||||
-Wno-analyzer-null-dereference
|
||||
-Wno-analyzer-use-after-free
|
||||
-Wno-attribute-warning
|
||||
-Wno-cast-align
|
||||
-Wno-clobbered
|
||||
-Wno-format-nonliteral
|
||||
-Wno-sign-compare
|
||||
-Wno-type-limits
|
||||
-Wno-unused-parameter
|
||||
' | tr -d '\n' | sed -e 's/ */ /g'`
|
||||
$ WARN_CFLAGS_GCC13="$WARN_GCC13 -Wnested-externs -Wshadow=local"
|
||||
$ WARN_CXXFLAGS_GCC13="$WARN_GCC13 -Wno-cpp"
|
||||
$ ./configure CFLAGS="-O2 -g $WARN_CFLAGS_GCC13" CXXFLAGS="-O2 -g $WARN_CXXFLAGS_GCC13"
|
||||
$ make
|
||||
With this approach, use your own judgement whether to fix warnings
|
||||
arising from your new code or not.
|
||||
Do *not* submit patches to silence warnings from existing code:
|
||||
- For these warnings, often the cure will be worse than the disease.
|
||||
- Some of the warnings are false positives. Rather than silencing
|
||||
these warnings, we prefer to report them in the GCC bug tracker
|
||||
and wait until they are fixed in a future GCC release.
|
||||
|
||||
Similarly, for clang version 16 you can use the following recipe, that uses
|
||||
selected warning options from
|
||||
https://releases.llvm.org/16.0.0/tools/clang/docs/DiagnosticsReference.html :
|
||||
$ WARN_CLANG16=`echo '
|
||||
-Wall
|
||||
-Wanon-enum-enum-conversion
|
||||
-Warc-repeated-use-of-weak
|
||||
-Warray-bounds-pointer-arithmetic
|
||||
-Warray-parameter
|
||||
-Watomic-properties
|
||||
-Wbinary-literal
|
||||
-Wbit-int-extension
|
||||
-Wbitfield-enum-conversion
|
||||
-Wbitwise-op-parentheses
|
||||
-Wbool-operation
|
||||
-Wc++-compat
|
||||
-Wc2x-compat
|
||||
-Wc2x-extensions
|
||||
-Wc99-compat
|
||||
-Wc99-designator
|
||||
-Wc99-extensions
|
||||
-Wcalled-once-parameter
|
||||
-Wcast-function-type
|
||||
-Wchar-subscripts
|
||||
-Wcomment
|
||||
-Wcompletion-handler
|
||||
-Wcomplex-component-init
|
||||
-Wcompound-token-split
|
||||
-Wconsumed
|
||||
-Wconversion
|
||||
-Wcstring-format-directive
|
||||
-Wcuda-compat
|
||||
-Wdate-time
|
||||
-Wdelimited-escape-sequence-extension
|
||||
-Wdeprecated
|
||||
-Wdeprecated-dynamic-exception-spec
|
||||
-Wdeprecated-implementations
|
||||
-Wdeprecated-this-capture
|
||||
-Wdeprecated-writable-strings
|
||||
-Wdirect-ivar-access
|
||||
-Wdocumentation
|
||||
-Wdocumentation-deprecated-sync
|
||||
-Wdocumentation-html
|
||||
-Wdocumentation-pedantic
|
||||
-Wdocumentation-unknown-command
|
||||
-Wdollar-in-identifier-extension
|
||||
-Wduplicate-decl-specifier
|
||||
-Wduplicate-enum
|
||||
-Wduplicate-method-arg
|
||||
-Wduplicate-method-match
|
||||
-Wdynamic-exception-spec
|
||||
-Wembedded-directive
|
||||
-Wempty-init-stmt
|
||||
-Wempty-translation-unit
|
||||
-Wenum-compare-conditional
|
||||
-Wenum-conversion
|
||||
-Wenum-enum-conversion
|
||||
-Wenum-float-conversion
|
||||
-Wexit-time-destructors
|
||||
-Wexpansion-to-defined
|
||||
-Wexplicit-ownership-type
|
||||
-Wextra
|
||||
-Wextra-semi
|
||||
-Wfixed-enum-extension
|
||||
-Wflexible-array-extensions
|
||||
-Wfloat-overflow-conversion
|
||||
-Wfloat-zero-conversion
|
||||
-Wfor-loop-analysis
|
||||
-Wformat
|
||||
-Wformat-pedantic
|
||||
-Wformat-type-confusion
|
||||
-Wformat=2
|
||||
-Wfour-char-constants
|
||||
-Wframe-address
|
||||
-Wfuse-ld-path
|
||||
-Wfuture-attribute-extensions
|
||||
-Wgcc-compat
|
||||
-Wgnu
|
||||
-Wgnu-anonymous-struct
|
||||
-Wgnu-auto-type
|
||||
-Wgnu-case-range
|
||||
-Wgnu-complex-integer
|
||||
-Wgnu-compound-literal-initializer
|
||||
-Wgnu-conditional-omitted-operand
|
||||
-Wgnu-designator
|
||||
-Wgnu-empty-initializer
|
||||
-Wgnu-empty-struct
|
||||
-Wgnu-flexible-array-initializer
|
||||
-Wgnu-flexible-array-union-member
|
||||
-Wgnu-folding-constant
|
||||
-Wgnu-imaginary-constant
|
||||
-Wgnu-label-as-value
|
||||
-Wgnu-line-marker
|
||||
-Wgnu-null-pointer-arithmetic
|
||||
-Wgnu-offsetof-extensions
|
||||
-Wgnu-pointer-arith
|
||||
-Wgnu-redeclared-enum
|
||||
-Wgnu-statement-expression
|
||||
-Wgnu-statement-expression-from-macro-expansion
|
||||
-Wgnu-union-cast
|
||||
-Wgnu-zero-line-directive
|
||||
-Wgnu-zero-variadic-macro-arguments
|
||||
-Wheader-hygiene
|
||||
-Widiomatic-parentheses
|
||||
-Wignored-qualifiers
|
||||
-Wimplicit
|
||||
-Wimplicit-fallthrough
|
||||
-Wimplicit-fallthrough-per-function
|
||||
-Wimplicit-function-declaration
|
||||
-Wimplicit-int
|
||||
-Wimplicit-retain-self
|
||||
-Wimport-preprocessor-directive-pedantic
|
||||
-Wincomplete-module
|
||||
-Winconsistent-missing-destructor-override
|
||||
-Winfinite-recursion
|
||||
-Wint-in-bool-context
|
||||
-Winvalid-or-nonexistent-directory
|
||||
-Winvalid-utf8
|
||||
-Wkeyword-macro
|
||||
-Wlanguage-extension-token
|
||||
-Wlocal-type-template-args
|
||||
-Wlogical-op-parentheses
|
||||
-Wlong-long
|
||||
-Wloop-analysis
|
||||
-Wmain
|
||||
-Wmax-tokens
|
||||
-Wmethod-signatures
|
||||
-Wmicrosoft
|
||||
-Wmicrosoft-anon-tag
|
||||
-Wmicrosoft-charize
|
||||
-Wmicrosoft-comment-paste
|
||||
-Wmicrosoft-cpp-macro
|
||||
-Wmicrosoft-end-of-file
|
||||
-Wmicrosoft-enum-value
|
||||
-Wmicrosoft-exception-spec
|
||||
-Wmicrosoft-fixed-enum
|
||||
-Wmicrosoft-flexible-array
|
||||
-Wmicrosoft-redeclare-static
|
||||
-Wmisleading-indentation
|
||||
-Wmismatched-tags
|
||||
-Wmissing-braces
|
||||
-Wmissing-method-return-type
|
||||
-Wmost
|
||||
-Wmove
|
||||
-Wnested-anon-types
|
||||
-Wnewline-eof
|
||||
-Wnon-gcc
|
||||
-Wnon-modular-include-in-framework-module
|
||||
-Wnon-modular-include-in-module
|
||||
-Wnon-virtual-dtor
|
||||
-Wnonportable-system-include-path
|
||||
-Wnull-pointer-arithmetic
|
||||
-Wnull-pointer-subtraction
|
||||
-Wnullability-extension
|
||||
-Wnullable-to-nonnull-conversion
|
||||
-Wopenmp
|
||||
-Wover-aligned
|
||||
-Woverlength-strings
|
||||
-Woverloaded-virtual
|
||||
-Woverriding-method-mismatch
|
||||
-Wpacked
|
||||
-Wpacked-non-pod
|
||||
-Wparentheses
|
||||
-Wpedantic
|
||||
-Wpedantic-core-features
|
||||
-Wpessimizing-move
|
||||
-Wpointer-arith
|
||||
-Wpoison-system-directories
|
||||
-Wpragma-pack
|
||||
-Wpragma-pack-suspicious-include
|
||||
-Wpragmas
|
||||
-Wpre-c2x-compat
|
||||
-Wpre-openmp-51-compat
|
||||
-Wprofile-instr-missing
|
||||
-Wquoted-include-in-framework-header
|
||||
-Wrange-loop-analysis
|
||||
-Wrange-loop-bind-reference
|
||||
-Wrange-loop-construct
|
||||
-Wreceiver-forward-class
|
||||
-Wredundant-move
|
||||
-Wredundant-parens
|
||||
-Wreorder
|
||||
-Wreorder-ctor
|
||||
-Wreserved-user-defined-literal
|
||||
-Wretained-language-linkage
|
||||
-Wselector
|
||||
-Wselector-type-mismatch
|
||||
-Wself-assign
|
||||
-Wself-assign-overloaded
|
||||
-Wself-move
|
||||
-Wsemicolon-before-method-body
|
||||
-Wshadow-all
|
||||
-Wshadow-field
|
||||
-Wshadow-field-in-constructor
|
||||
-Wshadow-field-in-constructor-modified
|
||||
-Wshadow-uncaptured-local
|
||||
-Wshift-sign-overflow
|
||||
-Wsigned-enum-bitfield
|
||||
-Wsometimes-uninitialized
|
||||
-Wsource-uses-openmp
|
||||
-Wspir-compat
|
||||
-Wstatic-in-inline
|
||||
-Wstrict-potentially-direct-selector
|
||||
-Wstrict-selector-match
|
||||
-Wstring-concatenation
|
||||
-Wstring-conversion
|
||||
-Wsuggest-destructor-override
|
||||
-Wsuggest-override
|
||||
-Wsuper-class-method-mismatch
|
||||
-Wtautological-bitwise-compare
|
||||
-Wtautological-compare
|
||||
-Wtautological-constant-in-range-compare
|
||||
-Wtautological-overlap-compare
|
||||
-Wtautological-type-limit-compare
|
||||
-Wtautological-unsigned-char-zero-compare
|
||||
-Wtautological-unsigned-enum-zero-compare
|
||||
-Wtautological-unsigned-zero-compare
|
||||
-Wtautological-value-range-compare
|
||||
-Wthread-safety
|
||||
-Wthread-safety-analysis
|
||||
-Wthread-safety-attributes
|
||||
-Wthread-safety-beta
|
||||
-Wthread-safety-negative
|
||||
-Wthread-safety-precise
|
||||
-Wthread-safety-reference
|
||||
-Wthread-safety-verbose
|
||||
-Wtype-limits
|
||||
-Wunaligned-access
|
||||
-Wundeclared-selector
|
||||
-Wundef-prefix
|
||||
-Wundefined-func-template
|
||||
-Wundefined-internal-type
|
||||
-Wundefined-reinterpret-cast
|
||||
-Wunguarded-availability
|
||||
-Wuninitialized
|
||||
-Wuninitialized-const-reference
|
||||
-Wunknown-pragmas
|
||||
-Wunnamed-type-template-args
|
||||
-Wunneeded-internal-declaration
|
||||
-Wunneeded-member-function
|
||||
-Wunreachable-code-fallthrough
|
||||
-Wunreachable-code-loop-increment
|
||||
-Wunsupported-dll-base-class-template
|
||||
-Wunused
|
||||
-Wunused-but-set-parameter
|
||||
-Wunused-but-set-variable
|
||||
-Wunused-const-variable
|
||||
-Wunused-exception-parameter
|
||||
-Wunused-function
|
||||
-Wunused-label
|
||||
-Wunused-lambda-capture
|
||||
-Wunused-local-typedef
|
||||
-Wunused-member-function
|
||||
-Wunused-private-field
|
||||
-Wunused-property-ivar
|
||||
-Wunused-template
|
||||
-Wunused-variable
|
||||
-Wvariadic-macros
|
||||
-Wvector-conversion
|
||||
-Wweak-template-vtables
|
||||
-Wweak-vtables
|
||||
-Wzero-length-array
|
||||
-Wno-bitwise-instead-of-logical
|
||||
-Wno-c11-extensions
|
||||
-Wno-cast-function-type-strict
|
||||
-Wno-float-conversion
|
||||
-Wno-format-nonliteral
|
||||
-Wno-gnu-include-next
|
||||
-Wno-implicit-float-conversion
|
||||
-Wno-implicit-int-conversion
|
||||
-Wno-implicit-int-float-conversion
|
||||
-Wno-include-next-absolute-path
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-reserved-macro-identifier
|
||||
-Wno-shadow
|
||||
-Wno-shorten-64-to-32
|
||||
-Wno-sign-compare
|
||||
-Wno-sign-conversion
|
||||
-Wno-strict-prototypes
|
||||
-Wno-switch
|
||||
-Wno-unused-parameter
|
||||
-Wno-tautological-constant-out-of-range-compare
|
||||
-Wno-tautological-type-limit-compare
|
||||
-Wno-tautological-unsigned-zero-compare
|
||||
-Wno-tautological-value-range-compare
|
||||
-Wno-unused-command-line-argument
|
||||
-Wno-user-defined-warnings
|
||||
' | tr -d '\n' | sed -e 's/ */ /g'`
|
||||
$ ./configure CFLAGS="-O2 -g $WARN_CLANG16" CXXFLAGS="-O2 -g $WARN_CLANG16"
|
||||
$ make
|
||||
Again, use your own judgement to determine whether to fix or ignore a
|
||||
specific warning.
|
||||
|
||||
|
||||
Information for gnulib-tool maintenance
|
||||
***************************************
|
||||
|
||||
Running the unit tests
|
||||
======================
|
||||
|
||||
The unit tests of gnulib-tool reside in the maint-tools repository, that is a
|
||||
satellite repository of the main gnulib repository. Instructions how to obtain
|
||||
it are in https://savannah.gnu.org/git/?group=gnulib .
|
||||
|
||||
To run the unit tests of gnulib-tool.sh:
|
||||
$ cd maint-tools/gnulib-tool-tests/
|
||||
$ GNULIB_TOOL_IMPL=sh ./test-all.sh
|
||||
|
||||
To run the unit tests of gnulib-tool.py:
|
||||
$ cd maint-tools/gnulib-tool-tests/
|
||||
$ GNULIB_TOOL_IMPL=py ./test-all.sh
|
||||
|
||||
It is *mandatory* that you run the test suite before pushing any change to
|
||||
gnulib-tool.sh or gnulib-tool.py! If you fail to do so, and your change contains
|
||||
a bug, it will start to affect users immediately.
|
||||
|
||||
|
||||
Debugging the Python implementation of gnulib-tool
|
||||
==================================================
|
||||
|
||||
With Eclipse and PyDev as IDE
|
||||
-----------------------------
|
||||
|
||||
* Download and configuration:
|
||||
- Eclipse IDE from https://www.eclipse.org/downloads/packages/
|
||||
(either the build for Java or for C/C++ should work fine;
|
||||
either use the Eclipse Installer program at the top of the page,
|
||||
or one of the individual download links below).
|
||||
- PyDev from https://www.pydev.org/download.html
|
||||
section "Install as Plugin".
|
||||
(Don't use LiClipse, since the license costs money.)
|
||||
- Follow https://www.pydev.org/manual_101_install.html,
|
||||
replacing http://www.pydev.org/updates
|
||||
with https://www.pydev.org/updates
|
||||
- Once installed, restart the IDE.
|
||||
- Window > Preferences > PyDev > Interpreters > Python Interpreter:
|
||||
New > path: /usr/bin/python3
|
||||
- Window > Preferences > PyDev > Editor > Code Analysis:
|
||||
Others > Redefinition of builtin symbols: Ignore
|
||||
|
||||
* Create a project:
|
||||
Let GNULIB_DIR be my gnulib checkout.
|
||||
- File > New > Project... > PyDev > PyDev Project. Call it 'gnulib-tool'.
|
||||
Note that this is a project inside the Eclipse workspace, so far
|
||||
unrelated to the GNULIB_DIR.
|
||||
- Popup menu > New > Link to Existing Source
|
||||
Name: gnulib
|
||||
Path: <GNULIB_DIR>
|
||||
|
||||
* Create a run configuration:
|
||||
- Run > Run Configurations... > Python Run
|
||||
Popup menu > New configuration
|
||||
Name: gnulib-tool.py
|
||||
Main > Project: gnulib-tool
|
||||
Main > Main Module: ${workspace_loc:gnulib-tool/gnulib/.gnulib-tool.py}
|
||||
Arguments > Program arguments: --help
|
||||
- Test it: Run this configuration.
|
||||
|
||||
* Create a debug configuration:
|
||||
- Run > Debug Configurations... > gnulib-tool.py
|
||||
Popup menu > Duplicate
|
||||
- In the duplicate, set
|
||||
Arguments > Working directory: /tmp/oath-toolkit/lib
|
||||
Arguments > Program arguments: --add-import
|
||||
|
||||
* Debug it:
|
||||
- Open GLImport.py.
|
||||
- On the left-hand border of this editor, do "Add breakpoint".
|
||||
- Run > Debug Configurations... > pick the duplicate. Press Debug.
|
||||
|
||||
|
||||
Maintaining high quality
|
||||
========================
|
||||
|
||||
There is a continuous integration of gnulib-tool.py that runs the unit tests,
|
||||
at https://gitlab.com/gnulib/gnulib-tool-ci/ .
|
||||
+3898
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,127 @@
|
||||
Status for libposix
|
||||
===================
|
||||
|
||||
This file documents the status of work-in-progress.
|
||||
No ChangeLog entries are needed for this file.
|
||||
|
||||
Status for the libposix branch
|
||||
------------------------------
|
||||
|
||||
Bruce Korb says:
|
||||
|
||||
I think a real big step in libposix is to get a little experience with it.
|
||||
There are also some few little nits pointed out in the discussions that
|
||||
need some careful consideration, but some experience in using it would
|
||||
be good, too. The intended/expected usage is along the lines of:
|
||||
|
||||
1. configure, build and install the thing. Perhaps from:
|
||||
https://autogen.sourceforge.net/data/
|
||||
or roll your own, but the distribution should be there, I think.
|
||||
|
||||
2. fiddle a project to detect that it is "sufficiently recent" to
|
||||
cover the needs of this unnamed project. That is an interesting
|
||||
issue, though: the concept behind "configure" is that you do
|
||||
feature tests rather than version testing. However, if you choose
|
||||
to not test the version of libposix and test the features you
|
||||
need of libposix, then I have an extremely difficult time trying
|
||||
to understand the point of libposix -- you are back to running
|
||||
a bunch of feature tests that take too long. Testing for a
|
||||
libposix current as of some marker (version number or date)
|
||||
seems right to me, though there are some caveats to consider
|
||||
regarding "retired" POSIX features.
|
||||
|
||||
Anyway, the "fiddle a project" should boil down to testing
|
||||
for libposix in some way and then dying if it is not up to snuff.
|
||||
|
||||
3. configure, build, test, install and test installation of said project.
|
||||
|
||||
|
||||
TODO list for master
|
||||
--------------------
|
||||
|
||||
Bruno Haible says:
|
||||
|
||||
1) ... 7)
|
||||
proposed by Gary in the thread starting at
|
||||
[PATCH 0/7] contents of topic/libposix for merge to master
|
||||
in <https://lists.gnu.org/r/bug-gnulib/2010-10/threads.html>
|
||||
|
||||
1) Allow generate header files to coexist without shadowing each other.
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00283.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00289.html>
|
||||
|
||||
Still missing: dealing with include_next and old compilers, cf.
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00269.html>
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00285.html>
|
||||
|
||||
2) Allow using libgnu's file name in module descriptions.
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00284.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00291.html>
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00308.html
|
||||
|
||||
3) iconv_open's file list
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00282.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00290.html>
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00307.html>
|
||||
libposix needs to install only selected headers, not all of them. Let the
|
||||
script look at the 'Include:' section of each module description.
|
||||
|
||||
4) Module libposix
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00280.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00292.html>
|
||||
More discussion needed
|
||||
|
||||
5) Installable headers
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00281.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00293.html>
|
||||
Patch to be rewritten to use nobase_nodist_include_HEADERS,
|
||||
also need to add an Automake conditional to distinguish libposix from
|
||||
other projects.
|
||||
Also see whether the Automake bug can be fixed.
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00325.html>
|
||||
|
||||
6) libposix subdirectory
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00277.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00294.html>
|
||||
|
||||
7) use git-version-gen for version numbering
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00279.html>
|
||||
|
||||
Discussion:
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00297.html>
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-10/msg00303.html>
|
||||
Patch to be revised.
|
||||
|
||||
8) Licensing
|
||||
<https://lists.gnu.org/r/bug-gnulib/2010-12/msg00184.html>
|
||||
|
||||
Status: A majority of the issues have been handled.
|
||||
Obsolete modules (free, memcpy) can be ignored.
|
||||
To be done:
|
||||
getcwd
|
||||
faccessat
|
||||
fdopendir
|
||||
linkat
|
||||
mkfifoat
|
||||
openat
|
||||
readlinkat
|
||||
renameat
|
||||
symlinkat
|
||||
utimensat
|
||||
|
||||
9) Versioning
|
||||
<https://lists.gnu.org/r/bug-gnulib/2011-01/msg00163.html>
|
||||
|
||||
Status: No real plan exists.
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2022-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
progname=$0
|
||||
package=gnulib
|
||||
|
||||
# func_exit STATUS
|
||||
# exits with a given status.
|
||||
# This function needs to be used, rather than 'exit', when a 'trap' handler is
|
||||
# in effect that refers to $?.
|
||||
func_exit ()
|
||||
{
|
||||
(exit $1); exit $1
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
# Input:
|
||||
# - progname name of this program
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "$progname: *** $1" 1>&2
|
||||
echo "$progname: *** Stop." 1>&2
|
||||
func_exit 1
|
||||
}
|
||||
|
||||
# func_readlink SYMLINK
|
||||
# outputs the target of the given symlink.
|
||||
if (type readlink) > /dev/null 2>&1; then
|
||||
func_readlink ()
|
||||
{
|
||||
# Use the readlink program from GNU coreutils.
|
||||
readlink "$1"
|
||||
}
|
||||
else
|
||||
func_readlink ()
|
||||
{
|
||||
# Use two sed invocations. A single sed -n -e 's,^.* -> \(.*\)$,\1,p'
|
||||
# would do the wrong thing if the link target contains " -> ".
|
||||
LC_ALL=C ls -l "$1" | sed -e 's, -> ,#%%#,' | sed -n -e 's,^.*#%%#\(.*\)$,\1,p'
|
||||
}
|
||||
fi
|
||||
|
||||
# func_gnulib_dir
|
||||
# locates the directory where the gnulib repository lives
|
||||
# Input:
|
||||
# - progname name of this program
|
||||
# Sets variables
|
||||
# - self_abspathname absolute pathname of this program
|
||||
# - gnulib_dir absolute pathname of gnulib repository
|
||||
func_gnulib_dir ()
|
||||
{
|
||||
case "$progname" in
|
||||
/* | ?:*) self_abspathname="$progname" ;;
|
||||
*/*) self_abspathname=`pwd`/"$progname" ;;
|
||||
*)
|
||||
# Look in $PATH.
|
||||
# Iterate through the elements of $PATH.
|
||||
# We use IFS=: instead of
|
||||
# for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`
|
||||
# because the latter does not work when some PATH element contains spaces.
|
||||
# We use a canonicalized $pathx instead of $PATH, because empty PATH
|
||||
# elements are by definition equivalent to '.', however field splitting
|
||||
# according to IFS=: loses empty fields in many shells:
|
||||
# - /bin/sh on OSF/1 and Solaris loses all empty fields (at the
|
||||
# beginning, at the end, and in the middle),
|
||||
# - /bin/sh on IRIX and /bin/ksh on IRIX and OSF/1 lose empty fields
|
||||
# at the beginning and at the end,
|
||||
# - GNU bash, /bin/sh on AIX and HP-UX, and /bin/ksh on AIX, HP-UX,
|
||||
# Solaris lose empty fields at the end.
|
||||
# The 'case' statement is an optimization, to avoid evaluating the
|
||||
# explicit canonicalization command when $PATH contains no empty fields.
|
||||
self_abspathname=
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
|
||||
# contains only /bin. Note that ksh looks also at the FPATH variable,
|
||||
# so we have to set that as well for the test.
|
||||
PATH_SEPARATOR=:
|
||||
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
|| PATH_SEPARATOR=';'
|
||||
}
|
||||
fi
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
# Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
|
||||
# contains only /bin. Note that ksh looks also at the FPATH variable,
|
||||
# so we have to set that as well for the test.
|
||||
PATH_SEPARATOR=:
|
||||
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
&& { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|
||||
|| PATH_SEPARATOR=';'
|
||||
}
|
||||
fi
|
||||
if test "$PATH_SEPARATOR" = ";"; then
|
||||
# On Windows, programs are searched in "." before $PATH.
|
||||
pathx=".;$PATH"
|
||||
else
|
||||
# On Unix, we have to convert empty PATH elements to ".".
|
||||
pathx="$PATH"
|
||||
case :$PATH: in
|
||||
*::*)
|
||||
pathx=`echo ":$PATH:" | sed -e 's/:::*/:.:/g' -e 's/^://' -e 's/:\$//'`
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
saved_IFS="$IFS"
|
||||
IFS="$PATH_SEPARATOR"
|
||||
for d in $pathx; do
|
||||
IFS="$saved_IFS"
|
||||
test -z "$d" && d=.
|
||||
if test -x "$d/$progname" && test ! -d "$d/$progname"; then
|
||||
self_abspathname="$d/$progname"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$saved_IFS"
|
||||
if test -z "$self_abspathname"; then
|
||||
func_fatal_error "could not locate the all-modules program - how did you invoke it?"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
while test -h "$self_abspathname"; do
|
||||
# Resolve symbolic link.
|
||||
linkval=`func_readlink "$self_abspathname"`
|
||||
test -n "$linkval" || break
|
||||
case "$linkval" in
|
||||
/* | ?:* ) self_abspathname="$linkval" ;;
|
||||
* ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
|
||||
esac
|
||||
done
|
||||
gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
|
||||
}
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: all-modules [option]
|
||||
|
||||
Lists the gnulib-tool command line options that can be used when creating
|
||||
a testdir of nearly all of gnulib.
|
||||
|
||||
Options:
|
||||
|
||||
--for-mingw list only modules that work on mingw
|
||||
--for-msvc list only modules that work on MSVC
|
||||
|
||||
Report bugs to <bug-gnulib@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
func_gnulib_dir
|
||||
if test -d "$gnulib_dir"/.git \
|
||||
&& (git --version) >/dev/null 2>/dev/null \
|
||||
&& (date --version) >/dev/null 2>/dev/null; then
|
||||
# gnulib checked out from git.
|
||||
sed_extract_first_date='/^Date/{
|
||||
s/^Date:[ ]*//p
|
||||
q
|
||||
}'
|
||||
date=`cd "$gnulib_dir" && git log -n 1 --format=medium --date=iso ChangeLog | sed -n -e "$sed_extract_first_date"`
|
||||
# Turn "Fri Mar 21 07:16:51 2008 -0600" into "Mar 21 2008 07:16:51 -0600".
|
||||
sed_year_before_time='s/^[^ ]* \([^ ]*\) \([0-9]*\) \([0-9:]*\) \([0-9]*\) /\1 \2 \4 \3 /'
|
||||
date=`echo "$date" | sed -e "$sed_year_before_time"`
|
||||
# Use GNU date to compute the time in GMT.
|
||||
date=`date -d "$date" -u +"%Y-%m-%d %H:%M:%S"`
|
||||
version=' '`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 's/-dirty/-modified/'`
|
||||
else
|
||||
# gnulib copy without versioning information.
|
||||
date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog`
|
||||
version=
|
||||
fi
|
||||
year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed 's,^.* ,,'`
|
||||
echo "\
|
||||
all-modules (GNU $package $date)$version
|
||||
Copyright (C) $year Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
|
||||
Written by" "Bruno Haible"
|
||||
}
|
||||
|
||||
# Excludes for mingw and MSVC.
|
||||
exclude_for_mingw=
|
||||
# <pwd.h> and <grp.h> do not exist.
|
||||
exclude_for_mingw="$exclude_for_mingw idcache"
|
||||
exclude_for_mingw="$exclude_for_mingw pt_chown grantpt posix_openpt-tests posix_openpt"
|
||||
exclude_for_mingw="$exclude_for_mingw userspec-tests userspec"
|
||||
# The functions getuid, getgid, geteuid, getegid don't exist.
|
||||
exclude_for_mingw="$exclude_for_mingw faccessat"
|
||||
exclude_for_mingw="$exclude_for_mingw fchownat-tests fchownat chownat"
|
||||
# The functions fork, setsid, ttyname don't exist.
|
||||
exclude_for_mingw="$exclude_for_mingw forkpty-tests forkpty login_tty-tests login_tty"
|
||||
|
||||
# Excludes for MSVC.
|
||||
exclude_for_msvc="$exclude_for_mingw"
|
||||
|
||||
# Command-line option processing.
|
||||
exclude="year2038-recommended"
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--for-mingw | --for-ming | --for-min | --for-mi )
|
||||
exclude="$exclude $exclude_for_mingw"
|
||||
shift ;;
|
||||
--for-msvc | --for-msv | --for-ms )
|
||||
exclude="$exclude $exclude_for_msvc"
|
||||
shift ;;
|
||||
--help | --hel | --he | --h )
|
||||
func_usage
|
||||
exit $? ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit $? ;;
|
||||
-* )
|
||||
echo "all-modules: unknown option $1" 1>&2
|
||||
echo "Try 'all-modules --help' for more information." 1>&2
|
||||
exit 1 ;;
|
||||
* )
|
||||
echo "all-modules: too many arguments" 1>&2
|
||||
echo "Try 'all-modules --help' for more information." 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# gnulib-tool --create-testdir collects all modules by default.
|
||||
# We only need to filter out the excludes.
|
||||
for m in $exclude; do
|
||||
printf '%s\n' "--avoid=$m"
|
||||
done
|
||||
|
||||
# Local Variables:
|
||||
# indent-tabs-mode: nil
|
||||
# whitespace-check-buffer-indent: nil
|
||||
# End:
|
||||
@@ -0,0 +1,705 @@
|
||||
#!/bin/sh
|
||||
#! -*-perl-*-
|
||||
|
||||
# Generate a release announcement message.
|
||||
|
||||
# Copyright (C) 2002-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Jim Meyering
|
||||
|
||||
# This is a prologue that allows to run a perl script as an executable
|
||||
# on systems that are compliant to a POSIX version before POSIX:2017.
|
||||
# On such systems, the usual invocation of an executable through execlp()
|
||||
# or execvp() fails with ENOEXEC if it is a script that does not start
|
||||
# with a #! line. The script interpreter mentioned in the #! line has
|
||||
# to be /bin/sh, because on GuixSD systems that is the only program that
|
||||
# has a fixed file name. The second line is essential for perl and is
|
||||
# also useful for editing this file in Emacs. The next two lines below
|
||||
# are valid code in both sh and perl. When executed by sh, they re-execute
|
||||
# the script through the perl program found in $PATH. The '-x' option
|
||||
# is essential as well; without it, perl would re-execute the script
|
||||
# through /bin/sh. When executed by perl, the next two lines are a no-op.
|
||||
eval 'exec perl -wSx "$0" "$@"'
|
||||
if 0;
|
||||
|
||||
my $VERSION = '2024-07-17 02:16'; # UTC
|
||||
# The definition above must lie within the first 8 lines in order
|
||||
# for the Emacs time-stamp write hook (at end) to update it.
|
||||
# If you change this file with Emacs, please let the write hook
|
||||
# do its job. Otherwise, update this string manually.
|
||||
|
||||
(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/;
|
||||
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
use POSIX qw(strftime);
|
||||
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
|
||||
my @archive_suffixes = qw (tar.gz tar.bz2 tar.lz tar.lzma tar.xz);
|
||||
my $srcdir = '.';
|
||||
|
||||
sub usage ($)
|
||||
{
|
||||
my ($exit_code) = @_;
|
||||
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
|
||||
if ($exit_code != 0)
|
||||
{
|
||||
print $STREAM "Try '$ME --help' for more information.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
my @types = sort keys %valid_release_types;
|
||||
print $STREAM <<EOF;
|
||||
Usage: $ME [OPTIONS]
|
||||
Generate an announcement message. Run this from builddir.
|
||||
|
||||
OPTIONS:
|
||||
|
||||
These options must be specified:
|
||||
|
||||
--release-type=TYPE TYPE must be one of @types
|
||||
--package-name=PACKAGE_NAME
|
||||
--previous-version=VER
|
||||
--current-version=VER
|
||||
--gpg-key-id=ID The GnuPG ID of the key used to sign the tarballs
|
||||
--url-directory=URL_DIR
|
||||
|
||||
The following are optional:
|
||||
|
||||
--news=NEWS_FILE include the NEWS section about this release
|
||||
from this NEWS_FILE; accumulates.
|
||||
--srcdir=DIR where to find the NEWS_FILEs (default: $srcdir)
|
||||
--bootstrap-tools=TOOL_LIST a comma-separated list of tools, e.g.,
|
||||
autoconf,automake,bison,gnulib
|
||||
--gnulib-version=VERSION report VERSION as the gnulib version, where
|
||||
VERSION is the result of running git describe
|
||||
in the gnulib source directory.
|
||||
required if gnulib is in TOOL_LIST.
|
||||
--gpg-key-email=EMAIL The email address of the key used to
|
||||
sign the tarballs
|
||||
--gpg-keyring-url=URL URL pointing to keyring containing the key used
|
||||
to sign the tarballs
|
||||
--no-print-checksums do not emit SHA1 or SHA256 checksums
|
||||
--archive-suffix=SUF add SUF to the list of archive suffixes
|
||||
--mail-headers=HEADERS a space-separated list of mail headers, e.g.,
|
||||
To: x\@example.com Cc: y-announce\@example.com,...
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib\@gnu.org>.
|
||||
EOF
|
||||
}
|
||||
exit $exit_code;
|
||||
}
|
||||
|
||||
|
||||
=item C<%size> = C<sizes (@file)>
|
||||
|
||||
Compute the sizes of the C<@file> and return them as a hash. Return
|
||||
C<undef> if one of the computation failed.
|
||||
|
||||
=cut
|
||||
|
||||
sub sizes (@)
|
||||
{
|
||||
my (@file) = @_;
|
||||
|
||||
my $fail = 0;
|
||||
my %res;
|
||||
foreach my $f (@file)
|
||||
{
|
||||
my $cmd = "du -h $f";
|
||||
my $t = `$cmd`;
|
||||
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
|
||||
$@
|
||||
and (warn "command failed: '$cmd'\n"), $fail = 1;
|
||||
chomp $t;
|
||||
$t =~ s/^\s*([\d.]+[MkK]).*/${1}B/;
|
||||
$res{$f} = $t;
|
||||
}
|
||||
return $fail ? undef : %res;
|
||||
}
|
||||
|
||||
=item C<print_locations ($title, \@url, \%size, @file)
|
||||
|
||||
Print a section C<$title> dedicated to the list of <@file>, which
|
||||
sizes are stored in C<%size>, and which are available from the C<@url>.
|
||||
|
||||
=cut
|
||||
|
||||
sub print_locations ($\@\%@)
|
||||
{
|
||||
my ($title, $url, $size, @file) = @_;
|
||||
print "Here are the $title:\n";
|
||||
foreach my $url (@{$url})
|
||||
{
|
||||
for my $file (@file)
|
||||
{
|
||||
print " $url/$file";
|
||||
print " (", $$size{$file}, ")"
|
||||
if exists $$size{$file};
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
|
||||
=item C<print_checksums (@file)
|
||||
|
||||
Print the SHA1 and SHA256 signature section for each C<@file>.
|
||||
|
||||
=cut
|
||||
|
||||
# This digest function omits the "=" padding that is required by cksum,
|
||||
# so add the 0..2 bytes of padding required for each of Digest's algorithms.
|
||||
sub digest_file_base64_wrap ($$)
|
||||
{
|
||||
my ($file, $alg) = @_;
|
||||
my $h = digest_file_base64($file, $alg);
|
||||
$alg =~ tr{-}{}d;
|
||||
my %pad = (MD5 => 2, SHA1 => 1, SHA256 => 1, SHA384 => 0, SHA512 => 2);
|
||||
return $h . '=' x $pad{$alg};
|
||||
}
|
||||
|
||||
sub print_checksums (@)
|
||||
{
|
||||
my (@file) = @_;
|
||||
|
||||
print "Here are the SHA1 and SHA256 checksums:\n";
|
||||
print "\n";
|
||||
|
||||
use Digest::file qw(digest_file_hex digest_file_base64);
|
||||
|
||||
foreach my $f (@file)
|
||||
{
|
||||
print ' ', digest_file_hex ($f, "SHA-1"), " $f\n";
|
||||
print ' ', digest_file_base64_wrap ($f, "SHA-256"), " $f\n";
|
||||
}
|
||||
print "\nVerify the base64 SHA256 checksum with cksum -a sha256 --check\n";
|
||||
print "from coreutils-9.2 or OpenBSD's cksum since 2007.\n\n";
|
||||
}
|
||||
|
||||
=item C<print_news_deltas ($news_file, $prev_version, $curr_version)
|
||||
|
||||
Print the section of the NEWS file C<$news_file> addressing changes
|
||||
between versions C<$prev_version> and C<$curr_version>.
|
||||
|
||||
=cut
|
||||
|
||||
sub print_news_deltas ($$$)
|
||||
{
|
||||
my ($news_file, $prev_version, $curr_version) = @_;
|
||||
|
||||
my $news_name = $news_file;
|
||||
$news_name =~ s|^\Q$srcdir\E/||;
|
||||
|
||||
print "\n$news_name\n\n";
|
||||
|
||||
# Print all lines from $news_file, starting with the first one
|
||||
# that mentions $curr_version up to but not including
|
||||
# the first occurrence of $prev_version.
|
||||
my $in_items;
|
||||
|
||||
my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/;
|
||||
|
||||
my $found_news;
|
||||
open NEWS, '<', $news_file
|
||||
or die "$ME: $news_file: cannot open for reading: $!\n";
|
||||
while (defined (my $line = <NEWS>))
|
||||
{
|
||||
if ( ! $in_items)
|
||||
{
|
||||
# Match lines like these:
|
||||
# * Major changes in release 5.0.1:
|
||||
# * Noteworthy changes in release 6.6 (2006-11-22) [stable]
|
||||
$line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o
|
||||
or next;
|
||||
$in_items = 1;
|
||||
print $line;
|
||||
}
|
||||
else
|
||||
{
|
||||
# This regexp must not match version numbers in NEWS items.
|
||||
# For example, they might well say "introduced in 4.5.5",
|
||||
# and we don't want that to match.
|
||||
$line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o
|
||||
and last;
|
||||
print $line;
|
||||
$line =~ /\S/
|
||||
and $found_news = 1;
|
||||
}
|
||||
}
|
||||
close NEWS;
|
||||
|
||||
$in_items
|
||||
or die "$ME: $news_file: no matching lines for '$curr_version'\n";
|
||||
$found_news
|
||||
or die "$ME: $news_file: no news item found for '$curr_version'\n";
|
||||
}
|
||||
|
||||
sub print_changelog_deltas ($$)
|
||||
{
|
||||
my ($package_name, $prev_version) = @_;
|
||||
|
||||
# Print new ChangeLog entries.
|
||||
|
||||
# First find all CVS-controlled ChangeLog files.
|
||||
use File::Find;
|
||||
my @changelog;
|
||||
find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
|
||||
and push @changelog, $File::Find::name}},
|
||||
'.');
|
||||
|
||||
# If there are no ChangeLog files, we're done.
|
||||
@changelog
|
||||
or return;
|
||||
my %changelog = map {$_ => 1} @changelog;
|
||||
|
||||
# Reorder the list of files so that if there are ChangeLog
|
||||
# files in the specified directories, they're listed first,
|
||||
# in this order:
|
||||
my @dir = qw ( . src lib m4 config doc );
|
||||
|
||||
# A typical @changelog array might look like this:
|
||||
# ./ChangeLog
|
||||
# ./po/ChangeLog
|
||||
# ./m4/ChangeLog
|
||||
# ./lib/ChangeLog
|
||||
# ./doc/ChangeLog
|
||||
# ./config/ChangeLog
|
||||
my @reordered;
|
||||
foreach my $d (@dir)
|
||||
{
|
||||
my $dot_slash = $d eq '.' ? $d : "./$d";
|
||||
my $target = "$dot_slash/ChangeLog";
|
||||
delete $changelog{$target}
|
||||
and push @reordered, $target;
|
||||
}
|
||||
|
||||
# Append any remaining ChangeLog files.
|
||||
push @reordered, sort keys %changelog;
|
||||
|
||||
# Remove leading './'.
|
||||
@reordered = map { s!^\./!!; $_ } @reordered;
|
||||
|
||||
print "\nChangeLog entries:\n\n";
|
||||
# print join ("\n", @reordered), "\n";
|
||||
|
||||
$prev_version =~ s/\./_/g;
|
||||
my $prev_cvs_tag = "\U$package_name\E-$prev_version";
|
||||
|
||||
my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
|
||||
open DIFF, '-|', $cmd
|
||||
or die "$ME: cannot run '$cmd': $!\n";
|
||||
# Print two types of lines, making minor changes:
|
||||
# Lines starting with '+++ ', e.g.,
|
||||
# +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
|
||||
# and those starting with '+'.
|
||||
# Don't print the others.
|
||||
my $prev_printed_line_empty = 1;
|
||||
while (defined (my $line = <DIFF>))
|
||||
{
|
||||
if ($line =~ /^\+\+\+ /)
|
||||
{
|
||||
my $separator = "*"x70 ."\n";
|
||||
$line =~ s///;
|
||||
$line =~ s/\s.*//;
|
||||
$prev_printed_line_empty
|
||||
or print "\n";
|
||||
print $separator, $line, $separator;
|
||||
}
|
||||
elsif ($line =~ /^\+/)
|
||||
{
|
||||
$line =~ s///;
|
||||
print $line;
|
||||
$prev_printed_line_empty = ($line =~ /^$/);
|
||||
}
|
||||
}
|
||||
close DIFF;
|
||||
|
||||
# The exit code should be 1.
|
||||
# Allow in case there are no modified ChangeLog entries.
|
||||
$? == 256 || $? == 128
|
||||
or warn "warning: '$cmd' had unexpected exit code or signal ($?)\n";
|
||||
}
|
||||
|
||||
sub get_tool_versions ($$)
|
||||
{
|
||||
my ($tool_list, $gnulib_version) = @_;
|
||||
@$tool_list
|
||||
or return ();
|
||||
|
||||
my $fail;
|
||||
my @tool_version_pair;
|
||||
foreach my $t (@$tool_list)
|
||||
{
|
||||
if ($t eq 'gnulib')
|
||||
{
|
||||
push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version;
|
||||
next;
|
||||
}
|
||||
# Assume that the last "word" on the first line of
|
||||
# 'tool --version' output is the version string.
|
||||
my ($first_line, undef) = split ("\n", `$t --version`);
|
||||
if ($first_line =~ /.* (\d[\w.-]+)$/)
|
||||
{
|
||||
$t = ucfirst $t;
|
||||
push @tool_version_pair, "$t $1";
|
||||
}
|
||||
else
|
||||
{
|
||||
defined $first_line
|
||||
and $first_line = '';
|
||||
warn "$t: unexpected --version output\n:$first_line";
|
||||
$fail = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$fail
|
||||
and exit 1;
|
||||
|
||||
return @tool_version_pair;
|
||||
}
|
||||
|
||||
# Print a more human-friendly representation of $SEC seconds.
|
||||
sub readable_interval0($)
|
||||
{
|
||||
my $sec = shift;
|
||||
$sec < 60 and return "$sec seconds";
|
||||
|
||||
my $min = int($sec / 60); $sec %= 60;
|
||||
30 < $sec and $min++;
|
||||
$min < 60 and return "$min minutes";
|
||||
|
||||
my $hr = int($min / 60); $min %= 60;
|
||||
30 < $min and $hr++;
|
||||
$hr < 24 and return "$hr hours";
|
||||
|
||||
my $day = int($hr / 24); $hr %= 24;
|
||||
12 < $hr and $day++;
|
||||
$day < 50 and return "$day days";
|
||||
|
||||
my $wk = int($day / 7); $day %= 7;
|
||||
4 < $day and $wk++;
|
||||
return "$wk weeks";
|
||||
}
|
||||
|
||||
# Convert e.g., "1 weeks", to "1 week".
|
||||
sub readable_interval($)
|
||||
{
|
||||
my $interval_str = shift;
|
||||
my $i = readable_interval0 $interval_str;
|
||||
$i =~ m{^1 \w+s$} and chop $i;
|
||||
return $i;
|
||||
}
|
||||
|
||||
{
|
||||
# Use the C locale so that, for instance, "du" does not
|
||||
# print "1,2" instead of "1.2", which would confuse our regexps.
|
||||
$ENV{LC_ALL} = "C";
|
||||
|
||||
my $mail_headers;
|
||||
my $release_type;
|
||||
my $package_name;
|
||||
my $prev_version;
|
||||
my $curr_version;
|
||||
my $gpg_key_id;
|
||||
my @url_dir_list;
|
||||
my @news_file;
|
||||
my $bootstrap_tools;
|
||||
my $gnulib_version;
|
||||
my $print_checksums_p = 1;
|
||||
my $gpg_key_email;
|
||||
my $gpg_keyring_url;
|
||||
|
||||
# Reformat the warnings before displaying them.
|
||||
local $SIG{__WARN__} = sub
|
||||
{
|
||||
my ($msg) = @_;
|
||||
# Warnings from GetOptions.
|
||||
$msg =~ s/Option (\w)/option --$1/;
|
||||
warn "$ME: $msg";
|
||||
};
|
||||
|
||||
GetOptions
|
||||
(
|
||||
'mail-headers=s' => \$mail_headers,
|
||||
'release-type=s' => \$release_type,
|
||||
'package-name=s' => \$package_name,
|
||||
'previous-version=s' => \$prev_version,
|
||||
'current-version=s' => \$curr_version,
|
||||
'gpg-key-id=s' => \$gpg_key_id,
|
||||
'gpg-key-email=s' => \$gpg_key_email,
|
||||
'gpg-keyring-url=s' => \$gpg_keyring_url,
|
||||
'url-directory=s' => \@url_dir_list,
|
||||
'news=s' => \@news_file,
|
||||
'srcdir=s' => \$srcdir,
|
||||
'bootstrap-tools=s' => \$bootstrap_tools,
|
||||
'gnulib-version=s' => \$gnulib_version,
|
||||
'print-checksums!' => \$print_checksums_p,
|
||||
'archive-suffix=s' => \@archive_suffixes,
|
||||
|
||||
help => sub { usage 0 },
|
||||
version =>
|
||||
sub
|
||||
{
|
||||
print "$ME version $VERSION\n";
|
||||
print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
|
||||
print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
|
||||
. "This is free software: you are free to change and redistribute it.\n"
|
||||
. "There is NO WARRANTY, to the extent permitted by law.\n";
|
||||
print "\n";
|
||||
my $author = "Jim Meyering";
|
||||
print "Written by $author.\n";
|
||||
exit
|
||||
},
|
||||
) or usage 1;
|
||||
|
||||
my $fail = 0;
|
||||
# Ensure that each required option is specified.
|
||||
$release_type
|
||||
or (warn "release type not specified\n"), $fail = 1;
|
||||
$package_name
|
||||
or (warn "package name not specified\n"), $fail = 1;
|
||||
$prev_version
|
||||
or (warn "previous version string not specified\n"), $fail = 1;
|
||||
$curr_version
|
||||
or (warn "current version string not specified\n"), $fail = 1;
|
||||
$gpg_key_id
|
||||
or (warn "GnuPG key ID not specified\n"), $fail = 1;
|
||||
@url_dir_list
|
||||
or (warn "URL directory name(s) not specified\n"), $fail = 1;
|
||||
|
||||
my @tool_list = split ',', $bootstrap_tools
|
||||
if $bootstrap_tools;
|
||||
|
||||
grep (/^gnulib$/, @tool_list) && ! defined $gnulib_version
|
||||
and (warn "when specifying gnulib as a tool, you must also specify\n"
|
||||
. "--gnulib-version=V, where V is the result of running git describe\n"
|
||||
. "in the gnulib source directory.\n"), $fail = 1;
|
||||
|
||||
! grep (/^gnulib$/, @tool_list) && defined $gnulib_version
|
||||
and (warn "with --gnulib-version=V you must use --bootstrap-tools=...\n"
|
||||
. "including gnulib in that list"), $fail = 1;
|
||||
|
||||
!$release_type || exists $valid_release_types{$release_type}
|
||||
or (warn "'$release_type': invalid release type\n"), $fail = 1;
|
||||
|
||||
@ARGV
|
||||
and (warn "too many arguments:\n", join ("\n", @ARGV), "\n"),
|
||||
$fail = 1;
|
||||
$fail
|
||||
and usage 1;
|
||||
|
||||
my $my_distdir = "$package_name-$curr_version";
|
||||
|
||||
my $xd = "$package_name-$prev_version-$curr_version.xdelta";
|
||||
|
||||
my @candidates = map { "$my_distdir.$_" } @archive_suffixes;
|
||||
my @tarballs = grep {-f $_} @candidates;
|
||||
|
||||
@tarballs
|
||||
or die "$ME: none of " . join(', ', @candidates) . " were found\n";
|
||||
my @sizable = @tarballs;
|
||||
-f $xd
|
||||
and push @sizable, $xd;
|
||||
my %size = sizes (@sizable);
|
||||
%size
|
||||
or exit 1;
|
||||
|
||||
my $headers = '';
|
||||
if (defined $mail_headers)
|
||||
{
|
||||
($headers = $mail_headers) =~ s/\s+(\S+:)/\n$1/g;
|
||||
$headers .= "\n";
|
||||
}
|
||||
|
||||
# The markup is escaped as <\# so that when this script is sent by
|
||||
# mail (or part of a diff), Gnus is not triggered.
|
||||
print <<EOF;
|
||||
|
||||
${headers}Subject: $my_distdir released [$release_type]
|
||||
|
||||
<\#secure method=pgpmime mode=sign>
|
||||
This is to announce $package_name-$curr_version, a $release_type release.
|
||||
|
||||
FIXME: put comments here
|
||||
|
||||
EOF
|
||||
|
||||
my $v0 = $prev_version;
|
||||
my $v1 = $curr_version;
|
||||
|
||||
(my $first_name = `git config user.name|cut -d' ' -f1`)
|
||||
=~ m{\S} or die "no name? set user.name in ~/.gitconfig\n";
|
||||
|
||||
chomp (my $n_ci = `git rev-list "v$v0..v$v1" | wc -l`);
|
||||
chomp (my $n_p = `git shortlog "v$v0..v$v1" | grep -c '^[^ ]'`);
|
||||
|
||||
my $prev_release_date = `git log --pretty=%ct -1 "v$v0"`;
|
||||
my $this_release_date = `git log --pretty=%ct -1 "v$v1"`;
|
||||
my $n_seconds = $this_release_date - $prev_release_date;
|
||||
my $time_since_prev = readable_interval $n_seconds;
|
||||
my $names = `git shortlog "v$v0..v$v1"|perl -lne '/^(\\w.*):/ and print " ".\$1'`;
|
||||
|
||||
print <<EOF;
|
||||
There have been $n_ci commits by $n_p people in the $time_since_prev since $v0.
|
||||
|
||||
See the NEWS below for a brief summary.
|
||||
|
||||
Thanks to everyone who has contributed!
|
||||
The following people contributed changes to this release:
|
||||
|
||||
$names
|
||||
$first_name [on behalf of the $package_name maintainers]
|
||||
==================================================================
|
||||
|
||||
Here is the GNU $package_name home page:
|
||||
https://gnu.org/s/$package_name/
|
||||
|
||||
For a summary of changes and contributors, see:
|
||||
https://git.sv.gnu.org/gitweb/?p=$package_name.git;a=shortlog;h=v$v1
|
||||
or run this command from a git-cloned $package_name directory:
|
||||
git shortlog v$v0..v$v1
|
||||
|
||||
EOF
|
||||
|
||||
if (@url_dir_list == 1 && @tarballs == 1)
|
||||
{
|
||||
# When there's only one tarball and one URL, use a more concise form.
|
||||
my $m = "$url_dir_list[0]/$tarballs[0]";
|
||||
print "Here are the compressed sources and a GPG detached signature:\n"
|
||||
. " $m\n"
|
||||
. " $m.sig\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print_locations ("compressed sources", @url_dir_list, %size, @tarballs);
|
||||
-f $xd
|
||||
and print_locations ("xdelta diffs (useful? if so, "
|
||||
. "please tell bug-gnulib\@gnu.org)",
|
||||
@url_dir_list, %size, $xd);
|
||||
my @sig_files = map { "$_.sig" } @tarballs;
|
||||
print_locations ("GPG detached signatures", @url_dir_list, %size,
|
||||
@sig_files);
|
||||
}
|
||||
|
||||
if ($url_dir_list[0] =~ "gnu\.org")
|
||||
{
|
||||
print "Use a mirror for higher download bandwidth:\n";
|
||||
if (@tarballs == 1 && $url_dir_list[0] =~ m!https://ftp\.gnu\.org/gnu/!)
|
||||
{
|
||||
(my $m = "$url_dir_list[0]/$tarballs[0]")
|
||||
=~ s!https://ftp\.gnu\.org/gnu/!https://ftpmirror\.gnu\.org/!;
|
||||
print " $m\n"
|
||||
. " $m.sig\n\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print " https://www.gnu.org/order/ftp.html\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
$print_checksums_p
|
||||
and print_checksums (@sizable);
|
||||
|
||||
print <<EOF;
|
||||
Use a .sig file to verify that the corresponding file (without the
|
||||
.sig suffix) is intact. First, be sure to download both the .sig file
|
||||
and the corresponding tarball. Then, run a command like this:
|
||||
|
||||
gpg --verify $tarballs[0].sig
|
||||
|
||||
EOF
|
||||
my $gpg_fingerprint = `LC_ALL=C gpg --fingerprint $gpg_key_id | grep -v ^sub`;
|
||||
if ($gpg_fingerprint =~ /^pub/)
|
||||
{
|
||||
chop $gpg_fingerprint;
|
||||
$gpg_fingerprint =~ s/ \[expires:.*//mg;
|
||||
$gpg_fingerprint =~ s/^uid \[ultimate\]/uid /mg;
|
||||
$gpg_fingerprint =~ s/^/ /mg;
|
||||
print<<EOF
|
||||
The signature should match the fingerprint of the following key:
|
||||
|
||||
$gpg_fingerprint
|
||||
EOF
|
||||
}
|
||||
print <<EOF;
|
||||
If that command fails because you don't have the required public key,
|
||||
or that public key has expired, try the following commands to retrieve
|
||||
or refresh it, and then rerun the 'gpg --verify' command.
|
||||
EOF
|
||||
if ($gpg_key_email) {
|
||||
print <<EOF;
|
||||
|
||||
gpg --locate-external-key $gpg_key_email
|
||||
EOF
|
||||
}
|
||||
print <<EOF;
|
||||
|
||||
gpg --recv-keys $gpg_key_id
|
||||
EOF
|
||||
if ($gpg_keyring_url) {
|
||||
print <<EOF;
|
||||
|
||||
wget -q -O- '$gpg_keyring_url' | gpg --import -
|
||||
EOF
|
||||
}
|
||||
print <<EOF;
|
||||
|
||||
As a last resort to find the key, you can try the official GNU
|
||||
keyring:
|
||||
|
||||
wget -q https://ftp.gnu.org/gnu/gnu-keyring.gpg
|
||||
gpg --keyring gnu-keyring.gpg --verify $tarballs[0].sig
|
||||
EOF
|
||||
|
||||
my @tool_versions = get_tool_versions (\@tool_list, $gnulib_version);
|
||||
@tool_versions
|
||||
and print "\nThis release was bootstrapped with the following tools:",
|
||||
join ('', map {"\n $_"} @tool_versions), "\n";
|
||||
|
||||
print_news_deltas ($_, $prev_version, $curr_version)
|
||||
foreach @news_file;
|
||||
|
||||
$release_type eq 'stable'
|
||||
or print_changelog_deltas ($package_name, $prev_version);
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
### Setup "GNU" style for perl-mode and cperl-mode.
|
||||
## Local Variables:
|
||||
## mode: perl
|
||||
## 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
|
||||
## perl-extra-newline-before-brace: t
|
||||
## perl-merge-trailing-else: nil
|
||||
## eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
## time-stamp-line-limit: 50
|
||||
## time-stamp-start: "my $VERSION = '"
|
||||
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||
## time-stamp-time-zone: "UTC0"
|
||||
## time-stamp-end: "'; # UTC"
|
||||
## End:
|
||||
+279
@@ -0,0 +1,279 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for Microsoft lib.exe
|
||||
|
||||
me=ar-lib
|
||||
scriptversion=2024-06-19.01; # UTC
|
||||
|
||||
# Copyright (C) 2010-2024 Free Software Foundation, Inc.
|
||||
# Written by Peter Rosin <peda@lysator.liu.se>.
|
||||
#
|
||||
# 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 <https://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>.
|
||||
|
||||
|
||||
# func_error message
|
||||
func_error ()
|
||||
{
|
||||
echo "$me: $1" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv in
|
||||
mingw)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin | msys)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_at_file at_file operation archive
|
||||
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
|
||||
# for each of them.
|
||||
# When interpreting the content of the @FILE, do NOT use func_file_conv,
|
||||
# since the user would need to supply preconverted file names to
|
||||
# binutils ar, at least for MinGW.
|
||||
func_at_file ()
|
||||
{
|
||||
operation=$2
|
||||
archive=$3
|
||||
at_file_contents=`cat "$1"`
|
||||
eval set x "$at_file_contents"
|
||||
shift
|
||||
|
||||
for member
|
||||
do
|
||||
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
|
||||
done
|
||||
}
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
func_error "no command. Try '$0 --help' for more information."
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<EOF
|
||||
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
|
||||
|
||||
Members may be specified in a file named with @FILE.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "$me (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test $# -lt 3; then
|
||||
func_error "you must specify a program, an action and an archive"
|
||||
fi
|
||||
|
||||
AR=$1
|
||||
shift
|
||||
while :
|
||||
do
|
||||
if test $# -lt 2; then
|
||||
func_error "you must specify a program, an action and an archive"
|
||||
fi
|
||||
case $1 in
|
||||
-lib | -LIB \
|
||||
| -ltcg | -LTCG \
|
||||
| -machine* | -MACHINE* \
|
||||
| -subsystem* | -SUBSYSTEM* \
|
||||
| -verbose | -VERBOSE \
|
||||
| -wx* | -WX* )
|
||||
AR="$AR $1"
|
||||
shift
|
||||
;;
|
||||
-nologo | -NOLOGO)
|
||||
# We always invoke AR with -nologo, so don't need to add it again.
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
action=$1
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
orig_archive=$1
|
||||
shift
|
||||
func_file_conv "$orig_archive"
|
||||
archive=$file
|
||||
|
||||
# strip leading dash in $action
|
||||
action=${action#-}
|
||||
|
||||
delete=
|
||||
extract=
|
||||
list=
|
||||
quick=
|
||||
replace=
|
||||
index=
|
||||
create=
|
||||
|
||||
while test -n "$action"
|
||||
do
|
||||
case $action in
|
||||
d*) delete=yes ;;
|
||||
x*) extract=yes ;;
|
||||
t*) list=yes ;;
|
||||
q*) quick=yes ;;
|
||||
r*) replace=yes ;;
|
||||
s*) index=yes ;;
|
||||
S*) ;; # the index is always updated implicitly
|
||||
c*) create=yes ;;
|
||||
u*) ;; # TODO: don't ignore the update modifier
|
||||
v*) ;; # TODO: don't ignore the verbose modifier
|
||||
*)
|
||||
func_error "unknown action specified"
|
||||
;;
|
||||
esac
|
||||
action=${action#?}
|
||||
done
|
||||
|
||||
case $delete$extract$list$quick$replace,$index in
|
||||
yes,* | ,yes)
|
||||
;;
|
||||
yesyes*)
|
||||
func_error "more than one action specified"
|
||||
;;
|
||||
*)
|
||||
func_error "no action specified"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -n "$delete"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
func_error "archive not found"
|
||||
fi
|
||||
for member
|
||||
do
|
||||
case $1 in
|
||||
@*)
|
||||
func_at_file "${1#@}" -REMOVE "$archive"
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$1"
|
||||
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
elif test -n "$extract"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
func_error "archive not found"
|
||||
fi
|
||||
if test $# -gt 0; then
|
||||
for member
|
||||
do
|
||||
case $1 in
|
||||
@*)
|
||||
func_at_file "${1#@}" -EXTRACT "$archive"
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$1"
|
||||
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
|
||||
;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
$AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \
|
||||
| while read member
|
||||
do
|
||||
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
|
||||
done
|
||||
fi
|
||||
|
||||
elif test -n "$quick$replace"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
if test -z "$create"; then
|
||||
echo "$me: creating $orig_archive"
|
||||
fi
|
||||
orig_archive=
|
||||
else
|
||||
orig_archive=$archive
|
||||
fi
|
||||
|
||||
for member
|
||||
do
|
||||
case $1 in
|
||||
@*)
|
||||
func_file_conv "${1#@}"
|
||||
set x "$@" "@$file"
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$1"
|
||||
set x "$@" "$file"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
if test -n "$orig_archive"; then
|
||||
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
|
||||
else
|
||||
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
|
||||
fi
|
||||
|
||||
elif test -n "$list"; then
|
||||
if test ! -f "$orig_archive"; then
|
||||
func_error "archive not found"
|
||||
fi
|
||||
$AR -NOLOGO -LIST "$archive" || exit $?
|
||||
fi
|
||||
+1612
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,67 @@
|
||||
# Bootstrap configuration. -*- sh -*-
|
||||
|
||||
# Copyright (C) 2006-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules="
|
||||
"
|
||||
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||
--from-code=UTF-8\\\
|
||||
--flag=asprintf:2:c-format --flag=vasprintf:2:c-format\\\
|
||||
--flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\
|
||||
--flag=wrapf:1:c-format\\\
|
||||
'
|
||||
|
||||
# If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]"
|
||||
# appears in configure.ac, exclude some unnecessary files.
|
||||
# Without grep's -E option (not portable enough, pre-configure),
|
||||
# the following test is ugly. Also, this depends on the existence
|
||||
# of configure.ac, not the obsolescent-named configure.in. But if
|
||||
# you're using this infrastructure, you should care about such things.
|
||||
|
||||
gettext_external=0
|
||||
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
|
||||
gettext_external=1
|
||||
grep '^[ ]*AM_GNU_GETTEXT(\[external]' configure.ac > /dev/null &&
|
||||
gettext_external=1
|
||||
|
||||
if test $gettext_external = 1; then
|
||||
# Gettext supplies these files, but we don't need them since
|
||||
# we don't have an intl subdirectory.
|
||||
excluded_files='
|
||||
m4/glibc2.m4
|
||||
m4/intdiv0.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/printf-posix.m4
|
||||
m4/size_max.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/visibility.m4
|
||||
m4/xsize.m4
|
||||
'
|
||||
fi
|
||||
|
||||
# Build prerequisites
|
||||
buildreq="\
|
||||
autoconf 2.59
|
||||
automake 1.9.6
|
||||
git 1.5.5
|
||||
tar -
|
||||
"
|
||||
+351
@@ -0,0 +1,351 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2024-06-19.01; # UTC
|
||||
|
||||
# Copyright (C) 1999-2024 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# 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 <https://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>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/* | msys/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.lo | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,247 @@
|
||||
#!/bin/sh
|
||||
# Compile a C# program.
|
||||
|
||||
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This uses the same choices as csharpcomp.c, but instead of relying on the
|
||||
# environment settings at run time, it uses the environment variables
|
||||
# present at configuration time.
|
||||
#
|
||||
# This is a separate shell script, because the various C# compilers have
|
||||
# different command line options.
|
||||
#
|
||||
# Usage: /bin/sh csharpcomp.sh [OPTION] SOURCE.cs ... RES.resource ...
|
||||
# Options:
|
||||
# -o PROGRAM.exe or -o LIBRARY.dll
|
||||
# set the output assembly name
|
||||
# -L DIRECTORY search for C# libraries also in DIRECTORY
|
||||
# -l LIBRARY reference the C# library LIBRARY.dll
|
||||
# -O optimize
|
||||
# -g generate debugging information
|
||||
|
||||
# func_tmpdir
|
||||
# creates a temporary directory.
|
||||
# Sets variable
|
||||
# - tmp pathname of freshly created temporary directory
|
||||
func_tmpdir ()
|
||||
{
|
||||
# Use the environment variable TMPDIR, falling back to /tmp. This allows
|
||||
# users to specify a different temporary directory, for example, if their
|
||||
# /tmp is filled up or too small.
|
||||
: "${TMPDIR=/tmp}"
|
||||
{
|
||||
# Use the mktemp program if available. If not available, hide the error
|
||||
# message.
|
||||
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
|
||||
test -n "$tmp" && test -d "$tmp"
|
||||
} ||
|
||||
{
|
||||
# Use a simple mkdir command. It is guaranteed to fail if the directory
|
||||
# already exists. $RANDOM is bash specific and expands to empty in shells
|
||||
# other than bash, ksh and zsh. Its use does not increase security;
|
||||
# rather, it minimizes the probability of failure in a very cluttered /tmp
|
||||
# directory.
|
||||
tmp=$TMPDIR/gt$$-$RANDOM
|
||||
(umask 077 && mkdir "$tmp")
|
||||
} ||
|
||||
{
|
||||
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
|
||||
{ (exit 1); exit 1; }
|
||||
}
|
||||
}
|
||||
|
||||
# In order to construct a command that invokes csc, we need 'eval', because
|
||||
# some of the arguments may contain spaces.
|
||||
command_for_print=
|
||||
command_for_eval=
|
||||
options_csc_for_print=
|
||||
options_csc_for_eval=
|
||||
sources_csc_for_print=
|
||||
sources_csc_for_eval=
|
||||
# Protecting special characters, hiding them from 'eval':
|
||||
# Double each backslash.
|
||||
sed_protect_1='s/\\/\\\\/g'
|
||||
# Escape each dollar, backquote, double-quote.
|
||||
sed_protect_2a='s/\$/\\$/g'
|
||||
sed_protect_2b='s/`/\\`/g'
|
||||
sed_protect_2c='s/"/\\"/g'
|
||||
# Add double-quotes at the beginning and end of the word.
|
||||
sed_protect_3a='1s/^/"/'
|
||||
sed_protect_3b='$s/$/"/'
|
||||
func_add_word_to_command ()
|
||||
{
|
||||
command_for_print="${command_for_print:+$command_for_print }$1"
|
||||
word_protected=`echo "$1" | sed -e "$sed_protect_1" -e "$sed_protect_2a" -e "$sed_protect_2b" -e "$sed_protect_2c" -e "$sed_protect_3a" -e "$sed_protect_3b"`
|
||||
command_for_eval="${command_for_eval:+$command_for_eval }$word_protected"
|
||||
}
|
||||
func_add_word_to_options_csc ()
|
||||
{
|
||||
options_csc_for_print="${options_csc_for_print:+$options_csc_for_print }$1"
|
||||
word_protected=`echo "$1" | sed -e "$sed_protect_1" -e "$sed_protect_2a" -e "$sed_protect_2b" -e "$sed_protect_2c" -e "$sed_protect_3a" -e "$sed_protect_3b"`
|
||||
options_csc_for_eval="${options_csc_for_eval:+$options_csc_for_eval }$word_protected"
|
||||
}
|
||||
func_add_word_to_sources_csc ()
|
||||
{
|
||||
sources_csc_for_print="${sources_csc_for_print:+$sources_csc_for_print }$1"
|
||||
word_protected=`echo "$1" | sed -e "$sed_protect_1" -e "$sed_protect_2a" -e "$sed_protect_2b" -e "$sed_protect_2c" -e "$sed_protect_3a" -e "$sed_protect_3b"`
|
||||
sources_csc_for_eval="${sources_csc_for_eval:+$sources_csc_for_eval }$word_protected"
|
||||
}
|
||||
|
||||
sed_quote_subst='s/\([|&;<>()$`"'"'"'*?[#~=% \\]\)/\\\1/g'
|
||||
|
||||
options_mcs=
|
||||
sources=
|
||||
func_add_word_to_options_csc "-nologo"
|
||||
while test $# != 0; do
|
||||
case "$1" in
|
||||
-o)
|
||||
case "$2" in
|
||||
*.dll)
|
||||
options_mcs="$options_mcs -target:library"
|
||||
func_add_word_to_options_csc "-target:library"
|
||||
;;
|
||||
*.exe)
|
||||
func_add_word_to_options_csc "-target:exe"
|
||||
;;
|
||||
esac
|
||||
options_mcs="$options_mcs -out:"`echo "$2" | sed -e "$sed_quote_subst"`
|
||||
# On Windows, assume that 'dotnet' and 'csc' are native Windows programs,
|
||||
# not Cygwin programs.
|
||||
arg="$2"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
arg=`cygpath -w "$arg"`
|
||||
;;
|
||||
esac
|
||||
func_add_word_to_options_csc "-out:$arg"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
options_mcs="$options_mcs -lib:"`echo "$2" | sed -e "$sed_quote_subst"`
|
||||
# On Windows, assume that 'dotnet' and 'csc' are native Windows programs,
|
||||
# not Cygwin programs.
|
||||
arg="$2"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
arg=`cygpath -w "$arg"`
|
||||
;;
|
||||
esac
|
||||
func_add_word_to_options_csc "-lib:$arg"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
options_mcs="$options_mcs -reference:"`echo "$2" | sed -e "$sed_quote_subst"`
|
||||
func_add_word_to_options_csc "-reference:$2.dll"
|
||||
shift
|
||||
;;
|
||||
-O)
|
||||
func_add_word_to_options_csc "-optimize+"
|
||||
;;
|
||||
-g)
|
||||
options_mcs="$options_mcs -debug"
|
||||
func_add_word_to_options_csc "-debug+"
|
||||
;;
|
||||
-*)
|
||||
echo "csharpcomp: unknown option '$1'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*.resources)
|
||||
options_mcs="$options_mcs -resource:"`echo "$1" | sed -e "$sed_quote_subst"`
|
||||
# On Windows, assume that 'dotnet' and 'csc' are native Windows programs,
|
||||
# not Cygwin programs.
|
||||
arg="$1"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
arg=`cygpath -w "$arg"`
|
||||
;;
|
||||
esac
|
||||
func_add_word_to_options_csc "-resource:$arg"
|
||||
;;
|
||||
*.cs)
|
||||
sources="$sources "`echo "$1" | sed -e "$sed_quote_subst"`
|
||||
# On Windows, assume that 'dotnet' and 'csc' are native Windows programs,
|
||||
# not Cygwin programs.
|
||||
arg="$1"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
arg=`cygpath -w "$arg"`
|
||||
;;
|
||||
esac
|
||||
func_add_word_to_sources_csc "$arg"
|
||||
;;
|
||||
*)
|
||||
echo "csharpcomp: unknown type of argument '$1'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test -n "@HAVE_MCS@"; then
|
||||
# mcs prints it errors and warnings to stdout, not stderr. Furthermore it
|
||||
# adds a useless line "Compilation succeeded..." at the end. Correct both.
|
||||
sed_drop_success_line='${
|
||||
/^Compilation succeeded/d
|
||||
}'
|
||||
func_tmpdir
|
||||
trap 'rm -rf "$tmp"' HUP INT QUIT TERM
|
||||
test -z "$CSHARP_VERBOSE" || echo mcs $options_mcs $sources 1>&2
|
||||
mcs $options_mcs $sources > "$tmp"/mcs.err
|
||||
result=$?
|
||||
sed -e "$sed_drop_success_line" < "$tmp"/mcs.err >&2
|
||||
rm -rf "$tmp"
|
||||
exit $result
|
||||
else
|
||||
if test -n "@HAVE_DOTNET_SDK@"; then
|
||||
dotnet_runtime_dir=`dotnet --list-runtimes | sed -n -e 's/Microsoft.NETCore.App \([^ ]*\) \[\(.*\)\].*/\2\/\1/p' | sed -e 1q`
|
||||
dotnet_sdk_dir=`dotnet --list-sdks | sed -e 's/\([^ ]*\) \[\(.*\)\].*/\2\/\1/p' | sed -e 1q`
|
||||
# Add -lib and -reference options, so that the compiler finds Object, Console, String, etc.
|
||||
arg="$dotnet_runtime_dir"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
arg=`cygpath -w "$arg"`
|
||||
;;
|
||||
esac
|
||||
func_add_word_to_options_csc "-lib:$arg"
|
||||
for file in `cd "$dotnet_runtime_dir" && echo [ABCDEFGHIJKLMNOPQRSTUVWXYZ]*.dll`; do
|
||||
case "$file" in
|
||||
*.Native.*) ;;
|
||||
*) func_add_word_to_options_csc "-reference:$file" ;;
|
||||
esac
|
||||
done
|
||||
func_add_word_to_command dotnet
|
||||
csc="$dotnet_sdk_dir/Roslyn/bincore/csc.dll"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
csc=`cygpath -w "$csc"`
|
||||
;;
|
||||
esac
|
||||
func_add_word_to_command "$csc"
|
||||
test -z "$CSHARP_VERBOSE" || echo "$command_for_print $options_csc_for_print $sources_csc_for_print" 1>&2
|
||||
eval "$command_for_eval $options_csc_for_eval $sources_csc_for_eval"
|
||||
exit $?
|
||||
else
|
||||
if test -n "@HAVE_DOTNET_CSC@" || test -n "@HAVE_CSC@"; then
|
||||
test -z "$CSHARP_VERBOSE" || echo "csc $options_csc_for_print $sources_csc_for_print" 1>&2
|
||||
eval "csc $options_csc_for_eval $sources_csc_for_eval"
|
||||
exit $?
|
||||
else
|
||||
echo 'C# compiler not found, try installing mono or dotnet, then reconfigure' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,213 @@
|
||||
#!/bin/sh
|
||||
# Execute a C# program.
|
||||
|
||||
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This uses the same choices as csharpexec.c, but instead of relying on the
|
||||
# environment settings at run time, it uses the environment variables
|
||||
# present at configuration time.
|
||||
#
|
||||
# This is a separate shell script, because the various C# interpreters have
|
||||
# different command line options.
|
||||
#
|
||||
# Usage: /bin/sh csharpexec.sh [OPTION] program.exe [ARGUMENTS]
|
||||
# Options:
|
||||
# -L DIRECTORY search for C# libraries also in DIRECTORY
|
||||
|
||||
# func_tmpdir
|
||||
# creates a temporary directory.
|
||||
# Sets variable
|
||||
# - tmp pathname of freshly created temporary directory
|
||||
func_tmpdir ()
|
||||
{
|
||||
# Use the environment variable TMPDIR, falling back to /tmp. This allows
|
||||
# users to specify a different temporary directory, for example, if their
|
||||
# /tmp is filled up or too small.
|
||||
: "${TMPDIR=/tmp}"
|
||||
{
|
||||
# Use the mktemp program if available. If not available, hide the error
|
||||
# message.
|
||||
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
|
||||
test -n "$tmp" && test -d "$tmp"
|
||||
} ||
|
||||
{
|
||||
# Use a simple mkdir command. It is guaranteed to fail if the directory
|
||||
# already exists. $RANDOM is bash specific and expands to empty in shells
|
||||
# other than bash, ksh and zsh. Its use does not increase security;
|
||||
# rather, it minimizes the probability of failure in a very cluttered /tmp
|
||||
# directory.
|
||||
tmp=$TMPDIR/gt$$-$RANDOM
|
||||
(umask 077 && mkdir "$tmp")
|
||||
} ||
|
||||
{
|
||||
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
|
||||
{ (exit 1); exit 1; }
|
||||
}
|
||||
}
|
||||
|
||||
libdirs_mono=
|
||||
libdirs_dotnet=
|
||||
prog=
|
||||
while test $# != 0; do
|
||||
case "$1" in
|
||||
-L)
|
||||
libdirs_mono="${libdirs_mono:+$libdirs_mono@MONO_PATH_SEPARATOR@}$2"
|
||||
libdirs_dotnet="${libdirs_dotnet:+$libdirs_dotnet|}$2"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
echo "csharpexec: unknown option '$1'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
prog="$1"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if test -z "$prog"; then
|
||||
echo "csharpexec: no program specified" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
case "$prog" in
|
||||
*.exe) ;;
|
||||
*)
|
||||
echo "csharpexec: program is not a .exe" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -n "@HAVE_MONO@"; then
|
||||
CONF_MONO_PATH='@MONO_PATH@'
|
||||
if test -n "$libdirs_mono"; then
|
||||
MONO_PATH="$libdirs_mono${CONF_MONO_PATH:+@MONO_PATH_SEPARATOR@$CONF_MONO_PATH}"
|
||||
else
|
||||
MONO_PATH="$CONF_MONO_PATH"
|
||||
fi
|
||||
export MONO_PATH
|
||||
test -z "$CSHARP_VERBOSE" || echo mono "$@" 1>&2
|
||||
exec mono "$@"
|
||||
else
|
||||
if test -n "@HAVE_DOTNET@"; then
|
||||
# Invoke 'dotnet $prog ...'.
|
||||
# Documentation:
|
||||
# <https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet#options-for-running-an-application>
|
||||
# This could be optimized on Windows platforms, because C# .exe files are
|
||||
# directly executable there. But there's no point in optimizing specifically
|
||||
# a non-free platform, especially since it would increase the test matrix.
|
||||
shift
|
||||
# On Windows, assume that 'dotnet' is a native Windows program, not a Cygwin program.
|
||||
prog_arg="$prog"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
prog_arg=`cygpath -w "$prog"`
|
||||
;;
|
||||
esac
|
||||
# Handle the -L options.
|
||||
# The way this works is that we have to copy (or symlink) the DLLs into the
|
||||
# directory where FOO.exe resides.
|
||||
# Maybe there is another way to do this, but I haven't found it, trying
|
||||
# - the --additionalprobingpath command-line option,
|
||||
# - the additionalProbingPaths property in runtimeconfig.json,
|
||||
# - adding a --deps deps.json option,
|
||||
# cf. <https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet#options-for-running-an-application>
|
||||
# and <https://github.com/dotnet/runtime/blob/main/docs/design/features/host-probing.md>.
|
||||
tmpfiles=
|
||||
if test -n "$libdirs_dotnet"; then
|
||||
# Make sure the added DLLs are removed when this script terminates.
|
||||
func_cleanup_tmpfiles()
|
||||
{
|
||||
saved_IFS="$IFS"
|
||||
IFS='|'
|
||||
for file in $tmpfiles; do
|
||||
IFS="$saved_IFS"
|
||||
rm -f "$file"
|
||||
done
|
||||
IFS="$saved_IFS"
|
||||
}
|
||||
trap func_cleanup_tmpfiles HUP INT QUIT PIPE TERM
|
||||
trap 'exit_status=$?; func_cleanup_tmpfiles; exit $exit_status' EXIT
|
||||
# Copy the DLLs.
|
||||
prog_dir=`dirname "$prog"`
|
||||
saved_IFS="$IFS"
|
||||
IFS='|'
|
||||
for dir in $libdirs_dotnet; do
|
||||
IFS="$saved_IFS"
|
||||
for file in `cd "$dir" && echo *.dll`; do
|
||||
if test -f "$prog_dir/$file"; then
|
||||
# A DLL of this name is already at the expected location.
|
||||
:
|
||||
else
|
||||
tmpfiles="${tmpfiles:+$tmpfiles|}$prog_dir/$file"
|
||||
cp "$dir/$file" "$prog_dir/$file" || exit 1
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS="$saved_IFS"
|
||||
fi
|
||||
if test -f "${prog%.exe}.runtimeconfig.json"; then
|
||||
# There is already a FOO.runtimeconfig.json alongside FOO.exe.
|
||||
dotnet exec "$prog_arg" "$@"
|
||||
result=$?
|
||||
else
|
||||
# dotnet needs a FOO.runtimeconfig.json alongside FOO.exe in order to
|
||||
# execute FOO.exe. Create a dummy one in a temporary directory
|
||||
# (because the directory where FOO.exe sits is not necessarily writable).
|
||||
# Documentation of this file format:
|
||||
# <https://learn.microsoft.com/en-us/dotnet/core/runtime-config/>
|
||||
func_tmpdir
|
||||
runtimeconfig="$tmp"/runtimeconfig.json
|
||||
dotnet --list-runtimes | sed -n -e 's/Microsoft.NETCore.App \([^ ]*\) .*/{ "runtimeOptions": { "framework": { "name": "Microsoft.NETCore.App", "version": "\1" } } }/p' > "$runtimeconfig"
|
||||
runtimeconfig_arg="$runtimeconfig"
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
runtimeconfig_arg=`cygpath -w "$runtimeconfig"`
|
||||
;;
|
||||
esac
|
||||
test -z "$CSHARP_VERBOSE" || echo dotnet exec --runtimeconfig "$runtimeconfig_arg" "$prog_arg" "$@" 1>&2
|
||||
dotnet exec --runtimeconfig "$runtimeconfig_arg" "$prog_arg" "$@"
|
||||
result=$?
|
||||
rm -f "$runtimeconfig"
|
||||
rmdir "$tmp"
|
||||
fi
|
||||
exit $result
|
||||
else
|
||||
if test -n "@HAVE_CLIX@"; then
|
||||
CONF_CLIX_PATH='@CLIX_PATH@'
|
||||
if test -n "$libdirs_mono"; then
|
||||
@CLIX_PATH_VAR@="$libdirs_mono${CONF_CLIX_PATH:+@MONO_PATH_SEPARATOR@$CONF_CLIX_PATH}"
|
||||
else
|
||||
@CLIX_PATH_VAR@="$CONF_CLIX_PATH"
|
||||
fi
|
||||
export @CLIX_PATH_VAR@
|
||||
shift
|
||||
# On Windows, assume that 'clix' is a native Windows program,
|
||||
# not a Cygwin program.
|
||||
case "@build_os@" in
|
||||
cygwin*)
|
||||
prog=`cygpath -w "$prog"`
|
||||
;;
|
||||
esac
|
||||
test -z "$CSHARP_VERBOSE" || echo clix "$prog" "$@" 1>&2
|
||||
exec clix "$prog" "$@"
|
||||
else
|
||||
echo 'C# virtual machine not found, try installing mono or dotnet, then reconfigure' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,138 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2006-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# This script determines the declared global symbols in a C header file.
|
||||
# Assumptions:
|
||||
# - The header files are in C, with only C89 comments.
|
||||
# - No use of macros with parameters.
|
||||
# - All global declarations are marked with 'extern'.
|
||||
# - All declarations end in ';' on the same line.
|
||||
# - Not more than one symbol is declared in a declaration.
|
||||
|
||||
# This script requires GNU sed.
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: declared.sh [OPTION]... < SOURCE.h
|
||||
|
||||
Extracts the declared global symbols of a C header file.
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "declared.sh (GNU gnulib)"
|
||||
echo "Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo
|
||||
printf 'Written by %s.\n' "Bruno Haible"
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "declared.sh: *** $1" 1>&2
|
||||
echo "declared.sh: *** Stop." 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Command-line option processing.
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--help | --hel | --he | --h )
|
||||
func_usage
|
||||
exit 0 ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit 0 ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
-* )
|
||||
func_fatal_error "unrecognized option: $1"
|
||||
;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -gt 0; then
|
||||
func_fatal_error "too many arguments"
|
||||
fi
|
||||
|
||||
# A sed expression that removes ANSI C and ISO C99 comments.
|
||||
sed_remove_comments="
|
||||
/[/][/*]/{
|
||||
ta
|
||||
:a
|
||||
s,^\\(\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*\\)//.*,\\1,
|
||||
te
|
||||
s,^\\(\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*\\)/[*]\\([^*]\\|[*][^/*]\\)*[*][*]*/,\\1 ,
|
||||
ta
|
||||
/^\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*[/][*]/{
|
||||
s,^\\(\\([^\"'/]\\|\"\\([^\\\"]\\|[\\].\\)*\"\\|'\\([^\\']\\|[\\].\\)*'\\|[/][^\"'/*]\\|[/]\"\\([^\\\"]\\|[\\].\\)*\"\\|[/]'\\([^\\']\\|[\\].\\)*'\\)*\\)/[*].*,\\1 ,
|
||||
tu
|
||||
:u
|
||||
n
|
||||
s,^\\([^*]\\|[*][^/*]\\)*[*][*]*/,,
|
||||
tv
|
||||
s,^.*\$,,
|
||||
bu
|
||||
:v
|
||||
}
|
||||
:e
|
||||
}"
|
||||
|
||||
# Check that 'sed' supports the kind of regular expressions used in
|
||||
# sed_remove_comments. The use of \| meaning alternation of basic regular
|
||||
# expressions is a GNU extension.
|
||||
sed_test='s,^\(\(a\|X\)*\)//.*,\1,'
|
||||
sed_result=`echo 'aaa//bcd' | sed -e "$sed_test"`
|
||||
test "$sed_result" = 'aaa' \
|
||||
|| func_fatal_error "The 'sed' program is not GNU sed. Try installing GNU sed."
|
||||
|
||||
# A sed expression that joins 'extern' declarations that are broken over
|
||||
# several lines.
|
||||
sed_join_multiline_externs='
|
||||
/^extern [^;"]*$/{
|
||||
:a
|
||||
N
|
||||
s/\n/ /g
|
||||
/^extern [^;"]*$/{
|
||||
ba
|
||||
}
|
||||
}'
|
||||
|
||||
# A sed expression that extracts the identifier of each 'extern' declaration.
|
||||
sed_extract_extern_declared='s/^extern [^()]*[ *]\([A-Za-z_][A-Za-z0-9_]*\) *[;(].*$/\1/p'
|
||||
|
||||
sed -e "$sed_remove_comments" \
|
||||
| sed -e "$sed_join_multiline_externs" \
|
||||
| sed -n -e "$sed_extract_extern_declared"
|
||||
+792
@@ -0,0 +1,792 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2024-06-19.01; # UTC
|
||||
|
||||
# Copyright (C) 1999-2024 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 <https://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.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interference from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsolete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IBM xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
#!/bin/sh
|
||||
# In a git/autoconf/automake-enabled project with a NEWS file and a version-
|
||||
# controlled .prev-version file, automate the procedure by which we record
|
||||
# the date, release-type and version string in the NEWS file. That commit
|
||||
# will serve to identify the release, so apply a signed tag to it as well.
|
||||
VERSION=2024-07-04.10 # UTC
|
||||
|
||||
# Note: this is a bash script (could be zsh or dash)
|
||||
|
||||
# Copyright (C) 2009-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Jim Meyering
|
||||
|
||||
ME=$(basename "$0")
|
||||
warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
|
||||
die() { warn "$*"; exit 1; }
|
||||
|
||||
help()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: $ME [OPTION...] VERSION RELEASE_TYPE
|
||||
|
||||
Run this script from top_srcdir to perform the final pre-release NEWS
|
||||
update in which the date, release-type and version string are
|
||||
recorded. Commit that result with a log entry marking the release,
|
||||
and apply a signed tag. Run it from your project's top-level
|
||||
directory.
|
||||
|
||||
Requirements:
|
||||
- you use git for version-control
|
||||
- a version-controlled .prev-version file
|
||||
- a NEWS file, with line 3 identical to this:
|
||||
$noteworthy_stub
|
||||
|
||||
Options:
|
||||
--branch=BRANCH set release branch (default: $branch)
|
||||
-C, --builddir=DIR location of (configured) Makefile (default: $builddir)
|
||||
--help print this help, then exit
|
||||
--version print version number, then exit
|
||||
|
||||
EXAMPLE:
|
||||
To update NEWS and tag the beta 8.1 release of coreutils, I would run this:
|
||||
|
||||
$ME 8.1 beta
|
||||
|
||||
Report bugs and patches to <bug-gnulib@gnu.org>.
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
|
||||
version()
|
||||
{
|
||||
year=$(echo "$VERSION" | sed 's/[^0-9].*//')
|
||||
cat <<EOF
|
||||
$ME $VERSION
|
||||
Copyright (C) $year Free Software Foundation, Inc,
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
|
||||
## ------ ##
|
||||
## Main. ##
|
||||
## ------ ##
|
||||
|
||||
# Constants.
|
||||
noteworthy='* Noteworthy changes in release'
|
||||
noteworthy_stub="$noteworthy ?.? (????-??-??) [?]"
|
||||
|
||||
# Variables.
|
||||
branch=$(git branch | sed -ne '/^\* /{s///;p;q;}')
|
||||
builddir=.
|
||||
|
||||
while test $# != 0
|
||||
do
|
||||
# Handle --option=value by splitting apart and putting back on argv.
|
||||
case $1 in
|
||||
--*=*)
|
||||
opt=$(echo "$1" | sed -e 's/=.*//')
|
||||
val=$(echo "$1" | sed -e 's/[^=]*=//')
|
||||
shift
|
||||
set dummy "$opt" "$val" "$@"; shift
|
||||
;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--help|--version) ${1#--};;
|
||||
--branch) shift; branch=$1; shift ;;
|
||||
-C|--builddir) shift; builddir=$1; shift ;;
|
||||
--*) die "unrecognized option: $1";;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
test $# = 2 \
|
||||
|| die "Usage: $ME [OPTION...] VERSION TYPE"
|
||||
|
||||
ver=$1
|
||||
type=$2
|
||||
|
||||
|
||||
## ---------------------- ##
|
||||
## First, sanity checks. ##
|
||||
## ---------------------- ##
|
||||
|
||||
# Verify that $ver looks like a version number, and...
|
||||
echo "$ver"|grep -E '^[0-9][0-9.]*[0-9]$' > /dev/null \
|
||||
|| die "invalid version: $ver"
|
||||
prev_ver=$(cat .prev-version) \
|
||||
|| die 'failed to determine previous version number from .prev-version'
|
||||
|
||||
# Verify that $ver is sensible (> .prev-version).
|
||||
case $(printf "%s\n%s\n" "$prev_ver" "$ver"|sort -V -u|tr '\n' ':') in
|
||||
"$prev_ver:$ver:") ;;
|
||||
*) die "invalid version: $ver (<= $prev_ver)";;
|
||||
esac
|
||||
|
||||
case $type in
|
||||
alpha|beta|stable) ;;
|
||||
*) die "invalid release type: $type";;
|
||||
esac
|
||||
|
||||
# No local modifications allowed.
|
||||
case $(git diff-index --name-only HEAD) in
|
||||
'') ;;
|
||||
*) die 'this tree is dirty; commit your changes first';;
|
||||
esac
|
||||
|
||||
# Ensure the current branch name is correct:
|
||||
curr_br=$(git rev-parse --symbolic-full-name HEAD)
|
||||
test "$curr_br" = "refs/heads/$branch" || die not on branch $branch
|
||||
|
||||
# Extract package name from Makefile.
|
||||
Makefile=$builddir/Makefile
|
||||
pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' "$Makefile") \
|
||||
|| die "failed to determine package name from $Makefile"
|
||||
|
||||
# Check that line 3 of NEWS is the stub line about to be replaced.
|
||||
test "$(sed -n 3p NEWS)" = "$noteworthy_stub" \
|
||||
|| die "line 3 of NEWS must be exactly '$noteworthy_stub'"
|
||||
|
||||
## --------------- ##
|
||||
## Then, changes. ##
|
||||
## --------------- ##
|
||||
|
||||
# Update NEWS to have today's date, plus desired version number and $type.
|
||||
perl -MPOSIX -ni -e 'my $today = strftime "%F", localtime time;' \
|
||||
-e 'my ($type, $ver) = qw('"$type $ver"');' \
|
||||
-e 'my $pfx = "'"$noteworthy"'";' \
|
||||
-e 'print $.==3 ? "$pfx $ver ($today) [$type]\n" : $_' \
|
||||
NEWS || die 'failed to update NEWS'
|
||||
|
||||
printf "version %s\n\n* NEWS: Record release date.\n" "$ver" \
|
||||
| git commit -F - -a || die 'git commit failed'
|
||||
git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed'
|
||||
|
||||
# Local variables:
|
||||
# indent-tabs-mode: nil
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "VERSION="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: " # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,102 @@
|
||||
# options to filter out, and why
|
||||
--all-warnings alias for -Wall
|
||||
--extra-warnings alias for -Wextra
|
||||
-frequire-return-statement go
|
||||
-Waggregate-return obsolescent
|
||||
-Waliasing fortran
|
||||
-Walign-commons fortran
|
||||
-Wampersand fortran
|
||||
-Warray-bounds covered by -Warray-bounds=
|
||||
-Warray-bounds= handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Warray-temporaries fortran
|
||||
-Wassign-intercept objc/objc++
|
||||
-Wbad-function-cast c
|
||||
-Wc++0x-compat c++ compatibility
|
||||
-Wc++11-compat c++ compatibility
|
||||
-Wc++14-compat c++ compatibility
|
||||
-Wc90-c99-compat c compatibility
|
||||
-Wc99-c11-compat c compatibility
|
||||
-Wcast-qual FIXME maybe? too much noise; encourages bad changes
|
||||
-Wcast-result d
|
||||
-Wc-binding-type fortran
|
||||
-Wc++-compat FIXME maybe? borderline. some will want this
|
||||
-Wcharacter-truncation fortran
|
||||
-Wcompare-reals fortran
|
||||
-Wconversion-extra fortran
|
||||
-Wconversion FIXME maybe? too much noise; encourages bad changes
|
||||
-Wdeclaration-after-statement FIXME: do not want. others may
|
||||
-Wdesignated-init c
|
||||
-Wdiscarded-array-qualifiers c
|
||||
-Wdiscarded-qualifiers c
|
||||
-Werror-implicit-function-declaration deprecated
|
||||
-Wfloat-conversion FIXME maybe? borderline. some will want this
|
||||
-Wfloat-equal FIXME maybe? borderline. some will want this
|
||||
-Wformat covered by -Wformat=2
|
||||
-Wformat= gcc --help=warnings artifact
|
||||
-Wframe-larger-than=<number> FIXME: choose something sane?
|
||||
-Wfunction-elimination fortran
|
||||
-Wimplicit c
|
||||
-Wimplicit-function-declaration c
|
||||
-Wimplicit-int c
|
||||
-Wimplicit-interface fortran
|
||||
-Wimplicit-procedure fortran
|
||||
-Wincompatible-pointer-types c
|
||||
-Wint-conversion c
|
||||
-Winteger-division fortran
|
||||
-Wintrinsic-shadow fortran
|
||||
-Wintrinsics-std fortran
|
||||
-Wjump-misses-init c
|
||||
-Wlarger-than- gcc --help=warnings artifact
|
||||
-Wlarger-than=<number> FIXME: choose something sane?
|
||||
-Wline-truncation fortran
|
||||
-Wlong-long obsolescent
|
||||
-Wmissing-format-attribute obsolescent
|
||||
-Wmissing-noreturn obsolescent
|
||||
-Wmissing-parameter-type c
|
||||
-Wmissing-prototypes c
|
||||
-Wnested-externs c
|
||||
-Wnormalized covered by -Wnormalized=
|
||||
-Wnormalized=<none|id|nfc|nfkc> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wold-style-declaration c
|
||||
-Wold-style-definition c
|
||||
-Woverride-init c
|
||||
-Wpadded FIXME maybe? warns about "stabil" member in /usr/include/bits/timex.h
|
||||
-Wpedantic FIXME: too strict?
|
||||
-Wpointer-sign c
|
||||
-Wpointer-to-int-cast c
|
||||
-Wproperty-assign-default objc++
|
||||
-Wprotocol objc++
|
||||
-Wrealloc-lhs-all fortran
|
||||
-Wrealloc-lhs fortran
|
||||
-Wreal-q-constant fortran
|
||||
-Wredundant-decls FIXME maybe? many _gl_cxxalias_dummy FPs
|
||||
-Wselector objc and objc++
|
||||
-Wshadow-ivar objc
|
||||
-Wshift-overflow covered by -Wshift-overflow=2
|
||||
-Wshift-overflow= gcc --help=warnings artifact
|
||||
-Wsign-compare FIXME maybe? borderline. some will want this
|
||||
-Wsign-conversion FIXME maybe? borderline. some will want this
|
||||
-Wstack-usage= FIXME: choose something sane?
|
||||
-Wstrict-aliasing= FIXME: choose something sane?
|
||||
-Wstrict-overflow= FIXME: choose something sane?
|
||||
-Wstrict-prototypes c
|
||||
-Wstrict-selector-match objc and objc++
|
||||
-Wsurprising fortran
|
||||
-Wswitch-default https://lists.gnu.org/r/bug-gnulib/2018-05/msg00179.html
|
||||
-Wswitch-enum FIXME maybe? borderline. some will want this
|
||||
-Wsynth deprecated
|
||||
-Wsystem-headers warns about system headers on macOS and #include_next in gnulib headers
|
||||
-Wtabs fortran
|
||||
-Wtarget-lifetime fortran
|
||||
-Wtraditional-conversion obsolescent
|
||||
-Wtraditional obsolescent
|
||||
-Wundeclared-selector objc and objc++
|
||||
-Wundef FIXME maybe? too many false positives
|
||||
-Wunderflow fortran
|
||||
-Wunreachable-code obsolescent no-op
|
||||
-Wunsuffixed-float-constants triggers warning in gnulib's timespec.h
|
||||
-Wunused-const-variable covered by -Wunusec-const-variable=2
|
||||
-Wunused-const-variable= gcc --help=warnings artifact
|
||||
-Wunused-dummy-argument fortran
|
||||
-Wuse-without-only fortran
|
||||
-Wzerotrip fortran
|
||||
@@ -0,0 +1,400 @@
|
||||
# options to filter out, and why
|
||||
--all-warnings alias for -Wall
|
||||
--extra-warnings alias for -Wextra
|
||||
-W alias for -Wextra
|
||||
-Wabi this is now a no-op
|
||||
-Wabi-tag c++
|
||||
-Wabi= c++
|
||||
-Wabsolute-value enabled by -Wextra
|
||||
-Waddress enabled by -Wall
|
||||
-Waddress-of-packed-member default
|
||||
-Waggregate-return obsolescent
|
||||
-Waggressive-loop-optimizations default
|
||||
-Waliasing fortran
|
||||
-Walign-commons fortran
|
||||
-Waligned-new=[none|global|all] c++
|
||||
-Walloc-size enabled by -Wextra
|
||||
-Walloc-size-larger-than=<bytes> defaults to PTRDIFF_MAX
|
||||
-Walloc-zero Gnulib fixes this problem
|
||||
-Walloca we like alloca in small doses
|
||||
-Walloca-larger-than=<number> FIXME: choose something sane?
|
||||
-Wampersand fortran
|
||||
-Wanalyzer-allocation-size enabled by -fanalyzer
|
||||
-Wanalyzer-deref-before-check enabled by -fanalyzer
|
||||
-Wanalyzer-double-fclose enabled by -fanalyzer
|
||||
-Wanalyzer-double-free enabled by -fanalyzer
|
||||
-Wanalyzer-exposure-through-output-file enabled by -fanalyzer
|
||||
-Wanalyzer-exposure-through-uninit-copy enabled by -fanalyzer
|
||||
-Wanalyzer-fd-access-mode-mismatch enabled by -fanalyzer
|
||||
-Wanalyzer-fd-double-close enabled by -fanalyzer
|
||||
-Wanalyzer-fd-leak enabled by -fanalyzer
|
||||
-Wanalyzer-fd-phase-mismatch enabled by -fanalyzer
|
||||
-Wanalyzer-fd-type-mismatch enabled by -fanalyzer
|
||||
-Wanalyzer-fd-use-after-close enabled by -fanalyzer
|
||||
-Wanalyzer-fd-use-without-check enabled by -fanalyzer
|
||||
-Wanalyzer-file-leak enabled by -fanalyzer
|
||||
-Wanalyzer-free-of-non-heap enabled by -fanalyzer
|
||||
-Wanalyzer-imprecise-fp-arithmetic enabled by -fanalyzer
|
||||
-Wanalyzer-infinite-loop enabled by -fanalyzer
|
||||
-Wanalyzer-infinite-recursion enabled by -fanalyzer
|
||||
-Wanalyzer-jump-through-null enabled by -fanalyzer
|
||||
-Wanalyzer-malloc-leak enabled by -fanalyzer
|
||||
-Wanalyzer-mismatching-deallocation enabled by -fanalyzer
|
||||
-Wanalyzer-null-argument enabled by -fanalyzer
|
||||
-Wanalyzer-null-dereference enabled by -fanalyzer
|
||||
-Wanalyzer-out-of-bounds enabled by -fanalyzer
|
||||
-Wanalyzer-overlapping-buffers enabled by -fanalyzer
|
||||
-Wanalyzer-possible-null-argument enabled by -fanalyzer
|
||||
-Wanalyzer-possible-null-dereference enabled by -fanalyzer
|
||||
-Wanalyzer-putenv-of-auto-var enabled by -fanalyzer
|
||||
-Wanalyzer-shift-count-negative enabled by -fanalyzer
|
||||
-Wanalyzer-shift-count-overflow enabled by -fanalyzer
|
||||
-Wanalyzer-stale-setjmp-buffer implied by -fanalyzer
|
||||
-Wanalyzer-symbol-too-complex warns about compiler not about program
|
||||
-Wanalyzer-tainted-allocation-size FIXME requires -fanalyzer-checker=taint
|
||||
-Wanalyzer-tainted-array-index FIXME requires -fanalyzer-checker=taint
|
||||
-Wanalyzer-tainted-assertion FIXME requires -fanalyzer-checker=taint
|
||||
-Wanalyzer-tainted-divisor FIXME requires -fanalyzer-checker=taint
|
||||
-Wanalyzer-tainted-offset FIXME requires -fanalyzer-checker=taint
|
||||
-Wanalyzer-tainted-size FIXME requires -fanalyzer-checker=taint
|
||||
-Wanalyzer-undefined-behavior-strtok enabled by -fanalyzer
|
||||
-Wanalyzer-va-arg-type-mismatch enabled by -fanalyzer
|
||||
-Wanalyzer-va-list-exhausted enabled by -fanalyzer
|
||||
-Wanalyzer-va-list-leak enabled by -fanalyzer
|
||||
-Wanalyzer-va-list-use-after-va-end enabled by -fanalyzer
|
||||
-Wanalyzer-too-complex enabled by -fanalyzer
|
||||
-Wanalyzer-unsafe-call-within-signal-handler enabled by -fanalyzer
|
||||
-Wanalyzer-use-after-free enabled by -fanalyzer
|
||||
-Wanalyzer-use-of-pointer-in-stale-stack-frame enabled by -fanalyzer
|
||||
-Wanalyzer-use-of-uninitialized-value enabled by -fanalyzer
|
||||
-Wanalyzer-write-to-const enabled by -fanalyzer
|
||||
-Wanalyzer-write-to-string-literal enabled by -fanalyzer
|
||||
-Warray-bounds covered by -Warray-bounds=
|
||||
-Warray-bounds=<0,2> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Warray-compare enabled by -Wall
|
||||
-Warray-parameter enabled by -Wall
|
||||
-Warray-parameter=<0,2> enabled by -Wall
|
||||
-Warray-temporaries fortran
|
||||
-Wassign-intercept objc/objc++
|
||||
-Wattribute-alias covered by -Wattribute-alias=2
|
||||
-Wattribute-alias=<0,2> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wattribute-warning default
|
||||
-Wattributes default
|
||||
-Wbidi-chars handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wbidi-chars= handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wbool-compare enabled by -Wall
|
||||
-Wbool-operation enabled by -Wall
|
||||
-Wbuiltin-declaration-mismatch default
|
||||
-Wbuiltin-macro-redefined default
|
||||
-Wc++-compat only useful for code meant to be compiled by a C++ compiler
|
||||
-Wc++0x-compat c++
|
||||
-Wc++11-compat c++
|
||||
-Wc++11-extensions c++
|
||||
-Wc++14-compat c++
|
||||
-Wc++14-extensions c++
|
||||
-Wc++17-compat c++
|
||||
-Wc++17-extensions c++
|
||||
-Wc++1z-compat c++
|
||||
-Wc++20-compat c++
|
||||
-Wc++20-extensions c++
|
||||
-Wc++23-extensions c++
|
||||
-Wc++26-extensions c++
|
||||
-Wc++2a-compat c++
|
||||
-Wc-binding-type fortran
|
||||
-Wc11-c23-compat c compatibility
|
||||
-Wc90-c99-compat c compatibility
|
||||
-Wc99-c11-compat c compatibility
|
||||
-Wcalloc-transposed-args enabled by -Wextra
|
||||
-Wcannot-profile default
|
||||
-Wcast-align enabled by -Wcast-align=strict
|
||||
-Wcast-function-type enabled by -Wextra
|
||||
-Wcast-qual FIXME maybe? too much noise; encourages bad changes
|
||||
-Wcast-result D
|
||||
-Wcatch-value c++
|
||||
-Wcatch-value=<0,3> c++
|
||||
-Wchanges-meaning c++
|
||||
-Wchar-subscripts enabled by -Wall
|
||||
-Wcharacter-truncation fortran
|
||||
-Wchkp deprecated
|
||||
-Wclass-conversion c++ and objc++
|
||||
-Wclass-memaccess c++
|
||||
-Wclobbered enabled by -Wextra
|
||||
-Wcomma-subscript c++ and objc++
|
||||
-Wcomment enabled by -Wall
|
||||
-Wcomments alias for -Wcomment
|
||||
-Wcompare-distinct-pointer-types default
|
||||
-Wcompare-reals fortran
|
||||
-Wcomplain-wrong-lang default
|
||||
-Wconditionally-supported c++ and objc++
|
||||
-Wconversion FIXME maybe? too much noise; encourages bad changes
|
||||
-Wcoverage-too-many-conditions default
|
||||
-Wconversion-extra fortran
|
||||
-Wconversion-null c++ and objc++
|
||||
-Wcoverage-invalid-line-number default if --coverage
|
||||
-Wcoverage-mismatch default
|
||||
-Wcpp default
|
||||
-Wctad-maybe-unsupported c++ and objc++
|
||||
-Wctor-dtor-privacy c++
|
||||
-Wdangling-else enabled by -Wparentheses
|
||||
-Wdangling-pointer enabled by -Wall
|
||||
-Wdangling-pointer=<0,2> enabled by -Wall
|
||||
-Wdangling-reference c++ and objc++
|
||||
-Wdeclaration-after-statement needed only for pre-C99, so obsolete
|
||||
-Wdeclaration-missing-parameter-type default
|
||||
-Wdelete-incomplete c++ and objc++
|
||||
-Wdelete-non-virtual-dtor c++
|
||||
-Wdeprecated default
|
||||
-Wdeprecated-copy c++ and objc++
|
||||
-Wdeprecated-copy-dtor c++ and objc++
|
||||
-Wdeprecated-declarations default
|
||||
-Wdeprecated-enum-enum-conversion c++ and objc++
|
||||
-Wdeprecated-enum-float-conversion c++ and objc++
|
||||
-Wdesignated-init default
|
||||
-Wdiscarded-array-qualifiers default
|
||||
-Wdiscarded-qualifiers default
|
||||
-Wdo-subscript fortran
|
||||
-Wdiv-by-zero default
|
||||
-Wduplicate-decl-specifier enabled by -Wall
|
||||
-Weffc++ c++
|
||||
-Welaborated-enum-base default, c++11+
|
||||
-Wempty-body enabled by -Wextra
|
||||
-Wenum-compare enabled by -Wall
|
||||
-Wenum-conversion enabled by -Wextra
|
||||
-Wenum-int-mismatch enabled by -Wall
|
||||
-Wendif-labels default
|
||||
-Werror-implicit-function-declaration deprecated
|
||||
-Wexceptions c++ and objc++
|
||||
-Wexpansion-to-defined enabled by -Wextra
|
||||
-Wextra-semi c++
|
||||
-Wfloat-conversion FIXME maybe? borderline. some will want this
|
||||
-Wfloat-equal FIXME maybe? borderline. some will want this
|
||||
-Wformat covered by -Wformat=2
|
||||
-Wformat-contains-nul default
|
||||
-Wformat-diag enabled by -Wformat=2
|
||||
-Wformat-extra-args enabled by -Wformat=2
|
||||
-Wformat-nonliteral enabled by -Wformat=2
|
||||
-Wformat-overflow<0,2> gcc --help=warnings artifact
|
||||
-Wformat-overflow=<0,2> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wformat-security enabled by -Wformat=2
|
||||
-Wformat-truncation covered by -Wformat-truncation=2
|
||||
-Wformat-truncation=<0,2> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wformat-y2k enabled by -Wformat=2
|
||||
-Wformat-zero-length enabled by -Wformat=2
|
||||
-Wformat=<0,2> gcc --help=warnings artifact
|
||||
-Wframe-address enabled by -Wall
|
||||
-Wframe-larger-than=<byte-size> FIXME: choose something sane?
|
||||
-Wfree-nonheap-object default
|
||||
-Wfunction-elimination fortran
|
||||
-Wglobal-module default, c++ and objc++
|
||||
-Whardened default
|
||||
-Whsa default
|
||||
-Wif-not-aligned default
|
||||
-Wignored-attributes default
|
||||
-Wignored-qualifiers enabled by -Wextra
|
||||
-Wimplicit enabled by -Wall
|
||||
-Wimplicit-fallthrough covered by -Wimplicit-fallthrough=2
|
||||
-Wimplicit-fallthrough=<0,5> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wimplicit-function-declaration enabled by -Wimplicit
|
||||
-Wimplicit-int enabled by -Wimplicit
|
||||
-Wimplicit-interface fortran
|
||||
-Wimplicit-procedure fortran
|
||||
-Winaccessible-base c++ and objc++
|
||||
-Wincompatible-pointer-types default
|
||||
-Winfinite-recursion enabled by -Wall
|
||||
-Winherited-variadic-ctor c++
|
||||
-Winit-list-lifetime c++ and objc++
|
||||
-Wint-conversion default
|
||||
-Wint-in-bool-context enabled by -Wall
|
||||
-Wint-to-pointer-cast default
|
||||
-Winteger-division fortran
|
||||
-Winterference-size c++
|
||||
-Wintrinsic-shadow fortran
|
||||
-Wintrinsics-std fortran
|
||||
-Winvalid-constexpr c++
|
||||
-Winvalid-imported-macros c++ and objc++
|
||||
-Winvalid-memory-model default
|
||||
-Winvalid-offsetof c++ and objc++
|
||||
-Winvalid-utf8 enabled by -finput-charset=UTF-8
|
||||
-Wjump-misses-init only useful for code meant to be compiled by a C++ compiler
|
||||
-Wlarger-than- gcc --help=warnings artifact
|
||||
-Wlarger-than=<byte-size> FIXME: choose something sane?
|
||||
-Wline-truncation fortran
|
||||
-Wliteral-suffix c++ and objc++
|
||||
-Wlogical-not-parentheses enabled by -Wall
|
||||
-Wlong-long obsolescent
|
||||
-Wlto-type-mismatch c++ and objc++
|
||||
-Wmain enabled by -Wall
|
||||
-Wmaybe-uninitialized enabled by -Wall or -Wextra
|
||||
-Wmemset-elt-size enabled by -Wall
|
||||
-Wmemset-transposed-args enabled by -Wall
|
||||
-Wmisleading-indentation enabled by -Wall
|
||||
-Wmismatched-dealloc default
|
||||
-Wmismatched-new-delete default, c++ and objc++
|
||||
-Wmismatched-special-enum d
|
||||
-Wmismatched-tags c++ and objc++
|
||||
-Wmissing-attributes enabled by -Wall
|
||||
-Wmissing-braces enabled by -Wall
|
||||
-Wmissing-field-initializers enabled by -Wextra
|
||||
-Wmissing-format-attribute obsolescent
|
||||
-Wmissing-noreturn obsolescent
|
||||
-Wmissing-parameter-type enabled by -Wextra
|
||||
-Wmissing-profile default
|
||||
-Wmissing-requires default, c++
|
||||
-Wmissing-template-keyword default, c++
|
||||
-Wmultichar default
|
||||
-Wmultiple-inheritance c++ and objc++
|
||||
-Wmultistatement-macros enabled by -Wall
|
||||
-Wnamespaces c++
|
||||
-Wnarrowing enabled by -Wall
|
||||
-Wno-alloc-size-larger-than see -Walloc-size-larger-than
|
||||
-Wno-alloca-larger-than see -Walloca-larger-than
|
||||
-Wno-frame-larger-than see -Wframe-larger-than
|
||||
-Wno-larger-than see -Wlarger-than
|
||||
-Wno-stack-usage see -Wstack-usage
|
||||
-Wno-vla-larger-than see -Wvla-larger-than
|
||||
-Wnoexcept c++
|
||||
-Wnoexcept-type c++
|
||||
-Wnon-template-friend c++
|
||||
-Wnon-virtual-dtor c++
|
||||
-Wnonnull enabled by -Wall or -Wformat
|
||||
-Wnonnull-compare enabled by -Wall
|
||||
-Wnormalized default
|
||||
-Wnormalized=[none|id|nfc|nfkc] defaults to nfc
|
||||
-WNSObject-attribute objc and objc++
|
||||
-Wobjc-root-class objc and objc++
|
||||
-Wodr default
|
||||
-Wold-style-cast c++ and objc++
|
||||
-Wold-style-declaration enabled by -Wextra
|
||||
-Wopenacc-parallelism OpenACC
|
||||
-Wopenmp default
|
||||
-Woverflow default
|
||||
-Woverloaded-virtual c++
|
||||
-Woverloaded-virtual=<0,2> c++
|
||||
-Woverride-init enabled by -Wextra
|
||||
-Woverride-init-side-effects c++ and objc++
|
||||
-Woverwrite-recursive fortran
|
||||
-Wpacked-bitfield-compat default
|
||||
-Wpacked-not-aligned enabled by -Wall
|
||||
-Wpadded FIXME maybe? warns about "stabil" member in /usr/include/bits/timex.h
|
||||
-Wparentheses enabled by -Wall
|
||||
-Wpedantic FIXME: too strict?
|
||||
-Wpessimizing-move c++ and objc++
|
||||
-Wplacement-new c++
|
||||
-Wplacement-new=<0,2> c++
|
||||
-Wpmf-conversions c++ and objc++
|
||||
-Wpointer-compare default
|
||||
-Wpointer-sign enabled by -Wall
|
||||
-Wpointer-to-int-cast default
|
||||
-Wpragmas default
|
||||
-Wprio-ctor-dtor c++
|
||||
-Wproperty-assign-default objc++
|
||||
-Wprotocol objc++
|
||||
-Wpsabi default
|
||||
-Wrange-loop-construct c++ and objc++
|
||||
-Wreal-q-constant fortran
|
||||
-Wrealloc-lhs fortran
|
||||
-Wrealloc-lhs-all fortran
|
||||
-Wredundant-decls FIXME maybe? many _gl_cxxalias_dummy FPs
|
||||
-Wredundant-move c++ and objc++
|
||||
-Wredundant-tags c++ and objc++
|
||||
-Wregister c++ and objc++
|
||||
-Wreorder c++ and objc++
|
||||
-Wrestrict enabled by -Wall
|
||||
-Wreturn-local-addr default
|
||||
-Wreturn-mismatch default
|
||||
-Wreturn-type enabled by -Wall
|
||||
-Wscalar-storage-order default
|
||||
-Wselector objc and objc++
|
||||
-Wsequence-point enabled by -Wall
|
||||
-Wself-move c++ and objc++
|
||||
-Wshadow-compatible-local covered by -Wshadow
|
||||
-Wshadow-ivar objc
|
||||
-Wshadow-local covered by -Wshadow
|
||||
-Wshadow=compatible-local covered by -Wshadow
|
||||
-Wshadow=global covered by -Wshadow
|
||||
-Wshadow=local covered by -Wshadow
|
||||
-Wshift-count-negative default
|
||||
-Wshift-count-overflow default
|
||||
-Wshift-negative-value enabled by -Wextra
|
||||
-Wshift-overflow covered by -Wshift-overflow=2
|
||||
-Wshift-overflow=<0,2> gcc --help=warnings artifact
|
||||
-Wsign-compare enabled by -Wextra
|
||||
-Wsign-conversion FIXME maybe? borderline. some will want this
|
||||
-Wsign-promo c++ and objc++
|
||||
-Wsized-deallocation c++ and objc++
|
||||
-Wsizeof-array-argument default
|
||||
-Wsizeof-array-div enabled by -Wall
|
||||
-Wsizeof-pointer-div enabled by -Wall
|
||||
-Wsizeof-pointer-memaccess enabled by -Wall
|
||||
-Wstack-usage=<byte-size> FIXME: choose something sane?
|
||||
-Wstrict-aliasing enabled by -Wall
|
||||
-Wstrict-aliasing=<0,3> FIXME: choose something sane?
|
||||
-Wstrict-null-sentinel c++ and objc++
|
||||
-Wstrict-overflow=<0,5> FIXME: choose something sane?
|
||||
-Wstrict-selector-match objc and objc++
|
||||
-Wstring-compare enabled by -Wextra
|
||||
-Wstringop-overflow covered by -Wstringop-overflow=2
|
||||
-Wstringop-overflow=<0,4> defaults to 2
|
||||
-Wstringop-overread default
|
||||
-Wstringop-truncation default
|
||||
-Wsubobject-linkage c++ and objc++
|
||||
-Wsuggest-attribute=returns_nonnull https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114833
|
||||
-Wsuggest-override c++ and objc++
|
||||
-Wsurprising fortran
|
||||
-Wswitch enabled by -Wall
|
||||
-Wswitch-bool default
|
||||
-Wswitch-default https://lists.gnu.org/r/bug-gnulib/2018-05/msg00179.html
|
||||
-Wswitch-enum FIXME maybe? borderline. some will want this
|
||||
-Wswitch-outside-range default
|
||||
-Wswitch-unreachable default
|
||||
-Wsynth deprecated
|
||||
-Wsystem-headers warns about system headers on macOS and #include_next in gnulib headers
|
||||
-Wtabs fortran
|
||||
-Wtarget-lifetime fortran
|
||||
-Wtautological-compare enabled by -Wall
|
||||
-Wtemplate-id-cdtor default, c++ and objc++
|
||||
-Wtemplates c++ and objc++
|
||||
-Wterminate c++ and objc++
|
||||
-Wtraditional obsolescent
|
||||
-Wtraditional-conversion obsolescent
|
||||
-Wtrigraphs enabled by -Wall
|
||||
-Wtrivial-auto-var-init subsumed by -Wmaybe-uninitialized
|
||||
-Wtsan default
|
||||
-Wtype-limits enabled by -Wextra
|
||||
-Wundeclared-selector objc and objc++
|
||||
-Wundef FIXME maybe? too many false positives
|
||||
-Wundefined-do-loop fortran
|
||||
-Wunderflow fortran
|
||||
-Wunicode default
|
||||
-Wunreachable-code obsolescent no-op
|
||||
-Wunsuffixed-float-constants triggers warning in gnulib's timespec.h
|
||||
-Wunused enabled by -Wall
|
||||
-Wunused-but-set-parameter enabled by -Wunused
|
||||
-Wunused-but-set-variable enabled by -Wunused
|
||||
-Wunused-const-variable covered by -Wunused-const-variable=2
|
||||
-Wunused-const-variable=<0,2> gcc --help=warnings artifact
|
||||
-Wunused-dummy-argument fortran
|
||||
-Wunused-function enabled by -Wunused
|
||||
-Wunused-label enabled by -Wunused
|
||||
-Wunused-local-typedefs enabled by -Wunused
|
||||
-Wunused-parameter enabled by -Wunused
|
||||
-Wunused-result enabled by -Wunused
|
||||
-Wunused-value enabled by -Wunused
|
||||
-Wunused-variable enabled by -Wunused
|
||||
-Wuse-after-free handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wuse-after-free=<0,3> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wuse-without-only fortran
|
||||
-Wuseless-cast c++ and objc++
|
||||
-Wvarargs default
|
||||
-Wvexing-parse c++ and objc++
|
||||
-Wvirtual-inheritance c++
|
||||
-Wvirtual-move-assign c++
|
||||
-Wvla-larger-than=<number> handled specially by gl_MANYWARN_ALL_GCC
|
||||
-Wvla-parameter enabled by -Wall
|
||||
-Wvolatile c++ and objc++
|
||||
-Wvolatile-register-var enabled by -Wall
|
||||
-Wxor-used-as-pow default
|
||||
-Wzero-as-null-pointer-constant c++ and objc++
|
||||
-Wzero-length-bounds enabled by -Wall
|
||||
-Wzerotrip fortran
|
||||
-frequire-return-statement go
|
||||
@@ -0,0 +1,562 @@
|
||||
#!/bin/sh -e
|
||||
# gendocs.sh -- generate a GNU manual in many formats. This script is
|
||||
# mentioned in maintain.texi. See the help message below for usage details.
|
||||
|
||||
scriptversion=2024-07-04.03
|
||||
|
||||
# Copyright 2003-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Original author: Mohit Agarwal.
|
||||
# Send bug reports and any other correspondence to bug-gnulib@gnu.org.
|
||||
#
|
||||
# The latest version of this script, and the companion template, is
|
||||
# available from the Gnulib repository:
|
||||
#
|
||||
# https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
|
||||
# https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
|
||||
|
||||
# TODO:
|
||||
# - image importing was only implemented for HTML generated by
|
||||
# makeinfo. But it should be simple enough to adjust.
|
||||
# - images are not imported in the source tarball. All the needed
|
||||
# formats (PDF, PNG, etc.) should be included.
|
||||
|
||||
prog=`basename "$0"`
|
||||
srcdir=`pwd`
|
||||
|
||||
scripturl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
|
||||
templateurl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
|
||||
|
||||
: "${SETLANG="env LANG= LC_TIME= LC_MESSAGES= LC_ALL= LANGUAGE="}"
|
||||
: "${MAKEINFO="makeinfo"}"
|
||||
: "${TEXI2DVI="texi2dvi"}"
|
||||
: "${DOCBOOK2HTML="docbook2html"}"
|
||||
: "${DOCBOOK2PDF="docbook2pdf"}"
|
||||
: "${DOCBOOK2TXT="docbook2txt"}"
|
||||
: "${GENDOCS_TEMPLATE_DIR="."}"
|
||||
: "${PERL="perl"}"
|
||||
: "${TEXI2HTML="texi2html"}"
|
||||
unset CDPATH
|
||||
unset use_texi2html
|
||||
|
||||
MANUAL_TITLE=
|
||||
PACKAGE=
|
||||
EMAIL=webmasters@gnu.org # please override with --email
|
||||
commonarg= # passed to all makeinfo/texi2html invocations.
|
||||
dirargs= # passed to all tools (-I dir).
|
||||
dirs= # -I directories.
|
||||
htmlarg="--css-ref=https://www.gnu.org/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
|
||||
default_htmlarg=true
|
||||
infoarg=--no-split
|
||||
generate_ascii=true
|
||||
generate_html=true
|
||||
generate_info=true
|
||||
generate_tex=true
|
||||
outdir=manual
|
||||
unset source_extra
|
||||
split=node
|
||||
srcfile=
|
||||
texarg="-t @finalout"
|
||||
|
||||
version="gendocs.sh $scriptversion
|
||||
|
||||
Copyright 2024 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING."
|
||||
|
||||
usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
|
||||
|
||||
Generate output in various formats from PACKAGE.texinfo (or .texi or
|
||||
.txi) source. See the GNU Maintainers document for a more extensive
|
||||
discussion:
|
||||
https://www.gnu.org/prep/maintain_toc.html
|
||||
|
||||
Options:
|
||||
--email ADR use ADR as contact in generated web pages; always give this.
|
||||
|
||||
-s SRCFILE read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi}
|
||||
-o OUTDIR write files into OUTDIR, instead of manual/.
|
||||
-I DIR append DIR to the Texinfo search path.
|
||||
--common ARG pass ARG in all invocations.
|
||||
--html ARG pass ARG to makeinfo or texi2html for HTML targets,
|
||||
instead of '$htmlarg'.
|
||||
--info ARG pass ARG to makeinfo for Info, instead of --no-split.
|
||||
--no-ascii skip generating the plain text output.
|
||||
--no-html skip generating the html output.
|
||||
--no-info skip generating the info output.
|
||||
--no-tex skip generating the dvi and pdf output.
|
||||
--source ARG include ARG in tar archive of sources.
|
||||
--split HOW make split HTML by node, section, chapter; default node.
|
||||
--tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout.
|
||||
|
||||
--texi2html use texi2html to make HTML target, with all split versions.
|
||||
--docbook convert through DocBook too (xml, txt, html, pdf).
|
||||
|
||||
--help display this help and exit successfully.
|
||||
--version display version information and exit successfully.
|
||||
|
||||
Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\"
|
||||
|
||||
Typical sequence:
|
||||
cd PACKAGESOURCE/doc
|
||||
wget \"$scripturl\"
|
||||
wget \"$templateurl\"
|
||||
$prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\"
|
||||
|
||||
Output will be in a new subdirectory \"manual\" (by default;
|
||||
use -o OUTDIR to override). Move all the new files into your web CVS
|
||||
tree, as explained in the Web Pages node of maintain.texi.
|
||||
|
||||
Please use the --email ADDRESS option so your own bug-reporting
|
||||
address will be used in the generated HTML pages.
|
||||
|
||||
MANUAL-TITLE is included as part of the HTML <title> of the overall
|
||||
manual/index.html file. It should include the name of the package being
|
||||
documented. manual/index.html is created by substitution from the file
|
||||
$GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the
|
||||
generic template for your own purposes.)
|
||||
|
||||
If you have several manuals, you'll need to run this script several
|
||||
times with different MANUAL values, specifying a different output
|
||||
directory with -o each time. Then write (by hand) an overall index.html
|
||||
with links to them all.
|
||||
|
||||
If a manual's Texinfo sources are spread across several directories,
|
||||
first copy or symlink all Texinfo sources into a single directory.
|
||||
(Part of the script's work is to make a tar.gz of the sources.)
|
||||
|
||||
As implied above, by default monolithic Info files are generated.
|
||||
If you want split Info, or other Info options, use --info to override.
|
||||
|
||||
You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML,
|
||||
and PERL to control the programs that get executed, and
|
||||
GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is
|
||||
looked for. With --docbook, the environment variables DOCBOOK2HTML,
|
||||
DOCBOOK2PDF, and DOCBOOK2TXT are also consulted.
|
||||
|
||||
By default, makeinfo and texi2dvi are run in the default (English)
|
||||
locale, since that's the language of most Texinfo manuals. If you
|
||||
happen to have a non-English manual and non-English web site, see the
|
||||
SETLANG setting in the source.
|
||||
|
||||
Email bug reports or enhancement requests to bug-gnulib@gnu.org.
|
||||
"
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
-s) shift; srcfile=$1;;
|
||||
-o) shift; outdir=$1;;
|
||||
-I) shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";;
|
||||
--common) shift; commonarg=$1;;
|
||||
--docbook) docbook=yes;;
|
||||
--email) shift; EMAIL=$1;;
|
||||
--html) shift; default_htmlarg=false; htmlarg=$1;;
|
||||
--info) shift; infoarg=$1;;
|
||||
--no-ascii) generate_ascii=false;;
|
||||
--no-html) generate_html=false;;
|
||||
--no-info) generate_info=false;;
|
||||
--no-tex) generate_tex=false;;
|
||||
--source) shift; source_extra=$1;;
|
||||
--split) shift; split=$1;;
|
||||
--tex) shift; texarg=$1;;
|
||||
--texi2html) use_texi2html=1;;
|
||||
|
||||
--help) echo "$usage"; exit 0;;
|
||||
--version) echo "$version"; exit 0;;
|
||||
-*)
|
||||
echo "$0: Unknown option \`$1'." >&2
|
||||
echo "$0: Try \`--help' for more information." >&2
|
||||
exit 1;;
|
||||
*)
|
||||
if test -z "$PACKAGE"; then
|
||||
PACKAGE=$1
|
||||
elif test -z "$MANUAL_TITLE"; then
|
||||
MANUAL_TITLE=$1
|
||||
else
|
||||
echo "$0: extra non-option argument \`$1'." >&2
|
||||
exit 1
|
||||
fi;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# makeinfo uses the dirargs, but texi2dvi doesn't.
|
||||
commonarg=" $dirargs $commonarg"
|
||||
|
||||
# For most of the following, the base name is just $PACKAGE
|
||||
base=$PACKAGE
|
||||
|
||||
if $default_htmlarg && test -n "$use_texi2html"; then
|
||||
# The legacy texi2html doesn't support TOP_NODE_UP_URL
|
||||
htmlarg="--css-ref=https://www.gnu.org/software/gnulib/manual.css"
|
||||
fi
|
||||
|
||||
if test -n "$srcfile"; then
|
||||
# but here, we use the basename of $srcfile
|
||||
base=`basename "$srcfile"`
|
||||
case $base in
|
||||
*.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;;
|
||||
esac
|
||||
PACKAGE=$base
|
||||
elif test -s "$srcdir/$PACKAGE.texinfo"; then
|
||||
srcfile=$srcdir/$PACKAGE.texinfo
|
||||
elif test -s "$srcdir/$PACKAGE.texi"; then
|
||||
srcfile=$srcdir/$PACKAGE.texi
|
||||
elif test -s "$srcdir/$PACKAGE.txi"; then
|
||||
srcfile=$srcdir/$PACKAGE.txi
|
||||
else
|
||||
echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
|
||||
echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2
|
||||
echo "$0: it is available from $templateurl." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Function to return size of $1 in something resembling kilobytes.
|
||||
calcsize()
|
||||
{
|
||||
size=`ls -ksl $1 | awk '{print $1}'`
|
||||
echo $size
|
||||
}
|
||||
|
||||
# copy_images OUTDIR HTML-FILE...
|
||||
# -------------------------------
|
||||
# Copy all the images needed by the HTML-FILEs into OUTDIR.
|
||||
# Look for them in . and the -I directories; this is simpler than what
|
||||
# makeinfo supports with -I, but hopefully it will suffice.
|
||||
copy_images()
|
||||
{
|
||||
local odir
|
||||
odir=$1
|
||||
shift
|
||||
$PERL -n -e "
|
||||
BEGIN {
|
||||
\$me = '$prog';
|
||||
\$odir = '$odir';
|
||||
@dirs = qw(. $dirs);
|
||||
}
|
||||
" -e '
|
||||
/<img src="(.*?)"/g && ++$need{$1};
|
||||
|
||||
END {
|
||||
#print "$me: @{[sort keys %need]}\n"; # for debugging, show images found.
|
||||
FILE: for my $f (sort keys %need) {
|
||||
for my $d (@dirs) {
|
||||
if (-f "$d/$f") {
|
||||
use File::Basename;
|
||||
my $dest = dirname ("$odir/$f");
|
||||
#
|
||||
use File::Path;
|
||||
-d $dest || mkpath ($dest)
|
||||
|| die "$me: cannot mkdir $dest: $!\n";
|
||||
#
|
||||
use File::Copy;
|
||||
copy ("$d/$f", $dest)
|
||||
|| die "$me: cannot copy $d/$f to $dest: $!\n";
|
||||
next FILE;
|
||||
}
|
||||
}
|
||||
die "$me: $ARGV: cannot find image $f\n";
|
||||
}
|
||||
}
|
||||
' -- "$@" || exit 1
|
||||
}
|
||||
|
||||
case $outdir in
|
||||
/*) abs_outdir=$outdir;;
|
||||
*) abs_outdir=$srcdir/$outdir;;
|
||||
esac
|
||||
|
||||
echo "Making output for $srcfile"
|
||||
echo " in `pwd`"
|
||||
mkdir -p "$outdir/"
|
||||
|
||||
#
|
||||
if $generate_info; then
|
||||
cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
|
||||
echo "Generating info... ($cmd)"
|
||||
rm -f $PACKAGE.info* # get rid of any strays
|
||||
eval "$cmd"
|
||||
tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
|
||||
ls -l "$outdir/$PACKAGE.info.tar.gz"
|
||||
info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
|
||||
# do not mv the info files, there's no point in having them available
|
||||
# separately on the web.
|
||||
fi # end info
|
||||
|
||||
#
|
||||
if $generate_tex; then
|
||||
cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\""
|
||||
printf "\nGenerating dvi... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
# compress/finish dvi:
|
||||
gzip -f -9 $PACKAGE.dvi
|
||||
dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
|
||||
mv $PACKAGE.dvi.gz "$outdir/"
|
||||
ls -l "$outdir/$PACKAGE.dvi.gz"
|
||||
|
||||
cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\""
|
||||
printf "\nGenerating pdf... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
pdf_size=`calcsize $PACKAGE.pdf`
|
||||
mv $PACKAGE.pdf "$outdir/"
|
||||
ls -l "$outdir/$PACKAGE.pdf"
|
||||
fi # end tex (dvi + pdf)
|
||||
|
||||
#
|
||||
if $generate_ascii; then
|
||||
opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
|
||||
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
|
||||
printf "\nGenerating ascii... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
ascii_size=`calcsize $PACKAGE.txt`
|
||||
gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
|
||||
ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"`
|
||||
mv $PACKAGE.txt "$outdir/"
|
||||
ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
if $generate_html; then
|
||||
# Split HTML at level $1. Used for texi2html.
|
||||
html_split()
|
||||
{
|
||||
opt="--split=$1 --node-files $commonarg $htmlarg"
|
||||
cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\""
|
||||
printf "\nGenerating html by %s... (%s)\n" "$1" "$cmd"
|
||||
eval "$cmd"
|
||||
split_html_dir=$PACKAGE.html
|
||||
(
|
||||
cd ${split_html_dir} || exit 1
|
||||
ln -sf ${PACKAGE}.html index.html
|
||||
tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html
|
||||
)
|
||||
eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"`
|
||||
rm -f "$outdir"/html_$1/*.html
|
||||
mkdir -p "$outdir/html_$1/"
|
||||
mv ${split_html_dir}/*.html "$outdir/html_$1/"
|
||||
rmdir ${split_html_dir}
|
||||
}
|
||||
|
||||
if test -z "$use_texi2html"; then
|
||||
opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg"
|
||||
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
|
||||
printf "\nGenerating monolithic html... (%s)\n" "$cmd"
|
||||
rm -rf $PACKAGE.html # in case a directory is left over
|
||||
eval "$cmd"
|
||||
html_mono_size=`calcsize $PACKAGE.html`
|
||||
gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
|
||||
html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
|
||||
copy_images "$outdir/" $PACKAGE.html
|
||||
mv $PACKAGE.html "$outdir/"
|
||||
ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz"
|
||||
|
||||
# Before Texinfo 5.0, makeinfo did not accept a --split=HOW option,
|
||||
# it just always split by node. So if we're splitting by node anyway,
|
||||
# leave it out.
|
||||
if test "x$split" = xnode; then
|
||||
split_arg=
|
||||
else
|
||||
split_arg=--split=$split
|
||||
fi
|
||||
#
|
||||
opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg"
|
||||
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
|
||||
printf "\nGenerating html by %s... (%s)\n" "$split" "$cmd"
|
||||
eval "$cmd"
|
||||
split_html_dir=$PACKAGE.html
|
||||
copy_images $split_html_dir/ $split_html_dir/*.html
|
||||
(
|
||||
cd $split_html_dir || exit 1
|
||||
tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- *
|
||||
)
|
||||
eval \
|
||||
html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"`
|
||||
rm -rf "$outdir/html_$split/"
|
||||
mv $split_html_dir "$outdir/html_$split/"
|
||||
du -s "$outdir/html_$split/"
|
||||
ls -l "$outdir/$PACKAGE.html_$split.tar.gz"
|
||||
|
||||
else # use texi2html:
|
||||
opt="--output $PACKAGE.html $commonarg $htmlarg"
|
||||
cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\""
|
||||
printf "\nGenerating monolithic html with texi2html... (%s)\n" "$cmd"
|
||||
rm -rf $PACKAGE.html # in case a directory is left over
|
||||
eval "$cmd"
|
||||
html_mono_size=`calcsize $PACKAGE.html`
|
||||
gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
|
||||
html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
|
||||
mv $PACKAGE.html "$outdir/"
|
||||
|
||||
html_split node
|
||||
html_split chapter
|
||||
html_split section
|
||||
fi
|
||||
fi # end html
|
||||
|
||||
#
|
||||
printf "\nMaking .tar.gz for sources...\n"
|
||||
d=`dirname $srcfile`
|
||||
(
|
||||
cd "$d" || exit
|
||||
|
||||
# Set PATS to a list of globbing patterns that expand to
|
||||
# file names to be put into the .tar.gz for sources.
|
||||
# Omit patterns that do not expand to file names.
|
||||
pats=
|
||||
|
||||
if case `$MAKEINFO --version | sed -e 's/^[^0-9]*//' -e 1q` in \
|
||||
[1-6]* | 7.[01]*) false;; \
|
||||
*) true;; \
|
||||
esac \
|
||||
; then
|
||||
|
||||
for pat in '*.eps'; do
|
||||
for file in $pat; do
|
||||
test "$file" = "$pat" && test ! -e "$file" || pats="$pats $pat"
|
||||
break
|
||||
done
|
||||
done
|
||||
|
||||
# if $MAKEINFO is recent enough, use --trace-includes on the
|
||||
# $srcfile to get the included files of the targeted manual only
|
||||
base=`basename "$srcfile"`
|
||||
|
||||
cmd="$SETLANG $MAKEINFO $commonarg --trace-includes \"$base\""
|
||||
eval "$cmd" \
|
||||
| tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
|
||||
--verbatim-files-from -T- -- "$base" $pats \
|
||||
${source_extra+"$source_extra"} \
|
||||
&& ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
|
||||
else
|
||||
for pat in '*.texinfo' '*.texi' '*.txi' '*.eps'; do
|
||||
for file in $pat; do
|
||||
test "$file" = "$pat" && test ! -e "$file" || pats="$pats $pat"
|
||||
break
|
||||
done
|
||||
done
|
||||
|
||||
tar -czhf "$abs_outdir/$PACKAGE.texi.tar.gz" \
|
||||
-- $pats ${source_extra+"$source_extra"} \
|
||||
&& ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
|
||||
fi
|
||||
) || exit
|
||||
texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
|
||||
|
||||
#
|
||||
# Do everything again through docbook.
|
||||
if test -n "$docbook"; then
|
||||
opt="-o - --docbook $commonarg"
|
||||
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
|
||||
printf "\nGenerating docbook XML... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
docbook_xml_size=`calcsize $PACKAGE-db.xml`
|
||||
gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz"
|
||||
docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"`
|
||||
mv $PACKAGE-db.xml "$outdir/"
|
||||
|
||||
split_html_db_dir=html_node_db
|
||||
opt="$commonarg -o $split_html_db_dir"
|
||||
cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\""
|
||||
printf "\nGenerating docbook HTML... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
(
|
||||
cd ${split_html_db_dir} || exit 1
|
||||
tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html
|
||||
)
|
||||
html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"`
|
||||
rm -f "$outdir"/html_node_db/*.html
|
||||
mkdir -p "$outdir/html_node_db"
|
||||
mv ${split_html_db_dir}/*.html "$outdir/html_node_db/"
|
||||
rmdir ${split_html_db_dir}
|
||||
|
||||
cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\""
|
||||
printf "\nGenerating docbook ASCII... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
docbook_ascii_size=`calcsize $PACKAGE-db.txt`
|
||||
mv $PACKAGE-db.txt "$outdir/"
|
||||
|
||||
cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\""
|
||||
printf "\nGenerating docbook PDF... (%s)\n" "$cmd"
|
||||
eval "$cmd"
|
||||
docbook_pdf_size=`calcsize $PACKAGE-db.pdf`
|
||||
mv $PACKAGE-db.pdf "$outdir/"
|
||||
fi
|
||||
|
||||
#
|
||||
printf "\nMaking index.html for %s...\n" "$PACKAGE"
|
||||
if test -z "$use_texi2html"; then
|
||||
if test x$split = xnode; then
|
||||
CONDS="/%%IF *HTML_NODE%%/d;/%%ENDIF *HTML_NODE%%/d;\
|
||||
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d;\
|
||||
/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;"
|
||||
elif test x$split = xchapter; then
|
||||
CONDS="/%%IF *HTML_CHAPTER%%/d;/%%ENDIF *HTML_CHAPTER%%/d;\
|
||||
/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
|
||||
/%%IF *HTML_NODE%%/,/%%ENDIF *HTML_NODE%%/d;"
|
||||
elif test x$split = xsection; then
|
||||
CONDS="/%%IF *HTML_SECTION%%/d;/%%ENDIF *HTML_SECTION%%/d;\
|
||||
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d;\
|
||||
/%%IF *HTML_NODE%%/,/%%ENDIF *HTML_NODE%%/d;"
|
||||
else
|
||||
CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;" # invalid split argument
|
||||
fi
|
||||
else
|
||||
# for texi2html, we do not take account of --split and simply output
|
||||
# all variants
|
||||
CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;"
|
||||
fi
|
||||
|
||||
curdate=`$SETLANG date '+%B %d, %Y'`
|
||||
sed \
|
||||
-e "s!%%TITLE%%!$MANUAL_TITLE!g" \
|
||||
-e "s!%%EMAIL%%!$EMAIL!g" \
|
||||
-e "s!%%PACKAGE%%!$PACKAGE!g" \
|
||||
-e "s!%%DATE%%!$curdate!g" \
|
||||
-e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \
|
||||
-e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \
|
||||
-e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \
|
||||
-e "s!%%HTML_SECTION_TGZ_SIZE%%!$html_section_tgz_size!g" \
|
||||
-e "s!%%HTML_CHAPTER_TGZ_SIZE%%!$html_chapter_tgz_size!g" \
|
||||
-e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \
|
||||
-e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \
|
||||
-e "s!%%PDF_SIZE%%!$pdf_size!g" \
|
||||
-e "s!%%ASCII_SIZE%%!$ascii_size!g" \
|
||||
-e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \
|
||||
-e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \
|
||||
-e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \
|
||||
-e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \
|
||||
-e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \
|
||||
-e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \
|
||||
-e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \
|
||||
-e "s,%%SCRIPTURL%%,$scripturl,g" \
|
||||
-e "s!%%SCRIPTNAME%%!$prog!g" \
|
||||
-e "$CONDS" \
|
||||
$GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
|
||||
|
||||
echo "Done, see $outdir/ subdirectory for new files."
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
@@ -0,0 +1,227 @@
|
||||
#!/bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2024-07-04.10; # UTC
|
||||
|
||||
# Copyright (C) 2007-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
|
||||
# It may be run two ways:
|
||||
# - from a git repository in which the "git describe" command below
|
||||
# produces useful output (thus requiring at least one signed tag)
|
||||
# - from a non-git-repo directory containing a .tarball-version file, which
|
||||
# presumes this script is invoked like "./git-version-gen .tarball-version".
|
||||
|
||||
# In order to use intra-version strings in your project, you will need two
|
||||
# separate generated version string files:
|
||||
#
|
||||
# .tarball-version - present only in a distribution tarball, and not in
|
||||
# a checked-out repository. Created with contents that were learned at
|
||||
# the last time autoconf was run, and used by git-version-gen. Must not
|
||||
# be present in either $(srcdir) or $(builddir) for git-version-gen to
|
||||
# give accurate answers during normal development with a checked out tree,
|
||||
# but must be present in a tarball when there is no version control system.
|
||||
# Therefore, it cannot be used in any dependencies. GNUmakefile has
|
||||
# hooks to force a reconfigure at distribution time to get the value
|
||||
# correct, without penalizing normal development with extra reconfigures.
|
||||
#
|
||||
# .version - present in a checked-out repository and in a distribution
|
||||
# tarball. Usable in dependencies, particularly for files that don't
|
||||
# want to depend on config.h but do want to track version changes.
|
||||
# Delete this file prior to any autoconf run where you want to rebuild
|
||||
# files to pick up a version string change; and leave it stale to
|
||||
# minimize rebuild time after unrelated changes to configure sources.
|
||||
#
|
||||
# As with any generated file in a VC'd directory, you should add
|
||||
# /.version to .gitignore, so that you don't accidentally commit it.
|
||||
# .tarball-version is never generated in a VC'd directory, so needn't
|
||||
# be listed there.
|
||||
#
|
||||
# Use the following line in your configure.ac, so that $(VERSION) will
|
||||
# automatically be up-to-date each time configure is run (and note that
|
||||
# since configure.ac no longer includes a version string, Makefile rules
|
||||
# should not depend on configure.ac for version updates).
|
||||
#
|
||||
# AC_INIT([GNU project],
|
||||
# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
# [bug-project@example])
|
||||
#
|
||||
# Then use the following lines in your Makefile.am, so that .version
|
||||
# will be present for dependencies, and so that .version and
|
||||
# .tarball-version will exist in distribution tarballs.
|
||||
#
|
||||
# EXTRA_DIST = $(top_srcdir)/.version
|
||||
# BUILT_SOURCES = $(top_srcdir)/.version
|
||||
# $(top_srcdir)/.version:
|
||||
# echo '$(VERSION)' > $@-t
|
||||
# mv $@-t $@
|
||||
# dist-hook:
|
||||
# echo '$(VERSION)' > $(distdir)/.tarball-version
|
||||
|
||||
|
||||
me=$0
|
||||
|
||||
year=`expr "$scriptversion" : '\([^-]*\)'`
|
||||
version="git-version-gen $scriptversion
|
||||
|
||||
Copyright (C) ${year} Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
|
||||
usage="\
|
||||
Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
|
||||
Print a version string.
|
||||
|
||||
Options:
|
||||
|
||||
--prefix PREFIX prefix of git tags (default 'v')
|
||||
--fallback VERSION
|
||||
fallback version to use if \"git --version\" fails
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
|
||||
prefix=v
|
||||
fallback=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) echo "$usage"; exit 0;;
|
||||
--version) echo "$version"; exit 0;;
|
||||
--prefix) shift; prefix=${1?};;
|
||||
--fallback) shift; fallback=${1?};;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1'." >&2
|
||||
echo "$0: Try '--help' for more information." >&2
|
||||
exit 1;;
|
||||
*)
|
||||
if test "x$tarball_version_file" = x; then
|
||||
tarball_version_file="$1"
|
||||
elif test "x$tag_sed_script" = x; then
|
||||
tag_sed_script="$1"
|
||||
else
|
||||
echo "$0: extra non-option argument '$1'." >&2
|
||||
exit 1
|
||||
fi;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test "x$tarball_version_file" = x; then
|
||||
echo "$usage"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tag_sed_script="${tag_sed_script:-s/x/x/}"
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# Avoid meddling by environment variable of the same name.
|
||||
v=
|
||||
v_from_git=
|
||||
|
||||
# First see if there is a tarball-only version file.
|
||||
# then try "git describe", then default.
|
||||
if test -f $tarball_version_file
|
||||
then
|
||||
v=`cat $tarball_version_file` || v=
|
||||
case $v in
|
||||
*$nl*) v= ;; # reject multi-line output
|
||||
esac
|
||||
test "x$v" = x \
|
||||
&& echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
|
||||
fi
|
||||
|
||||
if test "x$v" != x
|
||||
then
|
||||
: # use $v
|
||||
# Otherwise, if there is at least one git commit involving the working
|
||||
# directory, and "git describe" output looks sensible, use that to
|
||||
# derive a version string.
|
||||
elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
|
||||
&& v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
|
||||
|| git describe --abbrev=4 HEAD 2>/dev/null` \
|
||||
&& v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
|
||||
&& case $v in
|
||||
$prefix[0-9]*) ;;
|
||||
*) (exit 1) ;;
|
||||
esac
|
||||
then
|
||||
# Is this a new git that lists number of commits since the last
|
||||
# tag or the previous older version that did not?
|
||||
# Newer: v6.10-77-g0f8faeb
|
||||
# Older: v6.10-g0f8faeb
|
||||
vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
|
||||
case $vprefix in
|
||||
*-*) : git describe is probably okay three part flavor ;;
|
||||
*)
|
||||
: git describe is older two part flavor
|
||||
# Recreate the number of commits and rewrite such that the
|
||||
# result is the same as if we were using the newer version
|
||||
# of git describe.
|
||||
vtag=`echo "$v" | sed 's/-.*//'`
|
||||
commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
|
||||
|| { commit_list=failed;
|
||||
echo "$0: WARNING: git rev-list failed" 1>&2; }
|
||||
numcommits=`echo "$commit_list" | wc -l`
|
||||
v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
|
||||
test "$commit_list" = failed && v=UNKNOWN
|
||||
;;
|
||||
esac
|
||||
|
||||
# Change the penultimate "-" to ".", for version-comparing tools.
|
||||
# Remove the "g" to save a byte.
|
||||
v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
|
||||
v_from_git=1
|
||||
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
|
||||
v=UNKNOWN
|
||||
else
|
||||
v=$fallback
|
||||
fi
|
||||
|
||||
v=`echo "$v" |sed "s/^$prefix//"`
|
||||
|
||||
# Test whether to append the "-dirty" suffix only if the version
|
||||
# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
|
||||
# or if it came from .tarball-version.
|
||||
if test "x$v_from_git" != x; then
|
||||
# Don't declare a version "dirty" merely because a timestamp has changed.
|
||||
git update-index --refresh > /dev/null 2>&1
|
||||
|
||||
dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
|
||||
case "$dirty" in
|
||||
'') ;;
|
||||
*) # Append the suffix only if there isn't one already.
|
||||
case $v in
|
||||
*-dirty) ;;
|
||||
*) v="$v-dirty" ;;
|
||||
esac ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
|
||||
printf %s "$v"
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,550 @@
|
||||
#!/bin/sh
|
||||
#! -*-perl-*-
|
||||
|
||||
# Convert git log output to ChangeLog format.
|
||||
|
||||
# Copyright (C) 2008-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Jim Meyering
|
||||
|
||||
# This is a prologue that allows running a perl script as an executable
|
||||
# on systems that are compliant to a POSIX version before POSIX:2017.
|
||||
# On such systems, the usual invocation of an executable through execlp()
|
||||
# or execvp() fails with ENOEXEC if it is a script that does not start
|
||||
# with a #! line. The script interpreter mentioned in the #! line has
|
||||
# to be /bin/sh, because on GuixSD systems that is the only program that
|
||||
# has a fixed file name. The second line is essential for perl and is
|
||||
# also useful for editing this file in Emacs. The next two lines below
|
||||
# are valid code in both sh and perl. When executed by sh, they re-execute
|
||||
# the script through the perl program found in $PATH. The '-x' option
|
||||
# is essential as well; without it, perl would re-execute the script
|
||||
# through /bin/sh. When executed by perl, the next two lines are a no-op.
|
||||
eval 'exec perl -wSx "$0" "$@"'
|
||||
if 0;
|
||||
|
||||
my $VERSION = '2024-07-17 02:20'; # UTC
|
||||
# The definition above must lie within the first 8 lines in order
|
||||
# for the Emacs time-stamp write hook (at end) to update it.
|
||||
# If you change this file with Emacs, please let the write hook
|
||||
# do its job. Otherwise, update this string manually.
|
||||
|
||||
(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Getopt::Long;
|
||||
use POSIX qw(strftime);
|
||||
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
# use File::Coda; # https://meyering.net/code/Coda/
|
||||
END {
|
||||
defined fileno STDOUT or return;
|
||||
close STDOUT and return;
|
||||
warn "$ME: failed to close standard output: $!\n";
|
||||
$? ||= 1;
|
||||
}
|
||||
|
||||
sub usage ($)
|
||||
{
|
||||
my ($exit_code) = @_;
|
||||
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
|
||||
if ($exit_code != 0)
|
||||
{
|
||||
print $STREAM "Try '$ME --help' for more information.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $STREAM <<EOF;
|
||||
Usage: $ME [OPTIONS] [ARGS]
|
||||
|
||||
Convert git log output to ChangeLog format. If present, any ARGS
|
||||
are passed to "git log". To avoid ARGS being parsed as options to
|
||||
$ME, they may be preceded by '--'.
|
||||
|
||||
OPTIONS:
|
||||
|
||||
--amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
|
||||
makes a change to SHA1's commit log text or metadata.
|
||||
--append-dot append a dot to the first line of each commit message if
|
||||
there is no other punctuation or blank at the end.
|
||||
--no-cluster never cluster commit messages under the same date/author
|
||||
header; the default is to cluster adjacent commit messages
|
||||
if their headers are the same and neither commit message
|
||||
contains multiple paragraphs.
|
||||
--srcdir=DIR the root of the source tree, from which the .git/
|
||||
directory can be derived.
|
||||
--since=DATE convert only the logs since DATE;
|
||||
the default is to convert all log entries.
|
||||
--until=DATE convert only the logs older than DATE.
|
||||
--ignore-matching=PAT ignore commit messages whose first lines match PAT.
|
||||
--ignore-line=PAT ignore lines of commit messages that match PAT.
|
||||
--format=FMT set format string for commit subject and body;
|
||||
see 'man git-log' for the list of format metacharacters;
|
||||
the default is '%s%n%b%n'
|
||||
--strip-tab remove one additional leading TAB from commit message lines.
|
||||
--strip-cherry-pick remove data inserted by "git cherry-pick";
|
||||
this includes the "cherry picked from commit ..." line,
|
||||
and the possible final "Conflicts:" paragraph.
|
||||
--commit-timezone use dates respecting the timezone commits were made in.
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
$ME --since=2008-01-01 > ChangeLog
|
||||
$ME -- -n 5 foo > last-5-commits-to-branch-foo
|
||||
|
||||
SPECIAL SYNTAX:
|
||||
|
||||
The following types of strings are interpreted specially when they appear
|
||||
at the beginning of a log message line. They are not copied to the output.
|
||||
|
||||
Copyright-paperwork-exempt: Yes
|
||||
Append the "(tiny change)" notation to the usual "date name email"
|
||||
ChangeLog header to mark a change that does not require a copyright
|
||||
assignment.
|
||||
Co-authored-by: Joe User <user\@example.com>
|
||||
List the specified name and email address on a second
|
||||
ChangeLog header, denoting a co-author.
|
||||
Signed-off-by: Joe User <user\@example.com>
|
||||
These lines are simply elided.
|
||||
|
||||
In a FILE specified via --amend, comment lines (starting with "#") are ignored.
|
||||
FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
|
||||
a line) referring to a commit in the current project, and CODE refers to one
|
||||
or more consecutive lines of Perl code. Pairs must be separated by one or
|
||||
more blank line.
|
||||
|
||||
Here is sample input for use with --amend=FILE, from coreutils:
|
||||
|
||||
3a169f4c5d9159283548178668d2fae6fced3030
|
||||
# fix typo in title:
|
||||
s/all tile types/all file types/
|
||||
|
||||
1379ed974f1fa39b12e2ffab18b3f7a607082202
|
||||
# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
|
||||
# Change the author to be Paul. Note the escaped "@":
|
||||
s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
|
||||
|
||||
Send patches and bug reports to <bug-gnulib\@gnu.org>.
|
||||
EOF
|
||||
}
|
||||
exit $exit_code;
|
||||
}
|
||||
|
||||
sub print_version ()
|
||||
{
|
||||
print "$ME version $VERSION\n";
|
||||
print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
|
||||
print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>\n"
|
||||
. "This is free software: you are free to change and redistribute it.\n"
|
||||
. "There is NO WARRANTY, to the extent permitted by law.\n";
|
||||
print "\n";
|
||||
my $author = "Jim Meyering";
|
||||
print "Written by $author.\n";
|
||||
}
|
||||
|
||||
# If the string $S is a well-behaved file name, simply return it.
|
||||
# If it contains white space, quotes, etc., quote it, and return the new string.
|
||||
sub shell_quote($)
|
||||
{
|
||||
my ($s) = @_;
|
||||
if ($s =~ m![^\w+/.,-]!)
|
||||
{
|
||||
# Convert each single quote to '\''
|
||||
$s =~ s/\'/\'\\\'\'/g;
|
||||
# Then single quote the string.
|
||||
$s = "'$s'";
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub quoted_cmd(@)
|
||||
{
|
||||
return join (' ', map {shell_quote $_} @_);
|
||||
}
|
||||
|
||||
# Parse file F.
|
||||
# Comment lines (starting with "#") are ignored.
|
||||
# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1
|
||||
# (alone on a line) referring to a commit in the current project, and
|
||||
# CODE refers to one or more consecutive lines of Perl code.
|
||||
# Pairs must be separated by one or more blank line.
|
||||
sub parse_amend_file($)
|
||||
{
|
||||
my ($f) = @_;
|
||||
|
||||
open F, '<', $f
|
||||
or die "$ME: $f: failed to open for reading: $!\n";
|
||||
|
||||
my $fail;
|
||||
my $h = {};
|
||||
my $in_code = 0;
|
||||
my $sha;
|
||||
while (defined (my $line = <F>))
|
||||
{
|
||||
$line =~ /^\#/
|
||||
and next;
|
||||
chomp $line;
|
||||
$line eq ''
|
||||
and $in_code = 0, next;
|
||||
|
||||
if (!$in_code)
|
||||
{
|
||||
$line =~ /^([[:xdigit:]]{40})$/
|
||||
or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
|
||||
$fail = 1, next;
|
||||
$sha = lc $1;
|
||||
$in_code = 1;
|
||||
exists $h->{$sha}
|
||||
and (warn "$ME: $f:$.: duplicate SHA1\n"),
|
||||
$fail = 1, next;
|
||||
}
|
||||
else
|
||||
{
|
||||
$h->{$sha} ||= '';
|
||||
$h->{$sha} .= "$line\n";
|
||||
}
|
||||
}
|
||||
close F;
|
||||
|
||||
$fail
|
||||
and exit 1;
|
||||
|
||||
return $h;
|
||||
}
|
||||
|
||||
# git_dir_option $SRCDIR
|
||||
#
|
||||
# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR
|
||||
# is undef). Return as a list (0 or 1 element).
|
||||
sub git_dir_option($)
|
||||
{
|
||||
my ($srcdir) = @_;
|
||||
my @res = ();
|
||||
if (defined $srcdir)
|
||||
{
|
||||
my $qdir = shell_quote $srcdir;
|
||||
my $cmd = "cd $qdir && git rev-parse --show-toplevel";
|
||||
my $qcmd = shell_quote $cmd;
|
||||
my $git_dir = qx($cmd);
|
||||
defined $git_dir
|
||||
or die "$ME: cannot run $qcmd: $!\n";
|
||||
$? == 0
|
||||
or die "$ME: $qcmd had unexpected exit code or signal ($?)\n";
|
||||
chomp $git_dir;
|
||||
push @res, "--git-dir=$git_dir/.git";
|
||||
}
|
||||
@res;
|
||||
}
|
||||
|
||||
{
|
||||
my $since_date;
|
||||
my $until_date;
|
||||
my $format_string = '%s%n%b%n';
|
||||
my $amend_file;
|
||||
my $append_dot = 0;
|
||||
my $cluster = 1;
|
||||
my $ignore_matching;
|
||||
my $ignore_line;
|
||||
my $strip_tab = 0;
|
||||
my $strip_cherry_pick = 0;
|
||||
my $commit_timezone = 0;
|
||||
my $srcdir;
|
||||
GetOptions
|
||||
(
|
||||
help => sub { usage 0 },
|
||||
version => sub { print_version; exit },
|
||||
'since=s' => \$since_date,
|
||||
'until=s' => \$until_date,
|
||||
'format=s' => \$format_string,
|
||||
'amend=s' => \$amend_file,
|
||||
'append-dot' => \$append_dot,
|
||||
'cluster!' => \$cluster,
|
||||
'ignore-matching=s' => \$ignore_matching,
|
||||
'ignore-line=s' => \$ignore_line,
|
||||
'strip-tab' => \$strip_tab,
|
||||
'strip-cherry-pick' => \$strip_cherry_pick,
|
||||
'commit-timezone' => \$commit_timezone,
|
||||
'srcdir=s' => \$srcdir,
|
||||
) or usage 1;
|
||||
|
||||
defined $since_date
|
||||
and unshift @ARGV, "--since=$since_date";
|
||||
defined $until_date
|
||||
and unshift @ARGV, "--until=$until_date";
|
||||
|
||||
# This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
|
||||
# that makes a correction in the log or attribution of that commit.
|
||||
my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
|
||||
|
||||
my $commit_time_format = $commit_timezone ? '%cI' : '%ct';
|
||||
my @cmd = ('git',
|
||||
git_dir_option $srcdir,
|
||||
qw(log --log-size),
|
||||
("--pretty=format:%H:$commit_time_format"
|
||||
. ' %an <%ae>%n%n'.$format_string, @ARGV));
|
||||
open PIPE, '-|', @cmd
|
||||
or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
|
||||
. "(Is your Git too old? Version 1.5.1 or later is required.)\n");
|
||||
|
||||
my $prev_multi_paragraph;
|
||||
my $prev_date_line = '';
|
||||
my @prev_coauthors = ();
|
||||
my @skipshas = ();
|
||||
while (1)
|
||||
{
|
||||
defined (my $in = <PIPE>)
|
||||
or last;
|
||||
$in =~ /^log size (\d+)$/
|
||||
or die "$ME:$.: Invalid line (expected log size):\n$in";
|
||||
my $log_nbytes = $1;
|
||||
|
||||
my $log;
|
||||
my $n_read = read PIPE, $log, $log_nbytes;
|
||||
$n_read == $log_nbytes
|
||||
or die "$ME:$.: unexpected EOF\n";
|
||||
|
||||
# Extract leading hash.
|
||||
my ($sha, $rest) = split ':', $log, 2;
|
||||
defined $sha
|
||||
or die "$ME:$.: malformed log entry\n";
|
||||
$sha =~ /^[[:xdigit:]]{40}$/
|
||||
or die "$ME:$.: invalid SHA1: $sha\n";
|
||||
|
||||
my $skipflag = 0;
|
||||
if (@skipshas)
|
||||
{
|
||||
foreach(@skipshas)
|
||||
{
|
||||
if ($sha =~ /^$_/)
|
||||
{
|
||||
$skipflag = $_;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# If this commit's log requires any transformation, do it now.
|
||||
my $code = $amend_code->{$sha};
|
||||
if (defined $code)
|
||||
{
|
||||
eval 'use Safe';
|
||||
my $s = new Safe;
|
||||
# Put the unpreprocessed entry into "$_".
|
||||
$_ = $rest;
|
||||
|
||||
# Let $code operate on it, safely.
|
||||
my $r = $s->reval("$code")
|
||||
or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n";
|
||||
|
||||
# Note that we've used this entry.
|
||||
delete $amend_code->{$sha};
|
||||
|
||||
# Update $rest upon success.
|
||||
$rest = $_;
|
||||
}
|
||||
|
||||
# Remove lines inserted by "git cherry-pick".
|
||||
if ($strip_cherry_pick)
|
||||
{
|
||||
$rest =~ s/^\s*Conflicts:\n.*//sm;
|
||||
$rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
|
||||
}
|
||||
|
||||
my @line = split /[ \t]*\n/, $rest;
|
||||
my $author_line = shift @line;
|
||||
defined $author_line
|
||||
or die "$ME:$.: unexpected EOF\n";
|
||||
$author_line =~ /^(\S+) (.*>)$/
|
||||
or die "$ME:$.: Invalid line "
|
||||
. "(expected date/author/email):\n$author_line\n";
|
||||
|
||||
# Author <email>
|
||||
my $author = $2;
|
||||
|
||||
my $commit_date = $1;
|
||||
if (! $commit_timezone)
|
||||
{
|
||||
# Seconds since the Epoch.
|
||||
$commit_date = strftime "%Y-%m-%d", localtime ($commit_date);
|
||||
}
|
||||
else
|
||||
{
|
||||
# ISO 8601 date.
|
||||
$commit_date =~ s/T.*$//;
|
||||
}
|
||||
|
||||
# Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
|
||||
# '(tiny change)' annotation.
|
||||
my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
|
||||
? ' (tiny change)' : '');
|
||||
|
||||
my $date_line = "$commit_date $author$tiny\n";
|
||||
|
||||
my @coauthors = grep /^Co-authored-by:.*$/, @line;
|
||||
# Omit meta-data lines we've already interpreted.
|
||||
@line = grep !/^(?:Signed-off-by:[ ].*>$
|
||||
|Co-authored-by:[ ]
|
||||
|Copyright-paperwork-exempt:[ ]
|
||||
|Tiny-change:[ ]
|
||||
)/x, @line;
|
||||
|
||||
# Remove leading and trailing blank lines.
|
||||
if (@line)
|
||||
{
|
||||
while ($line[0] =~ /^\s*$/) { shift @line; }
|
||||
while ($line[$#line] =~ /^\s*$/) { pop @line; }
|
||||
}
|
||||
|
||||
# Handle Emacs gitmerge.el "skipped" commits.
|
||||
# Yes, this should be controlled by an option. So sue me.
|
||||
if ( grep /^(; )?Merge from /, @line )
|
||||
{
|
||||
my $found = 0;
|
||||
foreach (@line)
|
||||
{
|
||||
if (grep /^The following commit.*skipped:$/, $_)
|
||||
{
|
||||
$found = 1;
|
||||
## Reset at each merge to reduce chance of false matches.
|
||||
@skipshas = ();
|
||||
next;
|
||||
}
|
||||
if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
|
||||
{
|
||||
push ( @skipshas, $1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Ignore commits that match the --ignore-matching pattern, if specified.
|
||||
if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/)
|
||||
{
|
||||
$skipflag = 1;
|
||||
}
|
||||
elsif ($skipflag)
|
||||
{
|
||||
## Perhaps only warn if a pattern matches more than once?
|
||||
warn "$ME: warning: skipping $sha due to $skipflag\n";
|
||||
}
|
||||
|
||||
if (! $skipflag)
|
||||
{
|
||||
if (defined $ignore_line && @line)
|
||||
{
|
||||
@line = grep ! /$ignore_line/, @line;
|
||||
while ($line[$#line] =~ /^\s*$/) { pop @line; }
|
||||
}
|
||||
|
||||
# Record whether there are two or more paragraphs.
|
||||
my $multi_paragraph = grep /^\s*$/, @line;
|
||||
|
||||
# Format 'Co-authored-by: A U Thor <email@example.com>' lines in
|
||||
# standard multi-author ChangeLog format.
|
||||
for (@coauthors)
|
||||
{
|
||||
s/^Co-authored-by:\s*/\t /;
|
||||
s/\s*</ </;
|
||||
|
||||
/<.*?@.*\..*>/
|
||||
or warn "$ME: warning: missing email address for "
|
||||
. substr ($_, 5) . "\n";
|
||||
}
|
||||
|
||||
# If clustering of commit messages has been disabled, if this header
|
||||
# would be different from the previous date/name/etc. header,
|
||||
# or if this or the previous entry consists of two or more paragraphs,
|
||||
# then print the header.
|
||||
if ( ! $cluster
|
||||
|| $date_line ne $prev_date_line
|
||||
|| "@coauthors" ne "@prev_coauthors"
|
||||
|| $multi_paragraph
|
||||
|| $prev_multi_paragraph)
|
||||
{
|
||||
$prev_date_line eq ''
|
||||
or print "\n";
|
||||
print $date_line;
|
||||
@coauthors
|
||||
and print join ("\n", @coauthors), "\n";
|
||||
}
|
||||
$prev_date_line = $date_line;
|
||||
@prev_coauthors = @coauthors;
|
||||
$prev_multi_paragraph = $multi_paragraph;
|
||||
|
||||
# If there were any lines
|
||||
if (@line == 0)
|
||||
{
|
||||
warn "$ME: warning: empty commit message:\n"
|
||||
. " commit $sha\n $date_line\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($append_dot)
|
||||
{
|
||||
# If the first line of the message has enough room, then
|
||||
if (length $line[0] < 72)
|
||||
{
|
||||
# append a dot if there is no other punctuation or blank
|
||||
# at the end.
|
||||
$line[0] =~ /[[:punct:]\s]$/
|
||||
or $line[0] .= '.';
|
||||
}
|
||||
}
|
||||
|
||||
# Remove one additional leading TAB from each line.
|
||||
$strip_tab
|
||||
and map { s/^\t// } @line;
|
||||
|
||||
# Prefix each non-empty line with a TAB.
|
||||
@line = map { length $_ ? "\t$_" : '' } @line;
|
||||
|
||||
print "\n", join ("\n", @line), "\n";
|
||||
}
|
||||
}
|
||||
|
||||
defined ($in = <PIPE>)
|
||||
or last;
|
||||
$in ne "\n"
|
||||
and die "$ME:$.: unexpected line:\n$in";
|
||||
}
|
||||
|
||||
close PIPE
|
||||
or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
|
||||
# FIXME-someday: include $PROCESS_STATUS in the diagnostic
|
||||
|
||||
# Complain about any unused entry in the --amend=F specified file.
|
||||
my $fail = 0;
|
||||
foreach my $sha (sort keys %$amend_code)
|
||||
{
|
||||
warn "$ME:$amend_file: unused entry: $sha\n";
|
||||
$fail = 1;
|
||||
}
|
||||
|
||||
exit $fail;
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# mode: perl
|
||||
# indent-tabs-mode: nil
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-line-limit: 50
|
||||
# time-stamp-start: "my $VERSION = '"
|
||||
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "'; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,216 @@
|
||||
#!/bin/sh
|
||||
# Run this after each non-alpha release, to update the web documentation at
|
||||
# https://www.gnu.org/software/$pkg/manual/
|
||||
|
||||
VERSION=2024-07-04.10; # UTC
|
||||
|
||||
# Copyright (C) 2009-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
ME=$(basename "$0")
|
||||
warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
|
||||
die() { warn "$*"; exit 1; }
|
||||
|
||||
help()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: $ME
|
||||
|
||||
Run this script from top_srcdir (no arguments) after each non-alpha
|
||||
release, to update the web documentation at
|
||||
https://www.gnu.org/software/\$pkg/manual/
|
||||
|
||||
This script assumes you're using git for revision control, and
|
||||
requires a .prev-version file as well as a Makefile, from which it
|
||||
extracts the version number and package name, respectively. Also, it
|
||||
assumes all documentation is in the doc/ sub-directory.
|
||||
|
||||
Options:
|
||||
-C, --builddir=DIR location of (configured) Makefile (default: .)
|
||||
-n, --dry-run don't actually commit anything
|
||||
-m, --mirror remove out of date files from document server
|
||||
-u, --user the name of the CVS user on Savannah
|
||||
--help print this help, then exit
|
||||
--version print version number, then exit
|
||||
|
||||
Report bugs and patches to <bug-gnulib@gnu.org>.
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
|
||||
version()
|
||||
{
|
||||
year=$(echo "$VERSION" | sed 's/[^0-9].*//')
|
||||
cat <<EOF
|
||||
$ME $VERSION
|
||||
Copyright (C) $year Free Software Foundation, Inc,
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
|
||||
# find_tool ENVVAR NAMES...
|
||||
# -------------------------
|
||||
# Search for a required program. Use the value of ENVVAR, if set,
|
||||
# otherwise find the first of the NAMES that can be run (i.e.,
|
||||
# supports --version). If found, set ENVVAR to the program name,
|
||||
# die otherwise.
|
||||
#
|
||||
# FIXME: code duplication, see also bootstrap.
|
||||
find_tool ()
|
||||
{
|
||||
find_tool_envvar=$1
|
||||
shift
|
||||
find_tool_names=$@
|
||||
eval "find_tool_res=\$$find_tool_envvar"
|
||||
if test x"$find_tool_res" = x; then
|
||||
for i
|
||||
do
|
||||
if ($i --version </dev/null) >/dev/null 2>&1; then
|
||||
find_tool_res=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
find_tool_error_prefix="\$$find_tool_envvar: "
|
||||
fi
|
||||
test x"$find_tool_res" != x \
|
||||
|| die "one of these is required: $find_tool_names"
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 \
|
||||
|| die "${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
eval "$find_tool_envvar=\$find_tool_res"
|
||||
eval "export $find_tool_envvar"
|
||||
}
|
||||
|
||||
## ------ ##
|
||||
## Main. ##
|
||||
## ------ ##
|
||||
|
||||
# Requirements: everything required to bootstrap your package, plus
|
||||
# these.
|
||||
find_tool CVS cvs
|
||||
find_tool GIT git
|
||||
find_tool RSYNC rsync
|
||||
find_tool XARGS gxargs xargs
|
||||
|
||||
builddir=.
|
||||
dryrun=
|
||||
rm_stale='echo'
|
||||
cvs_user="$USER"
|
||||
while test $# != 0
|
||||
do
|
||||
# Handle --option=value by splitting apart and putting back on argv.
|
||||
case $1 in
|
||||
--*=*)
|
||||
opt=$(echo "$1" | sed -e 's/=.*//')
|
||||
val=$(echo "$1" | sed -e 's/[^=]*=//')
|
||||
shift
|
||||
set dummy "$opt" "$val" "$@"; shift
|
||||
;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--help|--version) ${1#--};;
|
||||
-C|--builddir) shift; builddir=$1; shift ;;
|
||||
-n|--dry-run) dryrun=echo; shift;;
|
||||
-m|--mirror) rm_stale=''; shift;;
|
||||
-u|--user) shift; cvs_user=$1; shift ;;
|
||||
--*) die "unrecognized option: $1";;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
test $# = 0 \
|
||||
|| die "too many arguments"
|
||||
|
||||
prev=.prev-version
|
||||
version=$(cat $prev) || die "no $prev file?"
|
||||
pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \
|
||||
|| die "no Makefile?"
|
||||
tmp_branch=web-doc-$version-$$
|
||||
current_branch=$($GIT branch | sed -ne '/^\* /{s///;p;q;}')
|
||||
|
||||
cleanup()
|
||||
{
|
||||
__st=$?
|
||||
$dryrun rm -rf "$tmp"
|
||||
$GIT checkout "$current_branch"
|
||||
$GIT submodule update --recursive
|
||||
$GIT branch -d $tmp_branch
|
||||
exit $__st
|
||||
}
|
||||
trap cleanup EXIT
|
||||
trap 'exit $?' HUP INT PIPE TERM
|
||||
|
||||
# We must build using sources for which --version reports the
|
||||
# just-released version number, not some string like 7.6.18-20761.
|
||||
# That version string propagates into all documentation.
|
||||
set -e
|
||||
$GIT checkout -b $tmp_branch v$version
|
||||
$GIT submodule update --recursive
|
||||
./bootstrap
|
||||
srcdir=$(pwd)
|
||||
cd "$builddir"
|
||||
builddir=$(pwd)
|
||||
./config.status --recheck
|
||||
./config.status
|
||||
make
|
||||
make web-manual
|
||||
cd "$srcdir"
|
||||
set +e
|
||||
|
||||
tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1
|
||||
( cd $tmp \
|
||||
&& $CVS -d $cvs_user@cvs.savannah.gnu.org:/webcvs/$pkg co $pkg )
|
||||
$RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
|
||||
|
||||
(
|
||||
cd $tmp/$pkg
|
||||
test -d manual/CVS || $dryrun $CVS add -ko manual
|
||||
|
||||
cd manual
|
||||
|
||||
# Add all the files. This is simpler than trying to add only the
|
||||
# new ones because of new directories
|
||||
# First add non empty dirs individually
|
||||
find . -name CVS -prune -o -type d \! -empty -print \
|
||||
| $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko
|
||||
# Now add all files
|
||||
find . -name CVS -prune -o -type f -print \
|
||||
| $XARGS --no-run-if-empty -- $dryrun $CVS add -ko
|
||||
|
||||
# Report/Remove stale files
|
||||
# excluding doc server specific files like CVS/* and .symlinks
|
||||
if test -n "$rm_stale"; then
|
||||
echo 'Consider the --mirror option if all of the manual is generated,' >&2
|
||||
echo 'which will run `cvs remove` to remove stale files.' >&2
|
||||
fi
|
||||
{ find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print
|
||||
(cd "$builddir"/doc/manual/ && find . -type f -print | sed p)
|
||||
} | sort | uniq -u \
|
||||
| $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f
|
||||
|
||||
$dryrun $CVS ci -m $version
|
||||
)
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "VERSION="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+480
@@ -0,0 +1,480 @@
|
||||
#!/bin/sh
|
||||
# Sign files and upload them.
|
||||
|
||||
scriptversion=2024-07-04.10; # UTC
|
||||
|
||||
# Copyright (C) 2004-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
|
||||
# The master copy of this file is maintained in the gnulib Git repository.
|
||||
# Please send bug reports and feature requests to bug-gnulib@gnu.org.
|
||||
|
||||
set -e
|
||||
|
||||
GPG=gpg
|
||||
# Choose the proper version of gpg, so as to avoid a
|
||||
# "gpg-agent is not available in this session" error
|
||||
# when gpg-agent is version 2 but gpg is still version 1.
|
||||
# FIXME-2020: remove, once all major distros ship gpg version 2 as /usr/bin/gpg
|
||||
gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
|
||||
case "$gpg_agent_version" in
|
||||
2.*)
|
||||
gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
|
||||
case "$gpg_version" in
|
||||
1.*)
|
||||
if (type gpg2) >/dev/null 2>/dev/null; then
|
||||
# gpg2 is present.
|
||||
GPG=gpg2
|
||||
else
|
||||
# gpg2 is missing. Ubuntu users should install the package 'gnupg2'.
|
||||
echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
GPG="${GPG} --batch --no-tty"
|
||||
conffile=.gnuploadrc
|
||||
to=
|
||||
dry_run=false
|
||||
replace=
|
||||
symlink_files=
|
||||
delete_files=
|
||||
delete_symlinks=
|
||||
collect_var=
|
||||
dbg=
|
||||
nl='
|
||||
'
|
||||
|
||||
usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
|
||||
|
||||
Sign all FILES, and process them at the destinations specified with --to.
|
||||
If CMD is not given, it defaults to uploading. See examples below.
|
||||
|
||||
Commands:
|
||||
--delete delete FILES from destination
|
||||
--symlink create symbolic links
|
||||
--rmsymlink remove symbolic links
|
||||
-- treat the remaining arguments as files to upload
|
||||
|
||||
Options:
|
||||
--to DEST specify a destination DEST for FILES
|
||||
(multiple --to options are allowed)
|
||||
--user NAME sign with key NAME
|
||||
--replace allow replacements of existing files
|
||||
--symlink-regex[=EXPR] use sed script EXPR to compute symbolic link names
|
||||
-n, --dry-run do nothing, show what would have been done
|
||||
(including the constructed directive file)
|
||||
--version output version information and exit
|
||||
-h, --help print this help text and exit
|
||||
|
||||
If --symlink-regex is given without EXPR, then the link target name
|
||||
is created by replacing the version information with '-latest', e.g.:
|
||||
foo-1.3.4.tar.gz -> foo-latest.tar.gz
|
||||
|
||||
Recognized destinations are:
|
||||
alpha.gnu.org:DIRECTORY
|
||||
savannah.gnu.org:DIRECTORY
|
||||
savannah.nongnu.org:DIRECTORY
|
||||
ftp.gnu.org:DIRECTORY
|
||||
build directive files and upload files by FTP
|
||||
download.gnu.org.ua:{alpha|ftp}/DIRECTORY
|
||||
build directive files and upload files by SFTP
|
||||
[user@]host:DIRECTORY upload files with scp
|
||||
|
||||
Options and commands are applied in order. If the file $conffile exists
|
||||
in the current working directory, its contents are prepended to the
|
||||
actual command line options. Use this to keep your defaults. Comments
|
||||
(#) and empty lines in $conffile are allowed.
|
||||
|
||||
<https://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
|
||||
gives some further background.
|
||||
|
||||
Examples:
|
||||
1. Upload foobar-1.0.tar.gz to ftp.gnu.org:
|
||||
gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz
|
||||
|
||||
2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org:
|
||||
gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz foobar-1.0.tar.xz
|
||||
|
||||
3. Same as above, and also create symbolic links to foobar-latest.tar.*:
|
||||
gnupload --to ftp.gnu.org:foobar \\
|
||||
--symlink-regex \\
|
||||
foobar-1.0.tar.gz foobar-1.0.tar.xz
|
||||
|
||||
4. Create a symbolic link foobar-latest.tar.gz -> foobar-1.0.tar.gz
|
||||
and likewise for the corresponding .sig file:
|
||||
gnupload --to ftp.gnu.org:foobar \\
|
||||
--symlink foobar-1.0.tar.gz foobar-latest.tar.gz \\
|
||||
foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
|
||||
or (equivalent):
|
||||
gnupload --to ftp.gnu.org:foobar \\
|
||||
--symlink foobar-1.0.tar.gz foobar-latest.tar.gz \\
|
||||
--symlink foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
|
||||
|
||||
5. Upload foobar-0.9.90.tar.gz to two sites:
|
||||
gnupload --to alpha.gnu.org:foobar \\
|
||||
--to sources.redhat.com:~ftp/pub/foobar \\
|
||||
foobar-0.9.90.tar.gz
|
||||
|
||||
6. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
|
||||
(the -- terminates the list of files to delete):
|
||||
gnupload --to alpha.gnu.org:foobar \\
|
||||
--to sources.redhat.com:~ftp/pub/foobar \\
|
||||
--delete oopsbar-0.9.91.tar.gz \\
|
||||
-- foobar-0.9.91.tar.gz
|
||||
|
||||
gnupload executes a program ncftpput to do the transfers; if you don't
|
||||
happen to have an ncftp package installed, the ncftpput-ftp script in
|
||||
the build-aux/ directory of the gnulib package
|
||||
(https://savannah.gnu.org/projects/gnulib) may serve as a replacement.
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
|
||||
copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
|
||||
copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
|
||||
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
|
||||
# Read local configuration file
|
||||
if test -r "$conffile"; then
|
||||
echo "$0: Reading configuration file $conffile"
|
||||
conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" ' '`
|
||||
eval set x "$conf \"\$@\""
|
||||
shift
|
||||
fi
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
-*)
|
||||
collect_var=
|
||||
case $1 in
|
||||
-h | --help)
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
--to)
|
||||
if test -z "$2"; then
|
||||
echo "$0: Missing argument for --to" 1>&2
|
||||
exit 1
|
||||
elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then
|
||||
echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2
|
||||
echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2
|
||||
echo "$0: is used for direct ftp uploads, not with gnupload)." >&2
|
||||
echo "$0: See --help and its examples if need be." >&2
|
||||
exit 1
|
||||
else
|
||||
to="$to $2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--user)
|
||||
if test -z "$2"; then
|
||||
echo "$0: Missing argument for --user" 1>&2
|
||||
exit 1
|
||||
else
|
||||
GPG="$GPG --local-user $2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--delete)
|
||||
collect_var=delete_files
|
||||
;;
|
||||
--replace)
|
||||
replace="replace: true"
|
||||
;;
|
||||
--rmsymlink)
|
||||
collect_var=delete_symlinks
|
||||
;;
|
||||
--symlink-regex=*)
|
||||
symlink_expr=`expr "$1" : '[^=]*=\(.*\)'`
|
||||
;;
|
||||
--symlink-regex)
|
||||
symlink_expr='s|-[0-9][0-9\.]*\(-[0-9][0-9]*\)\{0,1\}\.|-latest.|'
|
||||
;;
|
||||
--symlink)
|
||||
collect_var=symlink_files
|
||||
;;
|
||||
-n | --dry-run)
|
||||
dry_run=:
|
||||
;;
|
||||
--version)
|
||||
echo "gnupload $scriptversion"
|
||||
echo "$copyright"
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
if test -z "$collect_var"; then
|
||||
break
|
||||
else
|
||||
eval "$collect_var=\"\$$collect_var $1\""
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
dprint()
|
||||
{
|
||||
echo "Running $* ..."
|
||||
}
|
||||
|
||||
if $dry_run; then
|
||||
dbg=dprint
|
||||
fi
|
||||
|
||||
if test -z "$to"; then
|
||||
echo "$0: Missing destination sites" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -n "$symlink_files"; then
|
||||
x=`echo "$symlink_files" | sed 's/[^ ]//g;s/ //g'`
|
||||
if test -n "$x"; then
|
||||
echo "$0: Odd number of symlink arguments" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# = 0; then
|
||||
if test -z "${symlink_files}${delete_files}${delete_symlinks}"; then
|
||||
echo "$0: No file to upload" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Make sure all files exist. We don't want to ask
|
||||
# for the passphrase if the script will fail.
|
||||
for file
|
||||
do
|
||||
if test ! -f $file; then
|
||||
echo "$0: Cannot find '$file'" 1>&2
|
||||
exit 1
|
||||
elif test -n "$symlink_expr"; then
|
||||
linkname=`echo $file | sed "$symlink_expr"`
|
||||
if test -z "$linkname"; then
|
||||
echo "$0: symlink expression produces empty results" >&2
|
||||
exit 1
|
||||
elif test "$linkname" = $file; then
|
||||
echo "$0: symlink expression does not alter file name" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Make sure passphrase is not exported in the environment.
|
||||
unset passphrase
|
||||
unset passphrase_fd_0
|
||||
GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg}
|
||||
|
||||
# Reset PATH to be sure that echo is a built-in. We will later use
|
||||
# 'echo $passphrase' to output the passphrase, so it is important that
|
||||
# it is a built-in (third-party programs tend to appear in 'ps'
|
||||
# listings with their arguments...).
|
||||
# Remember this script runs with 'set -e', so if echo is not built-in
|
||||
# it will exit now.
|
||||
if $dry_run || grep -q "^use-agent" $GNUPGHOME/gpg.conf; then :; else
|
||||
PATH=/empty echo -n "Enter GPG passphrase: "
|
||||
stty -echo
|
||||
read -r passphrase
|
||||
stty echo
|
||||
echo
|
||||
passphrase_fd_0="--passphrase-fd 0"
|
||||
fi
|
||||
|
||||
if test $# -ne 0; then
|
||||
for file
|
||||
do
|
||||
echo "Signing $file ..."
|
||||
rm -f $file.sig
|
||||
echo "$passphrase" | $dbg $GPG $passphrase_fd_0 -ba -o $file.sig $file
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# mkdirective DESTDIR BASE FILE STMT
|
||||
# Arguments: See upload, below
|
||||
mkdirective ()
|
||||
{
|
||||
stmt="$4"
|
||||
if test -n "$3"; then
|
||||
stmt="
|
||||
filename: $3$stmt"
|
||||
fi
|
||||
|
||||
cat >${2}.directive<<EOF
|
||||
version: 1.2
|
||||
directory: $1
|
||||
comment: gnupload v. $scriptversion$stmt
|
||||
EOF
|
||||
if $dry_run; then
|
||||
echo "File ${2}.directive:"
|
||||
cat ${2}.directive
|
||||
echo "File ${2}.directive:" | sed 's/./-/g'
|
||||
fi
|
||||
}
|
||||
|
||||
mksymlink ()
|
||||
{
|
||||
while test $# -ne 0
|
||||
do
|
||||
echo "symlink: $1 $2"
|
||||
shift
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# upload DEST DESTDIR BASE FILE STMT FILES
|
||||
# Arguments:
|
||||
# DEST Destination site;
|
||||
# DESTDIR Destination directory;
|
||||
# BASE Base name for the directive file;
|
||||
# FILE Name of the file to distribute (may be empty);
|
||||
# STMT Additional statements for the directive file;
|
||||
# FILES List of files to upload.
|
||||
upload ()
|
||||
{
|
||||
dest=$1
|
||||
destdir=$2
|
||||
base=$3
|
||||
file=$4
|
||||
stmt=$5
|
||||
files=$6
|
||||
|
||||
rm -f $base.directive $base.directive.asc
|
||||
case $dest in
|
||||
alpha.gnu.org:*)
|
||||
mkdirective "$destdir" "$base" "$file" "$stmt"
|
||||
echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
|
||||
$dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files $base.directive.asc
|
||||
;;
|
||||
ftp.gnu.org:*)
|
||||
mkdirective "$destdir" "$base" "$file" "$stmt"
|
||||
echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
|
||||
$dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc
|
||||
;;
|
||||
savannah.gnu.org:*)
|
||||
if test -z "$files"; then
|
||||
echo "$0: warning: standalone directives not applicable for $dest" >&2
|
||||
fi
|
||||
$dbg ncftpput savannah.gnu.org /incoming/savannah/$destdir $files
|
||||
;;
|
||||
savannah.nongnu.org:*)
|
||||
if test -z "$files"; then
|
||||
echo "$0: warning: standalone directives not applicable for $dest" >&2
|
||||
fi
|
||||
$dbg ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files
|
||||
;;
|
||||
download.gnu.org.ua:alpha/*|download.gnu.org.ua:ftp/*)
|
||||
destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'`
|
||||
destdir_topdir=`echo "$destdir" | sed 's,/.*,,'`
|
||||
mkdirective "$destdir_p1" "$base" "$file" "$stmt"
|
||||
echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
|
||||
for f in $files $base.directive.asc
|
||||
do
|
||||
echo put $f
|
||||
done | $dbg sftp -b - download.gnu.org.ua:/incoming/$destdir_topdir
|
||||
;;
|
||||
/*)
|
||||
dest_host=`echo "$dest" | sed 's,:.*,,'`
|
||||
mkdirective "$destdir" "$base" "$file" "$stmt"
|
||||
echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
|
||||
$dbg cp $files $base.directive.asc $dest_host
|
||||
;;
|
||||
*)
|
||||
if test -z "$files"; then
|
||||
echo "$0: warning: standalone directives not applicable for $dest" >&2
|
||||
fi
|
||||
$dbg scp $files $dest
|
||||
;;
|
||||
esac
|
||||
rm -f $base.directive $base.directive.asc
|
||||
}
|
||||
|
||||
#####
|
||||
# Process any standalone directives
|
||||
stmt=
|
||||
if test -n "$symlink_files"; then
|
||||
stmt="$stmt
|
||||
`mksymlink $symlink_files`"
|
||||
fi
|
||||
|
||||
for file in $delete_files
|
||||
do
|
||||
stmt="$stmt
|
||||
archive: $file"
|
||||
done
|
||||
|
||||
for file in $delete_symlinks
|
||||
do
|
||||
stmt="$stmt
|
||||
rmsymlink: $file"
|
||||
done
|
||||
|
||||
if test -n "$stmt"; then
|
||||
for dest in $to
|
||||
do
|
||||
destdir=`echo $dest | sed 's/[^:]*://'`
|
||||
upload "$dest" "$destdir" "`hostname`-$$" "" "$stmt"
|
||||
done
|
||||
fi
|
||||
|
||||
# Process actual uploads
|
||||
for dest in $to
|
||||
do
|
||||
for file
|
||||
do
|
||||
echo "Uploading $file to $dest ..."
|
||||
stmt=
|
||||
#
|
||||
# allowing file replacement is all or nothing.
|
||||
if test -n "$replace"; then stmt="$stmt
|
||||
$replace"
|
||||
fi
|
||||
#
|
||||
files="$file $file.sig"
|
||||
destdir=`echo $dest | sed 's/[^:]*://'`
|
||||
if test -n "$symlink_expr"; then
|
||||
linkname=`echo $file | sed "$symlink_expr"`
|
||||
stmt="$stmt
|
||||
symlink: $file $linkname
|
||||
symlink: $file.sig $linkname.sig"
|
||||
fi
|
||||
upload "$dest" "$destdir" "$file" "$file" "$stmt" "$files"
|
||||
done
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,114 @@
|
||||
#!/bin/sh
|
||||
# Increment serial number in Autoconf *.m4 files.
|
||||
|
||||
# Copyright (C) 2021-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
scriptversion=2022-01-27
|
||||
|
||||
copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
|
||||
copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
|
||||
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
|
||||
usage="Usage: $0 [FILE...]
|
||||
|
||||
Increments the serial number, if present, in each of the files.
|
||||
|
||||
Options:
|
||||
--version output version information and exit
|
||||
--help print this help text and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
|
||||
# Based on
|
||||
# <https://www.gnu.org/software/sed/manual/html_node/Increment-a-number.html>
|
||||
sed_inc_serial='1,10 {
|
||||
/serial *[0-9]/ {
|
||||
s/\(serial *[0-9][0-9]*\)/\1~/
|
||||
:a
|
||||
s/\(serial *[0-9]*\)9\(_*\)~/\1_\2~/
|
||||
ta
|
||||
s/\(serial *\)\(_*\)~/\11\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)8\(_*\)~/\19\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)7\(_*\)~/\18\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)6\(_*\)~/\17\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)5\(_*\)~/\16\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)4\(_*\)~/\15\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)3\(_*\)~/\14\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)2\(_*\)~/\13\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)1\(_*\)~/\12\2~/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)0\(_*\)~/\11\2~/
|
||||
tb
|
||||
:b
|
||||
s/\(serial *[0-9]*\)_/\10/
|
||||
tb
|
||||
s/\(serial *[0-9]*\)~/\1/
|
||||
}
|
||||
}'
|
||||
|
||||
# func_process FILE
|
||||
func_process ()
|
||||
{
|
||||
sed -i -e "$sed_inc_serial" "$1" || exit 1
|
||||
}
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--version)
|
||||
set -e
|
||||
echo "increment-serial $scriptversion"
|
||||
echo "$copyright"
|
||||
echo
|
||||
printf 'Written by %s.\n' "Bruno Haible"
|
||||
exit 0
|
||||
;;
|
||||
--help)
|
||||
set -e
|
||||
echo "$usage"
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*) func_process "./$1" ;;
|
||||
*) func_process "$1" ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
func_process "$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
exit 0
|
||||
@@ -0,0 +1,346 @@
|
||||
#!/bin/sh
|
||||
# install-reloc - install a program including a relocating wrapper
|
||||
# Copyright (C) 2003-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage 1:
|
||||
install-reloc -- library_path_var library_path_value prefix destdir \\
|
||||
compile_command srcdir builddir config_h_dir exeext \\
|
||||
strip_command \\
|
||||
install_command... destprog
|
||||
where
|
||||
- library_path_var is the platform dependent runtime library path variable
|
||||
- library_path_value is a colon separated list of directories that contain
|
||||
the libraries at installation time (use this instead of -rpath)
|
||||
- prefix is the base directory at installation time
|
||||
- destdir is a string that is prepended to all file names at installation
|
||||
time; it is already prepended to destprog but not to library_path_value
|
||||
and prefix
|
||||
- compile_command is a C compiler compilation and linking command
|
||||
- srcdir is the directory where to find relocwrapper.c and its dependencies
|
||||
- builddir is the directory where to find built dependencies (namely,
|
||||
alloca.h and stdbool.h)
|
||||
- config_h_dir is the directory where to find config.h
|
||||
- exeext is platform dependent suffix of executables
|
||||
- strip_command is the command for stripping executables, or : if no
|
||||
stripping is desired
|
||||
- install_command is the install command line, excluding the final destprog
|
||||
- destprog is the destination program name
|
||||
Usage 2:
|
||||
env RELOC_LIBRARY_PATH_VAR=library_path_var \\
|
||||
RELOC_LIBRARY_PATH_VALUE=library_path_value \\
|
||||
RELOC_PREFIX=prefix \\
|
||||
RELOC_DESTDIR=destdir \\
|
||||
RELOC_COMPILE_COMMAND=compile_command \\
|
||||
RELOC_SRCDIR=srcdir \\
|
||||
RELOC_BUILDDIR=builddir \\
|
||||
RELOC_CONFIG_H_DIR=config_h_dir \\
|
||||
RELOC_EXEEXT=exeext \\
|
||||
RELOC_STRIP_PROG=strip_command \\
|
||||
RELOC_INSTALL_PROG=install_command... \\
|
||||
install-reloc prog1 ... destprog
|
||||
where destprog is either the destination program name (when only one program
|
||||
is specified) or the destination directory for all programs.
|
||||
Usage 3:
|
||||
install-reloc OPTION
|
||||
|
||||
Renames destprog to destprog.bin and installs a relocating wrapper
|
||||
in the place of destprog.
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "install-reloc (GNU gnulib, module relocatable-prog-wrapper)"
|
||||
echo "Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo
|
||||
printf 'Written by %s.\n' "Bruno Haible"
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "install-reloc: *** $1" 1>&2
|
||||
echo "install-reloc: *** Stop." 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Command-line option processing.
|
||||
if test $# -eq 1; then
|
||||
case "$1" in
|
||||
--help | --hel | --he | --h )
|
||||
func_usage
|
||||
exit 0 ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit 0 ;;
|
||||
-- ) # Usage 1
|
||||
break ;;
|
||||
-* )
|
||||
func_fatal_error "unrecognized option: $1"
|
||||
;;
|
||||
* ) # Usage 2
|
||||
break ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test $# -ge 12 && test "x$1" = "x--"; then
|
||||
# Get fixed position arguments.
|
||||
shift
|
||||
library_path_var=$1
|
||||
library_path_value=$2
|
||||
prefix=$3
|
||||
destdir=$4
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
compile_command=$1
|
||||
srcdir=$2
|
||||
builddir=$3
|
||||
config_h_dir=$4
|
||||
exeext=$5
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
strip_prog=$1
|
||||
shift
|
||||
install_prog=$1 # maybe not including the "-c" option
|
||||
shift
|
||||
else
|
||||
if test $# -ge 2; then
|
||||
# Get arguments from environment variables.
|
||||
library_path_var=$RELOC_LIBRARY_PATH_VAR
|
||||
library_path_value=$RELOC_LIBRARY_PATH_VALUE
|
||||
prefix=$RELOC_PREFIX
|
||||
destdir=$RELOC_DESTDIR
|
||||
compile_command=$RELOC_COMPILE_COMMAND
|
||||
srcdir=$RELOC_SRCDIR
|
||||
builddir=$RELOC_BUILDDIR
|
||||
config_h_dir=$RELOC_CONFIG_H_DIR
|
||||
exeext=$RELOC_EXEEXT
|
||||
strip_prog=$RELOC_STRIP_PROG
|
||||
install_prog=$RELOC_INSTALL_PROG # including the "-c" option
|
||||
else
|
||||
func_usage 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Get destprog, last argument.
|
||||
destprog=
|
||||
for arg
|
||||
do
|
||||
destprog=$arg
|
||||
done
|
||||
# Determine whether destprog is a program name or a directory name.
|
||||
if test -d "$destprog"; then
|
||||
sed_remove_trailing_slashes='s|//*$||'
|
||||
destprog_directory=`echo "$destprog" | sed -e "$sed_remove_trailing_slashes"`
|
||||
if test -z "$destprog_directory"; then
|
||||
destprog_directory='/'
|
||||
fi
|
||||
else
|
||||
destprog_directory=
|
||||
fi
|
||||
# Prepare for remove trailing $exeext, if present.
|
||||
if test -n "$exeext"; then
|
||||
sed_quote='s,\.,\\.,g'
|
||||
sed_remove_exeext='s|'`echo "$exeext" | sed -e "$sed_quote"`'$||'
|
||||
fi
|
||||
if test -z "$destprog_directory"; then
|
||||
# Remove trailing $exeext, if present.
|
||||
if test -n "$exeext"; then
|
||||
destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# Outputs a command and runs it.
|
||||
func_verbose ()
|
||||
{
|
||||
# Make it easy to copy&paste the printed command into a shell in most cases,
|
||||
# by escaping '\\', '"', and '$'. This is not perfect, just good enough.
|
||||
echo "$@" | sed -e 's/\([\\"$]\)/\\\1/g'
|
||||
"$@"
|
||||
}
|
||||
|
||||
# Run install_command.
|
||||
func_verbose $install_prog "$@" || exit $?
|
||||
|
||||
# Iterate over all destination program names.
|
||||
# func_iterate f
|
||||
# applies f to each destination program names, after setting destprog.
|
||||
sed_basename_of_file='s|^.*/||'
|
||||
func_iterate ()
|
||||
{
|
||||
if test -n "$destprog_directory"; then
|
||||
prev_arg=
|
||||
for arg
|
||||
do
|
||||
if test -n "prev_arg"; then
|
||||
destprog="$destprog_directory"/`echo "$prev_arg" | sed -e "$sed_basename_of_file"`
|
||||
$1
|
||||
fi
|
||||
prev_arg="$arg"
|
||||
done
|
||||
else
|
||||
$1
|
||||
fi
|
||||
}
|
||||
|
||||
# Run strip_command.
|
||||
func_strip ()
|
||||
{
|
||||
# Remove trailing $exeext, if present.
|
||||
if test -n "$exeext"; then
|
||||
destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
|
||||
fi
|
||||
func_verbose "$strip_prog" "$destprog$exeext" || exit $?
|
||||
}
|
||||
if test "$strip_prog" != ':'; then
|
||||
func_iterate func_strip
|
||||
fi
|
||||
|
||||
# If the platform doesn't support LD_LIBRARY_PATH or similar, we cannot build
|
||||
# a wrapper.
|
||||
test -n "$library_path_var" || exit 0
|
||||
|
||||
libdirs=
|
||||
saved_IFS="$IFS"; IFS=":"
|
||||
for dir in $library_path_value; do
|
||||
IFS="$saved_IFS"
|
||||
if test -n "$dir"; then
|
||||
case "$libdirs" in
|
||||
*"\"$dir\""*) ;; # remove duplicate
|
||||
*) libdirs="$libdirs\"$dir\"," ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
IFS="$saved_IFS"
|
||||
# If there are no library directories to add at runtime, we don't need a
|
||||
# wrapper.
|
||||
test -n "$libdirs" || exit 0
|
||||
|
||||
# Determine installdir from destprog, removing a leading destdir if present.
|
||||
if test -n "$destprog_directory"; then
|
||||
installdir="$destprog_directory"
|
||||
else
|
||||
installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'`
|
||||
fi
|
||||
if test -n "$destdir"; then
|
||||
sed_quote='s,\([|.\*^$[]\),\\\1,g'
|
||||
sed_remove_destdir='s|^'`echo "$destdir" | sed -e "$sed_quote"`'||'
|
||||
installdir=`echo "$installdir" | sed -e "$sed_remove_destdir"`
|
||||
fi
|
||||
|
||||
# Compile and install wrapper.
|
||||
func_create_wrapper ()
|
||||
{
|
||||
# Remove trailing $exeext, if present.
|
||||
if test -n "$exeext"; then
|
||||
destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
|
||||
fi
|
||||
|
||||
# Compile wrapper.
|
||||
func_verbose $compile_command \
|
||||
-I"$builddir" -I"$srcdir" -I"$config_h_dir" \
|
||||
-DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \
|
||||
-D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" \
|
||||
-D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" \
|
||||
-D"EXEEXT=\"$exeext\"" \
|
||||
"$srcdir"/relocwrapper.c \
|
||||
"$srcdir"/progname.c \
|
||||
"$srcdir"/progreloc.c \
|
||||
"$srcdir"/areadlink.c \
|
||||
"$srcdir"/careadlinkat.c \
|
||||
"$srcdir"/allocator.c \
|
||||
"$srcdir"/readlink.c \
|
||||
"$srcdir"/stat.c \
|
||||
"$srcdir"/stat-time.c \
|
||||
"$srcdir"/canonicalize-lgpl.c \
|
||||
"$srcdir"/malloc/scratch_buffer_grow.c \
|
||||
"$srcdir"/malloc/scratch_buffer_grow_preserve.c \
|
||||
"$srcdir"/malloc/scratch_buffer_set_array_size.c \
|
||||
"$srcdir"/malloc.c \
|
||||
"$srcdir"/realloc.c \
|
||||
"$srcdir"/free.c \
|
||||
"$srcdir"/mempcpy.c \
|
||||
"$srcdir"/rawmemchr.c \
|
||||
"$srcdir"/malloca.c \
|
||||
"$srcdir"/relocatable.c \
|
||||
"$srcdir"/setenv.c \
|
||||
"$srcdir"/c-ctype.c \
|
||||
-o "$destprog.wrapper$exeext"
|
||||
rc=$?
|
||||
# Clean up object files left over in the current directory by the native C
|
||||
# compilers on Solaris, HP-UX, OSF/1, IRIX.
|
||||
rm -f relocwrapper.o \
|
||||
progname.o \
|
||||
progreloc.o \
|
||||
areadlink.o \
|
||||
careadlinkat.o \
|
||||
allocator.o \
|
||||
readlink.o \
|
||||
stat.o \
|
||||
canonicalize-lgpl.o \
|
||||
scratch_buffer_grow.o \
|
||||
scratch_buffer_grow_preserve.o \
|
||||
scratch_buffer_set_array_size.o \
|
||||
malloc.o \
|
||||
realloc.o \
|
||||
free.o \
|
||||
mempcpy.o \
|
||||
rawmemchr.o \
|
||||
malloca.o \
|
||||
relocatable.o \
|
||||
setenv.o \
|
||||
c-ctype.o
|
||||
test $rc = 0 || exit $?
|
||||
# Clean up debugging information left over by the native C compiler on MacOS X.
|
||||
rm -rf "$destprog.wrapper$exeext.dSYM"
|
||||
test $rc = 0 || exit $?
|
||||
|
||||
# Strip wrapper.
|
||||
test "$strip_prog" = ':' || func_verbose "$strip_prog" "$destprog.wrapper$exeext" || exit $?
|
||||
|
||||
# Rename $destprog.wrapper -> $destprog -> $destprog.bin.
|
||||
ln -f "$destprog$exeext" "$destprog.bin$exeext" \
|
||||
|| { rm -f "$destprog.bin$exeext" \
|
||||
&& cp -p "$destprog$exeext" "$destprog.bin$exeext"; } \
|
||||
|| exit 1
|
||||
mv "$destprog.wrapper$exeext" "$destprog$exeext" || exit 1
|
||||
}
|
||||
func_iterate func_create_wrapper
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,541 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2024-06-19.01; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 (GNU Automake) $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibility with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
# Compile a Java program.
|
||||
|
||||
# Copyright (C) 2001-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>, 2001.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This uses the same choices as javacomp.c, but instead of relying on the
|
||||
# environment settings at run time, it uses the environment variables
|
||||
# present at configuration time.
|
||||
#
|
||||
# This is a separate shell script, because it must be able to unset JAVA_HOME
|
||||
# in some cases, which a simple shell command cannot do.
|
||||
#
|
||||
# The extra CLASSPATH must have been set prior to calling this script.
|
||||
# Options that can be passed are -O, -g and "-d DIRECTORY".
|
||||
|
||||
CONF_JAVAC='@CONF_JAVAC@'
|
||||
CONF_CLASSPATH='@CLASSPATH@'
|
||||
if test -n "@HAVE_JAVAC_ENVVAR@"; then
|
||||
# Combine given CLASSPATH and configured CLASSPATH.
|
||||
if test -n "$CLASSPATH"; then
|
||||
CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}"
|
||||
else
|
||||
CLASSPATH="$CONF_CLASSPATH"
|
||||
fi
|
||||
export CLASSPATH
|
||||
test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@" 1>&2
|
||||
exec $CONF_JAVAC "$@"
|
||||
else
|
||||
unset JAVA_HOME
|
||||
if test -n "@HAVE_JAVAC@"; then
|
||||
# In this case, $CONF_JAVAC starts with "javac".
|
||||
CLASSPATH="$CLASSPATH"
|
||||
export CLASSPATH
|
||||
test -z "$JAVA_VERBOSE" || echo "$CONF_JAVAC $@" 1>&2
|
||||
exec $CONF_JAVAC "$@"
|
||||
else
|
||||
echo 'Java compiler not found, try setting $JAVAC, then reconfigure' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
# Execute a Java program.
|
||||
|
||||
# Copyright (C) 2001-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>, 2001.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This uses the same choices as javaexec.c, but instead of relying on the
|
||||
# environment settings at run time, it uses the environment variables
|
||||
# present at configuration time.
|
||||
#
|
||||
# This is a separate shell script, because it must be able to unset JAVA_HOME
|
||||
# in some cases, which a simple shell command cannot do.
|
||||
#
|
||||
# The extra CLASSPATH must have been set prior to calling this script.
|
||||
|
||||
CONF_JAVA='@CONF_JAVA@'
|
||||
CONF_CLASSPATH='@CLASSPATH@'
|
||||
if test -n "@HAVE_JAVA_ENVVAR@"; then
|
||||
# Combine given CLASSPATH and configured CLASSPATH.
|
||||
if test -n "$CLASSPATH"; then
|
||||
CLASSPATH="$CLASSPATH${CONF_CLASSPATH:+@CLASSPATH_SEPARATOR@$CONF_CLASSPATH}"
|
||||
else
|
||||
CLASSPATH="$CONF_CLASSPATH"
|
||||
fi
|
||||
export CLASSPATH
|
||||
test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" 1>&2
|
||||
exec $CONF_JAVA "$@"
|
||||
else
|
||||
unset JAVA_HOME
|
||||
export CLASSPATH
|
||||
if test -n "@HAVE_JAVA@"; then
|
||||
# In this case, $CONF_JAVA is "java".
|
||||
test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" 1>&2
|
||||
exec $CONF_JAVA "$@"
|
||||
else
|
||||
if test -n "@HAVE_JRE@"; then
|
||||
# In this case, $CONF_JAVA is "jre".
|
||||
test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@" 1>&2
|
||||
exec $CONF_JAVA "$@"
|
||||
else
|
||||
echo 'Java virtual machine not found, try setting $JAVA, then reconfigure' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# Determine the dynamically linked dependencies of a program.
|
||||
|
||||
# Copyright (C) 2006-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <bruno@clisp.org>, 2006.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Usage: ldd.sh program
|
||||
|
||||
@LDDPROG@ "$1" @LDDPOSTPROC@
|
||||
@@ -0,0 +1,295 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2019-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# This program is a wizard that helps a maintainer update the libtool
|
||||
# version of a shared library, according to the documentation section
|
||||
# 'Updating version info'
|
||||
# <https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html>.
|
||||
#
|
||||
# Let's call the three parts of the version
|
||||
# LTV_CURRENT
|
||||
# LTV_REVISION
|
||||
# LTV_AGE
|
||||
#
|
||||
# The list of steps given in this documentation section
|
||||
# - If the library source code has changed at all since the last update,
|
||||
# then increment LTV_REVISION.
|
||||
# - If any interfaces have been added, removed, or changed since the last
|
||||
# update, increment LTV_CURRENT and set LTV_REVISION to 0.
|
||||
# - If any interfaces have been added since the last public release, then
|
||||
# increment LTV_AGE.
|
||||
# - If any interfaces have been removed or changed since the last public
|
||||
# release, then set LTV_AGE to 0.
|
||||
# leads to mistakes, because
|
||||
# - It does not say what "interfaces" are.
|
||||
# - It does not enforce that applying the second, third, or fourth rule
|
||||
# is only possible after applying the first rule.
|
||||
# - It does not enforce that applying the third or fourth rule is only
|
||||
# possible after applying the second rule.
|
||||
|
||||
scriptversion=2024-06-13
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: libtool-next-version [OPTION]... PREVIOUS-LIBRARY CURRENT-LIBRARY
|
||||
|
||||
Determines the next version to use for a libtool library.
|
||||
|
||||
PREVIOUS-LIBRARY is the installed library (in .a or .so format) of the
|
||||
previous release.
|
||||
|
||||
CURRENT-LIBRARY is the installed library (in .a or .so format) of the current
|
||||
release candidate.
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
|
||||
echo "libtool-next-version (GNU gnulib) $scriptversion"
|
||||
echo "Copyright (C) ${copyright_year} Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo
|
||||
printf 'Written by %s.\n' "Bruno Haible"
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "libtool-next-version: *** $1" 1>&2
|
||||
echo "libtool-next-version: *** Stop." 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# func_tmpdir
|
||||
# creates a temporary directory.
|
||||
# Sets variable
|
||||
# - tmp pathname of freshly created temporary directory
|
||||
func_tmpdir ()
|
||||
{
|
||||
# Use the environment variable TMPDIR, falling back to /tmp. This allows
|
||||
# users to specify a different temporary directory, for example, if their
|
||||
# /tmp is filled up or too small.
|
||||
: "${TMPDIR=/tmp}"
|
||||
{
|
||||
# Use the mktemp program if available. If not available, hide the error
|
||||
# message.
|
||||
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
|
||||
test -n "$tmp" && test -d "$tmp"
|
||||
} ||
|
||||
{
|
||||
# Use a simple mkdir command. It is guaranteed to fail if the directory
|
||||
# already exists. $RANDOM is bash specific and expands to empty in shells
|
||||
# other than bash, ksh and zsh. Its use does not increase security;
|
||||
# rather, it minimizes the probability of failure in a very cluttered /tmp
|
||||
# directory.
|
||||
tmp=$TMPDIR/gt$$-$RANDOM
|
||||
(umask 077 && mkdir "$tmp")
|
||||
} ||
|
||||
{
|
||||
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
|
||||
{ (exit 1); exit 1; }
|
||||
}
|
||||
}
|
||||
|
||||
# func_read_yesno
|
||||
# reads an answer (yes or no).
|
||||
# Sets variable
|
||||
# - ans yes or no
|
||||
func_read_yesno ()
|
||||
{
|
||||
while true; do
|
||||
read ans
|
||||
if test yes = "$ans" || test no = "$ans"; then
|
||||
break
|
||||
fi
|
||||
echo "Invalid answer. Please answer yes or no."
|
||||
done
|
||||
}
|
||||
|
||||
# Command-line option processing.
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--help | --hel | --he | --h )
|
||||
func_usage
|
||||
exit 0 ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit 0 ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
-* )
|
||||
func_fatal_error "unrecognized option: $option"
|
||||
;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
test $# = 2 || {
|
||||
if test $# -gt 2; then
|
||||
func_fatal_error "too many arguments"
|
||||
else
|
||||
func_fatal_error "Usage: libtool-next-version [OPTION]... PREVIOUS-LIBRARY CURRENT-LIBRARY"
|
||||
fi
|
||||
}
|
||||
|
||||
test -f "$1" || func_fatal_error "file $1 not found"
|
||||
test -f "$2" || func_fatal_error "file $2 not found"
|
||||
|
||||
(type nm) >/dev/null || func_fatal_error "program 'nm' not found"
|
||||
# Determine how to extract a symbol list from the 'nm' output.
|
||||
case `uname -s` in
|
||||
Linux | FreeBSD | NetBSD | OpenBSD) nm_filter="sed -n -e 's/^.* [TWDRB] //p'" ;;
|
||||
Darwin) nm_filter="sed -n -e 's/^.* [TWDRB] _//p'" ;;
|
||||
Minix) nm_filter="sed -n -e 's/^.* [TDC] _//p'" ;;
|
||||
AIX) nm_filter="sed -n -e 's/ *[UD] .*//p' | sed -e 's/^\\.//'" ;;
|
||||
HP-UX) nm_filter="grep '|extern|\\(code\\|data\\) |' | sed -e 's/|.*//' | sed -e 's/ *$//'" ;;
|
||||
IRIX) nm_filter="grep '|\\(GLOB\\|WEAK\\)' | sed -e 's/^.*|//'" ;;
|
||||
SunOS)
|
||||
case `uname -r` in
|
||||
5.10) nm_filter="sed -n -e 's/^.* [ATWDRBV] //p'" ;;
|
||||
*) nm_filter="grep '|\\(GLOB\\|WEAK\\)' | grep -v '|UNDEF' | grep -v '|SUNW' | sed -e 's/^.*|//'" ;;
|
||||
esac
|
||||
;;
|
||||
CYGWIN*) nm_filter="sed -n -e 's/^.* T _//p'" ;;
|
||||
*) func_fatal_error "unknown OS - don't know how to interpret the 'nm' output" ;;
|
||||
esac
|
||||
nm_filter="$nm_filter | LC_ALL=C sort -u"
|
||||
|
||||
func_tmpdir
|
||||
eval "nm '$1' | $nm_filter > '$tmp/symlist1'"
|
||||
eval "nm '$2' | $nm_filter > '$tmp/symlist2'"
|
||||
|
||||
echo "Please enter the libtool version of the library in the previous release."
|
||||
|
||||
printf "LTV_CURRENT="; read current
|
||||
nondigits=`echo "$current" | tr -d '0123456789'`
|
||||
{ test -n "$current" && test -z "$nondigits"; } \
|
||||
|| func_fatal_error "LTV_CURRENT is invalid. It should be a nonnegative integer."
|
||||
|
||||
printf "LTV_REVISION="; read revision
|
||||
nondigits=`echo "$revision" | tr -d '0123456789'`
|
||||
{ test -n "$revision" && test -z "$nondigits"; } \
|
||||
|| func_fatal_error "LTV_REVISION is invalid. It should be a nonnegative integer."
|
||||
|
||||
printf "LTV_AGE="; read age
|
||||
nondigits=`echo "$age" | tr -d '0123456789'`
|
||||
{ test -n "$age" && test -z "$nondigits"; } \
|
||||
|| func_fatal_error "LTV_AGE is invalid. It should be a nonnegative integer."
|
||||
|
||||
echo
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo "Did the library's code change at all since the previous version?"
|
||||
echo "You can usually detect this by looking at the source code changes in git;"
|
||||
echo "don't forget source code that is imported from other projects."
|
||||
if cmp "$tmp/symlist1" "$tmp/symlist2" >/dev/null; then
|
||||
echo "Please answer yes or no."
|
||||
else
|
||||
echo "The symbol list changed. Here are the differences:"
|
||||
(cd "$tmp" && diff symlist1 symlist2 | grep '^[<>]' | sed -e 's/^/ /')
|
||||
echo "Please answer yes or no (probably yes)."
|
||||
fi
|
||||
func_read_yesno
|
||||
if test "$ans" = yes; then
|
||||
|
||||
revision=`expr $revision + 1`
|
||||
|
||||
echo
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo "Have any interfaces (functions, variables, classes) been removed since the"
|
||||
echo "previous release? What matters here are interfaces at the linker level;"
|
||||
echo "whether macros have been removed from the include files does not matter."
|
||||
if diff "$tmp/symlist1" "$tmp/symlist2" | grep '^< ' >/dev/null; then
|
||||
echo "Some symbols have been removed:"
|
||||
diff "$tmp/symlist1" "$tmp/symlist2" | grep '^< ' | sed -e 's/^< / /'
|
||||
echo "Please answer yes or no (probably yes)."
|
||||
else
|
||||
echo "Please answer yes or no."
|
||||
fi
|
||||
func_read_yesno
|
||||
|
||||
if test "$ans" = yes; then
|
||||
|
||||
current=`expr $current + 1`
|
||||
revision=0
|
||||
age=0
|
||||
|
||||
else
|
||||
|
||||
echo
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo "Have any interfaces (functions, variables, classes) been changed since the"
|
||||
echo "previous release? This includes signature changes. It includes also details of"
|
||||
echo "how functions produce their results and the values of variables, IF AND ONLY IF"
|
||||
echo "users of the library are likely use these details in their test suite."
|
||||
echo "Please answer yes or no."
|
||||
func_read_yesno
|
||||
|
||||
if test "$ans" = yes; then
|
||||
|
||||
current=`expr $current + 1`
|
||||
revision=0
|
||||
age=0
|
||||
|
||||
else
|
||||
|
||||
echo
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo "Have any interfaces (functions, variables, classes) been added since the"
|
||||
echo "previous release? What matters here are interfaces at the linker level;"
|
||||
echo "whether macros have been added to the include files does not matter."
|
||||
if diff "$tmp/symlist1" "$tmp/symlist2" | grep '^> ' >/dev/null; then
|
||||
echo "Some symbols have been added:"
|
||||
diff "$tmp/symlist1" "$tmp/symlist2" | grep '^> ' | sed -e 's/^> / /'
|
||||
echo "Please answer yes or no (probably yes)."
|
||||
else
|
||||
echo "Please answer yes or no."
|
||||
fi
|
||||
func_read_yesno
|
||||
|
||||
if test "$ans" = yes; then
|
||||
|
||||
current=`expr $current + 1`
|
||||
revision=0
|
||||
age=`expr $age + 1`
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo "This is the libtool version of the library for the new release:"
|
||||
echo "LTV_CURRENT=$current"
|
||||
echo "LTV_REVISION=$revision"
|
||||
echo "LTV_AGE=$age"
|
||||
@@ -0,0 +1,148 @@
|
||||
#!/bin/sh
|
||||
# libtool-reloc - libtool wrapper with support for relocatable programs
|
||||
# Copyright (C) 2019-2024 Free Software Foundation, Inc.
|
||||
# Written by Bruno Haible <bruno@clisp.org>, 2019.
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: libtool-reloc [OPTION]... libtool LIBTOOL_ARGUMENTS
|
||||
|
||||
Invokes GNU libtool, with support for relocatable programs.
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
|
||||
Send patches and bug reports to <bug-gnulib@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "libtool-reloc (GNU gnulib, module relocatable-prog)"
|
||||
echo "Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo
|
||||
printf 'Written by %s.\n' "Bruno Haible"
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "libtool-reloc: *** $1" 1>&2
|
||||
echo "libtool-reloc: *** Stop." 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Outputs a command and runs it.
|
||||
func_verbose ()
|
||||
{
|
||||
# Make it easy to copy&paste the printed command into a shell in most cases,
|
||||
# by escaping '\\', '"', and '$'. This is not perfect, just good enough.
|
||||
echo "$@" | sed -e 's/\([\\"$]\)/\\\1/g'
|
||||
"$@"
|
||||
}
|
||||
|
||||
# Command-line option processing.
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--help | --hel | --he | --h )
|
||||
func_usage
|
||||
exit 0 ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit 0 ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
-* )
|
||||
func_fatal_error "unrecognized option: $1"
|
||||
;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -lt 1; then
|
||||
func_fatal_error "too few arguments"
|
||||
fi
|
||||
|
||||
# Determine the mode from the arguments.
|
||||
mode=
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
--mode=link) mode=link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test "$mode" = link; then
|
||||
# Determine the target from the arguments.
|
||||
target=
|
||||
next_is_target=false
|
||||
for arg
|
||||
do
|
||||
if $next_is_target; then
|
||||
target="$arg"
|
||||
next_is_target=false
|
||||
else
|
||||
case "$arg" in
|
||||
-o) next_is_target=true ;;
|
||||
*) next_is_target=false ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
case "$target" in
|
||||
*.la)
|
||||
# When creating a library:
|
||||
# 1. Add a '-Wl,-rpath,@loader_path' option.
|
||||
# (A '-R @loader_path' option does not work: libtool produces
|
||||
# an error "error: only absolute run-paths are allowed".)
|
||||
# (Also note that 'install_name_tool -add_rpath @loader_path ...'
|
||||
# does not work on Mac OS X 10.5.)
|
||||
# This is done through the RELOCATABLE_LDFLAGS macro.
|
||||
# 2. After creating the library, run
|
||||
# install_name_tool -id @rpath/$dlname $target_dir/.libs/$dlname
|
||||
# (This is easier than to modify the libtool script to emit a different
|
||||
# install_name. Also, an option '-Wl,-install_name,@rpath/$dlname' does
|
||||
# not work since libtool emits another option '-Wl,-install_name,...'
|
||||
# after it.
|
||||
"$@" && {
|
||||
dlname_assignment=`grep '^dlname=' "$target"`
|
||||
dlname=
|
||||
eval "$dlname_assignment"
|
||||
# Nothing to do when --disable-shared was specified.
|
||||
if test -n "$dlname"; then
|
||||
target_dir=`dirname "$target"`
|
||||
if test -f "$target_dir/.libs/$dlname"; then
|
||||
func_verbose install_name_tool -id "@rpath/$dlname" "$target_dir/.libs/$dlname"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
;;
|
||||
*)
|
||||
"$@"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
@@ -0,0 +1,129 @@
|
||||
#!/bin/sh
|
||||
# Wrapper for compilers on macOS
|
||||
# that lose debug information in the final link of an executable.
|
||||
scriptversion=2024-05-20.15; # UTC
|
||||
|
||||
# Copyright (C) 2024 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 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
#
|
||||
# This file 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Bruno Haible <bruno@clisp.org>, 2024.
|
||||
|
||||
# The problem:
|
||||
# 1) On macOS, debug information for executables is not stored in the
|
||||
# executable itself, but in a separate file: If the executable is in
|
||||
# ${DIR}/${BASENAME}
|
||||
# the debug info is in
|
||||
# ${DIR}/${BASENAME}.dSYM/Contents/Resources/DWARF/${BASENAME}
|
||||
# 2) The Apple compilers on macOS, in the linking step that creates an
|
||||
# executable from object files, do not create this debug info.
|
||||
# An extra command
|
||||
# dsymutil ${DIR}/${BASENAME}
|
||||
# is necessary in order to create it.
|
||||
#
|
||||
# See
|
||||
# https://stackoverflow.com/questions/32297349/why-does-a-2-stage-command-line-build-with-clang-not-generate-a-dsym-directory
|
||||
# https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable/12827463#12827463
|
||||
# https://wiki.dwarfstd.org/Apple%27s_%22Lazy%22_DWARF_Scheme.md
|
||||
|
||||
# The solution:
|
||||
# Make
|
||||
# macos-compile clang [OPTION...] FILE...
|
||||
# behave like
|
||||
# clang [OPTION...] FILE...
|
||||
# does on other platforms, namely to create the debug info during linking
|
||||
# of the executable (instead of leaving it for later).
|
||||
|
||||
# Note: 1) is also a problem for the 'install' command that installs an
|
||||
# executable in a public location. This is not handled here.
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: macos-compile COMPILER [OPTION...] FILE...
|
||||
|
||||
Invokes COMPILER [OPTION...] FILE... and handles debug information.
|
||||
|
||||
Report bugs to <bug-gnulib@gnu.org>."
|
||||
}
|
||||
|
||||
# Handle --help and --version.
|
||||
case "$1" in
|
||||
--help)
|
||||
func_usage
|
||||
exit $?
|
||||
;;
|
||||
--version)
|
||||
echo "macos-compile (GNU gnulib) $scriptversion
|
||||
Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
|
||||
Written by Bruno Haible."
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Set to true for the linking step that creates an executable.
|
||||
linking=true
|
||||
# The executable created by the command.
|
||||
output_file='a.out'
|
||||
output_file_is_next=false
|
||||
# Whether debug information is requested.
|
||||
debugging=false
|
||||
|
||||
# Process the command-line options.
|
||||
first=true
|
||||
for arg
|
||||
do
|
||||
if $first; then
|
||||
first=false
|
||||
set -- "$arg"
|
||||
else
|
||||
if $output_file_is_next; then
|
||||
output_file="$arg"
|
||||
output_file_is_next=false
|
||||
else
|
||||
case "$arg" in
|
||||
-c | -E | -S | -fdriver-only | --precompile )
|
||||
linking=false
|
||||
;;
|
||||
-o )
|
||||
output_file_is_next=true
|
||||
;;
|
||||
-g* )
|
||||
debugging=true
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
set -- "$@" "$arg"
|
||||
fi
|
||||
done
|
||||
|
||||
# Execute the command and the $output_file.dSYM workaround.
|
||||
if $linking; then
|
||||
rm -rf "$output_file.dSYM"
|
||||
fi
|
||||
"$@" || exit $?
|
||||
if $linking; then
|
||||
# Do this dsymutil invocation also when not $debugging.
|
||||
# The linking step is supposed to copy and link the debug information from
|
||||
# the previous steps always.
|
||||
# Example: $CC -g -O2 -c foo.c && $CC foo.o
|
||||
dsymutil "$output_file" || exit $?
|
||||
fi
|
||||
exit 0
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
|
||||
scriptversion=2024-06-19.01; # UTC
|
||||
|
||||
# Copyright (C) 1995-2024 Free Software Foundation, Inc.
|
||||
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
|
||||
#
|
||||
# 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 <https://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>.
|
||||
|
||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||
emulate sh
|
||||
NULLCMD=:
|
||||
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
|
||||
# is contrary to our usage. Disable this feature.
|
||||
alias -g '${1+"$@"}'='"$@"'
|
||||
setopt NO_GLOB_SUBST
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No file. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: mdate-sh [--help] [--version] FILE
|
||||
|
||||
Pretty-print the modification day of FILE, in the format:
|
||||
1 January 1970
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "mdate-sh (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
error ()
|
||||
{
|
||||
echo "$0: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# Use UTC to get reproducible result.
|
||||
TZ=UTC0
|
||||
export TZ
|
||||
|
||||
# GNU ls changes its time format in response to the TIME_STYLE
|
||||
# variable. Since we cannot assume 'unset' works, revert this
|
||||
# variable to its documented default.
|
||||
if test "${TIME_STYLE+set}" = set; then
|
||||
TIME_STYLE=posix-long-iso
|
||||
export TIME_STYLE
|
||||
fi
|
||||
|
||||
save_arg1=$1
|
||||
|
||||
# Find out how to get the extended ls output of a file or directory.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command='ls -L -l -d'
|
||||
else
|
||||
ls_command='ls -l -d'
|
||||
fi
|
||||
# Avoid user/group names that might have spaces, when possible.
|
||||
if ls -n /dev/null 1>/dev/null 2>&1; then
|
||||
ls_command="$ls_command -n"
|
||||
fi
|
||||
|
||||
# A 'ls -l' line looks as follows on OS/2.
|
||||
# drwxrwx--- 0 Aug 11 2001 foo
|
||||
# This differs from Unix, which adds ownership information.
|
||||
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
|
||||
#
|
||||
# To find the date, we split the line on spaces and iterate on words
|
||||
# until we find a month. This cannot work with files whose owner is a
|
||||
# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
|
||||
# will be owned by a user whose name is a month. So we first look at
|
||||
# the extended ls output of the root directory to decide how many
|
||||
# words should be skipped to get the date.
|
||||
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
set x`$ls_command /`
|
||||
|
||||
# Find which argument is the month.
|
||||
month=
|
||||
command=
|
||||
until test $month
|
||||
do
|
||||
test $# -gt 0 || error "failed parsing '$ls_command /' output"
|
||||
shift
|
||||
# Add another shift to the command.
|
||||
command="$command shift;"
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -n "$month" || error "failed parsing '$ls_command /' output"
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
set dummy x`eval "$ls_command \"\\\$save_arg1\""`
|
||||
|
||||
# Remove all preceding arguments
|
||||
eval $command
|
||||
|
||||
# Because of the dummy argument above, month is in $2.
|
||||
#
|
||||
# On a POSIX system, we should have
|
||||
#
|
||||
# $# = 5
|
||||
# $1 = file size
|
||||
# $2 = month
|
||||
# $3 = day
|
||||
# $4 = year or time
|
||||
# $5 = filename
|
||||
#
|
||||
# On Darwin 7.7.0 and 7.6.0, we have
|
||||
#
|
||||
# $# = 4
|
||||
# $1 = day
|
||||
# $2 = month
|
||||
# $3 = year or time
|
||||
# $4 = filename
|
||||
|
||||
# Get the month.
|
||||
case $2 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
|
||||
case $3 in
|
||||
???*) day=$1;;
|
||||
*) day=$3; shift;;
|
||||
esac
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1,164 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
|
||||
scriptversion=2024-06-19.01; # UTC
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
errstatus=0
|
||||
dirmode=
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
GNU Automake home page: <https://www.gnu.org/software/automake/>.
|
||||
General help using GNU software: <https://www.gnu.org/gethelp/>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
|
||||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 (GNU Automake) $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*) # unknown option
|
||||
echo "$usage" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*) # first non-opt arg
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the 'mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because '.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "umask 22"
|
||||
umask 22
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "umask 22"
|
||||
umask 22
|
||||
|
||||
for file
|
||||
do
|
||||
case $file in
|
||||
/*) pathcomp=/ ;;
|
||||
*) pathcomp= ;;
|
||||
esac
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set fnord $file
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
for d
|
||||
do
|
||||
test "x$d" = x && continue
|
||||
|
||||
pathcomp=$pathcomp$d
|
||||
case $pathcomp in
|
||||
-*) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $file"
|
||||
chmod "$dirmode" "$file" || errstatus=$?
|
||||
fi
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
#!/bin/sh
|
||||
# Create a temporary directory, much like mktemp -d does.
|
||||
|
||||
# Copyright (C) 2007-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Jim Meyering.
|
||||
|
||||
# Usage: mktempd /tmp phoey.XXXXXXXXXX
|
||||
|
||||
# First, try to use the mktemp program.
|
||||
# Failing that, we'll roll our own mktemp-like function:
|
||||
# - try to get random bytes from /dev/urandom
|
||||
# - failing that, generate output from a combination of quickly-varying
|
||||
# sources and gzip. Ignore non-varying gzip header, and extract
|
||||
# "random" bits from there.
|
||||
# - given those bits, map to file-name bytes using tr, and try to create
|
||||
# the desired directory.
|
||||
# - make only $MAX_TRIES attempts
|
||||
|
||||
ME=`basename "$0"`
|
||||
die() { echo >&2 "$ME: $@"; exit 1; }
|
||||
|
||||
MAX_TRIES=4
|
||||
|
||||
rand_bytes()
|
||||
{
|
||||
n=$1
|
||||
|
||||
chars=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
|
||||
|
||||
dev_rand=/dev/urandom
|
||||
if test -r "$dev_rand"; then
|
||||
# Note: 256-length($chars) == 194; 3 copies of $chars is 186 + 8 = 194.
|
||||
dd ibs=$n count=1 if="$dev_rand" 2>/dev/null \
|
||||
| tr -c $chars 01234567$chars$chars$chars
|
||||
return
|
||||
fi
|
||||
|
||||
cmds='date; date +%N; free; who -a; w; ps auxww; ps -ef'
|
||||
data=` (eval "$cmds") 2>&1 | gzip `
|
||||
|
||||
n_plus_50=`expr $n + 50`
|
||||
|
||||
# Ensure that $data has length at least 50+$n
|
||||
while :; do
|
||||
len=`echo "$data"|wc -c`
|
||||
test $n_plus_50 -le $len && break;
|
||||
data=` (echo "$data"; eval "$cmds") 2>&1 | gzip `
|
||||
done
|
||||
|
||||
echo "$data" \
|
||||
| dd bs=1 skip=50 count=$n 2>/dev/null \
|
||||
| tr -c $chars 01234567$chars$chars$chars
|
||||
}
|
||||
|
||||
mktempd()
|
||||
{
|
||||
case $# in
|
||||
2);;
|
||||
*) die "Usage: $ME DIR TEMPLATE";;
|
||||
esac
|
||||
|
||||
destdir=$1
|
||||
template=$2
|
||||
|
||||
# Disallow any trailing slash on specified destdir:
|
||||
# it would subvert the post-mktemp "case"-based destdir test.
|
||||
case $destdir in
|
||||
/) ;;
|
||||
*/) die "invalid destination dir: remove trailing slash(es)";;
|
||||
esac
|
||||
|
||||
case $template in
|
||||
-*) die "invalid template: $template (cannot start with '-')";;
|
||||
*XXXX) ;;
|
||||
*) die "invalid template: $template (must have a suffix of at least 4 X's)";;
|
||||
esac
|
||||
|
||||
fail=0
|
||||
|
||||
# First, try GNU mktemp, where -t has no option-argument.
|
||||
# Put -t last, as GNU mktemp allows, so that the incompatible NetBSD mktemp
|
||||
# (where -t has an option-argument) fails instead of creating a junk dir.
|
||||
d=`env -u TMPDIR mktemp -d -p "$destdir" "$template" -t 2>/dev/null` \
|
||||
|| fail=1
|
||||
|
||||
# The resulting name must be in the specified directory.
|
||||
case $d in "$destdir"*);; *) fail=1;; esac
|
||||
|
||||
# It must have created the directory.
|
||||
test -d "$d" || fail=1
|
||||
|
||||
# It must have 0700 permissions. Handle sticky "S" bits.
|
||||
perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
|
||||
case $perms in drwx------*) ;; *) fail=1;; esac
|
||||
|
||||
test $fail = 0 && {
|
||||
echo "$d"
|
||||
return
|
||||
}
|
||||
|
||||
# If we reach this point, we'll have to create a directory manually.
|
||||
|
||||
# Get a copy of the template without its suffix of X's.
|
||||
base_template=`echo "$template"|sed 's/XX*$//'`
|
||||
|
||||
# Calculate how many X's we've just removed.
|
||||
template_length=`echo "$template" | wc -c`
|
||||
nx=`echo "$base_template" | wc -c`
|
||||
nx=`expr $template_length - $nx`
|
||||
|
||||
err=
|
||||
i=1
|
||||
while :; do
|
||||
X=`rand_bytes $nx`
|
||||
candidate_dir="$destdir/$base_template$X"
|
||||
err=`mkdir -m 0700 "$candidate_dir" 2>&1` \
|
||||
&& { echo "$candidate_dir"; return; }
|
||||
test $MAX_TRIES -le $i && break;
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
die "$err"
|
||||
}
|
||||
|
||||
mktempd "$@"
|
||||
@@ -0,0 +1,84 @@
|
||||
#!/bin/sh
|
||||
# Like mv $1 $2, but if the files are the same, just delete $1.
|
||||
# Status is zero if successful, nonzero otherwise.
|
||||
|
||||
VERSION='2024-07-04 10:56'; # UTC
|
||||
# The definition above must lie within the first 8 lines in order
|
||||
# for the Emacs time-stamp write hook (at end) to update it.
|
||||
# If you change this file with Emacs, please let the write hook
|
||||
# do its job. Otherwise, update this string manually.
|
||||
|
||||
# Copyright (C) 2002-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
usage="usage: $0 SOURCE DEST"
|
||||
|
||||
help="$usage
|
||||
or: $0 OPTION
|
||||
If SOURCE is different than DEST, then move it to DEST; else remove SOURCE.
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
The variable CMPPROG can be used to specify an alternative to 'cmp'.
|
||||
|
||||
Report bugs to <bug-gnulib@gnu.org>."
|
||||
|
||||
year=`expr "$VERSION" : '\([^-]*\)'`
|
||||
version=`expr "$VERSION" : '\([^ ]*\)'`
|
||||
version="move-if-change (gnulib) $version
|
||||
Copyright $year Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
--help | --hel | --he | --h)
|
||||
exec echo "$help" ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
exec echo "$version" ;;
|
||||
--)
|
||||
shift
|
||||
break ;;
|
||||
-*)
|
||||
echo "$0: invalid option: $arg" >&2
|
||||
exit 1 ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; }
|
||||
|
||||
if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then
|
||||
rm -f -- "$1"
|
||||
else
|
||||
if mv -f -- "$1" "$2"; then :; else
|
||||
# Ignore failure due to a concurrent move-if-change.
|
||||
test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1"
|
||||
fi
|
||||
fi
|
||||
|
||||
## Local Variables:
|
||||
## eval: (add-hook 'before-save-hook 'time-stamp nil t)
|
||||
## time-stamp-start: "VERSION='"
|
||||
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||
## time-stamp-time-zone: "UTC0"
|
||||
## time-stamp-end: "'; # UTC"
|
||||
## End:
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2008-2024 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Original author: Karl Berry.
|
||||
# Bug reports and correspondence to bug-gnulib@gnu.org.
|
||||
#
|
||||
# This is a minimal replacement for ncftpput using standard ftp.
|
||||
# It was written for use with the Automake gnupload script for machines
|
||||
# without ncftpput, e.g., rename it to ncftpput and put it in your PATH.
|
||||
#
|
||||
# The arguments are:
|
||||
# host dir file1 file2 ...
|
||||
|
||||
host=$1; shift
|
||||
dir=$1; shift
|
||||
|
||||
newline="
|
||||
"
|
||||
|
||||
mputs=
|
||||
for f
|
||||
do
|
||||
if test ! -s "$f"; then
|
||||
echo "$0: $f not readable or empty, goodbye." >&2
|
||||
exit 1
|
||||
fi
|
||||
target=`basename "$f"`
|
||||
mputs="${mputs}put $f $target$newline"
|
||||
done
|
||||
|
||||
if test "$dir" = .; then
|
||||
dir=
|
||||
else
|
||||
dir="cd $dir"
|
||||
fi
|
||||
|
||||
ftp -i $host <<END_SESSION
|
||||
$dir
|
||||
bin
|
||||
verbose
|
||||
$mputs
|
||||
quit
|
||||
END_SESSION
|
||||
@@ -0,0 +1,176 @@
|
||||
/* Styling for cyclomatic code complexity charts.
|
||||
|
||||
Copyright (C) 2008-2024 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 3 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
This file 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 <https://www.gnu.org/licenses/>. */
|
||||
|
||||
body {
|
||||
font-family: Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.page_title {
|
||||
font: 18pt Georgia, serif;
|
||||
color: darkred;
|
||||
}
|
||||
|
||||
.section_title {
|
||||
font: 14pt Georgia, serif;
|
||||
color: darkred;
|
||||
}
|
||||
|
||||
.report_timestamp {
|
||||
color: darkred;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.function_src {
|
||||
text-align: left;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.resume_table {
|
||||
}
|
||||
|
||||
.resume_header_entry {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.resume_number_entry {
|
||||
color: darkred;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.ranges_table {
|
||||
border-spacing: 0px;
|
||||
border-bottom: solid 2px black;
|
||||
border-top: solid 2px black;
|
||||
border-left: solid 2px black;
|
||||
border-right: solid 2px black;
|
||||
}
|
||||
|
||||
.ranges_header_entry {
|
||||
padding: 5px;
|
||||
border-bottom: solid 1px black;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
color: darkred;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ranges_entry {
|
||||
}
|
||||
|
||||
.ranges_entry_simple {
|
||||
background: #87ff75;
|
||||
}
|
||||
|
||||
.ranges_entry_moderate {
|
||||
background: #fffc60;
|
||||
}
|
||||
|
||||
.ranges_entry_high {
|
||||
background: #ff5a5d;
|
||||
}
|
||||
|
||||
.ranges_entry_untestable {
|
||||
background: #993300
|
||||
}
|
||||
|
||||
|
||||
.function_table {
|
||||
border-spacing: 0px;
|
||||
border-bottom: solid 2px black;
|
||||
border-top: solid 2px black;
|
||||
border-left: solid 2px black;
|
||||
border-right: solid 2px black;
|
||||
}
|
||||
|
||||
.function_table_caption {
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.function_table_header {
|
||||
}
|
||||
|
||||
|
||||
.function_table_header_entry {
|
||||
padding: 5px;
|
||||
border-bottom: solid 1px black;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
color: darkred;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.function_entry {
|
||||
}
|
||||
|
||||
|
||||
.function_entry_simple {
|
||||
background: #87ff75;
|
||||
}
|
||||
|
||||
.function_entry_moderate {
|
||||
background: #fffc60;
|
||||
}
|
||||
|
||||
.function_entry_high {
|
||||
background: #ff5a5d;
|
||||
}
|
||||
|
||||
.function_entry_untestable {
|
||||
background: #993300
|
||||
}
|
||||
|
||||
|
||||
.function_entry_name {
|
||||
font-size: 1em;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
text-valign: top;
|
||||
|
||||
border-top: solid 1px black;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.function_entry_cyclo {
|
||||
font-size: 1em;
|
||||
text-align: right;
|
||||
text-valign: top;
|
||||
|
||||
border-top: solid 1px black;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.function_entry_number {
|
||||
font-size: 1em;
|
||||
text-align: right;
|
||||
text-valign: top;
|
||||
|
||||
border-top: solid 1px black;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.function_entry_filename {
|
||||
font-size: 1em;
|
||||
text-align: left;
|
||||
text-valign: top;
|
||||
|
||||
border-top: solid 1px black;
|
||||
padding: 3px;
|
||||
}
|
||||
@@ -0,0 +1,911 @@
|
||||
# pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*-
|
||||
|
||||
# Copyright (C) 2007-2024 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Jose E. Marchesi <jemarch@gnu.org>.
|
||||
# Adapted for gnulib by Simon Josefsson <simon@josefsson.org>.
|
||||
# Added support for C++ by Giuseppe Scrivano <gscrivano@gnu.org>.
|
||||
|
||||
# Typical Invocation is from a Makefile.am:
|
||||
#
|
||||
# CYCLO_SRCS = ${top_srcdir}/src/*.[ch]
|
||||
#
|
||||
# cyclo-$(PACKAGE).html: $(CYCLO_SRCS)
|
||||
# $(AM_V_GEN)$(PMCCABE) $(CYCLO_SRCS) \
|
||||
# | LC_ALL=C sort -nr \
|
||||
# | LC_ALL=C $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \
|
||||
# -v lang=html -v name="$(PACKAGE_NAME)" \
|
||||
# -v vcurl="https://git.savannah.gnu.org/gitweb/?p=$(PACKAGE).git;a=blob;f=%FILENAME%;hb=HEAD" \
|
||||
# -v url="https://www.gnu.org/software/$(PACKAGE)/" \
|
||||
# -v css=${top_srcdir}/build-aux/pmccabe.css \
|
||||
# -v cut_dir=${top_srcdir}/ \
|
||||
# > $@-tmp
|
||||
# mv $@-tmp $@
|
||||
#
|
||||
# The variables available are:
|
||||
# lang output language, either 'html' or 'wiki'
|
||||
# name project name
|
||||
# url link to project's home page
|
||||
# vcurl URL to version controlled source code browser,
|
||||
# a %FILENAME% in the string is replaced with the relative
|
||||
# source filename
|
||||
# css CSS stylesheet filename, included verbatim in HTML output
|
||||
# css_url link to CSS stylesheet, an URL
|
||||
|
||||
# Prologue & configuration
|
||||
BEGIN {
|
||||
# Portable lookup of present time.
|
||||
"date +%s" | getline epoch_time
|
||||
"date" | getline chronos_time
|
||||
|
||||
section_global_stats_p = 1
|
||||
section_function_cyclo_p = 1
|
||||
|
||||
# "html" or "wiki"
|
||||
package_name = name
|
||||
output_lang = lang
|
||||
|
||||
# General Options
|
||||
cyclo_simple_max = 10
|
||||
cyclo_moderate_max = 20
|
||||
cyclo_high_max = 50
|
||||
source_file_link_tmpl = vcurl
|
||||
|
||||
# HTML options
|
||||
if (url != "")
|
||||
{
|
||||
html_prolog = "<a href=\"" url "\">Back to " package_name " Homepage</a><br/><br/>"
|
||||
}
|
||||
html_epilog = "<hr color=\"black\" size=\"2\"/> \
|
||||
Copyright (c) 2007, 2008 Free Software Foundation, Inc."
|
||||
html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \
|
||||
\"http://www.w3.org/TR/html401/loose.dtd\">"
|
||||
html_comment = "<!-- Generated by gnulib's pmccabe2html at " epoch_time " -->"
|
||||
html_title = "Cyclomatic Complexity report for " package_name
|
||||
|
||||
# Wiki options
|
||||
wiki_prolog = "{{Note|This page has been automatically generated}}"
|
||||
wiki_epilog = ""
|
||||
|
||||
# Internal variables
|
||||
nfuncs = 0;
|
||||
}
|
||||
|
||||
# Functions
|
||||
|
||||
function build_stats()
|
||||
{
|
||||
# Maximum modified cyclo
|
||||
for (fcn in mcyclo)
|
||||
{
|
||||
num_of_functions++
|
||||
if (mcyclo[fcn] > max_mcyclo)
|
||||
{
|
||||
max_mcyclo = mcyclo[fcn]
|
||||
}
|
||||
|
||||
if (mcyclo[fcn] > cyclo_high_max)
|
||||
{
|
||||
num_of_untestable_functions++
|
||||
}
|
||||
else if (mcyclo[fcn] > cyclo_moderate_max)
|
||||
{
|
||||
num_of_high_functions++
|
||||
}
|
||||
else if (mcyclo[fcn] > cyclo_simple_max)
|
||||
{
|
||||
num_of_moderate_functions++
|
||||
}
|
||||
else
|
||||
{
|
||||
num_of_simple_functions++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function html_fnc_table_complete (caption)
|
||||
{
|
||||
html_fnc_table(caption, 1, 1, 0, 1, 1, 0, 1)
|
||||
}
|
||||
|
||||
function html_fnc_table_abbrev (caption)
|
||||
{
|
||||
html_fnc_table(caption, 1, 1, 0, 0, 1, 0, 0)
|
||||
}
|
||||
|
||||
|
||||
function html_fnc_table (caption,
|
||||
fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
{
|
||||
print "<table width=\"90%\" class=\"function_table\" cellpadding=\"0\" cellspacing=\"0\">"
|
||||
if (caption != "")
|
||||
{
|
||||
print "<caption class=\"function_table_caption\">" caption "</caption>"
|
||||
}
|
||||
html_fnc_header(fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
for (nfnc = 1; nfnc <= nfuncs; nfnc++)
|
||||
{
|
||||
html_fnc(nfnc,
|
||||
fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
}
|
||||
print "</table>"
|
||||
}
|
||||
|
||||
function html_header ()
|
||||
{
|
||||
print html_doctype
|
||||
print "<html>"
|
||||
print html_comment
|
||||
print "<head>"
|
||||
print "<title>" html_title "</title>"
|
||||
print ""
|
||||
print "<meta name=\"description\" content=\"" html_title "\">"
|
||||
print "<meta name=\"keywords\" content=\"" html_title "\">"
|
||||
print "<meta name=\"resource-type\" content=\"document\">"
|
||||
print "<meta name=\"distribution\" content=\"global\">"
|
||||
print "<meta name=\"Generator\" content=\"pmccabe2html\">"
|
||||
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
|
||||
print "<script language=\"javascript\" type=\"text/javascript\">"
|
||||
print "function show_hide(idCapa, idButton, fuerzaVisibilidad)\
|
||||
{\
|
||||
var button = document.getElementById(idButton);\
|
||||
var capa = document.getElementById(idCapa);\
|
||||
if (capa)\
|
||||
{\
|
||||
if (fuerzaVisibilidad && fuerzaVisibilidad!=\"\") {\
|
||||
if (fuerzaVisibilidad==\"visible\") capa.style.display=\"\";\
|
||||
else capa.style.display=\"none\";\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
if (capa.style.display == \"none\") {\
|
||||
capa.style.display = \"\";\
|
||||
button.innerHTML = \"↑\";\
|
||||
} else {\
|
||||
capa.style.display = \"none\";\
|
||||
button.innerHTML = \"↓\"; \
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
}"
|
||||
print "</script>"
|
||||
|
||||
|
||||
if (css_url != "")
|
||||
{
|
||||
print "<link rel=\"stylesheet\" href=\"" css_url "\" type =\"text/css\" media=\"screen\"/>"
|
||||
}
|
||||
if (css != "")
|
||||
{
|
||||
print "<style type =\"text/css\" media=\"screen\">"
|
||||
print "<!--"
|
||||
while ((getline cssline < css) > 0)
|
||||
{
|
||||
print cssline
|
||||
}
|
||||
print "-->"
|
||||
print "</style>"
|
||||
close(css)
|
||||
}
|
||||
print "</head>"
|
||||
print "<body lang=\"en\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" \
|
||||
vlink=\"#800080\" alink=\"#FF0000\">"
|
||||
}
|
||||
|
||||
function html_footer ()
|
||||
{
|
||||
print "</body>"
|
||||
print "</html>"
|
||||
}
|
||||
|
||||
function html_fnc_header (fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
{
|
||||
print "<tr class=\"function_table_header\">"
|
||||
if (fname_p)
|
||||
{
|
||||
# Function name
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print ""
|
||||
print "</td>"
|
||||
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "Function Name"
|
||||
print "</td>"
|
||||
}
|
||||
if (mcyclo_p)
|
||||
{
|
||||
# Modified cyclo
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "Modified Cyclo"
|
||||
print "</td>"
|
||||
}
|
||||
if (cyclo_p)
|
||||
{
|
||||
# Cyclo
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "Cyclomatic"
|
||||
print "<br/>"
|
||||
print "Complexity"
|
||||
print "</td>"
|
||||
}
|
||||
if (num_statements_p)
|
||||
{
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "Number of"
|
||||
print "<br/>"
|
||||
print "Statements"
|
||||
print "</td>"
|
||||
}
|
||||
if (num_lines_p)
|
||||
{
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "Number of"
|
||||
print "<br/>"
|
||||
print "Lines"
|
||||
print "</td>"
|
||||
}
|
||||
if (first_line_p)
|
||||
{
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "First Line"
|
||||
print "</td>"
|
||||
}
|
||||
if (file_p)
|
||||
{
|
||||
print "<td class=\"function_table_header_entry\">"
|
||||
print "Source File"
|
||||
print "</td>"
|
||||
|
||||
}
|
||||
print "</tr>"
|
||||
}
|
||||
|
||||
function html_fnc (nfun,
|
||||
fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
{
|
||||
fname = fnames[nfun]
|
||||
|
||||
# Function name
|
||||
trclass = "function_entry_simple"
|
||||
if (mcyclo[nfun] > cyclo_high_max)
|
||||
{
|
||||
trclass="function_entry_untestable"
|
||||
}
|
||||
else if (mcyclo[nfun] > cyclo_moderate_max)
|
||||
{
|
||||
trclass="function_entry_high"
|
||||
}
|
||||
else if (mcyclo[nfun] > cyclo_simple_max)
|
||||
{
|
||||
trclass="function_entry_moderate"
|
||||
}
|
||||
|
||||
print "<tr class=\"" trclass "\">"
|
||||
if (fname_p)
|
||||
{
|
||||
print "<td class=\"function_entry_filename\">"
|
||||
if (file_p && mcyclo[nfun] > cyclo_simple_max)
|
||||
{
|
||||
print "<a href=\"javascript:void(0);\" title=\"show/hide function source\" onClick=\"javascript:show_hide('" fname "_src', '" fname "_button')\">\
|
||||
<span id=\"" fname "_button\">↓</span></a>"
|
||||
}
|
||||
else
|
||||
{
|
||||
print " "
|
||||
}
|
||||
print "</td>"
|
||||
|
||||
print "<td class=\"function_entry_name\">"
|
||||
print fname
|
||||
print "</td>"
|
||||
}
|
||||
if (mcyclo_p)
|
||||
{
|
||||
# Modified cyclo
|
||||
print "<td class=\"function_entry_cyclo\">"
|
||||
print mcyclo[nfun]
|
||||
print "</td>"
|
||||
}
|
||||
if (cyclo_p)
|
||||
{
|
||||
# Cyclo
|
||||
print "<td class=\"function_entry_cyclo\">"
|
||||
print cyclo[nfun]
|
||||
print "</td>"
|
||||
}
|
||||
if (num_statements_p)
|
||||
{
|
||||
# Number of statements
|
||||
print "<td class=\"function_entry_number\">"
|
||||
print num_statements[nfun]
|
||||
print "</td>"
|
||||
}
|
||||
if (num_lines_p)
|
||||
{
|
||||
# Number of lines
|
||||
print "<td class=\"function_entry_number\">"
|
||||
print num_lines[nfun]
|
||||
print "</td>"
|
||||
}
|
||||
if (first_line_p)
|
||||
{
|
||||
# First line
|
||||
print "<td class=\"function_entry_number\">"
|
||||
print first_line[nfun]
|
||||
print "</td>"
|
||||
}
|
||||
if (file_p)
|
||||
{
|
||||
href = ""
|
||||
if (source_file_link_tmpl != "")
|
||||
{
|
||||
# Get href target
|
||||
href = source_file_link_tmpl
|
||||
sub(/%FILENAME%/, file[nfun], href)
|
||||
}
|
||||
|
||||
# Source file
|
||||
print "<td class=\"function_entry_filename\">"
|
||||
if (href != "")
|
||||
{
|
||||
print "<a href=\"" href "\">" file[nfun] "</a>"
|
||||
}
|
||||
else
|
||||
{
|
||||
print file[nfun]
|
||||
}
|
||||
|
||||
print "</td>"
|
||||
|
||||
|
||||
print "</tr>"
|
||||
|
||||
if (mcyclo[nfun] > cyclo_simple_max)
|
||||
{
|
||||
print "<tr>"
|
||||
|
||||
num_columns = 1;
|
||||
if (fname_p) { num_columns++ }
|
||||
if (mcyclo_p) { num_columns++ }
|
||||
if (cyclo_p) { num_columns++ }
|
||||
if (num_statements_p) { num_columns++ }
|
||||
if (num_lines_p) { num_columns++ }
|
||||
if (first_line_p) { num_columns++ }
|
||||
if (file_p) { num_columns++ }
|
||||
|
||||
print "<td colspan=\"" num_columns "\" height=\"0\">"
|
||||
print "<div id=\"" fname "_src\" class=\"function_src\" style=\"position: relative; display: none;\">"
|
||||
print "<pre class=\"function_src\">"
|
||||
|
||||
while ((getline codeline < (fname nfun "_fn.txt")) > 0)
|
||||
{
|
||||
gsub(/&/, "\\&", codeline) # Must come first.
|
||||
gsub(/</, "\\<", codeline)
|
||||
gsub(/>/, "\\>", codeline)
|
||||
|
||||
print codeline
|
||||
}
|
||||
close(fname nfun "_fn.txt")
|
||||
system("rm " "'" fname "'" nfun "_fn.txt")
|
||||
print "</pre>"
|
||||
print "</div>"
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function html_global_stats ()
|
||||
{
|
||||
print "<div class=\"section_title\">Summary</div>"
|
||||
|
||||
print "<table class=\"summary_table\">"
|
||||
# Total number of functions
|
||||
print "<tr>"
|
||||
print "<td class=\"summary_header_entry\">"
|
||||
print "Total number of functions"
|
||||
print "</td>"
|
||||
print "<td class=\"summary_number_entry\">"
|
||||
print num_of_functions
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Number of simple functions
|
||||
print "<tr>"
|
||||
print "<td class=\"summary_header_entry\">"
|
||||
print "Number of low risk functions"
|
||||
print "</td>"
|
||||
print "<td class=\"summary_number_entry\">"
|
||||
print num_of_simple_functions
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Number of moderate functions
|
||||
print "<tr>"
|
||||
print "<td class=\"summary_header_entry\">"
|
||||
print "Number of moderate risk functions"
|
||||
print "</td>"
|
||||
print "<td class=\"summary_number_entry\">"
|
||||
print num_of_moderate_functions
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Number of high functions
|
||||
print "<tr>"
|
||||
print "<td class=\"summary_header_entry\">"
|
||||
print "Number of high risk functions"
|
||||
print "</td>"
|
||||
print "<td class=\"summary_number_entry\">"
|
||||
print num_of_high_functions
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Number of untestable functions
|
||||
print "<tr>"
|
||||
print "<td class=\"summary_header_entry\">"
|
||||
print "Number of untestable functions"
|
||||
print "</td>"
|
||||
print "<td class=\"summary_number_entry\">"
|
||||
print num_of_untestable_functions
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
print "</table>"
|
||||
print "<br/>"
|
||||
}
|
||||
|
||||
function html_function_cyclo ()
|
||||
{
|
||||
print "<div class=\"section_title\">Details for all functions</div>"
|
||||
|
||||
print "<table class=\"ranges_table\">"
|
||||
print "<tr>"
|
||||
print "<td class=\"ranges_header_entry\">"
|
||||
print " "
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_header_entry\">"
|
||||
print "Cyclomatic Complexity"
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_header_entry\">"
|
||||
print "Risk Evaluation"
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Simple
|
||||
print "<tr>"
|
||||
print "<td class=\"ranges_entry_simple\">"
|
||||
print " "
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print "0 - " cyclo_simple_max
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print "Simple module, without much risk"
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Moderate
|
||||
print "<tr>"
|
||||
print "<td class=\"ranges_entry_moderate\">"
|
||||
print " "
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print cyclo_simple_max + 1 " - " cyclo_moderate_max
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print "More complex module, moderate risk"
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# High
|
||||
print "<tr>"
|
||||
print "<td class=\"ranges_entry_high\">"
|
||||
print " "
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print cyclo_moderate_max + 1 " - " cyclo_high_max
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print "Complex module, high risk"
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
# Untestable
|
||||
print "<tr>"
|
||||
print "<td class=\"ranges_entry_untestable\">"
|
||||
print " "
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print "greater than " cyclo_high_max
|
||||
print "</td>"
|
||||
print "<td class=\"ranges_entry\">"
|
||||
print "Untestable module, very high risk"
|
||||
print "</td>"
|
||||
print "</tr>"
|
||||
print "</table>"
|
||||
print "<br/>"
|
||||
html_fnc_table_complete("")
|
||||
}
|
||||
|
||||
function wiki_global_stats ()
|
||||
{
|
||||
print "{| class=\"cyclo_summary_table\""
|
||||
# Total number of functions
|
||||
print "|-"
|
||||
print "| class=\"cyclo_summary_header_entry\" | Total number of functions"
|
||||
print "| class=\"cyclo_summary_number_entry\" |" num_of_functions
|
||||
# Number of simple functions
|
||||
print "|-"
|
||||
print "| class=\"cyclo_summary_header_entry\" | Number of low risk functions"
|
||||
print "| class=\"cyclo_summary_number_entry\" |" num_of_simple_functions
|
||||
# Number of moderate functions
|
||||
print "|-"
|
||||
print "| class=\"cyclo_summary_header_entry\" | Number of moderate risk functions"
|
||||
print "| class=\"cyclo_summary_number_entry\" |" num_of_moderate_functions
|
||||
# Number of high functions
|
||||
print "|-"
|
||||
print "| class=\"cyclo_summary_header_entry\" | Number of high risk functions"
|
||||
print "| class=\"cyclo_summary_number_entry\" |" num_of_high_functions
|
||||
# Number of untestable functions
|
||||
print "|-"
|
||||
print "| class=\"cyclo_summary_header_entry\" | Number of untestable functions"
|
||||
print "| class=\"cyclo_summary_number_entry\" |" num_of_untestable_functions
|
||||
print "|}"
|
||||
}
|
||||
|
||||
function wiki_function_cyclo ()
|
||||
{
|
||||
print "==Details for all functions=="
|
||||
|
||||
print "Used ranges:"
|
||||
|
||||
print "{| class =\"cyclo_ranges_table\""
|
||||
print "|-"
|
||||
print "| class=\"cyclo_ranges_header_entry\" | "
|
||||
print "| class=\"cyclo_ranges_header_entry\" | Cyclomatic Complexity"
|
||||
print "| class=\"cyclo_ranges_header_entry\" | Risk Evaluation"
|
||||
# Simple
|
||||
print "|-"
|
||||
print "| class=\"cyclo_ranges_entry_simple\" | "
|
||||
print "| class=\"cyclo_ranges_entry\" | 0 - " cyclo_simple_max
|
||||
print "| class=\"cyclo_ranges_entry\" | Simple module, without much risk"
|
||||
# Moderate
|
||||
print "|-"
|
||||
print "| class=\"cyclo_ranges_entry_moderate\" | "
|
||||
print "| class=\"cyclo_ranges_entry\" |" cyclo_simple_max + 1 " - " cyclo_moderate_max
|
||||
print "| class=\"cyclo_ranges_entry\" | More complex module, moderate risk"
|
||||
# High
|
||||
print "|-"
|
||||
print "| class=\"cyclo_ranges_entry_high\" | "
|
||||
print "| class=\"cyclo_ranges_entry\" |" cyclo_moderate_max + 1 " - " cyclo_high_max
|
||||
print "| class=\"cyclo_ranges_entry\" | Complex module, high risk"
|
||||
# Untestable
|
||||
print "|-"
|
||||
print "| class=\"cyclo_ranges_entry_untestable\" | "
|
||||
print "| class=\"cyclo_ranges_entry\" | greater than " cyclo_high_max
|
||||
print "| class=\"cyclo_ranges_entry\" | Untestable module, very high risk"
|
||||
print "|}"
|
||||
|
||||
print ""
|
||||
print ""
|
||||
wiki_fnc_table_complete("")
|
||||
}
|
||||
|
||||
function wiki_fnc_table_complete (caption)
|
||||
{
|
||||
wiki_fnc_table(caption, 1, 1, 0, 1, 1, 0, 1)
|
||||
}
|
||||
|
||||
function wiki_fnc_table_abbrev (caption)
|
||||
{
|
||||
wiki_fnc_table(caption, 1, 0, 0, 0, 0, 0, 0)
|
||||
}
|
||||
|
||||
function wiki_fnc_table (caption,
|
||||
fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
{
|
||||
print "{| width=\"90%\" class=\"cyclo_function_table\" cellpadding=\"0\" cellspacing=\"0\">"
|
||||
if (caption != "")
|
||||
{
|
||||
print "|+" caption
|
||||
}
|
||||
wiki_fnc_header(fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
for (nfnc = 1; nfnc <= nfuncs; nfnc++)
|
||||
{
|
||||
wiki_fnc(nfnc,
|
||||
fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
}
|
||||
print "|}"
|
||||
}
|
||||
|
||||
function wiki_fnc_header (fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
{
|
||||
if (fname_p)
|
||||
{
|
||||
# Function name
|
||||
print "! class=\"cyclo_function_table_header_entry\" | Function Name"
|
||||
}
|
||||
if (mcyclo_p)
|
||||
{
|
||||
# Modified cyclo
|
||||
print "! class=\"cyclo_function_table_header_entry\" | Modified Cyclo"
|
||||
}
|
||||
if (cyclo_p)
|
||||
{
|
||||
# Cyclo
|
||||
print "! class=\"cyclo_function_table_header_entry\" | Cyclomatic Complexity"
|
||||
}
|
||||
if (num_statements_p)
|
||||
{
|
||||
print "! class=\"cyclo_function_table_header_entry\" | Number of Statements"
|
||||
}
|
||||
if (num_lines_p)
|
||||
{
|
||||
print "! class=\"cyclo_function_table_header_entry\" | Number of Lines"
|
||||
}
|
||||
if (first_line_p)
|
||||
{
|
||||
print "! class=\"cyclo_function_table_header_entry\" | First Line"
|
||||
}
|
||||
if (file_p)
|
||||
{
|
||||
print "! class=\"cyclo_function_table_header_entry\" | Source File"
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_fnc (nfnc,
|
||||
fname_p,
|
||||
mcyclo_p,
|
||||
cyclo_p,
|
||||
num_statements_p,
|
||||
num_lines_p,
|
||||
first_line_p,
|
||||
file_p)
|
||||
{
|
||||
fname = fnames[nfnc]
|
||||
|
||||
# Function name
|
||||
trclass = "cyclo_function_entry_simple"
|
||||
if (mcyclo[nfnc] > cyclo_high_max)
|
||||
{
|
||||
trclass="cyclo_function_entry_untestable"
|
||||
}
|
||||
else if (mcyclo[nfnc] > cyclo_moderate_max)
|
||||
{
|
||||
trclass="cyclo_function_entry_high"
|
||||
}
|
||||
else if (mcyclo[nfnc] > cyclo_simple_max)
|
||||
{
|
||||
trclass="cyclo_function_entry_moderate"
|
||||
}
|
||||
|
||||
print "|- class=\"" trclass "\""
|
||||
if (fname_p)
|
||||
{
|
||||
print "| class=\"cyclo_function_entry_name\" |" fname
|
||||
}
|
||||
if (mcyclo_p)
|
||||
{
|
||||
# Modified cyclo
|
||||
print "| class=\"cyclo_function_entry_cyclo\" |" mcyclo[nfnc]
|
||||
}
|
||||
if (cyclo_p)
|
||||
{
|
||||
# Cyclo
|
||||
print "| class=\"cyclo_function_entry_cyclo\" |" cyclo[nfnc]
|
||||
}
|
||||
if (num_statements_p)
|
||||
{
|
||||
# Number of statements
|
||||
print "| class=\"cyclo_function_entry_number\" |" num_statements[nfnc]
|
||||
}
|
||||
if (num_lines_p)
|
||||
{
|
||||
# Number of lines
|
||||
print "| class=\"cyclo_function_entry_number\" |" num_lines[nfnc]
|
||||
}
|
||||
if (first_line_p)
|
||||
{
|
||||
# First line
|
||||
print "| class=\"cyclo_function_entry_number\" |" first_line[nfnc]
|
||||
}
|
||||
if (file_p)
|
||||
{
|
||||
href = ""
|
||||
if (source_file_link_tmpl != "")
|
||||
{
|
||||
# Get href target
|
||||
href = source_file_link_tmpl
|
||||
sub(/%FILENAME%/, file[nfnc], href)
|
||||
}
|
||||
|
||||
# Source file
|
||||
print "| class=\"cyclo_function_entry_filename\" |" \
|
||||
((href != "") ? "[" href " " file[nfnc] "]" : "[" file[nfnc] "]")
|
||||
}
|
||||
}
|
||||
|
||||
# Scan data from a line
|
||||
{
|
||||
function_name = $7
|
||||
|
||||
nfuncs++;
|
||||
fnames[nfuncs] = function_name
|
||||
mcyclo[nfuncs] = $1
|
||||
cyclo[nfuncs] = $2
|
||||
num_statements[nfuncs] = $3
|
||||
first_line[nfuncs] = $4
|
||||
num_lines[nfuncs] = $5
|
||||
|
||||
# Build the filename from the file_spec ($6)
|
||||
begin_util_path = index($6, cut_dir)
|
||||
tmpfilename = substr($6, begin_util_path + length(cut_dir))
|
||||
sub(/\([0-9]+\):/, "", tmpfilename)
|
||||
file[nfuncs] = tmpfilename
|
||||
|
||||
if (mcyclo[nfuncs] > cyclo_simple_max)
|
||||
{
|
||||
# Extract function contents to a fn_txt file
|
||||
filepath = $6
|
||||
|
||||
sub(/\([0-9]+\):/, "", filepath)
|
||||
num_line = 0
|
||||
|
||||
while ((getline codeline < filepath) > 0)
|
||||
{
|
||||
num_line++;
|
||||
if ((num_line >= first_line[nfuncs]) &&
|
||||
(num_line < first_line[nfuncs] + num_lines[nfuncs]))
|
||||
{
|
||||
print codeline > (function_name nfuncs "_fn.txt")
|
||||
}
|
||||
}
|
||||
close (function_name nfuncs "_fn.txt")
|
||||
close(filepath)
|
||||
}
|
||||
|
||||
# Initial values for statistics variables
|
||||
num_of_functions = 0
|
||||
max_mcyclo = 0
|
||||
max_function_length = 0
|
||||
num_of_simple_functions = 0
|
||||
num_of_moderate_functions = 0
|
||||
num_of_high_functions = 0
|
||||
num_of_untestable_functions = 0
|
||||
}
|
||||
|
||||
# Epilogue
|
||||
END {
|
||||
# Print header (only for html)
|
||||
if (output_lang == "html")
|
||||
{
|
||||
html_header()
|
||||
}
|
||||
|
||||
# Print prolog
|
||||
if ((output_lang == "html") &&
|
||||
(html_prolog != ""))
|
||||
{
|
||||
print html_prolog
|
||||
}
|
||||
if ((output_lang == "wiki") &&
|
||||
(wiki_prolog != ""))
|
||||
{
|
||||
print wiki_prolog
|
||||
}
|
||||
|
||||
if (output_lang == "html")
|
||||
{
|
||||
print "<div class=\"page_title\">" package_name " Cyclomatic Complexity Report</div>"
|
||||
print "<p>Report generated at: <span class=\"report_timestamp\">" chronos_time "</span></p>"
|
||||
}
|
||||
if (output_lang == "wiki")
|
||||
{
|
||||
print "==" package_name " Cyclomatic Complexity Report=="
|
||||
print "Report generated at: '''" chronos_time "'''"
|
||||
}
|
||||
|
||||
if (section_global_stats_p)
|
||||
{
|
||||
build_stats()
|
||||
|
||||
if (output_lang == "html")
|
||||
{
|
||||
html_global_stats()
|
||||
}
|
||||
if (output_lang == "wiki")
|
||||
{
|
||||
wiki_global_stats()
|
||||
}
|
||||
}
|
||||
if (section_function_cyclo_p)
|
||||
{
|
||||
if (output_lang == "html")
|
||||
{
|
||||
html_function_cyclo()
|
||||
}
|
||||
if (output_lang == "wiki")
|
||||
{
|
||||
wiki_function_cyclo()
|
||||
}
|
||||
}
|
||||
|
||||
# Print epilog
|
||||
if ((output_lang == "html") &&
|
||||
(html_epilog != ""))
|
||||
{
|
||||
print html_epilog
|
||||
}
|
||||
if ((output_lang == "wiki") &&
|
||||
(wiki_epilog != ""))
|
||||
{
|
||||
print wiki_epilog
|
||||
}
|
||||
|
||||
# Print footer (html only)
|
||||
if (output_lang == "html")
|
||||
{
|
||||
html_footer()
|
||||
}
|
||||
}
|
||||
|
||||
# End of pmccabe2html
|
||||
@@ -0,0 +1,510 @@
|
||||
# Makefile for PO directory in any package using GNU gettext.
|
||||
# Copyright (C) 1995-2000 Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
# Copyright (C) 2000-2020, 2024 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 any warranty.
|
||||
#
|
||||
# Origin: gettext-0.21
|
||||
GETTEXT_MACRO_VERSION = 0.20
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
||||
SED = @SED@
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
localedir = @localedir@
|
||||
gettextsrcdir = $(datadir)/gettext/po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
# We use $(mkdir_p).
|
||||
# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
|
||||
# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
|
||||
# @install_sh@ does not start with $(SHELL), so we add it.
|
||||
# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
|
||||
# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
|
||||
# versions, $(mkinstalldirs) and $(install_sh) are unused.
|
||||
mkinstalldirs = $(SHELL) @install_sh@ -d
|
||||
install_sh = $(SHELL) @install_sh@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
mkdir_p = @mkdir_p@
|
||||
|
||||
# When building gettext-tools, we prefer to use the built programs
|
||||
# rather than installed programs. However, we can't do that when we
|
||||
# are cross compiling.
|
||||
CROSS_COMPILING = @CROSS_COMPILING@
|
||||
|
||||
GMSGFMT_ = @GMSGFMT@
|
||||
GMSGFMT_no = @GMSGFMT@
|
||||
GMSGFMT_yes = @GMSGFMT_015@
|
||||
GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
|
||||
XGETTEXT_ = @XGETTEXT@
|
||||
XGETTEXT_no = @XGETTEXT@
|
||||
XGETTEXT_yes = @XGETTEXT_015@
|
||||
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_UPDATE = @MSGMERGE@ --update
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
MSGINIT = msginit
|
||||
MSGCONV = msgconv
|
||||
MSGFILTER = msgfilter
|
||||
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
UPDATEPOFILES = @UPDATEPOFILES@
|
||||
DUMMYPOFILES = @DUMMYPOFILES@
|
||||
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
|
||||
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
|
||||
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
|
||||
$(POFILES) $(GMOFILES) \
|
||||
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
|
||||
POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
|
||||
POFILESDEPS_yes = $(POFILESDEPS_)
|
||||
POFILESDEPS_no =
|
||||
POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
|
||||
|
||||
DISTFILESDEPS_ = update-po
|
||||
DISTFILESDEPS_yes = $(DISTFILESDEPS_)
|
||||
DISTFILESDEPS_no =
|
||||
DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
|
||||
|
||||
# Makevars gets inserted here. (Don't remove this line!)
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update
|
||||
|
||||
# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs.
|
||||
# The GNU Coding Standards say in
|
||||
# <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>:
|
||||
# "GNU distributions usually contain some files which are not source files
|
||||
# ... . Since these files normally appear in the source directory, they
|
||||
# should always appear in the source directory, not in the build directory.
|
||||
# So Makefile rules to update them should put the updated files in the
|
||||
# source directory."
|
||||
# Therefore we put these files in the source directory, not the build directory.
|
||||
|
||||
# During .po -> .gmo conversion, take into account the most recent changes to
|
||||
# the .pot file. This eliminates the need to update the .po files when the
|
||||
# .pot file has changed, which would be troublesome if the .po files are put
|
||||
# under version control.
|
||||
$(GMOFILES): $(srcdir)/$(DOMAIN).pot
|
||||
.po.gmo:
|
||||
@lang=`echo $* | sed -e 's,.*/,,'`; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \
|
||||
cd $(srcdir) && \
|
||||
rm -f $${lang}.gmo && \
|
||||
$(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \
|
||||
$(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \
|
||||
mv t-$${lang}.gmo $${lang}.gmo && \
|
||||
rm -f $${lang}.1po
|
||||
|
||||
.sin.sed:
|
||||
sed -e '/^#/d' $< > t-$@
|
||||
mv t-$@ $@
|
||||
|
||||
|
||||
all-yes: $(srcdir)/stamp-po
|
||||
all-no:
|
||||
|
||||
# Ensure that the gettext macros and this Makefile.in.in are in sync.
|
||||
CHECK_MACRO_VERSION = \
|
||||
test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
|
||||
|| { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
|
||||
exit 1; \
|
||||
}
|
||||
|
||||
# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
|
||||
# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
|
||||
# we don't want to bother translators with empty POT files). We assume that
|
||||
# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
|
||||
# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target).
|
||||
|
||||
# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS
|
||||
# have been loosely updated. Its purpose is that when a developer or translator
|
||||
# checks out the package from a version control system, and the $(DOMAIN).pot
|
||||
# file is not under version control, "make" will update the $(DOMAIN).pot and
|
||||
# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This
|
||||
# timestamp would not be necessary if updating the $(CATALOGS) would always
|
||||
# touch them; however, the rule for $(POFILES) has been designed to not touch
|
||||
# files that don't need to be changed.
|
||||
$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot
|
||||
@$(CHECK_MACRO_VERSION)
|
||||
test ! -f $(srcdir)/$(DOMAIN).pot || \
|
||||
test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
|
||||
@test ! -f $(srcdir)/$(DOMAIN).pot || { \
|
||||
echo "touch $(srcdir)/stamp-po" && \
|
||||
echo timestamp > $(srcdir)/stamp-poT && \
|
||||
mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \
|
||||
}
|
||||
|
||||
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
|
||||
# otherwise packages like GCC can not be built if only parts of the source
|
||||
# have been downloaded.
|
||||
|
||||
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
|
||||
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
|
||||
# The determination of whether the package xyz is a GNU one is based on the
|
||||
# heuristic whether some file in the top level directory mentions "GNU xyz".
|
||||
# If GNU 'find' is available, we avoid grepping through monster files.
|
||||
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
||||
package_gnu="$(PACKAGE_GNU)"; \
|
||||
test -n "$$package_gnu" || { \
|
||||
if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
|
||||
LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
|
||||
else \
|
||||
LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
|
||||
fi; \
|
||||
} | grep -v 'libtool:' >/dev/null; then \
|
||||
package_gnu=yes; \
|
||||
else \
|
||||
package_gnu=no; \
|
||||
fi; \
|
||||
}; \
|
||||
if test "$$package_gnu" = "yes"; then \
|
||||
package_prefix='GNU '; \
|
||||
else \
|
||||
package_prefix=''; \
|
||||
fi; \
|
||||
if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
|
||||
msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
|
||||
else \
|
||||
msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
|
||||
fi; \
|
||||
case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
|
||||
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
|
||||
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
|
||||
--add-comments=TRANSLATORS: \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)' \
|
||||
--msgid-bugs-address="$$msgid_bugs_address" \
|
||||
$(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
|
||||
;; \
|
||||
*) \
|
||||
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
|
||||
--add-comments=TRANSLATORS: \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)' \
|
||||
--package-name="$${package_prefix}@PACKAGE@" \
|
||||
--package-version='@VERSION@' \
|
||||
--msgid-bugs-address="$$msgid_bugs_address" \
|
||||
$(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
|
||||
;; \
|
||||
esac
|
||||
test ! -f $(DOMAIN).po || { \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot-header; then \
|
||||
sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \
|
||||
cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \
|
||||
rm -f $(DOMAIN).1po \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
|
||||
sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
|
||||
if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
|
||||
rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
|
||||
else \
|
||||
rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
|
||||
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
|
||||
fi; \
|
||||
else \
|
||||
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
|
||||
fi; \
|
||||
}
|
||||
|
||||
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
|
||||
# every "make" invocation, only create it when it is missing.
|
||||
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
|
||||
$(srcdir)/$(DOMAIN).pot:
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
|
||||
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
|
||||
# Note that a PO file is not touched if it doesn't need to be changed.
|
||||
$(POFILES): $(POFILESDEPS)
|
||||
@test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot
|
||||
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
|
||||
if test -f "$(srcdir)/$${lang}.po"; then \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \
|
||||
cd $(srcdir) \
|
||||
&& { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
|
||||
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \
|
||||
$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
|
||||
0.1[6-7] | 0.1[6-7].*) \
|
||||
$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \
|
||||
*) \
|
||||
$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \
|
||||
esac; \
|
||||
}; \
|
||||
else \
|
||||
$(MAKE) $${lang}.po-create; \
|
||||
fi
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
|
||||
for file in $(DISTFILES.common) Makevars.template; do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file \
|
||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
for file in Makevars; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkdir_p) $(DESTDIR)$$dir; \
|
||||
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
|
||||
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
|
||||
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
|
||||
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
if test -n "$$lc"; then \
|
||||
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
|
||||
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
|
||||
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
|
||||
for file in *; do \
|
||||
if test -f $$file; then \
|
||||
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
|
||||
fi; \
|
||||
done); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
else \
|
||||
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
fi; \
|
||||
fi; \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
|
||||
ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
|
||||
cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
|
||||
fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
install-strip: install
|
||||
|
||||
installdirs: installdirs-exec installdirs-data
|
||||
installdirs-exec:
|
||||
installdirs-data: installdirs-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
installdirs-data-no:
|
||||
installdirs-data-yes:
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkdir_p) $(DESTDIR)$$dir; \
|
||||
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
if test -n "$$lc"; then \
|
||||
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
|
||||
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
|
||||
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
|
||||
for file in *; do \
|
||||
if test -f $$file; then \
|
||||
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
|
||||
fi; \
|
||||
done); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
else \
|
||||
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall: uninstall-exec uninstall-data
|
||||
uninstall-exec:
|
||||
uninstall-data: uninstall-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
for file in $(DISTFILES.common) Makevars.template; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
uninstall-data-no:
|
||||
uninstall-data-yes:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
done; \
|
||||
done
|
||||
|
||||
check: all
|
||||
|
||||
info dvi ps pdf html tags TAGS ctags CTAGS ID:
|
||||
|
||||
install-dvi install-ps install-pdf install-html:
|
||||
|
||||
mostlyclean:
|
||||
rm -f remove-potcdate.sed
|
||||
rm -f $(srcdir)/stamp-poT
|
||||
rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES)
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir:
|
||||
test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
|
||||
@$(MAKE) dist2
|
||||
# This is a separate target because 'update-po' must be executed before.
|
||||
dist2: $(srcdir)/stamp-po $(DISTFILES)
|
||||
@dists="$(DISTFILES)"; \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
dists="$$dists Makevars.template"; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
dists="$$dists $(DOMAIN).pot stamp-po"; \
|
||||
else \
|
||||
case $(XGETTEXT) in \
|
||||
:) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \
|
||||
*) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \
|
||||
esac; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/ChangeLog; then \
|
||||
dists="$$dists ChangeLog"; \
|
||||
fi; \
|
||||
for i in 0 1 2 3 4 5 6 7 8 9; do \
|
||||
if test -f $(srcdir)/ChangeLog.$$i; then \
|
||||
dists="$$dists ChangeLog.$$i"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
|
||||
for file in $$dists; do \
|
||||
if test -f $$file; then \
|
||||
cp -p $$file $(distdir) || exit 1; \
|
||||
else \
|
||||
cp -p $(srcdir)/$$file $(distdir) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
|
||||
$(MAKE) update-gmo
|
||||
|
||||
# General rule for creating PO files.
|
||||
|
||||
.nop.po-create:
|
||||
@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
|
||||
echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
|
||||
exit 1
|
||||
|
||||
# General rule for updating PO files.
|
||||
|
||||
.nop.po-update:
|
||||
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
|
||||
if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \
|
||||
tmpdir=`pwd`; \
|
||||
echo "$$lang:"; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
|
||||
cd $(srcdir); \
|
||||
if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
|
||||
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \
|
||||
$(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
|
||||
0.1[6-7] | 0.1[6-7].*) \
|
||||
$(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
|
||||
*) \
|
||||
$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
|
||||
esac; \
|
||||
}; then \
|
||||
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
else \
|
||||
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
|
||||
:; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed!" 1>&2; \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
fi
|
||||
|
||||
$(DUMMYPOFILES):
|
||||
|
||||
update-gmo: Makefile $(GMOFILES)
|
||||
@:
|
||||
|
||||
# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
|
||||
# because execution permission bits may not work on the current file system.
|
||||
# Use @SHELL@, which is the shell determined by autoconf for the use by its
|
||||
# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
|
||||
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
|
||||
cd $(top_builddir) \
|
||||
&& @SHELL@ ./config.status $(subdir)/$@.in po-directories
|
||||
|
||||
force:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,25 @@
|
||||
# Sed script that removes the POT-Creation-Date line in the header entry
|
||||
# from a POT file.
|
||||
#
|
||||
# Copyright (C) 2002, 2020-2024 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 any warranty.
|
||||
#
|
||||
# The distinction between the first and the following occurrences of the
|
||||
# pattern is achieved by looking at the hold space.
|
||||
/^"POT-Creation-Date: .*"$/{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/P/P/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Remove the line.
|
||||
g
|
||||
d
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user