Commit Graph

256 Commits

Author SHA1 Message Date
Zach Mullen 254d267e36 Mac has gettimeofday defined, but cmsys wasn't aware of that, so it was falling back to using time() which only provides second resolution. Fixed to allow usec res. 2009-11-24 14:10:05 -05:00
David Cole 847918b38f Better fix for crash on Windows. This time it will even work on Linux, too. That GetLineFromStream method while loop sure is fussy. 2009-10-16 13:23:52 -04:00
David Cole 9578bfc0ef Fix crash on Windows. If input stream is no good, do not try to read a line from it. Return false and an empty line instead... 2009-10-16 11:43:05 -04:00
Brad King de955e4b6d Convert KWSys to OSI-approved BSD License
This converts the KWSys license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the KWSys copyright to
cover the full development time range.
2009-09-28 11:37:35 -04:00
Brad King f10929ae7c Restore KWSys SystemTools _WIN32 state on cygwin
The commit "Fix KWSys SystemTools build on cygwin with -mwin32" tried to
restore the state of the _WIN32 definition that was broken by the commit
"Optimize KWSys SystemTools::FileExists on Windows".  It did so for the
case of building with -mwin32 on cygwin, but since including <windows.h>
defines _WIN32, it failed for the case of not using -mwin32.

This commit restores the state of _WIN32 in all cases by undefining it
after including <windows.h> if it was not defined beforehand.
2009-09-24 08:10:46 -04:00
Brad King 4e121af95e Fix KWSys SystemTools build on cygwin with -mwin32
Commit "Optimize KWSys SystemTools::FileExists on Windows" accidentally
added "#undef _WIN32" when including <windows.h> on cygwin, which breaks
builds using the -mwin32 flag.  This commit removes that line and fixes
the real error it was intended to avoid.
2009-09-23 10:45:00 -04:00
Bill Hoffman e7601ca600 Put a flag in that will stop system tools from deleting system environment memory on exit, as it can cause gcov to crash the programs. 2009-09-22 14:56:33 -04:00
Brad King 9b6c3d0782 Optimize KWSys SystemTools::FileExists on Windows
We optimize this method by using the GetFileAttributesExA native Windows
API to check for file existence when possible.  For real Windows builds
we always use it.  For Cygwin we use cygwin_conv_to_win32_path to get a
native Windows path if possible and otherwise fall back to 'access'.

Cygwin-to-Windows path conversion and cache by Wojciech Migda.
See issue #8826.
2009-09-22 13:02:20 -04:00
Dave Partyka 9e7a3d7ece COMP: attempt to fix more 'hidden by' warnings. 2009-08-06 19:01:13 -04:00
Dave Partyka 1d158cffca ENH: try and see if using string.append instead of += will make valgrind not complaing that JoinPath is leaking. 2009-07-26 01:01:05 -04:00
Brad King d445275ed0 COMP: Remove useless variable assignment
This removes an assignment whose result is never used, thus quieting a
warning from Borland.
2009-06-22 14:19:17 -04:00
Bill Hoffman 8446a48054 ENH: use .exe on vms 2009-06-11 15:25:48 -04:00
Brad King fc537f05ba ENH: Teach KWSys SystemTools about VMS paths
This teaches ConvertToUnixSlashes to convert VMS paths into posix-style
paths.  We also set the DECC$FILENAME_UNIX_ONLY feature so the process
always sees posix-style paths on disk.
2009-06-10 13:02:48 -04:00
Bill Hoffman 0de79d4b2d ENH: fix warning on borland 2009-06-05 13:17:01 -04:00
Bill Hoffman fdff8eb300 ENH: move PutEnv to SystemTools 2009-06-05 12:01:30 -04:00
Brad King cecfce23a5 BUG: Fix removal of read-only directories
Read-only directories must be given write permission before we can
remove files and subdirectories from them.
2009-05-13 10:30:33 -04:00
Bill Hoffman 7fc99c94d4 ENH: check in almost building VMS stuff with VMSBuild directory since the bootstrap script will not work on VMS 2009-04-23 11:09:47 -04:00
Brad King 714d2fc04b ENH: Remove obscure method from KWSys SystemTools
This removes SystemTools::FileExistsInParentDirectories from KWSys since
it is a special-purpose method that is not generally useful.
2009-04-21 11:36:59 -04:00
Brad King 20f4fdee33 BUG: Fix SystemTools::IsSubDirectory on bad input
When SystemTools::GetParentDirectory was fixed to never remove the root
path component from a full path we violated an assumption made by
IsSubDirectory that eventually GetParentDirectory returns an empty
string.  This led to an infinite loop if the potential parent directory
is empty, so we explicitly avoid that case.
2009-04-20 08:42:05 -04:00
Brad King 3824f54c17 BUG: Replace brittle GetParentDirectory impl
The previous change to this method broke cases where the input path does
not exist.  The SystemTools::GetParentDirectory method is redundant with
the more robust SystemTools::GetFilenamePath.  This replaces its
implementation to just call GetFilenamePath.
2009-04-15 13:03:33 -04:00
Yumin Yuan f3035ff78d BUG: SystemTools::GetParentDirectory() will crash if "/" is passed in as argement. Valid check is added to make sure the input argment exists, and if "/" is passed in, empty string will be returned. 2009-04-15 10:45:29 -04:00
Francois Bertel 431c456cf5 COMP:Fixed warnings. 2009-03-18 08:50:55 -04:00
Brad King 6ed916795d BUG: Work around broken GetLongPathName case
On Windows the GetLongPathName API function does not work on some
filesystems even if the file exists.  In this case we should just use
the original long path name and not the GetShortPathName result.
See issue #8480.
2009-02-09 16:45:15 -05:00
Brad King ca096a4596 BUG: Fix GetRealPath when realpath fails
This patch from Philip Lowman teaches SystemTools::GetRealPath to deal
with paths that do not exist by dealing with the case that realpath
returns NULL.  See issue #8423.
2009-02-09 09:23:13 -05:00
David Cole 0fafdb7eb8 BUG: Do not copy permissions of files when making the copy in an install rule. If the source file was read-only, this prevents the subsequent set of the destination file's modification time, making the copied file always different in time-stamp than the original and always installing a new file with a new time stamp (but the same content) causing unnecessary downstream incremental rebuilds. As part of this fix, add an optional copyPermissions parameter to the SystemTools routines CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory. The copyPermissions parameter defaults to true to preserve the behavior of these routines for existing callers. 2008-12-18 10:43:24 -05:00
Sebastien Barre 8e5886e652 ENH: fix for Vista 2008-10-16 19:30:49 -04:00
Sebastien Barre b55f7a261f ENH: oops 2008-10-16 11:34:16 -04:00
Sebastien Barre ef93279573 ENH: fix for Windows Vista 2008-10-15 23:24:33 -04:00
Brad King b3f43f0065 STYLE: Fix typo in GetFilenameLastExtension docs
See issue #7797.
2008-10-10 11:23:02 -04:00
Bill Hoffman 64fc597de2 ENH: add initial support for HAIKU OS from bug# 7425 2008-09-15 17:53:28 -04:00
Brad King cea66664c5 ENH: Added WOW64 key view support to KWSys SystemTools' windows registry API.
- Add an argument to registry read/write/delete methods to specify
    a 32-bit or 64-bit view.
  - Default is the bit-ness of the running program.
  - See issue #7095.
