summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild28
1 files changed, 8 insertions, 20 deletions
diff --git a/build b/build
index ee8c564..7bdbb41 100755
--- a/build
+++ b/build
@@ -19,6 +19,7 @@ installcross_targets = installcross-$(OPK_HOST_ARCH)
base_version = $$(printf '%s\n' '$(OPK_SOURCE)' | sed 's/^gcc-//')
target = $$(printf '%s' '$@' | sed 's/^[a-z]*-//')
+target_gnu = $$(oh-architecture $(target))
builddir = obj-$(target)
destdir = dest-$(target)
@@ -159,19 +160,10 @@ $(installnative_targets):
oh-autoinstall -B "$(builddir)" -d "$(destdir)" -T install -- \
user_tooldir_prefix="/usr/lib/$(target)/gcc-$(base_version)"
# 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/"); \
- ln -sf $(target)-$$(printf '%s' \
- $(destdir)/usr/bin/*-$${f}-$(base_version) | \
- sed "s/^.*-\($${f}\)/\1/") \
- $(destdir)/usr/bin/$$(printf '%s' \
- $(destdir)/usr/bin/*-$${f}-$(base_version) | \
- sed "s/^.*-\($${f}\)/\1/"); \
+ rm -f $(destdir)/usr/bin/$(target_gnu)-*
+ for f in $(destdir)/usr/bin/*; do f="$${f##*/}"; \
+ mv $(destdir)/usr/bin/$${f} $(destdir)/usr/bin/$(target)-$${f};\
+ ln -s $(target)-$${f} $(destdir)/usr/bin/$${f}; \
done
# Move libstdc++.so link.
rm -f $(destdir)/usr/lib/$(target)/libstdc++.so
@@ -277,13 +269,9 @@ $(installcross_targets):
toolexeclibdir="/usr/lib/$(target)" \
MULTIOSDIR=.
# 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/"); \
+ rm -f $(destdir)/usr/bin/$(target_gnu)-*
+ for f in $(destdir)/usr/bin/*; do f="$${f##*/}"; \
+ mv $(destdir)/usr/bin/$${f} $(destdir)/usr/bin/$(target)-$${f};\
done
libdir=/usr/lib/$(target) && \
rm -Rf \