diff options
author | Martin Liska <mliska@suse.cz> | 2022-11-13 21:59:42 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-11-14 09:35:06 +0100 |
commit | 4e3dcf20763d7d4b2c06553ee14c88b573aabafc (patch) | |
tree | a96d66a1b66aeae1cdda1a33bf9af50e70664452 /gcc | |
parent | ef0879e3b4243293daf7e5dcf2c20e013d1c7037 (diff) | |
download | gcc-4e3dcf20763d7d4b2c06553ee14c88b573aabafc.zip gcc-4e3dcf20763d7d4b2c06553ee14c88b573aabafc.tar.gz gcc-4e3dcf20763d7d4b2c06553ee14c88b573aabafc.tar.bz2 |
Revert "sphinx: support Sphinx in build system"
This reverts commit 41a45cba0021f597dbfdec1f782026215ea21726.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/Makefile.in | 368 | ||||
-rwxr-xr-x | gcc/configure | 28 | ||||
-rw-r--r-- | gcc/configure.ac | 15 | ||||
-rw-r--r-- | gcc/cp/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/d/Make-lang.in | 60 | ||||
-rw-r--r-- | gcc/fortran/Make-lang.in | 105 | ||||
-rw-r--r-- | gcc/genhooks.cc | 235 | ||||
-rw-r--r-- | gcc/go/Make-lang.in | 65 |
8 files changed, 561 insertions, 317 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 92432c3..3491ff6 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -113,6 +113,14 @@ target_objdir := $(toplevel_builddir)/$(target_subdir) # Directory where sources are, from where we are. VPATH = @srcdir@ +# We define a vpath for the sources of the .texi files here because they +# are split between multiple directories and we would rather use one implicit +# pattern rule for everything. +# This vpath could be extended within the Make-lang fragments. + +vpath %.texi $(gcc_docdir) +vpath %.texi $(gcc_docdir)/include + # -------- # UNSORTED # -------- @@ -313,6 +321,13 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL@ install_sh = $(SHELL) $(srcdir)/../install-sh INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +MAKEINFO = @MAKEINFO@ +MAKEINFOFLAGS = --no-split +TEXI2DVI = texi2dvi +TEXI2PDF = texi2pdf +TEXI2HTML = $(MAKEINFO) --html +TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl +POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --date=$(shell sed 's/\(....\)\(..\)\(..\)/\1-\2-\3/' <$(DATESTAMP)) # Some versions of `touch' (such as the version on Solaris 2.8) # do not correctly set the timestamp due to buggy versions of `utime' # in the kernel. So, we use `echo' instead. @@ -763,8 +778,11 @@ LIBCONVERT = # Control whether header files are installed. INSTALL_HEADERS=install-headers install-mkheaders -# Control whether manpages generated by sphinx-build can be rebuilt. -SPHINX_BUILD = @SPHINX_BUILD@ +# Control whether Info documentation is built and installed. +BUILD_INFO = @BUILD_INFO@ + +# Control whether manpages generated by texi2pod.pl can be rebuilt. +GENERATED_MANPAGES = @GENERATED_MANPAGES@ # Additional directories of header files to run fixincludes on. # These should be directories searched automatically by default @@ -888,6 +906,7 @@ PKGVERSION_s:= "\"@PKGVERSION@\"" BUGURL_s := "\"@REPORT_BUGS_TO@\"" PKGVERSION := @PKGVERSION@ +BUGURL_TEXI := @REPORT_BUGS_TEXI@ ifdef REVISION_c REVISION_s := \ @@ -1173,6 +1192,8 @@ FLAGS_TO_PASS = \ "LN=$(LN)" \ "LN_S=$(LN_S)" \ "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ + "MAKEINFO=$(MAKEINFO)" \ + "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \ "MAKEOVERRIDES=" \ "SHELL=$(SHELL)" \ "TFLAGS=$(TFLAGS)" \ @@ -2554,6 +2575,8 @@ s-cfn-operators: build/gencfn-macros$(build_exeext) cfn-operators.pd: s-cfn-operators; @true target-hooks-def.h: s-target-hooks-def-h; @true +# make sure that when we build info files, the used tm.texi is up to date. +$(srcdir)/doc/tm.texi: s-tm-texi; @true s-target-hooks-def-h: build/genhooks$(build_exeext) $(RUN_GEN) build/genhooks$(build_exeext) "Target Hook" \ @@ -2589,20 +2612,38 @@ s-d-target-hooks-def-h: build/genhooks$(build_exeext) d/d-target-hooks-def.h $(STAMP) s-d-target-hooks-def-h -# The tm.rst.in we want to compare against / check into svn should have +# check if someone mistakenly only changed tm.texi. +# We use a different pathname here to avoid a circular dependency. +s-tm-texi: $(srcdir)/doc/../doc/tm.texi + +# The tm.texi we want to compare against / check into svn should have # unix-style line endings. To make this work on MinGW, remove \r. # \r is not portable to Solaris tr, therefore we have a special # case for ASCII. We use \r for other encodings like EBCDIC. -s-tm-rst-in: build/genhooks$(build_exeext) $(srcdir)/doc/gccint/target-macros/tm.rst.in - $(RUN_GEN) build/genhooks$(build_exeext) > tmp-tm.rst.in - $(SHELL) $(srcdir)/../move-if-change tmp-tm.rst.in tm.rst.in - - @if cmp -s $(srcdir)/doc/gccint/target-macros/tm.rst.in tm.rst.in; then \ +s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in + $(RUN_GEN) build/genhooks$(build_exeext) -d \ + $(srcdir)/doc/tm.texi.in > tmp-tm.texi + case `echo X|tr X '\101'` in \ + A) tr -d '\015' < tmp-tm.texi > tmp2-tm.texi ;; \ + *) tr -d '\r' < tmp-tm.texi > tmp2-tm.texi ;; \ + esac + mv tmp2-tm.texi tmp-tm.texi + $(SHELL) $(srcdir)/../move-if-change tmp-tm.texi tm.texi + @if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \ $(STAMP) $@; \ + elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \ + && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \ + || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \ + || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \ + || test $(srcdir)/doc/tm.texi -nt $(srcdir)/d/d-target.def \ + ); then \ + echo >&2 ; \ + echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \ + false; \ else \ echo >&2 ; \ echo Verify that you have permission to grant a GFDL license for all >&2 ; \ - echo new text in $(objdir)/tm.rst.in, then copy it to $(srcdir)/doc/gccint/target-macros/tm.rst.in. >&2 ; \ + echo new text in $(objdir)/tm.texi, then copy it to $(srcdir)/doc/tm.texi. >&2 ; \ false; \ fi @@ -3275,38 +3316,121 @@ install-no-fixedincludes: # Remake the info files. -doc: $(SPHINX_BUILD) +doc: $(BUILD_INFO) $(GENERATED_MANPAGES) -INFOFILES = doc/gcc/info/texinfo/gcc.info \ - doc/gccint/info/texinfo/gccint.info \ - doc/cpp/info/texinfo/cpp.info \ - doc/cppinternals/info/texinfo/cppinternals.info \ - doc/install/info/texinfo/install.info +INFOFILES = doc/cpp.info doc/gcc.info doc/gccint.info \ + doc/gccinstall.info doc/cppinternals.info info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo srcinfo: $(INFOFILES) -cp -p $^ $(srcdir)/doc -PDFFILES = doc/gcc/pdf/latex/gcc.pdf doc/gccint/pdf/latex/gccint.pdf doc/install/pdf/latex/install.pdf \ - doc/cpp/pdf/latex/cpp.pdf doc/cppinternals/pdf/latex/cppinternals.pdf +TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \ + gcc-common.texi gcc-vers.texi + +TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \ + standards.texi invoke.texi extend.texi md.texi objc.texi \ + gcov.texi trouble.texi bugreport.texi service.texi \ + contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \ + fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \ + implement-c.texi implement-cxx.texi gcov-tool.texi gcov-dump.texi \ + lto-dump.texi + +# we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with +# the generated tm.texi; the latter might have a more recent timestamp, +# but we don't want to rebuild the info files unless the contents of +# the *.texi files have changed. +TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \ + contribute.texi makefile.texi configterms.texi options.texi \ + portability.texi interface.texi passes.texi rtl.texi md.texi \ + $(srcdir)/doc/tm.texi hostconfig.texi fragments.texi \ + configfiles.texi collect2.texi headerdirs.texi funding.texi \ + gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \ + sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \ + loop.texi generic.texi gimple.texi plugins.texi optinfo.texi \ + match-and-simplify.texi analyzer.texi ux.texi poly-int.texi + +TEXI_GCCINSTALL_FILES = install.texi fdl.texi \ + gcc-common.texi gcc-vers.texi + +TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi + +# gcc-vers.texi is generated from the version files. +gcc-vers.texi: $(BASEVER) $(DEVPHASE) + (echo "@set version-GCC $(BASEVER_c)"; \ + if [ "$(DEVPHASE_c)" = "experimental" ]; \ + then echo "@set DEVELOPMENT"; \ + else echo "@clear DEVELOPMENT"; \ + fi) > $@T + $(build_file_translate) echo @set srcdir `echo $(abs_srcdir) | sed -e 's|\\([@{}]\\)|@\\1|g'` >> $@T + if [ -n "$(PKGVERSION)" ]; then \ + echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@T; \ + fi + echo "@set BUGURL $(BUGURL_TEXI)" >> $@T; \ + mv -f $@T $@ -pdf:: $(PDFFILES) lang.pdf -doc/gcc/pdf/latex/gcc.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_docdir)/gcc BUILDDIR=$(objdir)/doc/gcc/pdf +# The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit +# patterns. To use them, put each of the specific targets with its +# specific dependencies but no build commands. + +doc/cpp.info: $(TEXI_CPP_FILES) +doc/gcc.info: $(TEXI_GCC_FILES) +doc/gccint.info: $(TEXI_GCCINT_FILES) +doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +doc/%.info: %.texi + if [ x$(BUILD_INFO) = xinfo ]; then \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ + -I $(gcc_docdir)/include -o $@ $<; \ + fi + +# Duplicate entry to handle renaming of gccinstall.info +doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) + if [ x$(BUILD_INFO) = xinfo ]; then \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ + -I $(gcc_docdir)/include -o $@ $<; \ + fi + +doc/cpp.dvi: $(TEXI_CPP_FILES) +doc/gcc.dvi: $(TEXI_GCC_FILES) +doc/gccint.dvi: $(TEXI_GCCINT_FILES) +doc/cppinternals.dvi: $(TEXI_CPPINT_FILES) + +doc/cpp.pdf: $(TEXI_CPP_FILES) +doc/gcc.pdf: $(TEXI_GCC_FILES) +doc/gccint.pdf: $(TEXI_GCCINT_FILES) +doc/cppinternals.pdf: $(TEXI_CPPINT_FILES) + +$(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES) +$(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES) +$(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES) +$(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES) + +DVIFILES = doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \ + doc/cppinternals.dvi + +dvi:: $(DVIFILES) lang.dvi + +doc/%.dvi: %.texi + $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< -doc/gccint/pdf/latex/gccint.pdf: $(SPHINX_FILES) s-tm-rst-in - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_docdir)/gccint BUILDDIR=$(objdir)/doc/gccint/pdf +# Duplicate entry to handle renaming of gccinstall.dvi +doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES) + $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< -doc/install/pdf/latex/install.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_docdir)/install BUILDDIR=$(objdir)/doc/install/pdf +PDFFILES = doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \ + doc/cppinternals.pdf -doc/cpp/pdf/latex/cpp.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_docdir)/cpp BUILDDIR=$(objdir)/doc/cpp/pdf +pdf:: $(PDFFILES) lang.pdf + +doc/%.pdf: %.texi + $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< -doc/cppinternals/pdf/latex/cppinternals.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_docdir)/cppinternals BUILDDIR=$(objdir)/doc/cppinternals/pdf +# Duplicate entry to handle renaming of gccinstall.pdf +doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES) + $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< # List the directories or single hmtl files which are installed by # install-html. The lang.html file triggers language fragments to build @@ -3316,75 +3440,70 @@ HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \ $(build_htmldir)/cppinternals # List the html file targets. -HTMLS = doc/gcc/html/html/index.html doc/gccint/html/html/index.html doc/install/html/html/index.html \ - doc/cpp/html/html/index.html doc/cppinternals/html/html/index.html - -html:: $(HTMLS) lang.html - -doc/gcc/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_docdir)/gcc BUILDDIR=$(objdir)/doc/gcc/html - -doc/gccint/html/html/index.html: $(SPHINX_FILES) s-tm-rst-in - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_docdir)/gccint BUILDDIR=$(objdir)/doc/gccint/html +HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \ + $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \ + $(build_htmldir)/cppinternals/index.html lang.html -doc/install/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_docdir)/install BUILDDIR=$(objdir)/doc/install/html +html:: $(HTMLS_BUILD) -doc/cpp/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_docdir)/cpp BUILDDIR=$(objdir)/doc/cpp/html +$(build_htmldir)/%/index.html: %.texi + $(mkinstalldirs) $(@D) + rm -f $(@D)/* + $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $< -doc/cppinternals/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_docdir)/cppinternals BUILDDIR=$(objdir)/doc/cppinternals/html +# Duplicate entry to handle renaming of gccinstall +$(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES) + $(mkinstalldirs) $(@D) + echo rm -f $(@D)/* + SOURCEDIR=$(abs_docdir) \ + DESTDIR=$(@D) \ + $(SHELL) $(srcdir)/doc/install.texi2html -MANFILES = doc/gcc/man/man/gcc.1 doc/cpp/man/man/cpp.1 \ - doc/gcc/man/man/gfdl.7 doc/gcc/man/man/gpl.7 \ - doc/gcc/man/man/fsf-funding.7 doc/gcc/man/man/gcov-tool.1 \ - doc/gcc/man/man/gcov.1 doc/gcc/man/man/gcov-dump.1 \ - $(if $(filter yes,@enable_lto@),doc/gcc/man/man/lto-dump.1) +MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 \ + doc/fsf-funding.7 doc/gcov-tool.1 doc/gcov-dump.1 \ + $(if $(filter yes,@enable_lto@),doc/lto-dump.1) -export VERSION_PACKAGE=$(PKGVERSION) -export ENABLE_LTO=$(enable_lto) -export BUGURL="$(BUGURL_s)" +generated-manpages: man man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman srcman: $(MANFILES) -cp -p $^ $(srcdir)/doc -sphinx-build: man info - -RST_FILES:=$(shell find $(srcdir) -name *.rst -or -name *.rst.in) -SPHINX_CONFIG_FILES:=$(shell find $(srcdir)/.. -name conf.py) $(srcdir)/../doc/baseconf.py -SPHINX_FILES:=$(RST_FILES) $(SPHINX_CONFIG_FILES) - -doc/gcc/man/man/gcc.1: $(SPHINX_FILES) - + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_docdir)/gcc BUILDDIR=$(objdir)/doc/gcc/man - -doc/gcc/man/man/gcov.1: doc/gcc/man/man/gcc.1 -doc/gcc/man/man/gcov-tool.1: doc/gcc/man/man/gcc.1 -doc/gcc/man/man/gcov-dump.1: doc/gcc/man/man/gcc.1 -doc/gcc/man/man/lto-dump.1: doc/gcc/man/man/gcc.1 -doc/gcc/man/man/gfdl.7: doc/gcc/man/man/gcc.1 -doc/gcc/man/man/gpl.7: doc/gcc/man/man/gcc.1 -doc/gcc/man/man/fsf-funding.7: doc/gcc/man/man/gcc.1 - -doc/cpp/man/man/cpp.1: $(SPHINX_FILES) - + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_docdir)/cpp BUILDDIR=$(objdir)/doc/cpp/man +doc/%.1: %.pod + $(STAMP) $@ + -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \ + mv -f $(@).T$$$$ $@) || \ + (rm -f $(@).T$$$$ && exit 1) -doc/gcc/info/texinfo/gcc.info: $(SPHINX_FILES) - + make -C $(srcdir)/../doc info SOURCEDIR=$(abs_docdir)/gcc BUILDDIR=$(objdir)/doc/gcc/info +doc/%.7: %.pod + $(STAMP) $@ + -($(POD2MAN) --section=7 $< > $(@).T$$$$ && \ + mv -f $(@).T$$$$ $@) || \ + (rm -f $(@).T$$$$ && exit 1) -doc/gccint/info/texinfo/gccint.info: $(SPHINX_FILES) s-tm-rst-in - + make -C $(srcdir)/../doc info SOURCEDIR=$(abs_docdir)/gccint BUILDDIR=$(objdir)/doc/gccint/info +%.pod: %.texi + $(STAMP) $@ + -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" $< > $@ -doc/cpp/info/texinfo/cpp.info: $(SPHINX_FILES) - + make -C $(srcdir)/../doc info SOURCEDIR=$(abs_docdir)/cpp BUILDDIR=$(objdir)/doc/cpp/info +.INTERMEDIATE: cpp.pod gcc.pod gfdl.pod fsf-funding.pod gpl.pod +cpp.pod: cpp.texi cppenv.texi cppopts.texi -doc/cppinternals/info/texinfo/cppinternals.info: $(SPHINX_FILES) - + make -C $(srcdir)/../doc info SOURCEDIR=$(abs_docdir)/cppinternals BUILDDIR=$(objdir)/doc/cppinternals/info +# These next rules exist because the output name is not the same as +# the input name, so our implicit %.pod rule will not work. -doc/install/info/texinfo/install.info: $(SPHINX_FILES) - + make -C $(srcdir)/../doc info SOURCEDIR=$(abs_docdir)/install BUILDDIR=$(objdir)/doc/install/info +gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi + $(STAMP) $@ + -$(TEXI2POD) $< > $@ +gfdl.pod: fdl.texi + $(STAMP) $@ + -$(TEXI2POD) $< > $@ +fsf-funding.pod: funding.texi + $(STAMP) $@ + -$(TEXI2POD) $< > $@ +gpl.pod: gpl_v3.texi + $(STAMP) $@ + -$(TEXI2POD) $< > $@ # # Deletion of files made during compilation. @@ -3444,7 +3563,8 @@ clean: mostlyclean lang.clean -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h -rm -f options.cc options.h optionlist -rm -f cs-* - -rm -rf doc + -rm -f doc/*.dvi + -rm -f doc/*.pdf # Delete the include directories. -rm -rf include include-fixed # Delete files used by the "multilib" facility (including libgcc subdirs). @@ -3472,6 +3592,7 @@ distclean: clean lang.distclean -cd testsuite && rm -f *.out *.gcov *$(coverageexts) -rm -rf ${QMTEST_DIR} stamp-qmtest -rm -f .gdbinit configargs.h + -rm -f gcov.pod # Delete po/*.gmo only if we are not building in the source directory. -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi -rmdir ada cp f java objc intl po testsuite plugin 2>/dev/null @@ -3484,7 +3605,7 @@ maintainer-clean: $(MAKE) lang.maintainer-clean distclean -rm -f cpp.??s cpp.*aux -rm -f gcc.??s gcc.*aux - -rm -rf doc + -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf # # Entry points `install', `install-strip', and `uninstall'. # Also use `install-collect2' to install collect2 when the config files don't. @@ -3681,46 +3802,24 @@ install-info:: doc installdirs \ $(DESTDIR)$(infodir)/cpp.info \ $(DESTDIR)$(infodir)/gcc.info \ $(DESTDIR)$(infodir)/cppinternals.info \ - $(DESTDIR)$(infodir)/install.info \ + $(DESTDIR)$(infodir)/gccinstall.info \ $(DESTDIR)$(infodir)/gccint.info \ lang.install-info -$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - +$(DESTDIR)$(infodir)/%.info: doc/%.info installdirs + rm -f $@ + if [ -f $< ]; then \ + for f in $(<)*; do \ + realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ + $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \ + chmod a-x $(DESTDIR)$(infodir)/$$realfile; \ + done; \ + else true; fi + -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ + if [ -f $@ ]; then \ + install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \ + else true; fi; \ + else true; fi; dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`; @@ -3748,7 +3847,7 @@ install-pdf: $(PDFFILES) lang.install-pdf html__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -install-html: $(HTMLS) lang.install-html +install-html: $(HTMLS_BUILD) lang.install-html @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)" @list='$(HTMLS_INSTALL)'; for p in $$list; do \ @@ -3782,47 +3881,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -chmod a-x $@ - -$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -chmod a-x $@ - -$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - -chmod a-x $@ - -$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs +$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs +$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs +$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs +$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcov-tool.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs +$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcov-dump.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ -$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs +$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/lto-dump.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ diff --git a/gcc/configure b/gcc/configure index ca1169f..aa09609 100755 --- a/gcc/configure +++ b/gcc/configure @@ -807,7 +807,6 @@ AR NM BISON FLEX -SPHINX_BUILD GENERATED_MANPAGES BUILD_INFO MAKEINFO @@ -8164,7 +8163,7 @@ fi REPORT_BUGS_TEXI= ;; *) - REPORT_BUGS_TO="$BUGURL" + REPORT_BUGS_TO="<$BUGURL>" REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} ;; esac; @@ -8806,27 +8805,6 @@ $as_echo "no" >&6; } fi -# See if sphinx-build has been installed and is modern enough -# that we can use it. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sphinx-build" >&5 -$as_echo_n "checking for sphinx-build... " >&6; } -if sphinx-build -j auto -h &>/dev/null ; then - SPHINX_BUILD=sphinx-build - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: - *** sphinx-build is missing or too old. - *** Info and man pages documentation will not be built." >&5 -$as_echo "$as_me: WARNING: - *** sphinx-build is missing or too old. - *** Info and man pages documentation will not be built." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SPHINX_BUILD= -fi - - MISSING="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing" # How about lex? @@ -19732,7 +19710,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19735 "configure" +#line 19713 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19838,7 +19816,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19841 "configure" +#line 19819 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index f1de29e..7c55bff 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1253,21 +1253,6 @@ else fi AC_SUBST(GENERATED_MANPAGES) -# See if sphinx-build has been installed and is modern enough -# that we can use it. -AC_MSG_CHECKING([for sphinx-build]) -if sphinx-build -j auto -h &>/dev/null ; then - SPHINX_BUILD=sphinx-build - AC_MSG_RESULT(yes) -else - AC_MSG_WARN([ - *** sphinx-build is missing or too old. - *** Info and man pages documentation will not be built.]) - AC_MSG_RESULT(no) - SPHINX_BUILD= -fi -AC_SUBST(SPHINX_BUILD) - MISSING="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing" # How about lex? diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index f8fa4d1..291835d 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -285,7 +285,7 @@ c++.install-common: installdirs # We can't use links because not everyone supports them. So just copy the # manpage. -doc/g++.1: doc/gcc/man/man/gcc.1 +doc/g++.1: doc/gcc.1 cp $< doc/g++.1 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext) diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in index 87178e3..6f9b2e5 100644 --- a/gcc/d/Make-lang.in +++ b/gcc/d/Make-lang.in @@ -236,28 +236,48 @@ d21$(exeext): $(D_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) $(d.prev) @$(call LINK_PROGRESS,$(INDEX.d),end) # Documentation. -doc/gdc/info/texinfo/gdc.info: $(SPHINX_FILES) - + if [ x$(SPHINX_BUILD) = xsphinx-build ]; then \ - make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/info; \ + +D_TEXI_FILES = \ + d/gdc.texi \ + $(gcc_docdir)/include/fdl.texi \ + $(gcc_docdir)/include/gpl_v3.texi \ + $(gcc_docdir)/include/gcc-common.texi \ + gcc-vers.texi + +doc/gdc.info: $(D_TEXI_FILES) + if test "x$(BUILD_INFO)" = xinfo; then \ + rm -f doc/gdc.info*; \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ + -I $(gcc_docdir)/include -o $@ $<; \ else true; fi +doc/gdc.dvi: $(D_TEXI_FILES) + $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + doc/gdc.pdf: $(D_TEXI_FILES) $(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< -doc/gdc/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/html +$(build_htmldir)/d/index.html: $(D_TEXI_FILES) + $(mkinstalldirs) $(@D) + rm -f $(@D)/* + $(TEXI2HTML) -I $(gcc_docdir) -I $(gcc_docdir)/include \ + -I $(srcdir)/d -o $(@D) $< + +.INTERMEDIATE: gdc.pod + +gdc.pod: d/gdc.texi + -$(TEXI2POD) -D gdc < $< > $@ + # Build hooks. d.all.cross: gdc-cross$(exeext) d.start.encap: gdc$(exeext) d.rest.encap: -d.info: doc/gdc/info/texinfo/gdc.info -gdc.info: doc/gdc/info/texinfo/gdc.info -d.pdf: doc/gdc/pdf/latex/gdc.pdf -gdc.pdf: doc/gdc/pdf/latex/gdc.pdf -d.html: doc/gdc/html/html/index.html -gdc.html: doc/gdc/html/html/index.html -d.srcinfo: doc/gdc/info/texinfo/gdc.info +d.info: doc/gdc.info +d.dvi: doc/gdc.dvi +d.pdf: doc/gdc.pdf +d.html: $(build_htmldir)/d/index.html +d.srcinfo: doc/gdc.info -cp -p $^ $(srcdir)/doc d.srcextra: @@ -266,13 +286,10 @@ d.tags: force $(ETAGS) -o TAGS.sub *.cc *.h dmd/*.h dmd/root/*.h; \ $(ETAGS) --include TAGS.sub --include ../TAGS.sub -d.man: doc/gdc/man/man/gdc.1 -d.srcman: doc/gdc/man/man/gdc.1 +d.man: doc/gdc.1 +d.srcman: doc/gdc.1 -cp -p $^ $(srcdir)/doc -doc/gdc/man/man/gdc.1: $(SPHINX_FILES) - + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/man - # 'make check' in gcc/ looks for check-d, as do all toplevel D-related # check targets. However, our DejaGNU framework requires 'check-gdc' as its # entry point. We feed the former to the latter here. @@ -303,13 +320,6 @@ d.install-plugin: d.install-info: $(DESTDIR)$(infodir)/gdc.info -doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf - -$(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - d.install-pdf: doc/gdc.pdf @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc" @@ -349,7 +359,7 @@ d.install-html: $(build_htmldir)/d d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext) -$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs +$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index 17c0474..1cb47cb 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -109,23 +109,32 @@ fortran.all.cross: gfortran-cross$(exeext) fortran.start.encap: gfortran$(exeext) fortran.rest.encap: -fortran.srcinfo: doc/gfortran/info/texinfo/gfortran.info +fortran.srcinfo: doc/gfortran.info -cp -p $^ $(srcdir)/fortran fortran.tags: force cd $(srcdir)/fortran; $(ETAGS) -o TAGS.sub *.cc *.h; \ $(ETAGS) --include TAGS.sub --include ../TAGS.sub -fortran.info: doc/gfortran/info/texinfo/gfortran.info doc/gfc-internals/info/texinfo/gfc-internals.info +fortran.info: doc/gfortran.info doc/gfc-internals.info -doc/gfortran/info/texinfo/gfortran.info: $(SPHINX_FILES) - + if [ x$(SPHINX_BUILD) = xsphinx-build ]; then \ - make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/gfortran/info; \ - else true; fi +F95_DVIFILES = doc/gfortran.dvi + +fortran.dvi: $(F95_DVIFILES) doc/gfc-internals.dvi -F95_HTMLFILES = doc/fortran/html/html/index.html +fortran.install-dvi: $(F95_DVIFILES) + @$(NORMAL_INSTALL) + test -z "$(dvidir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(dvidir)/gcc" + @list='$(F95_DVIFILES)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(dvi__strip_dir) \ + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/gcc/$$f'"; \ + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/gcc/$$f"; \ + done -fortran.html: $(F95_HTMLFILES) doc/gfc-internals/html/html/index.html +F95_HTMLFILES = $(build_htmldir)/gfortran + +fortran.html: $(F95_HTMLFILES)/index.html fortran.install-html: $(F95_HTMLFILES) @$(NORMAL_INSTALL) @@ -144,9 +153,9 @@ fortran.install-html: $(F95_HTMLFILES) fi; \ done -F95_PDFFILES = doc/fortran/pdf/latex/gfortran.pdf +F95_PDFFILES = doc/gfortran.pdf -fortran.pdf: $(F95_PDFFILES) doc/gfc-internals/pdf/latex/gfc-internals.pdf +fortran.pdf: $(F95_PDFFILES) doc/gfc-internals.pdf fortran.install-pdf: $(F95_PDFFILES) @$(NORMAL_INSTALL) @@ -158,10 +167,7 @@ fortran.install-pdf: $(F95_PDFFILES) $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \ done -F95_MANFILES = doc/gfortran/man/man/gfortran.1 - -doc/gfortran/man/man/gfortran.1: $(SPHINX_FILES) - + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/gfortran/man +F95_MANFILES = doc/gfortran.1 fortran.man: $(F95_MANFILES) @@ -182,23 +188,60 @@ check_gfortran_parallelize = 10000 # No fortran-specific selftests selftest-fortran: -doc/fortran/pdf/latex/gfortran.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/fortran/pdf +# GFORTRAN documentation. +GFORTRAN_TEXI = \ + $(srcdir)/fortran/gfortran.texi \ + $(srcdir)/fortran/intrinsic.texi \ + $(srcdir)/fortran/invoke.texi \ + $(srcdir)/doc/include/fdl.texi \ + $(srcdir)/doc/include/gpl_v3.texi \ + $(srcdir)/doc/include/funding.texi \ + $(srcdir)/doc/include/gcc-common.texi \ + gcc-vers.texi + +doc/gfortran.info: $(GFORTRAN_TEXI) + if [ x$(BUILD_INFO) = xinfo ]; then \ + rm -f doc/gfortran.info-*; \ + $(MAKEINFO) -I $(srcdir)/doc/include -I $(srcdir)/fortran \ + -o $@ $<; \ + else true; fi + +doc/gfortran.dvi: $(GFORTRAN_TEXI) + $(TEXI2DVI) -I $(srcdir)/fortran -I $(abs_docdir)/include -o $@ $< -doc/fortran/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/fortran/html +doc/gfortran.pdf: $(GFORTRAN_TEXI) + $(TEXI2PDF) -I $(srcdir)/fortran -I $(abs_docdir)/include -o $@ $< + +$(build_htmldir)/gfortran/index.html: $(GFORTRAN_TEXI) + $(mkinstalldirs) $(@D) + rm -f $(@D)/* + $(TEXI2HTML) -I $(gcc_docdir)/include -I $(srcdir)/fortran -o $(@D) $< + +.INTERMEDIATE: gfortran.pod + +gfortran.pod: $(GFORTRAN_TEXI) + -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" \ + < $(srcdir)/fortran/invoke.texi > $@ # GFORTRAN internals documentation. -doc/gfc-internals/info/texinfo/gfc-internals.info: $(SPHINX_FILES) - + if [ x$(SPHINX_BUILD) = xsphinx-build ]; then \ - make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/fortran/doc/gfc-internals BUILDDIR=$(objdir)/doc/gfc-internals/info; \ +GFC_INTERNALS_TEXI = \ + $(srcdir)/fortran/gfc-internals.texi \ + $(srcdir)/doc/include/fdl.texi \ + $(srcdir)/doc/include/gcc-common.texi \ + gcc-vers.texi + +doc/gfc-internals.info: $(GFC_INTERNALS_TEXI) + if [ x$(BUILD_INFO) = xinfo ]; then \ + rm -f doc/gfc-internals.info-*; \ + $(MAKEINFO) -I $(srcdir)/doc/include -I $(srcdir)/fortran \ + -o $@ $<; \ else true; fi -doc/gfc-internals/pdf/latex/gfc-internals.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/fortran/doc/gfc-internals BUILDDIR=$(objdir)/doc/gfc-internals/pdf +doc/gfc-internals.dvi: $(GFC_INTERNALS_TEXI) + $(TEXI2DVI) -I $(srcdir)/fortran -I $(abs_docdir)/include -o $@ $< -doc/gfc-internals/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/fortran/doc/gfc-internals BUILDDIR=$(objdir)/doc/gfc-internals/html +doc/gfc-internals.pdf: $(GFC_INTERNALS_TEXI) + $(TEXI2PDF) -I $(srcdir)/fortran -I $(abs_docdir)/include -o $@ $< # Create or recreate the gfortran private include file directory. install-finclude-dir: installdirs @@ -226,13 +269,9 @@ fortran.install-plugin: fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info -$(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext) -$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \ +$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran.1 \ installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ @@ -260,6 +299,12 @@ fortran.mostlyclean: fortran.clean: fortran.distclean: -rm -f fortran/config.status fortran/Makefile + +fortran.extraclean: +fortran.maintainer-clean: + -rm -f doc/gfortran.info* fortran/gfortran.*aux + -rm -f $(docobjdir)/gfortran.1 + # # Stage hooks: # The toplevel makefile has already created stage?/fortran at this point. diff --git a/gcc/genhooks.cc b/gcc/genhooks.cc index 3482838..6bae85d 100644 --- a/gcc/genhooks.cc +++ b/gcc/genhooks.cc @@ -48,76 +48,211 @@ upstrdup (const char *in) return ret; } -/* Emit shared .rst.in file that is used by the corresponding - .. include:: tm.rst.in - :start-after: [HOOK_NAME] - :end-before: [HOOK_NAME] +/* Struct for 'start hooks' which start a sequence of consecutive hooks + that are defined in target.def and to be documented in tm.texi. */ +struct s_hook +{ + char *name; + int pos; +}; + +static hashval_t +s_hook_hash (const void *p) +{ + const struct s_hook *s_hook = (const struct s_hook *)p; + return htab_hash_string (s_hook->name); +} +static int +s_hook_eq_p (const void *p1, const void *p2) +{ + return (strcmp (((const struct s_hook *) p1)->name, + ((const struct s_hook *) p2)->name) == 0); +} + +/* Read the documentation file with name IN_FNAME, perform substitutions + to incorporate information from hook_array, and emit the result on stdout. + Hooks defined with DEFHOOK / DEFHOOKPOD are emitted at the place of a + matching @hook in the input file; if there is no matching @hook, the + hook is emitted after the hook that precedes it in target.def . + Usually, the emitted hook documentation starts with the hook + signature, followed by the string from the doc field. + The documentation is bracketed in @deftypefn / @deftypevr and a matching + @end. + While emitting the doc field, an @findex entry is added + to the affected paragraph. If the doc field starts with '*', the leading '*' is stripped, and the doc field is otherwise emitted unaltered; no function signature/ @deftypefn/deftypevr/@end is emitted. In particular, a doc field of "*" means not to emit any ocumentation for this target.def / hook_array entry at all (there might be documentation for this hook in the file named IN_FNAME, though). - - This allows all the free-form + A doc field of 0 is used to append the hook signature after the previous + hook's signture, so that one description can be used for a group of hooks. + When the doc field is "", @deftypefn/@deftypevr and the hook signature + is emitted, but not the matching @end. This allows all the free-form documentation to be placed in IN_FNAME, to work around GPL/GFDL licensing incompatibility issues. */ - static void -emit_documentation (void) +emit_documentation (const char *in_fname) { + int i, j; + char buf[1000]; + htab_t start_hooks = htab_create (99, s_hook_hash, s_hook_eq_p, (htab_del) 0); + FILE *f; + + /* Enter all the start hooks in start_hooks. */ + f = fopen (in_fname, "r"); + if (!f) + { + perror (""); + fatal ("Couldn't open input file"); + } + while (fscanf (f, "%*[^@]"), buf[0] = '\0', + fscanf (f, "@%5[^ \n]", buf) != EOF) + { + void **p; + struct s_hook *shp; + + if (strcmp (buf, "hook") != 0) + continue; + buf[0] = '\0'; + fscanf (f, "%999s", buf); + shp = XNEW (struct s_hook); + shp->name = upstrdup (buf); + shp->pos = -1; + p = htab_find_slot (start_hooks, shp, INSERT); + if (*p != HTAB_EMPTY_ENTRY) + fatal ("Duplicate placement for hook %s\n", shp->name); + *(struct s_hook **) p = shp; + } + fclose (f); /* For each hook in hook_array, if it is a start hook, store its position. */ - for (int i = 0; i < (int) (ARRAY_SIZE (hook_array)); i++) + for (i = 0; i < (int) (ARRAY_SIZE (hook_array)); i++) { - if (hook_array[i].doc == NULL - || strcmp (hook_array[i].doc, "") == 0 - || strcmp (hook_array[i].doc, "*") == 0) + struct s_hook sh, *shp; + void *p; + + if (!hook_array[i].doc || strcmp (hook_array[i].doc, "*") == 0) continue; - const char *hook_name = upstrdup (hook_array[i].name); - printf ("[%s]\n", hook_name); - /* Print header. Function-valued hooks have a parameter list, - unlike POD-valued ones. */ - const char *deftype = hook_array[i].param ? "function" : "c:var"; - printf (".. %s:: ", deftype); - if (strchr (hook_array[i].type, ' ')) - printf ("%s", hook_array[i].type); - else - printf ("%s", hook_array[i].type); - printf (" %s", hook_name); - if (hook_array[i].param) + sh.name = upstrdup (hook_array[i].name); + p = htab_find (start_hooks, &sh); + if (p) { - const char *q, *e; - /* Print the parameter list, with the parameter names - enclosed in @var{}. */ - printf (" "); - for (q = hook_array[i].param; (e = strpbrk (q, " *,)")); - q = e + 1) - /* Type names like 'int' are followed by a space, sometimes - also by '*'. 'void' should appear only in "(void)". */ - if (*e == ' ' || *e == '*' || *q == '(') - printf ("%.*s", (int) (e - q + 1), q); - else - printf ("%.*s%c", (int) (e - q), q, *e); + shp = (struct s_hook *) p; + if (shp->pos >= 0) + fatal ("Duplicate hook %s\n", sh.name); + shp->pos = i; } + else + fatal ("No place specified to document hook %s\n", sh.name); + free (sh.name); + } + /* Copy input file to stdout, substituting @hook directives with the + corresponding hook documentation sequences. */ + f = fopen (in_fname, "r"); + if (!f) + { + perror (""); + fatal ("Couldn't open input file"); + } + for (;;) + { + struct s_hook sh, *shp; + int c = getc (f); + char *name; - printf ("\n"); - if (hook_array[i].doc[0]) + if (c == EOF) + break; + if (c != '@') + { + putchar (c); + continue; + } + buf[0] = '\0'; + fscanf (f, "%5[^ \n]", buf); + if (strcmp (buf, "hook") != 0) + { + printf ("@%s", buf); + continue; + } + fscanf (f, "%999s", buf); + sh.name = name = upstrdup (buf); + shp = (struct s_hook *) htab_find (start_hooks, &sh); + if (!shp || shp->pos < 0) + fatal ("No documentation for hook %s\n", sh.name); + i = shp->pos; + do { + const char *q, *e; + const char *deftype; const char *doc, *p_end; - printf ("\n"); - /* Print each documentation paragraph in turn. */ - for (doc = hook_array[i].doc; *doc; doc = p_end) + + /* A leading '*' means to output the documentation string without + further processing. */ + if (*hook_array[i].doc == '*') + printf ("%s", hook_array[i].doc + 1); + else { - /* Find paragraph end. */ - p_end = strstr (doc, "\n"); - p_end = (p_end ? p_end + 1 : doc + strlen (doc)); - printf (" %.*s", (int) (p_end - doc), doc); + if (i != shp->pos) + printf ("\n\n"); + + /* Print header. Function-valued hooks have a parameter list, + unlike POD-valued ones. */ + deftype = hook_array[i].param ? "deftypefn" : "deftypevr"; + printf ("@%s {%s} ", deftype, hook_array[i].docname); + if (strchr (hook_array[i].type, ' ')) + printf ("{%s}", hook_array[i].type); + else + printf ("%s", hook_array[i].type); + printf (" %s", name); + if (hook_array[i].param) + { + /* Print the parameter list, with the parameter names + enclosed in @var{}. */ + printf (" "); + for (q = hook_array[i].param; (e = strpbrk (q, " *,)")); + q = e + 1) + /* Type names like 'int' are followed by a space, sometimes + also by '*'. 'void' should appear only in "(void)". */ + if (*e == ' ' || *e == '*' || *q == '(') + printf ("%.*s", (int) (e - q + 1), q); + else + printf ("@var{%.*s}%c", (int) (e - q), q, *e); + } + /* POD-valued hooks sometimes come in groups with common + documentation.*/ + for (j = i + 1; + j < (int) (ARRAY_SIZE (hook_array)) + && hook_array[j].doc == 0 && hook_array[j].type; j++) + { + char *namex = upstrdup (hook_array[j].name); + + printf ("\n@%sx {%s} {%s} %s", + deftype, hook_array[j].docname, + hook_array[j].type, namex); + } + if (hook_array[i].doc[0]) + { + printf ("\n"); + /* Print each documentation paragraph in turn. */ + for (doc = hook_array[i].doc; *doc; doc = p_end) + { + /* Find paragraph end. */ + p_end = strstr (doc, "\n\n"); + p_end = (p_end ? p_end + 2 : doc + strlen (doc)); + printf ("%.*s", (int) (p_end - doc), doc); + } + printf ("\n@end %s", deftype); + } } - printf ("\n"); + if (++i >= (int) (ARRAY_SIZE (hook_array)) || !hook_array[i].doc) + break; + free (name); + sh.name = name = upstrdup (hook_array[i].name); } - - printf ("\n[%s]\n\n", hook_name); + while (!htab_find (start_hooks, &sh)); + free (name); } } @@ -178,8 +313,8 @@ main (int argc, char **argv) { progname = "genhooks"; - if (argc == 1) - emit_documentation (); + if (argc >= 3) + emit_documentation (argv[2]); else emit_init_macros (argv[1]); return 0; diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in index e5de16f..0e81268 100644 --- a/gcc/go/Make-lang.in +++ b/gcc/go/Make-lang.in @@ -88,46 +88,57 @@ go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS) $(go.prev) # Documentation. -doc/gccgo/info/texinfo/gccgo.info: $(SPHINX_FILES) - + if [ x$(SPHINX_BUILD) = xsphinx-build ]; then \ - make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/go/doc/ BUILDDIR=$(objdir)/doc/gccgo/info; \ +GO_TEXI_FILES = \ + go/gccgo.texi \ + $(gcc_docdir)/include/fdl.texi \ + $(gcc_docdir)/include/gpl_v3.texi \ + $(gcc_docdir)/include/gcc-common.texi \ + gcc-vers.texi + +doc/gccgo.info: $(GO_TEXI_FILES) + if test "x$(BUILD_INFO)" = xinfo; then \ + rm -f doc/gccgo.info*; \ + $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ + -I $(gcc_docdir)/include -o $@ $<; \ else true; fi -doc/gccgo/pdf/latex/gccgo.pdf: $(SPHINX_FILES) - + make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/go/doc/ BUILDDIR=$(objdir)/doc/gccgo/pdf +doc/gccgo.dvi: $(GO_TEXI_FILES) + $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< -doc/gccgo/html/html/index.html: $(SPHINX_FILES) - + make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/go/doc/ BUILDDIR=$(objdir)/doc/gccgo/html +doc/gccgo.pdf: $(GO_TEXI_FILES) + $(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $< + +$(build_htmldir)/go/index.html: $(GO_TEXI_FILES) + $(mkinstalldirs) $(@D) + rm -f $(@D)/* + $(TEXI2HTML) -I $(gcc_docdir) -I $(gcc_docdir)/include \ + -I $(srcdir)/go -o $(@D) $< + +.INTERMEDIATE: gccgo.pod + +gccgo.pod: go/gccgo.texi + -$(TEXI2POD) -D gccgo < $< > $@ # Build hooks. go.all.cross: gccgo-cross$(exeext) go.start.encap: gccgo$(exeext) go.rest.encap: - -go.info: doc/gccgo/info/texinfo/gccgo.info - -go.pdf: doc/gccgo/pdf/latex/gccgo.pdf - -go.html: doc/gccgo/html/html/index.html - -go.srcinfo: doc/gccgo/info/texinfo/gccgo.info +go.info: doc/gccgo.info +go.dvi: doc/gccgo.dvi +go.pdf: doc/gccgo.pdf +go.html: $(build_htmldir)/go/index.html +go.srcinfo: doc/gccgo.info -cp -p $^ $(srcdir)/doc - go.srcextra: go.tags: force cd $(srcdir)/go; \ $(ETAGS) -o TAGS.sub *.cc *.h gofrontend/*.h gofrontend/*.cc; \ $(ETAGS) --include TAGS.sub --include ../TAGS.sub - -go.man: doc/gccgo/man/man/gccgo.1 - -go.srcman: doc/gccgo/man/man/gccgo.1 +go.man: doc/gccgo.1 +go.srcman: doc/gccgo.1 -cp -p $^ $(srcdir)/doc -doc/gccgo/man/man/gccgo.1: $(SPHINX_FILES) - + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/go/doc BUILDDIR=$(objdir)/doc/gccgo/man - lang_checks += check-go lang_checks_parallelized += check-go check_go_parallelize = 10 @@ -154,10 +165,6 @@ go.install-plugin: go.install-info: $(DESTDIR)$(infodir)/gccgo.info -$(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs - -rm -f $@ - -$(INSTALL_DATA) $< $@ - go.install-pdf: doc/gccgo.pdf @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc" @@ -187,7 +194,7 @@ go.install-html: $(build_htmldir)/go go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext) -$(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs +$(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo.1 installdirs -rm -f $@ -$(INSTALL_DATA) $< $@ -chmod a-x $@ @@ -207,7 +214,7 @@ go.mostlyclean: go.clean: go.distclean: go.maintainer-clean: - -rm -f doc/doc/gccgo/man/man/gccgo.1 + -rm -f $(docobjdir)/gccgo.1 # Stage hooks. |