]> Pileus Git - ~andy/gtk/blob - configure.in
Add ani to all_loaders.
[~andy/gtk] / configure.in
1 # require autoconf 2.52
2 AC_PREREQ(2.52)
3
4 # Process this file with autoconf to produce a configure script.
5 AC_INIT(gdk/gdktypes.h)
6
7 #
8 # For each of the libraries we build, we define the following
9 # substituted variables:
10 #
11 # foo_PACKAGES:     pkg-config packages this library requires
12 # foo_EXTRA_LIBS:   Libraries this module requires not pulled in by pkg-config
13 # foo_EXTRA_CFLAGS: cflags this module requires not pulled in by pkg-config
14 # foo_DEP_LIBS:     All libraries this module requires
15 # foo_DEP_CFLAGS:   All cflags this module requires
16
17
18 # Save this value here, since automake will set cflags later
19 cflags_set=${CFLAGS+set}
20
21 dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
22 dnl are available for $ac_help expansion (don't we all *love* autoconf?)
23 GLIB_AC_DIVERT_BEFORE_HELP([
24 #
25 # Making releases:
26 #   GTK_MICRO_VERSION += 1;
27 #   GTK_INTERFACE_AGE += 1;
28 #   GTK_BINARY_AGE += 1;
29 # if any functions have been added, set GTK_INTERFACE_AGE to 0.
30 # if backwards compatibility has been broken,
31 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
32 #
33 GTK_MAJOR_VERSION=2
34 GTK_MINOR_VERSION=1
35 GTK_MICRO_VERSION=0
36 GTK_INTERFACE_AGE=0
37 GTK_BINARY_AGE=100
38 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
39 dnl This is the X.Y used in -lgtk-FOO-X.Y
40 GTK_API_VERSION=2.0
41 ])dnl
42
43 AC_SUBST(GTK_MAJOR_VERSION)
44 AC_SUBST(GTK_MINOR_VERSION)
45 AC_SUBST(GTK_MICRO_VERSION)
46 AC_SUBST(GTK_INTERFACE_AGE)
47 AC_SUBST(GTK_BINARY_AGE)
48 AC_SUBST(GTK_API_VERSION)
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
58 LT_RELEASE=$GTK_MAJOR_VERSION.0
59 LT_CURRENT=`expr 100 '*' $GTK_MINOR_VERSION + $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
60 LT_REVISION=$GTK_INTERFACE_AGE
61 LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
62 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
63 AC_SUBST(LT_RELEASE)
64 AC_SUBST(LT_CURRENT)
65 AC_SUBST(LT_REVISION)
66 AC_SUBST(LT_AGE)
67 AC_SUBST(LT_CURRENT_MINUS_AGE)
68
69 # Define a string for the earliest version that this release has
70 # forward/backwards binary compatibility with. This is used for module
71 # locations. (Should this be backwards-compat instead?)
72 #
73 #GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
74 GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.0.$LT_CURRENT
75 AC_SUBST(GTK_BINARY_VERSION)
76
77 #
78 # gdk-pixbuf gets versioned separately, and for now, using standard
79 # libtool versioning, not GTK+-style versioning
80 #
81 GDK_PIXBUF_MAJOR=$GTK_MAJOR_VERSION
82 GDK_PIXBUF_MINOR=$GTK_MINOR_VERSION
83 GDK_PIXBUF_MICRO=$GTK_MICRO_VERSION
84 GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
85 AC_SUBST(GDK_PIXBUF_MAJOR)
86 AC_SUBST(GDK_PIXBUF_MINOR)
87 AC_SUBST(GDK_PIXBUF_MICRO)
88 AC_SUBST(GDK_PIXBUF_VERSION)
89
90 ## Versions of dependencies
91 GLIB_REQUIRED_VERSION=2.0.1
92 PANGO_REQUIRED_VERSION=1.0.1
93 ATK_REQUIRED_VERSION=1.0.1
94
95 # For automake.
96 VERSION=$GTK_VERSION
97 PACKAGE=gtk+
98
99 GETTEXT_PACKAGE=gtk20
100 AC_SUBST(GETTEXT_PACKAGE)
101 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
102
103 # Save this value here, since automake will set cflags later
104 cflags_set=${CFLAGS+set}
105
106 dnl Initialize automake stuff
107 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
108
109 # Specify a configuration file
110 AM_CONFIG_HEADER(config.h)
111
112 dnl Initialize libtool
113 AC_PROG_CC
114 AM_DISABLE_STATIC
115 AC_LIBTOOL_WIN32_DLL
116 AM_PROG_LIBTOOL
117
118 dnl XXXX Hack: Set AS and ASFLAGS so that automake 1.5 will be happy
119 AS="\${CC}"
120 ASFLAGS="\${CFLAGS}"
121 AC_SUBST(AS)
122 AC_SUBST(ASFLAGS)
123 dnl XXXX Hack: Set CCAS and CCASFLAGS so that automake 1.6 will be happy
124 CCAS="\${CC}"
125 CCASFLAGS="\${CFLAGS}"
126 AC_SUBST(CCAS)
127 AC_SUBST(CCASFLAGS)
128
129 dnl Initialize maintainer mode
130 AM_MAINTAINER_MODE
131
132 AC_CANONICAL_HOST
133
134 AC_MSG_CHECKING([for some Win32 platform])
135 case "$host" in
136   *-*-mingw*|*-*-cygwin*)
137     platform_win32=yes
138     ;;
139   *)
140     platform_win32=no
141     ;;
142 esac
143 AC_MSG_RESULT([$platform_win32])
144 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
145
146 MATH_LIB=-lm
147 AC_MSG_CHECKING([for native Win32])
148 case "$host" in
149   *-*-mingw*)
150     os_win32=yes
151     MATH_LIB=
152     ;;
153   *)
154     os_win32=no
155     ;;
156 esac
157 AC_MSG_RESULT([$os_win32])
158 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
159
160 if test "$os_win32" = "yes"; then
161   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
162 fi
163 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
164
165 dnl figure debugging default, prior to $ac_help setup
166 dnl
167 GLIB_AC_DIVERT_BEFORE_HELP([
168 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
169         debug_default=yes
170 else
171         debug_default=minimum
172 fi
173 ])dnl
174
175 dnl declare --enable-* args and collect ac_help strings
176 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
177 AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available [default=yes]],
178                    echo $enable_shm, enable_shm="yes")
179 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
180                     , enable_ansi=no)
181 AC_ARG_ENABLE(xim, [  --enable-xim            support XIM [default=yes]],
182                         , enable_xim="yes")
183 AC_ARG_ENABLE(xkb, [  --enable-xkb            support XKB [default=maybe]],
184                         , enable_xkb="maybe")
185 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
186
187 AC_ARG_WITH(xinput, [  --with-xinput=[no/yes]  support XInput ])
188
189 AC_ARG_WITH(wintab, [  --with-wintab=DIRECTORY use Wintab API with win32 backend])
190 AC_ARG_WITH(ie55, [  --with-ie55=DIRECTORY IE5.5 libs and headers (for Active IMM)])
191
192 GLIB_AC_DIVERT_BEFORE_HELP([
193 if test "$platform_win32" = yes; then
194   gdktarget=win32
195 else
196   gdktarget=x11
197 fi
198 ])
199
200 AC_ARG_WITH(gdktarget, [  --with-gdktarget=[[x11/linux-fb/win32]] select GDK target [default=$gdktarget]],
201         gdktarget=$with_gdktarget)
202
203 AC_SUBST(gdktarget)
204 case $gdktarget in
205   x11|linux-fb|win32) ;;
206   *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
207 esac
208
209 gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
210 gtktargetlib=libgtk-$gdktarget-$GTK_API_VERSION.la
211
212 AC_SUBST(gdktargetlib)
213 AC_SUBST(gtktargetlib)
214
215 AC_ARG_ENABLE(shadowfb, [  --disable-shadowfb      disable shadowfb support for linux-fb],,enable_shadowfb=yes)
216
217 AC_ARG_ENABLE(fbmanager, [  --enable-fbmanager      enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
218         
219 if test "x$enable_debug" = "xyes"; then
220   test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
221   GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
222 else
223   if test "x$enable_debug" = "xno"; then
224     GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
225   else
226     GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
227   fi
228 fi
229
230 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
231
232                         
233 # Build time sanity check...
234 AM_SANITY_CHECK
235
236 # Checks for programs.
237 AC_ISC_POSIX
238 AM_PROG_CC_STDC
239 AC_PROG_INSTALL
240 AC_PROG_MAKE_SET
241
242 changequote(,)dnl
243 if test "x$GCC" = "xyes"; then
244   case " $CFLAGS " in
245   *[\ \ ]-Wall[\ \      ]*) ;;
246   *) CFLAGS="$CFLAGS -Wall" ;;
247   esac
248
249   if test "x$enable_ansi" = "xyes"; then
250     case " $CFLAGS " in
251     *[\ \       ]-ansi[\ \      ]*) ;;
252     *) CFLAGS="$CFLAGS -ansi" ;;
253     esac
254
255     case " $CFLAGS " in
256     *[\ \       ]-pedantic[\ \  ]*) ;;
257     *) CFLAGS="$CFLAGS -pedantic" ;;
258     esac
259   fi
260
261   if test "$os_win32" = "yes"; then
262     case "$CC $CFLAGS " in
263     *[[\ \      ]]-fnative-struct[[\ \  ]]*) ;;
264     *) CFLAGS="$CFLAGS -fnative-struct" ;;
265     esac
266   fi
267 fi
268 changequote([,])dnl
269
270 # Honor aclocal flags
271 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
272
273 ## Initial sanity check, done here so that users get told they 
274 ## have the wrong dependencies as early in the process as possible.
275 ## Later on we actually use the cflags/libs from separate pkg-config
276 ## calls. Oh, also the later pkg-config calls don't include 
277 ## the version requirements since those make the module lists 
278 ## annoying to construct
279 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION atk >= $ATK_REQUIRED_VERSION pango >= $PANGO_REQUIRED_VERSION)
280
281 if test "$os_win32" != yes; then
282     # libtool option to control which symbols are exported
283     # right now, symbols starting with _ are not exported
284     LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
285 else
286     # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
287     LIBTOOL_EXPORT_OPTIONS=
288 fi
289 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
290
291 dnl ******************************************************
292 dnl * See whether to include shared library dependencies *
293 dnl ******************************************************
294
295 AC_ARG_ENABLE(explicit-deps, 
296               [  --enable-explicit-deps=[yes/no/auto]    use explicit dependencies in .pc files [default=auto]],
297               enable_explicit_deps="$enableval", 
298               enable_explicit_deps=auto)
299
300 AC_MSG_CHECKING([Whether to write dependencies into .pc files])
301 case $enable_explicit_deps in
302   auto)
303     deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh`
304     if test "X$deplib_check_method" = Xnone || test "x$enable_static" = xyes ; then
305       enable_explicit_deps=yes  
306     else
307       enable_explicit_deps=no  
308     fi
309   ;;
310   yes|no) 
311   ;;
312   *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
313   ;;
314 esac
315 AC_MSG_RESULT($enable_explicit_deps)
316
317 AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
318
319 # define a MAINT-like variable REBUILD which is set if Perl
320 # and awk are found, so autogenerated sources can be rebuilt
321
322 AC_PATH_PROGS(PERL, perl5 perl)
323
324 # We would like indent, but don't require it.
325 AC_CHECK_PROG(INDENT, indent, indent)
326
327 REBUILD=\#
328 if test "x$enable_rebuilds" = "xyes" && \
329      test -n "$PERL" && \
330      $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
331   REBUILD=
332 fi
333 AC_SUBST(REBUILD)
334
335 AC_CHECK_FUNCS(lstat mkstemp flockfile)
336
337 # sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
338 AC_MSG_CHECKING(for sigsetjmp)
339 AC_TRY_LINK([#include <setjmp.h>], [
340 sigjmp_buf env;
341 sigsetjmp(env, 0);
342 ], gtk_ok=yes, gtk_ok=no)
343 AC_MSG_RESULT($gtk_ok)
344 if test "$gtk_ok" = "yes"; then
345   AC_DEFINE(HAVE_SIGSETJMP)
346 fi
347
348 AC_MSG_CHECKING(whether make is GNU Make)
349 STRIP_BEGIN=
350 STRIP_END=
351 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
352         STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
353         STRIP_END=')'
354         AC_MSG_RESULT(yes)
355 else
356         AC_MSG_RESULT(no)
357 fi
358 STRIP_DUMMY=
359 AC_SUBST(STRIP_DUMMY)
360 AC_SUBST(STRIP_BEGIN)
361 AC_SUBST(STRIP_END)
362
363 # i18n stuff
364 ALL_LINGUAS="az bg ca cs cy da de el en_GB en@IPA es et eu fa fi fr ga gl he hi 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"
365 AM_GLIB_GNU_GETTEXT
366 LIBS="$LIBS $INTLLIBS"
367
368 # AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
369 # this is the directory where the *.{mo,gmo} files are installed
370 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
371 AC_SUBST(gtklocaledir)
372
373 dnl The DU4 header files don't provide library prototypes unless 
374 dnl -std1 is given to the native cc.
375 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
376
377 gtk_save_LIBS=$LIBS
378 LIBS="$LIBS -lm"
379 AC_TRY_RUN([#include <math.h>
380              int main (void) { return (log(1) != log(1.)); }],
381      AC_MSG_RESULT(none needed),
382      gtk_save_CFLAGS="$CFLAGS"
383      CFLAGS="$CFLAGS -std1"
384      AC_TRY_RUN([#include <math.h>
385                  int main (void) { return (log(1) != log(1.)); }],
386          AC_MSG_RESULT(-std1),
387          AC_MSG_RESULT()
388          CFLAGS="$gtk_save_CFLAGS"
389          AC_MSG_WARN(
390                 [No ANSI prototypes found in library. (-std1 didn't work.)]),
391          true
392      ),
393      AC_MSG_RESULT(none needed)
394 )
395 LIBS=$gtk_save_LIBS
396
397 AC_MSG_CHECKING(for the BeOS)
398 case $host in
399   *-*-beos*)
400     AC_MSG_RESULT(yes)
401     MATH_LIB=
402   ;;
403   *)
404     AC_MSG_RESULT(no)
405   ;;
406 esac
407
408 dnl NeXTStep cc seems to need this
409 AC_MSG_CHECKING([for extra flags for POSIX compliance])
410 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
411   AC_MSG_RESULT(none needed),
412   gtk_save_CFLAGS="$CFLAGS"
413   CFLAGS="$CFLAGS -posix"
414   AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
415     AC_MSG_RESULT(-posix),
416     AC_MSG_RESULT()
417     CFLAGS="$gtk_save_CFLAGS"
418     AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
419
420 #
421 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
422
423
424 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
425
426 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
427   AC_MSG_ERROR([
428 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
429 *** GLIB is always available from ftp://ftp.gtk.org/.]),
430   gobject gmodule gthread)
431
432 dnl
433 dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
434 dnl
435 gtk_save_LIBS=$LIBS
436 LIBS="$LIBS $GLIB_LIBS"
437 AC_CHECK_FUNCS(bind_textdomain_codeset)
438 LIBS=$gtk_save_LIBS
439
440 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
441 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
442 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
443 AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
444
445 if test "${with_ie55+set}" = set && test $with_ie55 != no; then
446   AC_MSG_CHECKING([for dimm.h])
447   saved_CFLAGS="$CFLAGS"
448   CFLAGS="$CFLAGS -idirafter $with_ie55/Include"
449   AC_TRY_COMPILE([#include <windows.h>
450 #include <objbase.h>
451 #ifdef __GNUC__
452 /* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
453 #define IMEMENUITEMINFOA hidden_IMEMENUITEMINFOA
454 #define IMEMENUITEMINFOW hidden_IMEMENUITEMINFOW
455 #include <imm.h>
456 #undef IMEMENUITEMINFOA
457 #undef IMEMENUITEMINFOW
458 #endif
459 #include <dimm.h>
460 ],
461    [],
462    [AC_MSG_RESULT(yes)
463     AC_MSG_CHECKING([for IE55 uuid.lib])
464     if test -f $with_ie55/Lib/uuid.lib ; then
465       AC_MSG_RESULT(yes)
466       have_ie55=yes
467       AC_DEFINE(HAVE_DIMM_H)
468       IE55_UUID_LIB="$with_ie55/Lib/uuid.lib"
469       AC_SUBST(IE55_UUID_LIB)
470     else
471       AC_MSG_RESULT(no)
472       CFLAGS="$saved_CFLAGS"
473       have_ie55=no
474     fi
475     ],
476    [AC_MSG_RESULT(no)
477     CFLAGS="$saved_CFLAGS"
478     have_ie55=no])
479 fi
480 AM_CONDITIONAL(HAVE_IE55, test x$have_ie55 = xyes)
481
482 if test "${with_wintab+set}" = set && test $with_wintab != no; then
483   AC_MSG_CHECKING([for wintab.h])
484   saved_CFLAGS="$CFLAGS"
485   CFLAGS="$CFLAGS -I$with_wintab/include"
486   AC_TRY_COMPILE([#include <windows.h>
487 #include <wintab.h>], 
488    [],
489    [AC_MSG_RESULT(yes)
490     AC_MSG_CHECKING([for wntab32x.lib])
491     if test -f $with_wintab/lib/i386/wntab32x.lib ; then
492       AC_MSG_RESULT(yes)
493       have_wintab=yes
494       AC_DEFINE(HAVE_WINTAB)
495       WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
496       AC_SUBST(WINTAB_LIB)
497     else
498       AC_MSG_RESULT(no)
499       CFLAGS="$saved_cflags"
500       have_wintab=no
501     fi
502     ],
503    [AC_MSG_RESULT(no)
504     CFLAGS="$saved_cflags"
505     have_wintab=no])
506 fi
507 AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
508
509 saved_cflags="$CFLAGS"
510 saved_ldflags="$LDFLAGS"
511
512
513 # Checks for header files.
514 AC_HEADER_STDC
515
516 # Checks for typedefs, structures, and compiler characteristics.
517 AC_C_CONST
518
519 # Checks for library functions.
520 AC_TYPE_SIGNAL
521 AC_FUNC_MMAP
522
523 AC_CHECK_FUNCS(getresuid)
524 AC_TYPE_UID_T
525
526 # Check if <sys/select.h> needs to be included for fd_set
527 AC_MSG_CHECKING([for fd_set])
528 AC_TRY_COMPILE([#include <sys/types.h>],
529         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
530 if test $gtk_ok = yes; then
531     AC_MSG_RESULT([yes, found in sys/types.h])
532 else
533     AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
534     if test $gtk_ok = yes; then
535         AC_DEFINE(HAVE_SYS_SELECT_H)
536         AC_MSG_RESULT([yes, found in sys/select.h])
537     else
538         AC_DEFINE(NO_FD_SET)
539         AC_MSG_RESULT(no)
540     fi
541 fi
542
543 # `widechar' tests for gdki18n.h
544 AC_MSG_CHECKING(for wchar.h)
545 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
546 if test $gdk_wchar_h = yes; then
547    AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
548 fi
549 AC_MSG_RESULT($gdk_wchar_h)
550
551 # Check for wctype.h (for iswalnum)
552 AC_MSG_CHECKING(for wctype.h)
553 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
554 if test $gdk_wctype_h = yes; then
555    AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
556 fi
557 AC_MSG_RESULT($gdk_wctype_h)
558
559 # in Solaris 2.5, `iswalnum' is in -lw
560 GDK_WLIBS=
561 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
562
563 oLIBS="$LIBS"
564 LIBS="$LIBS $GDK_WLIBS"
565 # The following is necessary for Linux libc-5.4.38
566 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
567 AC_TRY_LINK([#include <stdlib.h>],[
568 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
569 #  ifdef HAVE_WCTYPE_H
570 #    include <wctype.h>
571 #  else
572 #    ifdef HAVE_WCHAR_H
573 #      include <wchar.h>
574 #    endif
575 #  endif
576 #else
577 #  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
578 #endif
579 iswalnum((wchar_t) 0);
580 ], gdk_working_wctype=yes, gdk_working_wctype=no)
581 LIBS="$oLIBS"
582
583 if test $gdk_working_wctype = no; then
584    AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
585    GDK_WLIBS=
586 fi
587 AC_MSG_RESULT($gdk_working_wctype)
588 AC_SUBST(GDK_WLIBS)
589
590
591
592 ##################################################
593 # Checks for gdk-pixbuf
594 ##################################################
595
596 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
597
598 AC_ARG_ENABLE(modules, [  --disable-modules       disable dynamic module loading],[
599         if test x$withval = xyes; then 
600             with_modules=yes
601         else
602             with_modules=no
603         fi
604 ])
605
606 dynworks=false
607 deps=
608 if test x$with_modules = xno; then
609     AC_MSG_RESULT(no)
610 else
611     AC_MSG_RESULT(yes)
612     AC_MSG_CHECKING(whether dynamic modules work)
613     ## for loop is to strip newline 
614     tmp=`$PKG_CONFIG --variable=gmodule_supported gmodule-2.0`
615     for I in $tmp; do
616         dynworks=$I
617     done
618
619     dnl Now we check to see if our libtool supports shared lib deps
620     dnl (in a rather ugly way even)
621     if $dynworks; then
622         pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
623         pixbuf_deplibs_check=`$pixbuf_libtool_config | \
624             grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
625             sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
626         if test "x$pixbuf_deplibs_check" = "xnone" || \
627            test "x$pixbuf_deplibs_check" = "xunknown" || \
628            test "x$pixbuf_deplibs_check" = "x"; then
629             dynworks=false
630         fi
631     fi
632
633     if $dynworks; then
634         AC_DEFINE(USE_GMODULE)
635         AC_MSG_RESULT(yes)
636     else
637         AC_MSG_RESULT(no)
638     fi
639 fi
640
641 dnl We allow people to disable image loaders explicitely, but if they don't we error
642 dnl out so that people don't accidentally build without them.
643
644 AC_ARG_WITH(libpng,  [  --without-libpng          disable PNG loader for gdk-pixbuf])
645 AC_ARG_WITH(libjpeg, [  --without-libjpeg         disable JPEG loader for gdk-pixbuf])
646 AC_ARG_WITH(libtiff, [  --without-libtiff         disable TIFF loader for gdk-pixbuf])
647
648 dnl Test for libtiff
649   if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
650     AC_CHECK_LIB(tiff, TIFFReadScanline,
651       [AC_CHECK_HEADER(tiffio.h,
652         TIFF='tiff'; LIBTIFF='-ltiff',
653         AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
654       [AC_CHECK_LIB(tiff, TIFFWriteScanline,
655         [AC_CHECK_HEADER(tiffio.h,
656           TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
657           AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
658         [AC_CHECK_LIB(tiff34, TIFFFlushData,
659           [AC_CHECK_HEADER(tiffio.h,
660             TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
661             AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
662         AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
663   fi
664
665   if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
666      AC_MSG_ERROR([
667 *** Checks for TIFF loader failed. You can build without it by passing 
668 *** --without-libtiff to configure but some programs using GTK+ may
669 *** not work properly])
670   fi
671
672 dnl Test for libjpeg
673   if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
674     AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
675       jpeg_ok=yes,
676       jpeg_ok=no
677       AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
678     if test "$jpeg_ok" = yes; then
679       AC_MSG_CHECKING([for jpeglib.h])
680       AC_TRY_CPP(
681 [#include <stdio.h>
682 #undef PACKAGE
683 #undef VERSION
684 #undef HAVE_STDLIB_H
685 #include <jpeglib.h>],
686         jpeg_ok=yes,
687         jpeg_ok=no)
688       AC_MSG_RESULT($jpeg_ok)
689       if test "$jpeg_ok" = yes; then
690         LIBJPEG='-ljpeg'
691         AC_CHECK_LIB(jpeg, jpeg_simple_progression,     
692           AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
693           AC_MSG_WARN(JPEG library does not support progressive saving.))
694       else
695           AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
696       fi
697     fi
698   fi
699
700   if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
701      AC_MSG_ERROR([
702 *** Checks for JPEG loader failed. You can build without it by passing 
703 *** --without-libjpeg to configure but some programs using GTK+ may
704 *** not work properly])
705   fi
706
707 dnl Test for libpng
708   if test x$with_libpng != xno && test -z "$LIBPNG"; then
709     AC_MSG_CHECKING(for libpng12)
710     if $PKG_CONFIG --exists libpng12 ; then
711         AC_MSG_RESULT(yes)
712         PNG='png'
713         PNG_DEP_CFLAGS_PACKAGES=libpng12
714         LIBPNG=`$PKG_CONFIG --libs libpng12`
715     else
716       AC_MSG_RESULT(no)
717       AC_CHECK_LIB(png, png_read_info,
718         [AC_CHECK_HEADER(png.h,
719           png_ok=yes,
720           png_ok=no)],
721         AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
722       if test "$png_ok" = yes; then
723         AC_MSG_CHECKING([for png_structp in png.h])
724         AC_TRY_COMPILE([#include <png.h>],
725           [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
726           png_ok=yes,
727           png_ok=no)
728         AC_MSG_RESULT($png_ok)
729         if test "$png_ok" = yes; then
730           PNG='png'; LIBPNG='-lpng -lz'
731         else
732           AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
733         fi
734       else
735        AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
736       fi
737     fi
738   fi
739
740   if test x$with_libpng != xno && test -z "$LIBPNG"; then
741      AC_MSG_ERROR([
742 *** Checks for PNG loader failed. You can build without it by passing 
743 *** --without-libpng to configure but many programs using GTK+ will
744 *** not work properly. The PNG loader is also needed if you are compiling
745 *** from CVS.])
746   fi
747
748   REBUILD_PNGS=\#
749   if test -z "$LIBPNG"; then
750      REBUILD_PNGS=
751   fi
752   AC_SUBST(REBUILD_PNGS)
753
754 AC_SUBST(LIBTIFF)
755 AC_SUBST(LIBJPEG)
756 AC_SUBST(LIBPNG)
757
758 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
759
760 #
761 # Allow building some or all gdk-pixbuf loaders included
762 #
763 AC_MSG_CHECKING(pixbuf loaders to build)
764
765 AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,...  build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
766
767 if $dynworks; then 
768         :
769 else
770    ## if the option was specified, leave it; otherwise disable included loaders
771    if test x$with_included_loaders = xno; then
772            with_included_loaders=yes
773    fi
774 fi
775
776 all_loaders="png,bmp,wbmp,gif,ico,ani,jpeg,pnm,ras,tiff,xpm,tga"
777 included_loaders=""
778 # If no loaders specified, include all
779 if test "x$with_included_loaders" = xyes ; then
780   included_loaders="$all_loaders"
781 else
782   included_loaders="$with_included_loaders"
783 fi
784
785 AC_MSG_RESULT($included_loaders)
786
787 INCLUDED_LOADER_OBJ=
788 INCLUDED_LOADER_DEFINE=
789
790 IFS="${IFS=     }"; gtk_save_ifs="$IFS"; IFS=","
791 for loader in $included_loaders; do
792  if echo "$all_loaders" | egrep "(^|,)$loader(\$|,)" > /dev/null; then
793    :
794  else
795    AC_MSG_ERROR([the specified loader $loader does not exist])
796  fi
797
798  INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
799  INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
800 done
801 IFS="$gtk_save_ifs"
802 AC_SUBST(INCLUDED_LOADER_OBJ)
803 AC_SUBST(INCLUDED_LOADER_DEFINE)
804
805 AC_HEADER_SYS_WAIT
806
807 AC_TYPE_SIGNAL
808
809 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
810 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
811 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
812
813 if $dynworks ; then
814   STATIC_LIB_DEPS=
815   if echo "$included_loaders" | egrep '(^|,)tiff($|,)' > /dev/null; then
816     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
817   fi
818   if echo "$included_loaders" | egrep '(^|,)jpeg($|,)' > /dev/null; then
819     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
820   fi
821   if echo "$included_loaders" | egrep '(^|,)png($|,)' > /dev/null; then
822     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
823   fi
824 else
825   STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
826 fi
827
828 # Checks to see if we should compile in MMX support (there will be
829 # a runtime test when the code is actually run to see if it should
830 # be used - this just checks if we can compile it.)
831 #
832 # This code is partially taken from Mesa
833 #
834 AC_MSG_CHECKING(for x86 platform)
835 case $host_cpu in
836   i386|i486|i586|i686|i786|k6|k7)
837         use_x86_asm=yes
838         ;;
839    *)
840         use_x86_asm=no
841 esac
842 AC_MSG_RESULT($use_x86_asm)
843
844 use_mmx_asm=no
845 if test $use_x86_asm = yes; then
846     save_ac_ext=$ac_ext
847     ac_ext=S
848     
849     AC_MSG_CHECKING(compiler support for MMX)
850     cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
851     if AC_TRY_EVAL(ac_compile); then
852         use_mmx_asm=yes
853     fi
854
855     rm -rf conftest*
856
857     ac_ext=$save_ac_ext
858     if test $use_mmx_asm = yes; then
859       AC_DEFINE(USE_MMX)
860       AC_MSG_RESULT(yes)
861     else
862       AC_MSG_RESULT(no)
863     fi
864 fi
865
866 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
867
868 dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
869
870 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
871
872 if test $cross_compiling = yes; then
873   AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
874   if test x$GDK_PIXBUF_CSOURCE = xno; then
875     AC_MSG_ERROR(Could not find a gdk-pixbuf-csource in your PATH)
876   fi
877 fi
878
879 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
880 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
881 GDK_PIXBUF_EXTRA_CFLAGS= 
882 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
883 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $PNG_DEP_CFLAGS_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
884
885 AC_SUBST(GDK_PIXBUF_PACKAGES)
886 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
887 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
888 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
889 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
890
891
892 ########################################
893 # Windowing system checks
894 ########################################
895
896 GDK_EXTRA_LIBS=$GDK_WLIBS
897 GDK_EXTRA_CFLAGS= 
898
899 FREETYPE_LIBS=
900 FREETYPE_CFLAGS=
901 if test "x$gdktarget" = "xlinux-fb" || test "x$gdktarget" = "xx11" ; then
902   #
903   # Checks for FreeType
904   #
905   have_freetype=false
906   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
907   if test "x$FREETYPE_CONFIG" != "xno" ; then
908     FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
909     FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
910
911     AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
912                  ,:,$FREETYPE_LIBS)
913
914     if $have_freetype ; then
915       gtk_save_cppflags="$CPPFLAGS"
916       CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
917
918       AC_MSG_CHECKING([For sufficiently new FreeType (at least 2.0.1)])
919       AC_TRY_COMPILE([
920 #include <freetype/freetype.h>
921 #include FT_ERRORS_H
922     ],
923                      [(void)1;],:,have_freetype=false)
924       if $have_freetype ; then
925         AC_MSG_RESULT(yes)
926       else
927         AC_MSG_RESULT(no)
928       fi
929
930       CPPFLAGS="$gtk_save_cppflags"
931     fi
932   fi
933   AC_SUBST(FREETYPE_LIBS)
934   AC_SUBST(FREETYPE_CFLAGS)
935 fi
936
937 if test "x$gdktarget" = "xx11"; then
938   # We start off with the libraries from Pango
939
940   if $PKG_CONFIG --exists pangox ; then : ; else
941     AC_MSG_ERROR([pangox Pango backend is required for x11 target])
942   fi
943     
944   ## be sure we also have Pango built with xft support
945   if $PKG_CONFIG --exists pangoxft ; then
946     PANGO_PACKAGES="pangoxft pangox"
947     have_xft=true
948     AC_DEFINE(HAVE_XFT)
949     if $have_freetype ; then
950       :
951     else
952       AC_MSG_ERROR([pangoxft Pango backend found but did not find freetype libraries])
953     fi
954   else
955     PANGO_PACKAGES="pangox"
956     have_xft=false
957   fi
958
959   AM_CONDITIONAL(HAVE_XFT, $have_xft)
960
961   if $PKG_CONFIG --exists xft ; then
962     AC_DEFINE(HAVE_XFT2, 1, [Define if we have Xft, version 2])
963   fi
964
965   #
966   # If Pango included the shared library dependencies from X11 in
967   # the pkg-config output, then we use that (to avoid duplicates).
968   # but if they were omitted to avoid binary compatibility problems
969   # then we need to repeat the checks.
970   #
971   x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
972   case "$x_libs" in
973     *-lX11*) pango_omitted_x_deps=no ;;
974     *)       pango_omitted_x_deps=yes ;;
975   esac
976
977   x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
978   x_extra_libs=
979
980   if test $pango_omitted_x_deps = yes ; then
981     AC_PATH_XTRA
982
983     if test x$no_x = xyes ; then
984       AC_MSG_ERROR([X development libraries not found])
985     fi
986
987     x_libs="$X_LIBS -lX11 $X_EXTRA_LIBS"
988
989     #
990     # Checks for Xft/XRender
991     #
992     if test $have_xft = true ; then
993       have_xft=false
994
995       if pkg-config --exists pangoxft '>=' 1.1.0 ; then
996         x_libs="`pkg-config --libs xft` -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
997         have_xft=true
998       else
999         gtk_save_cppflags="$CPPFLAGS"
1000         CPPFLAGS="$CPPFLAGS $x_cflags"
1001       
1002         AC_CHECK_LIB(Xrender, XRenderFindFormat, 
1003           [AC_CHECK_LIB(Xft, XftFontOpen,
1004             [AC_CHECK_HEADER(X11/Xft/XftFreetype.h,
1005               have_xft=true,:)],
1006             :,-lXrender -lXext $x_libs $FREETYPE_LIBS)]
1007           ,:,-lXext $x_libs)
1008           
1009         if $have_xft ; then
1010           x_libs="$X_LIBS -lXft -lXrender -lXext -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
1011         fi
1012
1013         CPPFLAGS="$gtk_save_cppflags"
1014       fi
1015
1016       if $have_xft ; then
1017         :
1018       else
1019         AC_MSG_ERROR([pangoxft Pango backend found, but Xft not found])
1020       fi
1021     fi
1022   fi            
1023
1024   ## Strip the .la files
1025  
1026   x_libs_for_checks=""
1027   for I in $x_libs ; do
1028     case $I in 
1029       *.la) ;;
1030       *) x_libs_for_checks="$x_libs_for_checks $I" ;;
1031     esac
1032   done
1033
1034   # Sanity check for the X11 library
1035   AC_CHECK_LIB(X11, XOpenDisplay, :,
1036             AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
1037             $x_libs_for_checks)
1038
1039   if test "x$enable_shm" = "xyes"; then
1040     # Check for the Xext library (needed for XShm extention)
1041     AC_CHECK_LIB(Xext, XShmAttach,
1042         if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
1043           x_extra_libs="-lXext"
1044         fi,
1045         # On AIX, it is in XextSam instead, but we still need -lXext
1046         AC_CHECK_LIB(XextSam, XShmAttach, 
1047             if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
1048                x_extra_libs="-lXextSam -lXext"
1049             else
1050                x_extra_libs="-lXextSam"
1051             fi, , $x_libs_for_checks),
1052         $x_libs_for_checks)
1053   fi
1054
1055   GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
1056   # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
1057   GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs $x_libs"
1058
1059   # Check for Xinerama extension (Solaris impl or Xfree impl)
1060
1061   gtk_save_cppflags="$CPPFLAGS"
1062   CPPFLAGS="$CPPFLAGS $x_cflags"
1063
1064   case "$host" in
1065       *-*-solaris*)
1066           # Check for solaris
1067           use_solaris_xinerama=yes
1068           AC_CHECK_LIB(Xext, XineramaGetInfo,
1069                         use_solaris_xinerama=yes, use_solaris_xinerama=no)
1070           if test "x$use_solaris_xinerama" = "xyes"; then
1071               AC_CHECK_HEADER(X11/extensions/xinerama.h,
1072                 if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
1073                     x_extra_libs="-lXext $x_extra_libs"
1074                 fi
1075                 AC_DEFINE(HAVE_SOLARIS_XINERAMA)
1076                 AC_DEFINE(HAVE_XINERAMA), use_solaris_xinerama=no, -lXext $x_libs_for_checks)
1077           fi    
1078           AC_MSG_CHECKING(for Xinerama support on Solaris)
1079           AC_MSG_RESULT($use_solaris_xinerama);
1080           ;;
1081       *)
1082           # Check for XFree
1083           use_xfree_xinerama=yes
1084           AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
1085               [AC_CHECK_HEADER(X11/extensions/Xinerama.h, 
1086                   x_extra_libs="-lXinerama $x_extra_libs"   
1087                   if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
1088                       x_extra_libs="-lXext $x_extra_libs"
1089                   fi
1090                   AC_DEFINE(HAVE_XFREE_XINERAMA)
1091                   AC_DEFINE(HAVE_XINERAMA), 
1092                   use_xfree_xinerama=no)],
1093               use_xfree_xinerama=no, -lXext $x_libs_for_checks)
1094           AC_MSG_CHECKING(for Xinerama support on XFree86)
1095           AC_MSG_RESULT($use_xfree_xinerama);       
1096           ;;
1097   esac
1098
1099   CPPFLAGS="$gtk_save_cppflags"
1100
1101   # Check for shaped window extension
1102
1103   AC_CHECK_LIB(Xext, XShapeCombineMask,
1104       if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
1105            x_extra_libs="-lXext $x_extra_libs"
1106       fi
1107       AC_DEFINE(HAVE_SHAPE_EXT),
1108       ,
1109       $x_libs_for_checks)
1110
1111   # Check for XConvertCase (X11R6 specific)
1112
1113   AC_CHECK_LIB(X11, XConvertCase,
1114       AC_DEFINE(HAVE_XCONVERTCASE),
1115       ,
1116       $x_libs_for_checks)
1117
1118   # Check for XIM support.
1119
1120   if test "x$enable_xim" = "xyes"; then
1121     GTK_XIM_FLAGS="-DUSE_XIM"
1122   fi
1123
1124   # Check for XKB support.
1125
1126   if test "x$enable_xkb" = "xyes"; then
1127         AC_MSG_WARN(XKB support explicitly enabled)
1128         AC_DEFINE(HAVE_XKB)
1129   elif test "x$enable_xkb" = "xmaybe"; then
1130         AC_CHECK_LIB(X11, XkbQueryExtension,
1131                      AC_DEFINE(HAVE_XKB),
1132                      ,
1133                      $x_libs_for_checks)
1134   else
1135         AC_MSG_WARN(XKB support explicitly disabled)
1136   fi
1137
1138   x_cflags="$X_CFLAGS"
1139   x_ldflags="$X_LDFLAGS"
1140
1141   # set up things for XInput
1142
1143   if test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then
1144     AC_DEFINE(XINPUT_XFREE)
1145     x_extra_libs="-lXi $x_extra_libs"
1146   else
1147     AC_DEFINE(XINPUT_NONE)
1148   fi
1149
1150   AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
1151
1152   if test "x$enable_shm" = "xyes"; then
1153     # Check for shared memory
1154     AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
1155     AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
1156
1157     # Check for the X shared memory extension header file
1158     have_xshm=no 
1159     AC_MSG_CHECKING(X11/extensions/XShm.h)
1160     if test "x$no_xext_lib" = "xyes"; then
1161       :
1162     else
1163       gtk_save_CFLAGS="$CFLAGS"
1164       CFLAGS="$CFLAGS $x_cflags"
1165       AC_TRY_COMPILE([
1166 #include <stdlib.h>
1167 #include <sys/types.h>
1168 #include <sys/ipc.h>
1169 #include <sys/shm.h>
1170 #include <X11/Xlib.h>
1171 #include <X11/Xutil.h>
1172 #include <X11/extensions/XShm.h>
1173 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
1174       CFLAGS="$gtk_save_CFLAGS"
1175     fi
1176     AC_MSG_RESULT($have_xshm)
1177     if test $have_xshm = yes ; then
1178       AC_DEFINE(HAVE_XSHM_H)
1179     fi
1180   fi
1181
1182   GDK_EXTRA_CFLAGS=
1183   if test $pango_omitted_x_deps = yes ; then
1184     GDK_EXTRA_LIBS="$x_extra_libs $x_libs $GDK_EXTRA_LIBS"
1185   else
1186     GDK_EXTRA_LIBS="$x_extra_libs $GDK_EXTRA_LIBS"
1187   fi
1188
1189   AM_CONDITIONAL(USE_X11, true)
1190 else
1191   AM_CONDITIONAL(USE_X11, false)
1192 fi
1193
1194 if test "x$gdktarget" = "xwin32"; then
1195   # We start off with the libraries from Pango
1196
1197   ## be sure we also have Pango built with win32 support
1198   PANGO_PACKAGES="pangowin32"
1199
1200   if test x$have_wintab = xyes; then
1201     GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
1202     AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
1203   fi
1204
1205   GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
1206   AM_CONDITIONAL(USE_WIN32, true)
1207 else
1208   AM_CONDITIONAL(USE_WIN32, false)
1209 fi
1210
1211 AC_SUBST(xinput_progs)
1212
1213 GDK_PIXBUF_XLIB_PACKAGES=
1214 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1215 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
1216
1217 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
1218 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
1219 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
1220 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
1221 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
1222
1223 if test "x$gdktarget" = "xlinux-fb"; then
1224   if $have_freetype ; then
1225     :
1226   else
1227     AC_MSG_ERROR([Using linux-fb backend but freetype was not found])
1228   fi
1229
1230   ft2_libs="`$PKG_CONFIG --libs pangoft2`"
1231   case "$ft2_libs" in
1232     *-lfreetype*) pango_omitted_ft2_deps=no ;;
1233     *)            pango_omitted_ft2_deps=yes ;;
1234   esac
1235
1236   CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
1237
1238   if test x$enable_shadowfb = xyes ; then
1239     AC_DEFINE(ENABLE_SHADOW_FB)
1240   fi
1241
1242   if test x$enable_fbmanager = xyes ; then
1243     AC_DEFINE(ENABLE_FB_MANAGER)
1244     AM_CONDITIONAL(ENABLE_FB_MANAGER, true)
1245   else
1246     AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
1247   fi
1248   
1249   GDK_EXTRA_CFLAGS=""
1250   if test $pango_omitted_ft2_deps = yes ; then
1251     GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
1252   fi
1253
1254   AM_CONDITIONAL(USE_LINUX_FB, true)
1255 else
1256   AM_CONDITIONAL(USE_LINUX_FB, false)
1257   AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
1258 fi
1259
1260 #
1261 # Pick correct Pango packages to use
1262 #
1263
1264 if test "x$gdktarget" = "xx11"; then
1265         if $have_xft = true ; then
1266             PANGO_PACKAGES="pangoxft pangox"
1267         else
1268             PANGO_PACKAGES=pangox
1269         fi
1270 elif test "x$gdktarget" = "xwin32"; then
1271         PANGO_PACKAGES=pangowin32
1272 elif test "x$gdktarget" = "xlinux-fb"; then
1273         PANGO_PACKAGES=pangoft2
1274 else
1275         PANGO_PACKAGES=pango
1276 fi
1277
1278 # Check for Pango flags
1279
1280 AC_MSG_CHECKING(Pango flags)
1281 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
1282         PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
1283         PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1284
1285         AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1286 else
1287         AC_MSG_ERROR([
1288 *** Pango not found. Pango is required to build GTK+.
1289 *** See http://www.pango.org for Pango information.
1290 *** For the framebuffer target, you will need to build 
1291 *** Pango with freetype support.
1292 ])
1293 fi
1294
1295 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1296
1297 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1298         :
1299 else
1300         AC_CHECK_LIB(pango-1.0, pango_context_new, :, AC_MSG_ERROR([
1301 *** Can't link to Pango. Pango is required to build
1302 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
1303 fi
1304
1305 CFLAGS="$saved_cflags"
1306 LDFLAGS="$saved_ldflags"
1307
1308 GDK_PACKAGES=$PANGO_PACKAGES
1309 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1310 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1311
1312 #
1313 # If we aren't writing explicit dependencies, then don't put the extra libraries we need
1314 # into the pkg-config files
1315 #
1316 if test $enable_explicit_deps != yes ; then
1317   GDK_EXTRA_LIBS=
1318 fi
1319
1320 AC_SUBST(GDK_PACKAGES)
1321 AC_SUBST(GDK_EXTRA_LIBS)
1322 AC_SUBST(GDK_EXTRA_CFLAGS)
1323 AC_SUBST(GDK_DEP_LIBS)
1324 AC_SUBST(GDK_DEP_CFLAGS)
1325
1326
1327 ########################################
1328 # Check for Accessibility Toolkit flags
1329 ########################################
1330
1331 ATK_PACKAGES=atk
1332 AC_MSG_CHECKING(ATK flags)
1333 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1334         ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1335         ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1336
1337         AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1338 else
1339         AC_MSG_ERROR([
1340 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1341 *** to build GTK+.
1342 ])
1343 fi
1344
1345 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1346         :
1347 else
1348         AC_CHECK_LIB(atk-1.0, atk_object_get_type, : , AC_MSG_ERROR([
1349                 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1350                 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
1351 fi
1352
1353 GTK_PACKAGES=atk
1354 GTK_EXTRA_LIBS=
1355 GTK_EXTRA_CFLAGS= 
1356 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1357 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1358
1359 AC_SUBST(GTK_PACKAGES)
1360 AC_SUBST(GTK_EXTRA_LIBS)
1361 AC_SUBST(GTK_EXTRA_CFLAGS)
1362 AC_SUBST(GTK_DEP_LIBS)
1363 AC_SUBST(GTK_DEP_CFLAGS)
1364
1365
1366 AC_SUBST(GTK_DEBUG_FLAGS)
1367 AC_SUBST(GTK_XIM_FLAGS)
1368
1369 ##################################################
1370 # Checks for gtk-doc and docbook-tools
1371 ##################################################
1372
1373 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs ])
1374
1375 if test "x$with_html_dir" = "x" ; then
1376   HTML_DIR='${datadir}/gtk-doc/html'
1377 else
1378   HTML_DIR=$with_html_dir
1379 fi
1380
1381 AC_SUBST(HTML_DIR)
1382
1383 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1384
1385 gtk_doc_min_version=0.9
1386 if $GTKDOC ; then 
1387     gtk_doc_version=`gtkdoc-mkdb --version`
1388     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
1389     if perl <<EOF ; then
1390       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
1391             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1392 EOF
1393       AC_MSG_RESULT(yes)
1394    else
1395       AC_MSG_RESULT(no)
1396       GTKDOC=false
1397    fi
1398 fi
1399
1400 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1401 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1402
1403 dnl Make people enable the gtk-doc stuff explicitely.
1404 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1405
1406 if test x$enable_gtk_doc = xyes ; then
1407   if test x$GTKDOC != xtrue ; then
1408     enable_gtk_doc=no 
1409   fi
1410 fi
1411
1412 dnl NOTE: We need to use a separate automake conditional for this
1413 dnl       to make this work with the tarballs.
1414 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1415
1416
1417 ##################################################
1418 # Output commands
1419 ##################################################
1420
1421 AC_OUTPUT_COMMANDS([
1422
1423 ## Generate `gdk/gdkconfig.h' in two cases
1424 ## 1. `config.status' is run either explicitly, or via configure.
1425 ##     Esp. not when it is run in `Makefile' to generate makefiles and
1426 ##     config.h
1427 ## 2. CONFIG_OTHER is set explicitly
1428 ##
1429 ## Case 1 is difficult.  We know that `automake' sets one of
1430 ## CONFIG_FILES or CONFIG_HEADERS to empty.  This heuristic works
1431 ## only when AM_CONFIG_HEADER is set, however.
1432
1433 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1434   # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1435   CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1436 fi
1437 case "$CONFIG_OTHER" in
1438 *gdk/gdkconfig.h*)
1439         echo creating gdk/gdkconfig.h
1440         outfile=gdkconfig.h-tmp
1441         cat > $outfile <<\_______EOF
1442 /* gdkconfig.h
1443  *
1444  * This is a generated file.  Please modify `configure.in'
1445  */
1446
1447 #ifndef GDKCONFIG_H
1448 #define GDKCONFIG_H
1449
1450 #ifdef __cplusplus
1451 extern "C" {
1452 #endif /* __cplusplus */
1453
1454 _______EOF
1455
1456         cat >>$outfile <<_______EOF
1457 $gdk_windowing
1458 $gdk_wc
1459 _______EOF
1460
1461         cat >>$outfile <<_______EOF
1462
1463 #ifdef __cplusplus
1464 }
1465 #endif /* __cplusplus */
1466
1467 #endif /* GDKCONFIG_H */
1468 _______EOF
1469
1470
1471         if cmp -s $outfile gdk/gdkconfig.h; then
1472           echo gdk/gdkconfig.h is unchanged
1473           rm -f $outfile
1474         else
1475           mv $outfile gdk/gdkconfig.h
1476         fi ;;
1477 esac
1478 ],[
1479 if test "x$gdktarget" = "xx11" ; then
1480   gdk_windowing='
1481 #define GDK_WINDOWING_X11'
1482 elif test "x$gdktarget" = "xwin32" ; then
1483   gdk_windowing='
1484 #define GDK_WINDOWING_WIN32'
1485 elif test "x$gdktarget" = "xlinux-fb" ; then
1486   gdk_windowing='
1487 #define GDK_WINDOWING_FB
1488 #define GDK_NATIVE_WINDOW_POINTER'
1489 fi
1490
1491 if test x$gdk_wchar_h = xyes; then
1492   gdk_wc='
1493 #define GDK_HAVE_WCHAR_H 1'
1494 fi
1495 if test x$gdk_wctype_h = xyes; then
1496   gdk_wc="\$gdk_wc
1497 #define GDK_HAVE_WCTYPE_H 1"
1498 fi
1499 if test x$gdk_working_wctype = xno; then
1500   gdk_wc="\$gdk_wc
1501 #define GDK_HAVE_BROKEN_WCTYPE 1"
1502 fi
1503
1504
1505 ])
1506
1507 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1508 AM_CONDITIONAL(HAVE_SGML2HTML, test x$SGML2HTML != xno)
1509
1510 AC_OUTPUT([
1511 config.h.win32
1512 gtk-zip.sh
1513 gtk+.spec
1514 Makefile
1515 gdk-pixbuf-2.0.pc
1516 gdk-2.0.pc
1517 gtk+-2.0.pc
1518 gdk-pixbuf-2.0-uninstalled.pc
1519 gdk-2.0-uninstalled.pc
1520 gtk+-2.0-uninstalled.pc
1521 m4macros/Makefile
1522 po/Makefile.in
1523 build/Makefile
1524 build/win32/Makefile
1525 build/win32/dirent/Makefile
1526 demos/Makefile
1527 demos/gtk-demo/Makefile
1528 demos/gtk-demo/geninclude.pl
1529 tests/Makefile
1530 docs/Makefile
1531 docs/reference/Makefile
1532 docs/reference/gdk-pixbuf/Makefile
1533 docs/reference/gdk/Makefile
1534 docs/reference/gtk/Makefile
1535 docs/faq/Makefile
1536 docs/tutorial/Makefile
1537 gdk-pixbuf/Makefile
1538 gdk-pixbuf/makefile.mingw
1539 gdk-pixbuf/gdk_pixbuf.rc
1540 gdk-pixbuf/gdk-pixbuf-features.h
1541 gdk-pixbuf/pixops/Makefile
1542 gdk-pixbuf/pixops/makefile.mingw
1543 gdk/Makefile
1544 gdk/makefile.mingw
1545 gdk/x11/Makefile
1546 gdk/win32/Makefile
1547 gdk/win32/makefile.mingw
1548 gdk/win32/rc/Makefile
1549 gdk/win32/rc/gdk.rc
1550 gdk/linux-fb/Makefile
1551 gtk/Makefile
1552 gtk/makefile.mingw
1553 gtk/makefile.msc
1554 gtk/gtkversion.h
1555 gtk/gtk-win32.rc
1556 gtk/stock-icons/Makefile
1557 gtk/theme-bits/Makefile
1558 modules/Makefile
1559 modules/input/Makefile
1560 contrib/Makefile
1561 contrib/gdk-pixbuf-xlib/Makefile
1562 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc
1563 ])