diff options
Diffstat (limited to 'odk/configure.pl')
-rwxr-xr-x | odk/configure.pl | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/odk/configure.pl b/odk/configure.pl index c03fe0081c17..d102e6f031a2 100755 --- a/odk/configure.pl +++ b/odk/configure.pl @@ -37,7 +37,7 @@ chomp($main::OO_SDK_URE_HOME); $main::OO_SDK_MAKE_HOME = ""; $main::makeName = "make"; -if ( $main::operatingSystem =~ m/solaris/ || +if ( $main::operatingSystem =~ m/solaris/ || $main::operatingSystem =~ m/freebsd/ ) { $main::makeName = "gmake"; @@ -84,9 +84,9 @@ if ( $main::OFFICE_OR_URE eq "Office" ) if ( $main::operatingSystem =~ m/darwin/ ) { # used for a SDK as part of the office installation -# $main::OFFICE_HOME = `cd $main::sdkpath/../../.. && pwd`; -# chomp($main::OFFICE_HOME); -# print " Used Office = $main::OFFICE_HOME\n"; +# $main::OFFICE_HOME = `cd $main::sdkpath/../../.. && pwd`; +# chomp($main::OFFICE_HOME); +# print " Used Office = $main::OFFICE_HOME\n"; print " Used SDK = $main::OO_SDK_HOME\n\n"; $main::OFFICE_HOME_SUGGESTION = searchMacOffice(); @@ -96,16 +96,16 @@ if ( $main::OFFICE_OR_URE eq "Office" ) print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: "; $main::OFFICE_HOME = readStdIn(); chop($main::OFFICE_HOME); - if ( $main::OFFICE_HOME eq "" ) + if ( $main::OFFICE_HOME eq "" ) { $main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION; } - + if ( ! -d "$main::OFFICE_HOME" ) - { + { $main::OFFICE_HOME = ""; print " Error: An office installation is required, please specify the path to a valid installation.\n"; - } + } # check more details if ( -d "$main::OFFICE_HOME/Contents/basis-link" ) { @@ -125,7 +125,7 @@ if ( $main::OFFICE_OR_URE eq "Office" ) print " Error: no base layer found in office installation, please specify the path to a valid installation.\n"; } } - } else + } else { $main::OFFICE_HOME_SUGGESTION = searchoffice(); @@ -137,17 +137,17 @@ if ( $main::OFFICE_OR_URE eq "Office" ) if ( ! $main::OFFICE_HOME_SUGGESTION eq "" ) { my $tmpOffice = readlink "$main::OFFICE_HOME_SUGGESTION/soffice"; - + if ( $tmpOffice eq "" ) { $tmpOffice = "$main::OFFICE_HOME_SUGGESTION/soffice"; } - + my $offset = rindex($tmpOffice, "/program/soffice"); if ( $offset != -1 ) { $main::OFFICE_HOME_SUGGESTION = substr($tmpOffice, 0, $offset); - } else + } else { $offset = rindex($tmpOffice, "/soffice"); if ( $offset != -1 ) @@ -159,35 +159,35 @@ if ( $main::OFFICE_OR_URE eq "Office" ) } } } - + while ( (! -d "$main::OFFICE_HOME" ) || ((-d "$main::OFFICE_HOME") && (! -d "$main::OFFICE_HOME/program")) ) { print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: "; $main::OFFICE_HOME = readStdIn(); chop($main::OFFICE_HOME); - if ( $main::OFFICE_HOME eq "" ) + if ( $main::OFFICE_HOME eq "" ) { $main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION; } - + if ( ! -d "$main::OFFICE_HOME" ) - { + { $main::OFFICE_HOME = ""; print " Error: An office installation is required, please specify the path to a valid installation.\n"; } else { # special work for a network installation, no prgram directory but a link to the soffice binary if ( (! -d "$main::OFFICE_HOME/program") && (-e "$main::OFFICE_HOME/soffice") ) - { + { my $soserver = `ls -l $OFFICE_HOME_SUGGESTION/soffice | sed -n 's/.* -> //p'`; $soserver= substr($soserver, 0, rindex($soserver, "program") - 1); - + if ( ! -d $soserver ) { $main::OFFICE_HOME = ""; print " Error: An office installation is required, please specify the path to a valid installation.\n"; - } else + } else { $main::OFFICE_HOME = $soserver; } @@ -224,16 +224,16 @@ while ( (!$main::correctVersion) && print " Enter GNU make ($main::makeVersion or higher) tools directory [$main::OO_SDK_MAKE_HOME_SUGGESTION]: "; $main::OO_SDK_MAKE_HOME = readStdIn(); chop($main::OO_SDK_MAKE_HOME); - if ( $main::OO_SDK_MAKE_HOME eq "" ) + if ( $main::OO_SDK_MAKE_HOME eq "" ) { $main::OO_SDK_MAKE_HOME = $main::OO_SDK_MAKE_HOME_SUGGESTION; } - if ( (! -d "$main::OO_SDK_MAKE_HOME") || + if ( (! -d "$main::OO_SDK_MAKE_HOME") || ((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/$main::makeName")) ) - { + { $main::OO_SDK_MAKE_HOME = ""; print " Error: GNU make is required, please specify a GNU make tools directory.\n"; - } else + } else { #check version my $testVersion = `$OO_SDK_MAKE_HOME/$main::makeName --version`; @@ -241,7 +241,7 @@ while ( (!$main::correctVersion) && { print " Set the environment variable OO_SDK_MAKE_HOME to your GNU build tools directory.\n"; print " GNU make version $main::makeVersion can be obtained at ftp://ftp.gnu.org/gnu/make/\n"; - } else + } else { if ($testVersion =~ m#((\d+\.)+\d+)# ) { @@ -266,16 +266,16 @@ while ( (!$main::correctVersion) && print " Enter zip ($main::zipVersion or higher) tool directory [$main::OO_SDK_ZIP_HOME_SUGGESTION]: "; $main::OO_SDK_ZIP_HOME = readStdIn(); chop($main::OO_SDK_ZIP_HOME); - if ( $main::OO_SDK_ZIP_HOME eq "" ) + if ( $main::OO_SDK_ZIP_HOME eq "" ) { $main::OO_SDK_ZIP_HOME = $main::OO_SDK_ZIP_HOME_SUGGESTION; } - if ( (! -d "$main::OO_SDK_ZIP_HOME") || + if ( (! -d "$main::OO_SDK_ZIP_HOME") || ((-d "$main::OO_SDK_ZIP_HOME") && (! -e "$main::OO_SDK_ZIP_HOME/zip")) ) - { + { $main::OO_SDK_ZIP_HOME = ""; print " Error: zip tool is required, please specify a zip tool directory.\n"; - } else + } else { #check version my $testVersion = `$OO_SDK_ZIP_HOME/zip -h 2>&1 | egrep Zip | head -n 1`; @@ -284,7 +284,7 @@ while ( (!$main::correctVersion) && { print " Set the environment variable OO_SDK_ZIP_HOME to your zip tool directory.\n"; print " zip version $main::zipVersion can be obtained at ftp://www.info-zip.org/\n"; - } else + } else { if ($testVersion =~ m#((\d+\.)+\d+)# ) { @@ -312,26 +312,26 @@ while ( (!$main::correctVersion) && print " - MacOS, GNU C++ compiler, gcc version 4.0.1 or higher\n"; print " Enter the directory of the C++ compiler, the directory\n"; print " where the compiler is located (optional) [$main::OO_SDK_CPP_HOME_SUGGESTION]: "; - + $main::OO_SDK_CPP_HOME = readStdIn(); chop($main::OO_SDK_CPP_HOME); - if ( $main::OO_SDK_CPP_HOME eq "" ) + if ( $main::OO_SDK_CPP_HOME eq "" ) { $main::OO_SDK_CPP_HOME = $main::OO_SDK_CPP_HOME_SUGGESTION; } - if ( ! $main::OO_SDK_CPP_HOME eq "" ) + if ( ! $main::OO_SDK_CPP_HOME eq "" ) { - if ( (! -d "$main::OO_SDK_CPP_HOME") || + if ( (! -d "$main::OO_SDK_CPP_HOME") || ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cppName")) ) - { + { print " Error: Could not find directory '$main::OO_SDK_CPP_HOME'.\n"; if ( skipChoice("C++ compiler") == 1 ) { $main::correctVersion = 1; } $main::OO_SDK_CPP_HOME = ""; - } else + } else { #check version if ( $main::cppName eq "gcc" ) @@ -343,7 +343,7 @@ while ( (!$main::correctVersion) && print " GNU compiler.\nSet the environment variable OO_SDK_CPP_HOME to your GNU build tools "; print " directory.\nA GNU compiler version $main::cppVersion can be obtained at "; print " ftp://ftp.gnu.org/gnu/gcc/\n"; - } else + } else { $main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 1); if ( !$main::correctVersion ) @@ -367,7 +367,7 @@ while ( (!$main::correctVersion) && { 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 + } else { if ($testVersion =~ m#((\d+\.)+\d+)# ) { @@ -387,7 +387,7 @@ while ( (!$main::correctVersion) && $main::correctVersion = testVersion("5.5", $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 2); if ( $main::correctVersion ) { $main::OO_SDK_CC_55_OR_HIGHER = $testVersion; - } + } } } } @@ -417,27 +417,27 @@ while ( (!$main::correctVersion) && print " Enter Java SDK (1.5, recommendation is 1.6 or higher) installation directory (optional) [$main::OO_SDK_JAVA_HOME_SUGGESTION]: "; $main::OO_SDK_JAVA_HOME = readStdIn(); chop($main::OO_SDK_JAVA_HOME); - if ( $main::OO_SDK_JAVA_HOME eq "" ) + if ( $main::OO_SDK_JAVA_HOME eq "" ) { $main::OO_SDK_JAVA_HOME = $main::OO_SDK_JAVA_HOME_SUGGESTION; } - if ( ! $main::OO_SDK_JAVA_HOME eq "" ) + if ( ! $main::OO_SDK_JAVA_HOME eq "" ) { - if ( (! -d "$main::OO_SDK_JAVA_HOME") || + if ( (! -d "$main::OO_SDK_JAVA_HOME") || ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac")) ) - { + { print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac'.\n"; if ( skipChoice("JAVA SDK") == 1 ) { $main::correctVersion = 1; } $main::OO_SDK_JAVA_HOME = ""; - } else + } else { #check version my $testVersion = `$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`; $testVersion =~ s#([^\n]+)\n#$1#go; - + $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java", 1); if ( !$main::correctVersion ) { @@ -462,18 +462,18 @@ while ( (!$main::skipOutputDir) && { print " Default output directory is in your HOME directory.\n"; print " Enter an existent directory if you prefer a different output directory (optional) [$main::OO_SDK_OUTPUT_DIR_SUGGESTION]: "; - + $main::OO_SDK_OUTPUT_DIR = readStdIn(); chop($main::OO_SDK_OUTPUT_DIR); - if ( $main::OO_SDK_OUTPUT_DIR eq "" ) + if ( $main::OO_SDK_OUTPUT_DIR eq "" ) { $main::OO_SDK_OUTPUT_DIR = $main::OO_SDK_OUTPUT_DIR_SUGGESTION; } - if ( ! $main::OO_SDK_OUTPUT_DIR eq "" ) + if ( ! $main::OO_SDK_OUTPUT_DIR eq "" ) { if ( ! -d "$main::OO_SDK_OUTPUT_DIR" ) - { + { print " Error: Could not find directory '$main::OO_SDK_OUTPUT_DIR'.\n"; if ( skipChoice("optional output directory") == 1 ) { @@ -491,8 +491,8 @@ while ( (!$main::skipOutputDir) && # prepare auto deployment if ( $main::OFFICE_OR_URE eq "Office" ) { - while ( $main::SDK_AUTO_DEPLOYMENT eq "" || - ((! $main::SDK_AUTO_DEPLOYMENT eq "YES") && + while ( $main::SDK_AUTO_DEPLOYMENT eq "" || + ((! $main::SDK_AUTO_DEPLOYMENT eq "YES") && (! $main::SDK_AUTO_DEPLOYMENT eq "NO")) ) { print " Automatic deployment of UNO components (YES/NO) [$main::SDK_AUTO_DEPLOYMENT_SUGGESTION]: "; @@ -552,7 +552,7 @@ sub resolveLink my $link= shift; my $resolvedpath = "$base/$link"; - my $linktarget = readlink "$resolvedpath"; + my $linktarget = readlink "$resolvedpath"; my $resolvedlink = ""; while ( $linktarget ne "") { @@ -636,10 +636,10 @@ sub searchMacOffice } if (-d "/Applications/Oracle Open Office.app" ) { return "/Applications/Oracle Open Office.app"; - } + } if (-d "/Applications/StarOffice.app" ) { return "/Applications/StarOffice.app"; - } + } if (-d "/Applications/StarSuite.app" ) { return "/Applications/StarSuite.app"; } @@ -653,9 +653,9 @@ sub searchoffice my $tmpOffice = substr($main::sdkpath, 0, $offset); my $officepath = "$tmpOffice/libreoffice"; -# if ( $main::OO_MINORVERSION > 0) { -# $officepath = "$officepath$main::OO_MINORVERSION"; -# } +# if ( $main::OO_MINORVERSION > 0) { +# $officepath = "$officepath$main::OO_MINORVERSION"; +# } # search corresponding office for this SDK if (-d $officepath && -e "$officepath/program/soffice") { @@ -663,9 +663,9 @@ sub searchoffice } # fallback my $tmpversion = $main::OO_MAJORVERSION; -# if ( $main::OO_MINORVERSION > 0) { -# $tmpversion = "$tmpversion.$main::OO_MINORVERSION"; -# } +# if ( $main::OO_MINORVERSION > 0) { +# $tmpversion = "$tmpversion.$main::OO_MINORVERSION"; +# } $officepath = "$tmpOffice/oracle_open_office$tmpversion"; if (-d $officepath && -e "$officepath/program/soffice") { @@ -764,7 +764,7 @@ sub readStdIn return $tmpstdin; } -sub prepareScriptFile() +sub prepareScriptFile() { my $inputFile = shift; my $outputFile = shift; @@ -794,10 +794,10 @@ sub prepareScriptFile() $_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go; $_ =~ s#\@SDK_AUTO_DEPLOYMENT\@#$main::SDK_AUTO_DEPLOYMENT#go; $_ =~ s#\@OO_SDK_OUTPUT_DIR\@#$main::OO_SDK_OUTPUT_DIR#go; - - print FILEOUT $_; + + print FILEOUT $_; } - + close FILEIN; close FILEOUT; } |