Add linux pack and run scripts.
This commit is contained in:
15
scripts/GUI.sh
Normal file
15
scripts/GUI.sh
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 获取应用名称(如应用名称为app,那么脚本为app.sh
|
||||||
|
appname=`basename $0 | sed s,\.sh$,,`
|
||||||
|
# 获取应用当前目录
|
||||||
|
dirname=`dirname $0`
|
||||||
|
tmp="${dirname#?}"
|
||||||
|
# 判断目录是不是根目录
|
||||||
|
if [ "${dirname%$tmp}" != "/" ];
|
||||||
|
then
|
||||||
|
dirname=$PWD/$dirname
|
||||||
|
fi
|
||||||
|
# 将当前目录(库所在目录)加入环境变量
|
||||||
|
LD_LIBRARY_PATH=$dirname
|
||||||
|
export LD_LIBRARY_PATH
|
||||||
|
# 运行
|
||||||
9
scripts/pack.sh
Normal file
9
scripts/pack.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 发布程序的名称(参数1,执行脚本时输入)
|
||||||
|
exe=$1
|
||||||
|
# 修改输出可执行文件路径(当前路径)
|
||||||
|
destDir=`pwd`
|
||||||
|
# ldd将所有依赖库生成字符串组(#注意if后的空格只有一个)
|
||||||
|
dependenLibsList=$(ldd $exe | awk '{if (match($3,"/")){ printf("%s "),$3 } }')
|
||||||
|
# 将字符串组里面的库拷贝到目标文件夹
|
||||||
|
cp $dependenLibsList $destDir
|
||||||
Reference in New Issue
Block a user