Skip to content

Commit e9ed118

Browse files
committed
Option for specifying custom parent source path
Set the parent source path with `--with-src` (e.i --with-src=/path/to/parent) Use `arc-gnu-toolchain` as parent source by default. Signed-off-by: Luis Silva <[email protected]>
1 parent 15fb3ce commit e9ed118

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

Makefile.in

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,33 @@ LINUX_BRANCH := arc64
2323

2424

2525
BINUTILS_SRCDIR := @with_binutils_src@
26-
ifeq ($(BINUTILS_SRCDIR),)
27-
BINUTILS_SRCDIR := $(srcdir)/binutils-gdb
28-
endif
2926
NEWLIB_SRCDIR := @with_newlib_src@
30-
ifeq ($(NEWLIB_SRCDIR),)
31-
NEWLIB_SRCDIR := $(srcdir)/newlib
32-
endif
3327
GCC_SRCDIR := @with_gcc_src@
34-
ifeq ($(GCC_SRCDIR),)
35-
GCC_SRCDIR := $(srcdir)/gcc
36-
endif
3728
GLIBC_SRCDIR := @with_glibc_src@
38-
ifeq ($(GLIBC_SRCDIR),)
39-
GLIBC_SRCDIR := $(srcdir)/glibc
40-
endif
4129
LINUX_SRCDIR := @with_linux_src@
42-
ifeq ($(LINUX_SRCDIR),)
43-
LINUX_SRCDIR := $(srcdir)/linux
44-
endif
4530
QEMU_SRCDIR := @with_qemu_src@
46-
ifeq ($(QEMU_SRCDIR),)
47-
QEMU_SRCDIR := $(srcdir)/qemu
31+
32+
PARENT_SRCDIR = @with_src@
33+
34+
ifneq ($(PARENT_SRCDIR),)
35+
ifeq ($(BINUTILS_SRCDIR),$(srcdir)/binutils-gdb)
36+
BINUTILS_SRCDIR = $(PARENT_SRCDIR)/binutils-gdb
37+
endif
38+
ifeq ($(NEWLIB_SRCDIR),$(srcdir)/newlib)
39+
NEWLIB_SRCDIR = $(PARENT_SRCDIR)/newlib
40+
endif
41+
ifeq ($(GCC_SRCDIR),$(srcdir)/gcc)
42+
GCC_SRCDIR = $(PARENT_SRCDIR)/gcc
43+
endif
44+
ifeq ($(GLIBC_SRCDIR),$(srcdir)/glibc)
45+
GLIBC_SRCDIR = $(PARENT_SRCDIR)/glibc
46+
endif
47+
ifeq ($(LINUX_SRCDIR),$(srcdir)/linux)
48+
LINUX_SRCDIR = $(PARENT_SRCDIR)/linux
49+
endif
50+
ifeq ($(QEMU_SRCDIR),$(srcdir)/qemu)
51+
QEMU_SRCDIR = $(PARENT_SRCDIR)/qemu
52+
endif
4853
endif
4954

5055
SYSROOT := $(INSTALL_DIR)/sysroot

configure.ac

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,23 @@ AC_DEFUN([AX_ARG_WITH_SRC],
177177
m4_popdef([opt_name])
178178
}])
179179

180-
AX_ARG_WITH_SRC(binutils, binutils)
180+
AX_ARG_WITH_SRC(binutils, binutils-gdb)
181181
AX_ARG_WITH_SRC(newlib, newlib)
182182
AX_ARG_WITH_SRC(gcc, gcc)
183183
AX_ARG_WITH_SRC(glibc, glibc)
184184
AX_ARG_WITH_SRC(linux, linux)
185185
AX_ARG_WITH_SRC(qemu, qemu)
186186

187+
AC_ARG_WITH(src,
188+
[AS_HELP_STRING([--with-src],
189+
[Select parent source path, use `arc-gnu-toolchain` as parent source path by default])],
190+
[],
191+
[]
192+
)
193+
AS_IF([test "x$with_src" != x],
194+
[AC_SUBST(with_src, $with_src)],
195+
[AC_SUBST(with_src, "")])
196+
187197

188198
AC_ARG_WITH(target_cflags,
189199
[AS_HELP_STRING([--with-target-cflags],

0 commit comments

Comments
 (0)