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
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)
409 CFLAGS="$GLIB_CFLAGS"
416 if (g_module_supported ())
426 dnl Now we check to see if our libtool supports shared lib deps
427 dnl (in a rather ugly way even)
429 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
430 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
431 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
432 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
433 if test "x$pixbuf_deplibs_check" = "xnone" || \
434 test "x$pixbuf_deplibs_check" = "xunknown" || \
435 test "x$pixbuf_deplibs_check" = "x"; then
441 AC_DEFINE(USE_GMODULE)
448 if test -z "$LIBTIFF"; then
449 AC_CHECK_LIB(tiff, TIFFReadScanline,
450 AC_CHECK_HEADER(tiffio.h,
451 TIFF='tiff'; LIBTIFF='-ltiff',
452 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
453 AC_CHECK_LIB(tiff, TIFFWriteScanline,
454 AC_CHECK_HEADER(tiffio.h,
455 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
456 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
457 AC_CHECK_LIB(tiff34, TIFFFlushData,
458 AC_CHECK_HEADER(tiffio.h,
459 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
460 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
461 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
465 if test -z "$LIBJPEG"; then
466 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
469 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
470 if test "$jpeg_ok" = yes; then
471 AC_MSG_CHECKING([for jpeglib.h])
476 #include <jpeglib.h>],
479 AC_MSG_RESULT($jpeg_ok)
480 if test "$jpeg_ok" = yes; then
482 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
483 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
484 AC_MSG_WARN(JPEG library does not support progressive saving.))
486 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
492 if test -z "$LIBPNG"; then
493 AC_CHECK_LIB(png, png_read_info,
494 AC_CHECK_HEADER(png.h,
497 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
498 if test "$png_ok" = yes; then
499 AC_MSG_CHECKING([for png_structp in png.h])
500 AC_TRY_COMPILE([#include <png.h>],
501 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
504 AC_MSG_RESULT($png_ok)
505 if test "$png_ok" = yes; then
506 PNG='png'; LIBPNG='-lpng -lz'
508 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
511 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
519 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
522 # Allow building some or all gdk-pixbuf loaders included
524 AC_MSG_CHECKING(pixbuf loaders to build)
526 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
528 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm"
530 # If no loaders specified, include all
531 if test "x$with_included_loaders" = xyes ; then
532 included_loaders="$all_loaders"
534 included_loaders="$with_included_loaders"
537 AC_MSG_RESULT($included_loaders)
540 INCLUDED_LOADER_DEFINE=
542 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
543 for loader in $included_loaders; do
544 if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
547 AC_MSG_ERROR([the specified loader $loader does not exist])
550 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
551 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
554 AC_SUBST(INCLUDED_LOADER_OBJ)
555 AC_SUBST(INCLUDED_LOADER_DEFINE)
562 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
563 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
564 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
567 STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
570 if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
571 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
573 if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
574 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
576 if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
577 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
581 # Checks to see if we should compile in MMX support (there will be
582 # a runtime test when the code is actually run to see if it should
583 # be used - this just checks if we can compile it.)
585 # This code is partially taken from Mesa
587 AC_MSG_CHECKING(for x86 platform)
589 i386|i486|i586|i686|i786|k6|k7)
595 AC_MSG_RESULT($use_x86_asm)
598 if test $use_x86_asm = yes; then
602 AC_MSG_CHECKING(compiler support for MMX)
603 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
604 if AC_TRY_EVAL(ac_compile); then
611 if test $use_mmx_asm = yes; then
619 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
622 GDK_PIXBUF_PACKAGES=gmodule-2.0
623 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
624 GDK_PIXBUF_EXTRA_CFLAGS=
625 GDK_PIXBUF_DEP_LIBS="`pkg-config --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
626 GDK_PIXBUF_DEP_CFLAGS="`pkg-config --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
628 AC_SUBST(GDK_PIXBUF_PACKAGES)
629 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
630 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
631 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
632 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
635 ########################################
636 # Windowing system checks
637 ########################################
639 GDK_EXTRA_LIBS=$GDK_WLIBS
642 if test "x$gdktarget" = "xx11"; then
643 # Find the X11 include and library directories
647 if test "x$x_includes" = "x"; then
648 x_includes="/usr/include"
651 CFLAGS="$CFLAGS $X_CFLAGS"
652 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
654 if test "x$no_x" = "xyes"; then
656 *** X libraries or include files not found. Check 'config.log' for
660 # Checks for libraries.
661 # Check for the X11 library
662 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS",
663 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
666 if test "x$enable_shm" = "xyes"; then
667 # Check for the Xext library (needed for XShm extention)
668 AC_CHECK_LIB(Xext, XShmAttach,
669 x_libs="-lXext $x_libs",
670 # On AIX, it is in XextSam instead, but we still need -lXext
671 AC_CHECK_LIB(XextSam, XShmAttach,
672 x_libs="-lXextSam -lXext $x_libs",
673 no_xext_lib=yes, $x_libs),
677 GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
678 GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_ldflags $x_libs"
680 # Check for shaped window extension
682 AC_CHECK_LIB(Xext, XShapeCombineMask,
683 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
684 x_libs="-lXext $x_libs"
686 AC_DEFINE(HAVE_SHAPE_EXT),
690 # Check for XConvertCase (X11R6 specific)
692 AC_CHECK_LIB(X11, XConvertCase,
693 AC_DEFINE(HAVE_XCONVERTCASE),
698 # Checks for FreeType
703 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
704 if test "x$FREETYPE_CONFIG" != "xno" ; then
705 FREETYPE_CFLAGS=`freetype-config --cflags`
706 FREETYPE_LIBS=`freetype-config --libs`
708 AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
713 # Checks for Xft/XRender
716 if test $have_freetype = true ; then
717 AC_CHECK_LIB(Xrender, XRenderFindFormat,
718 AC_CHECK_LIB(Xft, XftFontOpen, have_xft=true, :, -lXrender -lXext $X_LIBS $FREETYPE_LIBS)
721 ## be sure we also have Pango built with xft support
722 if ! $PKG_CONFIG --exists pangoxft ; then
724 AC_MSG_WARN([X render extension found, but Pango lacks Xft support])
727 if $have_xft = 'true' ; then
728 X_LIBS="-lXft -lXrender -lXext $FREETYPE_LIBS $X_LIBS"
733 AM_CONDITIONAL(HAVE_XFT, $have_xft)
735 # Check for XIM support.
737 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
739 enable_xim_inst="no",
742 # On Solaris, calling XRegisterIMInstantiateCallback seems to
743 # cause an immediate segfault, so we disable it, unless
744 # the user specifically forces it to be on.
746 if test x$enable_xim_inst = xmaybe ; then
752 enable_xim_inst="yes"
757 if test "x$enable_xim" = "xyes"; then
758 GTK_XIM_FLAGS="-DUSE_XIM"
759 if test "x$enable_xim_inst" = "xyes"; then
760 AC_DEFINE(USE_X11R6_XIM)
764 # Check for XKB support.
766 if test "x$enable_xkb" = "xyes"; then
767 AC_MSG_WARN(XKB support explicitly enabled)
769 elif test "x$enable_xkb" = "xmaybe"; then
770 AC_CHECK_LIB(X11, XkbQueryExtension,
775 AC_MSG_WARN(XKB support explicitly disabled)
779 x_ldflags="$X_LDFLAGS"
781 # set up things for XInput
783 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
784 AC_DEFINE(XINPUT_GXI)
786 x_libs="-lXi $x_libs"
787 elif test "x$with_xinput" = "xxfree"; then
788 AC_DEFINE(XINPUT_XFREE)
789 x_libs="-lXi $x_libs"
791 AC_DEFINE(XINPUT_NONE)
794 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
795 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
797 if test "x$enable_shm" = "xyes"; then
798 # Check for shared memory
799 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
800 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
802 # Check for the X shared memory extension header file
803 AC_MSG_CHECKING(X11/extensions/XShm.h)
804 if test "x$no_xext_lib" = "xyes"; then
808 if test -f "$x_includes/X11/extensions/XShm.h"; then
810 AC_DEFINE(HAVE_XSHM_H)
818 GDK_EXTRA_CFLAGS="$GDK_EXTRA_CFLAGS $x_cflags"
819 GDK_EXTRA_LIBS="$x_ldflags $x_libs $GDK_EXTRA_LIBS"
821 # these are already defined above
822 #gdktargetlib = "libgdk-x11-1.3.la"
823 #gtktargetlib = "libgtk-x11-1.3.la"
825 AM_CONDITIONAL(USE_X11, true)
827 AM_CONDITIONAL(USE_X11, false)
830 AC_SUBST(xinput_progs)
832 GDK_PIXBUF_XLIB_PACKAGES=
833 GDK_PIXBUF_XLIB_DEP_LIBS="`pkg-config --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
834 GDK_PIXBUF_XLIB_DEP_CFLAGS="`pkg-config --cflags $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
836 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
837 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
838 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
839 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
840 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
842 if test "x$gdktarget" = "xnanox"; then
843 AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
844 # nano-X may require additional libraries
845 GDK_EXTRA_LIBS="-lnano-X $GDK_EXTRA_LIBS"
847 gdktargetlib="libgdk-nanox-1.3.la"
848 gtktargetlib="libgtk-nanox-1.3.la"
850 AM_CONDITIONAL(USE_NANOX, true)
852 AM_CONDITIONAL(USE_NANOX, false)
855 if test "x$gdktarget" = "xlinux-fb"; then
856 gdktargetlib="libgdk-linux-fb-1.3.la"
857 gtktargetlib="libgtk-linux-fb-1.3.la"
859 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
860 if test x$FREETYPE_CONFIG = xno ; then
861 AC_MSG_ERROR([*** freetype-config not found])
864 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
865 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
866 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
868 if test x$enable_shadowfb = xyes ; then
869 AC_DEFINE(ENABLE_SHADOW_FB)
872 GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
873 GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
875 AM_CONDITIONAL(USE_LINUX_FB, true)
877 AM_CONDITIONAL(USE_LINUX_FB, false)
880 AC_SUBST(gdktargetlib)
881 AC_SUBST(gtktargetlib)
884 # Pick correct Pango packages to use
887 if test "x$gdktarget" = "xx11"; then
888 if $have_xft = true ; then
889 PANGO_PACKAGES="pangox pangoxft"
891 PANGO_PACKAGES=pangox
893 elif test "x$gdktarget" = "xlinux-fb"; then
894 PANGO_PACKAGES=pangoft2
899 # Check for Pango flags
901 AC_MSG_CHECKING(Pango flags)
902 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
903 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
904 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
906 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
909 *** Pango not found. Pango is required to build GTK+.
910 *** See http://www.pango.org for Pango information.
911 *** For the framebuffer target, you will need to build
912 *** Pango with freetype support.
916 CFLAGS="$CFLAGS $PANGO_CFLAGS"
918 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
919 *** Can't link to Pango. Pango is required to build
920 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS $x_ldflags $x_libs)
922 CFLAGS="$saved_cflags"
923 LDFLAGS="$saved_ldflags"
925 GDK_PACKAGES=$PANGO_PACKAGES
926 GDK_DEP_LIBS="`pkg-config --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
927 GDK_DEP_CFLAGS="`pkg-config --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
929 AC_SUBST(GDK_PACKAGES)
930 AC_SUBST(GDK_EXTRA_LIBS)
931 AC_SUBST(GDK_EXTRA_CFLAGS)
932 AC_SUBST(GDK_DEP_LIBS)
933 AC_SUBST(GDK_DEP_CFLAGS)
936 ########################################
937 # Check for Accessibility Toolkit flags
938 ########################################
941 AC_MSG_CHECKING(ATK flags)
942 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
943 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
944 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
946 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
949 *** Accessibility Toolkit not found. Accessibility Toolkit is required
954 AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
955 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
956 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
962 GTK_DEP_LIBS="`pkg-config --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
963 GTK_DEP_CFLAGS="`pkg-config --cflags $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
965 AC_SUBST(GTK_PACKAGES)
966 AC_SUBST(GTK_EXTRA_LIBS)
967 AC_SUBST(GTK_EXTRA_CFLAGS)
968 AC_SUBST(GTK_DEP_LIBS)
969 AC_SUBST(GTK_DEP_CFLAGS)
972 AC_SUBST(GTK_DEBUG_FLAGS)
973 AC_SUBST(GTK_XIM_FLAGS)
975 ##################################################
976 # Checks for gtk-doc and docbook-tools
977 ##################################################
979 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
981 if test "x$with_html_dir" = "x" ; then
982 HTML_DIR='${datadir}/gtk-doc/html'
984 HTML_DIR=$with_html_dir
989 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
991 gtk_doc_min_version=0.6
993 gtk_doc_version=`gtkdoc-mkdb --version`
994 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
996 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
997 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1006 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1007 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1009 dnl Let people disable the gtk-doc stuff.
1010 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1012 if test x$enable_gtk_doc = xauto ; then
1013 if test x$GTKDOC = xtrue ; then
1020 dnl NOTE: We need to use a separate automake conditional for this
1021 dnl to make this work with the tarballs.
1022 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1025 ##################################################
1027 ##################################################
1029 AC_OUTPUT_COMMANDS([
1031 ## Generate `gdk/gdkconfig.h' in two cases
1032 ## 1. `config.status' is run either explicitly, or via configure.
1033 ## Esp. not when it is run in `Makefile' to generate makefiles and
1035 ## 2. CONFIG_OTHER is set explicitly
1037 ## Case 1 is difficult. We know that `automake' sets one of
1038 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1039 ## only when AM_CONFIG_HEADER is set, however.
1041 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1042 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1043 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1045 case "$CONFIG_OTHER" in
1047 echo creating gdk/gdkconfig.h
1048 outfile=gdkconfig.h-tmp
1049 cat > $outfile <<\_______EOF
1052 * This is a generated file. Please modify `configure.in'
1060 #endif /* __cplusplus */
1064 cat >>$outfile <<_______EOF
1069 cat >>$outfile <<_______EOF
1073 #endif /* __cplusplus */
1075 #endif /* GDKCONFIG_H */
1079 if cmp -s $outfile gdk/gdkconfig.h; then
1080 echo gdk/gdkconfig.h is unchanged
1083 mv $outfile gdk/gdkconfig.h
1087 if test "x$gdktarget" = "xx11" ; then
1089 #define GDK_WINDOWING_X11'
1090 elif test "x$gdktarget" = "xnanox" ; then
1092 #define GDK_WINDOWING_NANOX'
1093 elif test "x$gdktarget" = "xlinux-fb" ; then
1095 #define GDK_WINDOWING_FB
1096 #define GDK_NATIVE_WINDOW_POINTER'
1099 if test x$gdk_wchar_h = xyes; then
1101 #define GDK_HAVE_WCHAR_H 1'
1103 if test x$gdk_wctype_h = xyes; then
1105 #define GDK_HAVE_WCTYPE_H 1"
1107 if test x$gdk_working_wctype = xno; then
1109 #define GDK_HAVE_BROKEN_WCTYPE 1"
1115 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1116 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1128 build/win32/Makefile
1130 demos/gtk-demo/Makefile
1133 docs/reference/Makefile
1134 docs/reference/gdk-pixbuf/Makefile
1135 docs/reference/gdk/Makefile
1136 docs/reference/gtk/Makefile
1138 docs/tutorial/Makefile
1140 gdk-pixbuf/makefile.mingw
1141 gdk-pixbuf/gdk-pixbuf-features.h
1142 gdk-pixbuf/pixops/Makefile
1143 gdk-pixbuf/pixops/makefile.mingw
1148 gdk/win32/makefile.mingw
1149 gdk/win32/rc/Makefile
1152 gdk/linux-fb/Makefile
1158 gtk/stock-icons/Makefile
1160 modules/input/Makefile
1162 contrib/gdk-pixbuf-xlib/Makefile
1163 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc