]> Pileus Git - ~andy/gtk/blob - configure.in
051877e2a13626c5d12e062fd963974baaf059f4
[~andy/gtk] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(gdk/gdktypes.h)
3
4 #
5 # For each of the libraries we build, we define the following
6 # substituted variables:
7 #
8 # foo_PACKAGES:     pkg-config packages this library requires
9 # foo_EXTRA_LIBS:   Libraries this module requires not pulled in by pkg-config
10 # foo_EXTRA_CFLAGS: cflags this module requires not pulled in by pkg-config
11 # foo_DEP_LIBS:     All libraries this module requires
12 # foo_DEP_CFLAGS:   All cflags this module requires
13
14
15 ## We could have pkg-config uniquify the ldflags and cflags by calling
16 ## it once with both the GLib and Pango package names, but we don't,
17 ## someone should fix that.
18
19
20 # Save this value here, since automake will set cflags later
21 cflags_set=${CFLAGS+set}
22
23 dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
24 dnl are available for $ac_help expansion (don't we all *love* autoconf?)
25 GLIB_AC_DIVERT_BEFORE_HELP([
26 #
27 # Making releases:
28 #   GTK_MICRO_VERSION += 1;
29 #   GTK_INTERFACE_AGE += 1;
30 #   GTK_BINARY_AGE += 1;
31 # if any functions have been added, set GTK_INTERFACE_AGE to 0.
32 # if backwards compatibility has been broken,
33 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
34 #
35 GTK_MAJOR_VERSION=1
36 GTK_MINOR_VERSION=3
37 GTK_MICRO_VERSION=10
38 GTK_INTERFACE_AGE=0
39 GTK_BINARY_AGE=0
40 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
41 dnl
42 ])dnl
43
44 AC_SUBST(GTK_MAJOR_VERSION)
45 AC_SUBST(GTK_MINOR_VERSION)
46 AC_SUBST(GTK_MICRO_VERSION)
47 AC_SUBST(GTK_INTERFACE_AGE)
48 AC_SUBST(GTK_BINARY_AGE)
49 AC_SUBST(GTK_VERSION)
50
51 # libtool versioning
52 LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
53 LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
54 LT_REVISION=$GTK_INTERFACE_AGE
55 LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
56 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
57 AC_SUBST(LT_RELEASE)
58 AC_SUBST(LT_CURRENT)
59 AC_SUBST(LT_REVISION)
60 AC_SUBST(LT_AGE)
61 AC_SUBST(LT_CURRENT_MINUS_AGE)
62
63 # Define a string for the earliest version that this release has
64 # binary compatibility with. This is used for module locations.
65 #
66 GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
67 AC_SUBST(GTK_BINARY_VERSION)
68
69 #
70 # gdk-pixbuf gets versioned separately, and for now, using standard
71 # libtool versioning, not GTK+-style versioning
72 #
73 GDK_PIXBUF_MAJOR=$GTK_MAJOR_VERSION
74 GDK_PIXBUF_MINOR=$GTK_MINOR_VERSION
75 GDK_PIXBUF_MICRO=$GTK_MICRO_VERSION
76 GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
77 AC_SUBST(GDK_PIXBUF_MAJOR)
78 AC_SUBST(GDK_PIXBUF_MINOR)
79 AC_SUBST(GDK_PIXBUF_MICRO)
80 AC_SUBST(GDK_PIXBUF_VERSION)
81
82 ## Versions of dependencies
83 GLIB_REQUIRED_VERSION=1.3.10
84 PANGO_REQUIRED_VERSION=0.20
85 ATK_REQUIRED_VERSION=0.5
86
87 # For automake.
88 VERSION=$GTK_VERSION
89 PACKAGE=gtk+
90
91 GETTEXT_PACKAGE=gtk20
92 AC_SUBST(GETTEXT_PACKAGE)
93 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
94
95 # Save this value here, since automake will set cflags later
96 cflags_set=${CFLAGS+set}
97
98 dnl Initialize automake stuff
99 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
100
101 # Specify a configuration file
102 AM_CONFIG_HEADER(config.h)
103
104 dnl Initialize libtool
105 AC_LIBTOOL_WIN32_DLL
106 AM_PROG_LIBTOOL
107
108 dnl Set AS and ASFLAGS so that automake 1.5 will be happy
109 AS="\${CC}"
110 ASFLAGS="\${CFLAGS}"
111 AC_SUBST(AS)
112 AC_SUBST(ASFLAGS)
113
114 dnl Initialize maintainer mode
115 AM_MAINTAINER_MODE
116
117 AC_CANONICAL_HOST
118
119 AC_MSG_CHECKING([for some Win32 platform])
120 case "$host" in
121   *-*-mingw*|*-*-cygwin*)
122     platform_win32=yes
123     ;;
124   *)
125     platform_win32=no
126     ;;
127 esac
128 AC_MSG_RESULT([$platform_win32])
129 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
130
131 AC_MSG_CHECKING([for native Win32])
132 case "$host" in
133   *-*-mingw*)
134     os_win32=yes
135     ;;
136   *)
137     os_win32=no
138     ;;
139 esac
140 AC_MSG_RESULT([$os_win32])
141 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
142
143 if test "$os_win32" = "yes"; then
144   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
145 fi
146 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
147
148 dnl figure debugging default, prior to $ac_help setup
149 dnl
150 GLIB_AC_DIVERT_BEFORE_HELP([
151 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
152         debug_default=yes
153 else
154         debug_default=minimum
155 fi
156 ])dnl
157
158 dnl declare --enable-* args and collect ac_help strings
159 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
160 AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available [default=yes]],
161                    echo $enable_shm, enable_shm="yes")
162 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
163                     , enable_ansi=no)
164 AC_ARG_ENABLE(xim, [  --enable-xim            support XIM [default=yes]],
165                         , enable_xim="yes")
166 AC_ARG_ENABLE(xim_inst, [  --disable-xim-inst      does not use xim instantiate callback],
167                         , enable_xim_inst="maybe")
168 AC_ARG_ENABLE(xkb, [  --enable-xkb            support XKB [default=maybe]],
169                         , enable_xkb="maybe")
170 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
171
172 AC_ARG_WITH(xinput, [  --with-xinput=[no/gxi/xfree] support XInput ])
173
174 AC_ARG_WITH(wintab, [  --with-wintab=DIRECTORY  use Wintab API with win32 backend])
175
176 if test "$platform_win32" = yes; then
177   gdktarget=win32
178 else
179   gdktarget=x11
180 fi
181
182 AC_ARG_WITH(gdktarget, [  --with-gdktarget=[x11/linux-fb/win32] select GDK target [default=$gdktarget]],
183         gdktarget=$with_gdktarget)
184
185 AC_SUBST(gdktarget)
186 case $gdktarget in
187   x11|linux-fb|win32) ;;
188   *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
189 esac
190
191 gdktargetlib=libgdk-$gdktarget-1.3.la
192 gtktargetlib=libgtk-$gdktarget-1.3.la
193
194 AC_SUBST(gdktargetlib)
195 AC_SUBST(gtktargetlib)
196
197 AC_ARG_ENABLE(shadowfb, [  --disable-shadowfb      disable shadowfb support for linux-fb],,enable_shadowfb=yes)
198
199 AC_ARG_ENABLE(fbmanager, [  --enable-fbmanager      enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
200         
201 if test "x$enable_debug" = "xyes"; then
202   test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
203   GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
204 else
205   if test "x$enable_debug" = "xno"; then
206     GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
207   else
208     GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
209   fi
210 fi
211
212 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
213
214                         
215 # Build time sanity check...
216 AM_SANITY_CHECK
217
218 # Checks for programs.
219 AC_PROG_CC
220 AC_ISC_POSIX
221 AM_PROG_CC_STDC
222 AC_PROG_INSTALL
223 AC_PROG_MAKE_SET
224
225 changequote(,)dnl
226 if test "x$GCC" = "xyes"; then
227   case " $CFLAGS " in
228   *[\ \ ]-Wall[\ \      ]*) ;;
229   *) CFLAGS="$CFLAGS -Wall" ;;
230   esac
231
232   if test "x$enable_ansi" = "xyes"; then
233     case " $CFLAGS " in
234     *[\ \       ]-ansi[\ \      ]*) ;;
235     *) CFLAGS="$CFLAGS -ansi" ;;
236     esac
237
238     case " $CFLAGS " in
239     *[\ \       ]-pedantic[\ \  ]*) ;;
240     *) CFLAGS="$CFLAGS -pedantic" ;;
241     esac
242   fi
243
244   if test "$os_win32" = "yes"; then
245     case "$CC $CFLAGS " in
246     *[[\ \      ]]-fnative-struct[[\ \  ]]*) ;;
247     *) CFLAGS="$CFLAGS -fnative-struct" ;;
248     esac
249   fi
250 fi
251 changequote([,])dnl
252
253 # Honor aclocal flags
254 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
255
256 ## Initial sanity check, done here so that users get told they 
257 ## have the wrong dependencies as early in the process as possible.
258 ## Later on we actually use the cflags/libs from separate pkg-config
259 ## calls. Oh, also the later pkg-config calls don't include 
260 ## the version requirements since those make the module lists 
261 ## annoying to construct
262 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION atk >= $ATK_REQUIRED_VERSION pango >= $PANGO_REQUIRED_VERSION)
263
264 if test "$os_win32" != yes; then
265     # libtool option to control which symbols are exported
266     # right now, symbols starting with _ are not exported
267     LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
268 else
269     # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
270     LIBTOOL_EXPORT_OPTIONS=
271 fi
272 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
273
274 # define a MAINT-like variable REBUILD which is set if Perl
275 # and awk are found, so autogenerated sources can be rebuilt
276
277 AC_PROG_AWK
278 AC_CHECK_PROGS(PERL, perl5 perl)
279
280 # We would like indent, but don't require it.
281 AC_CHECK_PROG(INDENT, indent, indent)
282
283 REBUILD=\#
284 if test "x$enable_rebuilds" = "xyes" && \
285      test -n "$PERL" && \
286      $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
287      test -n "$AWK" ; then
288   REBUILD=
289 fi
290 AC_SUBST(REBUILD)
291
292 AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
293
294 AC_MSG_CHECKING(whether make is GNU Make)
295 STRIP_BEGIN=
296 STRIP_END=
297 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
298         STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
299         STRIP_END=')'
300         AC_MSG_RESULT(yes)
301 else
302         AC_MSG_RESULT(no)
303 fi
304 STRIP_DUMMY=
305 AC_SUBST(STRIP_DUMMY)
306 AC_SUBST(STRIP_BEGIN)
307 AC_SUBST(STRIP_END)
308
309 # i18n stuff
310 ALL_LINGUAS="az ca cs da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
311 AM_GLIB_GNU_GETTEXT
312 LIBS="$LIBS $INTLLIBS"
313
314 # AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
315 # this is the directory where the *.{mo,gmo} files are installed
316 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
317 AC_SUBST(gtklocaledir)
318
319 dnl The DU4 header files don't provide library prototypes unless 
320 dnl -std1 is given to the native cc.
321 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
322
323 gtk_save_LIBS=$LIBS
324 LIBS="$LIBS -lm"
325 AC_TRY_RUN([#include <math.h>
326              int main (void) { return (log(1) != log(1.)); }],
327      AC_MSG_RESULT(none needed),
328      gtk_save_CFLAGS="$CFLAGS"
329      CFLAGS="$CFLAGS -std1"
330      AC_TRY_RUN([#include <math.h>
331                  int main (void) { return (log(1) != log(1.)); }],
332          AC_MSG_RESULT(-std1),
333          AC_MSG_RESULT()
334          CFLAGS="$gtk_save_CFLAGS"
335          AC_MSG_WARN(
336                 [No ANSI prototypes found in library. (-std1 didn't work.)]),
337          true
338      ),
339      AC_MSG_RESULT(none needed)
340 )
341 LIBS=$gtk_save_LIBS
342
343 MATH_LIB=-lm
344 AC_MSG_CHECKING(for the BeOS)
345 case $host in
346   *-*-beos*)
347     AC_MSG_RESULT(yes)
348     MATH_LIB=
349   ;;
350   *)
351     AC_MSG_RESULT(no)
352   ;;
353 esac
354
355 dnl NeXTStep cc seems to need this
356 AC_MSG_CHECKING([for extra flags for POSIX compliance])
357 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
358   AC_MSG_RESULT(none needed),
359   gtk_save_CFLAGS="$CFLAGS"
360   CFLAGS="$CFLAGS -posix"
361   AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
362     AC_MSG_RESULT(-posix),
363     AC_MSG_RESULT()
364     CFLAGS="$gtk_save_CFLAGS"
365     AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
366
367 #
368 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
369
370
371 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
372
373 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
374   AC_MSG_ERROR([
375 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
376 *** GLIB is always available from ftp://ftp.gtk.org/.]),
377   gobject gmodule gthread)
378
379 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
380 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
381 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
382 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
383 AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
384 AC_CHECK_HEADERS(dimm.h, AC_DEFINE(HAVE_DIMM_H))
385
386 if test ${with_wintab+set} = set && test $with_wintab != no; then
387   AC_MSG_CHECKING([for wintab.h])
388   saved_CFLAGS="$CFLAGS"
389   CFLAGS="$CFLAGS -I$with_wintab/include"
390   AC_TRY_COMPILE([#include <windows.h>
391 #include <wintab.h>], 
392    [],
393    [AC_MSG_RESULT(yes)
394     AC_CHECK_FILE([$with_wintab/lib/i386/wntab32x.lib],
395       [have_wintab=yes
396        AC_DEFINE(HAVE_WINTAB)
397        WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
398        AC_SUBST(WINTAB_LIB)],
399       [have_wintab=no])
400     ],
401    [AC_MSG_RESULT(no)
402     have_wintab=no])
403   CFLAGS="$saved_cflags"
404 fi
405 AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
406
407 saved_cflags="$CFLAGS"
408 saved_ldflags="$LDFLAGS"
409
410
411 # Checks for header files.
412 AC_HEADER_STDC
413
414 # Checks for typedefs, structures, and compiler characteristics.
415 AC_C_CONST
416
417 # Checks for library functions.
418 AC_TYPE_SIGNAL
419 AC_FUNC_MMAP
420
421 AC_CHECK_FUNCS(getresuid)
422 AC_TYPE_UID_T
423
424 # Check if <sys/select.h> needs to be included for fd_set
425 AC_MSG_CHECKING([for fd_set])
426 AC_TRY_COMPILE([#include <sys/types.h>],
427         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
428 if test $gtk_ok = yes; then
429     AC_MSG_RESULT([yes, found in sys/types.h])
430 else
431     AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
432     if test $gtk_ok = yes; then
433         AC_DEFINE(HAVE_SYS_SELECT_H)
434         AC_MSG_RESULT([yes, found in sys/select.h])
435     else
436         AC_DEFINE(NO_FD_SET)
437         AC_MSG_RESULT(no)
438     fi
439 fi
440
441 # `widechar' tests for gdki18n.h
442 AC_MSG_CHECKING(for wchar.h)
443 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
444 if test $gdk_wchar_h = yes; then
445    AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
446 fi
447 AC_MSG_RESULT($gdk_wchar_h)
448
449 # Check for wctype.h (for iswalnum)
450 AC_MSG_CHECKING(for wctype.h)
451 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
452 if test $gdk_wctype_h = yes; then
453    AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
454 fi
455 AC_MSG_RESULT($gdk_wctype_h)
456
457 # in Solaris 2.5, `iswalnum' is in -lw
458 GDK_WLIBS=
459 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
460
461 oLIBS="$LIBS"
462 LIBS="$LIBS $GDK_WLIBS"
463 # The following is necessary for Linux libc-5.4.38
464 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
465 AC_TRY_LINK([#include <stdlib.h>],[
466 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
467 #  ifdef HAVE_WCTYPE_H
468 #    include <wctype.h>
469 #  else
470 #    ifdef HAVE_WCHAR_H
471 #      include <wchar.h>
472 #    endif
473 #  endif
474 #else
475 #  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
476 #endif
477 iswalnum((wchar_t) 0);
478 ], gdk_working_wctype=yes, gdk_working_wctype=no)
479 LIBS="$oLIBS"
480
481 if test $gdk_working_wctype = no; then
482    AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
483    GDK_WLIBS=
484 fi
485 AC_MSG_RESULT($gdk_working_wctype)
486 AC_SUBST(GDK_WLIBS)
487
488
489
490 ##################################################
491 # Checks for gdk-pixbuf
492 ##################################################
493
494 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
495
496 AC_ARG_ENABLE(modules, [  --disable-modules       Disables dynamic module loading],[
497         if test x$withval = xyes; then 
498             with_modules=yes
499         else
500             with_modules=no
501         fi
502 ])
503
504 dynworks=false
505 deps=
506 if test x$with_modules = xno; then
507     AC_MSG_RESULT(no)
508 else
509     AC_MSG_RESULT(yes)
510     AC_MSG_CHECKING(whether dynamic modules work)
511     ## for loop is to strip newline 
512     tmp=`pkg-config --variable=gmodule_supported gmodule-2.0`
513     for I in $tmp; do
514         dynworks=$I
515     done
516 fi
517
518 dnl Now we check to see if our libtool supports shared lib deps
519 dnl (in a rather ugly way even)
520 if $dynworks; then
521    pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
522    pixbuf_deplibs_check=`$pixbuf_libtool_config | \
523       grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
524       sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
525    if test "x$pixbuf_deplibs_check" = "xnone" || \
526       test "x$pixbuf_deplibs_check" = "xunknown" || \
527       test "x$pixbuf_deplibs_check" = "x"; then
528       dynworks=false
529    fi
530 fi
531
532 if $dynworks; then
533    AC_DEFINE(USE_GMODULE)
534    AC_MSG_RESULT(yes)
535 else
536    AC_MSG_RESULT(no)
537 fi
538
539 dnl Test for libtiff
540   if test -z "$LIBTIFF"; then
541     AC_CHECK_LIB(tiff, TIFFReadScanline,
542       [AC_CHECK_HEADER(tiffio.h,
543         TIFF='tiff'; LIBTIFF='-ltiff',
544         AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
545       [AC_CHECK_LIB(tiff, TIFFWriteScanline,
546         [AC_CHECK_HEADER(tiffio.h,
547           TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
548           AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
549         [AC_CHECK_LIB(tiff34, TIFFFlushData,
550           [AC_CHECK_HEADER(tiffio.h,
551             TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
552             AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
553         AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
554   fi
555
556 dnl Test for libjpeg
557   if test -z "$LIBJPEG"; then
558     AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
559       jpeg_ok=yes,
560       jpeg_ok=no
561       AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
562     if test "$jpeg_ok" = yes; then
563       AC_MSG_CHECKING([for jpeglib.h])
564       AC_TRY_CPP(
565 [#include <stdio.h>
566 #undef PACKAGE
567 #undef VERSION
568 #include <jpeglib.h>],
569         jpeg_ok=yes,
570         jpeg_ok=no)
571       AC_MSG_RESULT($jpeg_ok)
572       if test "$jpeg_ok" = yes; then
573         LIBJPEG='-ljpeg'
574         AC_CHECK_LIB(jpeg, jpeg_simple_progression,     
575           AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
576           AC_MSG_WARN(JPEG library does not support progressive saving.))
577       else
578           AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
579       fi
580     fi
581   fi
582
583 dnl Test for libpng
584   if test -z "$LIBPNG"; then
585     AC_CHECK_LIB(png, png_read_info,
586       [AC_CHECK_HEADER(png.h,
587         png_ok=yes,
588         png_ok=no)],
589       AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
590     if test "$png_ok" = yes; then
591       AC_MSG_CHECKING([for png_structp in png.h])
592       AC_TRY_COMPILE([#include <png.h>],
593         [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
594         png_ok=yes,
595         png_ok=no)
596       AC_MSG_RESULT($png_ok)
597       if test "$png_ok" = yes; then
598         PNG='png'; LIBPNG='-lpng -lz'
599       else
600         AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
601       fi
602     else
603      AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
604     fi
605   fi
606
607 AC_SUBST(LIBTIFF)
608 AC_SUBST(LIBJPEG)
609 AC_SUBST(LIBPNG)
610
611 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
612
613 #
614 # Allow building some or all gdk-pixbuf loaders included
615 #
616 AC_MSG_CHECKING(pixbuf loaders to build)
617
618 AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
619
620 if $dynworks; then 
621         :
622 else
623    ## if the option was specified, leave it; otherwise disable included loaders
624    if test x$with_included_loaders = xno; then
625            with_included_loaders=yes
626    fi
627 fi
628
629 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
630 included_loaders=""
631 # If no loaders specified, include all
632 if test "x$with_included_loaders" = xyes ; then
633   included_loaders="$all_loaders"
634 else
635   included_loaders="$with_included_loaders"
636 fi
637
638 AC_MSG_RESULT($included_loaders)
639
640 INCLUDED_LOADER_OBJ=
641 INCLUDED_LOADER_DEFINE=
642
643 IFS="${IFS=     }"; gtk_save_ifs="$IFS"; IFS=","
644 for loader in $included_loaders; do
645  if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
646    :
647  else
648    AC_MSG_ERROR([the specified loader $loader does not exist])
649  fi
650
651  INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
652  INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
653 done
654 IFS="$gtk_save_ifs"
655 AC_SUBST(INCLUDED_LOADER_OBJ)
656 AC_SUBST(INCLUDED_LOADER_DEFINE)
657
658 AC_HEADER_DIRENT
659 AC_HEADER_SYS_WAIT
660
661 AC_TYPE_SIGNAL
662
663 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
664 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
665 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
666
667 if $dynworks ; then
668   STATIC_LIB_DEPS=
669   if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
670     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
671   fi
672   if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
673     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
674   fi
675   if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
676     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
677   fi
678 else
679   STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
680 fi
681
682 # Checks to see if we should compile in MMX support (there will be
683 # a runtime test when the code is actually run to see if it should
684 # be used - this just checks if we can compile it.)
685 #
686 # This code is partially taken from Mesa
687 #
688 AC_MSG_CHECKING(for x86 platform)
689 case $host_cpu in
690   i386|i486|i586|i686|i786|k6|k7)
691         use_x86_asm=yes
692         ;;
693    *)
694         use_x86_asm=no
695 esac
696 AC_MSG_RESULT($use_x86_asm)
697
698 use_mmx_asm=no
699 if test $use_x86_asm = yes; then
700     save_ac_ext=$ac_ext
701     ac_ext=S
702     
703     AC_MSG_CHECKING(compiler support for MMX)
704     cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
705     if AC_TRY_EVAL(ac_compile); then
706         use_mmx_asm=yes
707     fi
708
709     rm -rf conftest*
710
711     ac_ext=$save_ac_ext
712     if test $use_mmx_asm = yes; then
713       AC_DEFINE(USE_MMX)
714       AC_MSG_RESULT(yes)
715     else
716       AC_MSG_RESULT(no)
717     fi
718 fi
719
720 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
721
722
723 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
724 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
725 GDK_PIXBUF_EXTRA_CFLAGS= 
726 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
727 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
728
729 AC_SUBST(GDK_PIXBUF_PACKAGES)
730 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
731 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
732 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
733 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
734
735
736 ########################################
737 # Windowing system checks
738 ########################################
739
740 GDK_EXTRA_LIBS=$GDK_WLIBS
741 GDK_EXTRA_CFLAGS= 
742
743 if test "x$gdktarget" = "xx11"; then
744   # We start off with the libraries from Pango
745
746   ## be sure we also have Pango built with xft support
747   if $PKG_CONFIG --exists pangoxft ; then
748     PANGO_PACKAGES="pangox pangoxft"
749     have_xft=true
750     AC_DEFINE(HAVE_XFT)
751   else
752     PANGO_PACKAGES="pangox"
753     have_xft=false
754   fi
755
756   AM_CONDITIONAL(HAVE_XFT, $have_xft)
757
758   x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
759   x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
760   x_extra_libs=
761
762   ## Strip the .la files
763  
764   x_libs_for_checks=""
765   for I in $x_libs ; do
766     case $I in 
767       *.la) ;;
768       *) x_libs_for_checks="$x_libs_for_checks $I" ;;
769     esac
770   done
771
772   # Sanity check for the X11 library
773   AC_CHECK_LIB(X11, XOpenDisplay, :,
774             AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
775             $x_libs_for_checks)
776
777   if test "x$enable_shm" = "xyes"; then
778     # Check for the Xext library (needed for XShm extention)
779     AC_CHECK_LIB(Xext, XShmAttach,
780         if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
781           x_extra_libs="-lXext"
782         fi,
783         # On AIX, it is in XextSam instead, but we still need -lXext
784         AC_CHECK_LIB(XextSam, XShmAttach, 
785             if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
786                x_extra_libs="-lXextSam -lXext"
787             else
788                x_extra_libs="-lXextSam"
789             fi, , $x_libs_for_checks),
790         $x_libs_for_checks)
791   fi
792
793   GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
794   # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
795   GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
796
797   # Check for shaped window extension
798
799   AC_CHECK_LIB(Xext, XShapeCombineMask,
800       if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
801            x_extra_libs="-lXext $x_extra_libs"
802       fi
803       AC_DEFINE(HAVE_SHAPE_EXT),
804       ,
805       $x_libs_for_checks)
806
807   # Check for XConvertCase (X11R6 specific)
808
809   AC_CHECK_LIB(X11, XConvertCase,
810       AC_DEFINE(HAVE_XCONVERTCASE),
811       ,
812       $x_libs_for_checks)
813
814   # Check for XIM support.
815
816   AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
817             : ,
818             enable_xim_inst="no",
819             $x_libs_for_checks)
820
821   # On Solaris, calling XRegisterIMInstantiateCallback seems to
822   # cause an immediate segfault, so we disable it, unless
823   # the user specifically forces it to be on.
824
825   if test x$enable_xim_inst = xmaybe ; then
826     case host in
827           *-*-solaris*)
828             enable_xim_inst="no"
829             ;;
830           *)
831             enable_xim_inst="yes"
832             ;;
833     esac
834   fi
835
836   if test "x$enable_xim" = "xyes"; then
837     GTK_XIM_FLAGS="-DUSE_XIM"
838     if test "x$enable_xim_inst" = "xyes"; then
839       AC_DEFINE(USE_X11R6_XIM)
840     fi
841   fi
842
843   # Check for XKB support.
844
845   if test "x$enable_xkb" = "xyes"; then
846         AC_MSG_WARN(XKB support explicitly enabled)
847         AC_DEFINE(HAVE_XKB)
848   elif test "x$enable_xkb" = "xmaybe"; then
849         AC_CHECK_LIB(X11, XkbQueryExtension,
850                      AC_DEFINE(HAVE_XKB),
851                      ,
852                      $x_libs_for_checks)
853   else
854         AC_MSG_WARN(XKB support explicitly disabled)
855   fi
856
857   x_cflags="$X_CFLAGS"
858   x_ldflags="$X_LDFLAGS"
859
860   # set up things for XInput
861
862   if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
863     AC_DEFINE(XINPUT_GXI)
864     xinput_progs=gxid
865     x_extra_libs="-lXi $x_extra_libs"
866   elif test "x$with_xinput" = "xxfree"; then
867     AC_DEFINE(XINPUT_XFREE)
868     x_extra_libs="-lXi $x_extra_libs"
869   else
870     AC_DEFINE(XINPUT_NONE)
871   fi
872
873   AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
874   AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
875
876   if test "x$enable_shm" = "xyes"; then
877     # Check for shared memory
878     AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
879     AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
880
881     # Check for the X shared memory extension header file
882     have_xshm=no 
883     AC_MSG_CHECKING(X11/extensions/XShm.h)
884     if test "x$no_xext_lib" = "xyes"; then
885       :
886     else
887       gtk_save_CFLAGS="$CFLAGS"
888       CFLAGS="$CFLAGS $x_cflags"
889       AC_TRY_COMPILE([
890 #include <stdlib.h>
891 #include <sys/types.h>
892 #include <sys/ipc.h>
893 #include <sys/shm.h>
894 #include <X11/Xlib.h>
895 #include <X11/Xutil.h>
896 #include <X11/extensions/XShm.h>
897 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
898       CFLAGS="$gtk_save_CFLAGS"
899     fi
900     AC_MSG_RESULT($have_xshm)
901     if test $have_xshm = yes ; then
902       AC_DEFINE(HAVE_XSHM_H)
903     fi
904   fi
905
906   GDK_EXTRA_CFLAGS=
907   GDK_EXTRA_LIBS="$x_extra_libs"
908
909   AM_CONDITIONAL(USE_X11, true)
910 else
911   AM_CONDITIONAL(USE_X11, false)
912 fi
913
914 if test "x$gdktarget" = "xwin32"; then
915   # We start off with the libraries from Pango
916
917   ## be sure we also have Pango built with win32 support
918   PANGO_PACKAGES="pangowin32"
919
920   if test x$have_wintab = xyes; then
921     GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
922     AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
923   fi
924
925   GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
926   AM_CONDITIONAL(USE_WIN32, true)
927 else
928   AM_CONDITIONAL(USE_WIN32, false)
929 fi
930
931 AC_SUBST(xinput_progs)
932
933 GDK_PIXBUF_XLIB_PACKAGES=
934 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
935 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags  $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
936
937 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
938 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
939 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
940 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
941 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
942
943 if test "x$gdktarget" = "xlinux-fb"; then
944   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
945   if test x$FREETYPE_CONFIG = xno ; then
946     AC_MSG_ERROR([*** freetype-config not found])
947   fi
948
949   FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
950   FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
951   CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
952
953   if test x$enable_shadowfb = xyes ; then
954     AC_DEFINE(ENABLE_SHADOW_FB)
955   fi
956
957   if test x$enable_fbmanager = xyes ; then
958     AC_DEFINE(ENABLE_FB_MANAGER)
959     AM_CONDITIONAL(ENABLE_FB_MANAGER, true)
960   else
961     AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
962   fi
963   
964   GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
965   GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
966
967   AM_CONDITIONAL(USE_LINUX_FB, true)
968 else
969   AM_CONDITIONAL(USE_LINUX_FB, false)
970   AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
971 fi
972
973 #
974 # Pick correct Pango packages to use
975 #
976
977 if test "x$gdktarget" = "xx11"; then
978         if $have_xft = true ; then
979             PANGO_PACKAGES="pangox pangoxft"
980         else
981             PANGO_PACKAGES=pangox
982         fi
983 elif test "x$gdktarget" = "xwin32"; then
984         PANGO_PACKAGES=pangowin32
985 elif test "x$gdktarget" = "xlinux-fb"; then
986         PANGO_PACKAGES=pangoft2
987 else
988         PANGO_PACKAGES=pango
989 fi
990
991 # Check for Pango flags
992
993 AC_MSG_CHECKING(Pango flags)
994 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
995         PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
996         PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
997
998         AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
999 else
1000         AC_MSG_ERROR([
1001 *** Pango not found. Pango is required to build GTK+.
1002 *** See http://www.pango.org for Pango information.
1003 *** For the framebuffer target, you will need to build 
1004 *** Pango with freetype support.
1005 ])
1006 fi
1007
1008 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1009
1010 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1011         :
1012 else
1013         AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
1014 *** Can't link to Pango. Pango is required to build
1015 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
1016 fi
1017
1018 CFLAGS="$saved_cflags"
1019 LDFLAGS="$saved_ldflags"
1020
1021 GDK_PACKAGES=$PANGO_PACKAGES
1022 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1023 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1024
1025 AC_SUBST(GDK_PACKAGES)
1026 AC_SUBST(GDK_EXTRA_LIBS)
1027 AC_SUBST(GDK_EXTRA_CFLAGS)
1028 AC_SUBST(GDK_DEP_LIBS)
1029 AC_SUBST(GDK_DEP_CFLAGS)
1030
1031
1032 ########################################
1033 # Check for Accessibility Toolkit flags
1034 ########################################
1035
1036 ATK_PACKAGES=atk
1037 AC_MSG_CHECKING(ATK flags)
1038 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1039         ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1040         ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1041
1042         AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1043 else
1044         AC_MSG_ERROR([
1045 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1046 *** to build GTK+.
1047 ])
1048 fi
1049
1050 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1051         :
1052 else
1053         AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
1054                 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1055                 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
1056 fi
1057
1058 GTK_PACKAGES=atk
1059 GTK_EXTRA_LIBS=
1060 GTK_EXTRA_CFLAGS= 
1061 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1062 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags  $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1063
1064 AC_SUBST(GTK_PACKAGES)
1065 AC_SUBST(GTK_EXTRA_LIBS)
1066 AC_SUBST(GTK_EXTRA_CFLAGS)
1067 AC_SUBST(GTK_DEP_LIBS)
1068 AC_SUBST(GTK_DEP_CFLAGS)
1069
1070
1071 AC_SUBST(GTK_DEBUG_FLAGS)
1072 AC_SUBST(GTK_XIM_FLAGS)
1073
1074 ##################################################
1075 # Checks for gtk-doc and docbook-tools
1076 ##################################################
1077
1078 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs ])
1079
1080 if test "x$with_html_dir" = "x" ; then
1081   HTML_DIR='${datadir}/gtk-doc/html'
1082 else
1083   HTML_DIR=$with_html_dir
1084 fi
1085
1086 AC_SUBST(HTML_DIR)
1087
1088 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1089
1090 gtk_doc_min_version=0.6
1091 if $GTKDOC ; then 
1092     gtk_doc_version=`gtkdoc-mkdb --version`
1093     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
1094     if perl <<EOF ; then
1095       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
1096             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1097 EOF
1098       AC_MSG_RESULT(yes)
1099    else
1100       AC_MSG_RESULT(no)
1101       GTKDOC=false
1102    fi
1103 fi
1104
1105 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1106 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1107
1108 dnl Let people disable the gtk-doc stuff.
1109 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1110
1111 if test x$enable_gtk_doc = xauto ; then
1112   if test x$GTKDOC = xtrue ; then
1113     enable_gtk_doc=yes
1114   else
1115     enable_gtk_doc=no 
1116   fi
1117 fi
1118
1119 dnl NOTE: We need to use a separate automake conditional for this
1120 dnl       to make this work with the tarballs.
1121 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1122
1123
1124 ##################################################
1125 # Output commands
1126 ##################################################
1127
1128 AC_OUTPUT_COMMANDS([
1129
1130 ## Generate `gdk/gdkconfig.h' in two cases
1131 ## 1. `config.status' is run either explicitly, or via configure.
1132 ##     Esp. not when it is run in `Makefile' to generate makefiles and
1133 ##     config.h
1134 ## 2. CONFIG_OTHER is set explicitly
1135 ##
1136 ## Case 1 is difficult.  We know that `automake' sets one of
1137 ## CONFIG_FILES or CONFIG_HEADERS to empty.  This heuristic works
1138 ## only when AM_CONFIG_HEADER is set, however.
1139
1140 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1141   # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1142   CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1143 fi
1144 case "$CONFIG_OTHER" in
1145 *gdk/gdkconfig.h*)
1146         echo creating gdk/gdkconfig.h
1147         outfile=gdkconfig.h-tmp
1148         cat > $outfile <<\_______EOF
1149 /* gdkconfig.h
1150  *
1151  * This is a generated file.  Please modify `configure.in'
1152  */
1153
1154 #ifndef GDKCONFIG_H
1155 #define GDKCONFIG_H
1156
1157 #ifdef __cplusplus
1158 extern "C" {
1159 #endif /* __cplusplus */
1160
1161 _______EOF
1162
1163         cat >>$outfile <<_______EOF
1164 $gdk_windowing
1165 $gdk_wc
1166 _______EOF
1167
1168         cat >>$outfile <<_______EOF
1169
1170 #ifdef __cplusplus
1171 }
1172 #endif /* __cplusplus */
1173
1174 #endif /* GDKCONFIG_H */
1175 _______EOF
1176
1177
1178         if cmp -s $outfile gdk/gdkconfig.h; then
1179           echo gdk/gdkconfig.h is unchanged
1180           rm -f $outfile
1181         else
1182           mv $outfile gdk/gdkconfig.h
1183         fi ;;
1184 esac
1185 ],[
1186 if test "x$gdktarget" = "xx11" ; then
1187   gdk_windowing='
1188 #define GDK_WINDOWING_X11'
1189 elif test "x$gdktarget" = "xwin32" ; then
1190   gdk_windowing='
1191 #define GDK_WINDOWING_WIN32'
1192 elif test "x$gdktarget" = "xlinux-fb" ; then
1193   gdk_windowing='
1194 #define GDK_WINDOWING_FB
1195 #define GDK_NATIVE_WINDOW_POINTER'
1196 fi
1197
1198 if test x$gdk_wchar_h = xyes; then
1199   gdk_wc='
1200 #define GDK_HAVE_WCHAR_H 1'
1201 fi
1202 if test x$gdk_wctype_h = xyes; then
1203   gdk_wc="\$gdk_wc
1204 #define GDK_HAVE_WCTYPE_H 1"
1205 fi
1206 if test x$gdk_working_wctype = xno; then
1207   gdk_wc="\$gdk_wc
1208 #define GDK_HAVE_BROKEN_WCTYPE 1"
1209 fi
1210
1211
1212 ])
1213
1214 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1215 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1216
1217 AC_OUTPUT([
1218 config.h.win32
1219 gtk-zip.sh
1220 gtk+.spec
1221 Makefile
1222 gdk-pixbuf-2.0.pc
1223 gdk-2.0.pc
1224 gtk+-2.0.pc
1225 gdk-pixbuf-2.0-uninstalled.pc
1226 gdk-2.0-uninstalled.pc
1227 gtk+-2.0-uninstalled.pc
1228 m4macros/Makefile
1229 po/Makefile.in
1230 build/Makefile
1231 build/win32/Makefile
1232 build/win32/dirent/Makefile
1233 demos/Makefile
1234 demos/gtk-demo/Makefile
1235 tests/Makefile
1236 docs/Makefile
1237 docs/reference/Makefile
1238 docs/reference/gdk-pixbuf/Makefile
1239 docs/reference/gdk/Makefile
1240 docs/reference/gtk/Makefile
1241 docs/faq/Makefile
1242 docs/tutorial/Makefile
1243 gdk-pixbuf/Makefile
1244 gdk-pixbuf/makefile.mingw
1245 gdk-pixbuf/gdk-pixbuf-features.h
1246 gdk-pixbuf/pixops/Makefile
1247 gdk-pixbuf/pixops/makefile.mingw
1248 gdk/Makefile
1249 gdk/makefile.mingw
1250 gdk/x11/Makefile
1251 gdk/win32/Makefile
1252 gdk/win32/makefile.mingw
1253 gdk/win32/rc/Makefile
1254 gdk/win32/rc/gdk.rc
1255 gdk/linux-fb/Makefile
1256 gtk/Makefile
1257 gtk/makefile.mingw
1258 gtk/makefile.msc
1259 gtk/gtkversion.h
1260 gtk/gtk-win32.rc
1261 gtk/stock-icons/Makefile
1262 modules/Makefile
1263 modules/input/Makefile
1264 contrib/Makefile
1265 contrib/gdk-pixbuf-xlib/Makefile
1266 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc
1267 ])