#!/bin/bash

. /etc/profile
. /etc/flenv

# select installed gcc
PS3='select gcc version : '
gccver=
select selected in $gccvers cancel; do
	if [ "$selected" == "cancel" ]; then
		echo ""
		echo "INFO: cancelled."
		echo ""
		exit 0
	fi
	if [ -n "$selected" ]; then
		gccver=$selected
		break
	fi
done


# copy version-specific files
duplist=`cat $gccfiles`
for dupfile in $duplist ; do
	mkdir -p $mingwpath/`dirname $dupfile`
	cp -f $mingwpath/$gccver/$dupfile $mingwpath/$dupfile
done

echo ""
echo "INFO: $gccver installed."
echo ""
