diff options
author | James Laird <jlaird@hdfgroup.org> | 2005-09-13 22:30:33 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2005-09-13 22:30:33 (GMT) |
commit | 33beeb7f55193bc76a7544f9fe3634718f36352d (patch) | |
tree | 477997f046cf9bc98025a8ecdd63ea01963d1081 /configure.in | |
parent | 676e9e6f13caaeff5fb0e3809dda6d0e427bf0de (diff) | |
download | hdf5-33beeb7f55193bc76a7544f9fe3634718f36352d.zip hdf5-33beeb7f55193bc76a7544f9fe3634718f36352d.tar.gz hdf5-33beeb7f55193bc76a7544f9fe3634718f36352d.tar.bz2 |
[svn-r11411] Purpose:
Bug fix
Description:
Building with --disable-static seems to have been broken on several platforms.
Fixed this.
Configure will now disable shared libraries automatically when using pgf90
or when building on Cygwin.
Solution:
To avoid errors when using shared libraries with pgf90 (which I had not
realized were compiler-specific), I had manually set convenience libraries
to use the -static linking flag. Apparently, this is not necessary, and
caused these libraries to be created as empty archives when --disable-static
was used.
Also, some libraries were including other libraries, which was not
necessary.
I also fixed code in configure.in to correctly detect whether shared
or static libraries are enabled, and moved code that disables shared libraries
to before libtool is created (rather than editing libtool after the fact).
Despite repeated warnings that only one shared library can be linked at a
time, I have yet to have shared libraries break the linking of tests on
any system. We'll see if the Daily Tests turn up anything.
Platforms tested:
mir (fortran, C++), sleipnir (C++), modi4 (fortran, C++, parallel),
sol (fortran, C++), cygwin
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 78 |
1 files changed, 49 insertions, 29 deletions
diff --git a/configure.in b/configure.in index cbc127a..7216b8e 100644 --- a/configure.in +++ b/configure.in @@ -498,6 +498,51 @@ export AR AC_PROG_MAKE_SET AC_PROG_INSTALL + +dnl ---------------------------------------------------------------------- +dnl As of Libtool 1.5.14, libtool officially doesn't know how to create +dnl shared libraries with pgcc. In fact, it is able to do so on some +dnl platforms, but not all (e.g., pgcc 5.2-4 on mir). +dnl Disable shared libraries when using pgcc. -JL 09/2005 +if (${CC-cc} -V 2>&1 | grep '^pgcc') > /dev/null; then + echo ' warning: shared libraries are not supported for pgcc!' + echo ' disabling shared libraries' + enable_shared="no" +fi + +dnl A similar problem seems to exist for pgf90 version 6.0-4. +if test "X$HDF_FORTRAN" = "Xyes" && \ + (${FC} -V 2>&1 | grep '^pgf90') > /dev/null; then + echo ' warning: shared libraries are not supported for pgf90!' + echo ' disabling shared libraries' + enable_shared="no" +fi + +dnl ---------------------------------------------------------------------- +dnl pgcc version 6.0x have optimization (-O, -O2 or -O3) problem. Detect +dnl these versions and add option "-Mx,28,0x8" to the compiler to avoid +dnl the problem if optimization is enabled. +dnl +if (${CC-cc} -V 2>&1 | grep '^pgcc 6.0') > /dev/null && test "X$enable_production" = "Xyes"; then + echo 'adding compiler flag to avoid optimization problem in pgcc' + CC="${CC-cc} -Mx,28,0x8" +fi + +dnl ---------------------------------------------------------------------- +dnl Shared libraries are not currently supported under Cygwin. +case "`uname`" in + CYGWIN*) + if test "X${enable_shared}" = "Xyes"; then + echo ' warning: shared libraries are not supported on Cygwin!' + echo ' disabling shared libraries' + fi + enable_shared="no" + ;; +esac + +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 AM_PROG_LIBTOOL @@ -519,30 +564,6 @@ EOF ;; esac -dnl As of Libtool 1.5.14, libtool officially doesn't know how to create -dnl shared libraries with pgcc. In fact, it is able to do so on a number -dnl of platforms, but not all (e.g., pgcc 5.2-4 on mir). There is discussion -dnl online which will hopefully resolve this issue, but in the meantime -dnl we disable support for shared libraries using pgcc because this issue -dnl is difficult to detect. -JL 03/2005 -if (${CC-cc} -V 2>&1 | grep '^pgcc') > /dev/null; then - echo 'disabling shared libraries for pgcc' -ed - $ofile <<EOF 2> /dev/null -/^build_libtool_libs=yes/s//build_libtool_libs=no/ -w -q -EOF -fi - -dnl ---------------------------------------------------------------------- -dnl pgcc version 6.0x have optimization (-O, -O2 or -O3) problem. Detect -dnl these versions and add option "-Mx,28,0x8" to the compiler to avoid -dnl the problem if optimization is enable. -dnl -if (${CC-cc} -V 2>&1 | grep '^pgcc 6.0') > /dev/null && test "X$enable_production" = "Xyes"; then - CC="${CC-cc} -Mx,28,0x8" -fi - dnl Fix up the INSTALL macro if it's a relative path. We want the dnl full-path to the binary instead. case "$INSTALL" in @@ -2937,17 +2958,16 @@ dnl Are we compiling static libraries, shared libraries, or both? This dnl is only used for the libhdf5.settings file. We can't just look at dnl $enable_static and $enable_shared because if they're yes the ltconfig dnl might have decided that one or the other is simply not possible. -dnl Therefore we have to look in the generated `libtool' shell script for -dnl lines that set the value of `build_libtool_libs' (shared) and -dnl `build_old_libs' (static). +dnl Therefore we have to ask the generated `libtool' shell script +dnl which 'features' it has enabled. AC_SUBST([STATIC_SHARED]) -if (grep '^build_libtool_libs=yes' libtool >/dev/null); then +if (./libtool --features | grep '^enable shared libraries' > /dev/null); then enable_shared=yes else enable_shared=no fi -if (grep '^build_old_libs=yes' libtool >/dev/null); then +if (./libtool --features | grep '^enable static libraries' > /dev/null); then enable_static=yes else enable_static=no |