4 echo "build_html.sh [-Dh?]"
5 echo " -l Specify language"
6 echo " -D Enable simple debugging of this script"
9 echo "Build the html version of the manual, including both the single"
10 echo "page version and the multi-page version. This also builds all the"
11 echo "category information."
15 while getopts "h?Dl:" arg
18 l
) language
=$OPTARG ;;
26 if [ "x$language" = "x" ]
29 languagedir
=@abs_srcdir@
31 texiinitfile
=$pwd/texi2html.init
33 languagedir
=@abs_srcdir@
/$language
35 if [ "$language" = "pt_BR" ]
38 texiinitfile
=$pwd/..
/texi2html.init
41 echo "$0: abs_srcdir=@abs_srcdir@, pwd=$pwd, language=$language, languagedir=$languagedir, texiinitfile=$texiinitfile"
43 includerfile
=include-maxima.texi
45 # Extract all filenames that are included using @include commands in the order
47 includedfiles
=`@AWK@ '/^[[:space:]]*@include/ { print $NF; }' $includerfile`
49 # If output dir exists, remove it so we start clean
50 if [ -d tmp_html
]; then
54 cp -r @abs_srcdir@
/figures tmp_html
55 # "make distcheck" write-protects the source tree. We don't want our
56 # figures to inherit that attribute as we want to delete the temp folder
60 cat include-maxima.texi
> tmp_html
/include-maxima.texi
64 for f
in $includedfiles
66 # Find the absolute path of the current element of $includedfiles
67 if [ -e $languagedir/$f ]
68 then includedfile_absolute
=$languagedir/$f
69 else if [ -e @abs_srcdir@
/$f ]
70 then includedfile_absolute
=@abs_srcdir@
/$f
71 else if [ -e ..
/..
/$f ]
72 then includedfile_absolute
=..
/..
/$f
74 then includedfile_absolute
=..
/$f
76 includedfile_absolute
=`pwd`/..
/$f
82 if [ -e $includedfile_absolute ]
84 if [ "X$DEBUG" = "Xyes" ]; then
85 echo "Taking the file $f from the path $includedfile_absolute"
88 echo Error
: File
$f cannot be found.
92 filenamebase
=`echo $includedfile_absolute | @SED@ -e 's/^.*\///;s/\.texi//'`
93 @SED@
-e 's/^@deffnx* *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: '$filenamebase'\/deffn\/\1}\
95 -e 's/^@defvrx* *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: '$filenamebase'\/defvr\/\1}\
97 -e 's/^@node *\([^,]*\).*/@anchor{Item: '$filenamebase'\/node\/\1}\
98 &/' $includedfile_absolute \
99 | @AWK@
'BEGIN { iftex = 0; } /^@iftex/ {iftex = 1;} {if (!iftex) {print;}} /^@end iftex/ {iftex = 0;}' \
100 | @AWK@
'/@anchor/ {if (!(foo[$0])) {foo[$0] = 1; print;}} !/@anchor/' > $
(basename $includedfile_absolute)
103 catprogname
=make-categories.lisp
106 filenamebase
=`echo $f | @SED@ -e 's/^.*\///;s/\.texi//'`
107 echo "(setq *filenamebase* \"$filenamebase\")"
109 done | @AWK@
'!/^@c / && !/^@c$/ && (/^@deffn/ || /^@defvr/ || /^@end deffn/ || /^@end defvr/ || /@category/ || /@node/ || /^.setq .filenamebase/)' | @SED@
-f @abs_srcdir@
/extract_categories1.
sed | @AWK@
-f @abs_srcdir@
/extract_categories1.
awk > $catprogname
111 if [ "@DEFAULTLISP@" = "gcl" ]
112 then lispprog
="@GCL_NAME@"
113 lispargs
="-batch -load $catprogname"
114 elif [ "@DEFAULTLISP@" = "clisp" ]
115 then lispprog
="@CLISP_NAME@"
116 lispargs
="$catprogname"
117 elif [ "@DEFAULTLISP@" = "cmucl" ]
118 then lispprog
="@CMUCL_NAME@"
119 lispargs
="-load $catprogname -eval (quit)"
120 elif [ "@DEFAULTLISP@" = "scl" ]
121 then lispprog
="@SCL_NAME@"
122 lispargs
="-load $catprogname -eval (quit)"
123 elif [ "@DEFAULTLISP@" = "ecl" ]
124 then lispprog
="@ECL_NAME@"
125 lispargs
="--shell $catprogname"
126 elif [ "@DEFAULTLISP@" = "ccl64" ]
127 then lispprog
="@CCL64_NAME@"
128 lispargs
="--load $catprogname --eval (quit)"
129 # NOT SURE ABOUT OPENMCL; SAME ARGS AS CCL/CCL64 OR DIFFERENT ??
130 elif [ "@DEFAULTLISP@" = "ccl" -o "@DEFAULTLISP@" = "openmcl" ]
131 then lispprog
="@OPENMCL_NAME@"
132 lispargs
="--load $catprogname --eval (quit)"
133 elif [ "@DEFAULTLISP@" = "sbcl" ]
134 then lispprog
="@SBCL_NAME@"
135 lispargs
="--script $catprogname"
136 elif [ "@DEFAULTLISP@" = "abcl" ]
137 then lispprog
="@JRE@"
138 lispargs
="-jar @ABCL_JAR@ --load $catprogname --eval (quit)"
139 elif [ "@DEFAULTLISP@" = "acl" ]
140 then lispprog
="@ACL_NAME@"
141 lispargs
="-L $catprogname --kill"
143 echo "$0: DEFAULTLISP = @DEFAULTLISP@ not recognized, assume '@DEFAULTLISP@ $catprogname' is acceptable."
144 lispprog
="@DEFAULTLISP@"
145 lispargs
="$catprogname"
148 echo "$0: execute category program: \"$lispprog\" $lispargs"
149 "$lispprog" $lispargs
151 @SED@
-e 's/^@bye/@node Documentation Categories, , Function and Variable Index\n@chapter Documentation Categories/' $languagedir/maxima.texi
> maxima.texi
153 # Add all Category-*.texi files to maxima.texi.
154 # If there aren't any the file named "Category-*.texi" cannot be found
155 # and therefore will be excluded by the 'if'.
156 ( for f
in Category-
*.texi
; do
164 if [ "X$DEBUG" = "Xyes" ]; then
168 # --no-node-files so we don't have thousands of little html files
169 # --force -e 10000 because the category stuff causes lots of errors.
170 TEXIOPT
="--html -c INLINE_CONTENTS=0 -c OUTPUT_ENCODING_NAME=UTF-8 --force -e 10000 --document-lang=$language -I . -I $languagedir -I ../.. --css-include=@abs_srcdir@/manual.css -I @abs_srcdir@/figures --init-file $texiinitfile"
171 makeinfo
--split=chapter
--no-node-files --output="$languagedestdir" $TEXIOPT maxima.texi
172 makeinfo
--no-split --output="$languagedestdir/maxima_singlepage.html" $TEXIOPT maxima.texi
174 if [ "X$DEBUG" = "Xyes" ]; then
180 if [ "X$DEBUG" != "Xyes" ]; then