File: gtm_env.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 (246 lines) | stat: -rwxr-xr-x 9,678 bytes parent folder | download | duplicates (4)
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
237
238
239
240
241
242
243
244
245
246
#################################################################
#								#
# Copyright (c) 2001-2019 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.	#
#								#
#################################################################

#
##################################################################################
#
#	gtm_env.csh - establish GT.M environment
#
#	This script defines reasonable default values for environment variables
#	and aliases generally compatible with as many Unix platforms as possible.
#
#	Each environment variable or alias used in any non-platform-specific Unix
#	shell script should have a default value defined in here.  In addition,
#	this script can contain definitions of other environment variables and
#	aliases considered to be generally useful.
#
#	To accomodate platform-specific peculiarities, this script also invokes
#	gtm_env_sp.csh (if one exists) to provide over-riding definitions for any
#	of the environment variables or aliases defined here.
#
#	Naming conventions are designed so an alphabetically-sorted list of
#	environment variables or aliases will cause related definitions to appear
#	together.  Common abbreviations:
#
#		gt	Greystone Technology
#		gt_ar	archiver (library maintenance)
#		gt_as	assembler
#		gt_cc	C compiler
#		gt_ld	linker
#		gt_lint	C de-lint utility
#		gtm	GT.M-specific (as opposed to GT.SQL-specific, for example)
#		shl	shared-library
#
##################################################################################


# Once the environment variables have been initialized, be careful not to
# re-initialize them for each subshell (i.e., don't undo any explicit changes that
# have been made since the last version change).

if ( $?gtm_version_change == "1" ) then

	# Generic archiver information:

	setenv	gt_ar_archiver		"ar"		# name of archiver utility

	setenv	gt_ar_option_create	"qlv"		# quick, use local directory for temp files, verbose
	setenv	gt_ar_option_update	"rlv"		# replace, use local directory for temp files, verbose
	setenv	gt_ar_option_delete	"dlv"		# delete, use local directory for temp files, verbose
	setenv	gt_ar_use_ranlib	"no"		# don't run ranlib over final archive -- not necessary


	# Generic assembler information:

	setenv	gt_as_assembler		"as"		# name of assembler

	setenv	gt_as_inc_convert	"false"		# if true, convert non-native assembly language header files
							#   to native dialect
	setenv	gt_as_src_convert	"false"		# if true, convert non-native assembly language source files
							#   to native dialect
	setenv	gt_as_src_suffix	".s"		# filename suffix for assembly language source files

	setenv	gt_as_option_DDEBUG	"-DDEBUG"	# define DEBUG compilation-/assembly-time macro
	setenv	gt_as_option_I		""		# specify header (include) file directory
							#   (set by gtmsrc.csh during version command)
	setenv	gt_as_option_debug	""		# generate debugger information
	setenv	gt_as_option_nooptimize	""		# don't optimize generated code
	setenv	gt_as_option_optimize	""		# optimize generated code (if applicable)

	setenv	gt_as_options_common	""		# generally-required assembler option(s)


	# Generic C compiler information:

	setenv	gt_cc_compiler		"cc"		# name of C compiler
	setenv	gt_cpp_compiler		"cpp"		# name of C preprocessor

	setenv	gt_cc_option_DBTABLD	"-DNOLIBGTMSHR"	# define NOLIBGTMSHR macro to statically link mumps for bta image

	setenv	gt_cc_option_DDEBUG	"-DDEBUG"	# define DEBUG compilation-time macro

	setenv	gt_cc_option_I		"-I/usr/local/include"	# specify ICU header (include) file directory
	setenv	gt_cc_option_I		" $gt_cc_option_I -I/usr/include/libelf" # Libelf is under different directory in SUSE
								#   (set by gtmsrc.csh during version command)
	setenv	gt_cc_option_debug	"-g"		# generate debugger information
	setenv	gt_cc_option_nooptimize	""		# don't optimize generated code
	setenv	gt_cc_option_optimize	"-O"		# optimize generated code

	setenv	gt_cc_options_common	"-c"		# suppress link phase; force .o for each .c file even if only one
	setenv	gt_cpp_options_common	""		# Options for C preprocessor


	# Generic linker information:

	setenv	gt_ld_linker		"$gt_cc_compiler" # name of link editor; use cc instead of ld to ensure correct
							  #   startup routines and C runtime libraries

	setenv	gt_ld_option_output	"-o "		# option to specify where linker should write output
							#   (some linkers do not allow a space; some require it)

	setenv	gt_ld_options_common	""		# generally-required linker options

	setenv	gt_ld_options_bta	"$gt_ld_options_common"
	setenv	gt_ld_options_dbg	"$gt_ld_options_common"
	setenv	gt_ld_options_pro	"$gt_ld_options_common"
	setenv	gt_ld_options_gtmshr	""
