A collection of some remarks about running GNU Autotools (autoconf/automake/libtool) under Mingw. In summary, I succeeded in getting autuconf/automake/libtool to run with the Mingw compiler under Windows, along with pkg-config, shared libraries, and GTK+ 2.0. There are a few steps that I found problematic, and here’s how to get past them.
First, install MSYS and the MSys Developer Toolkit.
Next, you need to install the GTK development environment; from here seems a very good place. In order to get things to work nicely with pkg-config, it is advisable to install it in the same directory MSYS was installed in.
Also, I think, though I’m not sure, I built my own pkgconfig because the one shipped with GTK didn’t work too well for me. Go figure.
If you need intltool for Win32, that’s a bit troublesome because it depends on an XML library for Perl so you’d want to have ActiveState Perl rather than the one shipped with Msys. I used the package from cygnome (edit the files in bin to set the prefix right), which didn’t quite work but was enough to convince my configure script that it was actually there.
I edited the gtk+-2.0.pc file to add -mms-bitfields to the cflags, which is nessacary to get applications to run out-of-the-box without specific Win32 checks.
Also, you’ll probably get an error like this:
Warning: linker path does not have real file for library ...
This seems to be a bug or problem in the Libtool ltmain.sh script. Selectively commenting things out probably should help though:
#if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
# | ${SED} 10q \
# | $EGREP "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
#fi
Finally, if you get an error message that Windows requires all symbols to be resolved and thus only static libraries are built. Luckily, this is easily fixable as well, by adding -no-undefined to the LDFLAGS like this:
monitor_la_LDFLAGS = -module @FAM_LIBS@ -no-undefined
After takin these hurdles, you should be able to build fairly advanced Unix applications under Windows with the Autotools without problems. For examples, refer to the Posadis source code (particularly, the poslib, pos6, dnsquery2 and zoneedit repositories): CVS tree.