From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3A8D13858C60 for ; Fri, 31 May 2024 08:18:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A8D13858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A8D13858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717143539; cv=none; b=oYi3u5cvAMKksmYDWW80k46UPJb0Ue7AMNsm0kwd5zsLu151CajbLLbeR7RwMZAgBfis4A/43/Fu9qBPGch0EO1lPZxvOnCc/8mKrT3jPCbP70ymvOZam2mb7gShApA3agmNxbcWwN+ZXyliqZATh5lHgHuu02tZxKUNHeUZnIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717143539; c=relaxed/simple; bh=uZDgkwIjLgSECB5vy1MVQwjy7lvhpgAn7yEFQG/Eji4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=IuAQlCxFSKIozWsinKOEdCLrvV05nTNHts82Xn6dKE5QgV9q3VZ1Tj6GTRvAlcyNC2sWs/ZVVUwpztj2XG71Qvn3nseBsDJQpDZruGgZAYaIBujyP36sQqdjPxWBn+nzAfVM1/eUrujtbcBhw5FhKviwje73hYSVVFhSA2i9hPo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717143533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HkEgxrHuM+ej9+HwCm9l/rn1ndvB0t10/PjTqpemgBw=; b=gd7Zp4tPEBc8g9z4pvQyN84Oj0PAqdyXs1O00rbXq/MQ5iKJ1ZnIqgX+JSwg7jBIDBT98J ITpfrA4UjiYi988+a0KJKAkEXyVI64ikQdN2Y+yL8X1+FKYW20LYxoxgu3LbbvR8gMy5s7 lEtJ2IHDRViZANMGVoA7tEtpFKmPfQk= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-QiuKxKgjMWO8DDwL_ePyIw-1; Fri, 31 May 2024 04:18:52 -0400 X-MC-Unique: QiuKxKgjMWO8DDwL_ePyIw-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-35e0e59dcf7so298488f8f.2 for ; Fri, 31 May 2024 01:18:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717143530; x=1717748330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HkEgxrHuM+ej9+HwCm9l/rn1ndvB0t10/PjTqpemgBw=; b=lT8zRJFnxSTMy0siiOuvb+aoIyutg8ylucUIfXY1dBjr0hds/IDn1CTzBIpd28/SS5 k5LH422/2asWj10O6wEkRLR7oxHKg2/YzPp8NRE6D0/JnOFGOjeDO9uFwrK0L4SrK0ge /XvRQtSO/h12N4MB54qGV0GJB1VgOS00u+8TeHL37AsX2x8wretpjZ6nh/bP7ZDOQwrU L6bi7nAuwk7Msfx7oWlMuJGgZdCtOascsQ3WWvhNEVMhMR2Vi8niQi3S31BDYvnCaSmh at1IQ8wFVkoZZZq474I0p4NqIyMT/dQMrH5DPhBwZMXWYKn8yMJkqeoDOEevAouR5vSP nKFw== X-Gm-Message-State: AOJu0Yz20CkGQkgLui8+M+3HZTJSxDJvZHJs+jeYsTcAKst4W7wRH2Vm 6bcIVDR8ysopko6IVfubn8LR8BCcUowCJqLhAYVX08R9K6/AYai8vhAaeyKHr2WZLdIApwjaKgR 4RFCMw2qobFRvVCNO3TylbSFW+rTe/z/m86k5n14Hob0X2dGdIwRNxaDEMlcAPRurfjamz+kRDD 17XHbmdzZsnbkPNFSRd03F5DUuBIkbMCSSFb0iFuqPZT0= X-Received: by 2002:a5d:5392:0:b0:34c:6629:9962 with SMTP id ffacd0b85a97d-35e0f284638mr827133f8f.30.1717143530324; Fri, 31 May 2024 01:18:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjGUDeunPy4WzDQXW8NzIiDkxZH74V4kxOUU4enr84JXG4hVF2Gu9U787x0Y6tCCGePukBdg== X-Received: by 2002:a5d:5392:0:b0:34c:6629:9962 with SMTP id ffacd0b85a97d-35e0f284638mr827114f8f.30.1717143529810; Fri, 31 May 2024 01:18:49 -0700 (PDT) Received: from localhost ([2a00:23c7:c696:e701:85a5:8a0c:1403:2dc]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0f2asm1307299f8f.3.2024.05.31.01.18.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 01:18:48 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 2/5] gdb/doc: allow for version.subst in the source tree Date: Fri, 31 May 2024 09:18:39 +0100 Message-Id: <7d24d630fb96976deb225f1098df2b32e72643bd.1717142725.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: In a git checkout of the source code we don't have a version.subst file in the gdb/doc directory. When building the GDB docs the version.subst file is generated on demand (we have a recipe for that). However, in a release tar file we do include a copy of the version.subst file in the source tree, as a result the version.subst recipe will not be run. If, in a release build, we force the running of any recipe that depends on version.subst then we run into a problem. For example, slightly confusingly, if we 'touch gdb/doc/version.subst' within the unpacked source tree of a release, then 'make -C gdb/doc GDBvn.texi' in the build tree, we'll see: make: Entering directory '/tmp/build/build/gdb/doc' GEN GDBvn.texi sed: can't read version.subst: No such file or directory make: Leaving directory '/tmp/build/build/gdb/doc' The problem is that every reference to version.subst in GDB's Makefile assumes that the version.subst file will always be in the build directory. In this commit I replace direct references to version.subst with a small shell snippet which returns the path to the version.subst file to use. If there is a version.subst file in the build directory then that file is selected, otherwise we return the path to a version.subst file in the source directory. As the POD2MAN1 and POD2MAN5 commands both depend on version.subst I have added version.subst as a dependency to the two recipes that use this variable. --- gdb/doc/Makefile.in | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 3a179e9799a..e5f8a11008e 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -178,10 +178,21 @@ MANCONF = -Dman TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl \ $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS) +# Shell snippet which will provide the full filename of the +# version.subst file to use. If there is a copy in the build +# directory then that is preferred, otherwise we assume there is a +# copy in the source tree. +VERSION_SUBST = $$(if [ -r version.subst ]; \ + then \ + (echo $$PWD/version.subst); \ + else \ + (builtin cd $(srcdir) && echo $$PWD/version.subst); \ + fi) + POD2MAN1 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=1 + --release="gdb-`sed q $(VERSION_SUBST)`" --section=1 POD2MAN5 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=5 + --release="gdb-`sed q $(VERSION_SUBST)`" --section=5 # List of man pages generated from gdb.texi MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1 @@ -439,7 +450,7 @@ refcard.pdf : refcard.tex $(REFEDITS) # File to record current GDB version number. GDBvn.texi : version.subst $(ECHO_GEN) - $(SILENCE) echo "@set GDBVN `sed q version.subst`" > ./GDBvn.new + $(SILENCE) echo "@set GDBVN `sed q $(VERSION_SUBST)`" > ./GDBvn.new $(SILENCE) if [ -n "$(PKGVERSION)" ]; then \ echo "@set VERSION_PACKAGE $(PKGVERSION)" >> ./GDBvn.new; \ fi @@ -654,13 +665,13 @@ annotate/index.html: $(ANNOTATE_DOC_FILES) # pages, then the .pod files must become a dependency, this will # trigger an attempt to rebuild these files while building and # installing a release of GDB, which is something we don't want. -$(MAN1S) : %.1 : $(GDB_DOC_FILES) +$(MAN1S) : %.1 : $(GDB_DOC_FILES) version.subst $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) $(SILENCE) rm -f $*.pod -$(MAN5S) : %.5 : $(GDB_DOC_FILES) +$(MAN5S) : %.5 : $(GDB_DOC_FILES) version.subst $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) -- 2.25.4