2016-01-07 16:51:53 +08:00
|
|
|
#!/bin/sh
|
1998-07-13 20:29:13 +08:00
|
|
|
|
2012-05-15 03:45:48 +08:00
|
|
|
OUTDIR=$1
|
|
|
|
shift
|
|
|
|
|
1998-07-13 20:29:13 +08:00
|
|
|
# Create libc.texinfo from the chapter files.
|
|
|
|
|
2012-05-15 03:45:48 +08:00
|
|
|
trap "rm -f ${OUTDIR}*.$$; exit 1" 1 2 15
|
1998-07-17 20:36:43 +08:00
|
|
|
|
2012-05-15 03:45:48 +08:00
|
|
|
exec 3>${OUTDIR}incl.$$ 4>${OUTDIR}smenu.$$ 5>${OUTDIR}lmenu.$$
|
1998-07-17 20:36:43 +08:00
|
|
|
|
|
|
|
build_menu () {
|
|
|
|
while IFS=: read file node; do
|
|
|
|
echo "@include $file" >&3
|
|
|
|
echo "* $node:: `sed -n 's/^@c %MENU% //p' $file`" >&4
|
|
|
|
$AWK 'BEGIN { do_menu = 0 }
|
|
|
|
/^@node / { sub(/^@node /, ""); sub(/,.*$/, ""); node = $0 }
|
|
|
|
/^@menu/ { printf "\n%s\n\n", node; do_menu = 1; next }
|
|
|
|
/^@end menu/ { do_menu = 0 }
|
|
|
|
do_menu { print }' $file >&5
|
|
|
|
done
|
|
|
|
}
|
1998-07-13 20:29:13 +08:00
|
|
|
|
1998-07-17 20:36:43 +08:00
|
|
|
collect_nodes () {
|
2022-06-06 03:09:02 +08:00
|
|
|
grep -E '^(@c )?@node.*Top' "$@" /dev/null | cut -d, -f-2 |
|
1999-01-07 17:55:57 +08:00
|
|
|
sed 's/@c //; s/, /:/; s/:@node /:/; s/ /_/g; s/:/ /g' |
|
1998-07-17 20:36:43 +08:00
|
|
|
$AWK '{ file[$2] = $1; nnode[$2] = $3 }
|
|
|
|
END { for (x in file)
|
|
|
|
if (file[x] != "")
|
|
|
|
print file[x] ":" x, file[nnode[x]] ":" nnode[x] }' |
|
1999-01-18 17:38:36 +08:00
|
|
|
$AWK -f tsort.awk | sed 's/_/ /g'
|
1998-07-13 20:29:13 +08:00
|
|
|
}
|
|
|
|
|
1998-07-17 20:36:43 +08:00
|
|
|
collect_nodes $1 | build_menu
|
|
|
|
|
|
|
|
{ echo; echo 'Appendices'; echo; } >&4
|
|
|
|
|
Remove add-ons mechanism.
glibc has an add-ons mechanism to allow additional software to be
integrated into the glibc build. Such add-ons may be within the glibc
source tree, or outside it at a path passed to the --enable-add-ons
configure option.
localedata and crypt were once add-ons, distributed in separate
release tarballs, but long since stopped using that mechanism.
Linuxthreads was always an add-on. Ports spent some time as an add-on
with separate release tarballs, then was first moved into the glibc
source tree, then had its sysdeps files moved into the main sysdeps
hierarchy so the add-ons mechanism was no longer used. NPTL spent
some time as an add-on in the main glibc tree before stopping using
the add-on mechanism. libidn used to have separate release tarballs
but no longer does so, but still uses the add-ons mechanism within the
glibc source tree. Various other software has supported building with
the add-ons mechanism at times in the past, but I don't think any is
still widely used.
Add-ons involve significant, little-used complexity in the glibc build
system, and make it hard to understand what the space of possible
glibc configurations is. This patch removes the add-ons mechanism.
libidn is now built via the Subdirs mechanism to cause any
configuration using sysdeps/unix/inet to build libidn; HAVE_LIBIDN
(which effectively means shared libraries are available) is now
defined via sysdeps/unix/inet/configure. Various references to
add-ons around the source tree are removed (in the case of maint.texi,
the example list of sysdeps directories is still very out of date).
Externally maintained ports should now put their files in the normal
sysdeps directory structure rather than being arranged as add-ons;
they probably need to change e.g. elf.h anyway, rather than actually
being able to work just as a drop-in subtree. Hurd libpthread should
be arranged similarly to NPTL, so some files might go in a
hurd-pthreads (or similar) top-level directory in glibc, while sysdeps
files should go in the normal sysdeps directory structure (possibly in
hurd or hurd-pthreads subdirectories, just as there are nptl
subdirectories in the sysdeps tree).
Tested for x86_64, and with build-many-glibcs.py.
* configure.ac (--enable-add-ons): Remove option.
(machine): Do not mention add-ons in comment.
(LIBC_PRECONFIGURE): Likewise.
(add_ons): Remove variable and sanity checks and logic to locate
add-ons.
(add_ons_automatic): Remove variable.
(configured_add_ons): Likewise.
(add_ons_sfx): Likewise.
(add_ons_pfx): Likewise.
(add_on_subdirs): Likewise.
(sysnames_add_ons): Likewise. Remove loop over add-ons and
consideration of add-ons in Implies handling.
(sysdeps_add_ons): Likewise.
* configure: Regenerated.
* libidn/configure.ac: Remove.
* libidn/configure: Likewise.
* sysdeps/unix/inet/configure.ac: New file.
* sysdeps/unix/inet/configure: New generated file.
* sysdeps/unix/inet/Subdirs: Add libidn.
* Makeconfig (sysdeps-srcdirs): Remove variable.
(+sysdep_dirs): Do not include $(sysdeps-srcdirs).
($(common-objpfx)config.status): Do not depend on add-on files.
($(common-objpfx)shlib-versions.v.i): Do not mention add-ons in
comment.
(all-subdirs): Do not include $(add-on-subdirs).
* Makefile (dist-prepare): Do not use $(sysdeps-add-ons).
* config.make.in (add-ons): Remove variable.
(add-on-subdirs): Likewise.
(sysdeps-add-ons): Likewise.
* manual/Makefile (add-chapters): Remove.
($(objpfx)texis): Do not depend on $(add-chapters).
(nonexamples): Do not handle $(add-chapters).
(examples): Do not handle $(add-ons).
(chapters.% top-menu.%): Do not pass '$(add-chapters)' to
libc-texinfo.sh.
* manual/install.texi (Installation): Do not mention add-ons.
(--enable-add-ons): Do not document configure option.
* INSTALL: Regenerated.
* manual/libc-texinfo.sh: Do not handle $2 add-ons argument.
* manual/maint.texi (Hierarchy Conventions): Do not mention
add-ons.
* scripts/build-many-glibcs.py (Glibc.build_glibc): Do not use
--enable-add-ons.
* scripts/gen-sorted.awk: Do not handle Subdirs files from
add-ons.
* scripts/test-installation.pl: Do not handle glibc-compat add-on.
* sysdeps/nptl/Makeconfig: Do not mention add-ons in comment.
2017-10-05 23:58:13 +08:00
|
|
|
collect_nodes $2 | build_menu
|
1998-07-17 20:36:43 +08:00
|
|
|
|
|
|
|
exec 3>&- 4>&- 5>&-
|
1998-07-13 20:29:13 +08:00
|
|
|
|
2012-05-15 03:45:48 +08:00
|
|
|
mv -f ${OUTDIR}incl.$$ ${OUTDIR}chapters.texi
|
1998-07-13 20:29:13 +08:00
|
|
|
|
1998-07-17 20:36:43 +08:00
|
|
|
{
|
|
|
|
echo '@menu'
|
|
|
|
$AWK -F: '
|
|
|
|
/^\*/ {
|
|
|
|
printf("%-32s", $1 "::");
|
|
|
|
x = split($3, word, " ");
|
|
|
|
hpos = 34;
|
|
|
|
for (i = 1; i <= x; i++) {
|
|
|
|
hpos += length(word[i]) + 1;
|
|
|
|
if (hpos > 78) {
|
|
|
|
printf("\n%34s", "");
|
|
|
|
hpos = 35 + length(word[i]);
|
|
|
|
}
|
|
|
|
printf(" %s", word[i]);
|
|
|
|
}
|
|
|
|
print ".";
|
|
|
|
}
|
|
|
|
|
|
|
|
!/^\*/ { print; }
|
2012-05-15 03:45:48 +08:00
|
|
|
' ${OUTDIR}smenu.$$
|
1998-07-13 20:29:13 +08:00
|
|
|
cat <<EOF
|
2001-08-28 16:05:41 +08:00
|
|
|
* Free Manuals:: Free Software Needs Free Documentation.
|
2001-07-06 13:37:16 +08:00
|
|
|
* Copying:: The GNU Lesser General Public License says
|
1998-07-13 20:29:13 +08:00
|
|
|
how you can copy and share the GNU C Library.
|
2001-07-06 17:21:36 +08:00
|
|
|
* Documentation License:: This manual is under the GNU Free
|
|
|
|
Documentation License.
|
1998-07-13 20:29:13 +08:00
|
|
|
|
|
|
|
Indices
|
|
|
|
|
|
|
|
* Concept Index:: Index of concepts and names.
|
|
|
|
* Type Index:: Index of types and type qualifiers.
|
|
|
|
* Function Index:: Index of functions and function-like macros.
|
|
|
|
* Variable Index:: Index of variables and variable-like macros.
|
|
|
|
* File Index:: Index of programs and files.
|
|
|
|
|
2013-02-22 12:45:17 +08:00
|
|
|
@detailmenu
|
1998-07-13 20:29:13 +08:00
|
|
|
--- The Detailed Node Listing ---
|
|
|
|
EOF
|
2012-05-15 03:45:48 +08:00
|
|
|
cat ${OUTDIR}lmenu.$$
|
2013-02-22 12:45:17 +08:00
|
|
|
echo '@end detailmenu'
|
2012-05-15 03:45:48 +08:00
|
|
|
echo '@end menu'; } >${OUTDIR}top-menu.texi.$$
|
|
|
|
mv -f ${OUTDIR}top-menu.texi.$$ ${OUTDIR}top-menu.texi
|
1998-07-13 20:29:13 +08:00
|
|
|
|
2012-05-15 03:45:48 +08:00
|
|
|
rm -f ${OUTDIR}*.$$
|