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