summaryrefslogtreecommitdiffstats
path: root/fortran/src/h5fc.in
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/src/h5fc.in')
-rwxr-xr-xfortran/src/h5fc.in64
1 files changed, 57 insertions, 7 deletions
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index db44600..9e9409d 100755
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -32,6 +32,24 @@ HL="@HL@"
############################################################################
## ##
+## Things You Can Modify to Override HDF5 Library Build Components: ##
+## ##
+## (Advanced usage - know what you're doing - you're on your own here.) ##
+## The three variables below can be used to insert paths and flags in ##
+## FFLAGS, LDFLAGS, or LIBS in the h5fc compile line: ##
+## $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $LIBS ##
+## $fmodules $link_objs $link_args $shared_link ##
+## ##
+## These settings can be overriden by setting HDF5_FFLAGS, ##
+## HDF5_LDFLAGS, or HDF5_LIBS in the environment. ##
+## ##
+############################################################################
+FFLAGSBASE=""
+LDFLAGSBASE=""
+LIBSBASE=""
+
+############################################################################
+## ##
## You shouldn't have to modify anything below this line. ##
## ##
############################################################################
@@ -58,14 +76,27 @@ get_output_file="no"
SHOW="eval"
FCBASE="@FC@"
FLINKERBASE="@FC@"
-FFLAGS="@AM_FCFLAGS@ @FCFLAGS@"
+
+# FFLAGS and LDFLAGS are reserved for use by the script user.
+# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
+
+# User's FFLAGS come after their H5BLD counterparts to override
+# them. User's LDFLAGS come just before clibpath, user's LIBS come after
+# $link_objs and before the hdf5 libraries in $link_args, followed by any
+# external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS
+# or LIBS carried in from the hdf5 build.
+
+H5BLD_FFLAGS="@AM_FCFLAGS@ @FCFLAGS@"
F9XMODFLAG="@F9XMODFLAG@"
F9XSUFFIXFLAG="@F9XSUFFIXFLAG@"
-LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
-LIBS="@LIBS@"
+H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
+H5BLD_LIBS="@LIBS@"
FC="${HDF5_FC:-$FCBASE}"
FLINKER="${HDF5_FLINKER:-$FLINKERBASE}"
+FFLAGS="${HDF5_FFLAGS:-$FFLAGSBASE}"
+LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
+LIBS="${HDF5_LIBS:-$LIBSBASE}"
USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
@@ -92,6 +123,20 @@ usage() {
echo " "
echo " HDF5_FC - use a different Fortran 90 or 95 compiler"
echo " HDF5_FLINKER - use a different linker"
+ echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library"
+ echo " [default: no]"
+ echo " "
+ echo " You can also add or change paths and flags to the compile line using"
+ echo " the following environment varibles or by assigning them to their counterparts"
+ echo " in the 'Things You Can Modify to Override...'" section of $prog_name
+ echo " "
+ echo " Variable Current value to be replaced"
+ echo " HDF5_FFLAGS \"$CFLAGSBASE\""
+ echo " HDF5_LDFLAGS \"$LDFLAGSBASE\""
+ echo " HDF5_LIBS \"$LIBSBASE\""
+ echo " "
+ echo " Note that adding library paths to HDF5_LDFLAGS where another hdf5 version"
+ echo " is located may link your program with that other hdf5 library version."
echo " "
exit $EXIT_FAILURE
}
@@ -228,7 +273,7 @@ if test "x$do_compile" = "xyes"; then
fi
- $SHOW $FC $FFLAGS ${F9XSUFFIXFLAG} ${fmodules} $compile_args
+ $SHOW $FC $H5BLD_FFLAGS $FFLAGS ${F9XSUFFIXFLAG} ${fmodules} $compile_args
status=$?
if test "$status" != "0"; then
@@ -297,9 +342,14 @@ if test "x$do_link" = "xyes"; then
# The LIBS are just a bunch of -l* libraries necessary for the HDF5
# module. It's okay if they're included twice in the compile line.
- link_args="$link_args $LIBS"
-
- $SHOW $FLINKER $FFLAGS $F9XSUFFIXFLAG $fmodules $link_objs $link_args $shared_link $LDFLAGS
+ link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
+
+ # User's FFLAGS come after their H5BLD counterparts to override
+ # them. User's LDFLAGS come just before clibpath, user's LIBS come after
+ # $link_objs and before the hdf5 libraries in $link_args, followed by any
+ # external library paths and libraries from AM_LDFLAGS, LDFLAGS, AM_LIBS
+ # or LIBS carried in from the hdf5 build.
+ $SHOW $FLINKER $FFLAGS $H5BLD_FFLAGS $F9XSUFFIXFLAG $LDFLAGS $fmodules $link_objs $LIBS $link_args $shared_link
status=$?
fi