sim: switch common srcdir to abs_srcdir

Message ID 20210623025952.15180-1-vapier@gentoo.org
State New
Headers show
Series
  • sim: switch common srcdir to abs_srcdir
Related show

Commit Message

Rustam Kovhaev via Gdb-patches June 23, 2021, 2:59 a.m.
We rewrite srcdir in subdir Makefiles that we generate from the common
parent dir since it points to the parent dir.  Since @srcdir@ can be a
variety of formats (relative & absolute), switch to @abs_srcdir@ which
is a lot easier to adjust.  Our use of srcdir in here should handle it.
---
 sim/common/Make-common.in |  2 +-
 sim/configure             | 36 ++++++++++++++++++------------------
 sim/configure.ac          |  2 +-
 3 files changed, 20 insertions(+), 20 deletions(-)

-- 
2.31.1

Comments

Rustam Kovhaev via Gdb-patches June 23, 2021, 1:01 p.m. | #1
On 2021-06-22 10:59 p.m., Mike Frysinger via Gdb-patches wrote:
> We rewrite srcdir in subdir Makefiles that we generate from the common

> parent dir since it points to the parent dir.  Since @srcdir@ can be a

> variety of formats (relative & absolute), switch to @abs_srcdir@ which

> is a lot easier to adjust.  Our use of srcdir in here should handle it.


That fixes it for me, thanks.

Simon

Patch

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 4bf1e2e21e27..c203b4e1c7bf 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -34,7 +34,7 @@ 
 
 ## COMMON_PRE_CONFIG_FRAG
 
-srcdir = @srcdir@
+srcdir = @abs_srcdir@
 VPATH = $(srcdir):$(srccom)
 srccom = $(srcdir)/../common
 srcroot = $(srcdir)/../..
diff --git a/sim/configure.ac b/sim/configure.ac
index e227f112d8b9..3632b559bf0f 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -69,7 +69,7 @@  m4_define([SIM_BUILD_TARGET], [dnl
     AC_CONFIG_COMMANDS([$1/Makefile],
 [sed -n \
 	-e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ {
-		/^srcdir / { s:= := ../:; s:$:/$1:; }
+		/^srcdir = / s:$:/$1:
 		p
 	}' \
 	<Make-common.sim >$1/Makesim1.tmp