未验证 提交 aca55e73 编写于 作者: W Wu Tao 提交者: GitHub

build: remove restrict to build from non-git-repo (#602)

上级 86979768
#!/bin/bash #!/bin/bash
set -e
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo "USAGE: $0 <version>" echo "USAGE: $0 <version>"
exit 1 exit 1
fi fi
pwd="$( cd "$( dirname "$0" )" && pwd )" pwd="$(cd "$(dirname "$0")" && pwd)"
shell_dir="$( cd $pwd/.. && pwd )" shell_dir="$(cd "$pwd"/.. && pwd)"
cd $shell_dir cd "$shell_dir" || exit 1
VERSION=$1 VERSION=$1
sed -i "s/^#define PEGASUS_VERSION .*/#define PEGASUS_VERSION \"$VERSION\"/" src/include/pegasus/version.h sed -i "s/^#define PEGASUS_VERSION .*/#define PEGASUS_VERSION \"$VERSION\"/" src/include/pegasus/version.h
echo "Files modified successfully, version bumped to $VERSION" echo "Files modified successfully, version bumped to $VERSION"
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
# RUN_VERBOSE YES|NO # RUN_VERBOSE YES|NO
# WARNING_ALL YES|NO # WARNING_ALL YES|NO
# ENABLE_GCOV YES|NO # ENABLE_GCOV YES|NO
# BOOST_DIR <dir>|""
# TEST_MODULE "<module1> <module2> ..." # TEST_MODULE "<module1> <module2> ..."
# #
# CMake options: # CMake options:
...@@ -19,7 +18,6 @@ ...@@ -19,7 +18,6 @@
# [-DCMAKE_BUILD_TYPE=Debug] # [-DCMAKE_BUILD_TYPE=Debug]
# [-DWARNING_ALL=TRUE] # [-DWARNING_ALL=TRUE]
# [-DENABLE_GCOV=TRUE] # [-DENABLE_GCOV=TRUE]
# [-DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=$BOOST_DIR -DBoost_NO_SYSTEM_PATHS=ON]
ROOT=`pwd` ROOT=`pwd`
BUILD_DIR="$ROOT/builder" BUILD_DIR="$ROOT/builder"
...@@ -97,27 +95,7 @@ else ...@@ -97,27 +95,7 @@ else
echo "DISABLE_GPERF=NO" echo "DISABLE_GPERF=NO"
fi fi
# You can specify customized boost by defining BOOST_DIR. CMAKE_OPTIONS="$CMAKE_OPTIONS -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=${ROOT}/rdsn/thirdparty/output -DBoost_NO_SYSTEM_PATHS=ON"
# Install boost like this:
# wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.zip?r=&ts=1442891144&use_mirror=jaist
# unzip -q boost_1_54_0.zip
# cd boost_1_54_0
# ./bootstrap.sh --with-libraries=system,filesystem --with-toolset=gcc
# ./b2 toolset=gcc cxxflags="-std=c++11 -fPIC" -j8 -d0
# ./b2 install --prefix=$DSN_ROOT -d0
# And set BOOST_DIR as:
# export BOOST_DIR=/path/to/boost_1_54_0/output
if [ -n "$BOOST_DIR" ]
then
echo "Use customized boost: $BOOST_DIR"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=$BOOST_DIR -DBoost_NO_SYSTEM_PATHS=ON"
# for makefile
export BOOST_ROOT=$BOOST_DIR
else
echo "Use system boost"
fi
echo "CMAKE_OPTIONS=$CMAKE_OPTIONS"
echo "#############################################################################" echo "#############################################################################"
...@@ -152,21 +130,16 @@ then ...@@ -152,21 +130,16 @@ then
cd .. cd ..
fi fi
cd $ROOT cd "$ROOT" || exit 1
PEGASUS_GIT_COMMIT=`git log | head -n 1 | awk '{print $2}'` PEGASUS_GIT_COMMIT="non-git-repo"
if [ $? -ne 0 ] || [ -z "$PEGASUS_GIT_COMMIT" ] if git rev-parse HEAD; then # this is a git repo
then PEGASUS_GIT_COMMIT=$(git rev-parse HEAD)
echo "ERROR: get PEGASUS_GIT_COMMIT failed"
echo "HINT: check if pegasus is a git repo"
exit 1
fi fi
echo "PEGASUS_GIT_COMMIT=${PEGASUS_GIT_COMMIT}"
GIT_COMMIT_FILE=include/pegasus/git_commit.h GIT_COMMIT_FILE=include/pegasus/git_commit.h
if [ ! -f $GIT_COMMIT_FILE ] || ! grep $PEGASUS_GIT_COMMIT $GIT_COMMIT_FILE echo "Generating $GIT_COMMIT_FILE..."
then echo "#pragma once" >$GIT_COMMIT_FILE
echo "Generating $GIT_COMMIT_FILE..." echo "#define PEGASUS_GIT_COMMIT \"$PEGASUS_GIT_COMMIT\"" >>$GIT_COMMIT_FILE
echo "#pragma once" >$GIT_COMMIT_FILE
echo "#define PEGASUS_GIT_COMMIT \"$PEGASUS_GIT_COMMIT\"" >>$GIT_COMMIT_FILE
fi
cd $BUILD_DIR cd $BUILD_DIR
echo "Building..." echo "Building..."
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "info_collector_app.h" #include "info_collector_app.h"
#include "brief_stat.h" #include "brief_stat.h"
#include <dsn/git_commit.h>
#include <pegasus/version.h> #include <pegasus/version.h>
#include <pegasus/git_commit.h> #include <pegasus/git_commit.h>
...@@ -37,7 +36,6 @@ static char const rcsid[] = ...@@ -37,7 +36,6 @@ static char const rcsid[] =
#if defined(DSN_BUILD_TYPE) #if defined(DSN_BUILD_TYPE)
" " STR(DSN_BUILD_TYPE) " " STR(DSN_BUILD_TYPE)
#endif #endif
", built with rDSN (" DSN_GIT_COMMIT ")"
", built by gcc " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) ", built by gcc " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
#if defined(DSN_BUILD_HOSTNAME) #if defined(DSN_BUILD_HOSTNAME)
", built on " STR(DSN_BUILD_HOSTNAME) ", built on " STR(DSN_BUILD_HOSTNAME)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册