Debian Codegraph @

tools/install-shared-commands.sh

raw
1 #!/bin/sh
2
3 # Create a symlink (if possible) or copy of the commadns with common-name.
4 # Used to create common name commands when --enable-shared-commands is given.
5
6 usage() {
7 echo "install-shaerd-commands.h <BINDIR> <DESTDIR>"
8 exit 1
9 }
10
11 bindir=$1
12 destdir=$2 # aux prefix when install for packaging
13
14 if [ -z "$bindir" ]; then usage; fi
15
16 target="$destdir$bindir"
17
18 makelink() {
19 gauche_name=$1
20 common_name=$2
21
22 rm -f $target/$common_name
23 if uname -a | grep -i 'mingw'; then
24 cp "$target/$gauche_name.exe" "$target/$common_name.exe"
25 else
26 ln -s "$gauche_name" "$target/$common_name"
27 fi
28 }
29
30 # SRFI-22
31 makelink gosh scheme-r7rs
32 makelink gosh scheme-srfi-0
33 makelink gosh scheme-srfi-7
34
35 # SRFI-138
36 makelink gauche-compile-r7rs compile-r7rs