diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2011-04-14 21:21:59 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2011-04-14 21:21:59 (GMT) |
commit | 98362b664c5299950edaa85448b219b372106b0b (patch) | |
tree | a5d95898916b57abc11b6dab2e53683be55ca31a /configure.in | |
parent | a45c7424b2d849c8876d4681d0815367f6e5c7f6 (diff) | |
download | hdf5-98362b664c5299950edaa85448b219b372106b0b.zip hdf5-98362b664c5299950edaa85448b219b372106b0b.tar.gz hdf5-98362b664c5299950edaa85448b219b372106b0b.tar.bz2 |
[svn-r20504] Purpose:
General shared library improvements for CYGWIN / AIX
Description:
Shared libraries are disabled on both CYGWIN and AIX due
to inability to build them correctly. Part of the problem
in both of these situations is the lack of the libtool
flag -no-undefined, which tells libtool that all needed
symbols are defined at link time (a requirement on these
systems) and that it's okay to build shared libraries.
Another problem are lack of dependencies between wrapper
libraries and core C HDF5 library.
This patch addresses both of these by fixing configure to
add in -no-undefined flag for libtool during linking and
adds automake dependencies in the Makefile.am files.
After testing, both CYGWIN and AIX now generate shared
libraries, but there are still some test failures in each.
(cache_api, dt_arith, and testerror.sh on CYGWIN, and
fortran tests on AIX).
Even though the shared libraries are not quite perfect,
this is a general improvement to what we had before, so
I'm applying the patch anyways. Note that default behavior
of shared libraries on these systems being disabled has
NOT been changed and requires the use of the
--enable-unsupported to attempt to build them.
We will need to address the test failures in each
architecture prior to formally supporting shared
libraries on each.
Tested:
h5committested & CYGWIN tested (on bangan)
(AIX tested by Albert on bp-login2)
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 9941744..42b552f 100644 --- a/configure.in +++ b/configure.in @@ -95,6 +95,7 @@ AC_SUBST([H5_CFLAGS]) AC_SUBST([H5_CPPFLAGS]) AC_SUBST([H5_FCFLAGS]) AC_SUBST([H5_CXXFLAGS]) +AC_SUBST([H5_LDFLAGS]) dnl AM_CFLAGS (and company) are for CFLAGS that should be used on HDF5, dnl and WILL be exported to h5cc (or h5fc, etc) if set by configure. @@ -953,6 +954,11 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then fi dnl ---------------------------------------------------------------------- +dnl Windows won't create DLLs without the following macro. +dnl +AC_LIBTOOL_WIN32_DLL + +dnl ---------------------------------------------------------------------- dnl Create libtool. If shared/static libraries are going to be enabled dnl or disabled, it should happen before these macros. AC_LIBTOOL_DLOPEN @@ -1243,6 +1249,27 @@ case "$host" in esac dnl ---------------------------------------------------------------------- +dnl Some platforms require that all symbols are resolved when a library +dnl is linked. We can use the -no-undefined flag to tell libtool that +dnl it will be able to build shared libraries on these architectures, +dnl as it will not do so by default. +dnl +if test "X${enable_shared}" = "Xyes"; then + AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared libraries]) + case "`uname`" in + CYGWIN*|MINGW*|AIX*) + dnl Add in the -no-undefined flag to LDFLAGS for libtool. + AC_MSG_RESULT([yes]) + H5_LDFLAGS="$H5_LDFLAGS -no-undefined" + ;; + *) + dnl Don't add in anything. + AC_MSG_RESULT([no]) + ;; + esac +fi + +dnl ---------------------------------------------------------------------- dnl Test for Largefile support. dnl AC_MSG_CHECKING([if configure should try to set up large file support]) @@ -4392,6 +4419,7 @@ AC_CONFIG_FILES([src/libhdf5.settings hl/fortran/examples/run-hlfortran-ex.sh]) AC_OUTPUT +LT_OUTPUT no_create=$saved_no_create # Then the stamp2 file for H5config.h |