Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to compile the tmux that has iTerm2 support.

This is the error I get: error: possibly undefined macro: AC_SEARCH_LIBS
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1
autoreconf failed

The website says:

If you get an error like "undefined macro: AC_SEARCH_LIBS", run this: echo $(brew --prefix)/share/aclocal | sudo tee -a /usr/share/aclocal/dirlist

Even though I've ran that command (as root), I still have the same results. This is the result of that command:


I think the permissions of /usr/share/aclocal/dirlist shouldn't be a problem:

$ ls -lah /usr/share/aclocal
total 8
drwxr-xr-x   5 root  wheel   170B May  6 20:20 .
drwxr-xr-x  69 root  wheel   2.3K Mar 12 03:18 ..
-rw-r--r--   1 root  wheel    69B May  6 20:54 dirlist
-rw-r--r--   1 root  wheel   7.7K Mar  3 20:57 libxml.m4
-rw-r--r--   1 root  wheel   7.9K Mar  3 20:57 libxslt.m4

aclocal, automake and autoconf are all in /usr/local/bin/, and I've tried installing them through homebrew and I also tried compiling and installing them myself. I always have the same results.


share|improve this question
What's the content of the /usr/share/aclocal/dirlist file? – Daniel Beck Jun 10 '12 at 20:16
/usr/local/share/aclocal, /usr/share/aclocal, /usr/local/share/aclocal. replace ", " with newlines. – orryowr Jun 12 '12 at 2:56

I got this after upgrading OS X. It was fixed with: brew reinstall pkg-config

share|improve this answer
This is the correct solution. Autoconf’s error message is misleading; the problem is not the use of AC_SEARCH_LIBS, but that of PKG_CHECK_MODULES immediately afterwards. This macro is provided by pkgconfig. – Lawrence Velázquez Jun 11 '15 at 3:40

For those running into this issue on a mac using macports rather than homebrew the suggestion to run:

 echo $(brew --prefix)/share/aclocal | sudo tee -a /usr/share/aclocal/dirlist

Has the following equivalent:

Ensure that /usr/share/aclocal/dirlist contains the line /opt/local/share/aclocal (this is where macports puts macros):

echo "/opt/local/share/aclocal" | sudo tee -a /usr/share/aclocal/dirlist
share|improve this answer
I don’t know if this was ever necessary with MacPorts’ automake, but it definitely isn’t necessary now. /opt/local/share/aclocal is in aclocal’s default system includes list. – Lawrence Velázquez Jun 11 '15 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .