summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-18 14:38:34 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-18 14:38:34 (EDT)
commitdaeb558e64fa3aefde7003aed78db452d03843aa (patch)
tree7307d56336122804717d983ae1ae66582b7a4fae
parentae27cbc255615b578207924d3b159e41aadee626 (diff)
gcc: Provide c89 and c99 links if host == target.
-rwxr-xr-xgcc.pkg.in/postinst6
-rwxr-xr-xgcc.pkg.in/prerm6
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc.pkg.in/postinst b/gcc.pkg.in/postinst
index c0be054..ae943bc 100755
--- a/gcc.pkg.in/postinst
+++ b/gcc.pkg.in/postinst
@@ -3,6 +3,12 @@
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
+ printf '#!/bin/sh\nexec gcc -std=c89 "${@}"\n' >/usr/bin/c89.gcc
+ printf '#!/bin/sh\nexec gcc -std=c99 "${@}"\n' >/usr/bin/c99.gcc
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 20
+ update-alternatives --install /usr/bin/c89 c89 \
+ /usr/bin/c89.gcc 20
+ update-alternatives --install /usr/bin/c99 c99 \
+ /usr/bin/c99.gcc 20
fi
fi
diff --git a/gcc.pkg.in/prerm b/gcc.pkg.in/prerm
index a980d35..c61b46e 100755
--- a/gcc.pkg.in/prerm
+++ b/gcc.pkg.in/prerm
@@ -2,7 +2,11 @@
if [ "${1}" = remove ]; then
if [ "x$(cat /etc/proteanos_arch)" = 'x@PKG_TARGET_ARCH@' ]; then
- rm -f /usr/bin/gcc
update-alternatives --remove cc /usr/bin/gcc
+ update-alternatives --remove c89 /usr/bin/c89.gcc
+ update-alternatives --remove c99 /usr/bin/c99.gcc
+ rm -f /usr/bin/gcc
+ rm -f /usr/bin/c89.gcc
+ rm -f /usr/bin/c99.gcc
fi
fi