1# Process this file with autoconf to produce a configure script.
2# Process this file with autoconf to produce a configure script.
3# require autoconf 2.54
4AC_PREREQ(2.62)
5
6# Making releases:
7#   GTK_MICRO_VERSION += 1;
8#   GTK_INTERFACE_AGE += 1;
9#   GTK_BINARY_AGE += 1;
10# if any functions have been added, set GTK_INTERFACE_AGE to 0.
11# if backwards compatibility has been broken,
12# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
13
14m4_define([gtk_major_version], [2])
15m4_define([gtk_minor_version], [24])
16m4_define([gtk_micro_version], [33])
17m4_define([gtk_interface_age], [33])
18m4_define([gtk_binary_age],
19          [m4_eval(100 * gtk_minor_version + gtk_micro_version)])
20m4_define([gtk_version],
21          [gtk_major_version.gtk_minor_version.gtk_micro_version])
22# This is the X.Y used in -lgtk-FOO-X.Y
23m4_define([gtk_api_version], [2.0])
24
25# Define a string for the earliest version that this release has
26# backwards binary compatibility with for all interfaces a module
27# might. Unless we add module-only API with lower stability
28# guarantees, this should be unchanged until we break binary compat
29# for GTK+.
30#
31#GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
32m4_define([gtk_binary_version], [2.10.0])
33
34# required versions of other packages
35m4_define([glib_required_version], [2.28.0])
36m4_define([pango_required_version], [1.20])
37m4_define([atk_required_version], [1.29.2])
38m4_define([cairo_required_version], [1.6])
39m4_define([gdk_pixbuf_required_version], [2.21.0])
40
41
42AC_INIT([gtk+], [gtk_version],
43        [http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B],
44	[gtk+])
45
46AC_CONFIG_SRCDIR([gdk/gdktypes.h])
47AC_CONFIG_HEADERS([config.h])
48AC_CONFIG_MACRO_DIR([m4])
49
50# Save this value here, since automake will set cflags later
51cflags_set=${CFLAGS+set}
52
53AM_INIT_AUTOMAKE([no-define -Wno-portability dist-bzip2])
54
55# Support silent build rules, requires at least automake-1.11. Enable
56# by either passing --enable-silent-rules to configure or passing V=0
57# to make
58m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
59
60#
61# For each of the libraries we build, we define the following
62
63# substituted variables:
64#
65# foo_PACKAGES:     pkg-config packages this library requires
66# foo_EXTRA_LIBS:   Libraries this module requires not pulled in by pkg-config
67# foo_EXTRA_CFLAGS: cflags this module requires not pulled in by pkg-config
68# foo_DEP_LIBS:     All libraries this module requires
69# foo_DEP_CFLAGS:   All cflags this module requires
70
71
72GTK_MAJOR_VERSION=gtk_major_version
73GTK_MINOR_VERSION=gtk_minor_version
74GTK_MICRO_VERSION=gtk_micro_version
75GTK_INTERFACE_AGE=gtk_interface_age
76GTK_BINARY_AGE=gtk_binary_age
77GTK_VERSION=gtk_version
78GTK_API_VERSION=gtk_api_version
79GTK_BINARY_VERSION=gtk_binary_version
80AC_SUBST(GTK_MAJOR_VERSION)
81AC_SUBST(GTK_MINOR_VERSION)
82AC_SUBST(GTK_MICRO_VERSION)
83AC_SUBST(GTK_INTERFACE_AGE)
84AC_SUBST(GTK_BINARY_AGE)
85AC_SUBST(GTK_API_VERSION)
86AC_SUBST(GTK_VERSION)
87AC_SUBST(GTK_BINARY_VERSION)
88
89# libtool versioning
90#LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
91#LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
92#LT_REVISION=$GTK_INTERFACE_AGE
93#LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
94#LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
95
96m4_define([lt_current], [m4_eval(100 * gtk_minor_version + gtk_micro_version - gtk_interface_age)])
97m4_define([lt_revision], [gtk_interface_age])
98m4_define([lt_age], [m4_eval(gtk_binary_age - gtk_interface_age)])
99LT_VERSION_INFO="lt_current:lt_revision:lt_age"
100LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
101AC_SUBST(LT_VERSION_INFO)
102AC_SUBST(LT_CURRENT_MINUS_AGE)
103
104m4_define([gail_lt_current],[18])
105m4_define([gail_lt_revision],[1])
106m4_define([gail_lt_age],[0])
107m4_define([gail_lt_version_info],[gail_lt_current:gail_lt_revision:gail_lt_age])
108m4_define([gail_lt_current_minus_age],[m4_eval(gail_lt_current - gail_lt_age)])
109AC_SUBST([GAIL_LT_VERSION_INFO],[gail_lt_version_info])
110AC_SUBST([GAIL_LT_CURRENT_MINUS_AGE],[gail_lt_current_minus_age])
111
112GETTEXT_PACKAGE=gtk20
113AC_SUBST(GETTEXT_PACKAGE)
114AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
115                   [The prefix for our gettext translation domains.])
116
117AC_CANONICAL_HOST
118
119MATH_LIB=-lm
120AC_MSG_CHECKING([for native Win32])
121LIB_EXE_MACHINE_FLAG=X86
122EXE_MANIFEST_ARCHITECTURE=X86
123case "$host" in
124  *-*-mingw*)
125    os_win32=yes
126    gio_can_sniff=no
127    MATH_LIB=
128    case "$host" in
129    x86_64-*-*)
130      LIB_EXE_MACHINE_FLAG=X64
131      EXE_MANIFEST_ARCHITECTURE=AMD64
132      ;;
133    esac
134    ;;
135  *)
136    os_win32=no
137    ;;
138esac
139AC_MSG_RESULT([$os_win32])
140
141AC_SUBST(LIB_EXE_MACHINE_FLAG)
142AC_SUBST(EXE_MANIFEST_ARCHITECTURE)
143
144case $host in
145  *-*-linux*)
146    os_linux=yes
147    ;;
148esac
149
150dnl Initialize libtool
151AC_PROG_CC
152AM_DISABLE_STATIC
153
154dnl
155dnl Check for a working C++ compiler, but do not bail out, if none is found.
156dnl We use this for an automated test for C++ header correctness.
157dnl
158AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
159AC_LANG_SAVE
160AC_LANG_CPLUSPLUS
161
162AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
163AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
164
165gtk_save_cxxflags="$CXXFLAGS"
166CXXFLAGS="$CXXFLAGS -x objective-c++"
167AC_TRY_COMPILE([@interface Foo @end],,OBJC=yes,OBJC=no)
168AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" = "yes")
169CXXFLAGS="$gtk_save_cxxflags"
170AC_LANG_RESTORE
171
172if test "$os_win32" = "yes"; then
173  if test x$enable_static = xyes -o x$enable_static = x; then
174    AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
175    enable_static=no
176  fi
177  if test x$enable_shared = xno; then
178    AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
179  fi
180  enable_shared=yes
181fi
182
183AC_LIBTOOL_WIN32_DLL
184AM_PROG_LIBTOOL
185dnl when using libtool 2.x create libtool early, because it's used in configure
186m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
187
188
189# Make sure we use 64-bit versions of various file stuff.
190AC_SYS_LARGEFILE
191
192AM_PROG_AS
193AC_PATH_TOOL(NM, nm, nm)
194
195dnl Initialize maintainer mode
196AM_MAINTAINER_MODE([enable])
197
198AC_MSG_CHECKING([for some Win32 platform])
199case "$host" in
200  *-*-mingw*|*-*-cygwin*)
201    platform_win32=yes
202    ;;
203  *)
204    platform_win32=no
205    ;;
206esac
207AC_MSG_RESULT([$platform_win32])
208AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
209
210AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
211AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
212AM_CONDITIONAL(OS_LINUX, test "$os_linux" = "yes")
213
214if test "$os_win32" = "yes"; then
215  AC_CHECK_TOOL(WINDRES, windres, no)
216  if test "$WINDRES" = no; then
217    AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
218  fi
219  AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
220fi
221AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
222
223m4_define([debug_default],
224          m4_if(m4_eval(gtk_minor_version % 2), [1], [yes], [minimum]))
225
226dnl declare --enable-* args and collect ac_help strings
227AC_ARG_ENABLE(debug,
228              AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
229                             [turn on debugging @<:@default=debug_default@:>@]),,
230              enable_debug=debug_default)
231AC_ARG_ENABLE(shm,
232              [AC_HELP_STRING([--enable-shm],
233                              [support shared memory if available [default=yes]])],,
234              [enable_shm="yes"])
235AC_ARG_ENABLE(xkb,
236              [AC_HELP_STRING([--enable-xkb],
237                              [support XKB [default=maybe]])],,
238              [enable_xkb="maybe"])
239AC_ARG_ENABLE(xinerama,
240              [AC_HELP_STRING([--enable-xinerama],
241	                      [support xinerama extension if available [default=yes]])],,
242              [enable_xinerama="yes"])
243AC_ARG_ENABLE(rebuilds,
244              [AC_HELP_STRING([--disable-rebuilds],
245                              [disable all source autogeneration rules])],,
246              [enable_rebuilds=yes])
247AC_ARG_ENABLE(visibility,
248              [AC_HELP_STRING([--disable-visibility],
249                              [don't use ELF visibility attributes])],,
250              [enable_visibility=yes])
251
252AC_ARG_WITH(xinput,
253            [AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
254
255if test "$platform_win32" = yes; then
256  gdktarget=win32
257else
258  gdktarget=x11
259fi
260
261AC_ARG_WITH(gdktarget, [  --with-gdktarget=[[x11/win32/quartz/directfb]] select non-default GDK target],
262	gdktarget=$with_gdktarget)
263
264AC_SUBST(gdktarget)
265case $gdktarget in
266  x11|win32|quartz|directfb) ;;
267  *) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz, directfb or win32.]);;
268esac
269
270gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
271gtktargetlib=libgtk-$gdktarget-$GTK_API_VERSION.la
272
273AC_SUBST(gdktargetlib)
274AC_SUBST(gtktargetlib)
275
276if test "x$enable_debug" = "xyes"; then
277  test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
278  GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES"
279else
280  if test "x$enable_debug" = "xno"; then
281    GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
282  else
283    GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
284  fi
285fi
286
287
288if test "x$enable_visibility" = "xno"; then
289  GTK_DEBUG_FLAGS="$GTK_DEBUG_FLAGS -DDISABLE_VISIBILITY"
290fi
291
292
293AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
294                   [Define if debugging is enabled])
295
296
297# Build time sanity check...
298AM_SANITY_CHECK
299
300# Checks for programs.
301AC_ISC_POSIX
302AM_PROG_CC_C_O
303AC_PROG_INSTALL
304AC_PROG_MAKE_SET
305
306changequote(,)dnl
307if test "x$GCC" = "xyes"; then
308  case " $CFLAGS " in
309  *[\ \	]-Wall[\ \	]*) ;;
310  *) CFLAGS="$CFLAGS -Wall" ;;
311  esac
312
313  if test "x$enable_ansi" = "xyes"; then
314    case " $CFLAGS " in
315    *[\ \	]-ansi[\ \	]*) ;;
316    *) CFLAGS="$CFLAGS -ansi" ;;
317    esac
318
319    case " $CFLAGS " in
320    *[\ \	]-pedantic[\ \	]*) ;;
321    *) CFLAGS="$CFLAGS -pedantic" ;;
322    esac
323  fi
324fi
325changequote([,])dnl
326
327CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
328
329# Ensure MSVC-compatible struct packing convention is used when
330# compiling for Win32 with gcc.
331# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
332# gcc2 uses "-fnative-struct".
333if test x"$os_win32" = xyes; then
334  if test x"$GCC" = xyes; then
335    msnative_struct=''
336    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
337    if test -z "$ac_cv_prog_CC"; then
338      our_gcc="$CC"
339    else
340      our_gcc="$ac_cv_prog_CC"
341    fi
342    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
343      2.)
344	if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
345	  msnative_struct='-fnative-struct'
346	fi
347	;;
348      *)
349	if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
350	  msnative_struct='-mms-bitfields'
351	fi
352	;;
353    esac
354    if test x"$msnative_struct" = x ; then
355      AC_MSG_RESULT([no way])
356      AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
357    else
358      CFLAGS="$CFLAGS $msnative_struct"
359      AC_MSG_RESULT([${msnative_struct}])
360    fi
361  fi
362fi
363
364# Honor aclocal flags
365ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
366
367## Initial sanity check, done here so that users get told they
368## have the wrong dependencies as early in the process as possible.
369## Later on we actually use the cflags/libs from separate pkg-config
370## calls. Oh, also the later pkg-config calls don't include
371## the version requirements since those make the module lists
372## annoying to construct
373PKG_CHECK_MODULES(BASE_DEPENDENCIES,
374  [glib-2.0 >= glib_required_version dnl
375   atk >= atk_required_version dnl
376   pango >= pango_required_version dnl
377   cairo >= cairo_required_version dnl
378   gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
379
380## In addition to checking that cairo is present, we also need to
381## check that the correct cairo backend is there. E.g. if the GDK
382## target is win32 we need the cairo-win32 backend and so on.
383cairo_backend=$gdktarget
384
385# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
386# backend names are identical.
387if test "x$cairo_backend" = "xx11"; then
388   cairo_backend=xlib
389fi
390PKG_CHECK_MODULES(CAIRO_BACKEND,
391  [cairo-$cairo_backend >= cairo_required_version])
392
393PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
394
395if test "$os_win32" != yes; then
396    # libtool option to control which symbols are exported
397    # right now, symbols starting with _ are not exported
398    LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
399else
400    # We currently use .def files on Windows (for gdk and gtk)
401    LIBTOOL_EXPORT_OPTIONS=
402fi
403AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
404
405dnl ******************************************************
406dnl * See whether to include shared library dependencies *
407dnl ******************************************************
408
409AC_ARG_ENABLE(explicit-deps,
410              [AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
411                              [use explicit dependencies in .pc files [default=auto]])],,
412              [enable_explicit_deps=auto])
413
414AC_MSG_CHECKING([Whether to write dependencies into .pc files])
415case $enable_explicit_deps in
416  auto)
417    export SED
418    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
419    if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
420      enable_explicit_deps=yes
421    else
422      enable_explicit_deps=no
423    fi
424  ;;
425  yes|no)
426  ;;
427  *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
428  ;;
429esac
430AC_MSG_RESULT($enable_explicit_deps)
431
432AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
433
434# define a MAINT-like variable REBUILD which is set if Perl
435# and awk are found, so autogenerated sources can be rebuilt
436
437AC_PATH_PROGS(PERL, perl5 perl)
438
439# We would like indent, but don't require it.
440AC_CHECK_PROG(INDENT, indent, indent)
441
442REBUILD=\#
443if test "x$enable_rebuilds" = "xyes" && \
444     test -n "$PERL" && \
445     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
446  REBUILD=
447fi
448AC_SUBST(REBUILD)
449
450AC_CHECK_FUNCS(lstat mkstemp flockfile getc_unlocked)
451AC_CHECK_FUNCS(localtime_r)
452
453# _NL_TIME_FIRST_WEEKDAY is an enum and not a define
454AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
455AC_TRY_LINK([#include <langinfo.h>], [
456char c;
457c = *((unsigned char *)  nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
458], gtk_ok=yes, gtk_ok=no)
459AC_MSG_RESULT($gtk_ok)
460if test "$gtk_ok" = "yes"; then
461  AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
462	    [Define if _NL_TIME_FIRST_WEEKDAY is available])
463fi
464
465# _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
466AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
467AC_TRY_LINK([#include <langinfo.h>], [
468char c;
469c = *((unsigned char *)  nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
470], gtk_ok=yes, gtk_ok=no)
471AC_MSG_RESULT($gtk_ok)
472if test "$gtk_ok" = "yes"; then
473  AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
474	    [Define if _NL_MEASUREMENT_MEASUREMENT is available])
475fi
476
477# _NL_PAPER_HEIGHT is an enum and not a define
478AC_MSG_CHECKING([for _NL_PAPER_HEIGHT])
479AC_TRY_LINK([#include <langinfo.h>], [
480char c;
481c = *((unsigned char *)  nl_langinfo(_NL_PAPER_HEIGHT));
482], gtk_ok=yes, gtk_ok=no)
483AC_MSG_RESULT($gtk_ok)
484if test "$gtk_ok" = "yes"; then
485  AC_DEFINE([HAVE__NL_PAPER_HEIGHT], [1],
486	    [Define if _NL_PAPER_HEIGHT is available])
487fi
488
489# _NL_PAPER_WIDTH is an enum and not a define
490AC_MSG_CHECKING([for _NL_PAPER_WIDTH])
491AC_TRY_LINK([#include <langinfo.h>], [
492char c;
493c = *((unsigned char *)  nl_langinfo(_NL_PAPER_WIDTH));
494], gtk_ok=yes, gtk_ok=no)
495AC_MSG_RESULT($gtk_ok)
496if test "$gtk_ok" = "yes"; then
497  AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1],
498	    [Define if _NL_PAPER_WIDTH is available])
499fi
500
501# sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
502AC_MSG_CHECKING(for sigsetjmp)
503AC_TRY_LINK([#include <setjmp.h>], [
504sigjmp_buf env;
505sigsetjmp(env, 0);
506], gtk_ok=yes, gtk_ok=no)
507AC_MSG_RESULT($gtk_ok)
508if test "$gtk_ok" = "yes"; then
509  AC_DEFINE(HAVE_SIGSETJMP, 1,
510            [Define to 1 if sigsetjmp is available])
511fi
512
513# i18n stuff
514ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
515AM_GLIB_GNU_GETTEXT
516LIBS="$LIBS $INTLLIBS"
517AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
518        sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
519      esac])
520
521dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
522dnl po-properties/POTFILES during configure; see GNOME #573515.
523dnl
524dnl Generate list of files to be processed by xgettext which will
525dnl be included in po-properties/Makefile.
526test -d po-properties || mkdir po-properties
527if test "x$srcdir" != "x."; then
528  if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
529    popropsrcprefix="$srcdir/"
530  else
531    popropsrcprefix="../$srcdir/"
532  fi
533else
534  popropsrcprefix="../"
535fi
536rm -f po-properties/POTFILES
537sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$popropsrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
538< $srcdir/po-properties/POTFILES.in > po-properties/POTFILES
539dnl (End of adapted AM_GLIB_GNU_GETTEXT snippet.)
540
541AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR)
542
543dnl The DU4 header files don't provide library prototypes unless
544dnl -std1 is given to the native cc.
545AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
546
547gtk_save_LIBS=$LIBS
548LIBS="$LIBS -lm"
549AC_TRY_RUN([#include <math.h>
550             int main (void) { return (log(1) != log(1.)); }],
551     AC_MSG_RESULT(none needed),
552     gtk_save_CFLAGS="$CFLAGS"
553     CFLAGS="$CFLAGS -std1"
554     AC_TRY_RUN([#include <math.h>
555	         int main (void) { return (log(1) != log(1.)); }],
556         AC_MSG_RESULT(-std1),
557         AC_MSG_RESULT()
558         CFLAGS="$gtk_save_CFLAGS"
559         AC_MSG_WARN(
560                [No ANSI prototypes found in library. (-std1 didn't work.)]),
561	 true
562     ),
563     AC_MSG_RESULT(none needed)
564)
565LIBS=$gtk_save_LIBS
566
567AC_MSG_CHECKING(for the BeOS)
568case $host in
569  *-*-beos*)
570    AC_MSG_RESULT(yes)
571    MATH_LIB=
572  ;;
573  *)
574    AC_MSG_RESULT(no)
575  ;;
576esac
577
578AC_SUBST(MATH_LIB)
579#
580# see bug 162979
581#
582AC_MSG_CHECKING(for HP-UX)
583case $host_os in
584  hpux9* | hpux10* | hpux11*)
585    AC_MSG_RESULT(yes)
586    CFLAGS="$CFLAGS -DHPPEX -DSHMLINK"
587  ;;
588  *)
589    AC_MSG_RESULT(no)
590  ;;
591esac
592
593dnl NeXTStep cc seems to need this
594AC_MSG_CHECKING([for extra flags for POSIX compliance])
595AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
596  AC_MSG_RESULT(none needed),
597  gtk_save_CFLAGS="$CFLAGS"
598  CFLAGS="$CFLAGS -posix"
599  AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
600    AC_MSG_RESULT(-posix),
601    AC_MSG_RESULT()
602    CFLAGS="$gtk_save_CFLAGS"
603    AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
604
605#
606# Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
607#
608
609GLIB_PACKAGES="gobject-2.0 gio-2.0 gmodule-no-export-2.0"
610
611AM_PATH_GLIB_2_0(glib_required_version, :,
612  AC_MSG_ERROR([
613*** GLIB glib_required_version or better is required. The latest version of
614*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
615  gobject gmodule-no-export gthread)
616
617# See if it's safe to turn G_DISABLE_DEPRECATED on.
618GLIB_VERSION_MAJOR_MINOR=`$PKG_CONFIG --modversion glib-2.0 | sed "s/\.@<:@^.@:>@*\$//"`
619GLIB_REQUIRED_VERSION_MAJOR_MINOR=`echo glib_required_version | sed "s/\.@<:@^.@:>@*\$//"`
620if test "x$GLIB_VERSION_MAJOR_MINOR" = "x$GLIB_REQUIRED_VERSION_MAJOR_MINOR"; then
621  CFLAGS="-DG_DISABLE_DEPRECATED $CFLAGS"
622fi
623
624
625dnl
626dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
627dnl
628gtk_save_LIBS=$LIBS
629LIBS="$LIBS $GLIB_LIBS"
630AC_CHECK_FUNCS(bind_textdomain_codeset)
631LIBS=$gtk_save_LIBS
632
633AC_CHECK_HEADERS(pwd.h,
634                 AC_DEFINE(HAVE_PWD_H, 1,
635                           [Define to 1 if pwd.h is available]))
636AC_CHECK_HEADERS(sys/time.h,
637                 AC_DEFINE(HAVE_SYS_TIME_H, 1,
638                           [Define to 1 if time.h is available]))
639AC_CHECK_HEADERS(unistd.h,
640                 AC_DEFINE(HAVE_UNISTD_H, 1,
641                           [Define to 1 if unistd.h is available]))
642AC_CHECK_HEADERS(ftw.h,
643                 AC_DEFINE(HAVE_FTW_H, 1,
644                           [Define to 1 if ftw.h is available]))
645
646AC_MSG_CHECKING([for GNU ftw extensions])
647AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
648#define _GNU_SOURCE
649#include <ftw.h>], [int flags = FTW_ACTIONRETVAL;], gtk_ok=yes, gtk_ok=no)
650if test $gtk_ok = yes; then
651    AC_MSG_RESULT([yes])
652    AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
653else
654    AC_MSG_RESULT([no])
655fi
656
657saved_cflags="$CFLAGS"
658saved_ldflags="$LDFLAGS"
659
660
661# Checks for header files.
662AC_HEADER_STDC
663
664# Checks for typedefs, structures, and compiler characteristics.
665AC_C_CONST
666
667# Checks for library functions.
668AC_TYPE_SIGNAL
669AC_FUNC_MMAP
670
671AC_CHECK_FUNCS(mallinfo)
672AC_CHECK_FUNCS(getresuid)
673AC_TYPE_UID_T
674
675# Check if <sys/select.h> needs to be included for fd_set
676AC_MSG_CHECKING([for fd_set])
677AC_TRY_COMPILE([#include <sys/types.h>],
678        [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
679if test $gtk_ok = yes; then
680    AC_MSG_RESULT([yes, found in sys/types.h])
681else
682    AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
683    if test $gtk_ok = yes; then
684        AC_DEFINE(HAVE_SYS_SELECT_H, 1,
685                  [Define to 1 if sys/select.h is available])
686        AC_MSG_RESULT([yes, found in sys/select.h])
687    else
688	AC_DEFINE(NO_FD_SET, 1,
689                  [Define to 1 if fd_set is not available])
690	AC_MSG_RESULT(no)
691    fi
692fi
693
694# `widechar' tests for gdki18n.h
695AC_MSG_CHECKING(for wchar.h)
696AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
697if test $gdk_wchar_h = yes; then
698   AC_DEFINE(HAVE_WCHAR_H, 1, [Have wchar.h include file])
699fi
700AC_MSG_RESULT($gdk_wchar_h)
701
702# Check for wctype.h (for iswalnum)
703AC_MSG_CHECKING(for wctype.h)
704AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
705if test $gdk_wctype_h = yes; then
706   AC_DEFINE(HAVE_WCTYPE_H, 1, [Have wctype.h include file])
707fi
708AC_MSG_RESULT($gdk_wctype_h)
709
710# in Solaris 2.5, `iswalnum' is in -lw
711GDK_WLIBS=
712AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
713
714oLIBS="$LIBS"
715LIBS="$LIBS $GDK_WLIBS"
716# The following is necessary for Linux libc-5.4.38
717AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
718AC_TRY_LINK([#include <stdlib.h>
719#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
720#  ifdef HAVE_WCTYPE_H
721#    include <wctype.h>
722#  else
723#    ifdef HAVE_WCHAR_H
724#      include <wchar.h>
725#    endif
726#  endif
727#else
728#  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
729#endif],[
730iswalnum((wchar_t) 0);
731], gdk_working_wctype=yes, gdk_working_wctype=no)
732LIBS="$oLIBS"
733
734if test $gdk_working_wctype = no; then
735   AC_DEFINE(HAVE_BROKEN_WCTYPE, 1, [Is the wctype implementation broken])
736   GDK_WLIBS=
737fi
738AC_MSG_RESULT($gdk_working_wctype)
739AC_SUBST(GDK_WLIBS)
740
741# Check for uxtheme.h (for MS-Windows Engine)
742AC_MSG_CHECKING(for uxtheme.h)
743AC_TRY_CPP([#include <uxtheme.h>], gtk_uxtheme_h=yes, gtk_uxtheme_h=no)
744if test $gtk_uxtheme_h = yes; then
745   AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
746fi
747AC_MSG_RESULT($gtk_uxtheme_h)
748
749# Checks for gdkspawn
750AC_CHECK_HEADERS(crt_externs.h)
751AC_CHECK_FUNCS(_NSGetEnviron)
752
753AC_MSG_CHECKING(whether to build dynamic modules)
754
755AC_ARG_ENABLE(modules,
756              [AC_HELP_STRING([--disable-modules],
757                              [disable dynamic module loading])])
758
759dynworks=false
760deps=
761if test x$enable_modules = xno; then
762    AC_MSG_RESULT(no)
763else
764    AC_MSG_RESULT(yes)
765    AC_MSG_CHECKING(whether dynamic modules work)
766    ## for loop is to strip newline
767    tmp=`$PKG_CONFIG --variable=gmodule_supported gmodule-no-export-2.0`
768    for I in $tmp; do
769        dynworks=$I
770    done
771
772    dnl Now we check to see if our libtool supports shared lib deps
773    dnl (in a rather ugly way even)
774    if $dynworks; then
775        module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
776        module_deplibs_check=`$module_libtool_config | \
777            grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
778            sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
779        if test "x$module_deplibs_check" = "xnone" || \
780           test "x$module_deplibs_check" = "xunknown" || \
781           test "x$module_deplibs_check" = "x"; then
782            dynworks=false
783        fi
784    fi
785
786    if $dynworks; then
787        AC_DEFINE(USE_GMODULE, 1,
788                  [Define to 1 if gmodule works and should be used])
789        AC_MSG_RESULT(yes)
790    else
791        AC_MSG_RESULT(no)
792    fi
793fi
794
795AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
796
797#
798# Allow building some or all immodules included
799#
800AC_MSG_CHECKING(immodules to build)
801
802dnl due to an autoconf bug, commas in the first arg to
803dnl AC_HELP_STRING cause problems.
804dnl AC_HELP_STRING([--with-included-immodules=MODULE1 MODULE2 ...],
805dnl                [build the specified input method modules into gtk])
806AC_ARG_WITH(included_immodules,
807[  --with-included-immodules=MODULE1,MODULE2,...
808                          build the specified input methods into gtk])
809
810if $dynworks; then
811   :
812else
813   ## if the option was specified, leave it; otherwise disable included immodules
814   if test x$with_included_immodules = xno; then
815           with_included_immodules=yes
816   fi
817fi
818
819all_immodules="am-et,cedilla,cyrillic-translit"
820if test "$gdktarget" = "win32"; then
821   all_immodules="${all_immodules},ime"
822fi
823if test "$gdktarget" = "quartz"; then
824   all_immodules="${all_immodules},quartz"
825fi
826all_immodules="${all_immodules},inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr"
827if test "$gdktarget" = "x11"; then
828   all_immodules="${all_immodules},xim"
829fi
830
831included_immodules=""
832# If the switch specified without listing any specific ones, include all
833if test "x$with_included_immodules" = xyes ; then
834  included_immodules="$all_immodules"
835else
836  included_immodules="$with_included_immodules"
837fi
838
839AC_MSG_RESULT($included_immodules)
840AM_CONDITIONAL(HAVE_INCLUDED_IMMMODULES, test "x$included_immodules" != x)
841
842INCLUDED_IMMODULE_OBJ=
843INCLUDED_IMMODULE_DEFINE=
844
845IFS="${IFS= 	}"; gtk_save_ifs="$IFS"; IFS=","
846for immodule in $included_immodules; do
847 immodule_underscores=`echo $immodule | sed -e 's/-/_/g'`
848 if echo "$all_immodules" | egrep "(^|,)$immodule(\$|,)" > /dev/null; then
849   :
850 else
851   AC_MSG_ERROR([the specified input method $immodule does not exist])
852 fi
853
854 INCLUDED_IMMODULE_OBJ="$INCLUDED_IMMODULE_OBJ ../modules/input/libstatic-im-$immodule.la"
855 INCLUDED_IMMODULE_DEFINE="$INCLUDED_IMMODULE_DEFINE -DINCLUDE_IM_$immodule_underscores"
856 eval INCLUDE_$immodule_underscores=yes
857done
858IFS="$gtk_save_ifs"
859AC_SUBST(INCLUDED_IMMODULE_OBJ)
860AC_SUBST(INCLUDED_IMMODULE_DEFINE)
861
862AM_CONDITIONAL(INCLUDE_IM_AM_ET, [test x"$INCLUDE_am_et" = xyes])
863AM_CONDITIONAL(INCLUDE_IM_CEDILLA, [test x"$INCLUDE_cedilla" = xyes])
864AM_CONDITIONAL(INCLUDE_IM_CYRILLIC_TRANSLIT, [test x"$INCLUDE_cyrillic_translit" = xyes])
865AM_CONDITIONAL(INCLUDE_IM_IME, [test x"$INCLUDE_ime" = xyes])
866AM_CONDITIONAL(INCLUDE_IM_INUKTITUT, [test x"$INCLUDE_inuktitut" = xyes])
867AM_CONDITIONAL(INCLUDE_IM_IPA, [test x"$INCLUDE_ipa" = xyes])
868AM_CONDITIONAL(INCLUDE_IM_MULTIPRESS, [test x"$INCLUDE_multipress" = xyes])
869AM_CONDITIONAL(INCLUDE_IM_QUARTZ, [test x"$INCLUDE_quartz" = xyes])
870AM_CONDITIONAL(INCLUDE_IM_THAI, [test x"$INCLUDE_thai" = xyes])
871AM_CONDITIONAL(INCLUDE_IM_TI_ER, [test x"$INCLUDE_ti_er" = xyes])
872AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
873AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
874AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
875
876AC_HEADER_SYS_WAIT
877
878AC_TYPE_SIGNAL
879
880# Checks to see whether we should include mediaLib
881# support.
882#
883AC_CHECK_HEADER(sys/systeminfo.h,
884                AC_DEFINE(HAVE_SYS_SYSTEMINFO_H, 1,
885                          [Define to 1 if sys/systeminfo.h is available]))
886AC_CHECK_HEADER(sys/sysinfo.h,
887                AC_DEFINE(HAVE_SYS_SYSINFO_H, 1,
888                          [Define to 1 if sys/sysinfo.h is available]))
889
890AC_MSG_CHECKING(for mediaLib 2.3)
891use_mlib25=no
892# Check for a mediaLib 2.3 function since that is what the GTK+ mediaLib
893# patch requires.
894AC_CHECK_LIB(mlib, mlib_ImageSetStruct, use_mlib=yes, use_mlib=no)
895if test $use_mlib = yes; then
896    AC_DEFINE(USE_MEDIALIB, 1,
897              [Define to 1 if medialib is available and should be used])
898    MEDIA_LIB=-lmlib
899
900    AC_MSG_CHECKING(for mediaLib 2.5)
901    # Check for a mediaLib 2.5 function since that is what is needed for
902    # gdk_rgb_convert integration.
903    AC_CHECK_LIB(mlib, mlib_VideoColorRGBint_to_BGRAint, use_mlib25=yes, use_mlib25=no)
904    if test $use_mlib25 = yes; then
905        AC_DEFINE(USE_MEDIALIB25, 1,
906                  [Define to 1 if medialib 2.5 is available])
907    fi
908fi
909AM_CONDITIONAL(USE_MEDIALIB, test $use_mlib = yes)
910AM_CONDITIONAL(USE_MEDIALIB25, test $use_mlib25 = yes)
911
912dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
913
914AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
915
916if test $cross_compiling = yes; then
917  AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
918  if test x$GTK_UPDATE_ICON_CACHE = xno; then
919    REBUILD_PNGS=#
920  fi
921fi
922
923AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
924
925if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
926   test "x$REBUILD_PNGS" = "x#" ; then
927     AC_MSG_ERROR([
928*** gtkbuiltincache.h is not in the tree, and cannot be built
929*** because you don't have libpng, or (when cross-compiling) you
930*** don't have a prebuilt gtk-update-icon-cache on the build system.])
931fi
932
933########################################
934# Windowing system checks
935########################################
936
937GDK_EXTRA_LIBS="$GDK_WLIBS"
938GDK_EXTRA_CFLAGS=
939
940# GTK+ uses some X calls, so needs to link against X directly
941GTK_DEP_PACKAGES_FOR_X=
942GTK_DEP_LIBS_FOR_X=
943
944if test "x$gdktarget" = "xx11"; then
945  X_PACKAGES=fontconfig
946
947  #
948  # We use fontconfig very peripherally when decoding the default
949  # settings.
950  #
951  if $PKG_CONFIG --exists fontconfig; then : ; else
952    AC_MSG_ERROR([
953*** fontconfig (http://www.fontconfig.org) is required by the X11 backend.])
954  fi
955
956  #
957  # Check for basic X packages; we use pkg-config if available
958  #
959  if $PKG_CONFIG --exists x11 xext xrender; then
960    have_base_x_pc=true
961    X_PACKAGES="$X_PACKAGES x11 xext xrender"
962    x_libs="`$PKG_CONFIG --libs x11 xext xrender`"
963    X_CFLAGS="`$PKG_CONFIG --cflags x11 xext xrender`"
964
965    # Strip out any .la files that pkg-config might give us (this happens
966    # with -uninstalled.pc files)
967    x_libs_for_checks=
968    for I in $x_libs ; do
969      case $I in
970        *.la) ;;
971        *) x_libs_for_checks="$x_libs_for_checks $I" ;;
972      esac
973    done
974
975    GTK_PACKAGES_FOR_X="x11"
976  else
977    have_base_x_pc=false
978    AC_PATH_XTRA
979    if test x$no_x = xyes ; then
980      AC_MSG_ERROR([X development libraries not found])
981    fi
982
983    x_cflags="$X_CFLAGS"
984    x_libs_for_checks="$X_LIBS -lXext -lXrender -lX11 $X_EXTRA_LIBS"
985
986    GTK_DEP_LIBS_FOR_X="$X_LIBS -lXrender -lX11 $X_EXTRA_LIBS"
987  fi
988
989  # Extra libraries found during checks (-lXinerama, etc), not from pkg-config.
990  x_extra_libs=
991
992  gtk_save_cppflags="$CPPFLAGS"
993  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
994
995  gtk_save_LIBS=$LIBS
996  LIBS="$x_libs_for_checks $LIBS"
997
998  # Sanity check for the X11 and Xext libraries. While everything we need from
999  # Xext is optional, the chances a system has *none* of these things is so
1000  # small that we just unconditionally require it.
1001  AC_CHECK_FUNC(XOpenDisplay, :,
1002                AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
1003  AC_CHECK_FUNC(XextFindDisplay, :,
1004                AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
1005  AC_CHECK_FUNC(XRenderQueryExtension, :,
1006                AC_MSG_ERROR([*** libXrender not found. Check 'config.log' for more details.]))
1007
1008  # Check for xReply
1009
1010  AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
1011  AC_TRY_COMPILE([#include <X11/Xlibint.h>],
1012      [xReply *rep;],
1013      [AC_MSG_RESULT([no])],
1014      [AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
1015#include <X11/Xlibint.h>],
1016           [xReply *rep;],
1017           [AC_MSG_RESULT([yes])
1018            AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
1019                      [Define if <X11/extensions/XIproto.h> needed for xReply])],
1020           [AC_MSG_RESULT([unknown])
1021            AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
1022
1023  # Check for XConvertCase, XInternAtoms (X11R6 specific)
1024
1025  AC_CHECK_FUNCS(XConvertCase XInternAtoms)
1026
1027  # Generic X11R6 check needed for XIM support; we could
1028  # probably use this to replace the above, but we'll
1029  # leave the separate checks for XConvertCase and XInternAtoms
1030  # for clarity
1031
1032  have_x11r6=false
1033  AC_CHECK_FUNC(XAddConnectionWatch,
1034      have_x11r6=true)
1035
1036  if $have_x11r6; then
1037    AC_DEFINE(HAVE_X11R6, 1, [Define if we have X11R6])
1038  fi
1039  AM_CONDITIONAL(HAVE_X11R6, $have_x11r6)
1040
1041  # Check for XKB support.
1042
1043  if test "x$enable_xkb" = "xyes"; then
1044        AC_MSG_WARN(XKB support explicitly enabled)
1045        AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
1046  elif test "x$enable_xkb" = "xmaybe"; then
1047        AC_CHECK_FUNC(XkbQueryExtension,
1048                      AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]))
1049  else
1050        AC_MSG_WARN(XKB support explicitly disabled)
1051  fi
1052
1053  # Check for shaped window extension
1054
1055  AC_CHECK_FUNC(XShapeCombineMask, :,
1056     [AC_MSG_ERROR([Shape extension not found, check your development headers])])
1057
1058  # X SYNC check
1059  gtk_save_CFLAGS="$CFLAGS"
1060  CFLAGS="$CFLAGS $x_cflags"
1061
1062  AC_CHECK_FUNC(XSyncQueryExtension,
1063      [AC_CHECK_HEADER(X11/extensions/sync.h,
1064	  AC_DEFINE(HAVE_XSYNC, 1, [Have the SYNC extension library]),
1065	  :, [#include <X11/Xlib.h>])])
1066
1067  CFLAGS="$gtk_save_CFLAGS"
1068
1069  # Xshm checks
1070
1071  if test "x$enable_shm" = "xyes"; then
1072     # Check for the XShm extension, normally in Xext
1073     AC_CHECK_FUNC(XShmAttach,
1074	:,
1075	# On AIX, it is in XextSam instead
1076	[AC_CHECK_LIB(XextSam, XShmAttach,
1077	    [GTK_ADD_LIB(x_extra_libs,XextSam)])])
1078  fi
1079
1080  if test "x$enable_shm" = "xyes"; then
1081    # Check for shared memory
1082    AC_CHECK_HEADER(sys/ipc.h,
1083                    AC_DEFINE(HAVE_IPC_H, 1,
1084                              [Define to 1 if ipc.h is available]),
1085                    no_sys_ipc=yes)
1086    AC_CHECK_HEADER(sys/shm.h,
1087                    AC_DEFINE(HAVE_SHM_H, 1,
1088                              [Define to 1 if shm.h is available]),
1089                    no_sys_shm=yes)
1090
1091    # Check for the X shared memory extension header file
1092    have_xshm=no
1093    AC_MSG_CHECKING(X11/extensions/XShm.h)
1094    if test "x$no_xext_lib" = "xyes"; then
1095      :
1096    else
1097      gtk_save_CFLAGS="$CFLAGS"
1098      CFLAGS="$CFLAGS $x_cflags"
1099      AC_TRY_COMPILE([
1100#include <stdlib.h>
1101#include <sys/types.h>
1102#include <sys/ipc.h>
1103#include <sys/shm.h>
1104#include <X11/Xlib.h>
1105#include <X11/Xutil.h>
1106#include <X11/extensions/XShm.h>
1107], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
1108      CFLAGS="$gtk_save_CFLAGS"
1109    fi
1110    AC_MSG_RESULT($have_xshm)
1111    if test $have_xshm = yes ; then
1112      AC_DEFINE(HAVE_XSHM_H, 1,
1113                [Define to 1 if xshm.h is available])
1114    fi
1115  fi
1116
1117  if test "x$enable_xinerama" = "xyes"; then
1118    # Check for Xinerama extension (Solaris impl or Xfree impl)
1119    gtk_save_cppflags="$CPPFLAGS"
1120    CPPFLAGS="$CPPFLAGS $x_cflags"
1121
1122    # Check for XFree
1123    AC_MSG_CHECKING(for Xinerama support on XFree86)
1124
1125    have_xfree_xinerama=false
1126    if $PKG_CONFIG --exists xinerama ; then
1127       have_xfree_xinerama=true
1128       X_PACKAGES="$X_PACKAGES xinerama"
1129    else
1130       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
1131	   [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
1132	   [GTK_ADD_LIB(x_extra_libs,Xinerama)
1133	   have_xfree_xinerama=true], :,
1134           [#include <X11/Xlib.h>])])
1135    fi
1136
1137    if $have_xfree_xinerama ; then
1138      AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
1139                [Define to 1 if XFree Xinerama is available])
1140      AC_DEFINE(HAVE_XINERAMA, 1,
1141                [Define to 1 is Xinerama is available])
1142      AC_MSG_RESULT(yes)
1143    else
1144      AC_MSG_RESULT(no)
1145
1146      case "$host" in
1147        *-*-solaris*)
1148            # Check for solaris
1149	    AC_MSG_CHECKING(for Xinerama support on Solaris)
1150
1151	    have_solaris_xinerama=false
1152	    AC_CHECK_FUNC(XineramaGetInfo,
1153	        [AC_CHECK_HEADER(X11/extensions/xinerama.h,
1154  	  	    [have_solaris_xinerama=true], :,
1155		    [#include <X11/Xlib.h>])])
1156
1157            if $have_solaris_xinerama ; then
1158              AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
1159                        [Define to 1 if solaris xinerama is available])
1160	      AC_DEFINE(HAVE_XINERAMA, 1,
1161                        [Define to 1 if xinerama is available])
1162              AC_MSG_RESULT(yes)
1163            else
1164              AC_MSG_RESULT(no)
1165            fi
1166            ;;
1167        *)
1168            ;;
1169      esac
1170    fi
1171  fi
1172
1173  # set up things for XInput
1174
1175  if test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then
1176    AC_DEFINE(XINPUT_XFREE, 1,
1177              [Define to 1 if XFree XInput should be used])
1178
1179    if $PKG_CONFIG --exists xi ; then
1180      X_PACKAGES="$X_PACKAGES xi"
1181    else
1182      GTK_ADD_LIB(x_extra_libs, Xi)
1183    fi
1184  else
1185    AC_DEFINE(XINPUT_NONE, 1,
1186              [Define to 1 if no XInput should be used])
1187  fi
1188
1189  AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree || test x$with_xinput = xyes)
1190
1191  # Check for the RANDR extension
1192  if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
1193     AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
1194
1195     if $PKG_CONFIG --exists "xrandr >= 1.5.0" ; then
1196       AC_DEFINE(HAVE_RANDR15, 1, [Have the Xrandr 1.5 extension library])
1197     fi
1198     X_PACKAGES="$X_PACKAGES xrandr"
1199  fi
1200
1201  # Checks for Xcursor library
1202
1203  if $PKG_CONFIG --exists xcursor ; then
1204    AC_DEFINE(HAVE_XCURSOR, 1, [Have the Xcursor library])
1205
1206    X_PACKAGES="$X_PACKAGES xcursor"
1207  fi
1208
1209  # Checks for XFixes extension
1210
1211  if $PKG_CONFIG --exists xfixes ; then
1212    AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
1213
1214    X_PACKAGES="$X_PACKAGES xfixes"
1215    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
1216  fi
1217
1218  # Checks for Xcomposite extension
1219
1220  if $PKG_CONFIG --exists xcomposite ; then
1221    AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
1222
1223    X_PACKAGES="$X_PACKAGES xcomposite"
1224    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
1225  fi
1226
1227  # Checks for Xdamage extension
1228
1229  if $PKG_CONFIG --exists xdamage ; then
1230    AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
1231
1232    X_PACKAGES="$X_PACKAGES xdamage"
1233    GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
1234  fi
1235
1236  if $have_base_x_pc ; then
1237    GDK_EXTRA_LIBS="$x_extra_libs"
1238  else
1239    GDK_EXTRA_LIBS="$X_LIBS $x_extra_libs -lXext -lX11 $GDK_EXTRA_LIBS"
1240  fi
1241
1242  CPPFLAGS="$gtk_save_cppflags"
1243  LIBS="$gtk_save_libs"
1244
1245  AM_CONDITIONAL(USE_X11, true)
1246else
1247  XPACKAGES=
1248
1249  AM_CONDITIONAL(XINPUT_XFREE, false)
1250  AM_CONDITIONAL(USE_X11, false)
1251  AM_CONDITIONAL(HAVE_X11R6, false)
1252fi
1253
1254if test "x$gdktarget" = "xwin32"; then
1255  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
1256  AM_CONDITIONAL(USE_WIN32, true)
1257else
1258  AM_CONDITIONAL(USE_WIN32, false)
1259fi
1260
1261AC_ARG_ENABLE(quartz-relocation,
1262              [AS_HELP_STRING([--enable-quartz-relocation],
1263                              [enable bundle-based relocation functions])],
1264                              [quartz_relocation=yes])
1265
1266if test "x$gdktarget" = "xquartz"; then
1267  GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -framework Cocoa"
1268  AM_CONDITIONAL(USE_QUARTZ, true)
1269  if test "x$quartz_relocation" = xyes; then
1270    AC_DEFINE([QUARTZ_RELOCATION], [1], [Use NSBundle functions to determine load paths for libraries, translations, etc.])
1271  fi
1272
1273else
1274  AM_CONDITIONAL(USE_QUARTZ, false)
1275fi
1276
1277if test "x$gdktarget" = "xdirectfb"; then
1278  DIRECTFB_REQUIRED_VERSION=1.0.0
1279  AC_MSG_CHECKING(for DirectFB)
1280
1281  PKG_CHECK_MODULES(DIRECTFB, [directfb >= $DIRECTFB_REQUIRED_VERSION])
1282  AM_CONDITIONAL(USE_DIRECTFB, true)
1283else
1284  AM_CONDITIONAL(USE_DIRECTFB, false)
1285fi
1286
1287
1288# Check for Pango flags
1289
1290if test "x$gdktarget" = "xwin32"; then
1291	PANGO_PACKAGES="pangowin32 pangocairo"
1292else
1293	PANGO_PACKAGES="pango pangocairo"
1294fi
1295
1296AC_MSG_CHECKING(Pango flags)
1297if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
1298        PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
1299        PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1300
1301        AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1302else
1303        AC_MSG_ERROR([
1304*** Pango not found. Pango built with Cairo support is required
1305*** to build GTK+. See http://www.pango.org for Pango information.
1306])
1307fi
1308
1309CFLAGS="$CFLAGS $PANGO_CFLAGS"
1310
1311if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1312        :
1313else
1314	gtk_save_LIBS="$LIBS"
1315        LIBS="$PANGO_LIBS $LIBS"
1316        AC_TRY_LINK_FUNC(pango_context_new, :, AC_MSG_ERROR([
1317*** Can't link to Pango. Pango is required to build
1318*** GTK+. For more information see http://www.pango.org]))
1319        LIBS="$gtk_save_LIBS"
1320fi
1321
1322CFLAGS="$saved_cflags"
1323LDFLAGS="$saved_ldflags"
1324
1325# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
1326if test "x$gdktarget" = "xx11"; then
1327  GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 cairo-$cairo_backend"
1328else
1329  GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend"
1330fi
1331
1332GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES` $MATH_LIB"
1333GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PACKAGES` $GDK_EXTRA_CFLAGS"
1334#
1335# If we aren't writing explicit dependencies, then don't put the extra libraries we need
1336# into the pkg-config files
1337#
1338if test $enable_explicit_deps != yes ; then
1339  GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0"
1340  GDK_EXTRA_LIBS=
1341fi
1342
1343AC_SUBST(GDK_PACKAGES)
1344AC_SUBST(GDK_EXTRA_LIBS)
1345AC_SUBST(GDK_EXTRA_CFLAGS)
1346AC_SUBST(GDK_DEP_LIBS)
1347AC_SUBST(GDK_DEP_CFLAGS)
1348
1349
1350########################################
1351# Check for Accessibility Toolkit flags
1352########################################
1353
1354ATK_PACKAGES=atk
1355AC_MSG_CHECKING(ATK flags)
1356if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1357        ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1358        ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1359
1360        AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1361else
1362        AC_MSG_ERROR([
1363*** Accessibility Toolkit not found. Accessibility Toolkit is required
1364*** to build GTK+.
1365])
1366fi
1367
1368if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1369        :
1370else
1371	gtk_save_LIBS="$LIBS"
1372        LIBS="$ATK_LIBS $LIBS"
1373        AC_TRY_LINK_FUNC(atk_object_get_type, : , AC_MSG_ERROR([
1374                *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1375                *** to build GTK+]))
1376        LIBS="$gtk_save_LIBS"
1377fi
1378
1379GTK_PACKAGES="atk cairo gdk-pixbuf-2.0 gio-2.0"
1380if test "x$gdktarget" = "xx11"; then
1381  GTK_PACKAGES="$GTK_PACKAGES pangoft2"
1382fi
1383GTK_EXTRA_LIBS=
1384GTK_EXTRA_CFLAGS=
1385GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $MATH_LIB"
1386GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PACKAGES $GTK_PACKAGES` $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1387
1388if test x"$os_win32" = xyes; then
1389  GTK_EXTRA_CFLAGS="$msnative_struct"
1390fi
1391
1392GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
1393ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
1394PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
1395CAIRO_PREFIX="`pkg-config --variable=prefix cairo`"
1396
1397AC_SUBST(GTK_PACKAGES)
1398AC_SUBST(GTK_EXTRA_LIBS)
1399AC_SUBST(GTK_EXTRA_CFLAGS)
1400AC_SUBST(GTK_DEP_LIBS)
1401AC_SUBST(GTK_DEP_CFLAGS)
1402
1403AC_SUBST(GLIB_PREFIX)
1404AC_SUBST(ATK_PREFIX)
1405AC_SUBST(PANGO_PREFIX)
1406AC_SUBST(CAIRO_PREFIX)
1407
1408AC_SUBST(GTK_DEBUG_FLAGS)
1409AC_SUBST(GTK_XIM_FLAGS)
1410
1411GDK_PIXBUF_LIBS=`$PKG_CONFIG --libs gdk-pixbuf-2.0`
1412AC_SUBST(GDK_PIXBUF_LIBS)
1413
1414########################
1415# Checks needed for gail
1416########################
1417
1418old_LIBS="$LIBS"
1419dnl Checks for inet libraries:
1420AC_SEARCH_LIBS(gethostent, nsl)
1421AC_SEARCH_LIBS(setsockopt, socket)
1422AC_SEARCH_LIBS(connect, inet)
1423
1424dnl check for the sockaddr_un.sun_len member
1425AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
1426		[struct_sockaddr_un_sun_len=true],
1427		[struct_sockaddr_un_suin_len=false],
1428		[#include <sys/types.h>
1429		 #include <sys/un.h>]
1430		)
1431case $struct_sockaddr_un_sun_len in
1432	true)
1433		AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_UN_SUN_LEN, 1,
1434		                   [Have the sockaddr_un.sun_len member])
1435		;;
1436	*)
1437		;;
1438esac
1439
1440GAIL_INET_LIBS="$LIBS"
1441AC_SUBST([GAIL_INET_LIBS])
1442
1443LIBS="$old_LIBS"
1444
1445################################################################
1446# Printing system checks
1447################################################################
1448
1449AC_ARG_ENABLE(cups,
1450              [AC_HELP_STRING([--disable-cups]
1451                              [disable cups print backend])],,
1452              [enable_cups=auto])
1453
1454if test "x$enable_cups" = "xno"; then
1455  AM_CONDITIONAL(HAVE_CUPS, false)
1456else
1457  AC_PATH_TOOL(CUPS_CONFIG, cups-config, no)
1458  if test "x$CUPS_CONFIG" = "xno"; then
1459    if test "x$enable_cups" = "xauto"; then
1460      AM_CONDITIONAL(HAVE_CUPS, false)
1461    else
1462      AC_MSG_ERROR([
1463*** cups not found.
1464])
1465    fi
1466  else
1467    CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
1468    CUPS_LIBS=`$CUPS_CONFIG --libs`
1469
1470    CUPS_API_VERSION=`$CUPS_CONFIG --api-version`
1471    CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
1472    CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
1473
1474    if test $CUPS_API_MAJOR -gt 1 -o \
1475            $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then
1476      AC_DEFINE(HAVE_CUPS_API_1_2, 1,
1477                [Define to 1 if CUPS 1.2 API is available])
1478    fi
1479    if test $CUPS_API_MAJOR -gt 1 -o \
1480	    $CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 6; then
1481      AC_DEFINE(HAVE_CUPS_API_1_6, 1,
1482                [Define to 1 if CUPS 1.6 API is available])
1483      have_cups_api_1_6=yes
1484    fi
1485
1486    AC_SUBST(CUPS_API_MAJOR)
1487    AC_SUBST(CUPS_API_MINOR)
1488    AC_SUBST(CUPS_CFLAGS)
1489    AC_SUBST(CUPS_LIBS)
1490
1491    AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
1492
1493    AM_CONDITIONAL(HAVE_CUPS, true)
1494
1495    gtk_save_cflags="$CFLAGS"
1496    CFLAGS="$CUPS_CFLAGS"
1497    AC_TRY_COMPILE([#include <cups/http.h>],
1498                   [http_t http; char *s = http.authstring;],
1499                   [AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
1500                              [Define if cups http_t authstring field is accessible])],)
1501    CFLAGS="$gtk_save_cflags"
1502
1503    AC_SUBST(HAVE_HTTP_AUTHSTRING)
1504
1505    gtk_save_libs="$LIBS"
1506    LIBS="$CUPS_LIBS"
1507    AC_CHECK_FUNCS(httpGetAuthString)
1508    LIBS="$gtk_save_libs"
1509  fi
1510fi
1511
1512# Checks to see if we should compile with PAPI backend for GTK+
1513#
1514
1515AC_ARG_ENABLE(papi,
1516              [AC_HELP_STRING([--disable-papi]
1517                              [disable papi print backend])],,
1518             [enable_papi=auto])
1519
1520if test "x$enable_papi" = "xno"; then
1521  AM_CONDITIONAL(HAVE_PAPI, false)
1522else
1523  AC_MSG_CHECKING(libpapi)
1524  AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
1525  if test $have_papi = yes; then
1526    AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
1527  fi
1528  AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
1529  if test "x$enable_papi" = "xyes" -a "x$have_papi" = "xno"; then
1530    AC_MSG_ERROR([
1531*** papi not found.
1532])
1533  fi
1534fi
1535
1536AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
1537
1538gtk_save_cppflags="$CPPFLAGS"
1539CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
1540
1541AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
1542*** Can't find cairo-pdf.h. You must build Cairo with the pdf
1543*** backend enabled.]))
1544
1545if test "$os_win32" != "yes"; then
1546  AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([
1547*** Can't find cairo-ps.h. You must build Cairo with the
1548*** postscript backend enabled.]))
1549
1550  AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([
1551*** Can't find cairo-svg.h. You must build Cairo with the
1552*** svg backend enabled.]))
1553fi
1554
1555CPPFLAGS="$gtk_save_cppflags"
1556
1557
1558AC_ARG_ENABLE(test-print-backend,
1559              [AC_HELP_STRING([--enable-test-print-backend],
1560                              [build test print backend])],,
1561              [enable_test_print_backend=no])
1562AM_CONDITIONAL(TEST_PRINT_BACKEND, test "x$enable_test_print_backend" != "xno")
1563
1564if test "$os_win32" = "yes"; then
1565  AC_CHECK_TYPES([IPrintDialogCallback],[],[],[[#include <windows.h>]])
1566fi
1567
1568################################################################
1569# Strip -export-dynamic from the link lines of various libraries
1570################################################################
1571
1572#
1573# pkg-config --libs gmodule includes the "export_dynamic" flag,
1574#  but this flag is only meaningful for executables. For libraries
1575#  the effect is undefined; what it causes on Linux is that the
1576#  export list from -export-symbols-regex is ignored and everything
1577#  is exported
1578#
1579# We are using gmodule-no-export now, but I'm leaving the stripping
1580# code in place for now, since pango and atk still require gmodule.
1581export SED
1582export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
1583if test -n "$export_dynamic"; then
1584  GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
1585  GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
1586fi
1587
1588##################################################
1589# GObject introspection
1590##################################################
1591
1592GOBJECT_INTROSPECTION_CHECK([0.9.3])
1593
1594##################################################
1595# Checks for gtk-doc and docbook-tools
1596##################################################
1597
1598GTK_DOC_CHECK([1.11])
1599
1600AC_CHECK_PROG(DB2HTML, db2html, true, false)
1601AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1602
1603AC_ARG_ENABLE(man,
1604              [AC_HELP_STRING([--enable-man],
1605                              [regenerate man pages from Docbook [default=no]])],,
1606              enable_man=no)
1607
1608if test "${enable_man}" != no; then
1609  dnl
1610  dnl Check for xsltproc
1611  dnl
1612  AC_PATH_PROG([XSLTPROC], [xsltproc])
1613  if test -z "$XSLTPROC"; then
1614    enable_man=no
1615  fi
1616
1617  dnl check for DocBook DTD and stylesheets in the local catalog.
1618  JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
1619     [DocBook XML DTD V4.1.2],,enable_man=no)
1620  JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
1621     [DocBook XSL Stylesheets],,enable_man=no)
1622fi
1623
1624AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
1625
1626##################################################
1627# Check whether MSVC toolset is explicitly set
1628##################################################
1629
1630AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
1631AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
1632
1633##################################################
1634# Output commands
1635##################################################
1636
1637AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [
1638	outfile=gdkconfig.h-tmp
1639	cat > $outfile <<\_______EOF
1640/* gdkconfig.h
1641 *
1642 * This is a generated file.  Please modify `configure.in'
1643 */
1644
1645#ifndef GDKCONFIG_H
1646#define GDKCONFIG_H
1647
1648#ifdef __cplusplus
1649extern "C" {
1650#endif /* __cplusplus */
1651
1652#ifndef GSEAL
1653/* introduce GSEAL() here for all of Gdk and Gtk+ without the need to modify GLib */
1654#  ifdef GSEAL_ENABLE
1655#    define GSEAL(ident)      _g_sealed__ ## ident
1656#  else
1657#    define GSEAL(ident)      ident
1658#  endif
1659#endif /* !GSEAL */
1660
1661_______EOF
1662
1663	cat >>$outfile <<_______EOF
1664$gdk_windowing
1665$gdk_wc
1666_______EOF
1667
1668	cat >>$outfile <<_______EOF
1669
1670#ifdef __cplusplus
1671}
1672#endif /* __cplusplus */
1673
1674#endif /* GDKCONFIG_H */
1675_______EOF
1676
1677
1678	if cmp -s $outfile gdk/gdkconfig.h; then
1679          AC_MSG_NOTICE([gdk/gdkconfig.h is unchanged])
1680	  rm -f $outfile
1681	else
1682	  mv $outfile gdk/gdkconfig.h
1683	fi
1684],[
1685if test "x$gdktarget" = "xx11" ; then
1686  gdk_windowing='
1687#define GDK_WINDOWING_X11'
1688elif test "x$gdktarget" = "xwin32" ; then
1689  gdk_windowing='
1690#define GDK_NATIVE_WINDOW_POINTER
1691
1692#define GDK_WINDOWING_WIN32'
1693elif test "x$gdktarget" = "xquartz" ; then
1694  gdk_windowing='
1695#define GDK_NATIVE_WINDOW_POINTER
1696
1697#define GDK_WINDOWING_QUARTZ'
1698elif test "x$gdktarget" = "xdirectfb" ; then
1699  gdk_windowing='
1700#define GDK_WINDOWING_DIRECTFB'
1701fi
1702
1703if test x$gdk_wchar_h = xyes; then
1704  gdk_wc='
1705#define GDK_HAVE_WCHAR_H 1'
1706fi
1707if test x$gdk_wctype_h = xyes; then
1708  gdk_wc="\$gdk_wc
1709#define GDK_HAVE_WCTYPE_H 1"
1710fi
1711if test x$gdk_working_wctype = xno; then
1712  gdk_wc="\$gdk_wc
1713#define GDK_HAVE_BROKEN_WCTYPE 1"
1714fi
1715
1716
1717])
1718
1719AC_CONFIG_FILES([
1720config.h.win32
1721gtk-zip.sh
1722Makefile
1723gdk-2.0.pc
1724gtk+-2.0.pc
1725gtk+-unix-print-2.0.pc
1726gail.pc
1727gdk-2.0-uninstalled.pc
1728gtk+-2.0-uninstalled.pc
1729gail-uninstalled.pc
1730m4macros/Makefile
1731po/Makefile.in
1732po-properties/Makefile.in
1733demos/Makefile
1734demos/gtk-demo/Makefile
1735demos/gtk-demo/geninclude.pl
1736tests/Makefile
1737docs/Makefile
1738docs/reference/Makefile
1739docs/reference/gdk/Makefile
1740docs/reference/gdk/version.xml
1741docs/reference/gtk/Makefile
1742docs/reference/gtk/version.xml
1743docs/reference/libgail-util/Makefile
1744docs/faq/Makefile
1745docs/tools/Makefile
1746docs/tutorial/Makefile
1747build/Makefile
1748build/win32/Makefile
1749build/win32/vs9/Makefile
1750build/win32/vs9/gtk-version-paths.vsprops
1751build/win32/vs10/Makefile
1752build/win32/vs10/gtk-version-paths.props
1753build/win32/vs11/Makefile
1754build/win32/vs12/Makefile
1755build/win32/vs14/Makefile
1756build/win32/vs15/Makefile
1757build/win32/vs16/Makefile
1758gdk/Makefile
1759gdk/x11/Makefile
1760gdk/win32/Makefile
1761gdk/win32/rc/Makefile
1762gdk/win32/rc/gdk.rc
1763gdk/quartz/Makefile
1764gdk/directfb/Makefile
1765gdk/tests/Makefile
1766gtk/Makefile
1767gtk/makefile.msc
1768gtk/gtkversion.h
1769gtk/gtk-win32.rc
1770gtk/theme-bits/Makefile
1771gtk/tests/Makefile
1772modules/Makefile
1773modules/other/Makefile
1774modules/other/gail/Makefile
1775modules/other/gail/libgail-util/Makefile
1776modules/other/gail/tests/Makefile
1777modules/engines/Makefile
1778modules/engines/pixbuf/Makefile
1779modules/engines/ms-windows/Makefile
1780modules/engines/ms-windows/Theme/Makefile
1781modules/engines/ms-windows/Theme/gtk-2.0/Makefile
1782modules/input/Makefile
1783modules/printbackends/Makefile
1784modules/printbackends/cups/Makefile
1785modules/printbackends/lpr/Makefile
1786modules/printbackends/file/Makefile
1787modules/printbackends/papi/Makefile
1788modules/printbackends/test/Makefile
1789perf/Makefile
1790])
1791
1792AC_OUTPUT
1793
1794echo "configuration:
1795        target: $gdktarget"
1796