Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

autoconf error on ubuntu 11.04

i've been googling and installing libraries for a while, but I couldn't quite handle this problem with autoconf.

i have downloaded a program that i want to compile, made a few changes, and need to run autogen.sh and ./configure and make install respectively.

however, when i try to run autogen.sh, i get the following error;

configure.ac:225: error: possibly undefined macro: AM_PATH_GTK_2_0
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

so i went on, downloaded autoconf-2.68, automake-1.11, m4-1.4.16, and tried sudo apt-get install libgtk2.0-dev, none of which changed the outcome. when i try aclocal, i again get the error

configure.ac:225: warning: macro `AM_PATH_GTK_2_0' not found in library

i'm currently stuck, and got nowhere to go. so i'd be glad for any suggestion.

like image 881
fizboz Avatar asked Oct 18 '11 10:10

fizboz


2 Answers

I know it's a bit late, but you just have to install the library libgtk2.0-dev:

sudo apt-get install libgtk2.0-dev

If you get errors about something related to GLIB, then install libglib2.0-dev as well:

sudo apt-get install libglib2.0-dev
like image 80
Addison Montgomery Avatar answered Nov 08 '22 00:11

Addison Montgomery


Given the name AM_PATH_GTK_2_0, one makes the following sequence of observations: 1) "AM_" is in automake's namespace, so that m4 macro must come from automake. 2) Hmmm, it isn't in automake. 3) It probably comes from gtk, so the gtk developer's have made an error in naming their m4 macro in conflict with automake. That's a bug in gtk, but I'll probably need to download the newest version of gtk to get the macro.

The problem is that you don't have the m4 macro that gtk expects you to have. You probably need to install libgtk-devel (or something like that). If I am correct and libgtk is indeed installing an m4 macro named AM_..., please report that as a bug to the developers. They are stomping on automakes' namespace (this is, unfortunately, an extremely common error.)

Since you mention downloading automake, I think the problem is that you are running aclocal that is not looking in /usr/share/aclocal, but in a different location (ie, you installed automake in /usr/local) When you installed libgtk-dev, it probably installed the *.m4 file in /usr/share/aclocal, but you need that file in /usr/local/share/aclocal (or $prefix/share/aclocal, where prefix is what you used to install automake.) The simplest solution is to copy that file to $(aclocal --print) That is, run "aclocal --print" to see where aclocal is looking for m4 files, then find the file that libgtk-dev installed that defines the improperly named m4 macro and copy that file to the appropriate location. Alternatively (and probably a better solution) you can put a file named dirlist in $(aclocal --print) that contains the single line "/usr/share/aclocal", so that your hand installed aclocal will always look for m4 files that are installed in /usr/share.

like image 38
William Pursell Avatar answered Nov 08 '22 01:11

William Pursell