]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/doc: use abs_srcdir when creating symlinks
authorAndrew Burgess <aburgess@redhat.com>
Tue, 21 Jan 2025 13:06:18 +0000 (13:06 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 22 Jan 2025 10:56:19 +0000 (10:56 +0000)
After commit:

  commit bd32be01c997f686ab0b53f0640eaa0aeb61fbd3
  Date:   Fri Dec 3 00:23:20 2021 -0500

      bfd: merge doc subdir up a level

And the follow-up commit:

  commit 98b1464bdf6306a8ab4614b5e9f76cdb2dd00b33
  Date:   Wed Oct 2 22:58:08 2024 +0300

      bfd: fix unnecessary bfd.info regen

There is still a problem building the bfd docs from a release tar
file.

As the release tar file contains the pre-generated .texi files we
expect the bfd/doc build stage to symlink to the pre-existing .texi
files in the source tree.

However, this is still not working as expected if $(srcdir) is
relative.  The problem is this line in REGEN_TEXI:

    test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \

This is executed from the build/bfd/ directory, so if $(srcdir) is
relative, then this will get you from the bfd/ directory in the build
tree to the corresponding bfd/ directory in the src tree.  However,
the symlink is created in the bfd/doc/ build directory.  The relative
path will then fail to take you to the bfd/ directory in the src
tree.

Fix this by using $(abs_srcdir) when creating the symlink.

Approved-By: Nick Clifton <nickc@redhat.com>
bfd/Makefile.in
bfd/doc/local.mk

index aec3717485a4f66312a4e4c0286ce8a100cf1b99..ee674a36c5be323de3ec9d6a51079f19c53911d1 100644 (file)
@@ -1318,7 +1318,7 @@ REGEN_TEXI = \
        $(MKDOC) -f $(srcdir)/doc/doc.str < $< > $@.tmp; \
        texi=$@; \
        texi=$${texi%.stamp}.texi; \
-       test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \
+       test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(abs_srcdir)/$$texi $$texi; \
        $(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
        touch $@; \
        )
index 97d658b5a4864425609efd3f4534c795425a6a0a..9b75402387c21b376b69955210edc34c3f7a2c53 100644 (file)
@@ -101,7 +101,7 @@ REGEN_TEXI = \
        $(MKDOC) -f $(srcdir)/%D%/doc.str < $< > $@.tmp; \
        texi=$@; \
        texi=$${texi%.stamp}.texi; \
-       test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi $$texi; \
+       test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(abs_srcdir)/$$texi $$texi; \
        $(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
        touch $@; \
        )