1 # -*- shell-script -*- 2 # 3 # This file is part of the HDF4 build script. It is processed shortly 4 # after configure starts and defines, among other things, flags for 5 # the various compilation modes. 6 7 # Choosing C, Fortran, and C++ Compilers 8 # -------------------------------------- 9 # 10 # The user should be able to specify the compiler by setting the CC, F77, 11 # and CXX environment variables to the name of the compiler and any 12 # switches it requires for proper operation. If CC is unset then this 13 # script may set it. If CC is unset by time this script completes then 14 # configure will try `gcc' and `cc' in that order (perhaps some others 15 # too). 16 # 17 # Note: Code later in this file may depend on the value of $CC_BASENAME 18 # in order to distinguish between different compilers when 19 # deciding which compiler command-line switches to use. This 20 # variable is set based on the incoming value of $CC and is only 21 # used within this file. 22 23 if test "X-$CC" = "X-"; then 24 CC=xlc 25 CC_BASENAME=xlc 26 fi 27 28 29 # C, Fortran, and C++ Compiler and Preprocessor Flags 30 # --------------------------------------------------- 31 # 32 # - Flags that end with `_CFLAGS' are always passed to the C compiler. 33 # - Flags that end with `_FFLAGS' are always passed to the Fortran 34 # compiler. 35 # - Flags that end with `_CXXFLAGS' are always passed to the C++ compiler. 36 # - Flags that end with `_CPPFLAGS' are passed to the C and C++ compilers 37 # when compiling but not when linking. 38 # 39 # DEBUG_CFLAGS 40 # DEBUG_FFLAGS 41 # DEBUG_CXXFLAGS 42 # DEBUG_CPPFLAGS - Flags to pass to the compiler to create a 43 # library suitable for use with debugging 44 # tools. Usually this list will exclude 45 # optimization switches (like `-O') and include 46 # switches that turn on symbolic debugging support 47 # (like `-g'). 48 # 49 # PROD_CFLAGS 50 # PROD_FFLAGS 51 # PROD_CXXFLAGS 52 # PROD_CPPFLAGS - Flags to pass to the compiler to create a 53 # production version of the library. These 54 # usualy exclude symbolic debugging switches (like 55 # `-g') and include optimization switches (like 56 # `-O'). 57 # 58 # PROFILE_CFLAGS 59 # PROFILE_FFLAGS 60 # PROFILE_CXXFLAGS 61 # PROFILE_CPPFLAGS- Flags to pass to the compiler to create a 62 # library suitable for performance testing (like 63 # `-pg'). This may or may not include debugging or 64 # production flags. 65 # 66 # FFLAGS 67 # CFLAGS - Flags can be added to these variable which 68 # might already be partially initialized. These 69 # flags will always be passed to the compiler and 70 # should include switches to turn on full warnings. 71 # 72 # WARNING: flags do not have to be added to the CFLAGS 73 # or FFLAGS variable if the compiler is the GNU gcc 74 # and g77 compiler. 75 # 76 # FFLAGS and CFLAGS should contain *something* or else 77 # configure will probably add `-g'. For most systems 78 # this isn't a problem but some systems will disable 79 # optimizations in favor of the `-g'. The configure 80 # script will remove the `-g' flag in production mode 81 # only. 82 # 83 # These flags should be set according to the compiler being used. 84 # There are two ways to check the compiler. You can try using `-v' or 85 # `--version' to see if the compiler will print a version string. You 86 # can use the value of $FOO_BASENAME which is the base name of the 87 # first word in $FOO, where FOO is either CC, F77, or CXX (note that the 88 # value of CC may have changed above). 89 90 case $CC_BASENAME in 91 gcc) 92 CFLAGS="$CFLAGS" 93 DEBUG_CFLAGS="-g -fverbose-asm" 94 DEBUG_CPPFLAGS= 95 PROD_CFLAGS="-O3 -fomit-frame-pointer" 96 PROD_CPPFLAGS= 97 PROFILE_CFLAGS="-pg" 98 PROFILE_CPPFLAGS= 99 ;; 100 101 *) 102 CFLAGS="$CFLAGS -D_ALL_SOURCE -qlanglvl=ansi" 103 DEBUG_CFLAGS="-g" 104 DEBUG_CPPFLAGS= 105 PROD_CFLAGS="-O" 106 PROD_CPPFLAGS= 107 PROFILE_CFLAGS="-pg" 108 PROFILE_CPPFLAGS= 109 ;; 110 esac 111 112 # Overriding Configure Tests 113 # -------------------------- 114 # 115 # Values for overriding configuration tests when cross compiling. 116 117 # Set this to `yes' or `no' depending on whether the target is big 118 # endian or little endian. 119 #ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'} 120