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