[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1471-g5fbb5ef
Brad King
brad.king at kitware.com
Tue Jan 8 08:42:30 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 5fbb5eff943d622219d806ddc447744b087cef20 (commit)
via 85ba0a0f663d1cd03872be3ccf99b2395a5dbc4e (commit)
via b79329b69ff7d13936c942e3ddbf02c5a7277e45 (commit)
from f7837b8ac4e14fa60bb2ef614c01c66620fe50ac (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5fbb5eff943d622219d806ddc447744b087cef20
commit 5fbb5eff943d622219d806ddc447744b087cef20
Merge: f7837b8 85ba0a0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 8 08:42:07 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 8 08:42:07 2013 -0500
Merge topic 'update-kwsys' into next
85ba0a0 Merge branch 'upstream-kwsys' into update-kwsys
b79329b KWSys 2013-01-07 (fc60c8b8)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85ba0a0f663d1cd03872be3ccf99b2395a5dbc4e
commit 85ba0a0f663d1cd03872be3ccf99b2395a5dbc4e
Merge: 64717bb b79329b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 8 08:39:31 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 8 08:39:31 2013 -0500
Merge branch 'upstream-kwsys' into update-kwsys
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b79329b69ff7d13936c942e3ddbf02c5a7277e45
commit b79329b69ff7d13936c942e3ddbf02c5a7277e45
Author: KWSys Robot <kwrobot at kitware.com>
AuthorDate: Mon Jan 7 10:20:26 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 8 08:39:27 2013 -0500
KWSys 2013-01-07 (fc60c8b8)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ fc60c8b8 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 5c0eb48c..fc60c8b8
Brad King (1):
34177aec SystemTools: Fix MakeDirectory after recent cleanup
Rolf Eike Beer (9):
f8e917c1 SystemInformation: remove the #define CPUID_INSTRUCTION
59c4b5c5 SystemInformation: split Windows code out of QueryMemory()
200ee91f SystemInformation: split HP-UX code out of QueryMemory()
88217703 SystemInformation: split Linux code out of QueryMemory()
9e317872 SystemInformation: split AIX code out of QueryMemory()
349cee5b SystemInformation: remove useless zeroing from QueryMemory()
7271926e SystemInformation: split Cygwin code out of QueryMemory()
6da78ad1 SystemInformation: make QueryMemory() return bool
182179e9 Haiku no longer defines __BEOS__
Change-Id: I3b22e4b5261381c3795fa054d4ad741a87ec5724
diff --git a/ProcessUNIX.c b/ProcessUNIX.c
index 1992211..83838af 100644
--- a/ProcessUNIX.c
+++ b/ProcessUNIX.c
@@ -63,10 +63,6 @@ do.
#include <dirent.h> /* DIR, dirent */
#include <ctype.h> /* isspace */
-#ifdef __HAIKU__
-#undef __BEOS__
-#endif
-
#if defined(__VMS)
# define KWSYSPE_VMS_NONBLOCK , O_NONBLOCK
#else
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 00a8a0a..0460b29 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -207,11 +207,6 @@ typedef struct rlimit ResourceLimitType;
#if USE_CPUID
#define CPUID_AWARE_COMPILER
-#ifdef CPUID_AWARE_COMPILER
-#define CPUID_INSTRUCTION cpuid
-#else
-#define CPUID_INSTRUCTION _asm _emit 0x0f _asm _emit 0xa2
-#endif
/**
* call CPUID instruction
@@ -239,7 +234,12 @@ static bool call_cpuid(int select, int result[4])
#endif
; <<CPUID>>
mov eax, select
- CPUID_INSTRUCTION
+#ifdef CPUID_AWARE_COMPILER
+ cpuid
+#else
+ _asm _emit 0x0f
+ _asm _emit 0xa2
+#endif
mov tmp[0 * TYPE int], eax
mov tmp[1 * TYPE int], ebx
mov tmp[2 * TYPE int], ecx
@@ -436,6 +436,9 @@ protected:
kwsys_stl::string ExtractValueFromCpuInfoFile(kwsys_stl::string buffer,
const char* word, size_t init=0);
+ bool QueryLinuxMemory();
+ bool QueryCygwinMemory();
+
static void Delay (unsigned int);
static void DelayOverhead (unsigned int);
@@ -465,12 +468,19 @@ protected:
bool QueryBSDProcessor();
//For HP-UX
+ bool QueryHPUXMemory();
bool QueryHPUXProcessor();
+ //For Microsoft Windows
+ bool QueryWindowsMemory();
+
+ //For AIX
+ bool QueryAIXMemory();
+
bool QueryProcessor();
// Evaluate the memory information.
- int QueryMemory();
+ bool QueryMemory();
size_t TotalVirtualMemory;
size_t AvailableVirtualMemory;
size_t TotalPhysicalMemory;
@@ -1306,6 +1316,16 @@ void SystemInformationImplementation::RunMemoryCheck()
this->QueryQNXMemory();
#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
this->QueryBSDMemory();
+#elif defined(__CYGWIN__)
+ this->QueryCygwinMemory();
+#elif defined(_WIN32)
+ this->QueryWindowsMemory();
+#elif defined(__hpux)
+ this->QueryHPUXMemory();
+#elif defined(__linux)
+ this->QueryLinuxMemory();
+#elif defined(_AIX)
+ this->QueryAIXMemory();
#else
this->QueryMemory();
#endif
@@ -3342,25 +3362,9 @@ void SystemInformationImplementation::SetStackTraceOnError(int enable)
#endif
}
-/** Query for the memory status */
-int SystemInformationImplementation::QueryMemory()
+bool SystemInformationImplementation::QueryWindowsMemory()
{
- this->TotalVirtualMemory = 0;
- this->TotalPhysicalMemory = 0;
- this->AvailableVirtualMemory = 0;
- this->AvailablePhysicalMemory = 0;
-#ifdef __CYGWIN__
- // _SC_PAGE_SIZE does return the mmap() granularity on Cygwin,
- // see http://cygwin.com/ml/cygwin/2006-06/msg00350.html
- // Therefore just use 4096 as the page size of Windows.
- long m = sysconf(_SC_PHYS_PAGES);
- if (m < 0)
- {
- return false;
- }
- this->TotalPhysicalMemory = m >> 8;
- return 1;
-#elif defined(_WIN32)
+#if defined(_WIN32)
# if defined(_MSC_VER) && _MSC_VER < 1300
MEMORYSTATUS ms;
unsigned long tv, tp, av, ap;
@@ -3385,8 +3389,15 @@ int SystemInformationImplementation::QueryMemory()
this->TotalPhysicalMemory = tp>>10>>10;
this->AvailableVirtualMemory = av>>10>>10;
this->AvailablePhysicalMemory = ap>>10>>10;
- return 1;
-#elif defined(__linux)
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool SystemInformationImplementation::QueryLinuxMemory()
+{
+#if defined(__linux)
unsigned long tv=0;
unsigned long tp=0;
unsigned long av=0;
@@ -3403,7 +3414,7 @@ int SystemInformationImplementation::QueryMemory()
if( errorFlag!=0 )
{
kwsys_ios::cout << "Problem calling uname(): " << strerror(errno) << kwsys_ios::endl;
- return 0;
+ return false;
}
if( unameInfo.release!=0 && strlen(unameInfo.release)>=3 )
@@ -3427,7 +3438,7 @@ int SystemInformationImplementation::QueryMemory()
if ( !fd )
{
kwsys_ios::cout << "Problem opening /proc/meminfo" << kwsys_ios::endl;
- return 0;
+ return false;
}
if( linuxMajor>=3 || ( (linuxMajor>=2) && (linuxMinor>=6) ) )
@@ -3466,7 +3477,7 @@ int SystemInformationImplementation::QueryMemory()
{
kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl;
fclose(fd);
- return 0;
+ return false;
}
}
else
@@ -3498,49 +3509,55 @@ int SystemInformationImplementation::QueryMemory()
{
kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl;
fclose(fd);
- return 0;
+ return false;
}
}
fclose( fd );
- return 1;
-#elif defined(__hpux)
- unsigned long tv=0;
- unsigned long tp=0;
- unsigned long av=0;
- unsigned long ap=0;
- struct pst_static pst;
- struct pst_dynamic pdy;
- unsigned long ps = 0;
- if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) != -1)
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool SystemInformationImplementation::QueryCygwinMemory()
+{
+#ifdef __CYGWIN__
+ // _SC_PAGE_SIZE does return the mmap() granularity on Cygwin,
+ // see http://cygwin.com/ml/cygwin/2006-06/msg00350.html
+ // Therefore just use 4096 as the page size of Windows.
+ long m = sysconf(_SC_PHYS_PAGES);
+ if (m < 0)
{
- ps = pst.page_size;
- tp = pst.physical_memory *ps;
- tv = (pst.physical_memory + pst.pst_maxmem) * ps;
- if (pstat_getdynamic(&pdy, sizeof(pdy), (size_t) 1, 0) != -1)
- {
- ap = tp - pdy.psd_rm * ps;
- av = tv - pdy.psd_vm;
- this->TotalVirtualMemory = tv>>10>>10;
- this->TotalPhysicalMemory = tp>>10>>10;
- this->AvailableVirtualMemory = av>>10>>10;
- this->AvailablePhysicalMemory = ap>>10>>10;
- return 1;
- }
+ return false;
}
- return 0;
-#elif defined(_AIX)
+ this->TotalPhysicalMemory = m >> 8;
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool SystemInformationImplementation::QueryAIXMemory()
+{
+#if defined(_AIX)
long c = sysconf(_SC_AIX_REALMEM);
if (c <= 0)
- {
- return 0;
- }
+ {
+ return false;
+ }
this->TotalPhysicalMemory = c / 1024;
- return 1;
+ return true;
#else
+ return false;
+#endif
+}
+/** Query for the memory status */
+bool SystemInformationImplementation::QueryMemory()
+{
#if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
// Assume the mmap() granularity as returned by _SC_PAGESIZE is also
// the system page size. The only known system where this isn't true
@@ -3550,7 +3567,7 @@ int SystemInformationImplementation::QueryMemory()
if (p < 0 || m < 0)
{
- return 0;
+ return false;
}
// assume pagesize is a power of 2 and smaller 1 MiB
@@ -3563,17 +3580,16 @@ int SystemInformationImplementation::QueryMemory()
p = sysconf(_SC_AVPHYS_PAGES);
if (p < 0)
{
- return 0;
+ return false;
}
this->AvailablePhysicalMemory = p;
this->AvailablePhysicalMemory /= pagediv;
#endif
- return 1;
-#endif
-
- return 0;
+ return true;
+#else
+ return false;
#endif
}
@@ -4414,6 +4430,42 @@ bool SystemInformationImplementation::QueryBSDProcessor()
#endif
}
+bool SystemInformationImplementation::QueryHPUXMemory()
+{
+#if defined(__hpux)
+ unsigned long tv=0;
+ unsigned long tp=0;
+ unsigned long av=0;
+ unsigned long ap=0;
+ struct pst_static pst;
+ struct pst_dynamic pdy;
+
+ unsigned long ps = 0;
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1)
+ {
+ return false;
+ }
+
+ ps = pst.page_size;
+ tp = pst.physical_memory *ps;
+ tv = (pst.physical_memory + pst.pst_maxmem) * ps;
+ if (pstat_getdynamic(&pdy, sizeof(pdy), (size_t) 1, 0) == -1)
+ {
+ return false;
+ }
+
+ ap = tp - pdy.psd_rm * ps;
+ av = tv - pdy.psd_vm;
+ this->TotalVirtualMemory = tv>>10>>10;
+ this->TotalPhysicalMemory = tp>>10>>10;
+ this->AvailableVirtualMemory = av>>10>>10;
+ this->AvailablePhysicalMemory = ap>>10>>10;
+ return true;
+#else
+ return false;
+#endif
+}
+
bool SystemInformationImplementation::QueryHPUXProcessor()
{
#if defined(__hpux)
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 9925640..b75993e 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -157,7 +157,7 @@ public:
#include <os/storage/Path.h>
#endif
-#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__)
+#if defined(__BEOS__) && !defined(__ZETA__)
#include <be/kernel/OS.h>
#include <be/storage/Path.h>
@@ -630,6 +630,7 @@ bool SystemTools::MakeDirectory(const char* path)
Mkdir(topdir.c_str());
pos++;
}
+ topdir = dir;
if(Mkdir(topdir.c_str()) != 0)
{
// There is a bug in the Borland Run time library which makes MKDIR
diff --git a/testDynamicLoader.cxx b/testDynamicLoader.cxx
index a7adbca..cbfb65b 100644
--- a/testDynamicLoader.cxx
+++ b/testDynamicLoader.cxx
@@ -15,7 +15,7 @@
#include KWSYS_HEADER(ios/iostream)
#include KWSYS_HEADER(stl/string)
-#if defined(__BEOS__) && !defined(__HAIKU__)
+#if defined(__BEOS__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
diff --git a/testProcess.c b/testProcess.c
index ec561ea..269b84b 100644
--- a/testProcess.c
+++ b/testProcess.c
@@ -32,7 +32,7 @@
# pragma warn -8060 /* possibly incorrect assignment */
#endif
-#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__)
+#if defined(__BEOS__) && !defined(__ZETA__)
/* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */
# include <be/kernel/OS.h>
static inline void testProcess_usleep(unsigned int msec)
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/ProcessUNIX.c | 4 -
Source/kwsys/SystemInformation.cxx | 184 +++++++++++++++++++++++-------------
Source/kwsys/SystemTools.cxx | 2 +-
Source/kwsys/testDynamicLoader.cxx | 2 +-
Source/kwsys/testProcess.c | 2 +-
5 files changed, 121 insertions(+), 73 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list