1#!/bin/sh
2#
3# Convert the GCC install documentation from texinfo format to HTML.
4#
5# $SOURCEDIR and $DESTDIR, resp., refer to the directory containing
6# the texinfo source and the directory to put the HTML version in.
7#
8# Copyright (C) 2001-2020 Free Software Foundation, Inc.
9# Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, June 2001.
10#
11# This file is part of GCC.
12#
13# GCC is free software; you can redistribute it and/or modify it under
14# the terms of the GNU General Public License as published by the Free
15# Software Foundation; either version 3, or (at your option) any later
16# version.
17#
18# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
19# WARRANTY; without even the implied warranty of MERCHANTABILITY or
20# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21# for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with GCC; see the file COPYING3.  If not see
25# <http://www.gnu.org/licenses/>.
26
27set -e
28
29SOURCEDIR=${SOURCEDIR-.}
30DESTDIR=${DESTDIR-HTML}
31
32MAKEINFO=${MAKEINFO-makeinfo}
33
34if [ ! -d $DESTDIR ]; then
35    mkdir -p $DESTDIR
36fi
37
38# Generate gcc-vers.texi.
39(
40   echo "@set version-GCC $(cat $SOURCEDIR/../BASE-VER)"
41   if [ "$(cat $SOURCEDIR/../DEV-PHASE)" = "experimental" ]; then
42      echo "@set DEVELOPMENT"
43   else
44      echo "@clear DEVELOPMENT"
45   fi
46   echo "@set srcdir $SOURCEDIR/.."
47) > $DESTDIR/gcc-vers.texi
48
49for x in index.html specific.html prerequisites.html download.html configure.html \
50         build.html test.html finalinstall.html binaries.html old.html \
51         gfdl.html
52do
53    define=`echo $x | sed -e 's/\.//g'`
54    echo "define = $define"
55    $MAKEINFO --no-number-sections -I $SOURCEDIR -I $SOURCEDIR/include -I $DESTDIR $SOURCEDIR/install.texi --html --no-split -D$define -o$DESTDIR/temp.html
56    # Use sed to work around makeinfo 4.7 brokenness.
57    sed -e 's/_002d/-/g' -e 's/_002a/*/g' $DESTDIR/temp.html > $DESTDIR/$x
58    rm $DESTDIR/temp.html
59done
60
61rm $DESTDIR/gcc-vers.texi
62