initial commit
[glibc.git] / debian / patches / all / local-remove-manual.diff
1 The GNU Libc Reference manual has to be removed for licensing reasons.
2 But some files have a dependency on manual/errno.texi; the easiest
3 solution is to drop those dependencies and make sure that MAKEINFO=:
4 so that no target depends on manual/*.texi files.
5
6 ---
7 manual/Makefile | 182 +++++++++++++++++++++++++++++++++++++++++++++
8 stdio-common/Makefile | 2
9 sysdeps/mach/hurd/Makefile | 2
10 3 files changed, 184 insertions(+), 2 deletions(-)
11
12 --- /dev/null
13 +++ b/manual/Makefile
14 @@ -0,0 +1,182 @@
15 +# Copyright (C) 1992-2012
16 +# Free Software Foundation, Inc.
17 +# This file is part of the GNU C Library.
18 +
19 +# The GNU C Library is free software; you can redistribute it and/or
20 +# modify it under the terms of the GNU Lesser General Public
21 +# License as published by the Free Software Foundation; either
22 +# version 2.1 of the License, or (at your option) any later version.
23 +
24 +# The GNU C Library is distributed in the hope that it will be useful,
25 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
26 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 +# Lesser General Public License for more details.
28 +
29 +# You should have received a copy of the GNU Lesser General Public
30 +# License along with the GNU C Library; if not, see
31 +# <http://www.gnu.org/licenses/>.
32 +
33 +# Makefile for the GNU C Library manual.
34 +
35 +subdir := manual
36 +
37 +# Allow override
38 +INSTALL_INFO = install-info
39 +
40 +.PHONY: dvi pdf info html
41 +
42 +# Get glibc's configuration info.
43 +include ../Makeconfig
44 +
45 +dvi: $(objpfx)libc.dvi
46 +pdf: $(objpfx)libc.pdf
47 +
48 +TEXI2DVI = texi2dvi
49 +TEXI2PDF = texi2dvi --pdf
50 +
51 +ifneq ($(strip $(MAKEINFO)),:)
52 +info: $(objpfx)libc.info
53 +endif
54 +
55 +chapters = $(addsuffix .texi, \
56 + intro errno memory ctype string charset locale \
57 + message search pattern io stdio llio filesys \
58 + pipe socket terminal syslog math arith time \
59 + resource setjmp signal startup process job nss \
60 + users sysinfo conf crypt debug)
61 +add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi))
62 +appendices = lang.texi header.texi install.texi maint.texi platform.texi \
63 + contrib.texi
64 +licenses = freemanuals.texi lgpl-2.1.texi fdl-1.3.texi
65 +
66 +-include $(objpfx)texis
67 +$(objpfx)texis: texis.awk $(chapters) $(add-chapters) $(appendices) $(licenses)
68 + $(make-target-directory)
69 + $(AWK) -f $^ > $@.T
70 + mv -f $@.T $@
71 +
72 +nonexamples = $(filter-out $(add-chapters) %.c.texi, $(texis))
73 +examples = $(filter-out $(foreach d, $(add-ons), ../$d/%.c.texi), \
74 + $(filter %.c.texi, $(texis)))
75 +
76 +# Generated files directly included from libc.texinfo.
77 +libc-texi-generated = chapters.texi top-menu.texi dir-add.texi \
78 + libm-err.texi version.texi
79 +
80 +# Add path to build dir for generated files
81 +texis-path := $(filter-out $(libc-texi-generated) summary.texi $(examples), \
82 + $(texis)) \
83 + $(addprefix $(objpfx),$(filter $(libc-texi-generated) summary.texi \
84 + $(examples), $(texis)))
85 +
86 +# Kludge: implicit rule so Make knows the one command does it all.
87 +chapters.% top-menu.%: libc-texinfo.sh $(texis-path) Makefile
88 + AWK=$(AWK) $(SHELL) $< $(objpfx) \
89 + '$(chapters)' \
90 + '$(add-chapters)' \
91 + '$(appendices) $(licenses)'
92 +
93 +
94 +$(objpfx)libc.dvi $(objpfx)libc.pdf $(objpfx)libc.info: \
95 + $(addprefix $(objpfx),$(libc-texi-generated))
96 +$(objpfx)libc.dvi $(objpfx)libc.pdf: texinfo.tex
97 +
98 +html: $(objpfx)libc/index.html
99 +$(objpfx)libc/index.html: $(addprefix $(objpfx),$(libc-texi-generated))
100 + $(MAKEINFO) -P $(objpfx) -o $(objpfx)libc --html libc.texinfo
101 +
102 +# Generate the summary from the Texinfo source files for each chapter.
103 +$(objpfx)summary.texi: $(objpfx)stamp-summary ;
104 +$(objpfx)stamp-summary: summary.awk $(filter-out $(objpfx)summary.texi, \
105 + $(texis-path))
106 + $(AWK) -f $^ | sort -t'\f' -df -k 1,1 | tr '\014' '\012' \
107 + > $(objpfx)summary-tmp
108 + $(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi
109 + touch $@
110 +
111 +# Generate a file which can be added to the `dir' content to provide direct
112 +# access to the documentation of the function, variables, and other
113 +# definitions.
114 +$(objpfx)dir-add.texi: xtract-typefun.awk $(texis-path)
115 + (echo "@dircategory GNU C library functions and macros"; \
116 + echo "@direntry"; \
117 + $(AWK) -f $^ | sort; \
118 + echo "@end direntry") > $@.new
119 + mv -f $@.new $@
120 +
121 +# The table with the math errors is generated.
122 +$(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
123 +$(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
124 + $(dir)/libm-test-ulps))
125 + pwd=`pwd`; \
126 + $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
127 + $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
128 + touch $@
129 +
130 +# Generate a file with the version number.
131 +$(objpfx)version.texi: $(objpfx)stamp-version ;
132 +$(objpfx)stamp-version: $(common-objpfx)config.make
133 + echo "@set VERSION $(version)" > $(objpfx)version-tmp
134 + $(move-if-change) $(objpfx)version-tmp $(objpfx)version.texi
135 + touch $@
136 +
137 +# Generate Texinfo files from the C source for the example programs.
138 +$(objpfx)%.c.texi: examples/%.c
139 + sed -e '1,/^\*\/$$/d' \
140 + -e 's,[{}],@&,g' \
141 + -e 's,/\*\(@.*\)\*/,\1,g' \
142 + -e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \
143 + -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g'\
144 + $< | expand > $@.new
145 + mv -f $@.new $@
146 +
147 +$(objpfx)%.info: %.texinfo
148 + LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $<
149 +
150 +$(objpfx)%.dvi: %.texinfo
151 + cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \
152 + $(shell cd $(<D) && pwd)/$<
153 +
154 +$(objpfx)%.pdf: %.texinfo
155 + cd $(objpfx);$(TEXI2PDF) -I $(shell cd $(<D) && pwd) --output=$@ \
156 + $(shell cd $(<D) && pwd)/$<
157 +
158 +
159 +# Distribution.
160 +minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \
161 + libm-err.texi stamp-libm-err \
162 + $(filter-out summary.texi, $(nonexamples)) \
163 + $(patsubst %.c.texi,examples/%.c, $(examples))
164 +
165 +indices = cp fn pg tp vr ky
166 +generated-dirs := libc
167 +generated = libc.dvi libc.pdf libc.tmp libc.info* \
168 + stubs \
169 + texis summary.texi stamp-summary *.c.texi \
170 + $(foreach index,$(indices),libc.$(index) libc.$(index)s) \
171 + libc.log libc.aux libc.toc \
172 + $(libc-texi-generated) \
173 + stamp-libm-err stamp-version
174 +
175 +include ../Rules
176 +
177 +.PHONY: install subdir_install install-data
178 +install-data subdir_install: install
179 +ifneq ($(strip $(MAKEINFO)),:)
180 +install: $(inst_infodir)/libc.info
181 + @if $(SHELL) -c '$(INSTALL_INFO) --version' >/dev/null 2>&1; then \
182 + test -f $(inst_infodir)/dir || $(INSTALL_DATA) dir $(inst_infodir);\
183 + $(INSTALL_INFO) --info-dir=$(inst_infodir) $(inst_infodir)/libc.info;\
184 + else : ; fi
185 +endif
186 +# Catchall implicit rule for other installation targets from the parent.
187 +install-%: ;
188 +
189 +$(inst_infodir)/libc.info: $(objpfx)libc.info
190 + $(make-target-directory)
191 + for file in $<*; do \
192 + $(INSTALL_DATA) $$file $(@D)/; \
193 + done
194 +
195 +TAGS: $(minimal-dist)
196 + $(ETAGS) -o $@ $^
197 --- a/stdio-common/Makefile
198 +++ b/stdio-common/Makefile
199 @@ -251,7 +251,7 @@
200 # generated
201 endif # $(run-built-tests)
202
203 -tests-special += $(objpfx)tst-errno-manual.out
204 +# tests-special += $(objpfx)tst-errno-manual.out
205
206 include ../Rules
207
208 --- a/sysdeps/mach/hurd/Makefile
209 +++ b/sysdeps/mach/hurd/Makefile
210 @@ -88,7 +88,7 @@
211 -e 's, \.\./, $(..),g' > $@t
212 mv -f $@t $@
213
214 -$(hurd)/bits/errno.h: $(common-objpfx)stamp-errnos ;
215 +$(hurd)/bits/errno-disabled.h: $(common-objpfx)stamp-errnos ;
216 $(common-objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
217 $(mach-errnos-deps) $(common-objpfx)errnos.d
218 mkdir -p $(hurd-objpfx)bits