summaryrefslogtreecommitdiffstats
path: root/gcc.pkg.in/postinst
blob: 0aa47969965998ea52090fe9f99135bf735d67aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh

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
		chmod a+x /usr/bin/c89.gcc
		chmod a+x /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