-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconfigure
More file actions
73 lines (57 loc) · 1.53 KB
/
configure
File metadata and controls
73 lines (57 loc) · 1.53 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
MEMCHECK=""
MEMPOOL=""
MEMCYCLE=""
CLEAN=""
DEBUG=""
for line in $*
do
if [[ $line == "clean" ]];then
CLEAN="clean"
elif [[ $line == "memcheck" ]];then
MEMCHECK="memcheck"
elif [[ $line == "mempool" ]];then
MEMPOOL="mempool"
elif [[ $line == "memcycle" ]];then
MEMCYCLE="memcycle"
elif [[ $line == "debug" ]];then
DEBUG="debug"
fi
done
export MemCheck=$MEMCHECK
export MemPool=$MEMPOOL
export MemCycle=$MEMCYCLE
export Debug=$DEBUG
if [[ $CLEAN == "clean" ]];then
make clean
fi
version_file="./version.in"
if [[ ! -f "$version_file" ]]; then
echo "1.0.0.0" > $version_file
fi
Major=`cat $version_file | awk -F '.' '{print $1}'`
Minor=`cat $version_file | awk -F '.' '{print $2}'`
Revision=`cat $version_file | awk -F '.' '{print $3}'`
Build=`cat $version_file | awk -F '.' '{print $4}'`
CmsLastVersion=$Major.$Minor.$Revision.$Build
echo ">>>>>>>>>>last version: $CmsLastVersion"
Build=$(($Build+1))
if [ $Build -gt 255 ];then
Revision=$(($Revision+1))
Build=0
fi
if [ $Revision -gt 255 ];then
Minor=$(($Minor+1))
Revision=0
fi
CmsVersion=$Major.$Minor.$Revision.$Build
echo ">>>>>>>>>>>cur version: $CmsVersion"
AppInfo="./app/cms_app_info.h"
echo "#ifndef __CMS_APP_INFO_H__" > $AppInfo
echo "#define __CMS_APP_INFO_H__" >> $AppInfo
echo "#include <string>" >> $AppInfo
echo "#define APP_ALL_MODULE_THREAD_NUM 4" >> $AppInfo
echo "#define APP_NAME \"cms(TK-Blue)\"" >> $AppInfo
echo "#define APP_VERSION \"$CmsVersion\"" >> $AppInfo
echo "#endif" >> $AppInfo
make && echo "$CmsVersion" > version.in