mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-11 06:10:06 +02:00
141 lines
4.2 KiB
Plaintext
141 lines
4.2 KiB
Plaintext
From 9c16dce27dbbc7b69932b52125b70bc2ee3e2a18 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?=
|
|
<adrian.arroyocalle@gmail.com>
|
|
Date: Wed, 29 Aug 2018 13:34:46 +0300
|
|
Subject: Fix build on Haiku
|
|
|
|
|
|
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
|
|
index ac28c62..c8bb883 100644
|
|
--- a/extra/CMakeLists.txt
|
|
+++ b/extra/CMakeLists.txt
|
|
@@ -67,7 +67,7 @@ TARGET_LINK_LIBRARIES(perror mysys mysys_ssl)
|
|
SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
MYSQL_ADD_EXECUTABLE(resolveip EXCLUDE_FROM_ALL resolveip.c)
|
|
-TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl)
|
|
+TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl network)
|
|
SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX)
|
|
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
|
INCLUDE(CheckFunctionExists)
|
|
diff --git a/include/my_sys.h b/include/my_sys.h
|
|
index 89011a8..3fe6e9d 100644
|
|
--- a/include/my_sys.h
|
|
+++ b/include/my_sys.h
|
|
@@ -16,6 +16,7 @@
|
|
#ifndef _my_sys_h
|
|
#define _my_sys_h
|
|
|
|
+#include <sys/time.h>
|
|
#include "my_global.h" /* C_MODE_START, C_MODE_END */
|
|
#include "my_pthread.h"
|
|
#include "m_ctype.h" /* for CHARSET_INFO */
|
|
@@ -26,9 +27,7 @@
|
|
#ifdef _WIN32
|
|
#include <malloc.h>
|
|
#endif
|
|
-#ifdef HAVE_UNISTD_H
|
|
#include <unistd.h>
|
|
-#endif
|
|
|
|
C_MODE_START
|
|
|
|
diff --git a/include/my_time.h b/include/my_time.h
|
|
index 90452f0..b791417 100644
|
|
--- a/include/my_time.h
|
|
+++ b/include/my_time.h
|
|
@@ -17,6 +17,7 @@
|
|
This is a private header of sql-common library, containing
|
|
declarations for my_time.c
|
|
*/
|
|
+#include <sys/time.h>
|
|
|
|
#ifndef _my_time_h_
|
|
#define _my_time_h_
|
|
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c
|
|
index 3007c4e..1cd4446 100644
|
|
--- a/mysys/my_getsystime.c
|
|
+++ b/mysys/my_getsystime.c
|
|
@@ -17,12 +17,12 @@
|
|
/* thus to get the current time we should use the system function
|
|
with the highest possible resolution */
|
|
|
|
+#include <sys/time.h>
|
|
+
|
|
#include "mysys_priv.h"
|
|
#include "my_static.h"
|
|
|
|
-#if HAVE_SYS_TIME_H
|
|
-#include <sys/time.h>
|
|
-#endif
|
|
+
|
|
|
|
/**
|
|
Get high-resolution time.
|
|
diff --git a/mysys/my_init.c b/mysys/my_init.c
|
|
index c0ba3ae..c3ac341 100644
|
|
--- a/mysys/my_init.c
|
|
+++ b/mysys/my_init.c
|
|
@@ -12,6 +12,8 @@
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
+#include <sys/time.h>
|
|
+#include <sys/resource.h>
|
|
|
|
#include "mysys_priv.h"
|
|
#include "my_static.h"
|
|
@@ -19,10 +21,6 @@
|
|
#include "m_string.h"
|
|
#include "mysql/psi/mysql_stage.h"
|
|
|
|
-#ifdef HAVE_SYS_RESOURCE_H
|
|
-#include <sys/resource.h>
|
|
-#endif
|
|
-
|
|
#ifdef _WIN32
|
|
#include <locale.h>
|
|
#include <crtdbg.h>
|
|
@@ -187,25 +185,6 @@ void my_end(int infoflag)
|
|
|
|
if ((infoflag & MY_GIVE_INFO) || print_info)
|
|
{
|
|
-#ifdef HAVE_GETRUSAGE
|
|
- struct rusage rus;
|
|
- if (!getrusage(RUSAGE_SELF, &rus))
|
|
- fprintf(info_file,"\n\
|
|
-User time %.2f, System time %.2f\n\
|
|
-Maximum resident set size %ld, Integral resident set size %ld\n\
|
|
-Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\
|
|
-Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\
|
|
-Voluntary context switches %ld, Involuntary context switches %ld\n",
|
|
- (rus.ru_utime.tv_sec * SCALE_SEC +
|
|
- rus.ru_utime.tv_usec / SCALE_USEC) / 100.0,
|
|
- (rus.ru_stime.tv_sec * SCALE_SEC +
|
|
- rus.ru_stime.tv_usec / SCALE_USEC) / 100.0,
|
|
- rus.ru_maxrss, rus.ru_idrss,
|
|
- rus.ru_minflt, rus.ru_majflt,
|
|
- rus.ru_nswap, rus.ru_inblock, rus.ru_oublock,
|
|
- rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals,
|
|
- rus.ru_nvcsw, rus.ru_nivcsw);
|
|
-#endif
|
|
#if defined(_WIN32) && defined(_MSC_VER)
|
|
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
|
|
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
|
|
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
|
|
index cb8599d..49d8e3f 100644
|
|
--- a/tests/CMakeLists.txt
|
|
+++ b/tests/CMakeLists.txt
|
|
@@ -18,7 +18,7 @@ ADD_DEFINITIONS("-DMYSQL_CLIENT")
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
|
|
|
ADD_EXECUTABLE(mysql_client_test mysql_client_test.c)
|
|
-TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient)
|
|
+TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient network)
|
|
SET_TARGET_PROPERTIES(mysql_client_test PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
#
|
|
--
|
|
2.16.4
|
|
|