File: lintgtm.csh

package info (click to toggle)
fis-gtm 7.1-006-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,908 kB
  • sloc: ansic: 344,906; asm: 5,184; csh: 4,859; sh: 2,000; awk: 294; makefile: 73; sed: 13
file content (236 lines) | stat: -rwxr-xr-x 5,792 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
#################################################################
#								#
# Copyright (c) 2001-2023 Fidelity National Information		#
# Services, Inc. and/or its subsidiaries. All rights reserved.	#
#								#
#	This source code contains the intellectual property	#
#	of its copyright holder(s), and is made available	#
#	under a license.  If you do not know the terms of	#
#	the license, please stop and do not read further.	#
#								#
#################################################################

#
##################################################################################
#
#	lintgtm.csh - lint C sources used to build GT.M
#
#	arguments:
#		$1 -	version number (without punctuation) or code letter:
#			e.g., "V123" => version "V1.2-3" or:
#				"a" => current active (in current process) release
#				"d" => current development release
#				"p" => current production release
#		$2 -	"gtm_bta" => lint bta images ($gtm_ver/bta)
#			"gtm_dbg" => lint dbg images ($gtm_ver/dbg)
#			"gtm_pro" => lint pro images ($gtm_ver/pro)
#		$3 -	any lint options in addition to the defaults
#
##################################################################################

echo "Start of $0 `date`"
echo ""

echo "lint'ed on $HOST"
echo ""

echo "arguments: '$1' '$2' '$3'"
echo ""

echo ""
echo "lint-related aliases:"
echo ""
alias | grep lint | sort
echo ""
echo ""

echo "lint-related environment variables:"
echo ""
env | grep lint | sort
echo ""
echo ""

set lintgtm_status = 0

set lintgtm_start_directory = `pwd`

if ( "$HOSTOS" == "OSF1"  &&  "$MACHTYPE" == "alpha" ) then

	# Check to make certain the system header files have been properly edited
	# to include the #pragma's necessary to preserve 64-bit pointer sizes
	# independent of C compiler options.
	grep xtaso_header_edit /usr/include/stdio.h > /dev/null
	if ( $status != 0 ) then
		echo "lintgtm-E-xtaso_header_edit: system header files do not support 32-bit pointers"
		echo "lintgtm-I-xtaso_header_edit: you need to run \$gtm_tools/xtaso_header_edit as superuser"
		set lintgtm_status = -10
		goto lint.END
	endif
endif

# Verify arguments:

# Default to linting the current version.
if ( $1 == "" ) then
	set p1 = "$gtm_verno"
else
	set p1 = $1
endif

# Default to linting the current images.
if ( $2 == "" ) then

	switch ( `basename $gtm_exe` )
	case "gtm_bta":
			set p2 = "b"
			breaksw

	case "gtm_dbg":
			set p2 = "d"
			breaksw

	case "gtm_pro":
			set p2 = "p"
			breaksw

	endsw

else
	set p2 = $2

endif


# Define image type-specific information.

set setactive_parms = ( $p1 $p2 ) ; source $gtm_tools/setactive.csh


# Default lint options.

set p3 = "$3"
switch ( $p2 )
case "gtm_bta":
	set gt_lint_options = "$gt_lint_options_common $gt_lint_options_bta $p3"
	breaksw

case "gtm_dbg":
	set gt_lint_options = "$gt_lint_options_common $gt_lint_options_dbg $p3"
	breaksw

case "gtm_pro":
	set gt_lint_options = "$gt_lint_options_common $gt_lint_options_pro $p3"
	breaksw

endsw



cd $gtm_exe


if ( ! -d ./lint ) then
	mkdir ./lint
endif
cd ./lint

# Remove any left-over files.
rm *

set eol_anchor = '$'
set gi = ($gtm_inc)
set gs = ($gtm_src)


cp $gtm_inc/*.h .
ls $gs[1] | grep '\.c$' | xargs -i cp "$gs[1]/{}" .
chmod +w *.c *.h


set lintgtm_verbose = $?verbose

set lintgtm_liblist = "dse lke mupip stub mumps"

foreach i ( $lintgtm_liblist )

	echo "Start of $i lint library creation: `date`"
	echo "lint options: ${gt_lint_option_output}$i $gt_lint_options" > llib-l$i.log
	echo "" >> llib-l$i.log

	switch ( $i )
	case "dse":
	case "lke":
	case "mupip":
	case "stub":
		pwd
		sed -f $gtm_tools/lib_list_lint.sed $gtm_tools/lib$i.list >& lib$i.list
		gt_lint ${gt_lint_option_output}$i $gt_lint_options $gt_lint_options_library `cat lib$i.list` >>& llib-l$i.log
		rm -f `cat lib$i.list`
		breaksw

	case "mumps":
		# (Almost) everything else goes into llib-lmumps.ln, but the list is too long for a single command line
		# so use xargs.  This case must be executed last in the switch statement (because it picks up "everything
		# else") and, hence, must appear last in the for statement.

		# Exclude files that define the same externals (e.g., "main" and the VMS CLI [command line interpreter]
		# emulator arrays):
		pwd
		rm -f gtm.c lke.c lke_cmd.c dse.c dse_cmd.c mupip.c mupip_cmd.c daemon.c gtmsecshr.c
		gt_lint ${gt_lint_option_output}$i $gt_lint_options $gt_lint_options_library *.c >>& llib-l$i.log
		rm *.c
		breaksw

	endsw

	echo "" >> llib-l$i.log
	echo "End of $i lint library creation: `date`"
	echo ""
end

# $shell $gtm_tools/lintshr.csh $p1	# for true parallelism, the following commands would be in lintshr.csh
cp $gtm_src/{gtm.c .
gt_lint $gt_lint_options gtm.c llib-l{mumps,stub}.ln $gt_lint_syslibs \
	>& lint.mumps.log

# $shell $gtm_tools/lintaux.csh $p1	# for true parallelism, the following commands would be in lingaux.csh
cp $gtm_src/{dse,dse_cmd}.c .
gt_lint $gt_lint_options {dse,dse_cmd}.c llib-l{dse,mumps,stub}.ln $gt_lint_syslibs >& lint.dse.log

cp $gtm_src/gtmsecshr.c .
gt_lint $gt_lint_options gtmsecshr.c llib-lmumps.ln $gt_lint_syslibs >& lint.gtmsecshr.log

cp $gtm_src/{lke,lke_cmd}.c .
gt_lint $gt_lint_options {lke,lke_cmd}.c llib-l{lke,mumps,stub}.ln $gt_lint_syslibs >& lint.lke.log

cp $gtm_src/{mupip,mupip_cmd}.c .
gt_lint $gt_lint_options {mupip,mupip_cmd}.c llib-l{mupip,mumps,stub,dse}.ln $gt_lint_syslibs >& lint.mupip.log

chmod +w *.c
rm *.h *.c


lint.END:

if ( $lintgtm_verbose == "0" ) then
	unset verbose
endif

# Return to starting directory:
cd $lintgtm_start_directory

# Clean up environment variables:
unsetenv lintgtm_gt_as
unsetenv lintgtm_gt_cc

# Clean up local shell variables:
unset lintgtm_liblist
unset lintgtm_start_directory
unset p1
unset p2
unset p3

echo ""
echo "End of $0 `date`"

exit $lintgtm_status