I've been at this for almost a week, but no matter what I try, I cannot get autotools to work properly for me... at least I think the problem is autotools.
I have reduced my method to as little steps as possible, in hope someone is able to help me out.
- I start of with installing mingw on a clean system, I use the installer and choose "candidate".
- I then install msys, I use the current stable installer.
- I then install the gtk development version from gladewin32 (sourceforge)
- I then install the gtkmm development version from
gnome.org ftp
All these programs properly setup any path variables, and gtk also contains the pkg-config tool. I only had to setup my PKG_CONFIG_PATH, so when I type pkg-config gtkmm-2.4 --cflags --libs, things work as expected.
Just to clarify this is definitely setup properly, I am able to compile a simple single file c++ gtkmm programs no problem by hand, using something like:
g++ simple.cc -o simple `pkg-config gtkmm-2.4 --cflags --libs`
So I know that is all working properly. Ok, now getting back to the problem at hand... First of all, here is my project, we start with a new folder, no files in it at all... then create the following files:
configure.ac:
AC_INIT(src/main.cc)
AM_INIT_AUTOMAKE(simple,0.1)
AC_CONFIG_HEADERS(config.h)
PKG_CHECK_MODULES(DEPS, gtkmm-2.4 >= 1.0.0)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_OUTPUT(Makefile src/Makefile)
Makefile.am:
SUBDIRS = src
src/Makefile.am:
bin_PROGRAMS = simple
simple_SOURCES = main.cc
LIBS = $(DEPS_LIBS)
INCLUDES = $(DEPS_CFLAGS)
src/main.cc:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
Ok, now I change into that folder (using msys offcourse), and type the following:
autoheader
touch NEWS README AUTHORS ChangeLog stamp-h
aclocal
libtoolize
autoconf
automake --add-missing
Everything's fine upto this point, then I type:
./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
./configure: line 1856: syntax error near unexpected token `PKG_CHECK_MODULES(DEPS,'
./configure: line 1856: `PKG_CHECK_MODULES(DEPS, gtkmm-2.4 >= 1.0.0)'
I checked the contents of configure, a very large shell script, however around line 1856 it has the text PKG_CHECK_MODULES(DEPS, gtkmm-2.4 >= 1.0.0) in it directly, which doesn't look like proper shellscript code to me. I am not sure which of the tools generates this file, but it seems like a bug to me.
I have tried replacing the autotools with later versions, but that didn't seem to work either, so I restored everything the way it was. Also, please note that this same method I use for building software works perfectly fine in Ubuntu, just not mingw/msys. I'm completely stuck at the moment, for now I can only compile my stuff in Ubuntu, but not win32 because of this. Any help would be much appreciated.