#!/bin/sh

. /etc/profile
. /etc/flenv

escape=$flpath/bin/escape.sh

usage(){
	echo "usage1: $0 static"
	echo "usage2: $0 dll"
	exit 1
}

case $1 in
	expat) libs='libexpat.dll.a libexpat.la' ;;
	iconv) libs='libiconv.dll.a libiconv.la libcharset.dll.a libcharset.la' ;;
	png)   libs='libpng14.dll.a libpng.dll.a' ;;
	popt)  libs='libpopt.dll.a libpopt.la' ;;
	xml2)  libs='libxml2.dll.a libxml2.la' ;;
	z)     libs='libz.dll.a' ;;
	*)     usage ;;
esac

case $2 in
	static|s)
		$escape escape $mingwpath/lib $libs
		echo "$1 is now for static library."
		;;
	dll|d)
		$escape restore $mingwpath/lib $libs
		echo "$1 is now for dll."
		;;
	*)
		usage
		;;
esac
