Unresolved issues

LDFLAGS

In order to generate DLLs, libtool needs LDFLAGS=-no-undefined. We need to

understand why

figure out where to handle it

Incorrect library names

THIS SECTION IS INCORRECT

(XXX ln -s libstdc++.a libstdc++.dll.a)

Now that's strange:

libtool: link: g++ -o .libs/dsets.exe dsets.o h5cpputil.o ../../test/.libs/libh5test.a ../../c++/src/.libs/libhdf5_cpp.a /mingw/lib/gcc/mingw32/4.4.0/libstdc++.dll.a ../../src/.libs/libhdf5.a -lws2_32 -L/mingw/lib/gcc/mingw32/4.4.0
g++.exe: C:/MinGW/lib/gcc/mingw32/4.4.0/libstdc++.dll.a: No such file or directory

This is a well-known issue, see for instance http://old.nabble.com/forum/Search.jtp?query=mingw+%22dll.a%22. Executive summary: the .la files contain incorrect information.

The simplest fix is to clear library_names in all .la files:

$ find /mingw/lib -name '*.la' | while read f ; do echo $f ; sed -e "s/library_names='[^']*'/library_names=\'\'/" $f > $f- && mv $f- $f ; done

The problem is that the same will happen to your own shared libraries, unless you fix libtool. You need to edit /mingw/share/aclocal/libtool.m4, /mingw/share/libtool/libltdl/configure, /mingw/share/libtool/config/ltmain.sh and /mingw/bin/libtool; replace any occurrence of library_names_spec='$libname.dll.a' with library_names_spec='', and any occurrence of *.dll.a) with *.a.

Fortran

/bin/sh ../libtool --tag=F77 --mode=compile gfortran -g -O2 -x f77-cpp-input -c -o getvar.lo getvar.f
libtool: compile: gfortran -g -O2 -x f77-cpp-input -c getvar.f -DDLL_EXPORT -o .libs/getvar.o getvar.f:93.65:
data cend/ ' ' , '.' , '/' , '$' , '#' , '?' , ',' , ';' , '\\' /
1
Warning: initialization string truncated to match variable at (1)
libtool: compile: gfortran -g -O2 -x f77-cpp-input -c getvar.f -o getvar.o >/dev/null 2>&1

This does not happen on Ubuntu, but in all fairness, we're using a different compiler (or, to be exact a different compiler version: gfortran 4.2.4 on Ubuntu, gfortran 4.4.0 on Windows).