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