Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
autoconf + automake + gtk2 = massive headache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
KingOfMalkier
n00b
n00b


Joined: 03 Apr 2003
Posts: 47

PostPosted: Sat May 10, 2003 4:28 am    Post subject: autoconf + automake + gtk2 = massive headache Reply with quote

So, I've been tooling around with gtk2 and I've got a gui all built in c++, it doesn't do anything yet, but it looks nice. :lol: I decided that now would be a good time to learn autoconf and automake, get nice professional looking builds and whatnot. It's proving to be quite difficult. I made it work on a simple 9 line "hello world" program, but when I tried on my gtk2 project, stuff goes wrong. It appears that it isn't using the gtk compile flags (can't find gtkmm/main.h, tons of undeclared type and parse errors), but I'm not sure how to let autoconf and automake know I need gtk. I've tried looking through the documentation, but it's thoroughly overwhelming. If anyone has used these things and gtk I'd love to hear any tips.
Back to top
View user's profile Send private message
KingOfMalkier
n00b
n00b


Joined: 03 Apr 2003
Posts: 47

PostPosted: Sat May 10, 2003 6:01 pm    Post subject: Reply with quote

Aha! Solved it!
I found this when I was looking at some stuff glade generated (I use it for experimenting with different layouts).
In configure.ac
Code:

pkg_module="gtkmm-2.0 >= 2.0.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

In Makefile.am
Code:

SUBDIRS = src

In src/Makefile.am
Code:

INCLUDES = \
          -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
          -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
          @PACKAGE_CFLAGS@

gclisp_LDADD = @PACKAGE_LIBS@



This assumes the project is named gclisp and the source files are all in a subdirectory src. I also used gtkmm instead of normal gtk, but I'm sure you just need to change the one line pkg_module"...".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum