Revision 1803ed2ccb61c60a003e1d03edb1e17d55acd16a authored by Igor Canadi on 15 April 2014, 23:31:49 UTC, committed by Igor Canadi on 15 April 2014, 23:31:49 UTC
1 parent 7d83885
Raw File
build_detect_version
#!/bin/sh
#
# Record the version of the source that we are compiling.
# We keep a record of the git revision in util/version.cc. This source file
# 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.

OUTFILE="$PWD/util/build_version.cc"

GIT_SHA=""
if command -v git >/dev/null 2>&1; then
    GIT_SHA=$(git rev-parse HEAD 2>/dev/null)
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
back to top