From 655a17014f8a2d4fd96f05e6bb2ca34e5377d431 Mon Sep 17 00:00:00 2001 From: "weihao.twh" Date: Thu, 20 Oct 2022 17:20:34 +0800 Subject: [PATCH] fix: fix compile problems --- build.sh | 43 +++--------------------------- deps/3rd/obclient.el7.aarch64.deps | 8 ++++++ deps/3rd/obclient.el8.aarch64.deps | 8 ++++++ include/probes_mysql.h | 3 +++ libmariadb | 2 +- rpm/obclient-build.sh | 30 +++++++++++---------- rpm/obclient.deps | 36 +++++++++++++++++++++---- rpm/obclient.spec | 6 +++-- 8 files changed, 75 insertions(+), 61 deletions(-) create mode 100644 deps/3rd/obclient.el7.aarch64.deps create mode 100644 deps/3rd/obclient.el8.aarch64.deps diff --git a/build.sh b/build.sh index 13fa7064..872a27c4 100755 --- a/build.sh +++ b/build.sh @@ -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 \ @@ -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 \ @@ -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` diff --git a/deps/3rd/obclient.el7.aarch64.deps b/deps/3rd/obclient.el7.aarch64.deps new file mode 100644 index 00000000..984d5ef2 --- /dev/null +++ b/deps/3rd/obclient.el7.aarch64.deps @@ -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 diff --git a/deps/3rd/obclient.el8.aarch64.deps b/deps/3rd/obclient.el8.aarch64.deps new file mode 100644 index 00000000..5e0ff4b1 --- /dev/null +++ b/deps/3rd/obclient.el8.aarch64.deps @@ -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 diff --git a/include/probes_mysql.h b/include/probes_mysql.h index ce5be041..d1631dcf 100644 --- a/include/probes_mysql.h +++ b/include/probes_mysql.h @@ -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 */ diff --git a/libmariadb b/libmariadb index 4c565b9d..8766f465 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit 4c565b9dd75bb1719e3a4eedf5df0d17fa9c70da +Subproject commit 8766f46525f98c0607ca899c07d5e693c6ee5404 diff --git a/rpm/obclient-build.sh b/rpm/obclient-build.sh index 3cbc4f9e..66b43a5c 100644 --- a/rpm/obclient-build.sh +++ b/rpm/obclient-build.sh @@ -3,23 +3,24 @@ # Usage: obclient-build.sh # 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 @@ -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}" diff --git a/rpm/obclient.deps b/rpm/obclient.deps index 359669da..ae8f144c 100644 --- a/rpm/obclient.deps +++ b/rpm/obclient.deps @@ -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 diff --git a/rpm/obclient.spec b/rpm/obclient.spec index 2debe372..dd26d66e 100644 --- a/rpm/obclient.spec +++ b/rpm/obclient.spec @@ -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