Mercurial > hg > octave-lojdl
view src/mk-pkg-add @ 5536:f16c05db6250 ss-2-9-4
[project @ 2005-11-11 19:53:51 by jwe]
author | jwe |
---|---|
date | Fri, 11 Nov 2005 19:53:52 +0000 |
parents | e107161b8ca3 |
children | b800ae36fc6a |
line wrap: on
line source
#! /bin/sh -e # Create additional links to .oct files that define more than one # function. # If the first arg is --print, only print the links we need to make. # The first non-option arg is taken as the directory where the .oct # files are installed. The remaining arguments should be the list of # .df files corresponding to the source files that were used to # create the .oct files. SED=${SED:-'sed'} if [ $1 = "--prefix" ]; then shift prefix="$1" shift fi for f in "$@"; do if [ -f $f ]; then ## Compute and print the autoloads. base=`basename $f | $SED 's/\.df$//'` fcns=`grep '^ *XDEFUN_DLD_INTERNAL' $f |\ $SED -e 's/XDEFUN_DLD_INTERNAL *( *//' -e 's/ *,.*$//' |\ sort -u` if [ -n "$fcns" ]; then for n in $fcns; do if [ "$n" = "$base" ]; then true else if [ -n "$prefix" ]; then echo "autoload (\"$n\", \"$prefix/$base.oct\");" else echo "autoload (\"$n\", \"$base.oct\");" fi fi done fi ## Process PKG_ADD directives after autoloads so that all ## necessary functions can be found before they are used. $SED -n -e 's,^//* *PKG_ADD: *,,p' \ -e 's,^/\* *PKG_ADD: *\(.*\) *\*/ *$,\1,p' $f fi done exit $?