Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

configure.ac: Support multiple GDK backends in one build

  • Loading branch information...
commit cacee7e7a380ac9009fc1339a860f563ebe4dc4d 1 parent ae7e5fc
Kristian Høgsberg krh authored
4 Makefile.am
@@ -71,8 +71,8 @@ gtk+-*-3.0-uninstalled.pc: gtk+-3.0-uninstalled.pc
71 71 pkgconfigdir = $(libdir)/pkgconfig
72 72 pkgconfig_DATA = gdk-3.0.pc gtk+-3.0.pc gail-3.0.pc
73 73
74   -pkgconfig_DATA += $(patsubst %,gtk+-%-3.0.pc,@gdktarget@)
75   -pkgconfig_DATA += $(patsubst %,gdk-%-3.0.pc,@gdktarget@)
  74 +pkgconfig_DATA += ${GDK_BACKENDS:%=gtk+-%-3.0.pc}
  75 +pkgconfig_DATA += ${GDK_BACKENDS:%=gdk-%-3.0.pc}
76 76
77 77 if OS_UNIX
78 78 pkgconfig_DATA += gtk+-unix-print-3.0.pc
10 Makefile.decl
@@ -17,9 +17,15 @@ XIDS = 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 \
17 17 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 \
18 18 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 \
19 19 9995 9996 9997 9998 9999
  20 +
  21 +if USE_X11
  22 +SKIP_GDKTARGET = \
  23 + false
  24 +else
20 25 SKIP_GDKTARGET = \
21   - test "$(gdktarget)" != "x11" \
22   - && echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
  26 + echo "Gtk+Tests:INFO: Skipping GUI tests for non-X11 target."
  27 +endif
  28 +
23 29 XVFB_START = \
24 30 ${XVFB} -help 2>/dev/null 1>&2 \
25 31 && XID=`for id in $(XIDS) ; do test -e /tmp/.X$$id-lock || { echo $$id; exit 0; }; done; exit 1` \
2  README.win32
@@ -85,7 +85,7 @@ LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \
85 85 LIBS=-lintl \
86 86 CFLAGS=-O2 \
87 87 ./configure \
88   ---with-gdktarget=win32 \
  88 +--enable-win32-backend \
89 89 --disable-gdiplus \
90 90 --with-included-immodules \
91 91 --without-libjasper \
116 configure.ac
@@ -255,22 +255,57 @@ AC_ARG_ENABLE(xinput,
255 255 [support XInput extension if available [default=yes]])],,
256 256 [enable_xinput="yes"])
257 257
258   -if test "$platform_win32" = yes; then
259   - gdktarget=win32
260   -else
261   - gdktarget=x11
  258 +AC_ARG_ENABLE(x11-backend,
  259 + [AC_HELP_STRING([--enable-x11-backend],
  260 + [enable the X11 gdk backend])],
  261 + [backend_set=yes])
  262 +AC_ARG_ENABLE(win32-backend,
  263 + [AC_HELP_STRING([--enable-win32-backend],
  264 + [enable the Win32 gdk backend])],
  265 + [backend_set=yes])
  266 +AC_ARG_ENABLE(quartz-backend,
  267 + [AC_HELP_STRING([--enable-quartz-backend],
  268 + [enable the quartz gdk backend])],
  269 + [backend_set=yes])
  270 +
  271 +if test -z "$backend_set"; then
  272 + if test "$platform_win32" = yes; then
  273 + enable_win32_backend=yes
  274 + else
  275 + enable_x11_backend=yes
  276 + fi
  277 +fi
  278 +
  279 +cairo_backends=
  280 +GDK_BACKENDS=
  281 +
  282 +if test "x$enable_x11_backend" == xyes; then
  283 + # GDK calls the xlib backend "x11," cairo calls it "xlib." Other
  284 + # backend names are identical.
  285 + cairo_backends="$cairo_backends cairo-xlib"
  286 + GDK_BACKENDS="$GDK_BACKENDS x11"
  287 + # Pull in gio-unix for GDesktopAppInfo usage, see at least
  288 + # gdkapplaunchcontext-x11.c
  289 + GIO_PACKAGE=gio-unix-2.0
