#
# 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
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
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
@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=`pwd`/../../install \
+ --prefix=`cd ../..; pwd`/install \
$(configure_$*) \
$(configure_$*-$(target))
touch $@
.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