summaryrefslogtreecommitdiffstats
path: root/c++/src
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2013-03-22 21:02:07 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2013-03-22 21:02:07 (GMT)
commit99b15244742caf98b5ff634f34d880fd0089d8d4 (patch)
tree054cf34f27f5133469210ca62c2762492030070f /c++/src
parent3f1c23b3151153395c6001b895532bf101bdd746 (diff)
downloadhdf5-99b15244742caf98b5ff634f34d880fd0089d8d4.zip
hdf5-99b15244742caf98b5ff634f34d880fd0089d8d4.tar.gz
hdf5-99b15244742caf98b5ff634f34d880fd0089d8d4.tar.bz2
[svn-r23431] Fix for HDFFV-8141.
Changes default value for USE_SHARED_LIB in compile scripts to yes when static is disabled. Comments in scripts about the order of flag variables containing library paths was also corrected. Tested with h5committest on duck, jam, koala, and ostrich in addition to specific testing for the compile script change.
Diffstat (limited to 'c++/src')
-rw-r--r--c++/src/h5c++.in33
1 files changed, 22 insertions, 11 deletions
diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in
index 20435eb..8928d13 100644
--- a/c++/src/h5c++.in
+++ b/c++/src/h5c++.in
@@ -83,11 +83,12 @@ CXXLINKERBASE="@CXX@"
# CXXFLAGS, CPPFLAGS and LDFLAGS are reserved for use by the script user.
# FLAGS brought from the hdf5 build are put in H5BLD_*FLAGS.
-# User's CPPFLAGS and CXXFLAGS 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.
+# User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts. 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. The order of the flags is intended to give precedence
+# to the user's flags.
H5BLD_CXXFLAGS="@AM_CXXFLAGS@ @CXXFLAGS@"
H5BLD_CPPFLAGS="@AM_CPPFLAGS@ @CPPFLAGS@"
H5BLD_LDFLAGS="@AM_LDFLAGS@ @LDFLAGS@"
@@ -100,7 +101,16 @@ CPPFLAGS="${HDF5_CPPFLAGS:-$CPPFLAGSBASE}"
LDFLAGS="${HDF5_LDFLAGS:-$LDFLAGSBASE}"
LIBS="${HDF5_LIBS:-$LIBSBASE}"
-USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
+# If a static library is available, the default will be to use it. If the only
+# available library is shared, it will be used by default. The user can
+# override either default, although choosing an unavailable library will result
+# in link errors.
+STATIC_AVAILABLE="@enable_static@"
+if test "${STATIC_AVAILABLE}" = "yes"; then
+ USE_SHARED_LIB="${HDF5_USE_SHLIB:-no}"
+else
+ USE_SHARED_LIB="${HDF5_USE_SHLIB:-yes}"
+fi
usage() {
# A wonderfully informative "usage" message.
@@ -365,11 +375,12 @@ if test "x$do_link" = "xyes"; then
# module. It's okay if they're included twice in the compile line.
link_args="$link_args $H5BLD_LDFLAGS $H5BLD_LIBS"
- # User's CPPFLAGS and CXXFLAGS 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.
+ # User's CPPFLAGS and CXXFLAGS come after their H5BLD counterparts. 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. The order of the flags is intended to give precedence
+ # to the user's flags.
$SHOW $CXXLINKER $H5BLD_CPPFLAGS $CPPFLAGS $H5BLD_CXXFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $LIBS $link_args $shared_link