Skip to content

Commit bdb41b9

Browse files
author
Tuncer Ayaz
committed
Build placeholder PDF files if FOP is not found
If FOP is not found create PDF files with fakefop script. Signed-off-by: Tuncer Ayaz <tuncer.ayaz@gmail.com>
1 parent 39e0191 commit bdb41b9

3 files changed

Lines changed: 111 additions & 3 deletions

File tree

configure.in

Lines changed: 9 additions & 1 deletion
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/bin/sh
2+
#
3+
# Copyright Tuncer Ayaz 2010. All Rights Reserved.
4+
#
5+
# %CopyrightBegin%
6+
# %CopyrightEnd%
7+
#
8+
# Author: Tuncer Ayaz
9+
#
10+
11+
if [ $# -lt 4 ]
12+
then
13+
echo "Usage: fakefop -fo IGNORED -pdf OUTFILE"
14+
exit 1
15+
fi
16+
17+
OUTFILE=$4
18+
NAME=`basename $4 .pdf`
19+
20+
echo Write $OUTFILE
21+
cat > $OUTFILE <<EndOfFile
22+
%PDF-1.4
23+
1 0 obj
24+
<< /Type /Catalog
25+
/Outlines 2 0 R
26+
/Pages 3 0 R
27+
>>
28+
endobj
29+
30+
2 0 obj
31+
<< /Type /Outlines
32+
/Count 0
33+
>>
34+
endobj
35+
36+
3 0 obj
37+
<< /Type /Pages
38+
/Kids [4 0 R]
39+
/Count 1
40+
>>
41+
endobj
42+
43+
4 0 obj
44+
<< /Type /Page
45+
/Parent 3 0 R
46+
/MediaBox [0 0 612 492]
47+
/Contents 5 0 R
48+
/Resources << /ProcSet 6 0 R
49+
/Font << /F1 7 0 R >>
50+
>>
51+
>>
52+
endobj
53+
54+
5 0 obj
55+
<< /Length 73 >>
56+
stream
57+
BT
58+
/F1 24 Tf
59+
10 400 Td
60+
($NAME) Tj
61+
ET
62+
BT
63+
/F1 24 Tf
64+
10 350 Td
65+
(\(placeholder PDF generated without FOP\)) Tj
66+
ET
67+
endstream
68+
endobj
69+
70+
6 0 obj
71+
[/PDF /Text]
72+
endobj
73+
7 0 obj
74+
<< /Type /Font
75+
/Subtype /Type1
76+
/Name /F1
77+
/BaseFont /Helvetica
78+
/Encoding /MacRomanEncoding
79+
>>
80+
endobj
81+
xref
82+
0 8
83+
0000000000 65535 f
84+
0000000009 00000 n
85+
0000000074 00000 n
86+
0000000120 00000 n
87+
0000000179 00000 n
88+
0000000364 00000 n
89+
0000000466 00000 n
90+
0000000496 00000 n
91+
92+
trailer
93+
<< /Size 8
94+
/Root 1 0 R
95+
>>
96+
startxref
97+
625
98+
%%EOF
99+
EndOfFile

0 commit comments

Comments
 (0)