轻量版适配openEuler 22.03 LTS

This commit is contained in:
jianghongbo4
2023-01-07 17:38:30 +08:00
parent 5da26aaca3
commit 952316ac44
9 changed files with 34 additions and 8 deletions

View File

@ -454,6 +454,10 @@ function install_gaussdb()
export DEBUG_TYPE=debug
fi
if [[ -e "/etc/openEuler-release" && "$(cat /etc/openEuler-release | awk '{print $3}')" == "22.03" ]]; then
CMAKE_OPT="$CMAKE_OPT -DENABLE_OPENEULER_MAJOR=ON"
fi
echo "CMAKE_OPT----> $CMAKE_OPT"
echo "Begin run cmake for gaussdb server" >> "$LOG_FILE" 2>&1
echo "CMake options: ${CMAKE_OPT}" >> "$LOG_FILE" 2>&1
echo "CMake release: ${DEBUG_TYPE}" >> "$LOG_FILE" 2>&1

View File

@ -94,6 +94,7 @@ option(HAVE_LIBM "enable -lm, this set to default -lm" ON)
option(HAVE_POSIX_SIGNALS "enable posix signals, this set to default" ON)
option(HAVE_GCC_INT_ATOMICS "enable gcc buildin atomics operations, this set to default" ON)
option(FLEXIBLE_ARRAY_MEMBER "pq_ce need" ON)
option(ENABLE_OPENEULER_MAJOR "support openEuler 22.03 LTS, this set to default" OFF)
# we will differ compile flags and definitions by different vars
set(DB_COMMON_DEFINE "")
@ -141,8 +142,12 @@ if(${ENABLE_LITE_MODE} STREQUAL "ON")
set(KRB5 OFF)
endif()
if(${ENABLE_OPENEULER_MAJOR} STREQUAL "ON")
add_definitions(-DOPENEULER_MAJOR)
endif()
set(PROTECT_OPTIONS -fwrapv -std=c++14 -fnon-call-exceptions ${OPTIMIZE_LEVEL})
set(WARNING_OPTIONS -Wall -Wendif-labels -Werror -Wformat-security)
set(WARNING_OPTIONS -Wall -Wendif-labels -Wformat-security)
set(OPTIMIZE_OPTIONS -pipe -pthread -fno-aggressive-loop-optimizations -fno-expensive-optimizations -fno-omit-frame-pointer -fno-strict-aliasing -freg-struct-return)
set(CHECK_OPTIONS -Wmissing-format-attribute -Wno-attributes -Wno-unused-but-set-variable -Wno-write-strings -Wpointer-arith)
set(MACRO_OPTIONS -D_GLIBCXX_USE_CXX11_ABI=0 -DENABLE_GSTRACE -D_GNU_SOURCE -DPGXC -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DSTREAMPLAN -D_THREAD_SAFE ${DB_COMMON_DEFINE})

5
configure vendored
View File

@ -709,6 +709,7 @@ with_selinux
krb_srvtab
with_python
with_openeuler_os
with_openeuler_major
enable_thread_safety
INCLUDES
TAS
@ -828,6 +829,7 @@ enable_nls
with_pgport
with_gs_version
with_openeuler_os
with_openeuler_major
enable_shared
enable_rpath
enable_jemalloc
@ -3272,6 +3274,9 @@ _ACEOF
fi
if [ "$(cat /etc/system-release)" == "openEuler release 22.03 LTS" ]; then
with_openeuler_major=yes
fi
#
# --enable-coverage enables generation of code coverage metrics with gcov

View File

@ -211,6 +211,7 @@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
with_openeuler_os = @with_openeuler_os@
with_openeuler_major = @with_openeuler_major@
#############################################################################
@ -728,6 +729,11 @@ endif
ifeq ($(with_openeuler_os), yes)
override CPPFLAGS := $(CPPFLAGS) -DWITH_OPENEULER_OS
endif
ifeq ($(with_openeuler_major), yes)
override CPPFLAGS := $(CPPFLAGS) -DOPENEULER_MAJOR
endif
CC = @CC@
GCC = @GCC@
C = gcc

View File

@ -31,10 +31,10 @@
#include <sys/poll.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#ifndef WITH_OPENEULER_OS
#include <sys/sysctl.h>
#else
#if (defined WITH_OPENEULER_OS) || (defined OPENEULER_MAJOR)
#include <linux/sysctl.h>
#else
#include <sys/sysctl.h>
#endif
#include <sys/ptrace.h>
#include <asm/ptrace.h>

View File

@ -54,10 +54,10 @@
#include <sys/poll.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#ifndef WITH_OPENEULER_OS
#include <sys/sysctl.h>
#else
#if (defined WITH_OPENEULER_OS) || (defined OPENEULER_MAJOR)
#include <linux/sysctl.h>
#else
#include <sys/sysctl.h>
#endif
#include <sys/uio.h>
#include <sys/wait.h>

View File

@ -28,6 +28,10 @@
#define PAGE_SIZE 4096
#define BBOX_PROC_PATH_LEN 128
#ifdef MINSIGSTKSZ
#undef MINSIGSTKSZ
#endif
#define MINSIGSTKSZ 5120
#define BBOX_ALT_STACKSIZE (MINSIGSTKSZ + 4096 * 32)

View File

@ -30,7 +30,9 @@
#include "typed_statistics_generator.h"
#include "sys/times.h"
#ifndef OPENEULER_MAJOR
#include "sys/vtimes.h"
#endif
namespace MOT {
/**

View File

@ -164,7 +164,7 @@ extern ErrorLevel min_debug_level;
#define MAX_CONTINUOUS_COUNT 10
#define INIT_TX_ALLOC_BUFF_NUM 5
#ifndef WITH_OPENEULER_OS
#if (!defined WITH_OPENEULER_OS) && (!defined OPENEULER_MAJOR)
extern int gettimeofday(struct timeval* tp, struct timezone* tzp);
#endif
//extern THR_LOCAL knl_thrd_context t_thrd;