6102
|
1 #! /bin/sh |
7019
|
2 # |
|
3 # Copyright (C) 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/>. |
6102
|
20 |
|
21 SED=${SED:-'sed'} |
|
22 AWK=${AWK:-'awk'} |
|
23 |
|
24 F77_TOLOWER=%F77_APPEND_UNDERSCORE% |
|
25 F77_APPEND_UNDERSCORE=%F77_APPEND_UNDERSCORE% |
|
26 F77_APPEND_EXTRA_UNDERSCORE=%F77_APPEND_EXTRA_UNDERSCORE% |
|
27 |
|
28 if $F77_TOLOWER; then |
|
29 case_cmd="tolower"; |
|
30 else |
|
31 case_cmd="toupper"; |
|
32 fi |
|
33 |
|
34 if $F77_APPEND_UNDERSCORE; then |
|
35 uscore="_"; |
|
36 else |
|
37 uscore=""; |
|
38 fi |
|
39 |
|
40 if $F77_APPEND_EXTRA_UNDERSCORE; then |
|
41 awkcmd="$AWK '{ if (\$0 ~ /_/) extra = \"_\"; else extra = \"\"; printf (\"%s%s%s\n\", $case_cmd (\$0), \"$uscore\", extra); }'" |
|
42 else |
|
43 awkcmd="$AWK '{ printf (\"%s%s\n\", tolower (\$0), \"$uscore\"); }'" |
|
44 fi |
|
45 |
6949
|
46 $SED -n -e 'y/ABCDEFGHIJLKMNOPQRSTUVWXYZ/abcdefghijlkmnopqrstuvwxyz/; s/^\( \| \)[ ]*\(.*function\|subroutine\|entry\)[ ]*\([^ (]*\).*$/\3/p' | eval $awkcmd |