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