summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-02 23:39:57 (GMT)
committerhobbs <hobbs>2002-09-02 23:39:57 (GMT)
commit895ffdfb298831e3f22128342c0205c5e3e7190e (patch)
tree270fe58784b2ad4c44cb2d3d14bba2c089321d71 /unix/tcl.m4
parentb532e9030fc637f2c240f82dc62d5d4c9ef7b761 (diff)
downloadtcl-895ffdfb298831e3f22128342c0205c5e3e7190e.zip
tcl-895ffdfb298831e3f22128342c0205c5e3e7190e.tar.gz
tcl-895ffdfb298831e3f22128342c0205c5e3e7190e.tar.bz2
* unix/configure:
* unix/tcl.m4: added 64-bit gcc compilation support on HP-11. [Patch #601051] (martin)
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m419
1 files changed, 17 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index e8ffd50..fd47e68 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -960,11 +960,26 @@ dnl AC_CHECK_TOOL(AR, ar, :)
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #EXTRA_CFLAGS="+DAportable"
+
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
- AC_MSG_WARN("64bit mode not supported with GCC on $system")
- else
+ hpux_arch='`gcc -dumpmachine`'
+ case $hpux_arch in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD="gcc -shared"
+ SHLIB_LD_LIBS=""
+ LD_SEARCH_FLAGS=''
+ ;;
+ *)
+ AC_MSG_WARN("64bit mode not supported with GCC on $system")
+ ;;
+ esac
+ else
do64bit_ok=yes
EXTRA_CFLAGS="+DA2.0W"
LDFLAGS="+DA2.0W $LDFLAGS"
le <<
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 20a61a0..e2970e5 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -63,7 +63,7 @@ bool cmSiteNameCommand
{
std::string host;
cmSystemTools::RunSingleCommand(hostname_cmd.c_str(),
- &host, 0, 0, cmSystemTools::OUTPUT_NONE);
+ &host, 0, 0, 0, cmSystemTools::OUTPUT_NONE);
// got the hostname
if (!host.empty())
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 95d05a6..0e0532d 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -659,7 +659,8 @@ std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
- std::string* output ,
+ std::string* captureStdOut,
+ std::string* captureStdErr,
int* retVal , const char* dir ,
OutputOption outputflag ,
double timeout )
@@ -671,9 +672,13 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
argv.push_back(a->c_str());
}
argv.push_back(0);
- if ( output )
+ if ( captureStdOut )
{
- *output = "";
+ *captureStdOut = "";
+ }
+ if (captureStdErr && captureStdErr != captureStdOut)
+ {
+ *captureStdErr = "";
}
cmsysProcess* cp = cmsysProcess_New();
@@ -693,15 +698,17 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp);
- std::vector<char> tempOutput;
+ std::vector<char> tempStdOut;
+ std::vector<char> tempStdErr;
char* data;
int length;
int pipe;
- if(outputflag != OUTPUT_PASSTHROUGH && (output || outputflag != OUTPUT_NONE))
+ if(outputflag != OUTPUT_PASSTHROUGH &&
+ (captureStdOut || captureStdErr || outputflag != OUTPUT_NONE))
{
while((pipe = cmsysProcess_WaitForData(cp, &data, &length, 0)) > 0)
{
- if(output || outputflag != OUTPUT_NONE)
+ if(captureStdOut || captureStdErr || outputflag != OUTPUT_NONE)
{
// Translate NULL characters in the output into valid text.
// Visual Studio 7 puts these characters in the output of its
@@ -714,9 +721,21 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
}
}
}
- if ( output )
+ if(pipe == cmsysProcess_Pipe_STDOUT ||
+ (pipe == cmsysProcess_Pipe_STDERR &&
+ captureStdOut == captureStdErr))
+ {
+ if (captureStdOut)
+ {
+ tempStdOut.insert(tempStdOut.end(), data, data+length);
+ }
+ }
+ else if(pipe == cmsysProcess_Pipe_STDERR)
{
- tempOutput.insert(tempOutput.end(), data, data+length);
+ if (captureStdErr)
+ {
+ tempStdErr.insert(tempStdErr.end(), data, data+length);
+ }
}
if(outputflag != OUTPUT_NONE)
{
@@ -740,9 +759,14 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
}
cmsysProcess_WaitForExit(cp, 0);
- if ( output && tempOutput.begin() != tempOutput.end())
+ if ( captureStdOut && tempStdOut.begin() != tempStdOut.end())
+ {
+ captureStdOut->append(&*tempStdOut.begin(), tempStdOut.size());
+ }
+ if ( captureStdErr && captureStdErr != captureStdOut &&
+ tempStdErr.begin() != tempStdErr.end())
{
- output->append(&*tempOutput.begin(), tempOutput.size());
+ captureStdErr->append(&*tempStdErr.begin(), tempStdErr.size());
}
bool result = true;
@@ -767,9 +791,9 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
{
std::cerr << exception_str << std::endl;
}
- if ( output )
+ if ( captureStdErr )
{
- output->append(exception_str, strlen(exception_str));
+ captureStdErr->append(exception_str, strlen(exception_str));
}
result = false;
}
@@ -780,9 +804,9 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
{
std::cerr << error_str << std::endl;
}
- if ( output )
+ if ( captureStdErr )
{
- output->append(error_str, strlen(error_str));
+ captureStdErr->append(error_str, strlen(error_str));
}
result = false;
}
@@ -793,9 +817,9 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
{
std::cerr << error_str << std::endl;
}
- if ( output )
+ if ( captureStdErr )
{
- output->append(error_str, strlen(error_str));
+ captureStdErr->append(error_str, strlen(error_str));
}
result = false;
}
@@ -806,7 +830,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
bool cmSystemTools::RunSingleCommand(
const char* command,
- std::string* output,
+ std::string* captureStdOut,
+ std::string* captureStdErr,
int *retVal,
const char* dir,
OutputOption outputflag,
@@ -823,8 +848,8 @@ bool cmSystemTools::RunSingleCommand(
{
return false;
}
- return cmSystemTools::RunSingleCommand(args, output,retVal,
- dir, outputflag, timeout);
+ return cmSystemTools::RunSingleCommand(args, captureStdOut, captureStdErr,
+ retVal, dir, outputflag, timeout);
}
std::string
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 433ef46..6feb6c5 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -223,7 +223,9 @@ public:
OUTPUT_NORMAL,
OUTPUT_PASSTHROUGH
};
- static bool RunSingleCommand(const char* command, std::string* output = 0,
+ static bool RunSingleCommand(const char* command,
+ std::string* captureStdOut = 0,
+ std::string* captureStdErr = 0,
int* retVal = 0, const char* dir = 0,
OutputOption outputflag = OUTPUT_MERGE,
double timeout = 0.0);
@@ -233,7 +235,8 @@ public:
* be in comand[1]...command[command.size()]
*/
static bool RunSingleCommand(std::vector<std::string> const& command,
- std::string* output = 0,
+ std::string* captureStdOut = 0,
+ std::string* captureStdErr = 0,
int* retVal = 0, const char* dir = 0,
OutputOption outputflag = OUTPUT_MERGE,
double timeout = 0.0);
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index c9e7a46..3cd92cb 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -224,7 +224,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
}
int timeout = 0;
bool worked = cmSystemTools::RunSingleCommand(finalCommand.c_str(),
- out, &retVal,
+ out, out, &retVal,
0, cmSystemTools::OUTPUT_NONE, timeout);
// set the run var
char retChar[1000];
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 55fc633..f3c6059 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx