view src/mk-oct-links.in @ 1976:f6a78c706c85

[project @ 1996-02-25 05:14:21 by jwe]
author jwe
date Sun, 25 Feb 1996 05:14:21 +0000
parents 48f0013988b1
children fe675f6fa03a
line wrap: on
line source

#! /bin/sh -e

# Create additional links to .oct files that define more than one
# function.

# The first arg is taken as the directory where the .oct files are
# installed.  The remaining arguments should be the list of source
# files that were used to create the .oct files.

LN_S="@LN_S@"

links_dir=$1
shift

for f in "$@"; do
  base=`basename $f | sed 's/\.cc$//'`
  fcns=`grep -h '^ *DEFUN_DLD' $f |\
        sed -e 's/DEFUN_DLD_BUILTIN *( *//' -e 's/ *,.*$//' |\
        sort -u`
  if [ -n "$fcns" ]; then
    for n in $fcns; do
      if [ "$n" = "$base" ]; then
        true
      else
	echo "creating link $n.oct -> $base.oct"
        ( cd $links_dir; $LN_S $base.oct $n.oct )
      fi
    done
  fi
done

exit $?