X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=lfs%2Fcleanup-toolchain;h=a818222025964d12ced80cef8016abcb33faeb53;hb=c8ead4a543859582497e107173c650cec4203d4f;hp=0dbebbcbb1d6744c0f479d9149e1ed02d1739e51;hpb=15679d9f9689003c7a79fc3875307b666e67a04f;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/lfs/cleanup-toolchain b/lfs/cleanup-toolchain index 0dbebbcbb..a81822202 100644 --- a/lfs/cleanup-toolchain +++ b/lfs/cleanup-toolchain @@ -29,7 +29,7 @@ include Config VER = ipfire THISAPP = cleanup-toolchain -TARGET = $(DIR_INFO)/$(THISAPP)-tools +TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools ############################################################################### # Top-level Rules @@ -51,8 +51,31 @@ md5 : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) +ifeq "$(PASS)" "1" + mv -v /tools/bin/{ld,ld-old} + mv -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old} + cp -v /tools/bin/{ld-new,ld} + ln -sv /tools/bin/ld /tools/i686-pc-linux-gnu/bin/ld + gcc -dumpspecs > /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs + sed 's@^/lib/ld-linux.so.2@/tools&@g' /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs > tempspecfile + mv -vf tempspecfile /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs + find /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/include/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; + rm -vf `grep -l "DO NOT EDIT THIS FILE" /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/include/*` +endif +ifeq "$(PASS)" "2" -strip --strip-debug /tools/lib/* -strip --strip-unneeded /tools/{,s}bin/* - rm -rfv /tools/{info,man} + rm -rfv /tools/{info,man} /usr/local/man chown -R root:root /tools +endif +ifeq "$(PASS)" "3" + mv -v /tools/bin/{ld,ld-old} + mv -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old} + mv -v /tools/bin/{ld-new,ld} + ln -sv /tools/bin/ld /tools/i686-pc-linux-gnu/bin/ld + gcc -dumpspecs | \ + perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ + -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > \ + /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs +endif @$(POSTBUILD)