1 # Process this file with autoconf to produce a configure script.
4 # GTK_MICRO_VERSION += 1;
5 # GTK_INTERFACE_AGE += 1;
7 # if any functions have been added, set GTK_INTERFACE_AGE to 0.
8 # if backwards compatibility has been broken,
9 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
11 m4_define([gtk_major_version], [2])
12 m4_define([gtk_minor_version], [99])
13 m4_define([gtk_micro_version], [4])
14 m4_define([gtk_interface_age], [0])
15 m4_define([gtk_binary_age],
16 [m4_eval(100 * gtk_minor_version + gtk_micro_version)])
17 m4_define([gtk_version],
18 [gtk_major_version.gtk_minor_version.gtk_micro_version])
19 # This is the X.Y used in -lgtk-FOO-X.Y
20 m4_define([gtk_api_version], [3.0])
23 AC_INIT([gtk+], [gtk_version],
24 [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B],
27 AC_CONFIG_HEADER([config.h])
28 AC_CONFIG_SRCDIR([gdk/gdktypes.h])
29 AC_CONFIG_MACRO_DIR([m4])
31 # Define a string for the earliest version that this release has
32 # backwards binary compatibility with for all interfaces a module
33 # might. Unless we add module-only API with lower stability
34 # guarantees, this should be unchanged until we break binary compat
37 #GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
38 m4_define([gtk_binary_version], [3.0.0])
40 # required versions of other packages
41 m4_define([glib_required_version], [2.27.5])
42 m4_define([pango_required_version], [1.20])
43 m4_define([atk_required_version], [1.29.2])
44 m4_define([cairo_required_version], [1.10.0])
45 m4_define([gdk_pixbuf_required_version], [2.21.0])
46 GLIB_REQUIRED_VERSION=glib_required_version
47 PANGO_REQUIRED_VERSION=pango_required_version
48 ATK_REQUIRED_VERSION=atk_required_version
49 CAIRO_REQUIRED_VERSION=cairo_required_version
50 GDK_PIXBUF_REQUIRED_VERSION=gdk_pixbuf_required_version
51 AC_SUBST(GLIB_REQUIRED_VERSION)
52 AC_SUBST(PANGO_REQUIRED_VERSION)
53 AC_SUBST(ATK_REQUIRED_VERSION)
54 AC_SUBST(CAIRO_REQUIRED_VERSION)
55 AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
58 # Save this value here, since automake will set cflags later
59 cflags_set=${CFLAGS+set}
61 AM_INIT_AUTOMAKE([1.10 no-define -Wno-portability dist-bzip2])
62 AM_MAINTAINER_MODE([enable])
64 # Support silent build rules, requires at least automake-1.11. Disable
65 # by either passing --disable-silent-rules to configure or passing V=1
67 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
70 # For each of the libraries we build, we define the following
71 # substituted variables:
73 # foo_PACKAGES: pkg-config packages this library requires
74 # foo_EXTRA_LIBS: Libraries this module requires not pulled in by pkg-config
75 # foo_EXTRA_CFLAGS: cflags this module requires not pulled in by pkg-config
76 # foo_DEP_LIBS: All libraries this module requires
77 # foo_DEP_CFLAGS: All cflags this module requires
80 GTK_MAJOR_VERSION=gtk_major_version
81 GTK_MINOR_VERSION=gtk_minor_version
82 GTK_MICRO_VERSION=gtk_micro_version
83 GTK_INTERFACE_AGE=gtk_interface_age
84 GTK_BINARY_AGE=gtk_binary_age
85 GTK_VERSION=gtk_version
86 GTK_API_VERSION=gtk_api_version
87 GTK_BINARY_VERSION=gtk_binary_version
88 AC_SUBST(GTK_MAJOR_VERSION)
89 AC_SUBST(GTK_MINOR_VERSION)
90 AC_SUBST(GTK_MICRO_VERSION)
91 AC_SUBST(GTK_INTERFACE_AGE)
92 AC_SUBST(GTK_BINARY_AGE)
93 AC_SUBST(GTK_API_VERSION)
95 AC_SUBST(GTK_BINARY_VERSION)
98 #LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
99 #LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
100 #LT_REVISION=$GTK_INTERFACE_AGE
101 #LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
102 #LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
104 m4_define([lt_current], [m4_eval(100 * gtk_minor_version + gtk_micro_version - gtk_interface_age)])
105 m4_define([lt_revision], [gtk_interface_age])
106 m4_define([lt_age], [m4_eval(gtk_binary_age - gtk_interface_age)])
107 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
108 LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
109 AC_SUBST(LT_VERSION_INFO)
110 AC_SUBST(LT_CURRENT_MINUS_AGE)
112 m4_define([gail_lt_current],[0])
113 m4_define([gail_lt_revision],[0])
114 m4_define([gail_lt_age],[0])
115 m4_define([gail_lt_version_info],[gail_lt_current:gail_lt_revision:gail_lt_age])
116 m4_define([gail_lt_current_minus_age],[m4_eval(gail_lt_current - gail_lt_age)])
117 AC_SUBST([GAIL_LT_VERSION_INFO],[gail_lt_version_info])
118 AC_SUBST([GAIL_LT_CURRENT_MINUS_AGE],[gail_lt_current_minus_age])
120 # Checks for programs.
128 GETTEXT_PACKAGE=gtk30
129 AC_SUBST(GETTEXT_PACKAGE)
130 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
131 [The prefix for our gettext translation domains.])
136 AC_MSG_CHECKING([for native Win32])
137 LIB_EXE_MACHINE_FLAG=X86
138 EXE_MANIFEST_ARCHITECTURE=X86
146 LIB_EXE_MACHINE_FLAG=X64
147 EXE_MANIFEST_ARCHITECTURE=AMD64
155 AC_MSG_RESULT([$os_win32])
157 AC_SUBST(LIB_EXE_MACHINE_FLAG)
158 AC_SUBST(EXE_MANIFEST_ARCHITECTURE)
167 dnl Check for a working C++ compiler, but do not bail out, if none is found.
168 dnl We use this for an automated test for C++ header correctness.
170 AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
173 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
174 [[class a { int b; } c;]])],
176 AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
178 gtk_save_cxxflags="$CXXFLAGS"
179 CXXFLAGS="$CXXFLAGS -x objective-c++"
180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@interface Foo @end]],
182 [OBJC=yes],[OBJC=no])
183 AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" = "yes")
184 CXXFLAGS="$gtk_save_cxxflags"
187 if test "$os_win32" = "yes"; then
188 if test x$enable_static = xyes -o x$enable_static = x; then
189 AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
192 if test x$enable_shared = xno; then
193 AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
198 dnl Initialize libtool
200 LT_INIT([disable-static win32-dll])
201 # Create libtool early, because it's used in configure
204 # Make sure we use 64-bit versions of various file stuff.
208 AC_PATH_PROG(NM, nm, nm)
210 AC_MSG_CHECKING([for some Win32 platform])
212 *-*-mingw*|*-*-cygwin*)
219 AC_MSG_RESULT([$platform_win32])
220 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
222 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
223 AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
224 AM_CONDITIONAL(OS_LINUX, test "$os_linux" = "yes")
226 if test "$os_win32" = "yes"; then
227 AC_CHECK_TOOL(WINDRES, windres, no)
228 if test "$WINDRES" = no; then
229 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
231 AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
233 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
235 m4_define([debug_default],
236 m4_if(m4_eval(gtk_minor_version % 2), [1], [yes], [minimum]))
238 dnl declare --enable-* args and collect ac_help strings
240 [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
241 [turn on debugging @<:@default=debug_default@:>@])],,
242 [enable_debug=debug_default])
244 AC_ARG_ENABLE(rebuilds,
245 [AS_HELP_STRING([--disable-rebuilds],
246 [disable all source autogeneration rules])],,
247 [enable_rebuilds=yes])
249 AC_ARG_ENABLE(gtk2-dependency,
250 [AS_HELP_STRING([--enable-gtk2-dependency],
251 [Do not build gtk-update-icon-cache and other shared tools])],,
252 [enable_gtk2_dependency=no])
254 AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
257 [AS_HELP_STRING([--enable-xkb],
258 [support XKB extension [default=maybe]])],,
259 [enable_xkb="maybe"])
260 AC_ARG_ENABLE(xinerama,
261 [AS_HELP_STRING([--enable-xinerama],
262 [support Xinerama extension if available [default=maybe]])],,
263 [enable_xinerama="maybe"])
264 AC_ARG_ENABLE(xinput,
265 [AS_HELP_STRING([--enable-xinput],
266 [support XInput extension if available [default=yes]])],,
267 [enable_xinput="maybe"])
268 AC_ARG_ENABLE(xrandr,
269 [AS_HELP_STRING([--enable-xrandr],
270 [support XRandR extension if available [default=maybe]])],,
271 [enable_xrandr="maybe"])
272 AC_ARG_ENABLE(xfixes,
273 [AS_HELP_STRING([--enable-xfixes],
274 [support XFixes extension if available [default=maybe]])],,
275 [enable_xfixes="maybe"])
276 AC_ARG_ENABLE(xcomposite,
277 [AS_HELP_STRING([--enable-xcomposite],
278 [support X Composite extension if available [default=maybe]])],,
279 [enable_xcomposite="maybe"])
280 AC_ARG_ENABLE(xdamage,
281 [AS_HELP_STRING([--enable-xdamage],
282 [support X Damage extension if available [default=maybe]])],,
283 [enable_xdamage="maybe"])
285 AC_ARG_ENABLE(x11-backend,
286 [AS_HELP_STRING([--enable-x11-backend],
287 [enable the X11 gdk backend])],
289 AC_ARG_ENABLE(win32-backend,
290 [AS_HELP_STRING([--enable-win32-backend],
291 [enable the Win32 gdk backend])],
293 AC_ARG_ENABLE(quartz-backend,
294 [AS_HELP_STRING([--enable-quartz-backend],
295 [enable the quartz gdk backend])],
298 if test -z "$backend_set"; then
299 if test "$platform_win32" = yes; then
300 enable_win32_backend=yes
302 enable_x11_backend=yes
313 PANGO_PACKAGES="pango pangocairo"
315 if test "x$enable_x11_backend" == xyes; then
316 # GDK calls the xlib backend "x11," cairo calls it "xlib." Other
317 # backend names are identical.
318 cairo_backends="$cairo_backends cairo-xlib"
319 GDK_BACKENDS="$GDK_BACKENDS x11"
320 # Pull in gio-unix for GDesktopAppInfo usage, see at least
321 # gdkapplaunchcontext-x11.c
322 GIO_PACKAGE=gio-unix-2.0
323 backend_immodules="$backend_immodules,xim"
324 GDK_WINDOWING="$GDK_WINDOWING
325 #define GDK_WINDOWING_X11"
328 if test "x$enable_win32_backend" == xyes; then
329 cairo_backends="$cairo_backends cairo-win32"
330 GDK_BACKENDS="$GDK_BACKENDS win32"
331 backend_immodules="$backend_immodules,ime"
332 GDK_WINDOWING="$GDK_WINDOWING
333 #define GDK_WINDOWING_WIN32"
334 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
335 AM_CONDITIONAL(USE_WIN32, true)
336 PANGO_PACKAGES="pangowin32 pangocairo"
338 AM_CONDITIONAL(USE_WIN32, false)
341 if test "x$enable_quartz_backend" == xyes; then
342 cairo_backends="$cairo_backends cairo-quartz"
343 GDK_BACKENDS="$GDK_BACKENDS quartz"
344 GDK_WINDOWING="$GDK_WINDOWING
345 #define GDK_WINDOWING_QUARTZ"
346 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
347 AM_CONDITIONAL(USE_QUARTZ, true)
349 AM_CONDITIONAL(USE_QUARTZ, false)
352 # strip leading space
353 GDK_BACKENDS=${GDK_BACKENDS/# }
355 AC_SUBST(GDK_BACKENDS)
357 if test -z "$GDK_BACKENDS"; then
358 AC_MSG_ERROR([No GDK backends selected.])
361 if test "x$enable_debug" = "xyes"; then
362 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
363 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES"
365 if test "x$enable_debug" = "xno"; then
366 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
368 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
373 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
374 [Define if debugging is enabled])
377 # Build time sanity check...
381 if test "x$GCC" = "xyes"; then
383 *[\ \ ]-Wall[\ \ ]*) ;;
384 *) CFLAGS="$CFLAGS -Wall" ;;
387 if test "x$enable_ansi" = "xyes"; then
389 *[\ \ ]-ansi[\ \ ]*) ;;
390 *) CFLAGS="$CFLAGS -ansi" ;;
394 *[\ \ ]-pedantic[\ \ ]*) ;;
395 *) CFLAGS="$CFLAGS -pedantic" ;;
401 CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES"
403 # Ensure MSVC-compatible struct packing convention is used when
404 # compiling for Win32 with gcc.
405 # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
406 # gcc2 uses "-fnative-struct".
407 if test x"$os_win32" = xyes; then
408 if test x"$GCC" = xyes; then
410 AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
411 if test -z "$ac_cv_prog_CC"; then
414 our_gcc="$ac_cv_prog_CC"
416 case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
418 if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
419 msnative_struct='-fnative-struct'
423 if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
424 msnative_struct='-mms-bitfields'
428 if test x"$msnative_struct" = x ; then
429 AC_MSG_RESULT([no way])
430 AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
432 CFLAGS="$CFLAGS $msnative_struct"
433 AC_MSG_RESULT([${msnative_struct}])
438 ## Initial sanity check, done here so that users get told they
439 ## have the wrong dependencies as early in the process as possible.
440 ## Later on we actually use the cflags/libs from separate pkg-config
441 ## calls. Oh, also the later pkg-config calls don't include
442 ## the version requirements since those make the module lists
443 ## annoying to construct
444 PKG_CHECK_MODULES(BASE_DEPENDENCIES,
445 [glib-2.0 >= glib_required_version dnl
446 atk >= atk_required_version dnl
447 pango >= pango_required_version dnl
448 cairo >= cairo_required_version dnl
449 cairo-gobject >= cairo_required_version dnl
450 gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
452 PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
454 if test "$os_win32" != yes; then
455 # libtool option to control which symbols are exported
456 # right now, symbols starting with _ are not exported
457 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
459 # We currently use .def files on Windows (for gdk and gtk)
460 LIBTOOL_EXPORT_OPTIONS=
462 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
464 dnl ******************************************************
465 dnl * See whether to include shared library dependencies *
466 dnl ******************************************************
468 AC_ARG_ENABLE(explicit-deps,
469 [AS_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
470 [use explicit dependencies in .pc files [default=auto]])],,
471 [enable_explicit_deps=auto])
473 AC_MSG_CHECKING([Whether to write dependencies into .pc files])
474 case $enable_explicit_deps in
477 deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
478 if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
479 enable_explicit_deps=yes
481 enable_explicit_deps=no
486 *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
489 AC_MSG_RESULT($enable_explicit_deps)
491 AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
493 # define a MAINT-like variable REBUILD which is set if Perl
494 # and awk are found, so autogenerated sources can be rebuilt
496 AC_PATH_PROGS(PERL, perl5 perl)
498 # We would like indent, but don't require it.
499 AC_CHECK_PROG(INDENT, indent, indent)
502 if test "x$enable_rebuilds" = "xyes" && \
504 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
509 AC_CHECK_FUNCS(lstat mkstemp flockfile getc_unlocked)
510 AC_CHECK_FUNCS(localtime_r)
512 # _NL_TIME_FIRST_WEEKDAY is an enum and not a define
513 AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
514 AC_TRY_LINK([#include <langinfo.h>], [
516 c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
517 ], gtk_ok=yes, gtk_ok=no)
518 AC_MSG_RESULT($gtk_ok)
519 if test "$gtk_ok" = "yes"; then
520 AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
521 [Define if _NL_TIME_FIRST_WEEKDAY is available])
524 # _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
525 AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
526 AC_TRY_LINK([#include <langinfo.h>], [
528 c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
529 ], gtk_ok=yes, gtk_ok=no)
530 AC_MSG_RESULT($gtk_ok)
531 if test "$gtk_ok" = "yes"; then
532 AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
533 [Define if _NL_MEASUREMENT_MEASUREMENT is available])
536 # _NL_PAPER_HEIGHT is an enum and not a define
537 AC_MSG_CHECKING([for _NL_PAPER_HEIGHT])
538 AC_TRY_LINK([#include <langinfo.h>], [
540 c = *((unsigned char *) nl_langinfo(_NL_PAPER_HEIGHT));
541 ], gtk_ok=yes, gtk_ok=no)
542 AC_MSG_RESULT($gtk_ok)
543 if test "$gtk_ok" = "yes"; then
544 AC_DEFINE([HAVE__NL_PAPER_HEIGHT], [1],
545 [Define if _NL_PAPER_HEIGHT is available])
548 # _NL_PAPER_WIDTH is an enum and not a define
549 AC_MSG_CHECKING([for _NL_PAPER_WIDTH])
550 AC_TRY_LINK([#include <langinfo.h>], [
552 c = *((unsigned char *) nl_langinfo(_NL_PAPER_WIDTH));
553 ], gtk_ok=yes, gtk_ok=no)
554 AC_MSG_RESULT($gtk_ok)
555 if test "$gtk_ok" = "yes"; then
556 AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1],
557 [Define if _NL_PAPER_WIDTH is available])
561 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
563 LIBS="$LIBS $INTLLIBS"
564 AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
565 sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
568 dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
569 dnl po-properties/POTFILES during configure; see GNOME #573515.
571 dnl Generate list of files to be processed by xgettext which will
572 dnl be included in po-properties/Makefile.
573 test -d po-properties || mkdir po-properties
574 if test "x$srcdir" != "x."; then
575 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
576 popropsrcprefix="$srcdir/"
578 popropsrcprefix="../$srcdir/"
581 popropsrcprefix="../"
583 rm -f po-properties/POTFILES
584 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $popropsrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
585 < $srcdir/po-properties/POTFILES.in > po-properties/POTFILES
586 dnl (End of adapted AM_GLIB_GNU_GETTEXT snippet.)
588 AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR)
590 dnl The DU4 header files don't provide library prototypes unless
591 dnl -std1 is given to the native cc.
592 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
596 AC_TRY_RUN([#include <math.h>
597 int main (void) { return (log(1) != log(1.)); }],
598 AC_MSG_RESULT(none needed),
599 gtk_save_CFLAGS="$CFLAGS"
600 CFLAGS="$CFLAGS -std1"
601 AC_TRY_RUN([#include <math.h>
602 int main (void) { return (log(1) != log(1.)); }],
603 AC_MSG_RESULT(-std1),
605 CFLAGS="$gtk_save_CFLAGS"
607 [No ANSI prototypes found in library. (-std1 didn't work.)]),
610 AC_MSG_RESULT(none needed)
614 AC_MSG_CHECKING(for the BeOS)
629 AC_MSG_CHECKING(for HP-UX)
631 hpux9* | hpux10* | hpux11*)
633 CFLAGS="$CFLAGS -DHPPEX -DSHMLINK"
641 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
644 GLIB_PACKAGES="gobject-2.0 gio-2.0 gmodule-no-export-2.0"
646 AM_PATH_GLIB_2_0(glib_required_version, :,
648 *** GLIB glib_required_version or better is required. The latest version of
649 *** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
650 gobject gmodule-no-export gthread)
652 # See if it's safe to turn G_DISABLE_DEPRECATED on.
653 GLIB_VERSION_MAJOR_MINOR=`$PKG_CONFIG --modversion glib-2.0 | sed "s/\.@<:@^.@:>@*\$//"`
654 GLIB_REQUIRED_VERSION_MAJOR_MINOR=`echo glib_required_version | sed "s/\.@<:@^.@:>@*\$//"`
655 if test "x$GLIB_VERSION_MAJOR_MINOR" = "x$GLIB_REQUIRED_VERSION_MAJOR_MINOR"; then
656 CFLAGS="-DG_DISABLE_DEPRECATED $CFLAGS"
659 CFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CFLAGS"
663 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
666 LIBS="$LIBS $GLIB_LIBS"
667 AC_CHECK_FUNCS(bind_textdomain_codeset)
670 AC_CHECK_HEADERS(pwd.h,
671 AC_DEFINE(HAVE_PWD_H, 1,
672 [Define to 1 if pwd.h is available]))
673 AC_CHECK_HEADERS(sys/time.h,
674 AC_DEFINE(HAVE_SYS_TIME_H, 1,
675 [Define to 1 if time.h is available]))
676 AC_CHECK_HEADERS(unistd.h,
677 AC_DEFINE(HAVE_UNISTD_H, 1,
678 [Define to 1 if unistd.h is available]))
679 AC_CHECK_HEADERS(ftw.h,
680 AC_DEFINE(HAVE_FTW_H, 1,
681 [Define to 1 if ftw.h is available]))
683 AC_MSG_CHECKING([for GNU ftw extensions])
684 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _XOPEN_SOURCE 500
687 [[int flags = FTW_ACTIONRETVAL;]])],
688 [gtk_ok=yes],[gtk_ok=no])
689 if test $gtk_ok = yes; then
691 AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
696 saved_cflags="$CFLAGS"
697 saved_ldflags="$LDFLAGS"
700 # Checks for library functions.
703 AC_CHECK_FUNCS(mallinfo)
704 AC_CHECK_FUNCS(getresuid)
707 # Check if <sys/select.h> needs to be included for fd_set
708 AC_MSG_CHECKING([for fd_set])
709 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
710 [[fd_set readMask, writeMask;]])],
711 [gtk_ok=yes],[gtk_ok=no])
712 if test $gtk_ok = yes; then
713 AC_MSG_RESULT([yes, found in sys/types.h])
715 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
716 if test $gtk_ok = yes; then
717 AC_DEFINE(HAVE_SYS_SELECT_H, 1,
718 [Define to 1 if sys/select.h is available])
719 AC_MSG_RESULT([yes, found in sys/select.h])
721 AC_DEFINE(NO_FD_SET, 1,
722 [Define to 1 if fd_set is not available])
727 # Check for uxtheme.h (for MS-Windows Engine)
728 AC_MSG_CHECKING(for uxtheme.h)
729 AC_TRY_CPP([#include <uxtheme.h>], gtk_uxtheme_h=yes, gtk_uxtheme_h=no)
730 if test $gtk_uxtheme_h = yes; then
731 AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
733 AC_MSG_RESULT($gtk_uxtheme_h)
735 # Checks for gdkspawn
736 AC_CHECK_HEADERS(crt_externs.h)
737 AC_CHECK_FUNCS(_NSGetEnviron)
739 AC_MSG_CHECKING(whether to build dynamic modules)
741 AC_ARG_ENABLE(modules,
742 [AS_HELP_STRING([--disable-modules],
743 [disable dynamic module loading])])
746 build_dynamic_modules=no
748 if test x$enable_modules = xno; then
752 AC_MSG_CHECKING(whether dynamic modules work)
753 ## for loop is to strip newline
754 tmp=`$PKG_CONFIG --variable=gmodule_supported gmodule-no-export-2.0`
759 dnl Now we check to see if our libtool supports shared lib deps
760 dnl (in a rather ugly way even)
762 module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
763 module_deplibs_check=`$module_libtool_config | \
764 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
765 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
766 if test "x$module_deplibs_check" = "xnone" || \
767 test "x$module_deplibs_check" = "xunknown" || \
768 test "x$module_deplibs_check" = "x"; then
774 build_dynamic_modules=yes
775 AC_DEFINE(USE_GMODULE, 1,
776 [Define to 1 if gmodule works and should be used])
779 build_dynamic_modules=no
784 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
787 # Allow building some or all immodules included
789 AC_MSG_CHECKING(immodules to build)
791 AC_ARG_WITH(included_immodules,
792 [AS_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
793 [build the specified input methods into gtk])])
798 ## if the option was specified, leave it; otherwise disable included immodules
799 if test x$with_included_immodules = xno; then
800 with_included_immodules=yes
804 all_immodules="am-et,cedilla,cyrillic-translit,inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr$backend_immodules"
806 included_immodules=""
807 # If the switch specified without listing any specific ones, include all
808 if test "x$with_included_immodules" = xyes ; then
809 included_immodules="$all_immodules"
811 included_immodules="$with_included_immodules"
814 AC_MSG_RESULT($included_immodules)
815 AM_CONDITIONAL(HAVE_INCLUDED_IMMMODULES, test "x$included_immodules" != x)
817 INCLUDED_IMMODULE_OBJ=
818 INCLUDED_IMMODULE_DEFINE=
820 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
821 for immodule in $included_immodules; do
822 immodule_underscores=`echo $immodule | sed -e 's/-/_/g'`
823 if echo "$all_immodules" | egrep "(^|,)$immodule(\$|,)" > /dev/null; then
826 AC_MSG_ERROR([the specified input method $immodule does not exist])
829 INCLUDED_IMMODULE_OBJ="$INCLUDED_IMMODULE_OBJ ../modules/input/libstatic-im-$immodule.la"
830 INCLUDED_IMMODULE_DEFINE="$INCLUDED_IMMODULE_DEFINE -DINCLUDE_IM_$immodule_underscores"
831 eval INCLUDE_$immodule_underscores=yes
834 AC_SUBST(INCLUDED_IMMODULE_OBJ)
835 AC_SUBST(INCLUDED_IMMODULE_DEFINE)
837 AM_CONDITIONAL(INCLUDE_IM_AM_ET, [test x"$INCLUDE_am_et" = xyes])
838 AM_CONDITIONAL(INCLUDE_IM_CEDILLA, [test x"$INCLUDE_cedilla" = xyes])
839 AM_CONDITIONAL(INCLUDE_IM_CYRILLIC_TRANSLIT, [test x"$INCLUDE_cyrillic_translit" = xyes])
840 AM_CONDITIONAL(INCLUDE_IM_IME, [test x"$INCLUDE_ime" = xyes])
841 AM_CONDITIONAL(INCLUDE_IM_INUKTITUT, [test x"$INCLUDE_inuktitut" = xyes])
842 AM_CONDITIONAL(INCLUDE_IM_IPA, [test x"$INCLUDE_ipa" = xyes])
843 AM_CONDITIONAL(INCLUDE_IM_MULTIPRESS, [test x"$INCLUDE_multipress" = xyes])
844 AM_CONDITIONAL(INCLUDE_IM_THAI, [test x"$INCLUDE_thai" = xyes])
845 AM_CONDITIONAL(INCLUDE_IM_TI_ER, [test x"$INCLUDE_ti_er" = xyes])
846 AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
847 AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
848 AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
850 # Checks to see whether we should include mediaLib
853 AC_CHECK_HEADER(sys/systeminfo.h,
854 AC_DEFINE(HAVE_SYS_SYSTEMINFO_H, 1,
855 [Define to 1 if sys/systeminfo.h is available]))
856 AC_CHECK_HEADER(sys/sysinfo.h,
857 AC_DEFINE(HAVE_SYS_SYSINFO_H, 1,
858 [Define to 1 if sys/sysinfo.h is available]))
860 dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
862 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
864 if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
865 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
866 if test x$GTK_UPDATE_ICON_CACHE = xno; then
871 AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
873 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
875 if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
876 test "x$REBUILD_PNGS" = "x#" ; then
878 *** gtkbuiltincache.h is not in the tree, and cannot be built
879 *** because you don't have libpng, or (when cross-compiling) you
880 *** don't have a prebuilt gtk-update-icon-cache on the build system.])
883 ########################################
884 # Windowing system checks
885 ########################################
887 # GTK+ uses some X calls, so needs to link against X directly
888 GTK_DEP_PACKAGES_FOR_X=
892 if test "x$enable_x11_backend" == xyes; then
893 X_PACKAGES=fontconfig
896 # We use fontconfig very peripherally when decoding the default
899 if $PKG_CONFIG --exists fontconfig; then : ; else
901 *** fontconfig (http://www.fontconfig.org) is required by the X11 backend.])
905 # Check for basic X packages; we use pkg-config if available
907 if $PKG_CONFIG --exists x11 xext; then
909 X_PACKAGES="$X_PACKAGES x11 xext"
910 x_libs="`$PKG_CONFIG --libs x11 xext`"
911 X_CFLAGS="`$PKG_CONFIG --cflags x11 xext`"
913 # Strip out any .la files that pkg-config might give us (this happens
914 # with -uninstalled.pc files)
916 for I in $x_libs ; do
919 *) x_libs_for_checks="$x_libs_for_checks $I" ;;
923 GTK_PACKAGES_FOR_X="x11"
927 if test x$no_x = xyes ; then
928 AC_MSG_ERROR([X development libraries not found])
932 x_libs_for_checks="$X_LIBS -lXext -lX11 $X_EXTRA_LIBS"
934 GTK_DEP_LIBS_FOR_X="$X_LIBS -lX11 $X_EXTRA_LIBS"
937 # Extra libraries found during checks (-lXinerama, etc), not from pkg-config.
940 gtk_save_cppflags="$CPPFLAGS"
941 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
944 LIBS="$x_libs_for_checks $LIBS"
946 # Sanity check for the X11 and Xext libraries. While everything we need from
947 # Xext is optional, the chances a system has *none* of these things is so
948 # small that we just unconditionally require it.
949 AC_CHECK_FUNC(XOpenDisplay, :,
950 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
951 AC_CHECK_FUNC(XextFindDisplay, :,
952 AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
956 AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
957 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
959 [AC_MSG_RESULT([no])],
960 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
961 #include <X11/Xlibint.h>]],
963 [AC_MSG_RESULT([yes])
964 AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
965 [Define if <X11/extensions/XIproto.h> needed for xReply])],
966 [AC_MSG_RESULT([unknown])
967 AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
969 # Check for XConvertCase, XInternAtoms (X11R6 specific)
971 AC_CHECK_FUNCS(XConvertCase XInternAtoms)
973 # Generic X11R6 check needed for XIM support; we could
974 # probably use this to replace the above, but we'll
975 # leave the separate checks for XConvertCase and XInternAtoms
979 AC_CHECK_FUNC(XAddConnectionWatch,
983 AC_DEFINE(HAVE_X11R6, 1, [Define if we have X11R6])
985 AM_CONDITIONAL(HAVE_X11R6, $have_x11r6)
987 # Check for XKB support.
989 if test "x$enable_xkb" = "xyes"; then
990 AC_CHECK_FUNC(XkbQueryExtension,
991 X_EXTENSIONS="$X_EXTENSIONS XKB"
992 AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]),
993 AC_MSG_ERROR([*** XKB extension not found. Check 'config.log' for more details.]))
994 elif test "x$enable_xkb" = "xmaybe"; then
995 AC_CHECK_FUNC(XkbQueryExtension,
996 X_EXTENSIONS="$X_EXTENSIONS XKB"
997 AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]))
999 AC_MSG_WARN(XKB support explicitly disabled)
1002 # Check for shaped window extension
1004 AC_CHECK_FUNC(XShapeCombineMask, :,
1005 [AC_MSG_ERROR([Shape extension not found, check your development headers])])
1008 gtk_save_CFLAGS="$CFLAGS"
1009 CFLAGS="$CFLAGS $x_cflags"
1011 AC_CHECK_FUNC(XSyncQueryExtension,
1012 [AC_CHECK_HEADER(X11/extensions/sync.h,
1013 AC_DEFINE(HAVE_XSYNC, 1, [Have the SYNC extension library]),
1014 :, [#include <X11/Xlib.h>])])
1016 CFLAGS="$gtk_save_CFLAGS"
1018 if test "x$enable_xinerama" != "xno"; then
1019 # Check for Xinerama extension (Solaris impl or Xfree impl)
1020 have_xfree_xinerama=false
1021 have_solaris_xinerama=false
1023 gtk_save_cppflags="$CPPFLAGS"
1024 CPPFLAGS="$CPPFLAGS $x_cflags"
1027 AC_MSG_CHECKING(for Xinerama packages)
1029 if $PKG_CONFIG --exists xinerama ; then
1031 have_xfree_xinerama=true
1032 X_PACKAGES="$X_PACKAGES xinerama"
1035 AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
1036 [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
1037 [GTK_ADD_LIB(x_extra_libs,Xinerama)
1038 have_xfree_xinerama=true], :,
1039 [#include <X11/Xlib.h>])])
1042 if $have_xfree_xinerama ; then
1043 X_EXTENSIONS="$X_EXTENSIONS Xinerama"
1044 AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
1045 [Define to 1 if XFree Xinerama is available])
1046 AC_DEFINE(HAVE_XINERAMA, 1,
1047 [Define to 1 is Xinerama is available])
1052 AC_MSG_CHECKING(for Xinerama support on Solaris)
1054 have_solaris_xinerama=false
1055 AC_CHECK_FUNC(XineramaGetInfo,
1056 [AC_CHECK_HEADER(X11/extensions/xinerama.h,
1057 [have_solaris_xinerama=true], :,
1058 [#include <X11/Xlib.h>])])
1060 if $have_solaris_xinerama ; then
1061 X_EXTENSIONS="$X_EXTENSIONS Xinerama"
1062 AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
1063 [Define to 1 if solaris xinerama is available])
1064 AC_DEFINE(HAVE_XINERAMA, 1,
1065 [Define to 1 if xinerama is available])
1076 if test "x$enable_xinerama" = "xyes" ; then
1077 if test "x$have_xfree_xinerama" != "xtrue" -a "x$have_solaris_xinerama" != "xtrue" ; then
1078 AC_MSG_ERROR([*** Xinerama extension not found. Check 'config.log' for more details.])
1082 # set up things for XInput
1083 if test "x$enable_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
1086 AC_DEFINE(XINPUT_XFREE, 1,
1087 [Define to 1 if XFree XInput should be used])
1089 X_PACKAGES="$X_PACKAGES xi"
1091 AC_CHECK_HEADER(X11/extensions/XInput2.h,
1093 X_EXTENSIONS="$X_EXTENSIONS XI2"
1094 AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]),
1095 X_EXTENSIONS="$X_EXTENSIONS XInput")
1098 AC_DEFINE(XINPUT_NONE, 1,
1099 [Define to 1 if no XInput should be used])
1102 AM_CONDITIONAL(XINPUT_XFREE, test "x$have_xinput" = "xyes")
1103 AM_CONDITIONAL(XINPUT_2, test "x$have_xinput2" = "xyes")
1105 if test "x$enable_xinput" = "xyes" ; then
1106 if test "x$have_xinput" != "xyes" -a "x$have_xinput2" != "xyes" ; then
1107 AC_MSG_ERROR([*** XInput extension not found. Check 'config.log' for more details.])
1111 # Check for the RANDR extension
1112 if test x"$enable_xrandr" != xno; then
1113 if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
1114 AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
1116 X_PACKAGES="$X_PACKAGES xrandr"
1117 X_EXTENSIONS="$X_EXTENSIONS XRANDR"
1118 elif test x"$enable_xrandr" = xyes; then
1119 AC_MSG_ERROR([RANDR support requested but xrandr not found])
1123 # Checks for Xcursor library
1125 if $PKG_CONFIG --exists xcursor ; then
1126 AC_DEFINE(HAVE_XCURSOR, 1, [Have the Xcursor library])
1128 X_PACKAGES="$X_PACKAGES xcursor"
1131 # Checks for XFixes extension
1133 if test x"$enable_xfixes" != xno; then
1134 if $PKG_CONFIG --exists xfixes ; then
1135 AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
1137 X_PACKAGES="$X_PACKAGES xfixes"
1138 X_EXTENSIONS="$X_EXTENSIONS XFIXES"
1139 GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
1140 elif test x"$enable_xfixes" = xyes; then
1141 AC_MSG_ERROR([XFixes support requested but xfixes not found])
1145 # Checks for Xcomposite extension
1147 if test x"$enable_xcomposite" != xno; then
1148 if $PKG_CONFIG --exists xcomposite ; then
1149 AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
1151 X_PACKAGES="$X_PACKAGES xcomposite"
1152 X_EXTENSIONS="$X_EXTENSIONS Composite"
1153 GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
1154 elif test x"$enable_xcomposite" = xyes; then
1155 AC_MSG_ERROR([Xcomposite support requested but xcomposite not found])
1159 # Checks for Xdamage extension
1161 if test x"$enable_xdamage" != xno; then
1162 if $PKG_CONFIG --exists xdamage ; then
1163 AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
1165 X_PACKAGES="$X_PACKAGES xdamage"
1166 X_EXTENSIONS="$X_EXTENSIONS DAMAGE"
1167 GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
1168 elif test x"$enable_xdamage" = xyes; then
1169 AC_MSG_ERROR([Xdamage support requested but xdamage not found])
1173 if $have_base_x_pc ; then
1174 GDK_EXTRA_LIBS="$x_extra_libs"
1176 GDK_EXTRA_LIBS="$X_LIBS $x_extra_libs -lXext -lX11 $GDK_EXTRA_LIBS"
1179 CPPFLAGS="$gtk_save_cppflags"
1180 LIBS="$gtk_save_libs"
1182 AM_CONDITIONAL(USE_X11, true)
1184 # strip leading space
1185 X_EXTENSIONS=${X_EXTENSIONS/# }
1190 AM_CONDITIONAL(XINPUT_XFREE, false)
1191 AM_CONDITIONAL(XINPUT_2, false)
1192 AM_CONDITIONAL(USE_X11, false)
1193 AM_CONDITIONAL(HAVE_X11R6, false)
1196 # Check for Pango flags
1198 AC_MSG_CHECKING(Pango flags)
1199 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
1200 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
1201 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1203 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1206 *** Pango not found. Pango built with Cairo support is required
1207 *** to build GTK+. See http://www.pango.org for Pango information.
1211 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1213 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1216 gtk_save_LIBS="$LIBS"
1217 LIBS="$PANGO_LIBS $LIBS"
1218 AC_TRY_LINK_FUNC(pango_context_new, :, AC_MSG_ERROR([
1219 *** Can't link to Pango. Pango is required to build
1220 *** GTK+. For more information see http://www.pango.org]))
1221 LIBS="$gtk_save_LIBS"
1224 CFLAGS="$saved_cflags"
1225 LDFLAGS="$saved_ldflags"
1227 GDK_PACKAGES="$PANGO_PACKAGES $GIO_PACKAGE $X_PACKAGES gdk-pixbuf-2.0 $cairo_backends cairo-gobject"
1229 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES`"
1230 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
1232 # If we aren't writing explicit dependencies, then don't put the extra libraries we need
1233 # into the pkg-config files
1235 if test $enable_explicit_deps != yes ; then
1236 GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 cairo-gobject"
1240 AC_SUBST(GDK_PACKAGES)
1241 AC_SUBST(GDK_EXTRA_LIBS)
1242 AC_SUBST(GDK_EXTRA_CFLAGS)
1243 AC_SUBST(GDK_DEP_LIBS)
1244 AC_SUBST(GDK_DEP_CFLAGS)
1247 ########################################
1248 # Check for Accessibility Toolkit flags
1249 ########################################
1252 AC_MSG_CHECKING(ATK flags)
1253 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1254 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1255 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1257 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1260 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1265 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1268 gtk_save_LIBS="$LIBS"
1269 LIBS="$ATK_LIBS $LIBS"
1270 AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
1271 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1272 *** to build GTK+]))
1273 LIBS="$gtk_save_LIBS"
1276 GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
1277 if test "x$enable_x11_backend" == xyes; then
1278 GTK_PACKAGES="$GTK_PACKAGES pangoft2"
1282 GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS"
1283 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PACKAGES $GTK_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1285 if test x"$os_win32" = xyes; then
1286 GTK_EXTRA_CFLAGS="$msnative_struct"
1289 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
1290 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
1291 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
1292 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
1294 AC_SUBST(GTK_PACKAGES)
1295 AC_SUBST(GTK_EXTRA_LIBS)
1296 AC_SUBST(GTK_EXTRA_CFLAGS)
1297 AC_SUBST(GTK_DEP_LIBS)
1298 AC_SUBST(GTK_DEP_CFLAGS)
1300 AC_SUBST(GLIB_PREFIX)
1301 AC_SUBST(ATK_PREFIX)
1302 AC_SUBST(PANGO_PREFIX)
1303 AC_SUBST(CAIRO_PREFIX)
1305 AC_SUBST(GTK_DEBUG_FLAGS)
1306 AC_SUBST(GTK_XIM_FLAGS)
1308 GDK_PIXBUF_LIBS=`$PKG_CONFIG --libs gdk-pixbuf-2.0`
1309 AC_SUBST(GDK_PIXBUF_LIBS)
1311 ########################
1312 # Checks needed for gail
1313 ########################
1316 dnl Checks for inet libraries:
1317 AC_SEARCH_LIBS(gethostent, nsl)
1318 AC_SEARCH_LIBS(setsockopt, socket)
1319 AC_SEARCH_LIBS(connect, inet)
1321 dnl check for the sockaddr_un.sun_len member
1322 AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
1323 [struct_sockaddr_un_sun_len=true],
1324 [struct_sockaddr_un_suin_len=false],
1325 [#include <sys/types.h>
1326 #include <sys/un.h>]
1328 case $struct_sockaddr_un_sun_len in
1330 AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_UN_SUN_LEN, 1,
1331 [Have the sockaddr_un.sun_len member])
1337 GAIL_INET_LIBS="$LIBS"
1338 AC_SUBST([GAIL_INET_LIBS])
1342 ################################################################
1343 # Printing system checks
1344 ################################################################
1346 PRINT_BACKENDS="file lpr"
1349 [AS_HELP_STRING([--disable-cups],
1350 [disable cups print backend])],,
1353 if test "x$enable_cups" = "xno"; then
1354 AM_CONDITIONAL(HAVE_CUPS, false)
1356 AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
1357 if test "x$CUPS_CONFIG" = "xno"; then
1358 if test "x$enable_cups" = "xauto"; then
1359 AM_CONDITIONAL(HAVE_CUPS, false)
1366 CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
1367 CUPS_LIBS=`$CUPS_CONFIG --libs`
1369 CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
1370 CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
1371 CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
1373 if test $CUPS_API_MAJOR -gt 1 -o \
1374 $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then
1375 AC_DEFINE(HAVE_CUPS_API_1_2, 1,
1376 [Define to 1 if CUPS 1.2 API is available])
1379 AC_SUBST(CUPS_API_MAJOR)
1380 AC_SUBST(CUPS_API_MINOR)
1381 AC_SUBST(CUPS_CFLAGS)
1384 AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
1386 PRINT_BACKENDS="$PRINT_BACKENDS cups"
1387 AM_CONDITIONAL(HAVE_CUPS, true)
1389 gtk_save_cflags="$CFLAGS"
1390 CFLAGS="$CUPS_CFLAGS"
1391 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cups/http.h>]],
1392 [[http_t http; char *s = http.authstring;]])],
1393 [AC_DEFINE([HAVE_HTTP_AUTHSTRING], [],
1394 [Define if cups http_t authstring field is accessible])],
1396 CFLAGS="$gtk_save_cflags"
1398 AC_SUBST(HAVE_HTTP_AUTHSTRING)
1400 gtk_save_libs="$LIBS"
1402 AC_CHECK_FUNCS(httpGetAuthString)
1403 LIBS="$gtk_save_libs"
1407 # Checks to see if we should compile with PAPI backend for GTK+
1411 [AS_HELP_STRING([--disable-papi],
1412 [disable papi print backend])],,
1415 if test "x$enable_papi" = "xno"; then
1416 AM_CONDITIONAL(HAVE_PAPI, false)
1418 AC_MSG_CHECKING(libpapi)
1419 AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
1420 if test $have_papi = yes; then
1421 PRINT_BACKENDS="$PRINT_BACKENDS papi"
1422 AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
1424 AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
1425 if test "x$enable_papi" = "xyes" -a "x$have_papi" = "xno"; then
1432 AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
1434 gtk_save_cppflags="$CPPFLAGS"
1435 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
1437 AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
1438 *** Can't find cairo-pdf.h. You must build Cairo with the pdf
1439 *** backend enabled.]))
1441 if test "$os_win32" != "yes"; then
1442 AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([
1443 *** Can't find cairo-ps.h. You must build Cairo with the
1444 *** postscript backend enabled.]))
1446 AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([
1447 *** Cannot find cairo-svg.h. You must build Cairo with the
1448 *** svg backend enabled.]))
1451 CPPFLAGS="$gtk_save_cppflags"
1454 AC_ARG_ENABLE(test-print-backend,
1455 [AS_HELP_STRING([--enable-test-print-backend],
1456 [build test print backend])],,
1457 [enable_test_print_backend=no])
1458 if test "x$enable_test_print_backend" != "xno" ; then
1459 PRINT_BACKENDS="$PRINT_BACKENDS test"
1461 AM_CONDITIONAL(TEST_PRINT_BACKEND, test "x$enable_test_print_backend" != "xno")
1464 ################################################################
1465 # Strip -export-dynamic from the link lines of various libraries
1466 ################################################################
1469 # pkg-config --libs gmodule includes the "export_dynamic" flag,
1470 # but this flag is only meaningful for executables. For libraries
1471 # the effect is undefined; what it causes on Linux is that the
1472 # export list from -export-symbols-regex is ignored and everything
1475 # We are using gmodule-no-export now, but I'm leaving the stripping
1476 # code in place for now, since pango and atk still require gmodule.
1478 export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
1479 if test -n "$export_dynamic"; then
1480 GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
1481 GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
1490 ##################################################
1491 # GObject introspection
1492 ##################################################
1494 GOBJECT_INTROSPECTION_CHECK([0.10.1])
1496 ##################################################
1498 #################################################
1500 AC_ARG_ENABLE(packagekit,
1501 [AS_HELP_STRING([--disable-packagekit],
1502 [build packagekit open-with module])])
1505 if test "os_win32" != "yes"; then
1506 if test "x$enable_packagekit" != "xno"; then
1507 build_packagekit=yes
1508 AC_DEFINE(ENABLE_PACKAGEKIT, 1, [define to enable packagekit])
1512 AM_CONDITIONAL(ENABLE_PACKAGEKIT, test "x$build_packagekit" = "xyes")
1514 ##################################################
1515 # Checks for gtk-doc and docbook-tools
1516 ##################################################
1518 GTK_DOC_CHECK([1.11])
1520 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1521 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1524 [AS_HELP_STRING([--enable-man],
1525 [regenerate man pages from Docbook [default=no]])],
1529 if test "${enable_man}" != no; then
1531 dnl Check for xsltproc
1533 AC_PATH_PROG([XSLTPROC], [xsltproc])
1534 if test -z "$XSLTPROC"; then
1538 dnl check for DocBook DTD and stylesheets in the local catalog.
1539 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
1540 [DocBook XML DTD V4.1.2],,enable_man=no)
1541 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
1542 [DocBook XSL Stylesheets],,enable_man=no)
1545 AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
1548 ##################################################
1550 ##################################################
1552 AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [
1553 outfile=gdkconfig.h-tmp
1554 cat > $outfile <<\_______EOF
1557 * This is a generated file. Please modify `configure.ac'
1560 #ifndef __GDKCONFIG_H__
1561 #define __GDKCONFIG_H__
1563 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
1564 #error "Only <gdk/gdk.h> can be included directly."
1573 cat >>$outfile <<_______EOF
1577 cat >>$outfile <<_______EOF
1581 #endif /* __GDKCONFIG_H__ */
1585 if cmp -s $outfile gdk/gdkconfig.h; then
1586 AC_MSG_NOTICE([gdk/gdkconfig.h is unchanged])
1589 mv $outfile gdk/gdkconfig.h
1592 gdk_windowing='$GDK_WINDOWING'
1596 dnl Check for -Bsymbolic-functions linker flag used to avoid
1597 dnl intra-library PLT jumps, if available.
1599 AC_ARG_ENABLE(Bsymbolic,
1600 [AS_HELP_STRING([--disable-Bsymbolic],
1601 [avoid linking with -Bsymbolic])],,
1602 [SAVED_LDFLAGS="${LDFLAGS}"
1603 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
1604 LDFLAGS=-Wl,-Bsymbolic-functions
1605 AC_TRY_LINK([], [int main (void) { return 0; }],
1607 enable_Bsymbolic=yes,
1609 enable_Bsymbolic=no)
1610 LDFLAGS="${SAVED_LDFLAGS}"])
1612 if test "x${enable_Bsymbolic}" = "xyes" ; then
1613 GTK_LINK_FLAGS=-Wl,-Bsymbolic-functions
1615 AC_SUBST(GTK_LINK_FLAGS)
1623 gtk+-unix-print-3.0.pc
1625 gtk+-3.0-uninstalled.pc
1626 gail-3.0-uninstalled.pc
1629 po-properties/Makefile.in
1631 demos/gtk-demo/Makefile
1632 demos/gtk-demo/geninclude.pl
1636 docs/reference/Makefile
1637 docs/reference/gdk/Makefile
1638 docs/reference/gdk/version.xml
1639 docs/reference/gtk/Makefile
1640 docs/reference/gtk/version.xml
1641 docs/reference/libgail-util/Makefile
1642 docs/reference/libgail-util/version.xml
1645 build/win32/Makefile
1646 build/win32/vs9/Makefile
1650 gdk/win32/rc/Makefile
1660 modules/other/Makefile
1661 modules/other/gail/Makefile
1662 modules/other/gail/libgail-util/Makefile
1663 modules/other/gail/tests/Makefile
1664 modules/engines/Makefile
1665 modules/engines/pixbuf/Makefile
1666 modules/engines/ms-windows/Makefile
1667 modules/engines/ms-windows/Theme/Makefile
1668 modules/engines/ms-windows/Theme/gtk-3.0/Makefile
1669 modules/input/Makefile
1670 modules/printbackends/Makefile
1671 modules/printbackends/cups/Makefile
1672 modules/printbackends/lpr/Makefile
1673 modules/printbackends/file/Makefile
1674 modules/printbackends/papi/Makefile
1675 modules/printbackends/test/Makefile
1681 # beautify the immodule list a bit
1682 included_immodules=${included_immodules//,/ }
1683 included_immodules=${included_immodules:-none}
1686 echo " GTK+ $GTK_VERSION"
1689 echo " GDK backends: $GDK_BACKENDS"
1690 if test "x$enable_x11_backend" = "xyes"; then
1691 echo " X11 extensions: $X_EXTENSIONS"
1693 echo " Print backends: $PRINT_BACKENDS"
1694 echo " Dynamic modules: $build_dynamic_modules"
1695 echo " Included immodules: $included_immodules"
1696 echo " PackageKit support: $build_packagekit"
1697 echo " Introspection: $found_introspection"
1698 echo " Debugging: $enable_debug"
1699 echo " Documentation: $enable_gtk_doc"