summaryrefslogtreecommitdiffstats
path: root/package/libgtk2/libgtk2-reduce-dependencies.patch
blob: 5bb9db9a06e2ec2f2e1294683a1422ff28c88232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Hack the configure.in file to add a "none" gdktarget which removes
dependencies on graphic backends such as X.org or DirectFB. Gtk does
not fully build in this mode, but it builds sufficiently to build the
host tools that are needed to build the target Gtk.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 configure.in |   34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

Index: b/configure.in
===================================================================
--- a/configure.in
+++ b/configure.in
@@ -259,12 +259,12 @@
   gdktarget=x11
 fi
 
-AC_ARG_WITH(gdktarget, [  --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target],
+AC_ARG_WITH(gdktarget, [  --with-gdktarget=[[x11/win32/quartz/directfb/none]] select non-default GDK target],
 	gdktarget=$with_gdktarget)
 
 AC_SUBST(gdktarget)
 case $gdktarget in
-  x11|win32|quartz|directfb) ;;
+  x11|win32|quartz|directfb|none) ;;
   *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);;
 esac
 
@@ -374,11 +374,15 @@
 ## annoying to construct
 PKG_CHECK_MODULES(BASE_DEPENDENCIES,
   [glib-2.0 >= glib_required_version dnl
-   atk >= atk_required_version dnl
-   pango >= pango_required_version dnl
-   cairo >= cairo_required_version dnl
    gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
 
+if test "x$gdktarget" != "xnone"; then
+   PKG_CHECK_MODULES(BASE_DEPENDENCIES,
+	[atk >= atk_required_version dnl
+	 pango >= pango_required_version dnl
+	 cairo >= cairo_required_version])
+fi
+
 ## In addition to checking that cairo is present, we also need to
 ## check that the correct cairo backend is there. E.g. if the GDK
 ## target is win32 we need the cairo-win32 backend and so on.
@@ -389,8 +393,11 @@
 if test "x$cairo_backend" = "xx11"; then
    cairo_backend=xlib
 fi
-PKG_CHECK_MODULES(CAIRO_BACKEND,
-  [cairo-$cairo_backend >= cairo_required_version])
+
+if test "x$gdktarget" != "xnone"; then
+   PKG_CHECK_MODULES(CAIRO_BACKEND,
+	[cairo-$cairo_backend >= cairo_required_version])
+fi
 
 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
 
@@ -1281,6 +1288,7 @@
   AM_CONDITIONAL(USE_DIRECTFB, false)
 fi
 
+if test "x$gdktarget" != "xnone"; then
 
 # Check for Pango flags
 
@@ -1326,6 +1334,8 @@
   GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend"
 fi
 
+fi # gdktarget != none
+
 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES` $MATH_LIB"
 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
 #
@@ -1344,6 +1354,8 @@
 AC_SUBST(GDK_DEP_CFLAGS)
 
 
+if test "x$gdktarget" != "xnone"; then
+
 ########################################
 # Check for Accessibility Toolkit flags
 ########################################
@@ -1374,6 +1386,10 @@
 fi
 
 GTK_PACKAGES="atk cairo gdk-pixbuf-2.0 gio-2.0"
+else # gdktarget != none
+GTK_PACKAGES="gdk-pixbuf-2.0"
+fi # gdktarget != none
+
 if test "x$gdktarget" = "xx11"; then
   GTK_PACKAGES="$GTK_PACKAGES pangoft2"
 fi
@@ -1529,6 +1545,8 @@
 gtk_save_cppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
 
+if test "x$gdktarget" != "xnone"; then
+
 AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
 *** Can't find cairo-pdf.h. You must build Cairo with the pdf
 *** backend enabled.]))
@@ -1543,6 +1561,8 @@
 *** svg backend enabled.]))
 fi   
 
+fi # gdktarget != none
+
 CPPFLAGS="$gtk_save_cppflags"
      
 			  	
OpenPOWER on IntegriCloud