From: Mike Frysinger Date: Tue, 8 Jun 2021 22:04:28 +0000 (-0400) Subject: gnulib: define the path to gnulib's parent dir X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=483ab96a1bd6df30035dc2ae1a90b1b59c54ef75;p=binutils-gdb.git gnulib: define the path to gnulib's parent dir 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7f46c4a6482..4188bc8e4d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * Makefile.in (GNULIB_BUILDDIR): Rename to ... + (GNULIB_PARENT_DIR): ... this. Remove "gnulib" from value. + 2021-06-14 John Baldwin * configure.ac: Check for . diff --git a/gdb/Makefile.in b/gdb/Makefile.in index f664d964536..b3d264f267c 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/ChangeLog b/gdbserver/ChangeLog index f8d7fd65fb1..9f4fcf81603 100644 --- a/gdbserver/ChangeLog +++ b/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * Makefile.in (GNULIB_BUILDDIR): Rename to ... + (GNULIB_PARENT_DIR): ... this. Remove "gnulib" from value. + 2021-05-27 Simon Marchi * Fix some indentation mistakes throughout. @@ -5712,8 +5717,7 @@ * gdbreplay.c: Fix common/ includes. * fork-child.c: Fix common/ includes. * event-loop.c: Fix common/ includes. - * ax.c: - (enum gdb_agent_op): Fix common/ includes. + * ax.c (enum gdb_agent_op): Fix common/ includes. 2019-01-21 Tom Tromey diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in index f7ade7d61d5..12e9b2777ae 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/ChangeLog b/gnulib/ChangeLog index 223b66324ee..f571a99eb73 100644 --- a/gnulib/ChangeLog +++ b/gnulib/ChangeLog @@ -1,3 +1,10 @@ +2021-06-14 Mike Frysinger + + * Makefile.gnulib.inc.in (GNULIB_BUILDDIR): Rename to ... + (GNULIB_PARENT_DIR): ... this. + (LIBGNU): Add "/gnulib" after $(GNULIB_PARENT_DIR). + (INCGNU): Likewise. Replace .. with $(GNULIB_PARENT_DIR). + 2021-06-08 Mike Frysinger * update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add netdb. diff --git a/gnulib/Makefile.gnulib.inc.in b/gnulib/Makefile.gnulib.inc.in index 822f892a189..cf69b835cfd 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/ChangeLog b/sim/common/ChangeLog index 8f44658c7d3..5bf47a36849 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2021-06-14 Mike Frysinger + + * Make-common.in (GNULIB_BUILDDIR): Rename to ... + (GNULIB_PARENT_DIR): ... this. Remove "gnulib" from value. + 2021-06-12 Mike Frysinger * Make-common.in (COMMON_OBJS_NAMES): Add portability.o. diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 7a5bbc1a985..3dab9ca1fd1 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@