view src/mk-oct-links.in @ 1923:1d4f67de06f4

[project @ 1996-02-11 20:20:30 by jwe]
author jwe
date Sun, 11 Feb 1996 20:23:27 +0000
parents c4649e82dbb4
children 48f0013988b1
line wrap: on
line source

#! /bin/sh

# 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.

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 $base.oct $n.oct )
      fi
    done
  fi
done