configure.pl (122c3632) configure.pl (985d02c7)
1#**************************************************************
1#**************************************************************
2#
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance
9# with the License. You may obtain a copy of the License at
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance
9# with the License. You may obtain a copy of the License at
10#
10#
11# http://www.apache.org/licenses/LICENSE-2.0
11# http://www.apache.org/licenses/LICENSE-2.0
12#
12#
13# Unless required by applicable law or agreed to in writing,
14# software distributed under the License is distributed on an
15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16# KIND, either express or implied. See the License for the
17# specific language governing permissions and limitations
18# under the License.
13# Unless required by applicable law or agreed to in writing,
14# software distributed under the License is distributed on an
15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16# KIND, either express or implied. See the License for the
17# specific language governing permissions and limitations
18# under the License.
19#
19#
20#**************************************************************
21
22#
23# configure.pl - a perl script to set a minimal environment for the SDK.
24#
25# Copyright 2000, 2010 Oracle and/or its affiliates.
26#
27

--- 43 unchanged lines hidden (view full) ---

71$main::OO_SDK_MAKE_HOME_SUGGESTION = searchprog($main::makeName);
72$main::makeVersion = "3.79.1";
73$main::correctVersion = 0;
74
75$main::OO_SDK_ZIP_HOME = "";
76$main::OO_SDK_ZIP_HOME_SUGGESTION = searchprog("zip");
77$main::zipVersion = "2.3";
78
20#**************************************************************
21
22#
23# configure.pl - a perl script to set a minimal environment for the SDK.
24#
25# Copyright 2000, 2010 Oracle and/or its affiliates.
26#
27

--- 43 unchanged lines hidden (view full) ---

71$main::OO_SDK_MAKE_HOME_SUGGESTION = searchprog($main::makeName);
72$main::makeVersion = "3.79.1";
73$main::correctVersion = 0;
74
75$main::OO_SDK_ZIP_HOME = "";
76$main::OO_SDK_ZIP_HOME_SUGGESTION = searchprog("zip");
77$main::zipVersion = "2.3";
78
79$main::OO_SDK_CAT_HOME = "";
80$main::OO_SDK_CAT_HOME_SUGGESTION = searchprog("cat");
81# TODO cat version
82# $main::catVersion = "";
83
84$main::OO_SDK_SED_HOME = "";
85$main::OO_SDK_SED_HOME_SUGGESTION = searchprog("sed");
86# TODO sed version
87# $main::sedVersion = "";
88
79$main::OO_SDK_CPP_HOME = "";
80$main::cppName = "gcc";
81$main::cppVersion = "4.0.1";
82if ( $main::operatingSystem =~ m/solaris/ )
83{
84 $main::cppName = "CC";
85 $main::cppVersion = "5.2";
86}

--- 234 unchanged lines hidden (view full) ---

321 {
322 print " The 'zip' command found at '$main::OO_SDK_ZIP_HOME' has a wrong version\n";
323 $main::OO_SDK_ZIP_HOME = "";
324 }
325 }
326 }
327}
328
89$main::OO_SDK_CPP_HOME = "";
90$main::cppName = "gcc";
91$main::cppVersion = "4.0.1";
92if ( $main::operatingSystem =~ m/solaris/ )
93{
94 $main::cppName = "CC";
95 $main::cppVersion = "5.2";
96}

--- 234 unchanged lines hidden (view full) ---

