public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
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	[thread overview]
Message-ID: <20210613052352.18771-1-vapier@gentoo.org> (raw)
In-Reply-To: <87r1h9io1n.fsf@tromey.com>

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


  reply	other threads:[~2021-06-13  5:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 22:06 [PATCH] gnulib: allow control over srcdir Mike Frysinger
2021-06-09 14:47 ` Tom Tromey
2021-06-09 16:58   ` Mike Frysinger
2021-06-10 18:15     ` Tom Tromey
2021-06-13  5:23       ` Mike Frysinger [this message]
2021-06-14 15:23         ` [PATCH] gnulib: define the path to gnulib's parent dir Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210613052352.18771-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).