2008-05-27 14:47:00 -04:00
Bill Lorensen 68dfcefbcb COMP: sprintf warnings. DWORD should use %ld rather than %d. Also, const char *p, a shadowed variable warning. 2008-05-10 22:48:53 -04:00
Jeffrey Baumes 4cf167173f ENH: Allow numbers in username in URL regex. 2008-04-23 12:51:02 -04:00
Bill Hoffman 7dcfdf5005 BUG: fix install problem on make and allow symlinks to cmake bin directory 2008-03-27 17:05:11 -04:00
Brad King 9198a92af9 COMP: Fix VS6 and old HP build. This source does not have the #define for hack. 2008-01-21 08:01:04 -05:00
Brad King ce2b20361a BUG: Fix previous commit to not access empty strings out of bounds. 2008-01-20 19:29:12 -05:00
Brad King c7b844ba3e BUG: Make sure search paths never have double-slashes. Leading with two slashes (//) on cygwin looks like a network path and delays while waiting for a non-existent machine. 2008-01-20 17:24:46 -05:00
Brad King 615ce67ad4 COMP: Fix build on borland. 2008-01-12 09:52:50 -05:00
Brad King a6d32b96ed ENH: Add SystemTools::SplitPathRootComponent and re-implement SplitPath to use it. Add better treatment of user home directory paths. 2008-01-11 08:33:48 -05:00
Bill Hoffman a5e76555bf BUG: fix for bug 6136 make sure includes are not directories 2007-12-14 20:31:27 -05:00
Philippe Pebay 836e595fcc BUG: fixed an incomplete regexp 2007-12-06 16:43:11 -05:00
Brad King cc80c4e285 COMP: Remove reference to vtksys. The unmangled kwsys name should be used in this source. 2007-12-05 13:13:53 -05:00
Philippe Pebay f18ae2234c ENH: added two functions for URL parsing:
1. an "abridged" version that separates protocol from dataglom in
        an expression with the form protocol://dataglom
     2. a "full" version that parses protocol, username, password,
        hostname, port, and path in a standard URL (all of these variables
        are optional, except for protocol and hostname).
2007-12-05 12:24:27 -05:00
Bill Hoffman 39c164cb83 ENH: remove warning 2007-12-04 17:00:44 -05:00
Bill Hoffman 5050706ae3 ENH: add a touch -E command to cmake 2007-12-04 16:03:19 -05:00
Alexander Neundorf e3c84cf5a6 ENH: add support for the Syllable OS (http://www.syllable.org)
major issues:
-access() doesn't return false for an empty string (#ifdefed in cmake)
-dlopen() doesn't return 0 on failure (#ifdefed in cmake and fixed now in Syllable)
-the kwsys and Bootstrap tests fail with timeout due to the fact that I'm doing all that in qemu, which is quite slow
-RPATH is now supported, so without modifying the test adapting DLL_PATH in Syllable is required for the tests to succeed
-the Plugin test fails with an undefined reference to example_exe_function() in example_mod_1, it seems this isn't supported under Syllable

Alex
2007-11-23 20:45:49 -05:00
David Cole 867de7fc67 ENH: Add ability to call Visual Studio macros from CMake. Add a CMake Visual Studio macro to reload a solution file automatically if CMake makes changes to .sln files or .vcproj files. Add code to call the macro automatically for any running Visual Studio instances with the .sln file open at the end of the Visual Studio Generate call. Only call the macro if some .sln or .vcproj file changed during Generate. Also, add handling for REG_EXPAND_SZ type to SystemTools::ReadRegistryValue - returned string has environment variable references expanded. 2007-11-16 07:01:58 -05:00
Brad King 8b9dcc9e1a COMP: Fix warning when gcount stream method does not really return std::streamsize. 2007-11-07 08:59:29 -05:00
Brad King f410f8578e COMP: Fix warnings on 64-bit Mac OS X build. Patch from issue #3697. 2007-11-05 14:34:36 -05:00
Sean McBride 0b4c9cb86c STYLE: fixed misspellings of Mac OS X 2007-10-26 12:13:01 -04:00