331 {
332 print " The 'zip' command found at '$main::OO_SDK_ZIP_HOME' has a wrong version\n";
333 $main::OO_SDK_ZIP_HOME = "";
334 }
335 }
336 }
337}
338
339# prepare cat path
340$main::correctVersion = 0;
341while ( (!$main::correctVersion) &&
342 ((! -d "$main::OO_SDK_CAT_HOME" ) ||
343 ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat"))) )
344{
345 print " Enter cat tool directory [$main::OO_SDK_CAT_HOME_SUGGESTION]: ";
346 $main::OO_SDK_CAT_HOME = readStdIn();
347 chop($main::OO_SDK_CAT_HOME);
348 if ( $main::OO_SDK_CAT_HOME eq "" )
349 {
350 $main::OO_SDK_CAT_HOME = $main::OO_SDK_CAT_HOME_SUGGESTION;
351 }
352 if ( (! -d "$main::OO_SDK_CAT_HOME") ||
353 ((-d "$main::OO_SDK_CAT_HOME") && (! -e "$main::OO_SDK_CAT_HOME/cat")) )
354 {
355 $main::OO_SDK_CAT_HOME = "";
356 print " Error: cat tool is required, please specify a cat tool directory.\n";
357 }
358 # else ...
359 # TODO check version
360 # NOTE: only Linux cat understands --version
361}
362
363# prepare sed path
364$main::correctVersion = 0;
365while ( (!$main::correctVersion) &&
366 ((! -d "$main::OO_SDK_SED_HOME" ) ||
367 ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed"))) )
368{
369 print " Enter sed tool directory [$main::OO_SDK_SED_HOME_SUGGESTION]: ";
370 $main::OO_SDK_SED_HOME = readStdIn();
371 chop($main::OO_SDK_SED_HOME);
372 if ( $main::OO_SDK_SED_HOME eq "" )
373 {
374 $main::OO_SDK_SED_HOME = $main::OO_SDK_SED_HOME_SUGGESTION;
375 }
376 if ( (! -d "$main::OO_SDK_SED_HOME") ||
377 ((-d "$main::OO_SDK_SED_HOME") && (! -e "$main::OO_SDK_SED_HOME/sed")) )
378 {
379 $main::OO_SDK_SED_HOME = "";
380 print " Error: sed tool is required, please specify a sed tool directory.\n";
381 }
382 # else ...
383 # TODO check version
384 # NOTE: only Linux sed understands --version
385}
386
329# prepare C++ compiler path
330$main::correctVersion = 0;
331while ( (!$main::correctVersion) &&
332 ((! -d "$main::OO_SDK_CPP_HOME" ) ||
333 ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cpp"))) )
334{
335 print " C++ compilers where for example a language binding exist:\n";
336 print " - Solaris, Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 or higher\n";

--- 193 unchanged lines hidden (view full) ---

530 }
531 }
532}
533else
534{
535 $main::SDK_AUTO_DEPLOYMENT = "NO";
536}
537
387# prepare C++ compiler path
388$main::correctVersion = 0;
389while ( (!$main::correctVersion) &&
390 ((! -d "$main::OO_SDK_CPP_HOME" ) ||
391 ((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cpp"))) )
392{
393 print " C++ compilers where for example a language binding exist:\n";
394 print " - Solaris, Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 or higher\n";

--- 193 unchanged lines hidden (view full) ---

588 }
589 }
590}
591else
592{
593 $main::SDK_AUTO_DEPLOYMENT = "NO";
594}
595
538prepareScriptFile("setsdkenv_unix.sh.in", "setsdkenv_unix.sh", 1);
596prepareScriptFile("setsdkenv_unix.sh.in", "setsdkenv_unix.sh");
539chmod 0644, "$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.sh";
540
597chmod 0644, "$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.sh";
598
541prepareScriptFile("setsdkenv_unix.csh.in", "setsdkenv_unix.csh", 2);
542chmod 0644, "$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.csh";
543
544print "\n";
545print " ************************************************************************\n";
546print " * ... your SDK environment has been prepared.\n";
547print " * For each time you want to use this configured SDK environment, you\n";
548print " * have to run the \"setsdkenv_unix\" script file!\n";
549print " * Alternatively can you source one of the scripts\n";
550print " * \"$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.sh\"\n";
599print "\n";
600print " ************************************************************************\n";
601print " * ... your SDK environment has been prepared.\n";
602print " * For each time you want to use this configured SDK environment, you\n";
603print " * have to run the \"setsdkenv_unix\" script file!\n";
604print " * Alternatively can you source one of the scripts\n";
605print " * \"$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.sh\"\n";
551print " * \"$main::OO_SDK_CONFIG_HOME/$main::hostname/setsdkenv_unix.csh\"\n";
552print " * to get an environment without starting a new shell.\n";
553print " ************************************************************************\n\n";
554
555exit $return;
556
557sub skipChoice
558{
559 my $msg = shift;

--- 196 unchanged lines hidden (view full) ---

756 my $length = $#mustBeVersion;
757
758 if ($#testVersion < $#mustBeVersion) {
759 $length = $#testVersion;
760 }
761
762 for ($i=0; $i <= $length; $i++ )
763 {
606print " * to get an environment without starting a new shell.\n";
607print " ************************************************************************\n\n";
608
609exit $return;
610
611sub skipChoice
612{
613 my $msg = shift;

--- 196 unchanged lines hidden (view full) ---

810 my $length = $#mustBeVersion;
811
812 if ($#testVersion < $#mustBeVersion) {
813 $length = $#testVersion;
814 }
815
816 for ($i=0; $i <= $length; $i++ )
817 {
764 if ( @testVersion->[$i] > @mustBeVersion->[$i] )
818 if ( @testVersion[$i] > @mustBeVersion[$i] )
765 {
766 return 1; # 1 indicates a correct version
767 }
768
819 {
820 return 1; # 1 indicates a correct version
821 }
822
769 if ( @testVersion->[$i] < @mustBeVersion->[$i] )
823 if ( @testVersion[$i] < @mustBeVersion[$i] )
770 {
771 if ( $#checkOnly == 1 ) {
772 print " The command '$toolName' has the version $tmpTestVersion.\n";
773 print " The SDK requires at least the version $tmpMustBeVersion.\n";
774 }
775 return 0;
776 }
777 }

--- 11 unchanged lines hidden (view full) ---

789
790 return $tmpstdin;
791}
792
793sub prepareScriptFile()
794{
795 my $inputFile = shift;
796 my $outputFile = shift;
824 {
825 if ( $#checkOnly == 1 ) {
826 print " The command '$toolName' has the version $tmpTestVersion.\n";
827 print " The SDK requires at least the version $tmpMustBeVersion.\n";
828 }
829 return 0;
830 }
831 }

--- 11 unchanged lines hidden (view full) ---

843
844 return $tmpstdin;
845}
846
847sub prepareScriptFile()
848{
849 my $inputFile = shift;
850 my $outputFile = shift;
797 # shell mode 1 = sh
798 # 2 = csh
799 my $shellMode = shift;
800
801 if ( ! -d "$main::OO_SDK_CONFIG_HOME/$main::hostname" )
802 {
803 system("mkdir -p $main::OO_SDK_CONFIG_HOME/$main::hostname");
804 }
805
806 open ( FILEIN, "$main::sdkpath/$inputFile" ) || die "\nERROR: could not open '$main::sdkpath/$inputFile' for reading";
807 open ( FILEOUT, ">$main::OO_SDK_CONFIG_HOME/$main::hostname/$outputFile" ) || die "\nERROR: could not open '$main::OO_SDK_CONFIG_HOME/$main::hostname/$outputFile' for writing";
808
809 while ( <FILEIN> )
810 {
811 $_ =~ s#\@OO_SDK_NAME\@#$main::OO_SDK_NAME#go;
812 $_ =~ s#\@OO_SDK_HOME\@#$main::OO_SDK_HOME#go;
813 $_ =~ s#\@OFFICE_HOME\@#$main::OFFICE_HOME#go;
814 $_ =~ s#\@OFFICE_BASE_HOME\@#$main::OFFICE_BASE_HOME#go;
815 $_ =~ s#\@OO_SDK_URE_HOME\@#$main::OO_SDK_URE_HOME#go;
816 $_ =~ s#\@OO_SDK_MAKE_HOME\@#$main::OO_SDK_MAKE_HOME#go;
817 $_ =~ s#\@OO_SDK_ZIP_HOME\@#$main::OO_SDK_ZIP_HOME#go;
851
852 if ( ! -d "$main::OO_SDK_CONFIG_HOME/$main::hostname" )
853 {
854 system("mkdir -p $main::OO_SDK_CONFIG_HOME/$main::hostname");
855 }
856
857 open ( FILEIN, "$main::sdkpath/$inputFile" ) || die "\nERROR: could not open '$main::sdkpath/$inputFile' for reading";
858 open ( FILEOUT, ">$main::OO_SDK_CONFIG_HOME/$main::hostname/$outputFile" ) || die "\nERROR: could not open '$main::OO_SDK_CONFIG_HOME/$main::hostname/$outputFile' for writing";
859
860 while ( <FILEIN> )
861 {
862 $_ =~ s#\@OO_SDK_NAME\@#$main::OO_SDK_NAME#go;
863 $_ =~ s#\@OO_SDK_HOME\@#$main::OO_SDK_HOME#go;
864 $_ =~ s#\@OFFICE_HOME\@#$main::OFFICE_HOME#go;
865 $_ =~ s#\@OFFICE_BASE_HOME\@#$main::OFFICE_BASE_HOME#go;
866 $_ =~ s#\@OO_SDK_URE_HOME\@#$main::OO_SDK_URE_HOME#go;
867 $_ =~ s#\@OO_SDK_MAKE_HOME\@#$main::OO_SDK_MAKE_HOME#go;
868 $_ =~ s#\@OO_SDK_ZIP_HOME\@#$main::OO_SDK_ZIP_HOME#go;
869 $_ =~ s#\@OO_SDK_CAT_HOME\@#$main::OO_SDK_CAT_HOME#go;
870 $_ =~ s#\@OO_SDK_SED_HOME\@#$main::OO_SDK_SED_HOME#go;
818 $_ =~ s#\@OO_SDK_CPP_HOME\@#$main::OO_SDK_CPP_HOME#go;
819 $_ =~ s#\@OO_SDK_CC_55_OR_HIGHER\@#$main::OO_SDK_CC_55_OR_HIGHER#go;
820 $_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go;
821 $_ =~ s#\@SDK_AUTO_DEPLOYMENT\@#$main::SDK_AUTO_DEPLOYMENT#go;
822 $_ =~ s#\@OO_SDK_OUTPUT_DIR\@#$main::OO_SDK_OUTPUT_DIR#go;
823
824 print FILEOUT $_;
825 }
826
827 close FILEIN;
828 close FILEOUT;
829}
871 $_ =~ s#\@OO_SDK_CPP_HOME\@#$main::OO_SDK_CPP_HOME#go;
872 $_ =~ s#\@OO_SDK_CC_55_OR_HIGHER\@#$main::OO_SDK_CC_55_OR_HIGHER#go;
873 $_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go;
874 $_ =~ s#\@SDK_AUTO_DEPLOYMENT\@#$main::SDK_AUTO_DEPLOYMENT#go;
875 $_ =~ s#\@OO_SDK_OUTPUT_DIR\@#$main::OO_SDK_OUTPUT_DIR#go;
876
877 print FILEOUT $_;
878 }
879
880 close FILEIN;
881 close FILEOUT;
882}