Skip to content

Commit 6ba7c11

Browse files
author
Erlang/OTP
committed
Merge branch 'ta/doc-fakefop' into dev
* ta/doc-fakefop: Build placeholder PDF files if FOP is not found OTP-8559 ta/doc-fakefop If the 'fop' program (needed for building PDF files) cannot not be found, it is now possible to build the HTML and man pages anyway (there will also be dummy PDF files with no real content created).
2 parents 2e4e428 + bdb41b9 commit 6ba7c11

File tree

3 files changed

+125
-3
lines changed

3 files changed

+125
-3
lines changed

configure.in

+9-1
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,18 @@ if test -f "erts/doc/CONF_INFO"; then
386386
echo '*********************************************************************'
387387
echo
388388
printf "%-15s: \n" documentation;
389+
havexsltproc="yes"
389390
for cmd in `cat erts/doc/CONF_INFO`; do
390391
echo " $cmd is missing."
392+
if test $cmd = "xsltproc"; then
393+
havexsltproc="no"
394+
fi
391395
done
392-
echo ' The documentation can not be built.'
396+
if test $havexsltproc = "no"; then
397+
echo ' The documentation can not be built.'
398+
else
399+
echo ' Using fakefop to generate placeholder PDF files.'
400+
fi
393401
echo
394402
echo '*********************************************************************'
395403
fi

erts/configure.in

+3-2
Original file line numberDiff line numberDiff line change
@@ -821,13 +821,14 @@ fi
821821
AC_CHECK_PROGS(XSLTPROC, xsltproc)
822822
if test -z "$XSLTPROC"; then
823823
echo "xsltproc" >> doc/CONF_INFO
824-
AC_MSG_WARN([No 'xsltproc' command found: the documentation can not be built])
824+
AC_MSG_WARN([No 'xsltproc' command found: the documentation cannot be built])
825825
fi
826826

827827
AC_CHECK_PROGS(FOP, fop)
828828
if test -z "$FOP"; then
829+
FOP="$ERL_TOP/make/fakefop"
829830
echo "fop" >> doc/CONF_INFO
830-
AC_MSG_WARN([No 'fop' command found: the documentation can not be built])
831+
AC_MSG_WARN([No 'fop' command found: going to generate placeholder PDF files])
831832
fi
832833

833834
dnl

make/fakefop

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#!/bin/sh
2+
#
3+
# Copyright Tuncer Ayaz 2010. All Rights Reserved.
4+
#
5+
# %CopyrightBegin%
6+
#
7+
# Copyright Ericsson AB 2010. All Rights Reserved.
8+
#
9+
# The contents of this file are subject to the Erlang Public License,
10+
# Version 1.1, (the "License"); you may not use this file except in
11+
# compliance with the License. You should have received a copy of the
12+
# Erlang Public License along with this software. If not, it can be
13+
# retrieved online at http://www.erlang.org/.
14+
#
15+
# Software distributed under the License is distributed on an "AS IS"
16+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17+
# the License for the specific language governing rights and limitations
18+
# under the License.
19+
#
20+
# %CopyrightEnd%
21+
#
22+
# Author: Tuncer Ayaz
23+
#
24+
25+
if [ $# -lt 4 ]
26+
then
27+
echo "Usage: fakefop -fo IGNORED -pdf OUTFILE"
28+
exit 1
29+
fi
30+
31+
OUTFILE=$4
32+
NAME=`basename $4 .pdf`
33+
34+
echo Write $OUTFILE
35+
cat > $OUTFILE <<EndOfFile
36+
%PDF-1.4
37+
1 0 obj
38+
<< /Type /Catalog
39+
/Outlines 2 0 R
40+
/Pages 3 0 R
41+
>>
42+
endobj
43+
44+
2 0 obj
45+
<< /Type /Outlines
46+
/Count 0
47+
>>
48+
endobj
49+
50+
3 0 obj
51+
<< /Type /Pages
52+
/Kids [4 0 R]
53+
/Count 1
54+
>>
55+
endobj
56+
57+
4 0 obj
58+
<< /Type /Page
59+
/Parent 3 0 R
60+
/MediaBox [0 0 612 492]
61+
/Contents 5 0 R
62+
/Resources << /ProcSet 6 0 R
63+
/Font << /F1 7 0 R >>
64+
>>
65+
>>
66+
endobj
67+
68+
5 0 obj
69+
<< /Length 73 >>
70+
stream
71+
BT
72+
/F1 24 Tf
73+
10 400 Td
74+
($NAME) Tj
75+
ET
76+
BT
77+
/F1 24 Tf
78+
10 350 Td
79+
(\(placeholder PDF generated without FOP\)) Tj
80+
ET
81+
endstream
82+
endobj
83+
84+
6 0 obj
85+
[/PDF /Text]
86+
endobj
87+
7 0 obj
88+
<< /Type /Font
89+
/Subtype /Type1
90+
/Name /F1
91+
/BaseFont /Helvetica
92+
/Encoding /MacRomanEncoding
93+
>>
94+
endobj
95+
xref
96+
0 8
97+
0000000000 65535 f
98+
0000000009 00000 n
99+
0000000074 00000 n
100+
0000000120 00000 n
101+
0000000179 00000 n
102+
0000000364 00000 n
103+
0000000466 00000 n
104+
0000000496 00000 n
105+
106+
trailer
107+
<< /Size 8
108+
/Root 1 0 R
109+
>>
110+
startxref
111+
625
112+
%%EOF
113+
EndOfFile

0 commit comments

Comments
 (0)