X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Makefile.upstream;h=d08a488078e4c8ff7df6f230008645c8f8599a1a;hb=8592fbb856c521cf0c2728d58db50350f2caebcd;hp=f291d5d0a66e31ab82ac4bf9551ac8869a095bc7;hpb=86c49121b2ce61e254cc0851080402ce80abb9fd;p=org.ibex.core.git diff --git a/Makefile.upstream b/Makefile.upstream index f291d5d..d08a488 100644 --- a/Makefile.upstream +++ b/Makefile.upstream @@ -4,8 +4,7 @@ # # deal with Apple's brokenness -setcc := CC="$(patsubst Darwin,/usr/bin/gcc3 -no-cpp-precomp,$(findstring Darwin,$(shell uname)))" -setcc += PATH=`pwd`/upstream/install/bin:$$PATH +setcc := $(shell test `uname` = Darwin && echo "CC=\"/usr/bin/gcc3 -no-cpp-precomp\"") # where to get stuff url_newlib-1.11.0 := ftp://sources.redhat.com/pub/newlib/newlib-1.11.0.tar.gz @@ -47,6 +46,7 @@ url_jikes-1.18 := http://www.megacz.com/tmp/jikes-1.18.tgz #ftp:// cd upstream/install/bin; ln -sf ../powerpc-apple-darwin/bin/ranlib powerpc-apple-darwin-ranlib cd upstream/install/bin; ln -sf ../powerpc-apple-darwin/bin/strip powerpc-apple-darwin-strip echo -e "#!/bin/sh\nc++filt \$$@\n" > upstream/install/bin/c++filt3; chmod +x upstream/install/bin/c++filt3 + cd upstream/install/powerpc-apple-darwin/bin; ln -s ../../bin/c++filt3 touch $@ # building gcc requires binutils @@ -67,6 +67,12 @@ configure_gcc-3.3-i686-pc-linux-gnu := --enable-threads=posix --enable-hash- configure_gcc-3.3-sparc-sun-solaris2.7 := --enable-threads=posix --disable-multilib configure_gcc-3.3-mips-unknown-elf := --enable-languages=c --nfp --enable-multilib --disable-threads +# libjpeg's configury doesn't obey --target +environment_jpeg-6b_$(target) := PATH=$(shell pwd)/upstream/install/$(target)/bin:$$PATH +environment_jpeg-6b_$(target) += CC=$(shell pwd)/upstream/install/$(target)/bin/gcc +environment_jpeg-6b_$(target) += AR="$(shell pwd)/upstream/install/$(target)/bin/ar rc" +environment_jpeg-6b_$(target) += AR2=$(shell pwd)/upstream/install/$(target)/bin/ranlib + .PRECIOUS: .vendor .download_% .configure_%_$(target) .install_%_$(target) # vendor-supplied binaries and headers; this is stuff that comes with various OSes @@ -92,7 +98,7 @@ vendor: .vendor; @true @echo -e "\n\033[1mconfiguring $*...\033[0m" mkdir -p upstream/$*/build-$(target) cd upstream/$*/build-$(target); \ - $(setcc) ../src/configure \ + $(setcc) $(environment_$*_$(target)) ../src/configure \ --target=$(target) \ --prefix=`cd ../..; pwd`/install \ $(configure_$*) \ @@ -106,9 +112,15 @@ vendor: .vendor; @true .install_%_$(target): .configure_%_$(target) @echo -e "\n\033[1mbuilding $*...\033[0m" - cd upstream/$*/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make + cd upstream/$*/build-$(target); \ + $(setcc) PATH=$$PATH:`pwd`/../../install/bin \ + $(environment_$*_$(target)) \ + make $(setcc) $(environment_$*_$(target)) @echo -e "\n\033[1minstalling $*...\033[0m" - cd upstream/$*/build-$(target); $(setcc) PATH=$$PATH:`pwd`/../../install/bin make install + cd upstream/$*/build-$(target); \ + $(setcc) PATH=$$PATH:`pwd`/../../install/bin \ + $(environment_$*_$(target)) \ + make install $(setcc) $(environment_$*_$(target)) touch $@ # jikes has a special target to autodetect a pre-installed jikes, and to autodetect the JVM's $CLASSPATH