PROJECT(mysql-proxy C)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckLibraryExists)
INCLUDE(FindPkgConfig)
INCLUDE(CheckTypeSize)
INCLUDE(ChassisPlugin)
INCLUDE(ChassisInstall)
INCLUDE(CTest)
INCLUDE(InstallRequiredSystemLibraries)
INCLUDE(Tar)
ENABLE_TESTING()
EXECUTE_PROCESS(COMMAND bzr version-info ${CMAKE_SOURCE_DIR} --custom --template="{branch_nick} revision {revno}"
TIMEOUT 5
OUTPUT_VARIABLE BZR_INFO
OUTPUT_STRIP_TRAILING_WHITESPACE
)
MESSAGE(STATUS "building from branch ${BZR_INFO}")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "8")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VENDOR "MySQL")
## SET(CPACK_*) before the INCLUDE(CPack)
INCLUDE(CPack)
IF(WIN32)
## make sure we only use the smallest set of
## headers on win32. Otherwise we get clashes
## between winsock2.h and winsock.h
ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
MESSAGE(STATUS "using glib base directory ${GLIB_DEV_BASE_DIR}")
SET(GLIB_DEV_BASE_DIR CACHE PATH "GLib2-dev directory")
IF(GLIB_DEV_BASE_DIR)
SET(GLIB_INCLUDE_DIRS "${GLIB_DEV_BASE_DIR}/include/glib-2.0" "${GLIB_DEV_BASE_DIR}/lib/glib-2.0/include/" CACHE PATH "")
SET(GLIB_LIBRARY_DIRS "${GLIB_DEV_BASE_DIR}/lib" CACHE PATH "")
SET(GLIB_LIBRARIES "glib-2.0")
# now set gmodule and gthread to whatever glib is, those libraries come as a bundle anyway
SET(GTHREAD_INCLUDE_DIRS ${GLIB_INCLUDE_DIRS} CACHE PATH "")
SET(GTHREAD_LIBRARY_DIRS ${GLIB_LIBRARY_DIRS} CACHE PATH "")
SET(GTHREAD_LIBRARIES "gthread-2.0")
SET(GMODULE_INCLUDE_DIRS ${GLIB_INCLUDE_DIRS} CACHE PATH "")
SET(GMODULE_LIBRARY_DIRS ${GLIB_LIBRARY_DIRS} CACHE PATH "")
SET(GMODULE_LIBRARIES "gmodule-2.0")
MESSAGE(STATUS "glib libraries ${GLIB_LIBRARIES} ${GTHREAD_LIBRARIES} ${GMODULE_LIBRARIES}")
ENDIF(GLIB_DEV_BASE_DIR)
# force the correct version for the redist manifest
ADD_DEFINITIONS(-D_BIND_TO_CURRENT_MFC_VERSION=1 -D_BIND_TO_CURRENT_CRT_VERSION=1)
# turn off security warnings for system calls
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE)
# turn off common warnings that are completely harmless in our case.
ADD_DEFINITIONS(/wd4005 /wd4113 /wd4244 /wd4273 /wd4996)
ENDIF(WIN32)
MESSAGE(STATUS "libevent at libs:${EVENT_LIBRARY_DIRS} incl:${EVENT_INCLUDE_DIRS}")
MESSAGE(STATUS "liblua at libs:${LUA_LIBRARY_DIRS} incl:${LUA_INCLUDE_DIRS}")
MESSAGE(STATUS "glib2.0 at libs:${GLIB_LIBRARY_DIRS} incl:${GLIB_INCLUDE_DIRS}")
MESSAGE(STATUS "gthread at libs:${GTHREAD_LIBRARY_DIRS} incl:${GTHREAD_INCLUDE_DIRS}")
MESSAGE(STATUS "gmodule at libs:${GMODULE_LIBRARY_DIRS} incl:${GMODULE_INCLUDE_DIRS}")
## if the paths are not set, use pkg-config to fetch them
IF(NOT GLIB_DEV_BASE_DIR)
SET(GLIB_INCLUDE_DIRS CACHE PATH "glib-2.0 include dir [see pkg-config glib-2.0 --cflags]")
SET(GLIB_LIBRARY_DIRS CACHE PATH "glib-2.0 library dir [see pkg-config glib-2.0 --libs]")
SET(GMODULE_INCLUDE_DIRS CACHE PATH "gmodule-2.0 include dir [see pkg-config gmodule-2.0 --cflags]")
SET(GMODULE_LIBRARY_DIRS CACHE PATH "gmodule-2.0 library dir [see pkg-config gmodule-2.0 --libs]")
SET(GTHREAD_INCLUDE_DIRS CACHE PATH "gthread-2.0 include dir [see pkg-config gthread-2.0 --cflags]")
SET(GTHREAD_LIBRARY_DIRS CACHE PATH "gthread-2.0 library dir [see pkg-config gthread-2.0 --libs]")
ENDIF(NOT GLIB_DEV_BASE_DIR)
SET(MYSQL_INCLUDE_DIRS CACHE PATH "MySQL include dir")
SET(MYSQL_LIBRARY_DIRS CACHE PATH "MySQL library dir")
SET(LUA_INCLUDE_DIRS CACHE PATH "lua-5.1 include dir")
SET(LUA_LIBRARY_DIRS CACHE PATH "lua-5.1 library dir")
IF (NOT EVENT_BASE_DIR)
SET(EVENT_INCLUDE_DIRS CACHE PATH "libevent include dir")
SET(EVENT_LIBRARY_DIRS CACHE PATH "libevent library dir")
ENDIF(NOT EVENT_BASE_DIR)
MESSAGE(STATUS "libevent at libs:${EVENT_LIBRARY_DIRS} incl:${EVENT_INCLUDE_DIRS}")
MESSAGE(STATUS "liblua at libs:${LUA_LIBRARY_DIRS} incl:${LUA_INCLUDE_DIRS}")
MESSAGE(STATUS "glib2.0 at libs:${GLIB_LIBRARY_DIRS} incl:${GLIB_INCLUDE_DIRS}")
MESSAGE(STATUS "gthread at libs:${GTHREAD_LIBRARY_DIRS} incl:${GTHREAD_INCLUDE_DIRS}")
MESSAGE(STATUS "gmodule at libs:${GMODULE_LIBRARY_DIRS} incl:${GMODULE_INCLUDE_DIRS}")
IF(NOT GLIB_INCLUDE_DIRS)
SET(__pkg_config_checked_GLIB 0)
PKG_CHECK_MODULES(GLIB REQUIRED glib-2.0>=2.16)
ADD_DEFINITIONS(-DHAVE_GLIB)
ENDIF(NOT GLIB_INCLUDE_DIRS)
IF(NOT GMODULE_INCLUDE_DIRS)
PKG_CHECK_MODULES(GMODULE REQUIRED gmodule-2.0>=2.16)
ADD_DEFINITIONS(-DHAVE_GMODULE)
ENDIF(NOT GMODULE_INCLUDE_DIRS)
IF(NOT GTHREAD_INCLUDE_DIRS)
PKG_CHECK_MODULES(GTHREAD REQUIRED gthread-2.0>=2.16)
ENDIF(NOT GTHREAD_INCLUDE_DIRS)
IF(NOT LUA_INCLUDE_DIRS)
SET(__pkg_config_checked_LUA 0)
PKG_SEARCH_MODULE(LUA lua5.1;lua>=5.1)
ADD_DEFINITIONS(-DHAVE_LUA)
ENDIF(NOT LUA_INCLUDE_DIRS)
FIND_PROGRAM(LUA_EXECUTABLE NAMES lua DOC "full path of lua")
MACRO(_mysql_config VAR _regex _opt)
EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} ${_opt}
OUTPUT_VARIABLE _mysql_config_output
)
SET(_var ${_mysql_config_output})
STRING(REGEX MATCHALL "${_regex}([^ ]+)" _mysql_config_output "${_mysql_config_output}")
STRING(REGEX REPLACE "^[ \t]+" "" _mysql_config_output "${_mysql_config_output}")
STRING(REGEX REPLACE "[\r\n]$" "" _mysql_config_output "${_mysql_config_output}")
STRING(REGEX REPLACE "${_regex}" "" _mysql_config_output "${_mysql_config_output}")
SEPARATE_ARGUMENTS(_mysql_config_output)
SET(${VAR} ${_mysql_config_output})
ENDMACRO(_mysql_config _regex _opt)
IF(NOT MYSQL_INCLUDE_DIRS)
FIND_PROGRAM(MYSQL_CONFIG_EXECUTABLE NAMES mysql_config DOC "full path of mysql_config")
IF(NOT MYSQL_CONFIG_EXECUTABLE)
MESSAGE(SEND_ERROR "mysql_config wasn't found, -DMYSQL_CONFIG_EXECUTABLE=...")
ENDIF(NOT MYSQL_CONFIG_EXECUTABLE)
_MYSQL_CONFIG(MYSQL_INCLUDE_DIRS "(^| )-I" "--include")
_MYSQL_CONFIG(MYSQL_LIBRARIES "(^| )-l" "--libs")
_MYSQL_CONFIG(MYSQL_LIBRARY_DIRS "(^| )-L" "--libs")
ELSE(NOT MYSQL_INCLUDE_DIRS)
SET(MYSQL_LIBRARIES libmysql)
ENDIF(NOT MYSQL_INCLUDE_DIRS)
SET(CMAKE_REQUIRED_INCLUDES
${EVENT_INCLUDE_DIRS}
${LUA_INCLUDE_DIRS}
${MYSQL_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${GTHREAD_INCLUDE_DIRS}
)
MESSAGE(STATUS "checking in dirs: ${CMAKE_REQUIRED_INCLUDES}")
CHECK_INCLUDE_FILES(sys/types.h;event.h HAVE_EVENT_H)
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES(lua.h HAVE_LUA_H)
CHECK_INCLUDE_FILES(netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES(net/if.h HAVE_NET_IF_H)
CHECK_INCLUDE_FILES(net/if_dl.h HAVE_NET_IF_DL_H)
CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H)
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILES(syslog.h HAVE_SYSLOG_H)
CHECK_INCLUDE_FILES(sys/filio.h HAVE_SYS_FILIO_H)
CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILES(sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILES(sys/resource.h HAVE_SYS_RESOURCE_H)
CHECK_INCLUDE_FILES(sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES(sys/sockio.h HAVE_SYS_SOCKIO_H)
CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(sys/uio.h HAVE_SYS_UIO_H)
CHECK_INCLUDE_FILES(sys/un.h HAVE_SYS_UN_H)
CHECK_INCLUDE_FILES(time.h HAVE_TIME_H)
CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES(mysql.h HAVE_MYSQL_H)
CHECK_INCLUDE_FILES(glib.h HAVE_GLIB_H)
CHECK_INCLUDE_FILES(glib/gthread.h HAVE_GTHREAD_H)
CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
CHECK_FUNCTION_EXISTS(inet_ntop HAVE_INET_NTOP)
CHECK_FUNCTION_EXISTS(getcwd HAVE_GETCWD)
CHECK_FUNCTION_EXISTS(signal HAVE_SIGNAL)
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
CHECK_FUNCTION_EXISTS(srandom HAVE_SRANDOM)
CHECK_FUNCTION_EXISTS(writev HAVE_WRITEV)
# check for gthread
没有合适的资源?快使用搜索试试~ 我知道了~
mysql-proxy-0.8.0.tar.gz
需积分: 5 0 下载量 48 浏览量
2022-08-10
15:03:42
上传
评论
收藏 739KB GZ 举报
温馨提示
mysql-proxy 安装需要依赖已有的mariadb或mysql 中的mysql_config yum install mariadb yum install mariadb-devel 解压资源进入后 ./configure make && make install
资源详情
资源评论
资源推荐
收起资源包目录
mysql-proxy-0.8.0.tar.gz (399个子文件)
Makefile.am 6KB
Makefile.am 5KB
Makefile.am 3KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 766B
Makefile.am 641B
Makefile.am 613B
Makefile.am 546B
Makefile.am 527B
Makefile.am 453B
Makefile.am 445B
Makefile.am 421B
Makefile.am 421B
Makefile.am 225B
Makefile.am 195B
Makefile.am 101B
Makefile.am 80B
Makefile.am 72B
Makefile.am 49B
Makefile.am 38B
Makefile.am 18B
Makefile.am 12B
AUTHORS 33B
winbuild.bat 4KB
sql-tokenizer.c 116KB
sql-tokenizer.c 116KB
lpeg.c 56KB
proxy-plugin.c 55KB
network-mysqld.c 46KB
mysql-myisam-dump.c 38KB
network-mysqld-packet.c 35KB
my_rdtsc.c 35KB
chassis.c 30KB
mysql-binlog-dump.c 30KB
network-mysqld-proto.c 29KB
network-mysqld-lua.c 23KB
replicant-plugin.c 22KB
t_network_mysqld_packet.c 21KB
network-socket.c 19KB
admin-plugin.c 18KB
network-mysqld-binlog.c 17KB
check_mysqld_proto.c 15KB
network-injection-lua.c 15KB
lfs.c 15KB
mysql-proto.c 13KB
lua-scope.c 13KB
debug-plugin.c 11KB
chassis.c 11KB
check_sql_tokenizer.c 11KB
chassis-event-thread.c 10KB
test-latency.c 10KB
t_network_socket.c 9KB
chassis-mainloop.c 9KB
network-conn-pool-lua.c 8KB
chassis-log.c 7KB
network-address.c 7KB
network-conn-pool.c 7KB
network-mysqld-masterinfo.c 6KB
sql-tokenizer-tokens.c 6KB
glib-ext.c 5KB
network-backend.c 5KB
sql-tokenizer-keywords.c 5KB
network-backend-lua.c 5KB
check_plugin.c 4KB
t_network_backend.c 4KB
sql-tokenizer-lua.c 4KB
network-queue.c 4KB
mysql-password.c 4KB
chassis-keyfile.c 4KB
t_network_injection.c 4KB
chassis-timings.c 3KB
t_network_queue.c 3KB
chassis-plugin.c 3KB
chassis-limits.c 3KB
chassis-path.c 3KB
lua-load-factory.c 3KB
t_network_mysqld_masterinfo.c 3KB
check_chassis_filemode.c 3KB
check_chassis_path.c 3KB
network-address-lua.c 3KB
network-injection.c 3KB
network-socket-lua.c 3KB
t_chassis_timings.c 2KB
lua-env.c 2KB
chassis-stats.c 2KB
glib2.c 2KB
check_loadscript.c 2KB
t_network_address.c 2KB
chassis-filemode.c 2KB
posix.c 2KB
check_chassis_log.c 2KB
glib-ext-ref.c 2KB
sql-tokenizer-gen.c 1KB
lua_runner.c 485B
lua_runner.c 485B
ChangeLog 2KB
libevent.event.h.cmake 39KB
libevent.evutil.h.cmake 6KB
Tar.cmake 2KB
共 399 条
- 1
- 2
- 3
- 4
封印水晶
- 粉丝: 10
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0