1 #							-*- shell-script -*-
2 #
3 # This file is part of the HDF5 build script.  It is processed shortly
4 # after configure starts and defines, among other things, flags for
5 # the various compile modes.
6 
7 
8 #----------------------------------------------------------------------------
9 # Compiler flags. The CPPFLAGS values should not include package debug
10 # flags like `-DH5G_DEBUG' since these are added with the
11 # `--enable-debug' switch of configure.
12 #----------------------------------------------------------------------------
13 
14 
15 # Choosing a C Compiler
16 # ---------------------
17 #
18 # The user should be able to specify the compiler by setting the CC
19 # environment variable to the name of the compiler and any switches it
20 # requires for proper operation.  If CC is unset then this script may
21 # set it.  If CC is unset by time this script completes then configure
22 # will try `gcc' and `cc' in that order (perhaps some others too).
23 #
24 # Note: Code later in this file may depend on the value of $CC_BASENAME
25 #       in order to distinguish between different compilers when
26 #       deciding which compiler command-line switches to use.  This
27 #       variable is set based on the incoming value of $CC and is only
28 #       used within this file.
29 
30 if test "X-" =  "X-$CC"; then
31     CC=cc
32     CC_BASENAME=cc
33 fi
34 # no need to use RANLIB
35 RANLIB=:
36 
37 
38 # C Compiler and Preprocessor Flags
39 # ---------------------------------
40 #
41 # Flags that end with `_CFLAGS' are always passed to the compiler.
42 # Flags that end with `_CPPFLAGS' are passed to the compiler when
43 # compiling but not when linking.
44 #
45 # DEBUG_CFLAGS		Flags to pass to the compiler to create a
46 # DEBUG_CPPFLAGS	library suitable for use with debugging
47 #			tools. Usually this list will exclude
48 #			optimization switches (like `-O') and include
49 #			switches that turn on symbolic debugging
50 #			support (like `-g').
51 #
52 # PROD_CFLAGS		Flags to pass to the compiler to create a
53 # PROD_CPPFLAGS		production version of the library.  These
54 #			usualy exclude symbolic debugging switches
55 #			(like `-g') and include optimization switches
56 #			(like `-O').
57 #
58 # PROFILE_CFLAGS	Flags to pass to the compiler to create a
59 # PROFILE_CPPFLAGS	library suitable for performance testing (like
60 # 			`-pg').  This may or may not include debugging
61 # 			or production flags.
62 #
63 # CFLAGS		Flags can be added to this variable which
64 #			might already be partially initialized.  These
65 #			flags will always be passed to the compiler
66 #			and should include switches to turn on full
67 #			warnings.  HDF5 attempts to be ANSI and Posix
68 #			compliant and employ good programming
69 #			practices resulting in few if any
70 #			warnings.
71 #
72 #			Warning flags do not have to be added to CFLAGS
73 #			variable if the compiler is the GNU gcc
74 #			compiler or a descendent of gcc such as EGCS or PGCC.
75 #
76 #			The CFLAGS should contains *something* or else
77 #			configure will probably add `-g'.  For most
78 #			systems this isn't a problem but some systems
79 #			will disable optimizations in favor of the
80 #			`-g'.
81 #
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 $CC_BASENAME which is the base name of the
87 # first word in $CC (note that the value of CC may have changed
88 # above).
89 
90 case $CC_BASENAME in
91     gcc)
92 	CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
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     cc)
102 	CFLAGS="$CFLAGS"
103 	DEBUG_CFLAGS="-g -h zero"
104 	DEBUG_CPPFLAGS=
105 	PROD_CFLAGS="-O2 -h scalar0"
106 	PROD_CPPFLAGS=
107 	PROFILE_CFLAGS="-pg"
108 	PROFILE_CPPFLAGS=
109 	;;
110 
111     *)
112 	CFLAGS="$CFLAGS -ansi"
113 	DEBUG_CFLAGS="-g"
114 	DEBUG_CPPFLAGS=
115 	PROD_CFLAGS="-O"
116 	PROD_CPPFLAGS=
117 	PROFILE_CFLAGS="-pg"
118 	PROFILE_CPPFLAGS=
119 	;;
120 esac
121 
122 
123 
124 # Overriding Configure Tests
125 # --------------------------
126 #
127 # Values for overriding configuration tests when cross compiling.
128 # This includes compiling on some machines where the serial front end
129 # compiles for a parallel back end.
130 
131 # Set this to `yes' or `no' depending on whether the target is big
132 # endian or little endian.
133 #ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
134 
135 # Set this to the width required by printf() to print type `long
136 # long'.  For instance, if the format would be `%lld' then set it to
137 # `ll' or if the format would be `%qd' set it to `q'.
138 #hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
139 
140 # Hard set the flag to indicate that converting denormalized floating-point
141 # values doesn't work.
142 hdf5_cv_convert_denormal_float=${hdf5_cv_convert_denormal_float='no'}
143