GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 23, 2014 8:43 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Autotools?
PostPosted: Tue Jul 17, 2012 11:51 pm 
Offline
Familiar Face

Joined: Sat Jun 23, 2012 1:36 pm
Posts: 5
My current GTK+ project is using a custom Makefile at the moment, but I'd like to eventually switch over to autotools (which I've never used).

There is this tutorial for using autotools with a GTK+ project. The source structure in this tutorial is the simplest possible, but I'm wondering how it translates for a more complicated structure. For example, if I have something like this...

program.h
program.c (includes extra.h, gui.h, lists.h, contains main function)
extra.h
extra.c
gui.h
gui.c (includes extra.h)
lists.h
lists.c

...can I just follow the same steps as outlined in the tutorial and I'm done? Or are there extra steps I need to carry out in order to define my source structure?


Top
 Profile  
 
 Post subject: Re: Autotools?
PostPosted: Wed Jul 18, 2012 11:47 am 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hello and welcome to the GTK+ forums!

I quickly glimpsed at the tutorial you linked and I think you should be OK by simply following the steps described there. Move your sources under src folder and that's basically it.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: Autotools?
PostPosted: Mon Aug 06, 2012 11:35 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Yes the tutorial is unfortunately very simple and doesn't really explain the why behind each macro.
The manuals for the autotools are unfortunately not too good for the learner. There seems to be a wealth of documentation targeted at the beginner and advanced user, but a gaping hole in the middle where everyone has to pretty much figure things out on their own.
The tutorial makes two programs from one c file each whereas you want one program from multiple c files. in which case you will only have the one _PROGRAMS macro which is followed by a whitespace delimited list of your c files and headers.
This'll get you started but there's a lot more that the autotools do that makes life easier provided you can find somewhere that explains it. Some of the macros in this tutorial are really dated (even for writing at the time of gtk+2.10) and there is much better ways of organising your project. pkgconfig provides an excellent interface for dependency checking and at some point you will probably want to add gnome documentation support, provide instructions for accessing the files through the desktop menus and possibly have runtime translations of your buttons etc. Your best best is to have a look at some examples done by others. They most likely will not do things the best way or sometimes be downright wrong (my stuff included: https://github.com/pchilds) but you should be able to pick up common themes which are hopefully good practice rather than not.


Top
 Profile  
 
 Post subject: Re: Autotools?
PostPosted: Wed Aug 15, 2012 12:28 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
I never got this finished, but, I did make good progress on an Autotools Tutorial for Python and GTK+. It's geared towards Python/GTK+ but does a pretty good job of explaining things in depth and includes application icons and the Desktop Entry. Should be relatively easy to adapt to C (just leave out the Python bits).

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group