diff options
-rwxr-xr-x | build | 30 | ||||
-rwxr-xr-x | config | 3 |
2 files changed, 29 insertions, 4 deletions
@@ -84,6 +84,13 @@ $(install_targets): build fincludedir="$${libsubdir}/finclude" \ toolexeclibdir="/usr/lib/$(target)" \ MULTIOSDIR= + if [ "x$(target)" = 'x$(OPK_HOST_ARCH)' ]; then \ + $(MAKE) -f ../build "installnative-$(target)"; \ + else \ + $(MAKE) -f ../build "installcross-$(target)"; \ + fi + +$(installnative_targets): # Change the target architecture prefix of files in /usr/bin. rm -f $(destdir)/usr/bin/*-gcc-$(base_version).* for f in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib; do \ @@ -192,9 +199,6 @@ $(install_targets): build gcc-$(base_version)-$(target) \ cpp-$(base_version)-$(target) \ g++-$(base_version)-$(target) \ - "; \ - if [ "x$(target)" = 'x$(OPK_HOST_ARCH)' ]; then \ - OPK_PACKAGES="$${OPK_PACKAGES} \ libgcc.1 \ libssp.0 \ libgomp.1 \ @@ -209,6 +213,26 @@ $(install_targets): build export OPK_PACKAGES; \ oh-installfiles -d "$(destdir)" +$(installcross_targets): + # Change the target architecture prefix of files in /usr/bin. + rm -f $(destdir)/usr/bin/*-gcc-$(base_version).* + for f in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib; do \ + rm -f $(destdir)/usr/bin/$${f}-$(base_version); \ + mv $(destdir)/usr/bin/*-$${f}-$(base_version) \ + $(destdir)/usr/bin/$(target)-$$(printf '%s' \ + $(destdir)/usr/bin/*-$${f}-$(base_version) | \ + sed "s/^.*-\($${f}\)/\1/"); \ + done + oh-fixperms -d "$(destdir)" + oh-strip -d "$(destdir)" + OPK_PACKAGES="\ + gcc-$(base_version)-$(target) \ + cpp-$(base_version)-$(target) \ + g++-$(base_version)-$(target) \ + "; \ + export OPK_PACKAGES; \ + oh-installfiles -d "$(destdir)" + install: $(install_targets) # POSIX.1-2008: @@ -18,7 +18,8 @@ main() PKG_TARGET_ARCH="${arch}" configure_build done >targets.mk - for stamp in configure build install; do + for stamp in configure build install \ + installnative installcross; do printf '%s_targets = \\\n' "${stamp}" \ >>targets.mk for arch in ${PKG_TARGETS}; do |