9

I encounter such errors when trying to build libnice-0.1.10. For solution, I am following possibly undefined macro: AC_MSG_ERROR, but still not getting there.

some program version

uname: 3.5.0-23-generic
m4: 1.4.16
automake: 1.14.1
autoconf: 2.69
libtoolize: 2.4.2

I also add ACLOCAL_FLAGS="-I /.../share/aclocal" in ~/.bashrc.

Here is what is reported from autogen.sh.

$ ./autogen.sh
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:331: the top level
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:331: the top level
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:331: the top level
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:331: the top level
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:331: the top level
configure.ac:331: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:331: the top level
configure.ac:105: error: possibly undefined macro: AS_IF
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:218: error: possibly undefined macro: AC_MSG_ERROR
autoreconf: /opt/oblong/deps-64-10/bin/autoconf failed with exit status: 1

Thanks a lot for the help!

pevik
  • 4,523
  • 3
  • 33
  • 44
user180574
  • 5,681
  • 13
  • 53
  • 94
  • 2
    Do you have [`pkg-config`](http://www.freedesktop.org/wiki/Software/pkg-config/) installed? See if: `/.../share/aclocal/pkg.m4` exists. It shouldn't be necessary to set `ACLOCAL_INCLUDE` - that directory is already part of autoconf - and it might prevent searching in the libnice `m4` directories. – Brett Hale Feb 18 '15 at 08:26

2 Answers2

18

This just means you're missing pkg-config (or perhaps you have an old version). Just download and install.

CpnCrunch
  • 4,831
  • 1
  • 33
  • 31
  • 1
    I made sure that pkg-config is installed and I have /usr/share/aclocal/pkg.m4 on my system. I still got an error when using the following: ACX_PTHREAD([AC_DEFINE([HAVE_PTHREAD] ...). The error is configure.ac:31: error: possibly undefined macro: AC_DEFINE. If this token and others are legitimate, please use m4_pattern_allow. So there are possible other causes. – Kemin Zhou Dec 24 '16 at 20:01
  • You should detail the troubleshooting steps that results in the conclusion `pkg-config` is the problem. – jww Jan 04 '18 at 11:05
1

You might be missing the autoconf-archive collection of macros (AC_MSG_ERROR is one of those macros included in this package)

Run autoreconf -vi then run ./configure and the actual error will be shown on the screen.

anthony shaw
  • 133
  • 11