Mercurial > hg > octave-lojdl
view src/mk-pkg-add @ 5539:b800ae36fc6a
[project @ 2005-11-16 18:45:32 by jwe]
author | jwe |
---|---|
date | Wed, 16 Nov 2005 18:45:32 +0000 |
parents | e107161b8ca3 |
children | d090d39bb82c |
line wrap: on
line source
#! /bin/sh -e SED=${SED:-'sed'} install=false if [ $1 = "--prefix" ]; then shift prefix="$1" shift elif [ $1 = "--install" ]; then install=true shift fi if [ $# -gt 0 ]; then if $install; then cat <<EOF __octfiledir__ = strrep (octave_config_info ("octfiledir"), octave_config_info ("prefix"), OCTAVE_HOME); EOF fi 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\", strcat (\"$prefix\", filesep, \"$base.oct\"));" elif $install; then echo "autoload (\"$n\", strcat (__octfiledir__, filesep, \"$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 $?