Commit 9891260a authored by Bill Hoffman's avatar Bill Hoffman

ENH: add support for watcom wmake and wcl386

parent 2694ad76
......@@ -34,10 +34,7 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
INCLUDE(CheckIncludeFileCXX)
INCLUDE(TestForSTDNamespace)
INCLUDE(TestForANSIForScope)
CHECK_INCLUDE_FILE_CXX("sstream" CMAKE_HAS_ANSI_STRING_STREAM)
INCLUDE(TestForSSTREAM)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
IF(NOT CMAKE_HAS_ANSI_STRING_STREAM)
SET( CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
"Does the compiler support sstream or stringstream.")
ENDIF(NOT CMAKE_HAS_ANSI_STRING_STREAM)
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
"Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(CMAKE_LIBRARY_PATH_FLAG "libpath ")
SET(CMAKE_LINK_LIBRARY_FLAG "library ")
IF(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_WCL_QUIET)
SET(CMAKE_WLINK_QUIET)
SET(CMAKE_LIB_QUIET)
ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_WCL_QUIET "-zq")
SET(CMAKE_WLINK_QUIET "option quiet")
SET(CMAKE_LIB_QUIET "-q")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_BUILD_TYPE_INIT Debug)
SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
SET (CMAKE_C_FLAGS_INIT "-w=3 ")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -od")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -ot -dNDEBUG")
SET (CMAKE_STANDARD_LIBRARIES "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib" CACHE STRING
"Libraries linked by defalut with all applications.")
SET(CMAKE_C_LINK_EXECUTABLE
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
# compile a C++ file into an object file
SET(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -fo<OBJECT> -c -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
# compile a C file into an object file
SET(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES>"
"wlib -q -n -b <TARGET_BASE>.lib +<TARGET_BASE>.dll ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
# create a C shared library
SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
# create a C shared module just copy the shared library rule
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
# create a C++ static library
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b <TARGET> <OBJECTS> ")
# create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
# # - Test for std:: namespace support
# check if the compiler supports std:: on stl classes
# CMAKE_NO_STD_NAMESPACE - defined by the results
#
IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
MESSAGE(STATUS "Check for sstream")
TRY_COMPILE(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
OUTPUT_VARIABLE OUTPUT)
IF (CMAKE_HAS_ANSI_STRING_STREAM)
MESSAGE(STATUS "Check for sstream - found")
SET (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
"Does the compiler support sstream")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if the CXX compiler has sstream passed with "
"the following output:\n${OUTPUT}\n\n")
ELSE (CMAKE_HAS_ANSI_STRING_STREAM)
MESSAGE(STATUS "Check for sstream - not found")
SET (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
"Does the compiler support sstream")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if the CXX compiler has sstream failed with "
"the following output:\n${OUTPUT}\n\n")
ENDIF (CMAKE_HAS_ANSI_STRING_STREAM)
ENDIF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
#include <sstream>
int main(int, char*[])
{
std::ostringstream os;
os << "12345";
if(os.str().size() == 5)
{
return 0;
}
return -1;
}
......@@ -28,7 +28,7 @@ If you need other commands to do special things then it should still begin with
You really should also provide backwards compatibility any old settings that were actually in use. Make sure you comment them as deprecated, so that no-one starts using them.
To correctly docuement a module, create a comment block at the top with # comments. There are three types of comments that can be in the block:
To correctly document a module, create a comment block at the top with # comments. There are three types of comments that can be in the block:
1. The brief description of the module, this is done by:
# - a small description
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -135,6 +135,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// target so that make with no arguments will run it.
// Just depend on the all target to drive the build.
std::vector<std::string> depends;
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
std::vector<std::string> no_commands;
depends.push_back("all");
......@@ -146,10 +151,16 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
depends,
no_commands);
depends.clear();
if(sym)
{
depends.push_back(sym);
}
// Write and empty all:
lg->WriteMakeRule(makefileStream,
"The main recursive all target", "all",
no_commands, no_commands);
depends, no_commands);
lg->WriteMakeVariables(makefileStream);
......@@ -590,6 +601,7 @@ cmGlobalUnixMakefileGenerator3
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
// for each target Generate the rule files for each target.
cmTargets& targets = lg->GetMakefile()->GetTargets();
......@@ -617,7 +629,11 @@ cmGlobalUnixMakefileGenerator3
commands.clear();
commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
t->second.GetName()));
depends.clear();
depends.clear();
if(sym)
{
depends.push_back(sym);
}
depends.push_back("cmake_check_build_system");
lg->WriteMakeRule(ruleFileStream,
"Build rule for target.",
......@@ -695,6 +711,11 @@ cmGlobalUnixMakefileGenerator3
// Write the rule.
localName += "/all";
depends.clear();
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
this->AppendGlobalTargetDepends(depends,t->second);
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
localName.c_str(), depends, commands);
......@@ -714,6 +735,10 @@ cmGlobalUnixMakefileGenerator3
commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
localName.c_str()));
depends.clear();
if(sym)
{
depends.push_back(sym);
}
depends.push_back("cmake_check_build_system");
localName = lg->GetRelativeTargetDirectory(t->second);
localName += "/rule";
......@@ -733,6 +758,10 @@ cmGlobalUnixMakefileGenerator3
makeTargetName = localName;
makeTargetName += "/clean";
depends.clear();
if(sym)
{
depends.push_back(sym);
}
commands.clear();
commands.push_back(lg->GetRecursiveMakeCall(makefileName.c_str(),
makeTargetName.c_str()));
......@@ -905,6 +934,11 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
}
}
}
const char* sym = lg->GetMakefile()->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
no_depends.push_back(sym);
}
lg->WriteMakeRule(ruleFileStream, "Help Target",
"help:",
no_depends, commands);
......
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "cmGlobalWatcomWMakeGenerator.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator()
{
m_FindMakeProgramFile = "CMakeFindWMake.cmake";
m_ForceUnixPaths = false;
}
void cmGlobalWatcomWMakeGenerator::EnableLanguage(std::vector<std::string>const& l,
cmMakefile *mf)
{
// pick a default
mf->AddDefinition("WATCOM", "1");
mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
mf->AddDefinition("CMAKE_WINDOWS_OBJECT_PATH", "1");
mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
mf->AddDefinition("CMAKE_NO_QUOTED_OBJECTS", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf);
}
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
lg->SetSilentNoColon(true);
lg->SetEchoNeedsQuote(false);
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("-s -h");
lg->SetGlobalGenerator(this);
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(false);
lg->SetUnixCD(false);
lg->SetIncludeDirective("!include");
return lg;
}
//----------------------------------------------------------------------------
void cmGlobalWatcomWMakeGenerator::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.name = this->GetName();
entry.brief = "Generates Watcom WMake makefiles.";
entry.full = "";
}
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef cmGlobalWatcomWMakeGenerator_h
#define cmGlobalWatcomWMakeGenerator_h
#include "cmGlobalUNIXMakefileGenerator3.h"
/** \class cmGlobalWatcomWMakeGenerator
* \brief Write a NMake makefiles.
*
* cmGlobalWatcomWMakeGenerator manages nmake build process for a tree
*/
class cmGlobalWatcomWMakeGenerator : public cmGlobalUnixMakefileGenerator3
{
public:
cmGlobalWatcomWMakeGenerator();
static cmGlobalGenerator* New() { return new cmGlobalWatcomWMakeGenerator; }
///! Get the name for the generator.
virtual const char* GetName() const {
return cmGlobalWatcomWMakeGenerator::GetActualName();}
static const char* GetActualName() {return "Watcom WMake";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
};
#endif
......@@ -41,6 +41,7 @@
//----------------------------------------------------------------------------
cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
{
m_SilentNoColon = false;
m_WindowsShell = false;
m_IncludeDirective = "include";
m_MakefileVariableSize = 0;
......@@ -609,7 +610,10 @@ cmLocalUnixMakefileGenerator3
std::string relativeObj = this->GetHomeRelativeOutputPath();
relativeObj += obj;
if(m_Makefile->GetDefinition("CMAKE_WINDOWS_OBJECT_PATH"))
{
relativeObj = cmSystemTools::ConvertToOutputPath(relativeObj.c_str());
}
// Write the build rule.
// Build the set of compiler flags.
std::string flags;
......@@ -849,6 +853,11 @@ cmLocalUnixMakefileGenerator3
// Collect the commands and dependencies.
std::vector<std::string> commands;
std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
// Utility targets store their rules in pre- and post-build commands.
this->AppendCustomDepends(depends, target.GetPreBuildCommands());
......@@ -1122,6 +1131,11 @@ cmLocalUnixMakefileGenerator3
// Write special "install" target to run cmake_install.cmake script.
{
std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
std::vector<std::string> commands;
std::string cmd;
if(m_Makefile->GetDefinition("CMake_BINARY_DIR"))
......@@ -1150,9 +1164,14 @@ cmLocalUnixMakefileGenerator3
"install", depends, commands);
}
std::vector<std::string> no_depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
no_depends.push_back(sym);
}
// Write special "rebuild_cache" target to re-run cmake.
{
std::vector<std::string> no_depends;
std::vector<std::string> commands;
this->AppendEcho(commands, "Running CMake to regenerate build system...");
commands.push_back(
......@@ -1168,7 +1187,6 @@ cmLocalUnixMakefileGenerator3
// Otherwise default to the interactive command-line interface.
if(m_Makefile->GetDefinition("CMAKE_EDIT_COMMAND"))
{
std::vector<std::string> no_depends;
std::vector<std::string> commands;
this->AppendEcho(commands, "Running CMake cache editor...");
commands.push_back(
......@@ -1181,7 +1199,6 @@ cmLocalUnixMakefileGenerator3
}
else
{
std::vector<std::string> no_depends;
std::vector<std::string> commands;
this->AppendEcho(commands,
"Running interactive CMake command-line interface...");
......@@ -1201,8 +1218,8 @@ cmLocalUnixMakefileGenerator3
// name of this special target. This gives a make-time choice to
// the user.
std::vector<std::string> commands;
no_depends.clear();
commands.clear();
std::vector<std::string> no_depends;
if(m_Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
{
makefileStream
......@@ -1210,12 +1227,18 @@ cmLocalUnixMakefileGenerator3
<< "VERBOSE = 1\n"
<< "\n";
}
this->WriteMakeRule(makefileStream,
"Suppress display of executed commands.",
"$(VERBOSE).SILENT",
no_depends,
commands);
if(m_SilentNoColon)
{
makefileStream << "$(VERBOSE).SILENT\n";
}
else
{
this->WriteMakeRule(makefileStream,
"Suppress display of executed commands.",
"$(VERBOSE).SILENT",
no_depends,
commands);
}
// Special target to cleanup operation of make tool.
std::vector<std::string> depends;
......@@ -1255,6 +1278,12 @@ cmLocalUnixMakefileGenerator3
std::vector<std::string> no_depends;
std::vector<std::string> commands;
commands.push_back(runRule);
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
no_depends.push_back(sym);
}
this->WriteMakeRule(makefileStream,
"Special rule to run CMake to check the build system "
"integrity.\n"
......@@ -1284,6 +1313,11 @@ cmLocalUnixMakefileGenerator3
{
// The helper target depends on the real target.
std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
depends.push_back(realTarget);
// There are no commands.
......@@ -1956,12 +1990,25 @@ cmLocalUnixMakefileGenerator3
<< "# Object files for target " << target.GetName() << "\n"
<< variableName.c_str() << " =";
std::string object;
const char* objName = m_Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS");
const char* lineContinue = m_Makefile->GetDefinition("CMAKE_MAKE_LINE_CONTINUE");
if(!lineContinue)
{
lineContinue = "\\";
}
for(std::vector<std::string>::const_iterator i = objects.begin();
i != objects.end(); ++i)
{
ruleFileStream
<< " \\\n"
<< this->ConvertToQuotedOutputPath(i->c_str());
<< " " << lineContinue << "\n";
if(objName)
{
ruleFileStream << this->Convert(i->c_str(), START_OUTPUT, MAKEFILE);
}
else
{
ruleFileStream << this->ConvertToQuotedOutputPath(i->c_str());
}
}
ruleFileStream
<< "\n";
......@@ -1979,8 +2026,16 @@ cmLocalUnixMakefileGenerator3
{
object = this->Convert(i->c_str(),START_OUTPUT);
ruleFileStream
<< " \\\n"
<< this->ConvertToQuotedOutputPath(object.c_str());
<< " " << lineContinue << "\n"
<< m_Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME");
if(objName)
{
ruleFileStream << this->Convert(i->c_str(), START_OUTPUT, MAKEFILE);
}
else
{
ruleFileStream << this->ConvertToQuotedOutputPath(i->c_str());
}
}
ruleFileStream
<< "\n"
......@@ -2053,7 +2108,12 @@ cmLocalUnixMakefileGenerator3
cmTarget& target,
const std::vector<std::string>& files)
{
std::vector<std::string> no_depends;
std::vector<std::string> depends;
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
std::vector<std::string> commands;
// Construct the clean target name.
......@@ -2066,7 +2126,7 @@ cmLocalUnixMakefileGenerator3
m_Makefile->GetHomeOutputDirectory());
// Write the rule.
this->WriteMakeRule(ruleFileStream, 0,
cleanTarget.c_str(), no_depends, commands);
cleanTarget.c_str(), depends, commands);
}
......@@ -2210,6 +2270,7 @@ cmLocalUnixMakefileGenerator3
std::string
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
{
// Split the path into its components.
std::vector<std::string> components;
cmSystemTools::SplitPath(p, components);
......@@ -2894,6 +2955,11 @@ void cmLocalUnixMakefileGenerator3
dir += "/directorystart";
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
// if at the top the rule is called all
const char* sym = m_Makefile->GetDefinition("CMAKE_MAKE_SYMBOLIC_RULE");
if(sym)
{
depends.push_back(sym);
}
if (!m_Parent)
{
dir = "all";
......@@ -2908,11 +2974,19 @@ void cmLocalUnixMakefileGenerator3
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
commands.clear();
depends.clear();
if(sym)
{
depends.push_back(sym);
}
this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir);
this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands);
// write the depend rule, really a recompute depends rule
depends.clear();
if(sym)
{
depends.push_back(sym);
}
commands.clear();
std::string cmakefileName = "CMakeFiles/Makefile.cmake";
this->Convert(cmakefileName.c_str(),HOME_OUTPUT,
......
......@@ -115,6 +115,12 @@ public:
*/
void SetUnixCD(bool v) {m_UnixCD = v;}
/**
* Set Support Verbose Variable. If true, then .SILENT will
* be not end with : i.e. .SILENT: or .SILENT
*/
void SetSilentNoColon(bool v) {m_SilentNoColon = v;}
/**
* Set the string used to include one makefile into another default
* is include.
......@@ -365,6 +371,7 @@ private:
bool m_DefineWindowsNULL;
bool m_UnixCD;
bool m_PassMakeflags;
bool m_SilentNoColon;
//==========================================================================
// Flag for whether echo command needs quotes.
......
......@@ -131,6 +131,7 @@ protected:
RegexReplacement(const char* s): number(-1), value(s) {}
RegexReplacement(const std::string& s): number(-1), value(s) {}
RegexReplacement(int n): number(n), value() {}
RegexReplacement() {};
int number;
std::string value;
};
......
......@@ -47,6 +47,7 @@
# endif
# include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h"
# include "cmGlobalWatcomWMakeGenerator.h"
# include "cmGlobalMSYSMakefileGenerator.h"
# include "cmGlobalMinGWMakefileGenerator.h"
# include "cmWin32ProcessExecution.h"
......@@ -1606,6 +1607,8 @@ void cmake::AddDefaultGenerators()
&cmGlobalBorlandMakefileGenerator::New;
m_Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] =
&cmGlobalNMakeMakefileGenerator::New;
m_Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] =
&cmGlobalWatcomWMakeGenerator::New;
m_Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] =
&cmGlobalMSYSMakefileGenerator::New;
m_Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] =
......
......@@ -74,7 +74,7 @@ const char* Directory::GetFile(unsigned long dindex)
// First microsoft compilers
#ifdef _MSC_VER
#if defined(_MSC_VER) || defined(__WATCOMC__)
#include <windows.h>
#include <io.h>
#include <ctype.h>
......
......@@ -12,7 +12,9 @@
=========================================================================*/
#include <stdio.h>
#ifdef __WATCOMC__
#define _unlink unlink
#endif
int main(int argc, char* argv[])
{
FILE* ifp;
......@@ -76,6 +78,9 @@ int main(int argc, char* argv[])
fprintf(ofp, "extern %s_EXPORT int %sEncodedWriteArray%s(const char* fname)\n",
argv[3], argv[3], argv[4]);
fprintf(ofp, "{\n");
fprintf(ofp, "#ifdef __WATCOMC__\n");
fprintf(ofp, "#define _unlink unlink\n");
fprintf(ofp, "#endif\n");
fprintf(ofp, " FILE* ofp = fopen(fname, \"wb\");\n");
fprintf(ofp, " if(!ofp) { return 0; }\n");
for(i=0; i < count; ++i)
......
......@@ -35,7 +35,7 @@
#include <ctype.h>
#include <stdio.h>
#include <string.h>
namespace KWSYS_NAMESPACE
{
#if defined( _WIN32 ) || defined( APPLE ) || defined( __CYGWIN__ )
......
......@@ -45,6 +45,9 @@ Q190351 and Q150956.
#include <string.h> /* strlen, strdup */
#include <stdio.h> /* sprintf */
#include <io.h> /* _unlink */
#ifdef __WATCOMC__
#define _unlink unlink
#endif
#ifndef _MAX_FNAME
#define _MAX_FNAME 4096
......
......@@ -367,9 +367,7 @@ RegistryHelper::~RegistryHelper()
bool RegistryHelper::Open(const char *toplevel, const char *subkey,
int readonly)
{
this->EntriesMap.erase(
this->EntriesMap.begin(),
this->EntriesMap.end());
this->EntriesMap.clear();
m_Empty = 1;
#ifdef _WIN32
......@@ -416,7 +414,7 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
}
}
m_HomeDirectory = homeDirectory;
str << m_HomeDirectory << "/." << toplevel << "rc";
str << m_HomeDirectory.c_str() << "/." << toplevel << "rc";
if ( readonly == Registry::READWRITE )
{
kwsys_ios::ofstream ofs( str.str().c_str(), kwsys_ios::ios::out|kwsys_ios::ios::app );
......@@ -503,7 +501,7 @@ bool RegistryHelper::Close()
}
kwsys_ios::ostringstream str;
str << m_HomeDirectory << "/." << this->GetTopLevel() << "rc";
str << m_HomeDirectory.c_str() << "/." << this->GetTopLevel() << "rc";
kwsys_ios::ofstream *ofs = new kwsys_ios::ofstream(str.str().c_str(), kwsys_ios::ios::out);
if ( !ofs )
{
......@@ -531,9 +529,7 @@ bool RegistryHelper::Close()
*ofs << it->first.c_str() << " = " << this->EncodeValue(it->second.c_str()).c_str() << kwsys_ios::endl;
}
}