(linenum→info "unix/slp.c:2238")

gauche/0.8.12/src/makeverslink

    1: #!/bin/sh
    2: # Helper script to create a symlink to sharedlib,
    3: #   like libgauche.so -> libgauche.so.0.1
    4: # Assumes $TARGETLIB and $DESTDIR is set by the caller.
    5: 
    6: # In some occasions, TARGETLIB contains a path like
    7: # '@executable_path/../Frameworks/Gauche.framework'.
    8: # We don't need to create links in such case.
    9: 
   10: case "$TARGETLIB" in 
   11:   "@*") 
   12:     exit 0;;
   13: esac
   14: 
   15: LIBGAUCHE=$1
   16: 
   17: API_VERSION=`cat ../VERSION | sed 's/_.*//'`
   18: 
   19: oldifs=$IFS
   20: IFS="."
   21: set $API_VERSION
   22: IFS=$oldifs
   23: 
   24: API_MAJOR_VERSION=$1
   25: API_MINOR_VERSION=$2
   26: API_MICRO_VERSION=$3
   27: 
   28: : ${API_MINOR_VERSION:=0}
   29: : ${API_MICRO_VERSION:=0}
   30: 
   31: LIB_VVV=$LIBGAUCHE.$API_MAJOR_VERSION.$API_MINOR_VERSION.$API_MICRO_VERSION
   32: LIB_V=$LIBGAUCHE.$API_MAJOR_VERSION
   33: 
   34: cd $DESTDIR$TARGETLIB
   35: # avoid re-running mkverslink.
   36: if test -f $LIB_VVV -a -L $LIBGAUCHE; then exit; fi
   37: rm -f $LIB_VVV
   38: mv $LIBGAUCHE $LIB_VVV
   39: ln -s $LIB_VVV $LIBGAUCHE
   40: rm -f $LIB_V
   41: ln -s $LIB_VVV $LIB_V
   42: 
Syntax (Markdown)