Subject: bug#8520: Missing glibconfig.h when compiling emacs-23-3 in Ubuntu 11.04 beta 2

From: William Bligh <[email-masked]>
Date: Mon, 18 Apr 2011 15:40:50 +0200

$ ./configure --with-x-toolkit=gtk
...
$ make

Gives this error:

gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I.
-I/home/jesper/Downloads/emacs-23.3/src -D_BSD_SOURCE -pthread
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/1
-linux-gnu/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/libpng12 -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/include/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1
-I/usr/include/freetype2     -g -O2 -Wdeclaration-after-statement
-Wno-pointer-sign   -MMD -MF deps/dispnew.d dispnew.c
In file included from /usr/include/glib-2.0/glib/galloca.h:34:0,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /usr/include/glib-2.0/gio/gioenums.h:30,
                 from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from xterm.h:44,
                 from dispnew.c:56:
/usr/include/glib-2.0/glib/gtypes.h:34:24: fatal error: glibconfig.h:
No such file or directory
compilation terminated.
make[1]: *** [dispnew.o] Error 1
make[1]: Leaving directory `/home/jesper/Downloads/emacs-23.3/src'
make: *** [src] Error 2

However, glibconfig.h is on my system:

$ locate glibconfig.h
/usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h

and pkg-config gives the correct location

$ pkg-config --cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include

Somehow the cflags doesn't get propagated correctly to the Makefile in src/

Not an autotools expert, so I have no idea how to fix this.