5534
|
1 #! /bin/sh -e |
7019
|
2 # |
|
3 # Copyright (C) 2005, 2006, 2007 John W. Eaton |
|
4 # |
|
5 # This file is part of Octave. |
|
6 # |
|
7 # Octave is free software; you can redistribute it and/or modify it |
|
8 # under the terms of the GNU General Public License as published by the |
|
9 # Free Software Foundation; either version 3 of the License, or (at |
|
10 # your option) any later version. |
|
11 # |
|
12 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 # for more details. |
|
16 # |
|
17 # You should have received a copy of the GNU General Public License |
|
18 # along with Octave; see the file COPYING. If not, see |
|
19 # <http://www.gnu.org/licenses/>. |
5534
|
20 |
|
21 SED=${SED:-'sed'} |
|
22 |
|
23 for f in "$@"; do |
|
24 if [ -f $f ]; then |
|
25 |
|
26 ## Compute and print the autoloads. |
|
27 |
|
28 base=`basename $f | $SED 's/\.df$//'` |
5865
|
29 fcns=`$SED -n -e 's/^ *XDEFUN_DLD_INTERNAL *( *\([^, ]*\)[, ].*$/\1/p' \ |
|
30 -e 's/^ *XDEFUNX_DLD_INTERNAL *( *"\([^"]*\)".*$/\1/p' $f | \ |
5534
|
31 sort -u` |
|
32 if [ -n "$fcns" ]; then |
|
33 for n in $fcns; do |
|
34 if [ "$n" = "$base" ]; then |
|
35 true |
|
36 else |
6926
|
37 echo "autoload (\"$n\", \"$base.oct\");" |
5534
|
38 fi |
|
39 done |
|
40 fi |
|
41 |
|
42 ## Process PKG_ADD directives after autoloads so that all |
|
43 ## necessary functions can be found before they are used. |
|
44 |
|
45 $SED -n -e 's,^//* *PKG_ADD: *,,p' \ |
|
46 -e 's,^/\* *PKG_ADD: *\(.*\) *\*/ *$,\1,p' $f |
|
47 |
|
48 fi |
|
49 done |
|
50 |
|
51 exit $? |