/********************************** Absoft compiler COOK OPTIONS **********************************/ /*required reentry of the cook process to setup the environment*/ #include [cookbook]/reentry.cook /********************************** INITILIZE ABSOFT ENVIRONMENT **********************************/ if [not [defined absoft_home]] then{ function print ****************************************************; function print "INVALID ABSOFT COMPILER CONFIGURATION"; function print "absoft_home not defined in a config file:"; function print [config]; function print [config-system]; function print [config-node]; function print ****************************************************; fail; } /*if the target architecture for absoft has not been set then figure it out*/ function print ****************************************************; function print "[os] os type:" [os]; function print "[os machine] machine type:" [os machine]; function print "[os system] system type:" [os system]; function print "[os node] node type:" [os node]; function print ****************************************************; if [not [defined absoft_arch]] then { if [is_windows] then { if [findstring "WOW64" [os system]] then { absoft_arch = intel64; } /* Need to verify on 32 bit Cygwin first */ /* else if [in [os system] x86] then { absoft_arch = ia32; } */ else { function print ****************************************************; function print "INVALID Windows ABSOFT COMPILER CONFIGURATION"; function print "Unknown machine type:" [os system]; function print ****************************************************; fail; } } else { /* linux check here */ if [in [os machine] x86] then { absoft_arch = ia32; } else if [in [os machine] x86_64] then { absoft_arch = intel64; } else { function print ****************************************************; function print "INVALID Linux ABSOFT COMPILER CONFIGURATION"; function print "Unknown machine type:" [os machine]; function print ****************************************************; fail; } } } else if [not [in [absoft_arch] ia32 intel64]] then { function print ****************************************************; function print "INVALID ABSOFT COMPILER CONFIGURATION"; function print "absoft_arch="[absoft_arch]; function print "Valid values: ia32|intel64"; function print ****************************************************; fail; } function print ****************************************************; function print "absoft_arch="[absoft_arch]; function print ****************************************************; /* init different variables if windows or unix */ if [is_windows] then { /* individual absvarsXX.bat scripts for 32 and 64 bit compilers */ if [findstring "ia32" [absoft_arch]] then { if [exists [absoft_home]/bin/absvars32.bat] then { function enqueue-reentry [absoft_home]/bin/absoftvars32.sh [absoft_arch]; } else { function print ****************************************************; function print "INVALID ABSOFT COMPILER CONFIGURATION"; function print "Valid absoft home not found."; function print "absoft_home="[absoft_home]; function print ****************************************************; fail; } } if [findstring "intel64" [absoft_arch]] then { function print "absoft_home="[absoft_home]; if [exists [absoft_home]/bin/absvars64.bat] then { function enqueue-reentry [absoft_home]/bin/absoftvars64.sh [absoft_arch]; } else { function print ****************************************************; function print "INVALID ABSOFT COMPILER CONFIGURATION"; function print "Valid absoft home not found."; function print "absoft_home="[absoft_home]; function print ****************************************************; fail; } } } else { /* linux absoft */ /* Only one absvars.sh script for both 32 an 64 bit compilers */ if [exists [absoft_home]/bin/absvars.sh] then { function enqueue-reentry [absoft_home]/bin/absvars.sh [absoft_arch]; } else { function print ****************************************************; function print "INVALID ABSOFT COMPILER CONFIGURATION"; function print "Valid absoft home not found."; function print "absoft_home="[absoft_home]; function print ****************************************************; fail; } } /********************************** COMPILER **********************************/ fc = af95; fc_build = [fc]_[absoft_arch]; fc_version = [collect [fc] --version | head -1]; fc_compile_flag = "-c "; fc_out_flag = "-o "; /* requires space for arg following option */ fc_flags = ""; fc_fixed = "-f fixed"; fc_free = "-f free"; fc_default = "-O2 -TENV:simd_imask -TENV:simd_dmask -TENV:simd_zmask -TENV:simd_omask -TENV:simd_umask -TENV:simd_pmask -Rb -Rc -Rp -Rs -trapuv"; /* default mode flags */ fc_debug = "-O0 -g -TENV:simd_imask -TENV:simd_dmask -TENV:simd_zmask -TENV:simd_omask -TENV:simd_umask -TENV:simd_pmask -Rb -Rc -Rp -Rs -trapuv"; /* debug flags */ if [is_windows] then { fc_optimize = "-O4"; /* optimization flags */ } else { fc_optimize = "-Ofast"; /* optimization flags */ } fc_release = "-O3"; /* release flags */ /* includes */ fc_inc_flag = "-I "; fc_inc_join = [false]; /* if true, includes joined into single arg with separator */ fc_inc_sep = ";"; fc_mod_inc_flag = "-p"; fc_mod_out_flag = "-YMOD_OUT_DIR="; /* Case of the module names: lower, upper or mixed*/ fc_mod_case = upper; /********************************** LINKER **********************************/ ld = [fc]; ld_version = [fc_version]; if [is_windows] then{ ld_link_flag = "unix.lib"; } else { ld_link_flag = ""; ld_libs = "-lU77"; } ld_out_flag = "-o "; ld_flags = [ld_link_flag]; /* pass the "-O" option to the linker */ if [findstring "-O0" [fc_debug]] then { ld_debug = "-O0"; } if [findstring "-O2" [fc_default]] then { ld_default = "-O2"; } if [findstring "-O3" [fc_release]] then { ld_release = "-O3"; } if [findstring "-O4" [fc_optimize]] then { ld_optimize = "-O4"; /* function print "ld_optimize (-O4) is:" [ld_optimize]; */ } else if [findstring "-Ofast" [fc_optimize]] then { ld_optimize = "-Ofast"; /* function print "ld_optimize (-Ofast) is:" [ld_optimize]; */ } function print "ld_optimize is now:" [ld_optimize]; if [is_unix] then { if [in [mode] default debug release] then { ld_lib_prefix = "-Xlinker --start-group "; ld_lib_suffix = " -Xlinker --end-group"; } else { /* we don't actually use the gnu linker with "-Ofast" specified */ } } /* includes */ ld_inc_flag = [fc_inc_flag]; ld_inc_join = [fc_inc_join]; /* if true, includes joined into single arg with separator */ ld_inc_sep = [fc_inc_sep]; /********************************** ARCHIVER **********************************/ if [is_windows] then { if [in [mode] optimize] then { /* use gnu ar if "-O4" is specified */ ar = ar; ar_flags = "-cq "; lib.prefix = "lib"; lib = ".a"; } else { /* use MS library manager */ ar = lib; ar_flags = "-out:"; } } else { ar = ar; ar_flags = "-cq "; } ar_version = [collect [ar] --version | head -1];