加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
platform.sh 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
uname=$(uname)
libsuffix() {
case $uname in
Darwin)
if [ -z "$1" ] ; then
echo "dylib"
else
echo "$1.dylib"
fi
;;
CYGWIN_NT*)
if [ -z "$1" ] ; then
echo "a"
else
echo a.$1
fi
;;
*)
if [ -z "$1" ] ; then
echo "so"
else
echo so.$1
fi
;;
esac
}
dynlibflag() {
case $uname in
Darwin) echo "-dynamiclib" ;;
*) echo "-shared" ;;
esac
}
libnameflag() {
MAJOR=$1
INSTALLLIB=$2
case $uname in
Darwin) echo "-Wl,-install_name,$INSTALLLIB/libxdo.$MAJOR.dylib" ;;
*) echo "-Wl,-soname=libxdo.so.$MAJOR" ;;
esac
}
extralibs() {
case $uname in
CYGWIN_NT*) echo "-lrt -lxkbcommon -lXtst -lXinerama" ; ;;
Linux|GNU/kFreeBSD|GNU) echo "-lrt" ;;
esac
}
command=$1
shift
case $command in
libsuffix) $command "$@" ;;
dynlibflag) $command "$@" ;;
libnameflag) $command "$@" ;;
extralibs) $command "$@" ;;
*)
echo "Invalid $0 command, '$command'" >&2
exit 1
;;
esac
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化