summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-28 17:56:15 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-28 17:56:15 +0000
commit895ffe47997b8e4402c73b4460c56c7582600fe5 (patch)
tree9866bff0435ba0d4fd2cfb186761bb9387f65af3 /soltools
parenta6ef6eddc6ac91f44d98400cc1dbee17163578d9 (diff)
#i10000# #101342# min-gw fix
Diffstat (limited to 'soltools')
-rw-r--r--soltools/testhxx/create.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/soltools/testhxx/create.pl b/soltools/testhxx/create.pl
index c0ee3586a9f9..eb9e540f0a82 100644
--- a/soltools/testhxx/create.pl
+++ b/soltools/testhxx/create.pl
@@ -91,6 +91,33 @@ if ($ENV{OS} eq 'LINUX') {
"\n";
print STDOUT 'QUIT %my_ret%', "\n";
} elsif ($ENV{OS} eq 'WNT' and $ENV{USE_SHELL} ne '4nt') {
+ if ($ENV{COM} eq 'GCC') {
+ 1 while $in =~ s!\s+-I\s*\.\S*\s*! !g; # discard relative includes
+ $in =~ s!(\s+-I\s*)(?i:$solarversion)(\S*)!$1\${SOLARVERSION}$2!og;
+ # macrofy includes to solver
+ $in =~ s!\s+-o\s*\S+! -o /dev/null! || die 'bad input: no -o';
+ $in =~ s!\S+/testhxx.cxx!\${my_tmp}!
+ || die 'bad input: no source file';
+ print STDOUT '#!/bin/sh', "\n";
+ print STDOUT
+ 'my_tmp=${TMPDIR:-/tmp}/`id -u`_$$_include.cc', "\n";
+ print STDOUT 'my_pat=`dirname $1`', "\n";
+ print STDOUT 'my_fil=`basename $1`', "\n";
+ print STDOUT 'my_org=${PWD}', "\n";
+ print STDOUT 'cd $my_pat || exit 1', "\n";
+ print STDOUT 'my_pat=`cygpath -m \`pwd\``', "\n";
+ print STDOUT 'cd $my_org || exit 1', "\n";
+ print STDOUT
+ 'echo "#include \\"${my_pat}/${my_fil}\\"" > ${my_tmp} || exit 1', "\n";
+ print STDOUT $in, ' > ${my_tmp}.out 2>&1', "\n";
+ print STDOUT 'my_ret=$?', "\n";
+ print STDOUT
+ 'if [ ${my_ret} -ne 0 ] ; then echo $1 >&2 ; cat ${my_tmp}.out >&2 ;',
+ ' fi', "\n";
+ print STDOUT 'unlink ${my_tmp} || exit 1', "\n";
+ print STDOUT 'unlink ${my_tmp}.out || exit 1', "\n";
+ print STDOUT 'exit ${my_ret}', "\n";
+ } else {
1 while $in =~ s!\s+-I\s*\.\S*\s*! !g; # discard relative includes
$in =~ s!(\s+-I\s*)(?i:$solarversion)(\S*)!$1\${SOLARVERSION}$2!og;
# macrofy includes to solver
@@ -116,6 +143,7 @@ if ($ENV{OS} eq 'LINUX') {
print STDOUT 'unlink ${my_tmp} || exit 1', "\n";
print STDOUT 'unlink ${my_tmp}.out || exit 1', "\n";
print STDOUT 'exit ${my_ret}', "\n";
+ }
} else {
print STDOUT 'echo \'no testhxx on this platform\'', "\n";
}