]> Pileus Git - ~andy/gtk/blob - configure.in
Don't use AC_CHECK_FILE to check for a file since it always spits warnings
[~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_PROG_CC
106 AC_LIBTOOL_WIN32_DLL
107 AM_PROG_LIBTOOL
108
109 dnl Set AS and ASFLAGS so that automake 1.5 will be happy
110 AS="\${CC}"
111 ASFLAGS="\${CFLAGS}"
112 AC_SUBST(AS)
113 AC_SUBST(ASFLAGS)
114
115 dnl Initialize maintainer mode
116 AM_MAINTAINER_MODE
117
118 AC_CANONICAL_HOST
119
120 AC_MSG_CHECKING([for some Win32 platform])
121 case "$host" in
122   *-*-mingw*|*-*-cygwin*)
123     platform_win32=yes
124     ;;
125   *)
126     platform_win32=no
127     ;;
128 esac
129 AC_MSG_RESULT([$platform_win32])
130 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
131
132 AC_MSG_CHECKING([for native Win32])
133 case "$host" in
134   *-*-mingw*)
135     os_win32=yes
136     ;;
137   *)
138     os_win32=no
139     ;;
140 esac
141 AC_MSG_RESULT([$os_win32])
142 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
143
144 if test "$os_win32" = "yes"; then
145   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
146 fi
147 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
148
149 dnl figure debugging default, prior to $ac_help setup
150 dnl
151 GLIB_AC_DIVERT_BEFORE_HELP([
152 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
153         debug_default=yes
154 else
155         debug_default=minimum
156 fi
157 ])dnl
158
159 dnl declare --enable-* args and collect ac_help strings
160 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
161 AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available [default=yes]],
162                    echo $enable_shm, enable_shm="yes")
163 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
164                     , enable_ansi=no)
165 AC_ARG_ENABLE(xim, [  --enable-xim            support XIM [default=yes]],
166                         , enable_xim="yes")
167 AC_ARG_ENABLE(xim_inst, [  --disable-xim-inst      does not use xim instantiate callback],
168                         , enable_xim_inst="maybe")
169 AC_ARG_ENABLE(xkb, [  --enable-xkb            support XKB [default=maybe]],
170                         , enable_xkb="maybe")
171 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
172
173 AC_ARG_WITH(xinput, [  --with-xinput=[no/gxi/xfree] support XInput ])
174
175 AC_ARG_WITH(wintab, [  --with-wintab=DIRECTORY  use Wintab API with win32 backend])
176
177 if test "$platform_win32" = yes; then
178   gdktarget=win32
179 else
180   gdktarget=x11
181 fi
182
183 AC_ARG_WITH(gdktarget, [  --with-gdktarget=[x11/linux-fb/win32] select GDK target [default=$gdktarget]],
184         gdktarget=$with_gdktarget)
185
186 AC_SUBST(gdktarget)
187 case $gdktarget in
188   x11|linux-fb|win32) ;;
189   *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
190 esac
191
192 gdktargetlib=libgdk-$gdktarget-1.3.la
193 gtktargetlib=libgtk-$gdktarget-1.3.la
194
195 AC_SUBST(gdktargetlib)
196 AC_SUBST(gtktargetlib)
197
198 AC_ARG_ENABLE(shadowfb, [  --disable-shadowfb      disable shadowfb support for linux-fb],,enable_shadowfb=yes)
199
200 AC_ARG_ENABLE(fbmanager, [  --enable-fbmanager      enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
201         
202 if test "x$enable_debug" = "xyes"; then
203   test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
204   GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
205 else
206   if test "x$enable_debug" = "xno"; then
207     GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
208   else
209     GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
210   fi
211 fi
212
213 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
214
215                         
216 # Build time sanity check...
217 AM_SANITY_CHECK
218
219 # Checks for programs.
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     if test -f $with_wintab/lib/i386/wntab32x.lib ; then
395       have_wintab=yes
396       AC_DEFINE(HAVE_WINTAB)
397       WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
398       AC_SUBST(WINTAB_LIB)
399     else
400       have_wintab=no
401     fi
402     ],
403    [AC_MSG_RESULT(no)
404     have_wintab=no])
405   CFLAGS="$saved_cflags"
406 fi
407 AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
408
409 saved_cflags="$CFLAGS"
410 saved_ldflags="$LDFLAGS"
411
412
413 # Checks for header files.
414 AC_HEADER_STDC
415
416 # Checks for typedefs, structures, and compiler characteristics.
417 AC_C_CONST
418
419 # Checks for library functions.
420 AC_TYPE_SIGNAL
421 AC_FUNC_MMAP
422
423 AC_CHECK_FUNCS(getresuid)
424 AC_TYPE_UID_T
425
426 # Check if <sys/select.h> needs to be included for fd_set
427 AC_MSG_CHECKING([for fd_set])
428 AC_TRY_COMPILE([#include <sys/types.h>],
429         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
430 if test $gtk_ok = yes; then
431     AC_MSG_RESULT([yes, found in sys/types.h])
432 else
433     AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
434     if test $gtk_ok = yes; then
435         AC_DEFINE(HAVE_SYS_SELECT_H)
436         AC_MSG_RESULT([yes, found in sys/select.h])
437     else
438         AC_DEFINE(NO_FD_SET)
439         AC_MSG_RESULT(no)
440     fi
441 fi
442
443 # `widechar' tests for gdki18n.h
444 AC_MSG_CHECKING(for wchar.h)
445 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
446 if test $gdk_wchar_h = yes; then
447    AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
448 fi
449 AC_MSG_RESULT($gdk_wchar_h)
450
451 # Check for wctype.h (for iswalnum)
452 AC_MSG_CHECKING(for wctype.h)
453 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
454 if test $gdk_wctype_h = yes; then
455    AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
456 fi
457 AC_MSG_RESULT($gdk_wctype_h)
458
459 # in Solaris 2.5, `iswalnum' is in -lw
460 GDK_WLIBS=
461 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
462
463 oLIBS="$LIBS"
464 LIBS="$LIBS $GDK_WLIBS"
465 # The following is necessary for Linux libc-5.4.38
466 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
467 AC_TRY_LINK([#include <stdlib.h>],[
468 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
469 #  ifdef HAVE_WCTYPE_H
470 #    include <wctype.h>
471 #  else
472 #    ifdef HAVE_WCHAR_H
473 #      include <wchar.h>
474 #    endif
475 #  endif
476 #else
477 #  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
478 #endif
479 iswalnum((wchar_t) 0);
480 ], gdk_working_wctype=yes, gdk_working_wctype=no)
481 LIBS="$oLIBS"
482
483 if test $gdk_working_wctype = no; then
484    AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
485    GDK_WLIBS=
486 fi
487 AC_MSG_RESULT($gdk_working_wctype)
488 AC_SUBST(GDK_WLIBS)
489
490
491
492 ##################################################
493 # Checks for gdk-pixbuf
494 ##################################################
495
496 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
497
498 AC_ARG_ENABLE(modules, [  --disable-modules       Disables dynamic module loading],[
499         if test x$withval = xyes; then 
500             with_modules=yes
501         else
502             with_modules=no
503         fi
504 ])
505
506 dynworks=false
507 deps=
508 if test x$with_modules = xno; then
509     AC_MSG_RESULT(no)
510 else
511     AC_MSG_RESULT(yes)
512     AC_MSG_CHECKING(whether dynamic modules work)
513     ## for loop is to strip newline 
514     tmp=`pkg-config --variable=gmodule_supported gmodule-2.0`
515     for I in $tmp; do
516         dynworks=$I
517     done
518 fi
519
520 dnl Now we check to see if our libtool supports shared lib deps
521 dnl (in a rather ugly way even)
522 if $dynworks; then
523    pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
524    pixbuf_deplibs_check=`$pixbuf_libtool_config | \
525       grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
526       sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
527    if test "x$pixbuf_deplibs_check" = "xnone" || \
528       test "x$pixbuf_deplibs_check" = "xunknown" || \
529       test "x$pixbuf_deplibs_check" = "x"; then
530       dynworks=false
531    fi
532 fi
533
534 if $dynworks; then
535    AC_DEFINE(USE_GMODULE)
536    AC_MSG_RESULT(yes)
537 else
538    AC_MSG_RESULT(no)
539 fi
540
541 dnl Test for libtiff
542   if test -z "$LIBTIFF"; then
543     AC_CHECK_LIB(tiff, TIFFReadScanline,
544       [AC_CHECK_HEADER(tiffio.h,
545         TIFF='tiff'; LIBTIFF='-ltiff',
546         AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
547       [AC_CHECK_LIB(tiff, TIFFWriteScanline,
548         [AC_CHECK_HEADER(tiffio.h,
549           TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
550           AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
551         [AC_CHECK_LIB(tiff34, TIFFFlushData,
552           [AC_CHECK_HEADER(tiffio.h,
553             TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
554             AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
555         AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
556   fi
557
558 dnl Test for libjpeg
559   if test -z "$LIBJPEG"; then
560     AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
561       jpeg_ok=yes,
562       jpeg_ok=no
563       AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
564     if test "$jpeg_ok" = yes; then
565       AC_MSG_CHECKING([for jpeglib.h])
566       AC_TRY_CPP(
567 [#include <stdio.h>
568 #undef PACKAGE
569 #undef VERSION
570 #include <jpeglib.h>],
571         jpeg_ok=yes,
572         jpeg_ok=no)
573       AC_MSG_RESULT($jpeg_ok)
574       if test "$jpeg_ok" = yes; then
575         LIBJPEG='-ljpeg'
576         AC_CHECK_LIB(jpeg, jpeg_simple_progression,     
577           AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
578           AC_MSG_WARN(JPEG library does not support progressive saving.))
579       else
580           AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
581       fi
582     fi
583   fi
584
585 dnl Test for libpng
586   if test -z "$LIBPNG"; then
587     AC_CHECK_LIB(png, png_read_info,
588       [AC_CHECK_HEADER(png.h,
589         png_ok=yes,
590         png_ok=no)],
591       AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
592     if test "$png_ok" = yes; then
593       AC_MSG_CHECKING([for png_structp in png.h])
594       AC_TRY_COMPILE([#include <png.h>],
595         [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
596         png_ok=yes,
597         png_ok=no)
598       AC_MSG_RESULT($png_ok)
599       if test "$png_ok" = yes; then
600         PNG='png'; LIBPNG='-lpng -lz'
601       else
602         AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
603       fi
604     else
605      AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
606     fi
607   fi
608
609 AC_SUBST(LIBTIFF)
610 AC_SUBST(LIBJPEG)
611 AC_SUBST(LIBPNG)
612
613 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
614
615 #
616 # Allow building some or all gdk-pixbuf loaders included
617 #
618 AC_MSG_CHECKING(pixbuf loaders to build)
619
620 AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
621
622 if $dynworks; then 
623         :
624 else
625    ## if the option was specified, leave it; otherwise disable included loaders
626    if test x$with_included_loaders = xno; then
627            with_included_loaders=yes
628    fi
629 fi
630
631 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
632 included_loaders=""
633 # If no loaders specified, include all
634 if test "x$with_included_loaders" = xyes ; then
635   included_loaders="$all_loaders"
636 else
637   included_loaders="$with_included_loaders"
638 fi
639
640 AC_MSG_RESULT($included_loaders)
641
642 INCLUDED_LOADER_OBJ=
643 INCLUDED_LOADER_DEFINE=
644
645 IFS="${IFS=     }"; gtk_save_ifs="$IFS"; IFS=","
646 for loader in $included_loaders; do
647  if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
648    :
649  else
650    AC_MSG_ERROR([the specified loader $loader does not exist])
651  fi
652
653  INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
654  INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
655 done
656 IFS="$gtk_save_ifs"
657 AC_SUBST(INCLUDED_LOADER_OBJ)
658 AC_SUBST(INCLUDED_LOADER_DEFINE)
659
660 AC_HEADER_DIRENT
661 AC_HEADER_SYS_WAIT
662
663 AC_TYPE_SIGNAL
664
665 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
666 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
667 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
668
669 if $dynworks ; then
670   STATIC_LIB_DEPS=
671   if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
672     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
673   fi
674   if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
675     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
676   fi
677   if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
678     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
679   fi
680 else
681   STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
682 fi
683
684 # Checks to see if we should compile in MMX support (there will be
685 # a runtime test when the code is actually run to see if it should
686 # be used - this just checks if we can compile it.)
687 #
688 # This code is partially taken from Mesa
689 #
690 AC_MSG_CHECKING(for x86 platform)
691 case $host_cpu in
692   i386|i486|i586|i686|i786|k6|k7)
693         use_x86_asm=yes
694         ;;
695    *)
696         use_x86_asm=no
697 esac
698 AC_MSG_RESULT($use_x86_asm)
699
700 use_mmx_asm=no
701 if test $use_x86_asm = yes; then
702     save_ac_ext=$ac_ext
703     ac_ext=S
704     
705     AC_MSG_CHECKING(compiler support for MMX)
706     cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
707     if AC_TRY_EVAL(ac_compile); then
708         use_mmx_asm=yes
709     fi
710
711     rm -rf conftest*
712
713     ac_ext=$save_ac_ext
714     if test $use_mmx_asm = yes; then
715       AC_DEFINE(USE_MMX)
716       AC_MSG_RESULT(yes)
717     else
718       AC_MSG_RESULT(no)
719     fi
720 fi
721
722 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
723
724
725 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
726 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
727 GDK_PIXBUF_EXTRA_CFLAGS= 
728 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
729 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
730
731 AC_SUBST(GDK_PIXBUF_PACKAGES)
732 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
733 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
734 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
735 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
736
737
738 ########################################
739 # Windowing system checks
740 ########################################
741
742 GDK_EXTRA_LIBS=$GDK_WLIBS
743 GDK_EXTRA_CFLAGS= 
744
745 if test "x$gdktarget" = "xx11"; then
746   # We start off with the libraries from Pango
747
748   ## be sure we also have Pango built with xft support
749   if $PKG_CONFIG --exists pangoxft ; then
750     PANGO_PACKAGES="pangox pangoxft"
751     have_xft=true
752     AC_DEFINE(HAVE_XFT)
753   else
754     PANGO_PACKAGES="pangox"
755     have_xft=false
756   fi
757
758   AM_CONDITIONAL(HAVE_XFT, $have_xft)
759
760   x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
761   x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
762   x_extra_libs=
763
764   ## Strip the .la files
765  
766   x_libs_for_checks=""
767   for I in $x_libs ; do
768     case $I in 
769       *.la) ;;
770       *) x_libs_for_checks="$x_libs_for_checks $I" ;;
771     esac
772   done
773
774   # Sanity check for the X11 library
775   AC_CHECK_LIB(X11, XOpenDisplay, :,
776             AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
777             $x_libs_for_checks)
778
779   if test "x$enable_shm" = "xyes"; then
780     # Check for the Xext library (needed for XShm extention)
781     AC_CHECK_LIB(Xext, XShmAttach,
782         if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
783           x_extra_libs="-lXext"
784         fi,
785         # On AIX, it is in XextSam instead, but we still need -lXext
786         AC_CHECK_LIB(XextSam, XShmAttach, 
787             if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
788                x_extra_libs="-lXextSam -lXext"
789             else
790                x_extra_libs="-lXextSam"
791             fi, , $x_libs_for_checks),
792         $x_libs_for_checks)
793   fi
794
795   GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
796   # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
797   GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
798
799   # Check for shaped window extension
800
801   AC_CHECK_LIB(Xext, XShapeCombineMask,
802       if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
803            x_extra_libs="-lXext $x_extra_libs"
804       fi
805       AC_DEFINE(HAVE_SHAPE_EXT),
806       ,
807       $x_libs_for_checks)
808
809   # Check for XConvertCase (X11R6 specific)
810
811   AC_CHECK_LIB(X11, XConvertCase,
812       AC_DEFINE(HAVE_XCONVERTCASE),
813       ,
814       $x_libs_for_checks)
815
816   # Check for XIM support.
817
818   AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
819             : ,
820             enable_xim_inst="no",
821             $x_libs_for_checks)
822
823   # On Solaris, calling XRegisterIMInstantiateCallback seems to
824   # cause an immediate segfault, so we disable it, unless
825   # the user specifically forces it to be on.
826
827   if test x$enable_xim_inst = xmaybe ; then
828     case host in
829           *-*-solaris*)
830             enable_xim_inst="no"
831             ;;
832           *)
833             enable_xim_inst="yes"
834             ;;
835     esac
836   fi
837
838   if test "x$enable_xim" = "xyes"; then
839     GTK_XIM_FLAGS="-DUSE_XIM"
840     if test "x$enable_xim_inst" = "xyes"; then
841       AC_DEFINE(USE_X11R6_XIM)
842     fi
843   fi
844
845   # Check for XKB support.
846
847   if test "x$enable_xkb" = "xyes"; then
848         AC_MSG_WARN(XKB support explicitly enabled)
849         AC_DEFINE(HAVE_XKB)
850   elif test "x$enable_xkb" = "xmaybe"; then
851         AC_CHECK_LIB(X11, XkbQueryExtension,
852                      AC_DEFINE(HAVE_XKB),
853                      ,
854                      $x_libs_for_checks)
855   else
856         AC_MSG_WARN(XKB support explicitly disabled)
857   fi
858
859   x_cflags="$X_CFLAGS"
860   x_ldflags="$X_LDFLAGS"
861
862   # set up things for XInput
863
864   if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
865     AC_DEFINE(XINPUT_GXI)
866     xinput_progs=gxid
867     x_extra_libs="-lXi $x_extra_libs"
868   elif test "x$with_xinput" = "xxfree"; then
869     AC_DEFINE(XINPUT_XFREE)
870     x_extra_libs="-lXi $x_extra_libs"
871   else
872     AC_DEFINE(XINPUT_NONE)
873   fi
874
875   AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
876   AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
877
878   if test "x$enable_shm" = "xyes"; then
879     # Check for shared memory
880     AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
881     AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
882
883     # Check for the X shared memory extension header file
884     have_xshm=no 
885     AC_MSG_CHECKING(X11/extensions/XShm.h)
886     if test "x$no_xext_lib" = "xyes"; then
887       :
888     else
889       gtk_save_CFLAGS="$CFLAGS"
890       CFLAGS="$CFLAGS $x_cflags"
891       AC_TRY_COMPILE([
892 #include <stdlib.h>
893 #include <sys/types.h>
894 #include <sys/ipc.h>
895 #include <sys/shm.h>
896 #include <X11/Xlib.h>
897 #include <X11/Xutil.h>
898 #include <X11/extensions/XShm.h>
899 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
900       CFLAGS="$gtk_save_CFLAGS"
901     fi
902     AC_MSG_RESULT($have_xshm)
903     if test $have_xshm = yes ; then
904       AC_DEFINE(HAVE_XSHM_H)
905     fi
906   fi
907
908   GDK_EXTRA_CFLAGS=
909   GDK_EXTRA_LIBS="$x_extra_libs"
910
911   AM_CONDITIONAL(USE_X11, true)
912 else
913   AM_CONDITIONAL(USE_X11, false)
914 fi
915
916 if test "x$gdktarget" = "xwin32"; then
917   # We start off with the libraries from Pango
918
919   ## be sure we also have Pango built with win32 support
920   PANGO_PACKAGES="pangowin32"
921
922   if test x$have_wintab = xyes; then
923     GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
924     AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
925   fi
926
927   GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
928   AM_CONDITIONAL(USE_WIN32, true)
929 else
930   AM_CONDITIONAL(USE_WIN32, false)
931 fi
932
933 AC_SUBST(xinput_progs)
934
935 GDK_PIXBUF_XLIB_PACKAGES=
936 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
937 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags  $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
938
939 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
940 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
941 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
942 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
943 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
944
945 if test "x$gdktarget" = "xlinux-fb"; then
946   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
947   if test x$FREETYPE_CONFIG = xno ; then
948     AC_MSG_ERROR([*** freetype-config not found])
949   fi
950
951   FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
952   FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
953   CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
954
955   if test x$enable_shadowfb = xyes ; then
956     AC_DEFINE(ENABLE_SHADOW_FB)
957   fi
958
959   if test x$enable_fbmanager = xyes ; then
960     AC_DEFINE(ENABLE_FB_MANAGER)
961     AM_CONDITIONAL(ENABLE_FB_MANAGER, true)
962   else
963     AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
964   fi
965   
966   GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
967   GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
968
969   AM_CONDITIONAL(USE_LINUX_FB, true)
970 else
971   AM_CONDITIONAL(USE_LINUX_FB, false)
972   AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
973 fi
974
975 #
976 # Pick correct Pango packages to use
977 #
978
979 if test "x$gdktarget" = "xx11"; then
980         if $have_xft = true ; then
981             PANGO_PACKAGES="pangox pangoxft"
982         else
983             PANGO_PACKAGES=pangox
984         fi
985 elif test "x$gdktarget" = "xwin32"; then
986         PANGO_PACKAGES=pangowin32
987 elif test "x$gdktarget" = "xlinux-fb"; then
988         PANGO_PACKAGES=pangoft2
989 else
990         PANGO_PACKAGES=pango
991 fi
992
993 # Check for Pango flags
994
995 AC_MSG_CHECKING(Pango flags)
996 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
997         PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
998         PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
999
1000         AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1001 else
1002         AC_MSG_ERROR([
1003 *** Pango not found. Pango is required to build GTK+.
1004 *** See http://www.pango.org for Pango information.
1005 *** For the framebuffer target, you will need to build 
1006 *** Pango with freetype support.
1007 ])
1008 fi
1009
1010 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1011
1012 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1013         :
1014 else
1015         AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
1016 *** Can't link to Pango. Pango is required to build
1017 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
1018 fi
1019
1020 CFLAGS="$saved_cflags"
1021 LDFLAGS="$saved_ldflags"
1022
1023 GDK_PACKAGES=$PANGO_PACKAGES
1024 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1025 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1026
1027 AC_SUBST(GDK_PACKAGES)
1028 AC_SUBST(GDK_EXTRA_LIBS)
1029 AC_SUBST(GDK_EXTRA_CFLAGS)
1030 AC_SUBST(GDK_DEP_LIBS)
1031 AC_SUBST(GDK_DEP_CFLAGS)
1032
1033
1034 ########################################
1035 # Check for Accessibility Toolkit flags
1036 ########################################
1037
1038 ATK_PACKAGES=atk
1039 AC_MSG_CHECKING(ATK flags)
1040 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1041         ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1042         ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1043
1044         AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1045 else
1046         AC_MSG_ERROR([
1047 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1048 *** to build GTK+.
1049 ])
1050 fi
1051
1052 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1053         :
1054 else
1055         AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
1056                 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1057                 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
1058 fi
1059
1060 GTK_PACKAGES=atk
1061 GTK_EXTRA_LIBS=
1062 GTK_EXTRA_CFLAGS= 
1063 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1064 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags  $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1065
1066 AC_SUBST(GTK_PACKAGES)
1067 AC_SUBST(GTK_EXTRA_LIBS)
1068 AC_SUBST(GTK_EXTRA_CFLAGS)
1069 AC_SUBST(GTK_DEP_LIBS)
1070 AC_SUBST(GTK_DEP_CFLAGS)
1071
1072
1073 AC_SUBST(GTK_DEBUG_FLAGS)
1074 AC_SUBST(GTK_XIM_FLAGS)
1075
1076 ##################################################
1077 # Checks for gtk-doc and docbook-tools
1078 ##################################################
1079
1080 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs ])
1081
1082 if test "x$with_html_dir" = "x" ; then
1083   HTML_DIR='${datadir}/gtk-doc/html'
1084 else
1085   HTML_DIR=$with_html_dir
1086 fi
1087
1088 AC_SUBST(HTML_DIR)
1089
1090 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1091
1092 gtk_doc_min_version=0.6
1093 if $GTKDOC ; then 
1094     gtk_doc_version=`gtkdoc-mkdb --version`
1095     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
1096     if perl <<EOF ; then
1097       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
1098             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1099 EOF
1100       AC_MSG_RESULT(yes)
1101    else
1102       AC_MSG_RESULT(no)
1103       GTKDOC=false
1104    fi
1105 fi
1106
1107 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1108 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1109
1110 dnl Let people disable the gtk-doc stuff.
1111 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1112
1113 if test x$enable_gtk_doc = xauto ; then
1114   if test x$GTKDOC = xtrue ; then
1115     enable_gtk_doc=yes
1116   else
1117     enable_gtk_doc=no 
1118   fi
1119 fi
1120
1121 dnl NOTE: We need to use a separate automake conditional for this
1122 dnl       to make this work with the tarballs.
1123 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1124
1125
1126 ##################################################
1127 # Output commands
1128 ##################################################
1129
1130 AC_OUTPUT_COMMANDS([
1131
1132 ## Generate `gdk/gdkconfig.h' in two cases
1133 ## 1. `config.status' is run either explicitly, or via configure.
1134 ##     Esp. not when it is run in `Makefile' to generate makefiles and
1135 ##     config.h
1136 ## 2. CONFIG_OTHER is set explicitly
1137 ##
1138 ## Case 1 is difficult.  We know that `automake' sets one of
1139 ## CONFIG_FILES or CONFIG_HEADERS to empty.  This heuristic works
1140 ## only when AM_CONFIG_HEADER is set, however.
1141
1142 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1143   # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1144   CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1145 fi
1146 case "$CONFIG_OTHER" in
1147 *gdk/gdkconfig.h*)
1148         echo creating gdk/gdkconfig.h
1149         outfile=gdkconfig.h-tmp
1150         cat > $outfile <<\_______EOF
1151 /* gdkconfig.h
1152  *
1153  * This is a generated file.  Please modify `configure.in'
1154  */
1155
1156 #ifndef GDKCONFIG_H
1157 #define GDKCONFIG_H
1158
1159 #ifdef __cplusplus
1160 extern "C" {
1161 #endif /* __cplusplus */
1162
1163 _______EOF
1164
1165         cat >>$outfile <<_______EOF
1166 $gdk_windowing
1167 $gdk_wc
1168 _______EOF
1169
1170         cat >>$outfile <<_______EOF
1171
1172 #ifdef __cplusplus
1173 }
1174 #endif /* __cplusplus */
1175
1176 #endif /* GDKCONFIG_H */
1177 _______EOF
1178
1179
1180         if cmp -s $outfile gdk/gdkconfig.h; then
1181           echo gdk/gdkconfig.h is unchanged
1182           rm -f $outfile
1183         else
1184           mv $outfile gdk/gdkconfig.h
1185         fi ;;
1186 esac
1187 ],[
1188 if test "x$gdktarget" = "xx11" ; then
1189   gdk_windowing='
1190 #define GDK_WINDOWING_X11'
1191 elif test "x$gdktarget" = "xwin32" ; then
1192   gdk_windowing='
1193 #define GDK_WINDOWING_WIN32'
1194 elif test "x$gdktarget" = "xlinux-fb" ; then
1195   gdk_windowing='
1196 #define GDK_WINDOWING_FB
1197 #define GDK_NATIVE_WINDOW_POINTER'
1198 fi
1199
1200 if test x$gdk_wchar_h = xyes; then
1201   gdk_wc='
1202 #define GDK_HAVE_WCHAR_H 1'
1203 fi
1204 if test x$gdk_wctype_h = xyes; then
1205   gdk_wc="\$gdk_wc
1206 #define GDK_HAVE_WCTYPE_H 1"
1207 fi
1208 if test x$gdk_working_wctype = xno; then
1209   gdk_wc="\$gdk_wc
1210 #define GDK_HAVE_BROKEN_WCTYPE 1"
1211 fi
1212
1213
1214 ])
1215
1216 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1217 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1218
1219 AC_OUTPUT([
1220 config.h.win32
1221 gtk-zip.sh
1222 gtk+.spec
1223 Makefile
1224 gdk-pixbuf-2.0.pc
1225 gdk-2.0.pc
1226 gtk+-2.0.pc
1227 gdk-pixbuf-2.0-uninstalled.pc
1228 gdk-2.0-uninstalled.pc
1229 gtk+-2.0-uninstalled.pc
1230 m4macros/Makefile
1231 po/Makefile.in
1232 build/Makefile
1233 build/win32/Makefile
1234 build/win32/dirent/Makefile
1235 demos/Makefile
1236 demos/gtk-demo/Makefile
1237 tests/Makefile
1238 docs/Makefile
1239 docs/reference/Makefile
1240 docs/reference/gdk-pixbuf/Makefile
1241 docs/reference/gdk/Makefile
1242 docs/reference/gtk/Makefile
1243 docs/faq/Makefile
1244 docs/tutorial/Makefile
1245 gdk-pixbuf/Makefile
1246 gdk-pixbuf/makefile.mingw
1247 gdk-pixbuf/gdk-pixbuf-features.h
1248 gdk-pixbuf/pixops/Makefile
1249 gdk-pixbuf/pixops/makefile.mingw
1250 gdk/Makefile
1251 gdk/makefile.mingw
1252 gdk/x11/Makefile
1253 gdk/win32/Makefile
1254 gdk/win32/makefile.mingw
1255 gdk/win32/rc/Makefile
1256 gdk/win32/rc/gdk.rc
1257 gdk/linux-fb/Makefile
1258 gtk/Makefile
1259 gtk/makefile.mingw
1260 gtk/makefile.msc
1261 gtk/gtkversion.h
1262 gtk/gtk-win32.rc
1263 gtk/stock-icons/Makefile
1264 modules/Makefile
1265 modules/input/Makefile
1266 contrib/Makefile
1267 contrib/gdk-pixbuf-xlib/Makefile
1268 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc
1269 ])