0

I downloaded an archive with the gcc info manual from an official page. Extracting the archive leads to not a single .texi file, but a very complex directory structure when many many .texi files. I'm not sure how to actually convert these to a single .info file (so that I can install-info that into my emacs info directory /usr/share/info, I know how to do that).

It is completely non-obvious to me how to get a .info file from this directory with many many .texi files. From the top-level directory that got extracted, I went to gcc/doc and then found (among about 30 other texi files) a file called gcc.texi. Trying makeinfo gcc.texi made it complain that gcc.texi:25: @include: could not find gcc-common.texi, even though that file is in gcc/doc/include.

What is the command I'm supposed to be using to build this?

0

I don't think there is a simple straightforward way to extract just the code you want and then run that independently of the Makefile (which is generated from Makefile.in when you run ./configure etc to build the entire GCC package). If you genuinely need to build locally, follow the package's standard build instructions.

In some more detail, Makefile.in contains the following snippets;

info: do-info

# Make sure makeinfo is built before we do a `make info', if we're
# in fact building texinfo.
do-info: maybe-all-texinfo

install-info: do-install-info dir.info
    s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
    if [ -f dir.info ]; then \
      $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
    else true; fi
#...
.PHONY: all-texinfo maybe-all-texinfo
maybe-all-texinfo:
@if gcc-bootstrap
all-texinfo: stage_current
@endif gcc-bootstrap
@if texinfo
TARGET-texinfo=all
maybe-all-texinfo: all-texinfo
all-texinfo: configure-texinfo
    @: $(MAKE); $(unstage)
    @r=`${PWD_COMMAND}`; export r; \
    s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
    $(HOST_EXPORTS)  \
    (cd $(HOST_SUBDIR)/texinfo && \
      $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS)  \
        $(TARGET-texinfo))
@endif texinfo
#...
.PHONY: do-install-info
do-install-info:
    @: $(MAKE); $(unstage)
    @r=`${PWD_COMMAND}`; export r; \
    s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
    $(MAKE) $(RECURSE_FLAGS_TO_PASS) install-info-host \
      install-info-target


.PHONY: install-info-host

install-info-host: maybe-install-info-bfd
install-info-host: maybe-install-info-opcodes
install-info-host: maybe-install-info-binutils
install-info-host: maybe-install-info-bison

The definition proceeds with a very long list of individual targets, and I didn't follow through to the end.

0
0

OP here, here's a hack that solves the issue, at least for the 8.3.0 version of the standalone texinfo sources downloaded from the link in the OP:

TLDR:

Step 1: In the docs folder which contains gcc.texi, open the file install.texi2html using a text editor, and remove the final line that says rm $DESTDIR/gcc-vers.texi.

Step 2: run the script using `./install.texi2html

Step 3: run makeinfo gcc.texi -P ./HTML -P ./include

Step 4: read the manual using info gcc.info, or from emacs, do C-u F1 i then path/to/gcc.info

Explanation:

it appears the issue is that the standalone texinfo sources tarballs listed on the gcc onlinedocs page do not contain any Makefiles. It appears that the gcc maintainers simply didn't worry too much about making the standalone info manuals easy to compile.

Here's a hack to get it to work (this worked for me for the gcc 8.3 texinfo sources):

First, go to gcc/gcc/docs from where we extracted the archive. We will see gcc.texi, a directory named include, and some other .texi files. If we tried to do makeinfo gcc.texi now, we will get many complaints about things like gcc-common.texi not found. Those missing files happen to be in the include directory, so we add that to the search path using the -P option:

makeinfo gcc.texi -P ./include 

However, we will get a complaint about a missing gcc-vers.info. That file is nowhere to be found, but was intended to be generated automatically by autogen when the full gcc source tree (not just the texi sources) is configured and built. However, we are in luck, because in the same directory as gcc.texi, there's a script called install.texi2html. At the end of the script, we see the line:

rm $DESTDIR/gcc-vers.texi

This means that the script is actually generating the file we need, but then deleting it. Hence, simply remove that line from the script, run it again, and we'll see HTML/gcc-vers.texi. Then we can add the HTML directory to the path, and this time gcc.texi builds correctly.

By the way, most of the .texi files are actually subnodes. Fortunately, they are easily identified by a comment near the beginning of each file. To filter them out (by that comment) and see a list of toplevel node files, do

grep -L '@c This is part of the' *.texi

The resulting files are

ppinternals.texi
cpp.texi
gccint.texi
gcc.texi
install.texi
poly-int.texi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.