#!/bin/bash
#
# wlld : This file is part of the Witchcraft Compiler Collection
#
# Copyright : Jonathan Brossard - endrazine@gmail.com
#
# This file is licensed under the MIT license
#
# version 0.01 Sun Jul 17 19:25:18 PDT 2016
#
#

usage () {
	echo "Usage: $0 </path/to/bin>"
	echo ""
	echo "  Returns libraries to be passed to gcc to relink this application."
	echo ""
	exit
}

getlibs (){
	ldd $1|grep "=> /"|awk '{print $1}'|sed s#"\..*"##|sed s#"^lib"#"-l"#|tr "\n" " "
	echo ""
}

if [ "$1" == "" ]
then
	usage
fi

getlibs $1

