Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b41932fb
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b41932fb
编写于
3月 21, 2020
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cherrypick travis and appveyor CI support and cherrypick few files to support build for Mac
上级
706d3dfb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
132 addition
and
50 deletion
+132
-50
CMakeLists.txt
CMakeLists.txt
+5
-0
src/client/CMakeLists.txt
src/client/CMakeLists.txt
+17
-15
src/os/darwin/inc/os.h
src/os/darwin/inc/os.h
+65
-29
src/os/darwin/src/tdarwin.c
src/os/darwin/src/tdarwin.c
+45
-6
未找到文件。
CMakeLists.txt
浏览文件 @
b41932fb
...
...
@@ -284,6 +284,11 @@ IF (NOT DEFINED TD_CLUSTER)
INSTALL
(
FILES
${
LIBRARY_OUTPUT_PATH
}
/libtaos.dll DESTINATION driver
)
INSTALL
(
FILES
${
LIBRARY_OUTPUT_PATH
}
/libtaos.dll.a DESTINATION driver
)
ENDIF
()
ELSEIF
(
TD_DARWIN_64
)
SET
(
TD_MAKE_INSTALL_SH
"
${
TD_COMMUNITY_DIR
}
/packaging/tools/make_install.sh"
)
INSTALL
(
CODE
"MESSAGE(
\"
make install script:
${
TD_MAKE_INSTALL_SH
}
\"
)"
)
INSTALL
(
CODE
"execute_process(COMMAND chmod 777
${
TD_MAKE_INSTALL_SH
}
)"
)
INSTALL
(
CODE
"execute_process(COMMAND
${
TD_MAKE_INSTALL_SH
}
${
TD_COMMUNITY_DIR
}
${
PROJECT_BINARY_DIR
}
Darwin)"
)
ENDIF
()
ENDIF
()
...
...
src/client/CMakeLists.txt
浏览文件 @
b41932fb
...
...
@@ -24,20 +24,10 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
#set version of .so
#VERSION so version
#SOVERSION api version
IF
(
TD_LITE
)
execute_process
(
COMMAND chmod 777
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
)
execute_process
(
COMMAND
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
${
TD_COMMUNITY_DIR
}
/src/util/src/version.c
OUTPUT_VARIABLE
VERSION_INFO
)
MESSAGE
(
STATUS
"build lite version
${
VERSION_INFO
}
"
)
ELSE
()
execute_process
(
COMMAND chmod 777
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
)
execute_process
(
COMMAND
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
${
TD_COMMUNITY_DIR
}
/src/util/src/version.c
OUTPUT_VARIABLE
VERSION_INFO
)
MESSAGE
(
STATUS
"build cluster version
${
VERSION_INFO
}
"
)
ENDIF
()
execute_process
(
COMMAND chmod 777
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
)
execute_process
(
COMMAND
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
${
TD_COMMUNITY_DIR
}
/src/util/src/version.c
OUTPUT_VARIABLE
VERSION_INFO
)
MESSAGE
(
STATUS
"build version
${
VERSION_INFO
}
"
)
SET_TARGET_PROPERTIES
(
taos PROPERTIES VERSION
${
VERSION_INFO
}
SOVERSION 1
)
...
...
@@ -57,6 +47,7 @@ ELSEIF (TD_WINDOWS_64)
TARGET_LINK_LIBRARIES
(
taos trpc
)
ELSEIF
(
TD_DARWIN_64
)
SET
(
CMAKE_MACOSX_RPATH 1
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/jni/linux
)
ADD_LIBRARY
(
taos_static STATIC
${
SRC
}
)
...
...
@@ -66,6 +57,17 @@ ELSEIF (TD_DARWIN_64)
# generate dynamic library (*.dylib)
ADD_LIBRARY
(
taos SHARED
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
taos trpc tutil pthread m
)
SET_TARGET_PROPERTIES
(
taos PROPERTIES CLEAN_DIRECT_OUTPUT 1
)
#set version of .so
#VERSION so version
#SOVERSION api version
execute_process
(
COMMAND chmod 777
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
)
execute_process
(
COMMAND
${
TD_COMMUNITY_DIR
}
/packaging/tools/get_version.sh
${
TD_COMMUNITY_DIR
}
/src/util/src/version.c
OUTPUT_VARIABLE
VERSION_INFO
)
MESSAGE
(
STATUS
"build version
${
VERSION_INFO
}
"
)
SET_TARGET_PROPERTIES
(
taos PROPERTIES VERSION
${
VERSION_INFO
}
SOVERSION 1
)
ENDIF
()
src/os/darwin/inc/os.h
浏览文件 @
b41932fb
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_PLATFORM_DARWIN_H
#define TDENGINE_PLATFORM_DARWIN_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <float.h>
#include <ifaddrs.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <netdb.h>
#include <pwd.h>
#include <syslog.h>
#include <termios.h>
#include <wordexp.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <pthread.h>
#include <pwd.h>
#include <regex.h>
#include <semaphore.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/statvfs.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <stdint.h>
#include <pthread.h>
#include <stdbool.h>
#include <limits.h>
#include <locale.h>
#include <syslog.h>
#include <termios.h>
#include <unistd.h>
#include <wchar.h>
#include <wordexp.h>
#include <wctype.h>
#include <inttypes.h>
#include <dispatch/dispatch.h>
#define htobe64 htonll
#define taosCloseSocket(x) \
{ \
if (FD_VALID(x)) {
\
if (FD_VALID(x)) { \
close(x); \
x =
-1;
\
x =
FD_INITIALIZER;
\
} \
}
#define taosWriteSocket(fd, buf, len) write(fd, buf, len)
#define taosReadSocket(fd, buf, len) read(fd, buf, len)
...
...
@@ -160,7 +188,7 @@
(__a < __b) ? __a : __b; \
})
#define MILLISECOND_PER_SECOND (1000L)
#define MILLISECOND_PER_SECOND (
(int64_t)
1000L)
#define tsem_t dispatch_semaphore_t
...
...
@@ -197,6 +225,10 @@ bool taosSkipSocketCheck();
bool
taosGetDisk
();
int
fsendfile
(
FILE
*
out_file
,
FILE
*
in_file
,
int64_t
*
offset
,
int32_t
count
);
void
taosSetCoreDump
();
typedef
int
(
*
__compar_fn_t
)(
const
void
*
,
const
void
*
);
// for send function in tsocket.c
...
...
@@ -219,4 +251,8 @@ typedef int(*__compar_fn_t)(const void *, const void *);
#define BUILDIN_CLZ(val) __builtin_clz(val)
#define BUILDIN_CTZ(val) __builtin_ctz(val)
#endif
\ No newline at end of file
#ifdef __cplusplus
}
#endif
#endif
src/os/darwin/src/tdarwin.c
浏览文件 @
b41932fb
...
...
@@ -33,11 +33,11 @@
#include "tsdb.h"
#include "tutil.h"
char
configDir
[
TSDB_FILENAME_LEN
]
=
"
~/TDengine/cfg
"
;
char
tsDirectory
[
TSDB_FILENAME_LEN
]
=
"
~/TDengine/data
"
;
char
dataDir
[
TSDB_FILENAME_LEN
]
=
"
~/TDengine/data
"
;
char
logDir
[
TSDB_FILENAME_LEN
]
=
"~/TDengine
/l
og"
;
char
scriptDir
[
TSDB_FILENAME_LEN
]
=
"
~/TDengine/script
"
;
char
configDir
[
TSDB_FILENAME_LEN
]
=
"
/etc/taos
"
;
char
tsDirectory
[
TSDB_FILENAME_LEN
]
=
"
/var/lib/taos
"
;
char
dataDir
[
TSDB_FILENAME_LEN
]
=
"
/var/lib/taos
"
;
char
logDir
[
TSDB_FILENAME_LEN
]
=
"~/TDengine
L
og"
;
char
scriptDir
[
TSDB_FILENAME_LEN
]
=
"
/etc/taos
"
;
int64_t
str2int64
(
char
*
str
)
{
char
*
endptr
=
NULL
;
...
...
@@ -418,4 +418,43 @@ int32_t __sync_val_load_32(int32_t *ptr) {
void
__sync_val_restore_32
(
int32_t
*
ptr
,
int32_t
newval
)
{
__atomic_store_n
(
ptr
,
newval
,
__ATOMIC_RELEASE
);
}
\ No newline at end of file
}
#define _SEND_FILE_STEP_ 1000
int
fsendfile
(
FILE
*
out_file
,
FILE
*
in_file
,
int64_t
*
offset
,
int32_t
count
)
{
fseek
(
in_file
,
(
int32_t
)(
*
offset
),
0
);
int
writeLen
=
0
;
uint8_t
buffer
[
_SEND_FILE_STEP_
]
=
{
0
};
for
(
int
len
=
0
;
len
<
(
count
-
_SEND_FILE_STEP_
);
len
+=
_SEND_FILE_STEP_
)
{
size_t
rlen
=
fread
(
buffer
,
1
,
_SEND_FILE_STEP_
,
in_file
);
if
(
rlen
<=
0
)
{
return
writeLen
;
}
else
if
(
rlen
<
_SEND_FILE_STEP_
)
{
fwrite
(
buffer
,
1
,
rlen
,
out_file
);
return
(
int
)(
writeLen
+
rlen
);
}
else
{
fwrite
(
buffer
,
1
,
_SEND_FILE_STEP_
,
in_file
);
writeLen
+=
_SEND_FILE_STEP_
;
}
}
int
remain
=
count
-
writeLen
;
if
(
remain
>
0
)
{
size_t
rlen
=
fread
(
buffer
,
1
,
remain
,
in_file
);
if
(
rlen
<=
0
)
{
return
writeLen
;
}
else
{
fwrite
(
buffer
,
1
,
remain
,
out_file
);
writeLen
+=
remain
;
}
}
return
writeLen
;
}
void
taosSetCoreDump
()
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录