summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2015-06-28 23:08:19 +0200
committerRich Felker <dalias@aerifal.cx>2015-07-06 23:34:14 +0000
commitb3cd7d13fe630ba1847326242525298e361018c1 (patch)
treec9de5727a40240894dfb3fa9c290d8a955f24f21 /Makefile
parent2a780aa3050b86d888489361f04220bfb58890a1 (diff)
downloadmusl-b3cd7d13fe630ba1847326242525298e361018c1.tar.gz
musl-b3cd7d13fe630ba1847326242525298e361018c1.tar.bz2
musl-b3cd7d13fe630ba1847326242525298e361018c1.tar.xz
musl-b3cd7d13fe630ba1847326242525298e361018c1.zip
build: overhaul wrapper script system for multiple wrapper support
this overhauls part of the build system in order to support multiple toolchain wrapper scripts, as opposed to solely the musl-gcc wrapper as before. it thereby replaces --enable-gcc-wrapper with --enable-wrapper=..., which has the options 'auto' (the default, detect whether to use wrappers), 'all' (build and install all wrappers), 'no' (don't build any) and finally the options named after the individual compiler scripts (currently only 'gcc' is available) to build and install only that wrapper. the old --enable-gcc-wrapper is removed from --help, but still available. it also modifies the wrappers to use the C compiler specified to the build system as 'inner' compiler, when applicable. as wrapper detection works by probing this compiler, it may not work with any other.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2eb7b308..a1c19284 100644
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,8 @@ TOOL_LIBS = lib/musl-gcc.specs
ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
ALL_TOOLS = tools/musl-gcc
+WRAPCC_GCC = gcc
+
LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
-include config.mak
@@ -155,7 +157,7 @@ lib/musl-gcc.specs: tools/musl-gcc.specs.sh config.mak
sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
tools/musl-gcc: config.mak
- printf '#!/bin/sh\nexec "$${REALGCC:-gcc}" "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
+ printf '#!/bin/sh\nexec "$${REALGCC:-$(WRAPCC_GCC)}" "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
chmod +x $@
$(DESTDIR)$(bindir)/%: tools/%