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