How to fix the `AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd`


Problem

When trying to compile OpenITG I ran across this cryptic warning:

configure.ac:208: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
autoconf/m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
autoconf/m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
autoconf/m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:208: the top level
configure.ac:208: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
configure.ac:208: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
autoconf/m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
autoconf/m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
autoconf/m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:208: the top level
configure.ac:208: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
configure:9482: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:9483: error: possibly undefined macro: AC_LIB_RPATH
configure:9488: error: possibly undefined macro: AC_LIB_LINKFLAGS_BODY
configure:9496: error: possibly undefined macro: AC_LIB_APPENDTOVAR
configure.ac:208: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
autoconf/m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
autoconf/m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
autoconf/m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:208: the top level
configure.ac:208: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
configure.ac:208: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
autoconf/m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
autoconf/m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
autoconf/m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:208: the top level
configure.ac:208: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd

which caused subsequent ./configure to fail.

Solution

After bit of googling, I found out the solution:

Install “gettext” package

Couldn’t be more simple, huh? But google wasn’t that helpful at first.

What got me going was this gentoo bug report. So, thank you, Gentoo developers.