Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
be271c33
R
rocksdb
项目概览
kvdb
/
rocksdb
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
be271c33
编写于
1月 06, 2014
作者:
K
Kai Liu
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #56 from sepeth/refactor-detect-version
Refactor build_tools/build_detect_version
上级
7e70ff63
d800dc56
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
33 deletion
+16
-33
.gitignore
.gitignore
+0
-1
build_tools/build_detect_platform
build_tools/build_detect_platform
+5
-1
build_tools/build_detect_version
build_tools/build_detect_version
+11
-31
未找到文件。
.gitignore
浏览文件 @
be271c33
...
...
@@ -19,5 +19,4 @@ sst_dump
util/build_version.cc
build_tools/VALGRIND_LOGS/
coverage/COVERAGE_REPORT
util/build_version.cc.tmp
.gdbhistory
build_tools/build_detect_platform
浏览文件 @
be271c33
...
...
@@ -172,7 +172,11 @@ echo "MEMENV_SOURCES=helpers/memenv/memenv.cc" >> $OUTPUT
if
[
"
$CROSS_COMPILE
"
=
"true"
-o
"
$FBCODE_BUILD
"
=
"true"
]
;
then
# Cross-compiling; do not try any compilation tests.
# Also don't need any compilation tests if compiling on fbcode
true
# TODO(kailiu) For some fb-supported environments, they have trouble finding
# symbols from gflags if -lgflags wasn't specified. As a temporary resort,
# we added it to PLATFORM_LDFLAGS although for some environments it is
# unnecessary.
PLATFORM_LDFLAGS
=
"
$PLATFORM_LDFLAGS
-gflags"
else
# do fPIC on 64 bit in non-fbcode environment
case
"
$TARGET_OS
"
in
...
...
build_tools/build_detect_version
浏览文件 @
be271c33
...
...
@@ -5,38 +5,18 @@
# is then built as a regular source file as part of the compilation process.
# One can run "strings executable_filename | grep _build_" to find the version of
# the source that we used to build the executable file.
#
# create git version file
VFILE
=
$PWD
/util/build_version.cc.tmp
trap
"rm
$VFILE
"
EXIT
# check to see if git is in the path
which git
>
/dev/null
OUTFILE
=
"
$PWD
/util/build_version.cc"
if
[
"
$?
"
=
0
]
;
then
env
-i
git rev-parse HEAD 2>&1 |
awk
'
BEGIN {
print "#include \"build_version.h\"\n"
}
{ print "const char* rocksdb_build_git_sha = \"rocksdb_build_git_sha:" $0"\";" }
'
>
${
VFILE
}
else
echo
"git not found"
|
awk
'
BEGIN {
print "#include \"build_version.h\""
}
{ print "const char* rocksdb_build_git_sha = \"rocksdb_build_git_sha:git not found\";" }
'
>
${
VFILE
}
GIT_SHA
=
""
if
command
-v
git
>
/dev/null 2>&1
;
then
GIT_SHA
=
$(
git rev-parse HEAD 2>/dev/null
)
fi
echo
"const char* rocksdb_build_git_datetime =
\"
rocksdb_build_git_datetime:
$(
date
)
\"
;"
>>
${
VFILE
}
echo
"const char* rocksdb_build_compile_date = __DATE__;"
>>
${
VFILE
}
echo
"const char* rocksdb_build_compile_time = __TIME__;"
>>
${
VFILE
}
OUTFILE
=
$PWD
/util/build_version.cc
if
[
!
-e
$OUTFILE
]
||
!
cmp
-s
$VFILE
$OUTFILE
;
then
cp
$VFILE
$OUTFILE
fi
cat
>
"
${
OUTFILE
}
"
<<
EOF
#include "build_version.h"
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:
${
GIT_SHA
}
";
const char* rocksdb_build_git_datetime = "rocksdb_build_git_datetime:
$(
date
)
";
const char* rocksdb_build_compile_date = __DATE__;
const char* rocksdb_build_compile_time = __TIME__;
EOF
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录