Branch
Hash :
94046104
Author :
Thomas de Grivel
Date :
2020-02-24T15:19:27
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
#! /bin/sh
SED='sed y+/+\\+'
MODE=$1
LIB_DIR=$2
LIB_NAME=$3
cd $LIB_DIR
install () {
for d in `ls -d */`; do
F=`ls -1 ${d}.libs/*.dll 2>/dev/null | head -n 1`
if [[ "x$F" != "x" ]]; then
dd=`echo $d | sed 's:/*$::'`
echo
echo ' SetOutPath "$INSTDIR/lib/'$LIB_NAME'/'${dd}'"' | ${SED}
ls -1 ${dd}/.libs/*.dll ${dd}/.libs/*.la 2>/dev/null | \
awk '{print " File \"'$LIB_DIR'/"$$1"\""}' | ${SED}
fi
done
}
uninstall () {
for d in `ls -d */`; do
F=`ls -1 ${d}.libs/*.dll 2>/dev/null | head -n 1`
if [[ "x$F" != "x" ]]; then
cd ${d}.libs
ls -1 *.dll *.la 2>/dev/null | \
awk '{print " Delete \"$INSTDIR/lib/'$LIB_NAME'/'$d'"$$1"\""}' | \
${SED}
echo ' RMDir "$INSTDIR/lib/'$LIB_NAME'/'${d}'"' | ${SED}
echo
cd -
fi
done
echo ' RMDir "$INSTDIR/lib/'$LIB_NAME'"' | ${SED}
}
case "$MODE" in
"install")
install;;
"uninstall")
uninstall;;
*)
echo "Usage: $0 (install|uninstall) lib_dir lib_name";;
esac