1Hack the configure.in file to add a "none" gdktarget which removes 2dependencies on graphic backends such as X.org or DirectFB. Gtk does 3not fully build in this mode, but it builds sufficiently to build the 4host tools that are needed to build the target Gtk. 5 6Changes: 7 Ported to 2.24.18 8 9Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 10Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> 11--- 12Index: libgtk2-2.24.18/configure.ac 13=================================================================== 14--- libgtk2-2.24.18.orig/configure.ac 2013-05-13 07:02:44.000000000 -0500 15+++ libgtk2-2.24.18/configure.ac 2013-05-27 02:12:09.947030335 -0500 16@@ -258,12 +258,12 @@ 17 gdktarget=x11 18 fi 19 20-AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target], 21+AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/directfb/none]] select non-default GDK target], 22 gdktarget=$with_gdktarget) 23 24 AC_SUBST(gdktarget) 25 case $gdktarget in 26- x11|win32|quartz|directfb) ;; 27+ x11|win32|quartz|directfb|none) ;; 28 *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);; 29 esac 30 31@@ -372,11 +373,15 @@ 32 ## annoying to construct 33 PKG_CHECK_MODULES(BASE_DEPENDENCIES, 34 [glib-2.0 >= glib_required_version dnl 35- atk >= atk_required_version dnl 36- pango >= pango_required_version dnl 37- cairo >= cairo_required_version dnl 38 gdk-pixbuf-2.0 >= gdk_pixbuf_required_version]) 39 40+if test "x$gdktarget" != "xnone"; then 41+ PKG_CHECK_MODULES(BASE_DEPENDENCIES, 42+ [atk >= atk_required_version dnl 43+ pango >= pango_required_version dnl 44+ cairo >= cairo_required_version]) 45+fi 46+ 47 ## In addition to checking that cairo is present, we also need to 48 ## check that the correct cairo backend is there. E.g. if the GDK 49 ## target is win32 we need the cairo-win32 backend and so on. 50@@ -387,8 +392,11 @@ 51 if test "x$cairo_backend" = "xx11"; then 52 cairo_backend=xlib 53 fi 54-PKG_CHECK_MODULES(CAIRO_BACKEND, 55- [cairo-$cairo_backend >= cairo_required_version]) 56+ 57+if test "x$gdktarget" != "xnone"; then 58+ PKG_CHECK_MODULES(CAIRO_BACKEND, 59+ [cairo-$cairo_backend >= cairo_required_version]) 60+fi 61 62 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0]) 63 64@@ -1279,6 +1287,7 @@ 65 AM_CONDITIONAL(USE_DIRECTFB, false) 66 fi 67 68+if test "x$gdktarget" != "xnone"; then 69 70 # Check for Pango flags 71 72@@ -1324,6 +1333,8 @@ 73 GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend" 74 fi 75 76+fi # gdktarget != none 77+ 78 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES` $MATH_LIB" 79 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS" 80 # 81@@ -1341,6 +1352,7 @@ 82 AC_SUBST(GDK_DEP_LIBS) 83 AC_SUBST(GDK_DEP_CFLAGS) 84 85+if test "x$gdktarget" != "xnone"; then 86 87 ######################################## 88 # Check for Accessibility Toolkit flags 89@@ -1372,6 +1384,10 @@ 90 fi 91 92 GTK_PACKAGES="atk cairo gdk-pixbuf-2.0 gio-2.0" 93+else # gdktarget != none 94+GTK_PACKAGES="gdk-pixbuf-2.0" 95+fi # gdktarget != none 96+ 97 if test "x$gdktarget" = "xx11"; then 98 GTK_PACKAGES="$GTK_PACKAGES pangoft2" 99 fi 100@@ -1533,6 +1549,8 @@ 101 gtk_save_cppflags="$CPPFLAGS" 102 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS" 103 104+if test "x$gdktarget" != "xnone"; then 105+ 106 AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([ 107 *** Can't find cairo-pdf.h. You must build Cairo with the pdf 108 *** backend enabled.])) 109@@ -1547,6 +1565,8 @@ 110 *** svg backend enabled.])) 111 fi 112 113+fi # gdktarget != none 114+ 115 CPPFLAGS="$gtk_save_cppflags" 116 117 118