Adventures with autotools

I’ve used and otherwise benefited from autotools a number of times in the past – being able to just ./configure && make && make install a large number of open source projects is hugely beneficial – but I’ve never actually ./configured (heh) one of my own projects to use them. Well…I decided to go down that path today.

The project – svgcal (link coming soon!) – is a little tool I’m throwing together to parse an input file and generate a (hopefully) pretty SVG file that displays my weekly agenda. I’m not too far along, so right now it’s just a couple of files – sources for the lexer and parser and a couple of header files – so I thought it would be good to go ahead and get autotools set up before it got much more complex than that. So, what did I have to do? Just a handful of steps:

  1. Create a couple of files for autoreconf to use (,, and src/ – listings below)
  2. Run autoreconf --install
  3. Tweak my lexer (autotools muck about with how the parser header file gets created; was an easy fix: s/
  4. Add the generated files to source control
  5. …and that’s it!
My project is now all set up to be built using ./configure and make without me doing any additional work. Awesome!

dist_doc_DATA = README

AC_INIT([svgcal], [0.1], [])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# programs needed


bin_PROGRAMS = parser
parser_SOURCES = svgcal.c parser.y lexer.l


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s