aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Muellner <cmuellner@linux.com>2022-02-08 23:02:50 +0100
committerChristoph Muellner <cmuellner@linux.com>2022-02-10 17:37:03 +0100
commitb83ee522a712a60dabb6587130788add87cf3c49 (patch)
treed866a500194ab83e5d9e3b632381d38286c66420
parent75b82e1f0b4fc8537305da7e5c6059cb8c73d54f (diff)
downloadriscv-gnu-toolchain-b83ee522a712a60dabb6587130788add87cf3c49.zip
riscv-gnu-toolchain-b83ee522a712a60dabb6587130788add87cf3c49.tar.gz
riscv-gnu-toolchain-b83ee522a712a60dabb6587130788add87cf3c49.tar.bz2
Allow source-override for QEMU
This patch introduces a configure-time source-dir override for QEMU similar to the existing overrides for the other toolchain sources. Signed-off-by: Christoph Muellner <cmuellner@linux.com>
-rw-r--r--Makefile.in9
-rw-r--r--README.md1
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac1
4 files changed, 32 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index ede8573..3fe302d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,6 +9,7 @@ GLIBC_SRCDIR := @with_glibc_src@
MUSL_SRCDIR := @with_musl_src@
LINUX_HEADERS_SRCDIR := @with_linux_headers_src@
GDB_SRCDIR := @with_gdb_src@
+QEMU_SRCDIR := @with_qemu_src@
SIM:=qemu
@@ -243,6 +244,12 @@ else
GLIBC_SRC_GIT :=
endif
+ifeq ($(findstring $(srcdir),$(QEMU_SRCDIR)),$(srcdir))
+QEMU_SRC_GIT := $(QEMU_SRCDIR)/.git
+else
+QEMU_SRC_GIT :=
+endif
+
ifneq ("$(wildcard $(GCC_SRCDIR)/.git)","")
GCCPKGVER := g$(shell git -C $(GCC_SRCDIR) describe --always --dirty --exclude '*')
else
@@ -820,7 +827,7 @@ stamps/build-pk64: pk-src stamps/build-gcc-newlib-stage2
mkdir -p $(dir $@)
date > $@
-stamps/build-qemu: $(srcdir)/qemu $(srcdir)/qemu/.git
+stamps/build-qemu: $(QEMU_SRCDIR) $(QEMU_SRC_GIT)
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
diff --git a/README.md b/README.md
index 0941e6d..79b6f23 100644
--- a/README.md
+++ b/README.md
@@ -240,4 +240,5 @@ Here is the list of configure option for specify source tree:
--with-musl-src
--with-gdb-src
--with-linux-headers-src
+ --with-qemu-src
diff --git a/configure b/configure
index b510857..0532751 100755
--- a/configure
+++ b/configure
@@ -585,6 +585,7 @@ PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
LIBOBJS
with_linux_headers_src
+with_qemu_src
with_gdb_src
with_musl_src
with_glibc_src
@@ -686,6 +687,7 @@ with_newlib_src
with_glibc_src
with_musl_src
with_gdb_src
+with_qemu_src
with_linux_headers_src
'
ac_precious_vars='build_alias
@@ -1352,6 +1354,7 @@ Optional Packages:
--with-glibc-src Set glibc source path, use builtin source by default
--with-musl-src Set musl source path, use builtin source by default
--with-gdb-src Set gdb source path, use builtin source by default
+ --with-qemu-src Set qemu source path, use builtin source by default
--with-linux-headers-src
Set linux-headers source path, use builtin source by
default
@@ -3617,6 +3620,25 @@ else
fi
}
+{
+
+# Check whether --with-qemu-src was given.
+if test "${with_qemu_src+set}" = set; then :
+ withval=$with_qemu_src;
+else
+ with_qemu_src=default
+
+fi
+
+ if test "x$with_qemu_src" != xdefault; then :
+ with_qemu_src=$with_qemu_src
+
+else
+ with_qemu_src="\$(srcdir)/riscv-qemu"
+
+fi
+
+ }
# Check whether --with-linux-headers-src was given.
diff --git a/configure.ac b/configure.ac
index 00d0372..ba7dc0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,6 +221,7 @@ AX_ARG_WITH_SRC(newlib)
AX_ARG_WITH_SRC(glibc)
AX_ARG_WITH_SRC(musl)
AX_ARG_WITH_SRC(gdb)
+AX_ARG_WITH_SRC(qemu)
AC_ARG_WITH(linux-headers-src,
[AC_HELP_STRING([--with-linux-headers-src],