| 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 |
# C and Fortran Compiler and Preprocessor Flags |
| 8 |
# --------------------------------------------------- |
| 9 |
# |
| 10 |
# - Flags that end with `_CFLAGS' are always passed to the C compiler. |
| 11 |
# - Flags that end with `_FFLAGS' are always passed to the Fortran |
| 12 |
# compiler. |
| 13 |
# - Flags that end with `_CPPFLAGS' are passed to the C compiler |
| 14 |
# when compiling but not when linking. |
| 15 |
# |
| 16 |
# DEBUG_CFLAGS |
| 17 |
# DEBUG_FFLAGS |
| 18 |
# DEBUG_CPPFLAGS - Flags to pass to the compiler to create a |
| 19 |
# library suitable for use with debugging |
| 20 |
# tools. Usually this list will exclude |
| 21 |
# optimization switches (like `-O') and include |
| 22 |
# switches that turn on symbolic debugging support |
| 23 |
# (like `-g'). |
| 24 |
# |
| 25 |
# PROD_CFLAGS |
| 26 |
# PROD_FFLAGS |
| 27 |
# PROD_CPPFLAGS - Flags to pass to the compiler to create a |
| 28 |
# production version of the library. These |
| 29 |
# usually exclude symbolic debugging switches (like |
| 30 |
# `-g') and include optimization switches (like |
| 31 |
# `-O'). |
| 32 |
# |
| 33 |
# PROFILE_CFLAGS |
| 34 |
# PROFILE_FFLAGS |
| 35 |
# PROFILE_CPPFLAGS- Flags to pass to the compiler to create a |
| 36 |
# library suitable for performance testing (like |
| 37 |
# `-pg'). This may or may not include debugging or |
| 38 |
# production flags. |
| 39 |
# |
| 40 |
# FFLAGS |
| 41 |
# CFLAGS - Flags can be added to these variable which |
| 42 |
# might already be partially initialized. These |
| 43 |
# flags will always be passed to the compiler and |
| 44 |
# should include switches to turn on full warnings. |
| 45 |
# |
| 46 |
# WARNING: flags do not have to be added to the CFLAGS |
| 47 |
# or FFLAGS variable if the compiler is the GNU gcc |
| 48 |
# and gfortran compiler. |
| 49 |
# |
| 50 |
# FFLAGS and CFLAGS should contain *something* or else |
| 51 |
# configure will probably add `-g'. For most systems |
| 52 |
# this isn't a problem but some systems will disable |
| 53 |
# optimizations in favor of the `-g'. The configure |
| 54 |
# script will remove the `-g' flag in production mode |
| 55 |
# only. |
| 56 |
# |
| 57 |
# These flags should be set according to the compiler being used. |
| 58 |
# There are two ways to check the compiler. You can try using `-v' or |
| 59 |
# `--version' to see if the compiler will print a version string. You |
| 60 |
# can use the value of $FOO_BASENAME which is the base name of the |
| 61 |
# first word in $FOO, where FOO is either CC or F77 (note that the |
| 62 |
# value of CC may have changed above). |
| 63 |
|
| 64 |
case $F77_BASENAME in |
| 65 |
gfortran) |
| 66 |
if test $cc_vers_major -ge 10; then |
| 67 |
FFLAGS="$FFLAGS -fallow-argument-mismatch" |
| 68 |
else |
| 69 |
FFLAGS="$FFLAGS" |
| 70 |
fi |
| 71 |
DEBUG_FFLAGS="-g" |
| 72 |
PROD_FFLAGS="-O" |
| 73 |
PROFILE_FFLAGS="-pg" |
| 74 |
;; |
| 75 |
|
| 76 |
g77) |
| 77 |
FFLAGS="$FFLAGS " |
| 78 |
DEBUG_FFLAGS="-g" |
| 79 |
PROD_FFLAGS="-O3 -fomit-frame-pointer" |
| 80 |
PROFILE_FFLAGS="-pg" |
| 81 |
;; |
| 82 |
|
| 83 |
f95) |
| 84 |
CFLAGS="$CFLAGS" |
| 85 |
FFLAGS="$FFLAGS" |
| 86 |
DEBUG_FFLAGS="-g" |
| 87 |
PROD_FFLAGS="-O" |
| 88 |
PROFILE_FFLAGS="-pg" |
| 89 |
;; |
| 90 |
|
| 91 |
g95) |
| 92 |
CFLAGS="$CFLAGS" |
| 93 |
FFLAGS="$FFLAGS -i4" |
| 94 |
DEBUG_FFLAGS="-g" |
| 95 |
PROD_FFLAGS="-O" |
| 96 |
PROFILE_FFLAGS="-pg" |
| 97 |
;; |
| 98 |
esac |