1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(gdk/gdktypes.h)
5 # For each of the libraries we build, we define the following
6 # substituted variables:
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
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.
20 # Save this value here, since automake will set cflags later
21 cflags_set=${CFLAGS+set}
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 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
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.
40 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
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)
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`
62 # gdk-pixbuf gets versioned separately, and for now, using standard
63 # libtool versioning, not GTK+-style versioning
65 GDK_PIXBUF_MAJOR=$GTK_MAJOR_VERSION
66 GDK_PIXBUF_MINOR=$GTK_MINOR_VERSION
67 GDK_PIXBUF_MICRO=$GTK_MICRO_VERSION
68 GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
69 AC_SUBST(GDK_PIXBUF_MAJOR)
70 AC_SUBST(GDK_PIXBUF_MINOR)
71 AC_SUBST(GDK_PIXBUF_MICRO)
72 AC_SUBST(GDK_PIXBUF_VERSION)
79 AC_SUBST(GETTEXT_PACKAGE)
80 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
82 # Save this value here, since automake will set cflags later
83 cflags_set=${CFLAGS+set}
85 dnl Initialize automake stuff
86 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
88 # Specify a configuration file
89 AM_CONFIG_HEADER(config.h)
91 dnl Initialize libtool
94 dnl Initialize maintainer mode
99 dnl figure debugging default, prior to $ac_help setup
101 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
102 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
105 debug_default=minimum
109 dnl declare --enable-* args and collect ac_help strings
110 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
111 AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
112 echo $enable_shm, enable_shm="yes")
113 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
115 AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
117 AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
118 , enable_xim_inst="maybe")
119 AC_ARG_ENABLE(xkb, [ --enable-xkb support XKB [default=maybe]],
120 , enable_xkb="maybe")
121 AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
123 AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
126 gdktargetlib=libgdk-x11-1.3.la
127 gtktargetlib=libgtk-x11-1.3.la
128 AC_ARG_WITH(gdktarget, [ --with-gdktarget=[x11/nanox/linux-fb] select GDK target [default=x11] ],
129 gdktarget=$with_gdktarget)
133 x11|nanox|linux-fb) ;;
134 *) AC_MSG_ERROR([Invalid target for GDK: use x11, nanox or linux-fb.]);;
137 AC_ARG_ENABLE(shadowfb, [ --disable-shadowfb disable shadowfb support for linux-fb],,enable_shadowfb=yes)
139 if test "x$enable_debug" = "xyes"; then
140 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
141 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
143 if test "x$enable_debug" = "xno"; then
144 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
146 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
150 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
153 # Build time sanity check...
156 # Checks for programs.
164 if test "x$GCC" = "xyes"; then
166 *[\ \ ]-Wall[\ \ ]*) ;;
167 *) CFLAGS="$CFLAGS -Wall" ;;
170 if test "x$enable_ansi" = "xyes"; then
172 *[\ \ ]-ansi[\ \ ]*) ;;
173 *) CFLAGS="$CFLAGS -ansi" ;;
177 *[\ \ ]-pedantic[\ \ ]*) ;;
178 *) CFLAGS="$CFLAGS -pedantic" ;;
184 # Honor aclocal flags
185 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
187 # libtool option to control which symbols are exported
188 # right now, symbols starting with _ are not exported
189 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
190 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
192 # define a MAINT-like variable REBUILD which is set if Perl
193 # and awk are found, so autogenerated sources can be rebuilt
196 AC_CHECK_PROGS(PERL, perl5 perl)
198 # We would like indent, but don't require it.
199 AC_CHECK_PROG(INDENT, indent, indent)
202 if test "x$enable_rebuilds" = "xyes" && \
204 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
205 test -n "$AWK" ; then
210 AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
212 AC_MSG_CHECKING(whether make is GNU Make)
215 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
216 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
223 AC_SUBST(STRIP_DUMMY)
224 AC_SUBST(STRIP_BEGIN)
228 ALL_LINGUAS="az ca cs da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
230 LIBS="$LIBS $INTLLIBS"
232 # AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
233 # this is the directory where the *.{mo,gmo} files are installed
234 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
235 AC_SUBST(gtklocaledir)
237 dnl The DU4 header files don't provide library prototypes unless
238 dnl -std1 is given to the native cc.
239 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
243 AC_TRY_RUN([#include <math.h>
244 int main (void) { return (log(1) != log(1.)); }],
245 AC_MSG_RESULT(none needed),
246 gtk_save_CFLAGS="$CFLAGS"
247 CFLAGS="$CFLAGS -std1"
248 AC_TRY_RUN([#include <math.h>
249 int main (void) { return (log(1) != log(1.)); }],
250 AC_MSG_RESULT(-std1),
252 CFLAGS="$gtk_save_CFLAGS"
254 [No ANSI prototypes found in library. (-std1 didn't work.)]),
257 AC_MSG_RESULT(none needed)
262 AC_MSG_CHECKING(for the BeOS)
273 dnl NeXTStep cc seems to need this
274 AC_MSG_CHECKING([for extra flags for POSIX compliance])
275 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
276 AC_MSG_RESULT(none needed),
277 gtk_save_CFLAGS="$CFLAGS"
278 CFLAGS="$CFLAGS -posix"
279 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
280 AC_MSG_RESULT(-posix),
282 CFLAGS="$gtk_save_CFLAGS"
283 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
286 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
289 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
290 GLIB_REQUIRED_VERSION=1.3.4
292 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
294 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
295 *** GLIB is always available from ftp://ftp.gtk.org/.]),
296 gobject gmodule gthread)
298 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
299 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
300 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
301 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
303 saved_cflags="$CFLAGS"
304 saved_ldflags="$LDFLAGS"
307 # Checks for header files.
310 # Checks for typedefs, structures, and compiler characteristics.
313 # Checks for library functions.
317 AC_CHECK_FUNCS(getresuid)
320 # Check if <sys/select.h> needs to be included for fd_set
321 AC_MSG_CHECKING([for fd_set])
322 AC_TRY_COMPILE([#include <sys/types.h>],
323 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
324 if test $gtk_ok = yes; then
325 AC_MSG_RESULT([yes, found in sys/types.h])
327 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
328 if test $gtk_ok = yes; then
329 AC_DEFINE(HAVE_SYS_SELECT_H)
330 AC_MSG_RESULT([yes, found in sys/select.h])
337 # `widechar' tests for gdki18n.h
338 AC_MSG_CHECKING(for wchar.h)
339 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
340 if test $gdk_wchar_h = yes; then
341 AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
343 AC_MSG_RESULT($gdk_wchar_h)
345 # Check for wctype.h (for iswalnum)
346 AC_MSG_CHECKING(for wctype.h)
347 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
348 if test $gdk_wctype_h = yes; then
349 AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
351 AC_MSG_RESULT($gdk_wctype_h)
353 # in Solaris 2.5, `iswalnum' is in -lw
355 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
358 LIBS="$LIBS $GDK_WLIBS"
359 # The following is necessary for Linux libc-5.4.38
360 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
361 AC_TRY_LINK([#include <stdlib.h>],[
362 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
363 # ifdef HAVE_WCTYPE_H
371 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
373 iswalnum((wchar_t) 0);
374 ], gdk_working_wctype=yes, gdk_working_wctype=no)
377 if test $gdk_working_wctype = no; then
378 AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
381 AC_MSG_RESULT($gdk_working_wctype)
386 ##################################################
387 # Checks for gdk-pixbuf
388 ##################################################
390 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
392 AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[
393 if test x$withval = xyes; then
402 if test x$with_modules = xno; then
406 AC_MSG_CHECKING(whether dynamic modules work)
407 ## for loop is to strip newline
408 tmp=`pkg-config --variable=gmodule_supported gmodule-2.0`
414 dnl Now we check to see if our libtool supports shared lib deps
415 dnl (in a rather ugly way even)
417 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
418 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
419 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
420 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
421 if test "x$pixbuf_deplibs_check" = "xnone" || \
422 test "x$pixbuf_deplibs_check" = "xunknown" || \
423 test "x$pixbuf_deplibs_check" = "x"; then
429 AC_DEFINE(USE_GMODULE)
436 if test -z "$LIBTIFF"; then
437 AC_CHECK_LIB(tiff, TIFFReadScanline,
438 AC_CHECK_HEADER(tiffio.h,
439 TIFF='tiff'; LIBTIFF='-ltiff',
440 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
441 AC_CHECK_LIB(tiff, TIFFWriteScanline,
442 AC_CHECK_HEADER(tiffio.h,
443 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
444 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
445 AC_CHECK_LIB(tiff34, TIFFFlushData,
446 AC_CHECK_HEADER(tiffio.h,
447 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
448 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
449 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
453 if test -z "$LIBJPEG"; then
454 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
457 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
458 if test "$jpeg_ok" = yes; then
459 AC_MSG_CHECKING([for jpeglib.h])
464 #include <jpeglib.h>],
467 AC_MSG_RESULT($jpeg_ok)
468 if test "$jpeg_ok" = yes; then
470 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
471 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
472 AC_MSG_WARN(JPEG library does not support progressive saving.))
474 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
480 if test -z "$LIBPNG"; then
481 AC_CHECK_LIB(png, png_read_info,
482 AC_CHECK_HEADER(png.h,
485 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
486 if test "$png_ok" = yes; then
487 AC_MSG_CHECKING([for png_structp in png.h])
488 AC_TRY_COMPILE([#include <png.h>],
489 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
492 AC_MSG_RESULT($png_ok)
493 if test "$png_ok" = yes; then
494 PNG='png'; LIBPNG='-lpng -lz'
496 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
499 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
507 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
510 # Allow building some or all gdk-pixbuf loaders included
512 AC_MSG_CHECKING(pixbuf loaders to build)
514 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
519 ## if the option was specified, leave it; otherwise disable included loaders
520 if test x$with_included_loaders = xno; then
521 with_included_loaders=yes
525 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm"
527 # If no loaders specified, include all
528 if test "x$with_included_loaders" = xyes ; then
529 included_loaders="$all_loaders"
531 included_loaders="$with_included_loaders"
534 AC_MSG_RESULT($included_loaders)
537 INCLUDED_LOADER_DEFINE=
539 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
540 for loader in $included_loaders; do
541 if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
544 AC_MSG_ERROR([the specified loader $loader does not exist])
547 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
548 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
551 AC_SUBST(INCLUDED_LOADER_OBJ)
552 AC_SUBST(INCLUDED_LOADER_DEFINE)
559 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
560 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
561 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
565 if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
566 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
568 if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
569 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
571 if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
572 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
575 STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
578 # Checks to see if we should compile in MMX support (there will be
579 # a runtime test when the code is actually run to see if it should
580 # be used - this just checks if we can compile it.)
582 # This code is partially taken from Mesa
584 AC_MSG_CHECKING(for x86 platform)
586 i386|i486|i586|i686|i786|k6|k7)
592 AC_MSG_RESULT($use_x86_asm)
595 if test $use_x86_asm = yes; then
599 AC_MSG_CHECKING(compiler support for MMX)
600 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
601 if AC_TRY_EVAL(ac_compile); then
608 if test $use_mmx_asm = yes; then
616 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
619 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
620 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
621 GDK_PIXBUF_EXTRA_CFLAGS=
622 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
623 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
625 AC_SUBST(GDK_PIXBUF_PACKAGES)
626 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
627 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
628 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
629 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
632 ########################################
633 # Windowing system checks
634 ########################################
636 GDK_EXTRA_LIBS=$GDK_WLIBS
639 if test "x$gdktarget" = "xx11"; then
640 # We start off with the libraries from Pango
642 ## be sure we also have Pango built with xft support
643 if $PKG_CONFIG --exists pangoxft ; then
644 PANGO_PACKAGES="pangox pangoxft"
648 PANGO_PACKAGES="pangox"
652 AM_CONDITIONAL(HAVE_XFT, $have_xft)
654 x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
655 x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
658 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
661 # Sanity check for the X11 library
662 AC_CHECK_LIB(X11, XOpenDisplay, :,
663 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
667 if test "x$enable_shm" = "xyes"; then
668 # Check for the Xext library (needed for XShm extention)
669 AC_CHECK_LIB(Xext, XShmAttach,
670 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
671 x_extra_libs="-lXext"
673 # On AIX, it is in XextSam instead, but we still need -lXext
674 AC_CHECK_LIB(XextSam, XShmAttach,
675 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
676 x_extra_libs="-lXextSam -lXext"
678 x_extra_libs="-lXextSam"
680 no_xext_lib=yes, $x_libs),
684 GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
685 # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
686 GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
688 # Check for shaped window extension
690 AC_CHECK_LIB(Xext, XShapeCombineMask,
691 if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
692 x_extra_libs="-lXext $x_extra_libs"
694 AC_DEFINE(HAVE_SHAPE_EXT),
698 # Check for XConvertCase (X11R6 specific)
700 AC_CHECK_LIB(X11, XConvertCase,
701 AC_DEFINE(HAVE_XCONVERTCASE),
705 # Check for XIM support.
707 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
709 enable_xim_inst="no",
712 # On Solaris, calling XRegisterIMInstantiateCallback seems to
713 # cause an immediate segfault, so we disable it, unless
714 # the user specifically forces it to be on.
716 if test x$enable_xim_inst = xmaybe ; then
722 enable_xim_inst="yes"
727 if test "x$enable_xim" = "xyes"; then
728 GTK_XIM_FLAGS="-DUSE_XIM"
729 if test "x$enable_xim_inst" = "xyes"; then
730 AC_DEFINE(USE_X11R6_XIM)
734 # Check for XKB support.
736 if test "x$enable_xkb" = "xyes"; then
737 AC_MSG_WARN(XKB support explicitly enabled)
739 elif test "x$enable_xkb" = "xmaybe"; then
740 AC_CHECK_LIB(X11, XkbQueryExtension,
745 AC_MSG_WARN(XKB support explicitly disabled)
749 x_ldflags="$X_LDFLAGS"
751 # set up things for XInput
753 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
754 AC_DEFINE(XINPUT_GXI)
756 x_extra_libs="-lXi $x_extra_libs"
757 elif test "x$with_xinput" = "xxfree"; then
758 AC_DEFINE(XINPUT_XFREE)
759 x_extra_libs="-lXi $x_extra_libs"
761 AC_DEFINE(XINPUT_NONE)
764 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
765 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
767 if test "x$enable_shm" = "xyes"; then
768 # Check for shared memory
769 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
770 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
772 # Check for the X shared memory extension header file
773 AC_MSG_CHECKING(X11/extensions/XShm.h)
774 if test "x$no_xext_lib" = "xyes"; then
778 if test -f "$x_includes/X11/extensions/XShm.h"; then
780 AC_DEFINE(HAVE_XSHM_H)
789 GDK_EXTRA_LIBS="$x_extra_libs"
791 # these are already defined above
792 #gdktargetlib = "libgdk-x11-1.3.la"
793 #gtktargetlib = "libgtk-x11-1.3.la"
795 AM_CONDITIONAL(USE_X11, true)
797 AM_CONDITIONAL(USE_X11, false)
800 AC_SUBST(xinput_progs)
802 GDK_PIXBUF_XLIB_PACKAGES=
803 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
804 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
806 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
807 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
808 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
809 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
810 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
812 if test "x$gdktarget" = "xnanox"; then
813 AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
814 # nano-X may require additional libraries
815 GDK_EXTRA_LIBS="-lnano-X $GDK_EXTRA_LIBS"
817 gdktargetlib="libgdk-nanox-1.3.la"
818 gtktargetlib="libgtk-nanox-1.3.la"
820 AM_CONDITIONAL(USE_NANOX, true)
822 AM_CONDITIONAL(USE_NANOX, false)
825 if test "x$gdktarget" = "xlinux-fb"; then
826 gdktargetlib="libgdk-linux-fb-1.3.la"
827 gtktargetlib="libgtk-linux-fb-1.3.la"
829 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
830 if test x$FREETYPE_CONFIG = xno ; then
831 AC_MSG_ERROR([*** freetype-config not found])
834 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
835 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
836 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
838 if test x$enable_shadowfb = xyes ; then
839 AC_DEFINE(ENABLE_SHADOW_FB)
842 GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
843 GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
845 AM_CONDITIONAL(USE_LINUX_FB, true)
847 AM_CONDITIONAL(USE_LINUX_FB, false)
850 AC_SUBST(gdktargetlib)
851 AC_SUBST(gtktargetlib)
854 # Pick correct Pango packages to use
857 if test "x$gdktarget" = "xx11"; then
858 if $have_xft = true ; then
859 PANGO_PACKAGES="pangox pangoxft"
861 PANGO_PACKAGES=pangox
863 elif test "x$gdktarget" = "xlinux-fb"; then
864 PANGO_PACKAGES=pangoft2
869 # Check for Pango flags
871 AC_MSG_CHECKING(Pango flags)
872 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
873 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
874 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
876 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
879 *** Pango not found. Pango is required to build GTK+.
880 *** See http://www.pango.org for Pango information.
881 *** For the framebuffer target, you will need to build
882 *** Pango with freetype support.
886 CFLAGS="$CFLAGS $PANGO_CFLAGS"
888 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
891 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
892 *** Can't link to Pango. Pango is required to build
893 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
896 CFLAGS="$saved_cflags"
897 LDFLAGS="$saved_ldflags"
899 GDK_PACKAGES=$PANGO_PACKAGES
900 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
901 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
903 AC_SUBST(GDK_PACKAGES)
904 AC_SUBST(GDK_EXTRA_LIBS)
905 AC_SUBST(GDK_EXTRA_CFLAGS)
906 AC_SUBST(GDK_DEP_LIBS)
907 AC_SUBST(GDK_DEP_CFLAGS)
910 ########################################
911 # Check for Accessibility Toolkit flags
912 ########################################
915 AC_MSG_CHECKING(ATK flags)
916 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
917 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
918 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
920 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
923 *** Accessibility Toolkit not found. Accessibility Toolkit is required
928 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
931 AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
932 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
933 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
939 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
940 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
942 AC_SUBST(GTK_PACKAGES)
943 AC_SUBST(GTK_EXTRA_LIBS)
944 AC_SUBST(GTK_EXTRA_CFLAGS)
945 AC_SUBST(GTK_DEP_LIBS)
946 AC_SUBST(GTK_DEP_CFLAGS)
949 AC_SUBST(GTK_DEBUG_FLAGS)
950 AC_SUBST(GTK_XIM_FLAGS)
952 ##################################################
953 # Checks for gtk-doc and docbook-tools
954 ##################################################
956 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
958 if test "x$with_html_dir" = "x" ; then
959 HTML_DIR='${datadir}/gtk-doc/html'
961 HTML_DIR=$with_html_dir
966 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
968 gtk_doc_min_version=0.6
970 gtk_doc_version=`gtkdoc-mkdb --version`
971 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
973 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
974 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
983 AC_CHECK_PROG(DB2HTML, db2html, true, false)
984 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
986 dnl Let people disable the gtk-doc stuff.
987 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
989 if test x$enable_gtk_doc = xauto ; then
990 if test x$GTKDOC = xtrue ; then
997 dnl NOTE: We need to use a separate automake conditional for this
998 dnl to make this work with the tarballs.
999 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1002 ##################################################
1004 ##################################################
1006 AC_OUTPUT_COMMANDS([
1008 ## Generate `gdk/gdkconfig.h' in two cases
1009 ## 1. `config.status' is run either explicitly, or via configure.
1010 ## Esp. not when it is run in `Makefile' to generate makefiles and
1012 ## 2. CONFIG_OTHER is set explicitly
1014 ## Case 1 is difficult. We know that `automake' sets one of
1015 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1016 ## only when AM_CONFIG_HEADER is set, however.
1018 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1019 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1020 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1022 case "$CONFIG_OTHER" in
1024 echo creating gdk/gdkconfig.h
1025 outfile=gdkconfig.h-tmp
1026 cat > $outfile <<\_______EOF
1029 * This is a generated file. Please modify `configure.in'
1037 #endif /* __cplusplus */
1041 cat >>$outfile <<_______EOF
1046 cat >>$outfile <<_______EOF
1050 #endif /* __cplusplus */
1052 #endif /* GDKCONFIG_H */
1056 if cmp -s $outfile gdk/gdkconfig.h; then
1057 echo gdk/gdkconfig.h is unchanged
1060 mv $outfile gdk/gdkconfig.h
1064 if test "x$gdktarget" = "xx11" ; then
1066 #define GDK_WINDOWING_X11'
1067 elif test "x$gdktarget" = "xnanox" ; then
1069 #define GDK_WINDOWING_NANOX'
1070 elif test "x$gdktarget" = "xlinux-fb" ; then
1072 #define GDK_WINDOWING_FB
1073 #define GDK_NATIVE_WINDOW_POINTER'
1076 if test x$gdk_wchar_h = xyes; then
1078 #define GDK_HAVE_WCHAR_H 1'
1080 if test x$gdk_wctype_h = xyes; then
1082 #define GDK_HAVE_WCTYPE_H 1"
1084 if test x$gdk_working_wctype = xno; then
1086 #define GDK_HAVE_BROKEN_WCTYPE 1"
1092 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1093 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1103 gdk-pixbuf-2.0-uninstalled.pc
1104 gdk-2.0-uninstalled.pc
1105 gtk+-2.0-uninstalled.pc
1109 build/win32/Makefile
1111 demos/gtk-demo/Makefile
1114 docs/reference/Makefile
1115 docs/reference/gdk-pixbuf/Makefile
1116 docs/reference/gdk/Makefile
1117 docs/reference/gtk/Makefile
1119 docs/tutorial/Makefile
1121 gdk-pixbuf/makefile.mingw
1122 gdk-pixbuf/gdk-pixbuf-features.h
1123 gdk-pixbuf/pixops/Makefile
1124 gdk-pixbuf/pixops/makefile.mingw
1129 gdk/win32/makefile.mingw
1130 gdk/win32/rc/Makefile
1133 gdk/linux-fb/Makefile
1139 gtk/stock-icons/Makefile
1141 modules/input/Makefile
1143 contrib/gdk-pixbuf-xlib/Makefile
1144 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc