29 Mar 2009 robertc   » (Master)

This has irritated me for a while in configure.ac. You've probably seen this pattern before:


AC_INIT([foo], [0.0.1])
MAJOR=0
MINOR=0
MICRO=1
MY_VERSION=$MAJOR.$MINOR.$MICRO
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(MICRO)
AC_SUBST(MY_VERSION)

I finally hit my annoyance threshold for this, and the answer is pretty obvious. (If its not, or you think there is a simpler one, give it a shot - I'd like something more pithy).


AC_DEFUN([MAJOR], [0])
AC_DEFUN([MINOR], [0])
AC_DEFUN([MICRO], [1])
AC_DEFUN([MY_VERSION], [MAJOR.MINOR.MICRO])
AC_INIT([foo], [MY_VERSION])
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(MICRO)
AC_SUBST(MY_VERSION)

Its not a big deal to be duplicating version numbers, but not duplicating at all is nicer.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!