Skip to content

Commit 217e7f3

Browse files
authored
Merge pull request #1023 from cmuellner/riscv-mainline
Allow source-override for QEMU
2 parents 75b82e1 + b83ee52 commit 217e7f3

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

Makefile.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ GLIBC_SRCDIR := @with_glibc_src@
99
MUSL_SRCDIR := @with_musl_src@
1010
LINUX_HEADERS_SRCDIR := @with_linux_headers_src@
1111
GDB_SRCDIR := @with_gdb_src@
12+
QEMU_SRCDIR := @with_qemu_src@
1213

1314
SIM:=qemu
1415

@@ -243,6 +244,12 @@ else
243244
GLIBC_SRC_GIT :=
244245
endif
245246

247+
ifeq ($(findstring $(srcdir),$(QEMU_SRCDIR)),$(srcdir))
248+
QEMU_SRC_GIT := $(QEMU_SRCDIR)/.git
249+
else
250+
QEMU_SRC_GIT :=
251+
endif
252+
246253
ifneq ("$(wildcard $(GCC_SRCDIR)/.git)","")
247254
GCCPKGVER := g$(shell git -C $(GCC_SRCDIR) describe --always --dirty --exclude '*')
248255
else
@@ -820,7 +827,7 @@ stamps/build-pk64: pk-src stamps/build-gcc-newlib-stage2
820827
mkdir -p $(dir $@)
821828
date > $@
822829

823-
stamps/build-qemu: $(srcdir)/qemu $(srcdir)/qemu/.git
830+
stamps/build-qemu: $(QEMU_SRCDIR) $(QEMU_SRC_GIT)
824831
rm -rf $@ $(notdir $@)
825832
mkdir $(notdir $@)
826833
cd $(notdir $@) && $</configure \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,5 @@ Here is the list of configure option for specify source tree:
240240
--with-musl-src
241241
--with-gdb-src
242242
--with-linux-headers-src
243+
--with-qemu-src
243244

configure

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ PACKAGE_URL=''
585585
ac_subst_vars='LTLIBOBJS
586586
LIBOBJS
587587
with_linux_headers_src
588+
with_qemu_src
588589
with_gdb_src
589590
with_musl_src
590591
with_glibc_src
@@ -686,6 +687,7 @@ with_newlib_src
686687
with_glibc_src
687688
with_musl_src
688689
with_gdb_src
690+
with_qemu_src
689691
with_linux_headers_src
690692
'
691693
ac_precious_vars='build_alias
@@ -1352,6 +1354,7 @@ Optional Packages:
13521354
--with-glibc-src Set glibc source path, use builtin source by default
13531355
--with-musl-src Set musl source path, use builtin source by default
13541356
--with-gdb-src Set gdb source path, use builtin source by default
1357+
--with-qemu-src Set qemu source path, use builtin source by default
13551358
--with-linux-headers-src
13561359
Set linux-headers source path, use builtin source by
13571360
default
@@ -3614,6 +3617,25 @@ fi
36143617
else
36153618
with_gdb_src="\$(srcdir)/riscv-gdb"
36163619
3620+
fi
3621+
3622+
}
3623+
{
3624+
3625+
# Check whether --with-qemu-src was given.
3626+
if test "${with_qemu_src+set}" = set; then :
3627+
withval=$with_qemu_src;
3628+
else
3629+
with_qemu_src=default
3630+
3631+
fi
3632+
3633+
if test "x$with_qemu_src" != xdefault; then :
3634+
with_qemu_src=$with_qemu_src
3635+
3636+
else
3637+
with_qemu_src="\$(srcdir)/riscv-qemu"
3638+
36173639
fi
36183640
36193641
}

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ AX_ARG_WITH_SRC(newlib)
221221
AX_ARG_WITH_SRC(glibc)
222222
AX_ARG_WITH_SRC(musl)
223223
AX_ARG_WITH_SRC(gdb)
224+
AX_ARG_WITH_SRC(qemu)
224225

225226
AC_ARG_WITH(linux-headers-src,
226227
[AC_HELP_STRING([--with-linux-headers-src],

0 commit comments

Comments
 (0)