summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-18 14:19:50 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-18 14:19:50 (EDT)
commita6cee6c601eba39a5d97cf215ae07ec62f536777 (patch)
tree1984c5d4668d256bc29f4ec72dcf8818309f91a9
parent7be374c28308222f4558a76984996f785eefbb51 (diff)
gcc: Provide gcc and cc links if host == target.
-rwxr-xr-xgcc.pkg.in/postinst7
-rwxr-xr-xgcc.pkg.in/prerm5
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc.pkg.in/postinst b/gcc.pkg.in/postinst
index 9fd34c0..c0be054 100755
--- a/gcc.pkg.in/postinst
+++ b/gcc.pkg.in/postinst
@@ -1,5 +1,8 @@
#! /bin/sh
-if [ "${1}" = configure ]; then
- update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 20
+if [ "x${1}" = 'xconfigure' ]; then
+ if [ "x$(cat /etc/proteanos_arch)" = 'x@PKG_TARGET_ARCH@' ]; then
+ ln -sf @PKG_TARGET_ARCH@-gcc /usr/bin/gcc
+ update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 20
+ fi
fi
diff --git a/gcc.pkg.in/prerm b/gcc.pkg.in/prerm
index 5d0150b..a980d35 100755
--- a/gcc.pkg.in/prerm
+++ b/gcc.pkg.in/prerm
@@ -1,5 +1,8 @@
#! /bin/sh
if [ "${1}" = remove ]; then
- update-alternatives --remove cc /usr/bin/gcc
+ if [ "x$(cat /etc/proteanos_arch)" = 'x@PKG_TARGET_ARCH@' ]; then
+ rm -f /usr/bin/gcc
+ update-alternatives --remove cc /usr/bin/gcc
+ fi
fi