262 290 fi
263 291
264   -AC_ARG_WITH(gdktarget,
265   - AC_HELP_STRING([--with-gdktarget=@<:@x11/win32/quartz@:>@],
266   - [select non-default GDK target]),
267   - gdktarget=$with_gdktarget)
  292 +if test "x$enable_win32_backend" == xyes; then
  293 + cairo_backends="$cairo_backends cairo-win32"
  294 + GDK_BACKENDS="$GDK_BACKENDS win32"
  295 + GIO_PACKAGE=gio-2.0
  296 +fi
268 297
269   -AC_SUBST(gdktarget)
270   -case $gdktarget in
271   - x11|win32|quartz) ;;
272   - *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz or win32.]);;
273   -esac
  298 +if test "x$enable_quartz_backend" == xyes; then
  299 + cairo_backends="$cairo_backends cairo-quartz"
  300 + GDK_BACKENDS="$GDK_BACKENDS quartz"
  301 + GIO_PACKAGE=gio-2.0
  302 +fi
  303 +
  304 +AC_SUBST(GDK_BACKENDS)
  305 +
  306 +if test -z "$GDK_BACKENDS"; then
  307 + AC_MSG_ERROR([No GDK backends selected.])
  308 +fi
274 309
275 310 if test "x$enable_debug" = "xyes"; then
276 311 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
@@ -363,18 +398,7 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
363 398 cairo-gobject >= cairo_required_version dnl
364 399 gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
365 400
366   -## In addition to checking that cairo is present, we also need to
367   -## check that the correct cairo backend is there. E.g. if the GDK
368   -## target is win32 we need the cairo-win32 backend and so on.
369   -cairo_backend=$gdktarget
370   -
371   -# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
372   -# backend names are identical.
373   -if test "x$cairo_backend" = "xx11"; then
374   - cairo_backend=xlib
375   -fi
376   -PKG_CHECK_MODULES(CAIRO_BACKEND,
377   - [cairo-$cairo_backend >= cairo_required_version])
  401 +PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
378 402
379 403 if test "$os_win32" != yes; then
380 404 # libtool option to control which symbols are exported
@@ -744,11 +768,11 @@ else
744 768 fi
745 769
746 770 all_immodules="am-et,cedilla,cyrillic-translit"
747   -if test "$gdktarget" = "win32"; then
  771 +if test "x$enable_win32_backend" == xyes; then
748 772 all_immodules="${all_immodules},ime"
749 773 fi
750 774 all_immodules="${all_immodules},inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr"
751   -if test "$gdktarget" = "x11"; then
  775 +if test "x$enable_x11_backend" == xyes; then
752 776 all_immodules="${all_immodules},xim"
753 777 fi
754 778
@@ -842,7 +866,7 @@ GDK_EXTRA_CFLAGS=
842 866 GTK_DEP_PACKAGES_FOR_X=
843 867 GTK_DEP_LIBS_FOR_X=
844 868
845   -if test "x$gdktarget" = "xx11"; then
  869 +if test "x$enable_x11_backend" == xyes; then
846 870 X_PACKAGES=fontconfig
847 871
848 872 #
@@ -1101,14 +1125,15 @@ else
1101 1125 AM_CONDITIONAL(HAVE_X11R6, false)
1102 1126 fi
1103 1127
1104   -if test "x$gdktarget" = "xwin32"; then
  1128 +
  1129 +if test "x$enable_win32_backend" == xyes; then
1105 1130 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
1106 1131 AM_CONDITIONAL(USE_WIN32, true)
1107 1132 else
1108 1133 AM_CONDITIONAL(USE_WIN32, false)
1109 1134 fi
1110 1135
1111   -if test "x$gdktarget" = "xquartz"; then
  1136 +if test "x$enable_quartz_backend" == xyes; then
1112 1137 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
1113 1138 AM_CONDITIONAL(USE_QUARTZ, true)
1114 1139 else
@@ -1117,7 +1142,7 @@ fi
1117 1142
1118 1143 # Check for Pango flags
1119 1144
1120   -if test "x$gdktarget" = "xwin32"; then
  1145 +if test "x$enable_win32_backend" == xyes; then
