Changeset 28560 for main/trunk/greenstone2/perllib/util.pm
- Timestamp:
- 2013-10-30T20:54:49+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/util.pm
r28460 r28560 1650 1650 } 1651 1651 1652 # Sets the gnomelib_env. Based on the logic in wvware.pl which can perhaps be replaced with a call to this function in future 1653 sub set_gnomelib_env 1654 { 1655 ## SET THE ENVIRONMENT AS DONE IN SETUP.BASH/BAT OF GNOME-LIB 1656 # Though this is only needed for darwin Lion at this point (and android, though that is untested) 1657 1658 my $env_vars=""; 1659 1660 my $libext = "so"; 1661 if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 1662 #return $env_vars; 1663 return; 1664 } elsif ($ENV{'GSDLOS'} =~ m/^darwin$/i) { 1665 $libext = "dylib"; 1666 } 1667 1668 if (!defined $ENV{'GEXTGNOME'}) { 1669 ##print STDERR "@@@ Setting GEXTGNOME env\n"; 1670 1671 my $gnome_dir = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"ext","gnome-lib-minimal"); 1672 1673 if(! -d $gnome_dir) { 1674 $gnome_dir = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"ext","gnome-lib"); 1675 1676 if(! -d $gnome_dir) { 1677 $gnome_dir = ""; 1678 } 1679 } 1680 1681 # now set other the related env vars, 1682 # IF we've found the gnome-lib dir installed in the ext folder 1683 1684 if ($gnome_dir ne "" && -f &FileUtils::filenameConcatenate($gnome_dir, $ENV{'GSDLOS'}, "lib", "libiconv.$libext")) { 1685 $ENV{'GEXTGNOME'} = $gnome_dir; 1686 $ENV{'GEXTGNOME_INSTALLED'}=&FileUtils::filenameConcatenate($ENV{'GEXTGNOME'}, $ENV{'GSDLOS'}); 1687 1688 my $gnomelib_bin = &FileUtils::filenameConcatenate($ENV{'GEXTGNOME_INSTALLED'}, "bin"); 1689 if(-d $gnomelib_bin) { # no bin subfolder in GS binary's cutdown gnome-lib-minimal folder 1690 &util::envvar_prepend("PATH", $gnomelib_bin); 1691 #$env_vars = "export PATH=".$ENV{'PATH'}.";"; 1692 } 1693 1694 # util's prepend will create LD/DYLD_LIB_PATH if it doesn't exist yet 1695 my $gextlib = &FileUtils::filenameConcatenate($ENV{'GEXTGNOME_INSTALLED'}, "lib"); 1696 1697 if($ENV{'GSDLOS'} eq "linux") { 1698 &util::envvar_prepend("LD_LIBRARY_PATH", $gextlib); 1699 #$env_vars .= "export LD_LIBRARY_PATH=".$ENV{'LD_LIBRARY_PATH'}; 1700 } 1701 elsif ($ENV{'GSDLOS'} eq "darwin") { 1702 #&util::envvar_prepend("DYLD_LIBRARY_PATH", $gextlib); 1703 &util::envvar_prepend("DYLD_FALLBACK_LIBRARY_PATH", $gextlib); 1704 #$env_vars .= "export DYLD_FALLBACK_LIBRARY_PATH=".$ENV{'DYLD_FALLBACK_LIBRARY_PATH'}; 1705 } 1706 } 1707 1708 # Above largely mimics the setup.bash of the gnome-lib-minimal. 1709 # Not doing the devel-srcpack that gnome-lib-minimal's setup.bash used to set 1710 # Not exporting GSDLEXTS variable either 1711 } 1712 1713 # print STDERR "@@@@@ GEXTGNOME: ".$ENV{'GEXTGNOME'}."\n\tINSTALL".$ENV{'GEXTGNOME_INSTALLED'}."\n"; 1714 # print STDERR "\tPATH".$ENV{'PATH'}."\n"; 1715 # print STDERR "\tLD_LIB_PATH".$ENV{'LD_LIBRARY_PATH'}."\n" if $ENV{'LD_LIBRARY_PATH}; 1716 # print STDERR "\tDYLD_FALLBACK_LIB_PATH".$ENV{'DYLD_FALLBACK_LIBRARY_PATH'}."\n" if $ENV{'DYLD_FALLBACK_LIBRARY_PATH}; 1717 1718 # if no GEXTGNOME, maybe users didn't need gnome-lib to run gnomelib/libiconv dependent binaries like hashfile, suffix, wget 1719 # (wvware is launched in a gnomelib env from its own script, but could possibly go through this script in future) 1720 1721 #return $env_vars; #print STDOUT $env_vars; 1722 } 1723 1724 1652 1725 1653 1726 ## @function augmentINC()
Note:
See TracChangeset
for help on using the changeset viewer.