1998-04-03 11:29:38 +08:00
|
|
|
# -*- shell-script -*-
|
|
|
|
#
|
2007-02-15 06:29:52 +08:00
|
|
|
# Copyright by The HDF Group.
|
2005-10-21 22:54:41 +08:00
|
|
|
# Copyright by the Board of Trustees of the University of Illinois.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This file is part of HDF5. The full HDF5 copyright notice, including
|
|
|
|
# terms governing use, modification, and redistribution, is contained in
|
2017-04-18 03:32:16 +08:00
|
|
|
# the COPYING file, which can be found at the root of the source code
|
|
|
|
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
|
|
|
# If you do not have access to either file, you may request a copy from
|
|
|
|
# help@hdfgroup.org.
|
2005-10-21 22:54:41 +08:00
|
|
|
|
|
|
|
|
1998-04-03 11:29:38 +08:00
|
|
|
# This file is part of the HDF5 build script. It is processed shortly
|
|
|
|
# after configure starts and defines, among other things, flags for
|
|
|
|
# the various compile modes.
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
# Compiler flags. The CPPFLAGS values should not include package debug
|
|
|
|
# flags like `-DH5G_DEBUG' since these are added with the
|
|
|
|
# `--enable-debug' switch of configure.
|
1998-09-01 03:21:23 +08:00
|
|
|
#----------------------------------------------------------------------------
|
1998-04-03 11:29:38 +08:00
|
|
|
|
|
|
|
|
1998-09-01 03:21:23 +08:00
|
|
|
# Choosing a C Compiler
|
|
|
|
# ---------------------
|
|
|
|
#
|
1998-11-13 23:06:06 +08:00
|
|
|
# The user should be able to specify the compiler by setting the CC
|
|
|
|
# environment variable to the name of the compiler and any switches it
|
|
|
|
# requires for proper operation. If CC is unset then this script may
|
|
|
|
# set it. If CC is unset by time this script completes then configure
|
|
|
|
# will try `gcc' and `cc' in that order (perhaps some others too).
|
|
|
|
#
|
|
|
|
# Note: Code later in this file may depend on the value of $CC_BASENAME
|
|
|
|
# in order to distinguish between different compilers when
|
|
|
|
# deciding which compiler command-line switches to use. This
|
|
|
|
# variable is set based on the incoming value of $CC and is only
|
|
|
|
# used within this file.
|
1998-04-03 11:29:38 +08:00
|
|
|
|
1998-11-13 23:06:06 +08:00
|
|
|
if test "X-" = "X-$CC"; then
|
|
|
|
CC="/some/default/compiler/named/foo -ansi"
|
|
|
|
CC_BASENAME=foo
|
|
|
|
fi
|
1998-04-03 11:29:38 +08:00
|
|
|
|
|
|
|
|
1998-09-01 03:21:23 +08:00
|
|
|
# C Compiler and Preprocessor Flags
|
|
|
|
# ---------------------------------
|
|
|
|
#
|
|
|
|
# Flags that end with `_CFLAGS' are always passed to the compiler.
|
|
|
|
# Flags that end with `_CPPFLAGS' are passed to the compiler when
|
|
|
|
# compiling but not when linking.
|
|
|
|
#
|
|
|
|
# DEBUG_CFLAGS Flags to pass to the compiler to create a
|
|
|
|
# DEBUG_CPPFLAGS library suitable for use with debugging
|
|
|
|
# tools. Usually this list will exclude
|
|
|
|
# optimization switches (like `-O') and include
|
|
|
|
# switches that turn on symbolic debugging
|
|
|
|
# support (like `-g').
|
|
|
|
#
|
|
|
|
# PROD_CFLAGS Flags to pass to the compiler to create a
|
|
|
|
# PROD_CPPFLAGS production version of the library. These
|
|
|
|
# usualy exclude symbolic debugging switches
|
|
|
|
# (like `-g') and include optimization switches
|
|
|
|
# (like `-O').
|
|
|
|
#
|
|
|
|
# PROFILE_CFLAGS Flags to pass to the compiler to create a
|
|
|
|
# PROFILE_CPPFLAGS library suitable for performance testing (like
|
|
|
|
# `-pg'). This may or may not include debugging
|
|
|
|
# or production flags.
|
|
|
|
#
|
[svn-r17616] Purpose:
CFLAGS overhaul
Description:
Modified the way configure handles CFLAGS.
(note: all changes also apply to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS).
1. The configure process will now always preserve a user's CFLAGS
environment variable setup. Any additional flags necessary for compilation
added at configure time will be passed into the Makefiles as AM_CFLAGS,
which is an automake construct to be used in addition to CFLAGS.
This will allow a user to have the final say, as CFLAGS will always appear
later in the compile line than AM_CFLAGS. Additionally, setting CFLAGS
during make will no longer completely erase all flags set by configure,
since they're maintained in AM_CFLAGS.
2. Additionally, where possible, flags previously being assigned directly
into CFLAGS (and thus propagating into h5cc) have now been redirected into
H5_CFLAGS, so they're used ONLY for compiling hdf5, and not embedded into
the h5cc wrapper script as well.
*Note that H5_CFLAGS ultimately is assigned into AM_CFLAGS for use in the
Makefiles. Complete description of changes and build process will be
included in a Configure Document that Elena and I are working on.
3. Removed unsupported config files. This includes:
config/dec-osf*
config/hpux11.00
config/irix5.x
config/powerpc-ibm-aix4.x
config/rs6000-ibm-aix5.x
config/unicos*
4. Modified configure summary to display additional values. Specifically,
appropriate AM_* variables are being shown, as well as H5_FCFLAGS and
H5_CXXFLAGS, which were for some reason not already present.
Tested:
- H5committest
- Tested on all THG / NCSA machines, using several combinations of the more
prominent configure options (c++, fortran, szip, threadsafe, parallel,
et cetera). (Thanks to Quincey for rysnc testing setup!)
- With regards to new automated testing, anything *necessary* for
compilation will be caught by the daily tests as it stands now. (i.e.,
if LDFLAGS is not properly set when szip is used, linking will fail).
Additionally, with regards to which flags get into h5cc, if any
*necessary* flags have been improperly removed, then daily tests should
fail during make installcheck. Additional machine-specific desired
behaviors and/or checks may have to be set up separately within the
daily tests, so this is something to work on.
2009-10-08 23:17:30 +08:00
|
|
|
# H5_CFLAGS Flags can be added to this variable which
|
1998-09-01 03:21:23 +08:00
|
|
|
# might already be partially initialized. These
|
|
|
|
# flags will always be passed to the compiler
|
|
|
|
# and should include switches to turn on full
|
|
|
|
# warnings. HDF5 attempts to be ANSI and Posix
|
|
|
|
# compliant and employ good programming
|
|
|
|
# practices resulting in few if any
|
|
|
|
# warnings.
|
|
|
|
#
|
[svn-r17616] Purpose:
CFLAGS overhaul
Description:
Modified the way configure handles CFLAGS.
(note: all changes also apply to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS).
1. The configure process will now always preserve a user's CFLAGS
environment variable setup. Any additional flags necessary for compilation
added at configure time will be passed into the Makefiles as AM_CFLAGS,
which is an automake construct to be used in addition to CFLAGS.
This will allow a user to have the final say, as CFLAGS will always appear
later in the compile line than AM_CFLAGS. Additionally, setting CFLAGS
during make will no longer completely erase all flags set by configure,
since they're maintained in AM_CFLAGS.
2. Additionally, where possible, flags previously being assigned directly
into CFLAGS (and thus propagating into h5cc) have now been redirected into
H5_CFLAGS, so they're used ONLY for compiling hdf5, and not embedded into
the h5cc wrapper script as well.
*Note that H5_CFLAGS ultimately is assigned into AM_CFLAGS for use in the
Makefiles. Complete description of changes and build process will be
included in a Configure Document that Elena and I are working on.
3. Removed unsupported config files. This includes:
config/dec-osf*
config/hpux11.00
config/irix5.x
config/powerpc-ibm-aix4.x
config/rs6000-ibm-aix5.x
config/unicos*
4. Modified configure summary to display additional values. Specifically,
appropriate AM_* variables are being shown, as well as H5_FCFLAGS and
H5_CXXFLAGS, which were for some reason not already present.
Tested:
- H5committest
- Tested on all THG / NCSA machines, using several combinations of the more
prominent configure options (c++, fortran, szip, threadsafe, parallel,
et cetera). (Thanks to Quincey for rysnc testing setup!)
- With regards to new automated testing, anything *necessary* for
compilation will be caught by the daily tests as it stands now. (i.e.,
if LDFLAGS is not properly set when szip is used, linking will fail).
Additionally, with regards to which flags get into h5cc, if any
*necessary* flags have been improperly removed, then daily tests should
fail during make installcheck. Additional machine-specific desired
behaviors and/or checks may have to be set up separately within the
daily tests, so this is something to work on.
2009-10-08 23:17:30 +08:00
|
|
|
# Warning flags do not have to be added to H5_CFLAGS
|
1998-09-01 03:21:23 +08:00
|
|
|
# variable if the compiler is the GNU gcc
|
1998-11-13 23:06:06 +08:00
|
|
|
# compiler or a descendent of gcc such as EGCS or PGCC.
|
1998-09-01 03:21:23 +08:00
|
|
|
#
|
[svn-r17616] Purpose:
CFLAGS overhaul
Description:
Modified the way configure handles CFLAGS.
(note: all changes also apply to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS).
1. The configure process will now always preserve a user's CFLAGS
environment variable setup. Any additional flags necessary for compilation
added at configure time will be passed into the Makefiles as AM_CFLAGS,
which is an automake construct to be used in addition to CFLAGS.
This will allow a user to have the final say, as CFLAGS will always appear
later in the compile line than AM_CFLAGS. Additionally, setting CFLAGS
during make will no longer completely erase all flags set by configure,
since they're maintained in AM_CFLAGS.
2. Additionally, where possible, flags previously being assigned directly
into CFLAGS (and thus propagating into h5cc) have now been redirected into
H5_CFLAGS, so they're used ONLY for compiling hdf5, and not embedded into
the h5cc wrapper script as well.
*Note that H5_CFLAGS ultimately is assigned into AM_CFLAGS for use in the
Makefiles. Complete description of changes and build process will be
included in a Configure Document that Elena and I are working on.
3. Removed unsupported config files. This includes:
config/dec-osf*
config/hpux11.00
config/irix5.x
config/powerpc-ibm-aix4.x
config/rs6000-ibm-aix5.x
config/unicos*
4. Modified configure summary to display additional values. Specifically,
appropriate AM_* variables are being shown, as well as H5_FCFLAGS and
H5_CXXFLAGS, which were for some reason not already present.
Tested:
- H5committest
- Tested on all THG / NCSA machines, using several combinations of the more
prominent configure options (c++, fortran, szip, threadsafe, parallel,
et cetera). (Thanks to Quincey for rysnc testing setup!)
- With regards to new automated testing, anything *necessary* for
compilation will be caught by the daily tests as it stands now. (i.e.,
if LDFLAGS is not properly set when szip is used, linking will fail).
Additionally, with regards to which flags get into h5cc, if any
*necessary* flags have been improperly removed, then daily tests should
fail during make installcheck. Additional machine-specific desired
behaviors and/or checks may have to be set up separately within the
daily tests, so this is something to work on.
2009-10-08 23:17:30 +08:00
|
|
|
# AM_CFLAGS Flags added directly into this variable will
|
|
|
|
# be propogated to the compiler wrapper scripts (h5cc,
|
|
|
|
# h5c++, et cetera) in addition to being used to compile
|
|
|
|
# the library.
|
1998-09-01 03:21:23 +08:00
|
|
|
#
|
1998-11-13 23:06:06 +08:00
|
|
|
# These flags should be set according to the compiler being used.
|
|
|
|
# There are two ways to check the compiler. You can try using `-v' or
|
|
|
|
# `--version' to see if the compiler will print a version string. You
|
|
|
|
# can use the value of $CC_BASENAME which is the base name of the
|
|
|
|
# first word in $CC (note that the value of CC may have changed
|
|
|
|
# above).
|
|
|
|
|
|
|
|
case $CC_BASENAME in
|
|
|
|
gcc)
|
[svn-r17616] Purpose:
CFLAGS overhaul
Description:
Modified the way configure handles CFLAGS.
(note: all changes also apply to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS).
1. The configure process will now always preserve a user's CFLAGS
environment variable setup. Any additional flags necessary for compilation
added at configure time will be passed into the Makefiles as AM_CFLAGS,
which is an automake construct to be used in addition to CFLAGS.
This will allow a user to have the final say, as CFLAGS will always appear
later in the compile line than AM_CFLAGS. Additionally, setting CFLAGS
during make will no longer completely erase all flags set by configure,
since they're maintained in AM_CFLAGS.
2. Additionally, where possible, flags previously being assigned directly
into CFLAGS (and thus propagating into h5cc) have now been redirected into
H5_CFLAGS, so they're used ONLY for compiling hdf5, and not embedded into
the h5cc wrapper script as well.
*Note that H5_CFLAGS ultimately is assigned into AM_CFLAGS for use in the
Makefiles. Complete description of changes and build process will be
included in a Configure Document that Elena and I are working on.
3. Removed unsupported config files. This includes:
config/dec-osf*
config/hpux11.00
config/irix5.x
config/powerpc-ibm-aix4.x
config/rs6000-ibm-aix5.x
config/unicos*
4. Modified configure summary to display additional values. Specifically,
appropriate AM_* variables are being shown, as well as H5_FCFLAGS and
H5_CXXFLAGS, which were for some reason not already present.
Tested:
- H5committest
- Tested on all THG / NCSA machines, using several combinations of the more
prominent configure options (c++, fortran, szip, threadsafe, parallel,
et cetera). (Thanks to Quincey for rysnc testing setup!)
- With regards to new automated testing, anything *necessary* for
compilation will be caught by the daily tests as it stands now. (i.e.,
if LDFLAGS is not properly set when szip is used, linking will fail).
Additionally, with regards to which flags get into h5cc, if any
*necessary* flags have been improperly removed, then daily tests should
fail during make installcheck. Additional machine-specific desired
behaviors and/or checks may have to be set up separately within the
daily tests, so this is something to work on.
2009-10-08 23:17:30 +08:00
|
|
|
H5_CFLAGS="$H5_CFLAGS -Wsign-compare" #Only works for some versions
|
1998-09-01 03:21:23 +08:00
|
|
|
DEBUG_CFLAGS="-g -fverbose-asm"
|
1999-08-11 04:21:32 +08:00
|
|
|
DEBUG_CPPFLAGS=
|
1998-11-13 23:06:06 +08:00
|
|
|
PROD_CFLAGS="-O3 -fomit-frame-pointer"
|
1998-09-01 03:21:23 +08:00
|
|
|
PROD_CPPFLAGS=
|
|
|
|
PROFILE_CFLAGS="-pg"
|
|
|
|
PROFILE_CPPFLAGS=
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
[svn-r17616] Purpose:
CFLAGS overhaul
Description:
Modified the way configure handles CFLAGS.
(note: all changes also apply to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS).
1. The configure process will now always preserve a user's CFLAGS
environment variable setup. Any additional flags necessary for compilation
added at configure time will be passed into the Makefiles as AM_CFLAGS,
which is an automake construct to be used in addition to CFLAGS.
This will allow a user to have the final say, as CFLAGS will always appear
later in the compile line than AM_CFLAGS. Additionally, setting CFLAGS
during make will no longer completely erase all flags set by configure,
since they're maintained in AM_CFLAGS.
2. Additionally, where possible, flags previously being assigned directly
into CFLAGS (and thus propagating into h5cc) have now been redirected into
H5_CFLAGS, so they're used ONLY for compiling hdf5, and not embedded into
the h5cc wrapper script as well.
*Note that H5_CFLAGS ultimately is assigned into AM_CFLAGS for use in the
Makefiles. Complete description of changes and build process will be
included in a Configure Document that Elena and I are working on.
3. Removed unsupported config files. This includes:
config/dec-osf*
config/hpux11.00
config/irix5.x
config/powerpc-ibm-aix4.x
config/rs6000-ibm-aix5.x
config/unicos*
4. Modified configure summary to display additional values. Specifically,
appropriate AM_* variables are being shown, as well as H5_FCFLAGS and
H5_CXXFLAGS, which were for some reason not already present.
Tested:
- H5committest
- Tested on all THG / NCSA machines, using several combinations of the more
prominent configure options (c++, fortran, szip, threadsafe, parallel,
et cetera). (Thanks to Quincey for rysnc testing setup!)
- With regards to new automated testing, anything *necessary* for
compilation will be caught by the daily tests as it stands now. (i.e.,
if LDFLAGS is not properly set when szip is used, linking will fail).
Additionally, with regards to which flags get into h5cc, if any
*necessary* flags have been improperly removed, then daily tests should
fail during make installcheck. Additional machine-specific desired
behaviors and/or checks may have to be set up separately within the
daily tests, so this is something to work on.
2009-10-08 23:17:30 +08:00
|
|
|
H5_CFLAGS="$H5_CFLAGS -ansi"
|
1999-03-09 20:33:06 +08:00
|
|
|
DEBUG_CFLAGS="-g"
|
1999-08-11 04:21:32 +08:00
|
|
|
DEBUG_CPPFLAGS=
|
1998-09-01 03:21:23 +08:00
|
|
|
PROD_CFLAGS="-O"
|
|
|
|
PROD_CPPFLAGS=
|
|
|
|
PROFILE_CFLAGS="-pg"
|
|
|
|
PROFILE_CPPFLAGS=
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Overriding Configure Tests
|
|
|
|
# --------------------------
|
|
|
|
#
|
1998-04-03 11:29:38 +08:00
|
|
|
# Values for overriding configuration tests when cross compiling.
|
|
|
|
# This includes compiling on some machines where the serial front end
|
|
|
|
# compiles for a parallel back end.
|
|
|
|
|
|
|
|
# Set this to `yes' or `no' depending on whether the target is big
|
|
|
|
# endian or little endian.
|
|
|
|
#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
1998-04-25 05:26:32 +08:00
|
|
|
|
|
|
|
# Set this to the width required by printf() to print type `long
|
|
|
|
# long'. For instance, if the format would be `%lld' then set it to
|
|
|
|
# `ll' or if the format would be `%qd' set it to `q'.
|
|
|
|
#hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'}
|