Skip to content

Commit

Permalink
fix: fix compile problems
Browse files Browse the repository at this point in the history
  • Loading branch information
weihao.twh committed Oct 24, 2022
1 parent 9557cb5 commit 655a170
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 61 deletions.
43 changes: 4 additions & 39 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,10 @@ function clean()
{
rm -rf CMakeFiles CMakeCache.txt
}

function sw()
{
local tmp=`pwd`;
while true; do
if [ x$tmp = 'x' ]; then
break;
fi;
if [ -d $tmp/.dep_create ]; then
DEP_DIR=$tmp/.dep_create;
break;
else
if [ -d $tmp/rpm/.dep_create ]; then
DEP_DIR=$tmp/rpm/.dep_create;
break;
fi;
fi;
tmp=${tmp%/*};
done;
echo "DEP_DIR = $DEP_DIR";
[ -f $DEP_DIR/info ] && echo "base on `cat $DEP_DIR/info`"
}

function do_init()
{
set -x
cd rpm && dep_create obclient
cd ..
}

clean
do_init

TOP_DIR=$(cd "$(dirname "$0")";pwd)
#DEP_DIR=${TOP_DIR}/rpm/.dep_create
OBCLIENT_VERSION=`cat rpm/obclient-VER.txt`

sw
DEP_DIR=${TOP_DIR}/deps/3rd/usr/local/oceanbase/deps/devel

cmake . \
-DCMAKE_INSTALL_PREFIX=/app/mariadb \
Expand All @@ -51,11 +17,10 @@ cmake . \
-DWITH_ARCHIVE_STORAGE_ENGINE=0 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=0 \
-DWITH_PARTITION_STORAGE_ENGINE=0 \
-DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
-DWITHOUT_MROONGA_STORAGE_ENGINE=0 \
-DWITH_DEBUG=0 \
-DWITH_READLINE=1 \
-DWITH_SSL=$DEP_DIR \
-DWITH_SSL_PATH=$DEP_DIR \
-DOPENSSL_ROOT_DIR=$DEP_DIR \
-DOPENSSL_INCLUDE_DIR=$DEP_DIR/include \
-DOPENSSL_SSL_LIBRARY=$DEP_DIR/lib/libssl.a \
Expand All @@ -73,8 +38,8 @@ cmake . \
-DMYSQL_UNIX_ADDR=/app/mariadb/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITHOUT_TOKUDB=1 \
-DWITHOUT_SERVER=1 \
-DOBCLIENT_VERSION=$OBCLIENT_VERSION
-DWITHOUT_TOKUDB=1 \
-DOBCLIENT_VERSION=$OBCLIENT_VERSION

make -j `cat /proc/cpuinfo | grep processor| wc -l`
8 changes: 8 additions & 0 deletions deps/3rd/obclient.el7.aarch64.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target]
os=7
arch=aarch64
repo=https://mirrors.aliyun.com/oceanbase/development-kit/el/7/aarch64/

[deps]
devdeps-openssl-static-1.0.1e-12.el7.aarch64.rpm
devdeps-ncurses-static-6.2-5.el7.aarch64.rpm
8 changes: 8 additions & 0 deletions deps/3rd/obclient.el8.aarch64.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target]
os=8
arch=aarch64
repo=https://mirrors.aliyun.com/oceanbase/development-kit/el/8/aarch64/

[deps]
devdeps-openssl-static-1.0.1e-12.el8.aarch64.rpm
devdeps-ncurses-static-6.2-5.el8.aarch64.rpm
3 changes: 3 additions & 0 deletions include/probes_mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

#define PROBES_MYSQL_H

// FORCE TO DISABLE DTRACE
#define DISABLE_DTRACE

#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)
#include "probes_mysql_dtrace.h"
#else /* no dtrace */
Expand Down
30 changes: 16 additions & 14 deletions rpm/obclient-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
# Usage: obclient-build.sh <oceanbasepath> <package> <version> <release>
# Usage: obclient-build.sh

REDHAT=`cat /etc/redhat-release|cut -d " " -f 7|cut -d "." -f 1`
if [ $# -ne 4 ]
then
TOP_DIR=`pwd`/../
PACKAGE=$(basename $0 -build.sh)
VERSION=`cat ${PACKAGE}-VER.txt`
RELEASE="dev.el${REDHAT}"
else
TOP_DIR=$1
PACKAGE=$2
VERSION=$3
RELEASE="$4.el${REDHAT}"
export AONE_BUILD_NUMBER=${4}
fi
SCRIPT_DIR=$(cd "$(dirname "$0")";pwd)
TOP_DIR=${1:-${SCRIPT_DIR}/../}
DEP_DIR=${TOP_DIR}/deps/3rd/
PACKAGE=${2:-$(basename $0 -build.sh)}
VERSION=${3:-`cat ${PACKAGE}-VER.txt`}
RELEASE=${4:-1}

echo "[BUILD] args: TOP_DIR=${TOP_DIR} PACKAGE=${PACKAGE} VERSION=${VERSION} RELEASE=${RELEASE}"

# dep_create
cd $DEP_DIR
bash dep_create.sh
if [[ $? -ne 0 ]]; then
echo "dep create failed"
exit 1
fi
cd $SCRIPT_DIR

TMP_DIR=${TOP_DIR}/${PACKAGE}-tmp.$$
BOOST_DIR=${TMP_DIR}/BOOST

Expand All @@ -31,6 +32,7 @@ mkdir -p ${TMP_DIR}/SOURCES
mkdir -p ${TMP_DIR}/SRPMS
mkdir -p $BOOST_DIR

#cp ./boost_1_59_0.tar.gz $BOOST_DIR
SPEC_FILE=${PACKAGE}.spec

echo "[BUILD] make rpms...dep_dir=$DEP_DIR spec_file=${SPEC_FILE}"
Expand Down
36 changes: 31 additions & 5 deletions rpm/obclient.deps
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,39 @@
os=7
arch=aarch64
[deps]
devdeps-openssl-static-1.0.1e-3.el7.aarch64.rpm
devdeps-ncurses-static-6.2-3.el7.aarch64.rpm

cmake-2.8.11-5.2.alios7.aarch64.rpm
gcc49-4.9.3-1488365.alios7.aarch64.rpm=test
ob-ncurses-6.2-20200624000532.alios7.aarch64.rpm=test
libarchive-3.1.2-7.3.alios7.aarch64.rpm
babassl-ob-8.1.3-1896127.alios7.aarch64.rpm=test
binutils-2.27-9.base.alios7.aarch64.rpm

[target]
os=7
arch=x86_64
[deps]
devdeps-openssl-static-1.0.1e-3.el7.x86_64.rpm
devdeps-ncurses-static-6.2-3.el7.x86_64.rpm
cmake-3.8.2-20170711173356.alios7.x86_64.rpm
gcc49-4.9.2-437507.el7.x86_64.rpm
ncurses-devel-5.9-13.20130511.1.alios7.x86_64.rpm
ncurses-libs-5.9-13.20130511.1.alios7.x86_64.rpm
babassl-ob-8.1.3-1894614.alios7.x86_64.rpm=test
binutils-2.29.1-20200226153249.alios7.x86_64.rpm

[target]
os=6
[deps]
cmake-2.8.12.2-1.el6.x86_64.rpm
gcc49-4.9.2-9.el6.x86_64.rpm
ncurses-devel-5.7-3.20090208.1.alios6.x86_64.rpm
ncurses-libs-5.7-3.20090208.1.alios6.x86_64.rpm
babassl-ob-8.1.3-1894614.alios6.x86_64.rpm=test
binutils-2.29.1-20200226153249.alios6.x86_64.rpm

[target]
os=5
[deps]
cmake-2.8.12.2-1.el5.x86_64.rpm
gcc48-4.8.2-252405.el5.x86_64.rpm
devtoolset-2-binutils-2.23.52.0.1-10.el5.x86_64.rpm
ncurses-devel-5.5-24.20060715.1.x86_64.rpm
ncurses-5.5-24.20060715.1.x86_64.rpm
6 changes: 4 additions & 2 deletions rpm/obclient.spec
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ ln -s %{prefix}/bin/mysql_config /usr/bin/mysql_config


%preun
rm /usr/bin/obclient
rm /usr/bin/mysql_config
if [ "$1" = "0" ]; then
rm /usr/bin/obclient
rm /usr/bin/mysql_config
fi

%changelog

0 comments on commit 655a170

Please sign in to comment.