Commit 1d99e4d6 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Merge branch '10.2' into 10.3

parents 44045262 d7f74150
......@@ -174,7 +174,7 @@ SET(INSTALL_SCRIPTDIR_DEB "bin")
SET(INSTALL_SYSCONFDIR_DEB "/etc")
SET(INSTALL_SYSCONF2DIR_DEB "/etc/mysql/conf.d")
#
SET(INSTALL_LIBDIR_DEB "lib")
SET(INSTALL_LIBDIR_DEB "lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}")
SET(INSTALL_PLUGINDIR_DEB "lib/mysql/plugin")
#
SET(INSTALL_INCLUDEDIR_DEB "include/mariadb")
......@@ -186,7 +186,7 @@ SET(INSTALL_INFODIR_DEB "share/info")
#
SET(INSTALL_SHAREDIR_DEB "share")
SET(INSTALL_MYSQLSHAREDIR_DEB "share/mysql")
SET(INSTALL_MYSQLTESTDIR_DEB "mysql-test")
SET(INSTALL_MYSQLTESTDIR_DEB "share/mysql/mysql-test")
SET(INSTALL_SQLBENCHDIR_DEB ".")
SET(INSTALL_SUPPORTFILESDIR_DEB "share/mysql")
#
......@@ -196,11 +196,7 @@ SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(INSTALL_PAMDIR_DEB "/lib/x86_64-linux-gnu/security")
ELSE()
SET(INSTALL_PAMDIR_DEB "/lib/i386-linux-gnu/security")
ENDIF()
SET(INSTALL_PAMDIR_DEB "/lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}/security")
#
# SVR4 layout
......
......@@ -86,9 +86,6 @@ endif
-DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
-DINSTALL_PLUGINDIR=lib/mysql/plugin \
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DDEB=$(DEB_VENDOR) ..'
......
......@@ -30,50 +30,52 @@ static int ncpus=0;
int my_getncpus(void)
{
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
cpu_set_t set;
if (!ncpus)
{
/*
First attempt to get the total number of available cores. sysconf is
the fallback, but it can return a larger number. It will return the
total number of cores, not the ones available to the process - as
configured via core affinity.
*/
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
cpu_set_t set;
if (pthread_getaffinity_np(pthread_self(), sizeof(set), &set) == 0)
{
#ifdef CPU_COUNT
/* CPU_COUNT was introduced with glibc 2.6. */
ncpus= CPU_COUNT(&set);
}
else
{
#ifdef _SC_NPROCESSORS_ONLN
ncpus= sysconf(_SC_NPROCESSORS_ONLN);
#else
ncpus= 2;
/* Implementation for platforms with glibc < 2.6 */
size_t i;
for (i= 0; i < CPU_SETSIZE; i++)
if (CPU_ISSET(i, &set))
ncpus++;
#endif
return ncpus;
}
}
#endif /* (__linux__ || __FreeBSD__) && HAVE_PTHREAD_GETAFFINITY_NP */
#else /* __linux__ || FreeBSD && HAVE_PTHREAD_GETAFFINITY_NP */
if (!ncpus)
{
#ifdef _SC_NPROCESSORS_ONLN
ncpus= sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(__WIN__)
SYSTEM_INFO sysinfo;
/*
* We are not calling GetNativeSystemInfo here because (1) we
* don't believe that they return different values for number
* of processors and (2) if WOW64 limits processors for Win32
* then we don't want to try to override that.
We are not calling GetNativeSystemInfo here because (1) we
don't believe that they return different values for number
of processors and (2) if WOW64 limits processors for Win32
then we don't want to try to override that.
*/
GetSystemInfo(&sysinfo);
ncpus= sysinfo.dwNumberOfProcessors;
#else
/* unknown so play safe: assume SMP and forbid uniprocessor build */
/* Unknown so play safe: assume SMP and forbid uniprocessor build */
ncpus= 2;
#endif
}
#endif /* __linux__ || FreeBSD && HAVE_PTHREAD_GETAFFINITY_NP */
return ncpus;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment