source: trunk/gsdl/cgi-bin/GSDLHOME.pm@ 1143

Last change on this file since 1143 was 1143, checked in by sjboddie, 24 years ago

attempting to get end-user building stuff working under windows

  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1package GSDLHOME;
2
3BEGIN {
4
5 # get arguments
6 my $cgi = new CGI;
7
8 $ENV{'GSDLHOME'} = $cgi->param("gsdlhome") if (!defined $ENV{'GSDLHOME'});
9
10 # delete this line once _gsdlhome macro is fixed
11 $ENV{'GSDLHOME'} =~ s/d:gsdl/d:\\gsdl/i;
12
13 unless (defined $ENV{'GSDLHOME'})
14 {
15 print "Content-type: text/html\n\n";
16 my $title = "Greenstone Software: Web Error Encountered";
17 print "<html><title>$title</title>\n";
18 print "<body bgcolor=\"#ffffff\"><h3>$title</h3>\n";
19 print "<p> GSDLHOME not set.\n";
20 print "</body>\n</html>\n";
21 exit(0);
22 }
23
24 # just in case GSDLHOME has a slash on the end which would cause
25 # double slashes below
26 $ENV{'GSDLHOME'} =~ s/[\/\\]+$//;
27
28 $ENV{'GSDLOS'} = $^O;
29
30 if ($ENV{'GSDLOS'} =~ /(win|dos)/i) {
31 $ENV{'GSDLOS'} = 'windows';
32 }
33
34 if ($ENV{'GSDLOS'} eq "windows") {
35 $ENV{'PATH'} .= ':' . $ENV{'GSDLHOME'} . '\bin\script';
36 $ENV{'PATH'} .= ':' . $ENV{'GSDLHOME'} . '\bin\windows';
37 unshift (@INC, $ENV{'GSDLHOME'} . '\perllib');
38 unshift (@INC, $ENV{'GSDLHOME'} . '\perllib\cpan');
39 } else {
40 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/script";
41 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
42 unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
43 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
44 }
45}
46
471;
Note: See TracBrowser for help on using the repository browser.