offer REALGCC variable to configure musl-gcc wrapper at runtime
authorRich Felker <dalias@aerifal.cx>
Fri, 21 Sep 2012 17:47:26 +0000 (13:47 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 21 Sep 2012 17:47:26 +0000 (13:47 -0400)
this is useful when the underlying gcc is already a wrapper, which is
the case at least on some uclibc-based system images. it's also useful
for running an older/newer/nondefault version of gcc.

Makefile

index 10c174ce48cb08878c21f201872ecd983b0417e2..3c55c8f24c9dd566ae2e4033f4afe85d16093cc3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,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 gcc "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
+       printf '#!/bin/sh\nexec "$${REALGCC:-gcc}" "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
        chmod +x $@
 
 $(DESTDIR)$(bindir)/%: tools/%