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 ## Strip the .la files
661 for I in $x_libs ; do
664 *) x_libs_for_checks="$x_libs_for_checks $I" ;;
668 # Sanity check for the X11 library
669 AC_CHECK_LIB(X11, XOpenDisplay, :,
670 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
673 if test "x$enable_shm" = "xyes"; then
674 # Check for the Xext library (needed for XShm extention)
675 AC_CHECK_LIB(Xext, XShmAttach,
676 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
677 x_extra_libs="-lXext"
679 # On AIX, it is in XextSam instead, but we still need -lXext
680 AC_CHECK_LIB(XextSam, XShmAttach,
681 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
682 x_extra_libs="-lXextSam -lXext"
684 x_extra_libs="-lXextSam"
685 fi, , $x_libs_for_checks),
689 GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
690 # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
691 GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
693 # Check for shaped window extension
695 AC_CHECK_LIB(Xext, XShapeCombineMask,
696 if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
697 x_extra_libs="-lXext $x_extra_libs"
699 AC_DEFINE(HAVE_SHAPE_EXT),
703 # Check for XConvertCase (X11R6 specific)
705 AC_CHECK_LIB(X11, XConvertCase,
706 AC_DEFINE(HAVE_XCONVERTCASE),
710 # Check for XIM support.
712 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
714 enable_xim_inst="no",
717 # On Solaris, calling XRegisterIMInstantiateCallback seems to
718 # cause an immediate segfault, so we disable it, unless
719 # the user specifically forces it to be on.
721 if test x$enable_xim_inst = xmaybe ; then
727 enable_xim_inst="yes"
732 if test "x$enable_xim" = "xyes"; then
733 GTK_XIM_FLAGS="-DUSE_XIM"
734 if test "x$enable_xim_inst" = "xyes"; then
735 AC_DEFINE(USE_X11R6_XIM)
739 # Check for XKB support.
741 if test "x$enable_xkb" = "xyes"; then
742 AC_MSG_WARN(XKB support explicitly enabled)
744 elif test "x$enable_xkb" = "xmaybe"; then
745 AC_CHECK_LIB(X11, XkbQueryExtension,
750 AC_MSG_WARN(XKB support explicitly disabled)
754 x_ldflags="$X_LDFLAGS"
756 # set up things for XInput
758 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
759 AC_DEFINE(XINPUT_GXI)
761 x_extra_libs="-lXi $x_extra_libs"
762 elif test "x$with_xinput" = "xxfree"; then
763 AC_DEFINE(XINPUT_XFREE)
764 x_extra_libs="-lXi $x_extra_libs"
766 AC_DEFINE(XINPUT_NONE)
769 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
770 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
772 if test "x$enable_shm" = "xyes"; then
773 # Check for shared memory
774 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
775 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
777 # Check for the X shared memory extension header file
779 AC_MSG_CHECKING(X11/extensions/XShm.h)
780 if test "x$no_xext_lib" = "xyes"; then
783 gtk_save_CFLAGS="$CFLAGS"
784 CFLAGS="$CFLAGS $x_cflags"
787 #include <sys/types.h>
790 #include <X11/Xlib.h>
791 #include <X11/Xutil.h>
792 #include <X11/extensions/XShm.h>
793 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
794 CFLAGS="$gtk_save_CFLAGS"
796 AC_MSG_RESULT($have_xshm)
797 if test $have_xshm = yes ; then
798 AC_DEFINE(HAVE_XSHM_H)
803 GDK_EXTRA_LIBS="$x_extra_libs"
805 # these are already defined above
806 #gdktargetlib = "libgdk-x11-1.3.la"
807 #gtktargetlib = "libgtk-x11-1.3.la"
809 AM_CONDITIONAL(USE_X11, true)
811 AM_CONDITIONAL(USE_X11, false)
814 AC_SUBST(xinput_progs)
816 GDK_PIXBUF_XLIB_PACKAGES=
817 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
818 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
820 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
821 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
822 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
823 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
824 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
826 if test "x$gdktarget" = "xnanox"; then
827 AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
828 # nano-X may require additional libraries
829 GDK_EXTRA_LIBS="-lnano-X $GDK_EXTRA_LIBS"
831 gdktargetlib="libgdk-nanox-1.3.la"
832 gtktargetlib="libgtk-nanox-1.3.la"
834 AM_CONDITIONAL(USE_NANOX, true)
836 AM_CONDITIONAL(USE_NANOX, false)
839 if test "x$gdktarget" = "xlinux-fb"; then
840 gdktargetlib="libgdk-linux-fb-1.3.la"
841 gtktargetlib="libgtk-linux-fb-1.3.la"
843 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
844 if test x$FREETYPE_CONFIG = xno ; then
845 AC_MSG_ERROR([*** freetype-config not found])
848 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
849 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
850 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
852 if test x$enable_shadowfb = xyes ; then
853 AC_DEFINE(ENABLE_SHADOW_FB)
856 GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
857 GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
859 AM_CONDITIONAL(USE_LINUX_FB, true)
861 AM_CONDITIONAL(USE_LINUX_FB, false)
864 AC_SUBST(gdktargetlib)
865 AC_SUBST(gtktargetlib)
868 # Pick correct Pango packages to use
871 if test "x$gdktarget" = "xx11"; then
872 if $have_xft = true ; then
873 PANGO_PACKAGES="pangox pangoxft"
875 PANGO_PACKAGES=pangox
877 elif test "x$gdktarget" = "xlinux-fb"; then
878 PANGO_PACKAGES=pangoft2
883 # Check for Pango flags
885 AC_MSG_CHECKING(Pango flags)
886 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
887 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
888 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
890 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
893 *** Pango not found. Pango is required to build GTK+.
894 *** See http://www.pango.org for Pango information.
895 *** For the framebuffer target, you will need to build
896 *** Pango with freetype support.
900 CFLAGS="$CFLAGS $PANGO_CFLAGS"
902 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
905 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
906 *** Can't link to Pango. Pango is required to build
907 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
910 CFLAGS="$saved_cflags"
911 LDFLAGS="$saved_ldflags"
913 GDK_PACKAGES=$PANGO_PACKAGES
914 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
915 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
917 AC_SUBST(GDK_PACKAGES)
918 AC_SUBST(GDK_EXTRA_LIBS)
919 AC_SUBST(GDK_EXTRA_CFLAGS)
920 AC_SUBST(GDK_DEP_LIBS)
921 AC_SUBST(GDK_DEP_CFLAGS)
924 ########################################
925 # Check for Accessibility Toolkit flags
926 ########################################
929 AC_MSG_CHECKING(ATK flags)
930 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
931 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
932 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
934 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
937 *** Accessibility Toolkit not found. Accessibility Toolkit is required
942 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
945 AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
946 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
947 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
953 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
954 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
956 AC_SUBST(GTK_PACKAGES)
957 AC_SUBST(GTK_EXTRA_LIBS)
958 AC_SUBST(GTK_EXTRA_CFLAGS)
959 AC_SUBST(GTK_DEP_LIBS)
960 AC_SUBST(GTK_DEP_CFLAGS)
963 AC_SUBST(GTK_DEBUG_FLAGS)
964 AC_SUBST(GTK_XIM_FLAGS)
966 ##################################################
967 # Checks for gtk-doc and docbook-tools
968 ##################################################
970 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
972 if test "x$with_html_dir" = "x" ; then
973 HTML_DIR='${datadir}/gtk-doc/html'
975 HTML_DIR=$with_html_dir
980 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
982 gtk_doc_min_version=0.6
984 gtk_doc_version=`gtkdoc-mkdb --version`
985 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
987 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
988 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
997 AC_CHECK_PROG(DB2HTML, db2html, true, false)
998 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1000 dnl Let people disable the gtk-doc stuff.
1001 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1003 if test x$enable_gtk_doc = xauto ; then
1004 if test x$GTKDOC = xtrue ; then
1011 dnl NOTE: We need to use a separate automake conditional for this
1012 dnl to make this work with the tarballs.
1013 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1016 ##################################################
1018 ##################################################
1020 AC_OUTPUT_COMMANDS([
1022 ## Generate `gdk/gdkconfig.h' in two cases
1023 ## 1. `config.status' is run either explicitly, or via configure.
1024 ## Esp. not when it is run in `Makefile' to generate makefiles and
1026 ## 2. CONFIG_OTHER is set explicitly
1028 ## Case 1 is difficult. We know that `automake' sets one of
1029 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1030 ## only when AM_CONFIG_HEADER is set, however.
1032 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1033 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1034 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1036 case "$CONFIG_OTHER" in
1038 echo creating gdk/gdkconfig.h
1039 outfile=gdkconfig.h-tmp
1040 cat > $outfile <<\_______EOF
1043 * This is a generated file. Please modify `configure.in'
1051 #endif /* __cplusplus */
1055 cat >>$outfile <<_______EOF
1060 cat >>$outfile <<_______EOF
1064 #endif /* __cplusplus */
1066 #endif /* GDKCONFIG_H */
1070 if cmp -s $outfile gdk/gdkconfig.h; then
1071 echo gdk/gdkconfig.h is unchanged
1074 mv $outfile gdk/gdkconfig.h
1078 if test "x$gdktarget" = "xx11" ; then
1080 #define GDK_WINDOWING_X11'
1081 elif test "x$gdktarget" = "xnanox" ; then
1083 #define GDK_WINDOWING_NANOX'
1084 elif test "x$gdktarget" = "xlinux-fb" ; then
1086 #define GDK_WINDOWING_FB
1087 #define GDK_NATIVE_WINDOW_POINTER'
1090 if test x$gdk_wchar_h = xyes; then
1092 #define GDK_HAVE_WCHAR_H 1'
1094 if test x$gdk_wctype_h = xyes; then
1096 #define GDK_HAVE_WCTYPE_H 1"
1098 if test x$gdk_working_wctype = xno; then
1100 #define GDK_HAVE_BROKEN_WCTYPE 1"
1106 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1107 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1117 gdk-pixbuf-2.0-uninstalled.pc
1118 gdk-2.0-uninstalled.pc
1119 gtk+-2.0-uninstalled.pc
1123 build/win32/Makefile
1125 demos/gtk-demo/Makefile
1128 docs/reference/Makefile
1129 docs/reference/gdk-pixbuf/Makefile
1130 docs/reference/gdk/Makefile
1131 docs/reference/gtk/Makefile
1133 docs/tutorial/Makefile
1135 gdk-pixbuf/makefile.mingw
1136 gdk-pixbuf/gdk-pixbuf-features.h
1137 gdk-pixbuf/pixops/Makefile
1138 gdk-pixbuf/pixops/makefile.mingw
1143 gdk/win32/makefile.mingw
1144 gdk/win32/rc/Makefile
1147 gdk/linux-fb/Makefile
1153 gtk/stock-icons/Makefile
1155 modules/input/Makefile
1157 contrib/gdk-pixbuf-xlib/Makefile
1158 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc