error: possibly undefined macro: AM_PATH_GTK_2_0

I am trying to compile GIMP git on Ubuntu-MATE 17.10:

Here is what I get:

I am testing that you have the tools required to build the
GNU Image Manipulation Program from git. This test is not foolproof,
so if anything goes wrong, see the file HACKING for more information...

checking for libtool >= 1.5 ... Major version might be too new (2.4.6)
checking for gtkdocize ... yes
checking for autoconf >= 2.54 ... yes (version 2.69)
checking for automake >= 1.13.0 ... yes (version 1.15)
checking for intltool >= 0.40.1 ... yes (version 0.51.0)
checking for xsltproc ... yes

I am going to run ./configure with the following arguments:

   

If you wish to pass additional arguments, please specify them 
on the ./autogen.sh command line or set the AUTOGEN_CONFIGURE_ARGS 
environment variable.


WARNING: aclocal's directory is /usr/share/aclocal, but...
         no file /usr/share/aclocal/glib-2.0.m4
         You may see fatal macro warnings below.
         If these files are installed in /some/dir, set the 
         ACLOCAL_FLAGS environment variable to "-I /some/dir"
         or install /usr/share/aclocal/glib-2.0.m4.


WARNING: aclocal's directory is /usr/share/aclocal, but...
         no file /usr/share/aclocal/glib-gettext.m4
         You may see fatal macro warnings below.
         If these files are installed in /some/dir, set the 
         ACLOCAL_FLAGS environment variable to "-I /some/dir"
         or install /usr/share/aclocal/glib-gettext.m4.


WARNING: aclocal's directory is /usr/share/aclocal, but...
         no file /usr/share/aclocal/gtk-2.0.m4
         You may see fatal macro warnings below.
         If these files are installed in /some/dir, set the 
         ACLOCAL_FLAGS environment variable to "-I /some/dir"
         or install /usr/share/aclocal/gtk-2.0.m4.

configure.ac:590: warning: macro 'AM_GLIB_GNU_GETTEXT' not found in library
configure.ac:663: warning: macro 'AM_PATH_GLIB_2_0' not found in library
configure.ac:745: warning: macro 'AM_PATH_GTK_2_0' not found in library
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: linking file 'm4macros/libtool.m4'
libtoolize: linking file 'm4macros/ltoptions.m4'
libtoolize: linking file 'm4macros/ltsugar.m4'
libtoolize: linking file 'm4macros/ltversion.m4'
libtoolize: linking file 'm4macros/lt~obsolete.m4'
configure.ac:228: installing './compile'
configure.ac:93: installing './missing'
app/Makefile.am: installing './depcomp'
configure.ac:600: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:677: error: possibly undefined macro: AM_PATH_GLIB_2_0
configure.ac:759: error: possibly undefined macro: AM_PATH_GTK_2_0

Any ideas how to fix this?

For Debian the missing files come with package ‘libglib2.0-dev-bin’. Dunno if that is true for your version of Ubuntu.

On my Ubuntu system, libglib2.0-dev-bin (2.54.1-1ubuntu1) is already installed. It may be something else on Ubuntu…

I would check directory ‘/usr/share/aclocal’ for the presence of files ‘glib-2.0.m4’ , ‘glib-gettext.m4’ and ‘gtk-2.0.m4’.
If the files are NOT there, try reinstalling packages ‘libglib2.0-dev-bin’ and ‘libgtk2.0-dev’.
If the files are there, let us know which version of GIMP you are trying to recompile, from what sources and using which procedure.

1 Like

Thanks,

The files are there.

I think I found the solution:

SImply add

ACLOCAL='aclocal -I /gtk/share/aclocal'

before ./autogen.sh in gimp folder:

ACLOCAL='aclocal -I /gtk/share/aclocal' ./autogen.sh

the error seems to go away.

Thanks, once again! I had now the same problem ‘‘macro ‘AM_PATH_GTK_3_0’ not found in library’’ and, as you suggested to check, the file glib-3.0.m4 was missing in the ‘/usr/share/aclocal’ directory.

Solved it by installing libgtk-3-dev. Now the file ‘glib-3.0.m4’ is in the folder ‘/usr/share/aclocal’, and this particular error is gone!