# force the linker to retain gtmci.o & dependent modules even if not referenced.
	setenv gt_ld_ci_u_option	"-Wl,-u,gtm_ci -Wl,-u,gtm_is_main_thread"

	setenv gt_ld_extra_libs		""		# platform specific GT.M libraries

	setenv	gt_ld_syslibs		"-lcurses -lm"	# system libraries needed for link (in addition to defaults)
	setenv	gt_ld_sysrtns		""		# system routines needed for link (in addition to defaults)
	setenv	gt_ld_aio_syslib	""		# system libraries needed for async I/O routines

	# Linker options to create shared libraries from GT.M generated objects
	setenv	gt_ld_m_shl_linker	"ld"
	setenv	gt_ld_m_shl_options	""

	# Generic shared library information:

	# setenv	gt_cc_shl_options	""	# there is no good default for this; leave uninitialized here,
							#  forcing initialization in gtm_env_sp.csh


	setenv	gt_ld_shl_linker	"$gt_ld_linker"

	# setenv	gt_ld_shl_options	""	# there is no good default for this; leave uninitialized here,
							#  forcing initialization in gtm_env_sp.csh
	setenv	gt_ld_shl_suffix	".sl"


	# Generic lint information:

	setenv	gt_lint_linter		"lint"		# name of linter; parameterized to allow use of non-default

	setenv	gt_lint_option_output	"-o "		# option to specify where lint should write output library
							#   (some lints do not allow a space; some require it)

	setenv	gt_lint_options_common	""		# generally-required lint options
	setenv	gt_lint_options_library	""		# lint options specific to lint library generation
							#  (e.g., ignore undefined externals because libraries typically
							#   only #   contain a subset of sources for a program)

	setenv	gt_lint_options_bta	"$gt_cc_option_DDEBUG"
	setenv	gt_lint_options_dbg	"$gt_cc_option_DDEBUG"
	setenv	gt_lint_options_pro	""

	setenv	gt_lint_syslibs		""		# system libraries against which to check for compatibility


endif



# Alias definitions.  In some Unix implementations, alias definitions are not inherited
# by subshells, so they need to be re-initialized each time.  Aliases should not be
# redefined by users; they should be defined to depend on environment variables which
# can be changed by users.


# Generic archiver invocations:

alias	gt_ar			'$gt_ar_archiver'


# Generic assembler invocations:

alias	gt_as			'$gt_as_assembler $gt_as_options_common $gt_as_option_I'
alias	gt_as_bta		'gt_as $gt_as_option_debug $gt_as_option_nooptimize'
alias	gt_as_dbg		'gt_as $gt_as_option_DDEBUG $gt_as_option_debug $gt_as_option_nooptimize'
alias	gt_as_pro		'gt_as $gt_as_option_optimize'


# Generic C compiler invocations:

alias	gt_cpp			'$gt_cpp_compiler $gt_cpp_options_common $gt_cc_option_I'
alias	gt_cc			'$gt_cc_compiler $gt_cc_options_common $gt_cc_option_I'
setenv	gt_cc			'eval $gt_cc_compiler $gt_cc_options_common $gt_cc_option_I'
alias	gt_cc_bta		'gt_cc $gt_cc_option_DBTABLD $gt_cc_option_debug $gt_cc_option_nooptimize'
setenv	gt_cc_bta		'eval $gt_cc $gt_cc_option_DBTABLD $gt_cc_option_debug $gt_cc_option_nooptimize'
alias	gt_cc_dbg		'gt_cc $gt_cc_option_DDEBUG $gt_cc_option_debug $gt_cc_option_nooptimize'
setenv	gt_cc_dbg		'eval $gt_cc $gt_cc_option_DDEBUG $gt_cc_option_debug $gt_cc_option_nooptimize'
if ( "$HOSTOS" == "Linux" ) then
	alias	gt_cc_pro		'gt_cc $gt_cc_option_optimize $gt_cc_option_debug'
	setenv	gt_cc_pro		'eval $gt_cc $gt_cc_option_optimize $gt_cc_option_debug'
else
	alias	gt_cc_pro		'gt_cc $gt_cc_option_optimize'
	setenv	gt_cc_pro		'eval $gt_cc $gt_cc_option_optimize'
endif


# Generic linker invocation:

alias	gt_ld			'$gt_ld_linker'
alias	gt_ld_shl		'$gt_ld_shl_linker'


# Generic lint invocation:

alias	gt_lint			'$gt_lint_linter'


# GT.M commands and utilities:

alias	dse	'$gtm_exe/dse'
alias	gde	'mumps -run GDE'
alias	gtm	'mumps -direct'
alias	lke	'$gtm_exe/lke'
alias	mumps	'$gtm_exe/mumps'
alias	mupip	'$gtm_exe/mupip'


# Note: on VMS, this is defined as the symbol VER*SION, allowing abbreviation by
# omitting trailing characters as long as the first three ("VER") are specified.

alias	version	'set setactive_parms=(\!*); source $gtm_tools/setactive.csh'

if ( $?prompt == "1" ) then
	# On Unix, we have to define all of the shorter forms as individual symbols, although
	# it's unlikely any forms other than "ver" or "version" are ever used.  Note we only
	# do this for login (interactive) processes; shell scripts should not need to abbreviate.
	alias	ver	version
	alias	vers	version
	alias	versi	version
	alias	versio	version
endif

# Platform-specific overrides, if any:

if ( -f $gtm_tools/gtm_env_sp.csh ) then
	source $gtm_tools/gtm_env_sp.csh
endif

# Allow platform specific gt_ld_ci related symbol changes
# force the linker to retain gtmci.o & dependent modules even if not referenced.
setenv gt_ld_ci_options "$gt_ld_ci_u_option $gt_ld_options_gtmshr"