1

I had asked a similar thing for GDB at: How to build the GDB documentation from source? , and it changed my life, now I want the same for GCC!

I managed to build the docs on Ubuntu 16.04 and gcc 6.4.0 source tree (to match my host) with:

./contrib/download_prerequisites
./configure
make
host-x86_64-pc-linux-gnu/gcc
make html
xdg-open HTML/gcc-6.4.0/gcc/index.html

But I could not make it put everything into a single page, I tried:

make html MAKEINFO=makeinfo MAKEINFOFLAGS='--no-split'

but it does not work as for binutils.

If I don't build GCC itself first, and do just make html directly, it fails with:

checking for x86_64-pc-linux-gnu-gcc... /data/git/gcc/host-x86_64-pc-linux-gnu/gcc/xgcc -B/data/git/gcc/host-x86_64-pc-linux-gnu/gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/
local/x86_64-pc-linux-gnu/sys-include   
checking for C compiler default output file name... 
configure: error: in `/data/git/gcc/x86_64-pc-linux-gnu/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.
Makefile:24442: recipe for target 'configure-target-libgomp' failed
make[1]: *** [configure-target-libgomp] Error 1
make[1]: Leaving directory '/data/git/gcc'
Makefile:1268: recipe for target 'do-html' failed
make: *** [do-html] Error 2

The problem is that the file:

host-x86_64-pc-linux-gnu/gcc/xgcc

does not exist, I wonder why it is needed since all I want is to build the docs.

I would like to obtain the docs available at: https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gcc/ and hopefully other manuals listed at https://gcc.gnu.org/onlinedocs/ such as CPP manual, each of them as a single HTML page that I can Ctrl + F easily on.

Ciro Santilli OurBigBook.com
  • 18,092
  • 4
  • 117
  • 102

1 Answers1

1

this worked for me:

git clone git://gcc.gnu.org/git/gcc.git gcc
cd gcc/gcc
./configure
make gcc-vers.texi
mkdir HTML
makeinfo --html --no-split -Idoc -Idoc/include -o HTML doc/gcc.texi

Same for gccint.html, cpp.html, etc. gcc's makefiles ignore the MAKEINFOFLAGS variable.

  • Thanks, this worked for gcc. I couldn't get it to work for libstdc++-v3 though, but it is already a big progress. – Ciro Santilli OurBigBook.com Jan 08 '19 at 11:45
  • 1
    It seems that libstdc++ docs aren't built from Texinfo at all, but from DocBook via XSLT which is a completely different problem. (probably installing docbook-utils and then using docbook2html -u should do it, but I haven't tried it). –  Jan 08 '19 at 17:50
  • This answer appears to be broken with gcc I just cloned from git: the gcc-vers.texi target does not exist, and make html in general seems to not have made any HTML gcc docs at all even after having built gcc prior – Yet Another User Feb 25 '21 at 14:54
  • @YetAnotherUser that's because you ran those commands in the top directory, not in the gcc subdirectory, as I did in my answer (cd /path/to/gcc-8.2.0/gcc). I'll update it with the whole recipe, starting with cloning the repository from scratch ;-) –  Feb 26 '21 at 15:53