1121 1146 PANGO_PACKAGES="pangowin32 pangocairo"
1122 1147 else
1123 1148 PANGO_PACKAGES="pango pangocairo"
@@ -1152,12 +1177,7 @@ fi
1152 1177 CFLAGS="$saved_cflags"
1153 1178 LDFLAGS="$saved_ldflags"
1154 1179
1155   -# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
1156   -if test "x$gdktarget" = "xx11"; then
1157   - GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
1158   -else
1159   - GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
1160   -fi
  1180 +GDK_PACKAGES="$PANGO_PACKAGES $GIO_PACKAGE $X_PACKAGES gdk-pixbuf-2.0 $cairo_backends cairo-gobject"
1161 1181
1162 1182 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES`"
1163 1183 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
@@ -1207,7 +1227,7 @@ else
1207 1227 fi
1208 1228
1209 1229 GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
1210   -if test "x$gdktarget" = "xx11"; then
  1230 +if test "x$enable_x11_backend" == xyes; then
1211 1231 GTK_PACKAGES="$GTK_PACKAGES pangoft2"
1212 1232 fi
1213 1233 GTK_EXTRA_LIBS=
@@ -1524,18 +1544,18 @@ _______EOF
1524 1544 fi
1525 1545 ],[
1526 1546 gdk_windowing=''
1527   -if expr "$gdktarget" : ".*x11.*" > /dev/null ; then
1528   - gdk_windowing='$gdk_windowing
1529   -#define GDK_WINDOWING_X11'
  1547 +if test "x$enable_x11_backend" == xyes; then
  1548 + gdk_windowing="\$gdk_windowing
  1549 +#define GDK_WINDOWING_X11"
1530 1550 fi
1531   -if expr "$gdktarget" : ".*win32.*" > /dev/null ; then
1532   - gdk_windowing='$gdk_windowing
  1551 +if test "x$enable_win32_backend" == xyes; then
  1552 + gdk_windowing="\$gdk_windowing
1533 1553 #define GDK_NATIVE_WINDOW_POINTER
1534   -#define GDK_WINDOWING_WIN32'
  1554 +#define GDK_WINDOWING_WIN32"
1535 1555 fi
1536   -if expr "$gdktarget" : ".*quartz.*" > /dev/null ; then
1537   - gdk_windowing='$gdk_windowing
1538   -#define GDK_WINDOWING_QUARTZ'
  1556 +if test "x$enable_quartz_backend" == xyes; then
  1557 + gdk_windowing="\$gdk_windowing
  1558 +#define GDK_WINDOWING_QUARTZ"
1539 1559 fi
1540 1560 ])
1541 1561
@@ -1626,4 +1646,4 @@ perf/Makefile
1626 1646 AC_OUTPUT
1627 1647
1628 1648 echo "configuration:
1629   - target: $gdktarget"
  1649 + backends: $GDK_BACKENDS"
28 docs/reference/gtk/building.sgml
@@ -360,9 +360,14 @@ How to compile GTK+ itself
360 360 <group>
361 361 <arg>--enable-packagekit</arg>
362 362 <arg>--disable-packagekit</arg>
363   - </group>
364   - <group>
365   - <arg>--with-gdktarget=[x11/win32/quartz]</arg>
  363 + </group>
  364 + <group>
  365 + <arg>--enable-x11-backend</arg>
  366 + <arg>--disable-x11-backend</arg>
  367 + <arg>--enable-win32-backend</arg>
  368 + <arg>--disable-win32-backend</arg>
  369 + <arg>--enable-quartz-backend</arg>
  370 + <arg>--disable-quartz-backend</arg>
366 371 </group>
367 372 <group>
368 373 <arg>--enable-introspection=[no/auto/yes]</arg>
@@ -545,13 +550,20 @@ How to compile GTK+ itself
545 550 </formalpara>
546 551
547 552 <formalpara>
548   - <title><systemitem>--with-gdktarget</systemitem></title>
  553 + <title><systemitem>--enable-x11-backend</systemitem>,
  554 + <systemitem>--disable-x11-backend</systemitem>,
  555 + <systemitem>--enable-win32-backend</systemitem>,
  556 + <systemitem>--disable-win32-backend</systemitem>,
  557 + <systemitem>--enable-quartz-backend</systemitem>,
  558 + and <systemitem>--disable-quartz-backend</systemitem></title>
549 559
550 560 <para>
551   - Toggles between the supported backends for GDK.
552   - The default is x11, unless the platform is Windows, in which
553   - case the default is win32. Other supported backends are
554   - the quartz backend for OS X.
  561 + Enables specific backends for GDK. If none of these options
  562 + are given, the x11 backend will be enabled by default,
  563 + unless the platform is Windows, in which case the default is
  564 + win32. If any backend is explicitly enabled or disabled, no
  565 + other platform will be enabled automatically. Other
  566 + supported backends are the quartz backend for OS X.
555 567 </para>
556 568 </formalpara>
557 569 <formalpara>
2  gdk-3.0.pc.in
@@ -2,7 +2,7 @@ prefix=@prefix@
2 2 exec_prefix=@exec_prefix@
3 3 libdir=@libdir@
4 4 includedir=@includedir@
5   -target=@gdktarget@
  5 +targets=@GDK_BACKENDS@
6 6
7 7 Name: GDK
8 8 Description: GTK+ Drawing Kit
5 gdk/Makefile.am
@@ -8,7 +8,8 @@ INTROSPECTION_COMPILER_ARGS = \
8 8 --includedir=$(srcdir) \
9 9 --includedir=.
10 10
11   -SUBDIRS = $(gdktarget) . tests
  11 +SUBDIRS = $(GDK_BACKENDS) . tests
  12 +
12 13 DIST_SUBDIRS = win32 x11 quartz tests
13 14
14 15 CLEANFILES =
@@ -38,8 +39,6 @@ INCLUDES = \
38 39 $(GTK_DEBUG_FLAGS) \
39 40 $(GDK_DEP_CFLAGS)
40 41
41   -gtarget=$(gdktarget)
42   -
43 42 if PLATFORM_WIN32
44 43 no_undefined = -no-undefined
45 44 endif
6 gtk+-3.0-uninstalled.pc.in
... ... @@ -1,10 +1,10 @@
1   -target=@gdktarget@
  1 +targets=@GDK_BACKENDS@
2 2
3 3 gtk_binary_version=@GTK_BINARY_VERSION@
4 4
5 5 Name: GTK+ Uninstalled
6 6 Description: GTK+ Graphical UI Library (${target} target), Not Installed
7 7 Version: @VERSION@
8   -Requires: gdk-${target}-@GTK_API_VERSION@-uninstalled @GTK_PACKAGES@
9   -Libs: ${pc_top_builddir}/${pcfiledir}/gtk/libgtk-${target}-@GTK_API_VERSION@.la @GTK_EXTRA_LIBS@
  8 +Requires: gdk-@GTK_API_VERSION@-uninstalled @GTK_PACKAGES@
  9 +Libs: ${pc_top_builddir}/${pcfiledir}/gtk/libgtk-@GTK_API_VERSION@.la @GTK_EXTRA_LIBS@
10 10 Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@ -I${pc_top_builddir}/${pcfiledir} @GTK_EXTRA_CFLAGS@
2  gtk+-3.0.pc.in
@@ -2,7 +2,7 @@ prefix=@prefix@
2 2 exec_prefix=@exec_prefix@
3 3 libdir=@libdir@
4 4 includedir=@includedir@
5   -target=@gdktarget@
  5 +targets=@GDK_BACKENDS@
6 6
7 7 gtk_binary_version=@GTK_BINARY_VERSION@
8 8 gtk_host=@host@
2  gtk+-unix-print-3.0.pc.in
@@ -2,7 +2,7 @@ prefix=@prefix@
2 2 exec_prefix=@exec_prefix@
3 3 libdir=@libdir@
4 4 includedir=@includedir@
5   -target=@gdktarget@
  5 +targets=@GDK_BACKENDS@
6 6
7 7 gtk_binary_version=@GTK_BINARY_VERSION@
8 8 gtk_host=@host@
2  gtk/Makefile.am
@@ -57,8 +57,6 @@ INCLUDES = \
57 57 $(gtk_clipboard_dnd_c_sources_CFLAGS) \
58 58 $(INCLUDED_IMMODULE_DEFINE)
59 59
60   -gtarget=$(gdktarget)
61   -
62 60 if PLATFORM_WIN32
63 61 no_undefined = -no-undefined
64 62 endif

0 comments on commit cacee7e

Please sign in to comment.
Something went wrong with that request. Please try again.