From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1yxyN4KWxWCPcAAAWB0awg (envelope-from ) for ; Sun, 13 Jun 2021 01:24:18 -0400 Received: by simark.ca (Postfix, from userid 112) id D0C0A1F163; Sun, 13 Jun 2021 01:24:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 051551E813 for ; Sun, 13 Jun 2021 01:24:18 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 500043861845 for ; Sun, 13 Jun 2021 05:24:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 500043861845 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623561857; bh=BeDnww9UVwQctvodDoHiRlCUbLoonaFhxJvzL3YvJqk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=DxZn5HYqQtd6hpjTXVZxhAitqD5jzmIkxX05RlcoL18TBBloKf0fhddvAl5luqoip yyNdMlHsUI/ST9dhv1o/KfjRv3eY/Yh+goQ+MRglZ1Lmnt+0LkUI63Ko70GRz+cO8F 4GjIdOrYMRsg0y7AjT8R58qM6RGrrn626/SU6WMQ= 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) 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-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: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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