views:

23

answers:

2

I'm trying to use autotools for the first time as a developer, so excuse any noobishness.

I'm using the Check unit testing library which defines the macro AM_PATH_CHECK in check.m4, which was installed in /usr/local/share/aclocal. I managed to get aclocal to recognize AM_PATH_CHECK by editing /usr/share/aclocal/dirlist to include /usr/local/share/aclocal.

So aclocal runs and returns cleanly (without any additional arguments).

However, when I run autoreconf --install, I get the error

configure.ac:36: error: possibly undefined macro: AM_PATH_CHECK
      If this token and others are legitimate, please use m4_pattern_allow
      See the Autoconf documentation
autoreconf: /usr/local/bin/autoconf failed with exit status: 1

What am I doing wrong? How should I let autoreconf know of the existence of AM_PATH_LOCAL?

+1  A: 

Sounds like Check is installing itself incorrectly. You should file a bug there. What you can do to work around this problem is to add

AC_CONFIG_MACRO_DIR([m4])

to configure.ac, and add

ACLOCAL_AMFLAGS += -I m4

to Makefile.am, and then copy check.m4 to the m4 directory that will be created in your project's root directory.

ptomato
Check may be the issue. I tried your fix, and got the same error though.
rampion
You may also have to add `-I m4` to your autoreconf command.
ptomato
@ptomato: Nope, that didn't do it. Thanks, though.
rampion
Then I'm mystified.
ptomato
Well, +1 for trying to help.
rampion
A: 

I had one of my peers help me out, and we discovered that the problem was that pkg-config wasn't installed. (Evidently, not part of OSX's XCode tools).

I'm not sure who to file a bug with about this - should Check be checking for pkg-confg when it installs? Should autoconf? Or is it so bog-standard that I should complain to the XCode tools people?

rampion