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 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
|
#################################################################
# #
# Copyright 2001, 2014 Fidelity Information Services, Inc #
# #
# 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_sp.csh - environment variable values and aliases specific to Linux
#
##########################################################################################
#
# 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).
set platform_name = `uname | sed 's/-//g' | tr '[A-Z]' '[a-z]'`
set mach_type = `uname -m`
### Sanitize platform_name and match_type
# Cygwin adds the Windows version e.g. uname = CYGWIN_NT-5.1
set platform_only = `echo $platform_name | sed 's/_.*//'`
# sanitize i386 thru i686 to one option, do not use this to set build optimizations!
if ( "linux" == $platform_name ) then
set mach_type = `uname -m | sed 's/i[3456]86/ia32/' `
endif
# default to 64bit builds when object mode is not set
if (!($?OBJECT_MODE)) then
setenv OBJECT_MODE 64
endif
### 64bit vs 32bit builds
# The only 32 bit targets are cygwin, ia32 and x86_64 with specific settings
if ( ( "ia32" == $mach_type ) || ( "cywgin" == $platform_only ) ) then
setenv gt_build_type 32
# build 32 bit on x86_64 when $gtm_inc/x86_64.h does not exist with comlist.csh OR when OBJECT_MODE is set to 32 with comlist.mk
else if ( "x86_64" == $mach_type && ((! -e $gtm_inc/x86_64.h && "inc" == "${gtm_inc:t}") || "32" == $OBJECT_MODE)) then
setenv gt_build_type 32
else
setenv gt_build_type 64
setenv gt_ld_m_shl_options "-shared"
endif
if ( $?gtm_version_change == "1" ) then
# Compiler selections:
#
if !( $?gtm_linux_compiler ) then
setenv gtm_linux_compiler gcc
endif
if ( "ia64" == $mach_type ) then
if ( "gcc" != $gtm_linux_compiler ) then
if (-r /usr/bin/icc) then
setenv gt_cc_compiler "icc -i-static" # name of C compiler
endif
endif
endif
# Archiver definitions:
# GNU ar q equals r, S prevents generating the symbol table but
# requires ranlib before linking
setenv gt_ar_option_create "qSv" # quick, verbose
setenv gt_ar_option_update "rv" # replace, verbose
setenv gt_ar_option_delete "dv" # delete, verbose
setenv gt_ar_use_ranlib "yes"
# Assembler definitions:
# From before conversion from MASM or get MASM running under DOSEMU or such
# setenv gt_as_use_prebuilt "yes"
# GNU as
if ( "ia64" == $mach_type ) then
if ( "icc" == $gtm_linux_compiler ) then
setenv gt_cpp_compiler "icc" # name of C preprocessor
setenv gt_cpp_options_common "-x assembler-with-cpp"
setenv gt_as_assembler "icc"
setenv gt_as_options_common "-c -i-static"
setenv gt_as_option_optimize "$gt_as_option_optimize -O3"
else
setenv gt_as_assembler "gcc -c"
endif
endif
if ( "ia64" != $mach_type ) then
setenv gt_as_assembler "as"
if ("s390x" == $mach_type) then
setenv gt_as_options_common "-march=z9-109"
setenv gt_as_option_debug "--gdwarf-2"
else if ( "cygwin" == $platform_only ) then
setenv gt_as_options_common "--defsym cygwin=1"
setenv gt_as_option_debug "--gdwarf-2"
else
setenv gt_as_option_debug "--gstabs"
endif
endif
# to avoid naming files with .S
# smw 1999/12/04 setenv gt_as_options_common "-c -x assembler-with-cpp"
setenv gt_as_option_DDEBUG ""
# C definitions:
# generate position independent code
setenv gt_cc_shl_fpic "-fPIC"
if ( "cygwin" == $platform_only ) then
setenv gt_cc_shl_fpic ""
endif
# setenv gt_cc_options_common "-c -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64"
# For gcc: _BSD_SOURCE for caddr_t, others
# _XOPEN_SOURCE=500 should probably define POSIX 199309 and/or
# POSIX 199506 but doesnt so...
# -fsigned-char for Linux390 but shouldn't hurt x86
# setenv gt_cc_options_common "-c -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_POSIX_C_SOURCE=199506L
# setenv gt_cc_options_common "$gt_cc_options_common -D_FILE_OFFSET_BITS=64 -DFULLBLOCKWRITES -fsigned-char"
# _GNU_SOURCE includes _XOPEN_SOURCE=400, _BSD_SOURCE, and _POSIX_C_SOURCE-199506L among others
# Need _XOPEN_SOURCE=600 for posix_memalign() interface (replaces obsolete memalign)
if ( "cygwin" == $platform_only ) then
# on Cygwin, -ansi defines __STRICT_ANSI__ which suppresses many prototypes
setenv gt_cc_options_common "-c "
else
setenv gt_cc_options_common "-c -ansi "
endif
setenv gt_cc_options_common "$gt_cc_options_common -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 "
setenv gt_cc_options_common "$gt_cc_options_common -D_XOPEN_SOURCE=600 -fsigned-char -Wreturn-type -Wpointer-sign "
if ( "ia64" != $mach_type ) then
if ("$gt_cc_compiler" =~ *icc*) then
setenv gt_cc_options_common "$gt_cc_options_common $gt_cc_shl_fpic"
else
setenv gt_cc_options_common "$gt_cc_options_common $gt_cc_shl_fpic -Wimplicit"
endif
setenv gt_cc_options_common "$gt_cc_options_common -Wmissing-prototypes -D_LARGEFILE64_SOURCE"
endif
if ( "cygwin" == $platform_only ) then
setenv gt_cc_options_common "$gt_cc_options_common -DNO_SEM_TIME -DNO_SEM_GETPID"
endif
# 32 bit ICU headers of 32 bit linux are in /emul/ia32-linux/usr/include/
if ( "32" == $gt_build_type ) then
if (-d /emul/ia32-linux/usr/include/) setenv gt_cc_option_I "-I/emul/ia32-linux/usr/include/"
endif
if ( "linux" == $platform_name ) then
set lversion=`uname -r`
set ltemp_ver=`echo $lversion | sed 's/./& /g'`
if ($ltemp_ver[3] == "2" && $ltemp_ver[1] == "2") then
setenv gt_cc_options_common "$gt_cc_options_common -DNeedInAddrPort"
endif
if ( "x86_64" == $mach_type ) then
# see if the compiler supports unused-result warnings
# Note: Compilers that dont support --help=warnings will not output unused-result.
# Currently, only compilers that support --help=warnings need to have unused-result
# turned off. Trying to turn it off on compilers that dont support it causes errors.
cc --help=warnings | & grep unused-result >/dev/null
if (! $status ) then
# if it does, turn them off
setenv gt_cc_options_common "$gt_cc_options_common -Wno-unused-result"
endif
endif
endif
# -fno-defer-pop to prevent problems with assembly/generated code with optimization
# -fno-strict-aliasing since we don't comply with the rules
# -ffloat-store for consistent results avoiding rounding differences
# -fno-omit-frame-pointer so %rbp always gets set up (required by caller_id()). Default changed in gcc 4.6.
if ( "ia64" != $mach_type ) then
setenv gt_cc_option_optimize "-O2 -fno-defer-pop -fno-strict-aliasing -ffloat-store"
if ( "32" == $gt_build_type ) then
# applies to 32bit x86_64, ia32 and cygwin
# Compile 32-bit x86 GT.M using 586 instruction set rather than 686 as the new Intel Quark
# low power system-on-a-chip uses the 586 instruction set rather than the 686 instruction set
setenv gt_cc_option_optimize "$gt_cc_option_optimize -fno-omit-frame-pointer -march=i586"
endif
endif
# -g generate debugging information for dbx (no longer overrides -O)
setenv gt_cc_option_debug "-g"
if ( "cygwin" == $platform_only ) then
setenv gt_cc_option_debug "$gt_cc_option_debug -gdwarf-2 -fno-inline -fno-inline-functions"
endif
# Linker definitions:
setenv gt_ld_linker "$gt_cc_compiler" # redefine to use new C compiler definition
# -M generate link map onto standard output
setenv gt_ld_options_common "-Wl,-M"
setenv gt_ld_options_gtmshr "-Wl,-u,gtm_filename_to_id -Wl,--version-script,gtmshr_symbols.export"
setenv gt_ld_options_all_exe "-rdynamic -Wl,-u,gtm_filename_to_id -Wl,-u,gtm_zstatus"
setenv gt_ld_options_all_exe "$gt_ld_options_all_exe -Wl,--version-script,gtmexe_symbols.export"
# optimize for all 64bit platforms
#
# -lrt doesn't work to pull in semaphores with GCC 4.6, so use -lpthread.
# Add -lc in front of -lpthread to avoid linking in thread-safe versions
# of libc routines from libpthread.
setenv gt_ld_syslibs " -lelf -lncurses -lm -ldl -lc -lpthread -lrt"
if ( 32 == $gt_build_type ) then
# 32bit x86_64 and ia32 - decided at the beginning of the file
setenv gt_ld_syslibs " -lncurses -lm -ldl -lc -lpthread -lrt"
endif
if ( "cygwin" == $platform_only ) then
setenv gt_ld_syslibs "-lncurses -lm -lcrypt"
endif
# -lrt for async I/O in mupip recover/rollback
setenv gt_ld_aio_syslib "-lrt"
if ( "cygwin" == $platform_only ) then
setenv gt_ld_aio_syslib ""
endif
# Shared library definition overrides:
setenv gt_cc_shl_options "-c $gt_cc_shl_fpic"
setenv gt_ld_shl_linker "cc"
setenv gt_ld_shl_options "-shared"
# If we are trying to force a 32 bit build on a 64 bit x86 machine, then we need to explicitly specify a 32 bit
# over-ride option.
if ( "x86_64" == $mach_type && "32" == $gt_build_type ) then
setenv gt_cc_options_common "$gt_cc_options_common -m32"
setenv gt_ld_options_gtmshr "$gt_ld_options_gtmshr -m32"
setenv gt_cc_shl_options "$gt_cc_shl_options -m32"
setenv gt_ld_shl_options "$gt_ld_shl_options -m32"
setenv gt_ld_options_common "$gt_ld_options_common -m32"
endif
# need to re-define these in terms of new gt_ld_options_common:
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_shl_suffix ".so"
# lint definition overrides
# setenv gt_lint_linter ""
setenv gt_lint_options_library "-x"
setenv gt_lint_options_common ""
endif
# PBO(Profile based optimization) settings for Linux-IA64, intel compiler.
set gtm_build_image = `basename $gtm_exe`
if ( "ia64" == $mach_type && "pro" == $gtm_build_image && "icc" == $gtm_linux_compiler) then
setenv gt_cc_option_optimize "-O3"
if ($?gtm_pbo_option) then
@ need_mkdir = 0
if !($?gtm_pbo_db) then
@ need_mkdir = 1
setenv gtm_pbo_db "$gtm_log/pbo"
else if !(-e $gtm_pbo_db) then
@ need_mkdir = 1
endif
if (1 == $need_mkdir) then
mkdir -p $gtm_pbo_db
chmod 775 $gtm_pbo_db # Others need ability to write to the pbo files
endif
if ($gtm_pbo_option == "collect") then
setenv gt_cc_option_optimize "-prof-gen -prof-dir $gtm_pbo_db"
setenv gt_ld_options_pro "$gt_ld_options_pro -prof-gen -prof-dir $gtm_pbo_db"
setenv gt_as_option_optimize "$gt_cc_option_optimize"
else if ($gtm_pbo_option == "use") then
setenv gt_cc_option_optimize "-O3 -prof-use -prof-dir $gtm_pbo_db"
setenv gt_ld_options_pro "$gt_ld_options_pro -prof-dir $gtm_pbo_db"
endif
endif
endif
# Assembler definitions:
# Note: we need to specify the assembler output file name or it will write it to the source directory.
if ( "ia64" == $mach_type ) then
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 '
endif
if ( "s390x" == $mach_type) then
setenv gt_asm_arch_size "-m64"
else if ( "64" == $gt_build_type) then
setenv gt_asm_arch_size "--64"
else
setenv gt_asm_arch_size "--32"
endif
if ( "ia64" != $mach_type ) then
alias gt_as_bta \
'gt_as $gt_as_option_debug $gt_as_option_nooptimize $gt_asm_arch_size -o `basename \!:1 .s`.o \!:1'
# If the value of the alias variable extends the 132 character limit, use a temporary variable
# (like gtm_as_dbg_var below) and use that in the alias value to stick to the the coding standard.
set gt_as_dbg_var = "$gt_as_option_DDEBUG $gt_as_option_debug $gt_as_option_nooptimize $gt_asm_arch_size"
alias gt_as_dbg 'gt_as $gt_as_dbg_var -o `basename \!:1 .s`.o \!:1'
alias gt_as_pro 'gt_as $gt_as_option_optimize $gt_asm_arch_size -o `basename \!:1 .s`.o \!:1'
endif
|