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