5534
|
1 #! /bin/sh -e |
|
2 |
|
3 SED=${SED:-'sed'} |
|
4 |
|
5 for f in "$@"; do |
|
6 if [ -f $f ]; then |
|
7 |
|
8 ## Compute and print the autoloads. |
|
9 |
|
10 base=`basename $f | $SED 's/\.df$//'` |
5865
|
11 fcns=`$SED -n -e 's/^ *XDEFUN_DLD_INTERNAL *( *\([^, ]*\)[, ].*$/\1/p' \ |
|
12 -e 's/^ *XDEFUNX_DLD_INTERNAL *( *"\([^"]*\)".*$/\1/p' $f | \ |
5534
|
13 sort -u` |
|
14 if [ -n "$fcns" ]; then |
|
15 for n in $fcns; do |
|
16 if [ "$n" = "$base" ]; then |
|
17 true |
|
18 else |
6926
|
19 echo "autoload (\"$n\", \"$base.oct\");" |
5534
|
20 fi |
|
21 done |
|
22 fi |
|
23 |
|
24 ## Process PKG_ADD directives after autoloads so that all |
|
25 ## necessary functions can be found before they are used. |
|
26 |
|
27 $SED -n -e 's,^//* *PKG_ADD: *,,p' \ |
|
28 -e 's,^/\* *PKG_ADD: *\(.*\) *\*/ *$,\1,p' $f |
|
29 |
|
30 fi |
|
31 done |
|
32 |
|
33 exit $? |