diff options
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmOrderDirectories.cxx | 26 | ||||
-rw-r--r-- | Source/cmOrderDirectories.h | 6 | ||||
-rw-r--r-- | Source/cmStandardIncludes.h | 2 | ||||
-rw-r--r-- | Source/kwsys/CPU.h.in | 4 | ||||
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 2 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 53 | ||||
-rw-r--r-- | Utilities/KWIML/ABI.h.in | 4 |
8 files changed, 63 insertions, 36 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0f9b810..15782b6 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 20151130) +set(CMake_VERSION_PATCH 20151202) #set(CMake_VERSION_RC 1) diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index e3eedc7..61efd01 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -73,10 +73,8 @@ public: { // Check if this directory conflicts with the entry. std::string const& dir = this->OD->OriginalDirectories[i]; - if(dir != this->Directory && - cmSystemTools::GetRealPath(dir) != - cmSystemTools::GetRealPath(this->Directory) && - this->FindConflict(dir)) + if (!this->OD->IsSameDirectory(dir, this->Directory) && + this->FindConflict(dir)) { // The library will be found in this directory but this is not // the directory named for it. Add an entry to make sure the @@ -639,3 +637,23 @@ void cmOrderDirectories::DiagnoseCycle() ->IssueMessage(cmake::WARNING, e.str(), this->Target->GetBacktrace()); } + +bool cmOrderDirectories::IsSameDirectory(std::string const& l, + std::string const& r) +{ + return this->GetRealPath(l) == this->GetRealPath(r); +} + +std::string const& cmOrderDirectories::GetRealPath(std::string const& dir) +{ + std::map<std::string, std::string>::iterator i = + this->RealPaths.lower_bound(dir); + if (i == this->RealPaths.end() || + this->RealPaths.key_comp()(dir, i->first)) + { + typedef std::map<std::string, std::string>::value_type value_type; + i = this->RealPaths.insert( + i, value_type(dir, cmSystemTools::GetRealPath(dir))); + } + return i->second; +} diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 211c786..477216b 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -80,6 +80,12 @@ private: struct ConflictList: public std::vector<ConflictPair> {}; std::vector<ConflictList> ConflictGraph; + // Compare directories after resolving symlinks. + bool IsSameDirectory(std::string const& l, std::string const& r); + + std::string const& GetRealPath(std::string const& dir); + std::map<std::string, std::string> RealPaths; + friend class cmOrderDirectoriesConstraint; friend class cmOrderDirectoriesConstraintLibrary; }; diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index dd8fa9c..aed2e74 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -54,6 +54,8 @@ #if defined( _MSC_VER ) typedef unsigned short mode_t; +#else +# include <sys/types.h> #endif // use this class to shrink the size of symbols in .o files diff --git a/Source/kwsys/CPU.h.in b/Source/kwsys/CPU.h.in index 884d71a..66ffbb1 100644 --- a/Source/kwsys/CPU.h.in +++ b/Source/kwsys/CPU.h.in @@ -88,6 +88,10 @@ #elif defined(__mips) || defined(__mips__) || defined(__MIPS__) # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG +/* NIOS2 */ +#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__) +# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE + /* OpenRISC 1000 */ #elif defined(__or1k__) # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 6d9b109..b0ddf5a 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -2241,7 +2241,7 @@ static kwsysProcessTime kwsysProcessTimeAdd(kwsysProcessTime in1, kwsysProcessTi kwsysProcessTime out; out.tv_sec = in1.tv_sec + in2.tv_sec; out.tv_usec = in1.tv_usec + in2.tv_usec; - if(out.tv_usec > 1000000) + if(out.tv_usec >= 1000000) { out.tv_usec -= 1000000; out.tv_sec += 1; diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index da34eb9..37fe421 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2970,6 +2970,8 @@ std::string SystemTools::FindProgram( bool no_system_path) { std::vector<std::string> extensions; + std::string tryPath; + #if defined (_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) bool hasExtension = false; // check to see if the name already has a .xxx at @@ -2983,22 +2985,22 @@ std::string SystemTools::FindProgram( { extensions.push_back(".com"); extensions.push_back(".exe"); - } -#endif - std::string tryPath; - // first try with extensions if the os supports them - for(std::vector<std::string>::iterator i = - extensions.begin(); i != extensions.end(); ++i) - { - tryPath = name; - tryPath += *i; - if(SystemTools::FileExists(tryPath) && - !SystemTools::FileIsDirectory(tryPath)) + // first try with extensions if the os supports them + for(std::vector<std::string>::iterator i = + extensions.begin(); i != extensions.end(); ++i) { - return SystemTools::CollapseFullPath(tryPath); + tryPath = name; + tryPath += *i; + if(SystemTools::FileExists(tryPath) && + !SystemTools::FileIsDirectory(tryPath)) + { + return SystemTools::CollapseFullPath(tryPath); + } } } +#endif + // now try just the name tryPath = name; if(SystemTools::FileExists(tryPath) && @@ -3048,8 +3050,7 @@ std::string SystemTools::FindProgram( tryPath = *p; tryPath += name; tryPath += *ext; - if(SystemTools::FileExists(tryPath) && - !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3057,8 +3058,7 @@ std::string SystemTools::FindProgram( // now try it without them tryPath = *p; tryPath += name; - if(SystemTools::FileExists(tryPath) && - !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3097,8 +3097,7 @@ std::string SystemTools const std::vector<std::string>& userPaths) { // See if the executable exists as written. - if(SystemTools::FileExists(name) && - !SystemTools::FileIsDirectory(name)) + if(SystemTools::FileExists(name, true)) { return SystemTools::CollapseFullPath(name); } @@ -3144,8 +3143,7 @@ std::string SystemTools tryPath = *p; tryPath += name; tryPath += ".lib"; - if(SystemTools::FileExists(tryPath) - && !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3154,8 +3152,7 @@ std::string SystemTools tryPath += "lib"; tryPath += name; tryPath += ".so"; - if(SystemTools::FileExists(tryPath) - && !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3163,8 +3160,7 @@ std::string SystemTools tryPath += "lib"; tryPath += name; tryPath += ".a"; - if(SystemTools::FileExists(tryPath) - && !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3172,8 +3168,7 @@ std::string SystemTools tryPath += "lib"; tryPath += name; tryPath += ".sl"; - if(SystemTools::FileExists(tryPath) - && !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3181,8 +3176,7 @@ std::string SystemTools tryPath += "lib"; tryPath += name; tryPath += ".dylib"; - if(SystemTools::FileExists(tryPath) - && !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } @@ -3190,8 +3184,7 @@ std::string SystemTools tryPath += "lib"; tryPath += name; tryPath += ".dll"; - if(SystemTools::FileExists(tryPath) - && !SystemTools::FileIsDirectory(tryPath)) + if(SystemTools::FileExists(tryPath, true)) { return SystemTools::CollapseFullPath(tryPath); } diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in index 6300ada..87b6e96 100644 --- a/Utilities/KWIML/ABI.h.in +++ b/Utilities/KWIML/ABI.h.in @@ -398,6 +398,10 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined. #elif defined(__mips) || defined(__mips__) || defined(__MIPS__) # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG +/* NIOS2 */ +#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__) +# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE + /* OpenRISC 1000 */ #elif defined(__or1k__) # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG |