Skip to content

Commit 15fb3ce

Browse files
luismgsilvaclaziss
authored andcommitted
Option for specifying custom source path.
Set source path with `---with-<tool>-src` (e.i --with-gcc-src=/path/to/gcc). Use builtin source by defaul. Signed-off-by: Luis Silva <[email protected]>
1 parent e731812 commit 15fb3ce

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Makefile.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,31 @@ LINUX_BRANCH := arc64
2121

2222
-include build.config
2323

24+
25+
BINUTILS_SRCDIR := @with_binutils_src@
26+
ifeq ($(BINUTILS_SRCDIR),)
2427
BINUTILS_SRCDIR := $(srcdir)/binutils-gdb
28+
endif
29+
NEWLIB_SRCDIR := @with_newlib_src@
30+
ifeq ($(NEWLIB_SRCDIR),)
2531
NEWLIB_SRCDIR := $(srcdir)/newlib
32+
endif
33+
GCC_SRCDIR := @with_gcc_src@
34+
ifeq ($(GCC_SRCDIR),)
2635
GCC_SRCDIR := $(srcdir)/gcc
36+
endif
37+
GLIBC_SRCDIR := @with_glibc_src@
38+
ifeq ($(GLIBC_SRCDIR),)
2739
GLIBC_SRCDIR := $(srcdir)/glibc
40+
endif
41+
LINUX_SRCDIR := @with_linux_src@
42+
ifeq ($(LINUX_SRCDIR),)
2843
LINUX_SRCDIR := $(srcdir)/linux
44+
endif
45+
QEMU_SRCDIR := @with_qemu_src@
46+
ifeq ($(QEMU_SRCDIR),)
2947
QEMU_SRCDIR := $(srcdir)/qemu
48+
endif
3049

3150
SYSROOT := $(INSTALL_DIR)/sysroot
3251

configure.ac

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,27 @@ AS_IF([test "x$with_cmodel" != x],
164164
[AC_SUBST(cmodel, "")])
165165
# [AC_SUBST(cmodel, -mcmodel=medlow)])
166166

167+
AC_DEFUN([AX_ARG_WITH_SRC],
168+
[{m4_pushdef([opt_name], with_$1_src)
169+
AC_ARG_WITH($1-src,
170+
[AS_HELP_STRING([--with-$1-src],[Set $1 source path, use builtin source by default])],
171+
[],
172+
[opt_name=default]
173+
)
174+
AS_IF([test "x$opt_name" != xdefault],
175+
[AC_SUBST(opt_name,$opt_name)],
176+
[AC_SUBST(opt_name,"\$(srcdir)/$2")])
177+
m4_popdef([opt_name])
178+
}])
179+
180+
AX_ARG_WITH_SRC(binutils, binutils)
181+
AX_ARG_WITH_SRC(newlib, newlib)
182+
AX_ARG_WITH_SRC(gcc, gcc)
183+
AX_ARG_WITH_SRC(glibc, glibc)
184+
AX_ARG_WITH_SRC(linux, linux)
185+
AX_ARG_WITH_SRC(qemu, qemu)
186+
187+
167188
AC_ARG_WITH(target_cflags,
168189
[AS_HELP_STRING([--with-target-cflags],
169190
[Add extra target flags for C for library code])],

0 commit comments

Comments
 (0)