You are not logged in.

#1 2008-02-05 11:08:40

violagirl23
Member
Registered: 2008-01-24
Posts: 184

aclocal gives warning with my configure.ac, did something wrong?

I'm trying to use my first make file, and it's my first program with gtkmm....
But I think I'm doing something wrong.  I made my configure.ac file, here it is:

AC_INIT(src/firstwindow.cpp)
AM_INIT_AUTOMAKE(firstwindow,0.1)
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES([MYAPP], [gtkmm-2.4 >= 2.8.0])
AC_PROG_INSTALL
AC_OUTPUT(Makefile src/Makefile)

But if I  then run aclocal, it has a problem with the PKG_CHECK_MODULES line for the GTK.
It prints out:

aclocal
/usr/share/aclocal/gtkgl.m4:4: warning: underquoted definition of AM_PATH_GTKGL
/usr/share/aclocal/gtkgl.m4:4:   run info '(automake)Extending aclocal'
/usr/share/aclocal/gtkgl.m4:4:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal

Am I not even supposed to use aclocal?  Ive never used a make file before, so I was just trying to follow the instructions...
sad

Last edited by violagirl23 (2008-02-05 11:15:21)


"You can't just ask to borrow somebody else's lampshade. It's AWKWARD!"

Offline

#2 2008-02-05 21:01:53

violagirl23
Member
Registered: 2008-01-24
Posts: 184

Re: aclocal gives warning with my configure.ac, did something wrong?

Update: Well, I uninstalled gtkglext, gtkglextmm, and gtkglarea and the warnings ceased, though I WOULD like to know why I'm having them and how to get rid of them for if I *need* said utilities.
But the program still won't compile.
So I think I'm just doing something wrong in general, forgetting something.
Here is my current configure.ac:

AC_INIT(src/firstwindow.cpp)
AM_INIT_AUTOMAKE(firstwindow,0.1)
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES([firstwindow], [gtkmm-2.4 >= 2.8.0])
AC_PROG_INSTALL
AC_OUTPUT(Makefile src/Makefile)

I am using this tutorial: http://www.gtkmm.org/docs/gtkmm-2.4/doc … nking.html
and it says:

To simplify compilation, we use pkg-config, which is present in all (properly installed) gtkmm installations. This program 'knows' what compiler switches are needed to compile programs that use gtkmm. The --cflags option causes pkg-config to output a list of include directories for the compiler to look in; the --libs option requests the list of libraries for the compiler to link with and the directories to find them in. Try running it from your shell-prompt to see the results on your system.

However, this is even simpler when using the PKG_CHECK_MODULES() macro in a standard configure.ac file with autoconf and automake. For instance:

PKG_CHECK_MODULES([MYAPP], [gtkmm-2.4 >= 2.8.0])

This checks for the presence of gtkmm and defines MYAPP_LIBS and MYAPP_CFLAGS for use in your Makefile.am files.

When they said MYAPP, I wasn't sure if they literally meant "MYAPP" or the name of my application, which is firstwindow.  I tried the latter.
Now, are they say I need to put something in my Makefile.am as well?
I tried putting the lines firstwindow_LIBS and firstwindow_CFLAGS in there and it wouldn't even let me do make, just gave an error about separators. 
So I think I'm just missing some general concept here.... could anyone enlighten me? Because I'm still not very familiar with make files...


"You can't just ask to borrow somebody else's lampshade. It's AWKWARD!"

Offline

#3 2008-02-06 20:40:36

e_tank
Member
Registered: 2006-12-21
Posts: 80

Re: aclocal gives warning with my configure.ac, did something wrong?

autoconf and automake are used to generate configure scripts and makefiles which can help to ensure that your program will build properly on a variety of platforms.  however, imo for most small or personal projects it's overkill as you'll probably only need a very basic makefile.
here's an example makefile based on the one given in the gtk faq that you can use for a gtkmm project, just put your source files on the sources line and the name of the executable file on the package line.
use make to compile, and make clean to easily remove the created files
NOTE: each command in the makefile must be preceded by a tab, not spaces

# basic GTK+ app makefile
SOURCES = myprg.cpp foo.cpp bar.cpp
OBJS    = ${SOURCES:.cpp=.o}
CFLAGS  = `pkg-config gtkmm-2.4 --cflags`
LDADD   = `pkg-config gtkmm-2.4 --libs`
CC      = gcc
CPP    = g++
PACKAGE = myprg

all : ${OBJS}
    ${CPP} -o ${PACKAGE} ${OBJS} ${LDADD}

.c.o:
    ${CPP} ${CFLAGS} -c $<

clean:
    rm -f ${OBJS} ${PACKAGE}

# end of file

Offline

Board footer

Powered by FluxBB