2644
|
1 #! /bin/sh -e |
|
2 |
|
3 # Create additional links to .oct files that define more than one |
|
4 # function. |
|
5 |
|
6 # If the first arg is -p, only print the links we need to make. |
|
7 |
|
8 # The first non-option arg is taken as the directory where the .oct |
|
9 # files are installed. The remaining arguments should be the list of |
4045
|
10 # .df files corresponding to the source files that were used to |
|
11 # create the .oct files. |
2644
|
12 |
4299
|
13 SED=${SED:-'sed'} |
|
14 |
2644
|
15 print_only=false |
|
16 if [ $1 = "-p" ]; then |
|
17 print_only=true |
|
18 shift |
|
19 fi |
|
20 |
|
21 links_dir=$1 |
|
22 shift |
|
23 |
|
24 for f in "$@"; do |
4299
|
25 base=`basename $f | $SED 's/\.df$//'` |
4045
|
26 fcns=`grep '^ *XDEFUN_DLD_INTERNAL' $f |\ |
4299
|
27 $SED -e 's/XDEFUN_DLD_INTERNAL *( *//' -e 's/ *,.*$//' |\ |
2644
|
28 sort -u` |
|
29 if [ -n "$fcns" ]; then |
|
30 for n in $fcns; do |
|
31 if [ "$n" = "$base" ]; then |
|
32 true |
|
33 else |
|
34 if $print_only; then |
|
35 echo $base.oct $n.oct |
|
36 else |
|
37 echo "creating link $n.oct -> $base.oct" |
|
38 ( cd $links_dir; rm -f $n.oct; ln $base.oct $n.oct ) |
|
39 fi |
|
40 fi |
|
41 done |
|
42 fi |
|
43 done |
|
44 |
|
45 exit $? |