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