diff options
author | P. J. McDermott <pjm@nac.net> | 2012-07-28 07:18:33 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-07-28 07:18:33 (EDT) |
commit | ce7a88a3bc6652654af43efdfdc59ac02fd7da1e (patch) | |
tree | 2f3818ebc73ee8133be40a770b8d9f4775a8d8cf /build | |
parent | 1de6a428509dbca01d2eb5c06b06e54e762af797 (diff) |
Do multiarch stuff. Blame multilib for stuff.
Diffstat (limited to 'build')
-rwxr-xr-x | build | 34 |
1 files changed, 32 insertions, 2 deletions
@@ -48,12 +48,42 @@ install.stamp: build for target in $(PKG_TARGETS); do \ cd "build-$${target}" && \ make CFLAGS='$(CFLAGS)' \ - prefix="$${PWD}/../dest/usr" tooldir="$${PWD}/../dest/usr" \ + prefix="$${PWD}/../dest/usr" tooldir="$${PWD}/../dest/usr/tool" \ + bindir="$${PWD}/../dest/usr/bin/$(OH_HOST_ARCH)" \ + libdir="$${PWD}/../dest/usr/lib/$(OH_HOST_ARCH)" \ install && \ cd ..; \ done + # tooldir contains target ldscripts and hard links to tools. + # Move ldscripts to where they belong and delete everything else. + # ldscripts should be independent of the host architecture and therefore + # coinstallable with themselves across host architectures. + for target in $(PKG_TARGETS); do \ + mv dest/usr/tool/lib/ldscripts "dest/usr/lib/$${target}" && \ + rm -Rf dest/usr/tool; \ + done + # This is a kludge to put libiberty.a in the right place. + # The problem is that libiberty's makefile asks GCC for a multilib + # directory. + for target in $(PKG_TARGETS); do \ + liberty="$$(find dest/usr/lib -name libiberty.a)" && \ + mv "$${liberty}" dest/usr/lib/$(OH_HOST_ARCH) && \ + rmdir "$${liberty%/libiberty.a}"; \ + done + # Move BFD libraries and headers into multiarch locations. + # This can't be done with *dir options; these paths are hardcoded in + # bfd/configure. + for target in $(PKG_TARGETS); do \ + target_arch_gnu=$$(oh-getarchitecture -t gnu "$${target}") && \ + mkdir dest/usr/include && \ + mkdir dest/usr/include/$(OH_HOST_ARCH) && \ + mv "dest/usr/$(OH_HOST_ARCH_GNU)/$${target_arch_gnu}/include" \ + "dest/usr/include/$(OH_HOST_ARCH)/$${target}" && \ + mv "dest/usr/$(OH_HOST_ARCH_GNU)/$${target_arch_gnu}/lib" \ + "dest/usr/lib/$(OH_HOST_ARCH)/$${target}"; \ + done # Remove static library dependency metadata generated by libtool. - rm -f ../dest/usr/lib/*.la + rm -f dest/usr/lib/$(OH_HOST_ARCH)/*.la # Make symbolic links to native utilities. for target in $(PKG_TARGETS); do \ if [ '$(OH_HOST_ARCH)' = "$${target}" ]; then \ |