1 Hack the configure.in file to add a "none" gdktarget which removes
2 dependencies on graphic backends such as X.org or DirectFB. Gtk does
3 not fully build in this mode, but it builds sufficiently to build the
4 host tools that are needed to build the target Gtk.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
12 Index: 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
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)
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.]);;
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])
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])
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.
51 if test "x$cairo_backend" = "xx11"; then
54 -PKG_CHECK_MODULES(CAIRO_BACKEND,
55 - [cairo-$cairo_backend >= cairo_required_version])
57 +if test "x$gdktarget" != "xnone"; then
58 + PKG_CHECK_MODULES(CAIRO_BACKEND,
59 + [cairo-$cairo_backend >= cairo_required_version])
62 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
65 AM_CONDITIONAL(USE_DIRECTFB, false)
68 +if test "x$gdktarget" != "xnone"; then
70 # Check for Pango flags
73 GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend"
76 +fi # gdktarget != none
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"
82 AC_SUBST(GDK_DEP_LIBS)
83 AC_SUBST(GDK_DEP_CFLAGS)
85 +if test "x$gdktarget" != "xnone"; then
87 ########################################
88 # Check for Accessibility Toolkit flags
89 @@ -1372,6 +1384,10 @@
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
97 if test "x$gdktarget" = "xx11"; then
98 GTK_PACKAGES="$GTK_PACKAGES pangoft2"
100 @@ -1533,6 +1549,8 @@
101 gtk_save_cppflags="$CPPFLAGS"
102 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
104 +if test "x$gdktarget" != "xnone"; then
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.]))
113 +fi # gdktarget != none
115 CPPFLAGS="$gtk_save_cppflags"