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