Bug 469

Summary: build of libgtk2 for host incorrectly assumes that X.org development files are installed
Product: buildroot Reporter: Thomas Petazzoni <thomas.petazzoni>
Component: OtherAssignee: Peter Korsgaard <jacmet>
Status: RESOLVED FIXED    
Severity: critical CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Thomas Petazzoni 2009-07-17 15:56:28 UTC
When building libgtk2 for the host, I get a failure :

 /usr/bin/gcc -I/home/thomas/local/buildroot-test/build_arm/host_dir/include -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DGDK_PIXBUF_DISABLE_DEPRECATED -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -pthread -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include/glib-2.0 -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/lib/glib-2.0/include -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include/pango-1.0 -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include/cairo -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include/freetype2 -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include/pixman-1 -I/home/thomas/local/buildroot-test/build_arm/host_dir/include -I/home/thomas/local/buildroot-test/build_arm/host_dir/usr/include -Wall -MT gdkasync.lo -MD -MP -MF .deps/gdkasync.Tpo -c gdkasync.c  -fPIC -DPIC -o .libs/gdkasync.o
In file included from gdkprivate-x11.h:36,
                 from gdkx.h:81,
                 from gdkasync.c:52:
../../gdk/x11/gdkwindow-x11.h:33:36: error: X11/extensions/Xdamage.h: No such file or directory
make[5]: *** [gdkasync.lo] Error 1

This is because libxdamage-dev is not installed on my system. The rest of the compilation works because some other X.org development files are installed on my system. But that's just pure coincidence.

With this build of libgtk2 for the host, the X.org development files basically became a requirement for Buildroot to work properly, which is a shame.

Also, building gtk2 twice (once for the host, once for the target) takes a lot of time. And the build for the host is done only for a few command line tools.

Isn't it possible to improve all this ?
Comment 1 Peter Korsgaard 2009-07-17 23:00:50 UTC
(In reply to comment #0)
> This is because libxdamage-dev is not installed on my system. The rest of the
> compilation works because some other X.org development files are installed on
> my system. But that's just pure coincidence.
> 
> With this build of libgtk2 for the host, the X.org development files basically
> became a requirement for Buildroot to work properly, which is a shame.
> 
> Also, building gtk2 twice (once for the host, once for the target) takes a lot
> of time. And the build for the host is done only for a few command line tools.
> 
> Isn't it possible to improve all this ?

Well, the question is how. The gtk buildsystem afaik needs gtk-update-icon-cache / gdk-pixbuf-csource, so we either depend on the user having the gtk development package installed on the host (in a compatible version), compile it ourselves (either including the X dependencies or require those packages on the host) or hack the gtk buildsystem to not use those programs / only compile those programs and not all of GTK.

The third option sounds nice, but I won't have time to work on it in the near future. It also won't help if we in the future will need to build something else for the host, which needs gtk.

Further discussion should probably better move to the mailing list though. 

Comment 2 Sven Neumann 2009-07-17 23:55:15 UTC
Neither gtk-update-icon-cache nor gdk-pixbuf-csource have a dependency on GDK. It should be possible to build them without building GDK, let alone GTK+. All you need is gdk-pixbuf. I suggest that you add options to the GTK+ build system to allow building just gdk-pixbuf and these two tools. This change does not belong into buildroot though, it should be submitted against upstream GTK+.
Comment 3 Thomas Petazzoni 2010-02-21 17:50:55 UTC
I've submitted today a patch to fix this:
 http://lists.busybox.net/pipermail/buildroot/2010-February/032129.html

However, the patch and solution is not clean enough to be submitted to the Gtk project.