Having tests for your projects is nice (others consider it as necessary, but that's not part of this post). Well, as with many brand new projects, people get suggested to use the trunk version as in subversion. This brought me to a really annoying problem: People were complaining about a missing macro (which was AM_PATH_CHECK). Of couse, I could argue now whether a developer should have this installed, but I came to the conclusion that I shouldn't imply any piece of installed software that's not absolutely necessary to build.
Fortunately the people are Ubuntu users, so the solution for them was quite easy (apt-get install check). But I was thinking about doing this a bit more cleverly. Ubuntu currently delivers check 0.9.3, version 0.9.4 includes check.pc, which is nice but unusable for me (Ubuntu Edgy, Feisty already has this). So, finally I started to improve my m4 skills and provide some code (that you're free to copy) that works as it should:
PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[
ifdef([AM_PATH_CHECK],
[AM_PATH_CHECK],
[AC_MSG_RESULT([no, testing is disabled])])
])
AM_CONDITIONAL([HAVE_CHECK],[test "x$CHECK_CFLAGS" != "x"])
You might want to replace the second AM_PATH_CHECK with AM_PATH_CHECK([0.8.2]) or your required version.