From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 5F7D9385800F for ; Sun, 13 Jun 2021 05:23:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F7D9385800F Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 7A72133BEAE for ; Sun, 13 Jun 2021 05:23:56 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] gnulib: define the path to gnulib's parent dir Date: Sun, 13 Jun 2021 01:23:52 -0400 Message-Id: <20210613052352.18771-1-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <87r1h9io1n.fsf@tromey.com> References: <87r1h9io1n.fsf@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 05:23:59 -0000 The current setting assumes that gnulib is only used by dirs immediately under the source root. Trying to build it two or more levels deep fails. Switch GNULIB_BUILDDIR to a relative GNULIB_PARENT_DIR so that it can be used to construct both the build & source paths. --- gdb/Makefile.in | 4 ++-- gdbserver/Makefile.in | 4 ++-- gnulib/Makefile.gnulib.inc.in | 10 ++++++---- sim/common/Make-common.in | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index f664d964536d..b3d264f267cb 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -245,8 +245,8 @@ CODESIGN_CERT = @CODESIGN_CERT@ GDBFLAGS = # Helper code from gnulib. -GNULIB_BUILDDIR = ../gnulib -include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc +GNULIB_PARENT_DIR = .. +include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc SUPPORT = ../gdbsupport LIBSUPPORT = $(SUPPORT)/libgdbsupport.a diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in index f7ade7d61d5c..12e9b2777aef 100644 --- a/gdbserver/Makefile.in +++ b/gdbserver/Makefile.in @@ -122,8 +122,8 @@ ustlibs = @ustlibs@ ustinc = @ustinc@ # gnulib -GNULIB_BUILDDIR = ../gnulib -include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc +GNULIB_PARENT_DIR = .. +include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc # Where is the INTL library? Typically in ../intl. INTL = @LIBINTL@ diff --git a/gnulib/Makefile.gnulib.inc.in b/gnulib/Makefile.gnulib.inc.in index 822f892a189a..cf69b835cfda 100644 --- a/gnulib/Makefile.gnulib.inc.in +++ b/gnulib/Makefile.gnulib.inc.in @@ -32,13 +32,15 @@ # INCGNU: A list of -I.... include paths that should be passed to the # compiler, these are where the gnulib headers can be found. -ifndef GNULIB_BUILDDIR -$(error missing GNULIB_BUILDDIR) +# Packages must define the relative path to gnulib's parent dir. +ifndef GNULIB_PARENT_DIR +$(error missing GNULIB_PARENT_DIR) endif -LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a +LIBGNU = $(GNULIB_PARENT_DIR)/gnulib/import/libgnu.a LIBGNU_EXTRA_LIBS = @FREXPL_LIBM@ @FREXP_LIBM@ @INET_NTOP_LIB@ \ @LIBTHREAD@ @LIB_GETLOGIN@ @LIB_GETRANDOM@ \ @LIB_HARD_LOCALE@ @LIB_MBRTOWC@ \ @LIB_SETLOCALE_NULL@ @LIBINTL@ @LIB_SELECT@ @LIBSOCKET@ -INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import +INCGNU = -I$(srcdir)/$(GNULIB_PARENT_DIR)/gnulib/import \ + -I$(GNULIB_PARENT_DIR)/gnulib/import diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 7a5bbc1a985c..3dab9ca1fd14 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -41,8 +41,8 @@ srcroot = $(srcdir)/../.. srcsim = $(srcdir)/.. # Helper code from gnulib. -GNULIB_BUILDDIR = ../../gnulib -include $(GNULIB_BUILDDIR)/Makefile.gnulib.inc +GNULIB_PARENT_DIR = ../.. +include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc prefix = @prefix@ exec_prefix = @exec_prefix@ -- 2.31.1