summaryrefslogtreecommitdiff
path: root/odk/configure.pl
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-07-09 09:36:22 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-07-09 09:36:22 +0000
commit7dd9a06729666568116d34ea858ab945d9e515d0 (patch)
tree4b3adb1722943eb8c68f4ca5f96ecbb3b6e92f91 /odk/configure.pl
parentb167593d96de22b0de3895d22dc5d294c51dd093 (diff)
INTEGRATION: CWS sdk06 (1.3.10); FILE MERGED
2003/07/07 13:50:35 jsc 1.3.10.5: #110567# remove test output 2003/07/07 13:47:23 jsc 1.3.10.4: #110567# correct testVersion function 2003/07/07 12:07:39 jsc 1.3.10.3: #110567# check Solaris compiler too 2003/07/07 07:17:59 jsc 1.3.10.2: #110567# improve pattern 2003/07/03 10:35:19 jsc 1.3.10.1: #110567# change version checking
Diffstat (limited to 'odk/configure.pl')
-rw-r--r--odk/configure.pl65
1 files changed, 48 insertions, 17 deletions
diff --git a/odk/configure.pl b/odk/configure.pl
index c0230239397d..5176cf2f0a26 100644
--- a/odk/configure.pl
+++ b/odk/configure.pl
@@ -28,7 +28,7 @@ $main::cppVersion = "3.0.1";
if ( $main::operatingSystem eq "SunOS" )
{
$main::cppName = "CC";
- $main::cppVersion = "";
+ $main::cppVersion = "5.2";
}
$main::OO_SDK_CPP_HOME_SUGGESTION = searchprog($main::cppName);
@@ -44,7 +44,7 @@ $main::return = 0;
# prepare SDK path
while ( (! -d "$main::OO_SDK_HOME" ) ||
- ((-d "$main::OO_SDK_HOME") && (! -d "$main::OO_SDK_HOME/idl")) )
+ ((-d "$main::OO_SDK_HOME") && (! -d "$main::OO_SDK_HOME/idl")) )
{
print "Enter the Office Software Development Kit directory [$main::OO_SDK_HOME_SUGGESTION]: ";
$main::OO_SDK_HOME = <STDIN>;
@@ -99,8 +99,8 @@ while ( (! -d "$main::OFFICE_HOME" ) ||
# prepare GNU make path
while ( (!$main::correctVersion) &&
- ((! -d "$main::OO_SDK_MAKE_HOME" ) ||
- ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/make"))) )
+ ((! -d "$main::OO_SDK_MAKE_HOME" ) ||
+ ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/make"))) )
{
print "Enter GNU make ($main::makeVersion or higher) tools directory [$main::OO_SDK_MAKE_HOME_SUGGESTION]: ";
$main::OO_SDK_MAKE_HOME = <STDIN>;
@@ -117,7 +117,7 @@ while ( (!$main::correctVersion) &&
} else
{
#check version
- my $testVersion = `$main::OO_SDK_MAKE_HOME/make --version 2> /dev/null | egrep "GNU Make version" | head -1 | sed -e 's#.*GNU Make version ##' | sed -e 's#,.*##'`;
+ my $testVersion = `$OO_SDK_MAKE_HOME/make --version`;
if ( $testVersion eq "")
{
print "The 'make' command found at $main::OO_SDK_MAKE_HOME/make is not GNU Make\n";
@@ -125,9 +125,14 @@ while ( (!$main::correctVersion) &&
print "GNU make version $main::makeVersion can be obtained at ftp://ftp.gnu.org/gnu/make/\n";
} else
{
+ if ($testVersion =~ m#((\d+\.)+\d+)# )
+ {
+ $testVersion = $1;
+ }
$main::correctVersion = testVersion($main::makeVersion, $testVersion, "$main::OO_SDK_MAKE_HOME/make");
if ( !$main::correctVersion )
{
+ print "The 'make' command found at '$main::OO_SDK_MAKE_HOME' has a wrong version\n";
$main::OO_SDK_MAKE_HOME = "";
}
}
@@ -137,8 +142,8 @@ while ( (!$main::correctVersion) &&
# prepare C++ compiler path
$main::correctVersion = 0;
while ( (!$main::correctVersion) &&
- ((! -d "$main::OO_SDK_CPP_HOME" ) ||
- ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cpp"))) )
+ ((! -d "$main::OO_SDK_CPP_HOME" ) ||
+ ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cpp"))) )
{
print "C++ Compiler where a language binding exist:\n";
print "Solaris, Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 or higher\n";
@@ -167,7 +172,7 @@ while ( (!$main::correctVersion) &&
#check version
if ( $main::cppName eq "gcc" )
{
- my $testVersion = `$OO_SDK_CPP_HOME/$main::cppName --version`;
+ my $testVersion = `$OO_SDK_CPP_HOME/$main::cppName -dumpversion`;
if ( $testVersion eq "")
{
print "The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
@@ -176,14 +181,10 @@ while ( (!$main::correctVersion) &&
print "ftp://ftp.gnu.org/gnu/gcc/\n";
} else
{
- # special handling for newer gcc compilers (--version has different output)
- if ($testVersion =~ m#(([^\d.]+)([\d\.]+)(.*))# )
- {
- $testVersion = $3;
- }
$main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName");
if ( !$main::correctVersion )
{
+ print "The '$main::cppName' command found at '$main::OO_SDK_CPP_HOME' has a wrong version\n";
if ( skipChoice("C++ compiler") == 1 )
{
$main::correctVersion = 1;
@@ -195,7 +196,31 @@ while ( (!$main::correctVersion) &&
} else
{
# for Solaris we have to check the version too
- $main::correctVersion = 1;
+ open(FILE, "$OO_SDK_CPP_HOME/$main::cppName -V 2>&1 |");
+ my @lines = <FILE>;
+ my $testVersion = $lines[0];
+ if ( $testVersion eq "")
+ {
+ print "The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
+ print "Solaris C++ compiler.\nSet the environment variable OO_SDK_CPP_HOME to your Solaris C++ compiler directory.\n";
+ } else
+ {
+ if ($testVersion =~ m#((\d+\.)+\d+)# )
+ {
+ $testVersion = $1;
+ }
+ $main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName");
+ if ( !$main::correctVersion )
+ {
+ print "The '$main::cppName' command found at '$main::OO_SDK_CPP_HOME' has a wrong version\n";
+ if ( skipChoice("C++ compiler") == 1 )
+ {
+ $main::correctVersion = 1;
+ }
+
+ $main::OO_SDK_CPP_HOME = "";
+ }
+ }
}
}
} else
@@ -270,6 +295,8 @@ close FILEIN;
close FILEOUT;
chmod 0755, "$main::currentWorkingDir/setsdkenv_unix";
+print "\nFor using your prepared environment, please run the \"setsdkenv_unix\" script file!\n\n";
+
exit $return;
sub skipChoice
@@ -320,11 +347,15 @@ sub testVersion
my $tmpMustBeVersion = shift;
my $tmpTestVersion = shift;
my $toolName = shift;
- my @mustBeVersion = split(/\.*_*/,$tmpMustBeVersion);
- my @testVersion = split(/\.*_*/,$tmpTestVersion);
+ my @mustBeVersion = split(/\.|_/,$tmpMustBeVersion);
+ my @testVersion = split(/\.|_/,$tmpTestVersion);
my $length = $#mustBeVersion;
- for ($i=0; $i < $length; $i++ )
+ if ($#testVersion < $#mustBeVersion) {
+ $length = $#testVersion;
+ }
+
+ for ($i=0; $i <= $length; $i++ )
{
if ( @testVersion->[$i] < @mustBeVersion->[$i] )
{