Quantcast

Can't get autotools to work.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't get autotools to work.

Robvdl
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.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mingw-msys mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't get autotools to work.

Brian Dessent
Rob van der Linde wrote:

> 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`

That shows that the pkg-config binary is working, but not that the
pkg-config m4 macros are visible to aclocal.  Do you have a pkg.m4 in
your /usr/share/aclocal/ directory?

> 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)

I don't think it matters for your issue, but stylistically these are
underquoted and use the old deprecated form of the macros.  The modern
way is:

AC_INIT([simple],[0.1])
AC_CONFIG_SRCDIR([src/main.cc])
AM_INIT_AUTOMAKE([foreign dist-bzip2 -Wportability -Wsyntax (etc)])
...

> autoheader
> touch NEWS README AUTHORS ChangeLog stamp-h
> aclocal
> libtoolize
> autoconf
> automake --add-missing

Also not relevant to your problem, but you can use the automake
'foreign' option instead of touching files you don't have or want.  And
the preferred method instead of the above is just to run autoreconf (or
in the initial case "autoreconf --install") and let it determine the
proper sequence.

Brian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mingw-msys mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't get autotools to work.

Robvdl
Thanks for the quick reply, I copied all the .m4 files from the C:\GTK\share\aclocal folder to c:\msys\1.0\share\aclocal folder, and thinks worked straight away :). Thanks also for the comments on which parts of my method were outdated, this has helped me a lot. I was aware of the foreign option, but have left it out, as it somehow makes me feel better if my project is GNU compliant (to a point), but thanks heaps for the help...

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mingw-msys mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Loading...