Changeset 23947

Show
Ignore:
Timestamp:
23.04.2011 17:30:21 (8 years ago)
Author:
davidb
Message:

Introduction of GSDLARCH to support linux32 and linux64 folders, if having multiple binaries in one Greenstone installation. In the event setup.bash cannont find bin/linux32 (or linux64) it sets GSDLARCH to be the empty string, thereby letting everything else continue as is used to be

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/setup.bash

    r23893 r23947  
    165165  export GSDLOS 
    166166 
    167   PATH=$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS:$PATH 
     167  # Establish cpu architecture 
     168  # 32-bit or 64-bit? 
     169  UNAME_HW_MACH=`uname -m` 
     170 
     171# Original test 
     172#  if test "`echo x$UNAME_HW_MACH | sed 's/^x.*_64$/x/'`" == "x" ; 
     173#  then 
     174#   GSDLARCH=64 
     175#  else 
     176#   GSDLARCH=32 
     177#  fi 
     178 
     179  # Following test came from VirtualBox's Guest Additions autostart.sh 
     180  # (adapted for use in Greenstone) 
     181  case "$UNAME_HW_MACH" in 
     182    i[3456789]86|x86|i86pc) 
     183      GSDLARCH='32' 
     184      ;; 
     185    x86_64|amd64|AMD64) 
     186      GSDLARCH='64' 
     187      ;; 
     188    *) 
     189      echo "Unknown architecture: $UNAME_HW_MACH" 
     190      ;; 
     191  esac 
     192 
     193  # Only want non-trival GSDLARCH value set if there is evidence of 
     194  # the installed bin (lib, ...) directories using linux32, linux64 
     195  # (otherwise probably looking at an SVN compiled up version for single OS) 
     196  if test ! -d "$GSDLHOME/bin/$GSDLOS$GSDLARCH" ; 
     197  then  
     198    GSDLARCH="" 
     199  fi 
     200 
     201  export GSDLARCH 
     202 
     203  PATH=$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS$GSDLARCH:$PATH 
    168204  export PATH 
    169205   
    170206  if test "$GSDLOS" = "linux" ; then 
    171       LD_LIBRARY_PATH="$GSDLHOME/lib/$GSDLOS:$LD_LIBRARY_PATH" 
     207      LD_LIBRARY_PATH="$GSDLHOME/lib/$GSDLOS$GSDLARCH:$LD_LIBRARY_PATH" 
    172208      export LD_LIBRARY_PATH 
    173209  elif test "$GSDLOS" = "darwin" ; then 
    174       DYLD_LIBRARY_PATH="$GSDLHOME/lib/$GSDLOS:$DYLD_LIBRARY_PATH" 
     210      DYLD_LIBRARY_PATH="$GSDLHOME/lib/$GSDLOS$GSDLARCH:$DYLD_LIBRARY_PATH" 
    175211      export DYLD_LIBRARY_PATH 
    176212  fi 
     
    178214  # Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables. 
    179215 
    180 if test -d "$GSDLHOME/bin/$GSDLOS/imagemagick" ; then 
    181     PATH="$GSDLHOME/bin/$GSDLOS/imagemagick/bin:$PATH" 
     216if test -d "$GSDLHOME/bin/$GSDLOS$GSDLARCH/imagemagick" ; then 
     217    PATH="$GSDLHOME/bin/$GSDLOS$GSDLARCH/imagemagick/bin:$PATH" 
    182218    export PATH 
    183219   
    184     MAGICK_HOME="$GSDLHOME/bin/$GSDLOS/imagemagick" 
     220    MAGICK_HOME="$GSDLHOME/bin/$GSDLOS$GSDLARCH/imagemagick" 
    185221    export MAGICK_HOME 
    186222   
    187223        if test "$GSDLOS" = "linux" ; then 
    188             LD_LIBRARY_PATH="$GSDLHOME/bin/$GSDLOS/imagemagick/lib:$LD_LIBRARY_PATH" 
     224            LD_LIBRARY_PATH="$GSDLHOME/bin/$GSDLOS$GSDLARCH/imagemagick/lib:$LD_LIBRARY_PATH" 
    189225            export LD_LIBRARY_PATH 
    190226         
    191227        elif test "$GSDLOS" = "darwin" ; then 
    192             DYLD_LIBRARY_PATH="$GSDLHOME/bin/$GSDLOS/imagemagick/lib:$DYLD_LIBRARY_PATH" 
     228            DYLD_LIBRARY_PATH="$GSDLHOME/bin/$GSDLOS$GSDLARCH/imagemagick/lib:$DYLD_LIBRARY_PATH" 
    193229            export DYLD_LIBRARY_PATH 
    194230        fi 
     
    198234  # Note: Ghostscript is only bundled with Greenstone on Mac and Windows, not on Linux. The code below should be used only for the Darwin platform 
    199235  # for Windows please see setup.bat 
    200 if test -d "$GSDLHOME/bin/$GSDLOS/ghostscript" ; then 
    201     PATH="$GSDLHOME/bin/$GSDLOS/ghostscript/bin":"$PATH" 
     236if test -d "$GSDLHOME/bin/$GSDLOS$GSDLARCH/ghostscript" ; then 
     237    PATH="$GSDLHOME/bin/$GSDLOS$GSDLARCH/ghostscript/bin":"$PATH" 
    202238    export PATH 
    203239   
    204     GS_LIB="$GSDLHOME/bin/$GSDLOS/ghostscript/share/ghostscript/8.63/lib" 
     240    GS_LIB="$GSDLHOME/bin/$GSDLOS$GSDLARCH/ghostscript/share/ghostscript/8.63/lib" 
    205241    export GS_LIB 
    206242 
    207     GS_FONTPATH="$GSDLHOME/bin/$GSDLOS/ghostscript/share/ghostscript/8.63/Resource/Font" 
     243    GS_FONTPATH="$GSDLHOME/bin/$GSDLOS$GSDLARCH/ghostscript/share/ghostscript/8.63/Resource/Font" 
    208244    export GS_FONTPATH 
    209245fi 
     
    251287if test -e apache-httpd ; then 
    252288  echo "+Adding in executable path for apache-httpd" 
    253   PATH=$GSDLHOME/apache-httpd/$GSDLOS/bin:$PATH 
     289  PATH=$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/bin:$PATH 
    254290  export PATH 
    255291 
    256292  if test "$GSDLOS" = "linux" ; then 
    257       LD_LIBRARY_PATH="$GSDLHOME/apache-httpd/$GSDLOS/lib:$LD_LIBRARY_PATH" 
     293      LD_LIBRARY_PATH="$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/lib:$LD_LIBRARY_PATH" 
    258294      export LD_LIBRARY_PATH 
    259295   
    260296  elif test "$GSDLOS" = "darwin" ; then 
    261       DYLD_LIBRARY_PATH="$GSDLHOME/apache-httpd/$GSDLOS/lib:$DYLD_LIBRARY_PATH" 
     297      DYLD_LIBRARY_PATH="$GSDLHOME/apache-httpd/$GSDLOS$GSDLARCH/lib:$DYLD_LIBRARY_PATH" 
    262298      export DYLD_LIBRARY_PATH 
    263299  fi 
     
    279315# if the Perl-for-greenstone tarfile has been installed in the bin/linux 
    280316# folder, then we set things up to use that, instead of a system perl  
    281 if [ -d "$GSDLHOME/bin/$GSDLOS/perl" ] ; then 
    282  
    283     PATH=$GSDLHOME/bin/$GSDLOS/perl/bin:$PATH 
     317if [ -d "$GSDLHOME/bin/$GSDLOS$GSDLARCH/perl" ] ; then 
     318 
     319    PATH=$GSDLHOME/bin/$GSDLOS$GSDLARCH/perl/bin:$PATH 
    284320    export PATH 
    285321 
    286322    if test "$GSDLOS" = "linux" ; then 
    287     LD_LIBRARY_PATH=$GSDLHOME/bin/$GSDLOS/perl/lib/5.8.9/i686-linux-thread-multi/CORE:$LD_LIBRARY_PATH 
     323    LD_LIBRARY_PATH=$GSDLHOME/bin/$GSDLOS$GSDLARCH/perl/lib/5.8.9/i686-linux-thread-multi/CORE:$LD_LIBRARY_PATH 
    288324    export LD_LIBRARY_PATH 
    289325    elif test "$GSDLOS" = "darwin" ; then 
    290     DYLD_LIBRARY_PATH=$GSDLHOME/bin/$GSDLOS/perl/lib/5.8.9/darwin-thread-multi-2level/CORE:$DYLD_LIBRARY_PATH 
     326    DYLD_LIBRARY_PATH=$GSDLHOME/bin/$GSDLOS$GSDLARCH/perl/lib/5.8.9/darwin-thread-multi-2level/CORE:$DYLD_LIBRARY_PATH 
    291327    export DYLD_LIBRARY_PATH 
    292328    fi 
    293329 
    294330    if [ "x$PERL5LIB" = "x" ] ; then 
    295     PERL5LIB=$GSDLHOME/bin/$GSDLOS/perl/lib 
     331    PERL5LIB=$GSDLHOME/bin/$GSDLOS$GSDLARCH/perl/lib 
    296332    else  
    297     PERL5LIB=$GSDLHOME/bin/$GSDLOS/perl/lib:$PERL5LIB 
     333    PERL5LIB=$GSDLHOME/bin/$GSDLOS$GSDLARCH/perl/lib:$PERL5LIB 
    298334    fi 
    299335    export PERL5LIB