diff options
Diffstat (limited to 'build')
-rwxr-xr-x | build | 28 |
1 files changed, 18 insertions, 10 deletions
@@ -56,7 +56,8 @@ install: build # All of these macro settings are effective thanks to # `patches/01_pass-some-dirs-to-child-makes.patch`. for target in $$(cat ../targets); do \ - oh-autoinstall -B "build-$${target}" CFLAGS='$(CFLAGS)' \ + oh-autoinstall -B "build-$${target}" -d "binutils-$${target}.data" \ + CFLAGS='$(CFLAGS)' \ tooldir='/usr/tool' scriptdir="/usr/lib/$${target}" \ bfdlibdir="/usr/lib/$(OPK_HOST_ARCH)/$${target}" \ bfdincludedir="/usr/include/$(OPK_HOST_ARCH)/$${target}" || \ @@ -65,11 +66,16 @@ install: build # /usr/tool/bin (TOOLBINDIR) contains hard links to tools. A quick look at # the code suggests we don't need them; ld *should* work without them in any # sane configuration. - rm -Rf dest/usr/tool # We don't need a static libiberty. - find dest/usr/lib -name 'libiberty.a' -exec rm -f '{}' ';' # Remove static library dependency metadata generated by libtool. - find dest/usr/lib -name '*.la' -exec rm -f '{}' ';' + for target in $$(cat ../targets); do \ + rm -Rf "binutils-$${target}.data/usr/tool" && \ + find "binutils-$${target}.data/usr/lib" -name 'libiberty.a' \ + -exec rm -f '{}' ';' && \ + find "binutils-$${target}.data/usr/lib" -name '*.la' \ + -exec rm -f '{}' ';' || \ + exit 1; \ + done # Make symbolic links to native utilities. for target in $$(cat ../targets); do \ if [ '$(OPK_HOST_ARCH)' = "$${target}" ]; then \ @@ -79,17 +85,19 @@ install: build fi; \ done # Write GNU ld configuration to point to BFD libraries. - mkdir -p dest/etc/ld.so.conf.d for target in $$(cat ../targets); do \ + mkdir -p "binutils-$${target}.data/etc/ld.so.conf.d" && \ echo '# GNU BFD libraries' \ - >"dest/etc/ld.so.conf.d/bfd_$(OPK_HOST_ARCH)_$${target}" && \ + >"binutils-$${target}.data/etc/ld.so.conf.d/bfd_$(OPK_HOST_ARCH)_$${target}" && \ echo "/usr/lib/$(OPK_HOST_ARCH)/$${target}" \ - >>"dest/etc/ld.so.conf.d/bfd_$(OPK_HOST_ARCH)_$${target}"; \ + >>"binutils-$${target}.data/etc/ld.so.conf.d/bfd_$(OPK_HOST_ARCH)_$${target}"; \ done # Post-process and install everything. - oh-fixperms - oh-strip - oh-installfiles + for target in $$(cat ../targets); do \ + oh-fixperms -d "binutils-$${target}.data" && \ + oh-strip -d "binutils-$${target}.data" || \ + exit 1; \ + done clean: for target in $$(cat ../targets); do \ |