File: wirebuildlibs

package info (click to toggle)
gauche 0.9.6-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 41,772 kB
  • sloc: lisp: 114,409; ansic: 111,988; sh: 8,587; makefile: 2,575; cpp: 1,472; asm: 107
file content (50 lines) | stat: -rwxr-xr-x 1,336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# This script is called when building Gauche in a different directory
# than srcdir.  The first argument is srcdir, and the second is the
# value of LN_S set by AC_PROG_LN_S.

set -e

if [ $# -ne 2 ]; then
  echo 'Usage: wirebuildlibs "$top_srcdir" "$LN_S"'
  echo 'Run this script in top_builddir to create links necessary to run'
  echo 'gosh in place. (e.g. cd src; ./gosh -ftest).'
  exit 1
fi

top_srcdir=$1
LN_S=$2

# Sanity check
if [ -z "$top_srcdir" ]; then
  echo 'wirebuildlibs: $top_srcdir cannot be empty.'
  exit 1
fi
if [ -z "$LN_S" ]; then
  echo 'wirebuildlibs: $LN_S cannot be empty.'
  exit 1
fi

echo "Wiring necessary library files..."

# We want top_srcdir be an absolute path to avoid complications of
# making links to deep directories.
echo $top_srcdir | grep '^/' > /dev/null || top_srcdir=`pwd`/$top_srcdir

# Older autoconf sets LN_S to "cp -p" when "ln -s" isn't available,
# but that doesn't handle directories.
if [ "$LN_S" = "cp -p" ]; then
  LN_S="cp -pR"
fi

rm -rf libsrc
$LN_S $top_srcdir/libsrc libsrc
for f in `(cd $top_srcdir; find lib \( -name '*.scm' -o -name 'dump' -o -name 'restore' \) -print)`; do
  if [ $f != "lib/gauche/config.scm" -a $f != "slib.scm" ]; then
    mkdir -p `dirname $f`
    rm -rf $f
    $LN_S $top_srcdir/$f $f
  fi
done
rm -rf test
$LN_S $top_srcdir/test test