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 GLIB_AC_DIVERT_BEFORE_HELP([
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`
56 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
61 AC_SUBST(LT_CURRENT_MINUS_AGE)
63 # Define a string for the earliest version that this release has
64 # binary compatibility with. This is used for module locations.
66 GTK_BINARY_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$LT_CURRENT
67 AC_SUBST(GTK_BINARY_VERSION)
70 # gdk-pixbuf gets versioned separately, and for now, using standard
71 # libtool versioning, not GTK+-style versioning
73 GDK_PIXBUF_MAJOR=$GTK_MAJOR_VERSION
74 GDK_PIXBUF_MINOR=$GTK_MINOR_VERSION
75 GDK_PIXBUF_MICRO=$GTK_MICRO_VERSION
76 GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
77 AC_SUBST(GDK_PIXBUF_MAJOR)
78 AC_SUBST(GDK_PIXBUF_MINOR)
79 AC_SUBST(GDK_PIXBUF_MICRO)
80 AC_SUBST(GDK_PIXBUF_VERSION)
82 ## Versions of dependencies
83 GLIB_REQUIRED_VERSION=1.3.10
84 PANGO_REQUIRED_VERSION=0.20
85 ATK_REQUIRED_VERSION=0.5
92 AC_SUBST(GETTEXT_PACKAGE)
93 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
95 # Save this value here, since automake will set cflags later
96 cflags_set=${CFLAGS+set}
98 dnl Initialize automake stuff
99 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
101 # Specify a configuration file
102 AM_CONFIG_HEADER(config.h)
104 dnl Initialize libtool
109 dnl Set AS and ASFLAGS so that automake 1.5 will be happy
115 dnl Initialize maintainer mode
120 AC_MSG_CHECKING([for some Win32 platform])
122 *-*-mingw*|*-*-cygwin*)
129 AC_MSG_RESULT([$platform_win32])
130 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
132 AC_MSG_CHECKING([for native Win32])
141 AC_MSG_RESULT([$os_win32])
142 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
144 if test "$os_win32" = "yes"; then
145 AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
147 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
149 dnl figure debugging default, prior to $ac_help setup
151 GLIB_AC_DIVERT_BEFORE_HELP([
152 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
155 debug_default=minimum
159 dnl declare --enable-* args and collect ac_help strings
160 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
161 AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
162 echo $enable_shm, enable_shm="yes")
163 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
165 AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
167 AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
168 , enable_xim_inst="maybe")
169 AC_ARG_ENABLE(xkb, [ --enable-xkb support XKB [default=maybe]],
170 , enable_xkb="maybe")
171 AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
173 AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
175 AC_ARG_WITH(wintab, [ --with-wintab=DIRECTORY use Wintab API with win32 backend])
177 GLIB_AC_DIVERT_BEFORE_HELP([
178 if test "$platform_win32" = yes; then
185 AC_ARG_WITH(gdktarget, [ --with-gdktarget=[x11/linux-fb/win32] select GDK target [default=$gdktarget]],
186 gdktarget=$with_gdktarget)
190 x11|linux-fb|win32) ;;
191 *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
194 gdktargetlib=libgdk-$gdktarget-1.3.la
195 gtktargetlib=libgtk-$gdktarget-1.3.la
197 AC_SUBST(gdktargetlib)
198 AC_SUBST(gtktargetlib)
200 AC_ARG_ENABLE(shadowfb, [ --disable-shadowfb disable shadowfb support for linux-fb],,enable_shadowfb=yes)
202 AC_ARG_ENABLE(fbmanager, [ --enable-fbmanager enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
204 if test "x$enable_debug" = "xyes"; then
205 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
206 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
208 if test "x$enable_debug" = "xno"; then
209 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
211 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
215 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
218 # Build time sanity check...
221 # Checks for programs.
228 if test "x$GCC" = "xyes"; then
230 *[\ \ ]-Wall[\ \ ]*) ;;
231 *) CFLAGS="$CFLAGS -Wall" ;;
234 if test "x$enable_ansi" = "xyes"; then
236 *[\ \ ]-ansi[\ \ ]*) ;;
237 *) CFLAGS="$CFLAGS -ansi" ;;
241 *[\ \ ]-pedantic[\ \ ]*) ;;
242 *) CFLAGS="$CFLAGS -pedantic" ;;
246 if test "$os_win32" = "yes"; then
247 case "$CC $CFLAGS " in
248 *[[\ \ ]]-fnative-struct[[\ \ ]]*) ;;
249 *) CFLAGS="$CFLAGS -fnative-struct" ;;
255 # Honor aclocal flags
256 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
258 ## Initial sanity check, done here so that users get told they
259 ## have the wrong dependencies as early in the process as possible.
260 ## Later on we actually use the cflags/libs from separate pkg-config
261 ## calls. Oh, also the later pkg-config calls don't include
262 ## the version requirements since those make the module lists
263 ## annoying to construct
264 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION atk >= $ATK_REQUIRED_VERSION pango >= $PANGO_REQUIRED_VERSION)
266 if test "$os_win32" != yes; then
267 # libtool option to control which symbols are exported
268 # right now, symbols starting with _ are not exported
269 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
271 # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
272 LIBTOOL_EXPORT_OPTIONS=
274 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
276 # define a MAINT-like variable REBUILD which is set if Perl
277 # and awk are found, so autogenerated sources can be rebuilt
280 AC_CHECK_PROGS(PERL, perl5 perl)
282 # We would like indent, but don't require it.
283 AC_CHECK_PROG(INDENT, indent, indent)
286 if test "x$enable_rebuilds" = "xyes" && \
288 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
289 test -n "$AWK" ; then
294 AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
296 AC_MSG_CHECKING(whether make is GNU Make)
299 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
300 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
307 AC_SUBST(STRIP_DUMMY)
308 AC_SUBST(STRIP_BEGIN)
312 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"
314 LIBS="$LIBS $INTLLIBS"
316 # AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
317 # this is the directory where the *.{mo,gmo} files are installed
318 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
319 AC_SUBST(gtklocaledir)
321 dnl The DU4 header files don't provide library prototypes unless
322 dnl -std1 is given to the native cc.
323 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
327 AC_TRY_RUN([#include <math.h>
328 int main (void) { return (log(1) != log(1.)); }],
329 AC_MSG_RESULT(none needed),
330 gtk_save_CFLAGS="$CFLAGS"
331 CFLAGS="$CFLAGS -std1"
332 AC_TRY_RUN([#include <math.h>
333 int main (void) { return (log(1) != log(1.)); }],
334 AC_MSG_RESULT(-std1),
336 CFLAGS="$gtk_save_CFLAGS"
338 [No ANSI prototypes found in library. (-std1 didn't work.)]),
341 AC_MSG_RESULT(none needed)
346 AC_MSG_CHECKING(for the BeOS)
357 dnl NeXTStep cc seems to need this
358 AC_MSG_CHECKING([for extra flags for POSIX compliance])
359 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
360 AC_MSG_RESULT(none needed),
361 gtk_save_CFLAGS="$CFLAGS"
362 CFLAGS="$CFLAGS -posix"
363 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
364 AC_MSG_RESULT(-posix),
366 CFLAGS="$gtk_save_CFLAGS"
367 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
370 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
373 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
375 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
377 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
378 *** GLIB is always available from ftp://ftp.gtk.org/.]),
379 gobject gmodule gthread)
381 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
382 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
383 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
384 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
385 AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
386 AC_CHECK_HEADERS(dimm.h, AC_DEFINE(HAVE_DIMM_H))
388 if test ${with_wintab+set} = set && test $with_wintab != no; then
389 AC_MSG_CHECKING([for wintab.h])
390 saved_CFLAGS="$CFLAGS"
391 CFLAGS="$CFLAGS -I$with_wintab/include"
392 AC_TRY_COMPILE([#include <windows.h>
393 #include <wintab.h>],
396 if test -f $with_wintab/lib/i386/wntab32x.lib ; then
398 AC_DEFINE(HAVE_WINTAB)
399 WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
407 CFLAGS="$saved_cflags"
409 AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
411 saved_cflags="$CFLAGS"
412 saved_ldflags="$LDFLAGS"
415 # Checks for header files.
418 # Checks for typedefs, structures, and compiler characteristics.
421 # Checks for library functions.
425 AC_CHECK_FUNCS(getresuid)
428 # Check if <sys/select.h> needs to be included for fd_set
429 AC_MSG_CHECKING([for fd_set])
430 AC_TRY_COMPILE([#include <sys/types.h>],
431 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
432 if test $gtk_ok = yes; then
433 AC_MSG_RESULT([yes, found in sys/types.h])
435 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
436 if test $gtk_ok = yes; then
437 AC_DEFINE(HAVE_SYS_SELECT_H)
438 AC_MSG_RESULT([yes, found in sys/select.h])
445 # `widechar' tests for gdki18n.h
446 AC_MSG_CHECKING(for wchar.h)
447 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
448 if test $gdk_wchar_h = yes; then
449 AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
451 AC_MSG_RESULT($gdk_wchar_h)
453 # Check for wctype.h (for iswalnum)
454 AC_MSG_CHECKING(for wctype.h)
455 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
456 if test $gdk_wctype_h = yes; then
457 AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
459 AC_MSG_RESULT($gdk_wctype_h)
461 # in Solaris 2.5, `iswalnum' is in -lw
463 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
466 LIBS="$LIBS $GDK_WLIBS"
467 # The following is necessary for Linux libc-5.4.38
468 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
469 AC_TRY_LINK([#include <stdlib.h>],[
470 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
471 # ifdef HAVE_WCTYPE_H
479 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
481 iswalnum((wchar_t) 0);
482 ], gdk_working_wctype=yes, gdk_working_wctype=no)
485 if test $gdk_working_wctype = no; then
486 AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
489 AC_MSG_RESULT($gdk_working_wctype)
494 ##################################################
495 # Checks for gdk-pixbuf
496 ##################################################
498 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
500 AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[
501 if test x$withval = xyes; then
510 if test x$with_modules = xno; then
514 AC_MSG_CHECKING(whether dynamic modules work)
515 ## for loop is to strip newline
516 tmp=`pkg-config --variable=gmodule_supported gmodule-2.0`
522 dnl Now we check to see if our libtool supports shared lib deps
523 dnl (in a rather ugly way even)
525 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
526 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
527 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
528 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
529 if test "x$pixbuf_deplibs_check" = "xnone" || \
530 test "x$pixbuf_deplibs_check" = "xunknown" || \
531 test "x$pixbuf_deplibs_check" = "x"; then
537 AC_DEFINE(USE_GMODULE)
544 if test -z "$LIBTIFF"; then
545 AC_CHECK_LIB(tiff, TIFFReadScanline,
546 [AC_CHECK_HEADER(tiffio.h,
547 TIFF='tiff'; LIBTIFF='-ltiff',
548 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
549 [AC_CHECK_LIB(tiff, TIFFWriteScanline,
550 [AC_CHECK_HEADER(tiffio.h,
551 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
552 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
553 [AC_CHECK_LIB(tiff34, TIFFFlushData,
554 [AC_CHECK_HEADER(tiffio.h,
555 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
556 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
557 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
561 if test -z "$LIBJPEG"; then
562 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
565 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
566 if test "$jpeg_ok" = yes; then
567 AC_MSG_CHECKING([for jpeglib.h])
572 #include <jpeglib.h>],
575 AC_MSG_RESULT($jpeg_ok)
576 if test "$jpeg_ok" = yes; then
578 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
579 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
580 AC_MSG_WARN(JPEG library does not support progressive saving.))
582 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
588 if test -z "$LIBPNG"; then
589 AC_CHECK_LIB(png, png_read_info,
590 [AC_CHECK_HEADER(png.h,
593 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
594 if test "$png_ok" = yes; then
595 AC_MSG_CHECKING([for png_structp in png.h])
596 AC_TRY_COMPILE([#include <png.h>],
597 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
600 AC_MSG_RESULT($png_ok)
601 if test "$png_ok" = yes; then
602 PNG='png'; LIBPNG='-lpng -lz'
604 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
607 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
615 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
618 # Allow building some or all gdk-pixbuf loaders included
620 AC_MSG_CHECKING(pixbuf loaders to build)
622 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
627 ## if the option was specified, leave it; otherwise disable included loaders
628 if test x$with_included_loaders = xno; then
629 with_included_loaders=yes
633 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
635 # If no loaders specified, include all
636 if test "x$with_included_loaders" = xyes ; then
637 included_loaders="$all_loaders"
639 included_loaders="$with_included_loaders"
642 AC_MSG_RESULT($included_loaders)
645 INCLUDED_LOADER_DEFINE=
647 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
648 for loader in $included_loaders; do
649 if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
652 AC_MSG_ERROR([the specified loader $loader does not exist])
655 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
656 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
659 AC_SUBST(INCLUDED_LOADER_OBJ)
660 AC_SUBST(INCLUDED_LOADER_DEFINE)
667 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
668 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
669 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
673 if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
674 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
676 if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
677 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
679 if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
680 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
683 STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
686 # Checks to see if we should compile in MMX support (there will be
687 # a runtime test when the code is actually run to see if it should
688 # be used - this just checks if we can compile it.)
690 # This code is partially taken from Mesa
692 AC_MSG_CHECKING(for x86 platform)
694 i386|i486|i586|i686|i786|k6|k7)
700 AC_MSG_RESULT($use_x86_asm)
703 if test $use_x86_asm = yes; then
707 AC_MSG_CHECKING(compiler support for MMX)
708 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
709 if AC_TRY_EVAL(ac_compile); then
716 if test $use_mmx_asm = yes; then
724 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
727 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
728 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
729 GDK_PIXBUF_EXTRA_CFLAGS=
730 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
731 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
733 AC_SUBST(GDK_PIXBUF_PACKAGES)
734 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
735 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
736 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
737 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
740 ########################################
741 # Windowing system checks
742 ########################################
744 GDK_EXTRA_LIBS=$GDK_WLIBS
747 if test "x$gdktarget" = "xx11"; then
748 # We start off with the libraries from Pango
750 ## be sure we also have Pango built with xft support
751 if $PKG_CONFIG --exists pangoxft ; then
752 PANGO_PACKAGES="pangox pangoxft"
756 PANGO_PACKAGES="pangox"
760 AM_CONDITIONAL(HAVE_XFT, $have_xft)
762 x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
763 x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
766 ## Strip the .la files
769 for I in $x_libs ; do
772 *) x_libs_for_checks="$x_libs_for_checks $I" ;;
776 # Sanity check for the X11 library
777 AC_CHECK_LIB(X11, XOpenDisplay, :,
778 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
781 if test "x$enable_shm" = "xyes"; then
782 # Check for the Xext library (needed for XShm extention)
783 AC_CHECK_LIB(Xext, XShmAttach,
784 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
785 x_extra_libs="-lXext"
787 # On AIX, it is in XextSam instead, but we still need -lXext
788 AC_CHECK_LIB(XextSam, XShmAttach,
789 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
790 x_extra_libs="-lXextSam -lXext"
792 x_extra_libs="-lXextSam"
793 fi, , $x_libs_for_checks),
797 GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
798 # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
799 GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
801 # Check for shaped window extension
803 AC_CHECK_LIB(Xext, XShapeCombineMask,
804 if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
805 x_extra_libs="-lXext $x_extra_libs"
807 AC_DEFINE(HAVE_SHAPE_EXT),
811 # Check for XConvertCase (X11R6 specific)
813 AC_CHECK_LIB(X11, XConvertCase,
814 AC_DEFINE(HAVE_XCONVERTCASE),
818 # Check for XIM support.
820 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
822 enable_xim_inst="no",
825 # On Solaris, calling XRegisterIMInstantiateCallback seems to
826 # cause an immediate segfault, so we disable it, unless
827 # the user specifically forces it to be on.
829 if test x$enable_xim_inst = xmaybe ; then
835 enable_xim_inst="yes"
840 if test "x$enable_xim" = "xyes"; then
841 GTK_XIM_FLAGS="-DUSE_XIM"
842 if test "x$enable_xim_inst" = "xyes"; then
843 AC_DEFINE(USE_X11R6_XIM)
847 # Check for XKB support.
849 if test "x$enable_xkb" = "xyes"; then
850 AC_MSG_WARN(XKB support explicitly enabled)
852 elif test "x$enable_xkb" = "xmaybe"; then
853 AC_CHECK_LIB(X11, XkbQueryExtension,
858 AC_MSG_WARN(XKB support explicitly disabled)
862 x_ldflags="$X_LDFLAGS"
864 # set up things for XInput
866 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
867 AC_DEFINE(XINPUT_GXI)
869 x_extra_libs="-lXi $x_extra_libs"
870 elif test "x$with_xinput" = "xxfree"; then
871 AC_DEFINE(XINPUT_XFREE)
872 x_extra_libs="-lXi $x_extra_libs"
874 AC_DEFINE(XINPUT_NONE)
877 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
878 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
880 if test "x$enable_shm" = "xyes"; then
881 # Check for shared memory
882 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
883 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
885 # Check for the X shared memory extension header file
887 AC_MSG_CHECKING(X11/extensions/XShm.h)
888 if test "x$no_xext_lib" = "xyes"; then
891 gtk_save_CFLAGS="$CFLAGS"
892 CFLAGS="$CFLAGS $x_cflags"
895 #include <sys/types.h>
898 #include <X11/Xlib.h>
899 #include <X11/Xutil.h>
900 #include <X11/extensions/XShm.h>
901 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
902 CFLAGS="$gtk_save_CFLAGS"
904 AC_MSG_RESULT($have_xshm)
905 if test $have_xshm = yes ; then
906 AC_DEFINE(HAVE_XSHM_H)
911 GDK_EXTRA_LIBS="$x_extra_libs"
913 AM_CONDITIONAL(USE_X11, true)
915 AM_CONDITIONAL(USE_X11, false)
918 if test "x$gdktarget" = "xwin32"; then
919 # We start off with the libraries from Pango
921 ## be sure we also have Pango built with win32 support
922 PANGO_PACKAGES="pangowin32"
924 if test x$have_wintab = xyes; then
925 GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
926 AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
929 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
930 AM_CONDITIONAL(USE_WIN32, true)
932 AM_CONDITIONAL(USE_WIN32, false)
935 AC_SUBST(xinput_progs)
937 GDK_PIXBUF_XLIB_PACKAGES=
938 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
939 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
941 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
942 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
943 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
944 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
945 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
947 if test "x$gdktarget" = "xlinux-fb"; then
948 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
949 if test x$FREETYPE_CONFIG = xno ; then
950 AC_MSG_ERROR([*** freetype-config not found])
953 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
954 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
955 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
957 if test x$enable_shadowfb = xyes ; then
958 AC_DEFINE(ENABLE_SHADOW_FB)
961 if test x$enable_fbmanager = xyes ; then
962 AC_DEFINE(ENABLE_FB_MANAGER)
963 AM_CONDITIONAL(ENABLE_FB_MANAGER, true)
965 AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
968 GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
969 GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
971 AM_CONDITIONAL(USE_LINUX_FB, true)
973 AM_CONDITIONAL(USE_LINUX_FB, false)
974 AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
978 # Pick correct Pango packages to use
981 if test "x$gdktarget" = "xx11"; then
982 if $have_xft = true ; then
983 PANGO_PACKAGES="pangox pangoxft"
985 PANGO_PACKAGES=pangox
987 elif test "x$gdktarget" = "xwin32"; then
988 PANGO_PACKAGES=pangowin32
989 elif test "x$gdktarget" = "xlinux-fb"; then
990 PANGO_PACKAGES=pangoft2
995 # Check for Pango flags
997 AC_MSG_CHECKING(Pango flags)
998 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
999 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
1000 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1002 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1005 *** Pango not found. Pango is required to build GTK+.
1006 *** See http://www.pango.org for Pango information.
1007 *** For the framebuffer target, you will need to build
1008 *** Pango with freetype support.
1012 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1014 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1017 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
1018 *** Can't link to Pango. Pango is required to build
1019 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
1022 CFLAGS="$saved_cflags"
1023 LDFLAGS="$saved_ldflags"
1025 GDK_PACKAGES=$PANGO_PACKAGES
1026 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1027 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1029 AC_SUBST(GDK_PACKAGES)
1030 AC_SUBST(GDK_EXTRA_LIBS)
1031 AC_SUBST(GDK_EXTRA_CFLAGS)
1032 AC_SUBST(GDK_DEP_LIBS)
1033 AC_SUBST(GDK_DEP_CFLAGS)
1036 ########################################
1037 # Check for Accessibility Toolkit flags
1038 ########################################
1041 AC_MSG_CHECKING(ATK flags)
1042 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1043 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1044 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1046 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1049 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1054 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1057 AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
1058 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1059 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
1065 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1066 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1068 AC_SUBST(GTK_PACKAGES)
1069 AC_SUBST(GTK_EXTRA_LIBS)
1070 AC_SUBST(GTK_EXTRA_CFLAGS)
1071 AC_SUBST(GTK_DEP_LIBS)
1072 AC_SUBST(GTK_DEP_CFLAGS)
1075 AC_SUBST(GTK_DEBUG_FLAGS)
1076 AC_SUBST(GTK_XIM_FLAGS)
1078 ##################################################
1079 # Checks for gtk-doc and docbook-tools
1080 ##################################################
1082 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
1084 if test "x$with_html_dir" = "x" ; then
1085 HTML_DIR='${datadir}/gtk-doc/html'
1087 HTML_DIR=$with_html_dir
1092 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1094 gtk_doc_min_version=0.6
1096 gtk_doc_version=`gtkdoc-mkdb --version`
1097 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
1098 if perl <<EOF ; then
1099 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
1100 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1109 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1110 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1112 dnl Let people disable the gtk-doc stuff.
1113 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1115 if test x$enable_gtk_doc = xauto ; then
1116 if test x$GTKDOC = xtrue ; then
1123 dnl NOTE: We need to use a separate automake conditional for this
1124 dnl to make this work with the tarballs.
1125 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1128 ##################################################
1130 ##################################################
1132 AC_OUTPUT_COMMANDS([
1134 ## Generate `gdk/gdkconfig.h' in two cases
1135 ## 1. `config.status' is run either explicitly, or via configure.
1136 ## Esp. not when it is run in `Makefile' to generate makefiles and
1138 ## 2. CONFIG_OTHER is set explicitly
1140 ## Case 1 is difficult. We know that `automake' sets one of
1141 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1142 ## only when AM_CONFIG_HEADER is set, however.
1144 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1145 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1146 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1148 case "$CONFIG_OTHER" in
1150 echo creating gdk/gdkconfig.h
1151 outfile=gdkconfig.h-tmp
1152 cat > $outfile <<\_______EOF
1155 * This is a generated file. Please modify `configure.in'
1163 #endif /* __cplusplus */
1167 cat >>$outfile <<_______EOF
1172 cat >>$outfile <<_______EOF
1176 #endif /* __cplusplus */
1178 #endif /* GDKCONFIG_H */
1182 if cmp -s $outfile gdk/gdkconfig.h; then
1183 echo gdk/gdkconfig.h is unchanged
1186 mv $outfile gdk/gdkconfig.h
1190 if test "x$gdktarget" = "xx11" ; then
1192 #define GDK_WINDOWING_X11'
1193 elif test "x$gdktarget" = "xwin32" ; then
1195 #define GDK_WINDOWING_WIN32'
1196 elif test "x$gdktarget" = "xlinux-fb" ; then
1198 #define GDK_WINDOWING_FB
1199 #define GDK_NATIVE_WINDOW_POINTER'
1202 if test x$gdk_wchar_h = xyes; then
1204 #define GDK_HAVE_WCHAR_H 1'
1206 if test x$gdk_wctype_h = xyes; then
1208 #define GDK_HAVE_WCTYPE_H 1"
1210 if test x$gdk_working_wctype = xno; then
1212 #define GDK_HAVE_BROKEN_WCTYPE 1"
1218 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1219 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1229 gdk-pixbuf-2.0-uninstalled.pc
1230 gdk-2.0-uninstalled.pc
1231 gtk+-2.0-uninstalled.pc
1235 build/win32/Makefile
1236 build/win32/dirent/Makefile
1238 demos/gtk-demo/Makefile
1241 docs/reference/Makefile
1242 docs/reference/gdk-pixbuf/Makefile
1243 docs/reference/gdk/Makefile
1244 docs/reference/gtk/Makefile
1246 docs/tutorial/Makefile
1248 gdk-pixbuf/makefile.mingw
1249 gdk-pixbuf/gdk-pixbuf-features.h
1250 gdk-pixbuf/pixops/Makefile
1251 gdk-pixbuf/pixops/makefile.mingw
1256 gdk/win32/makefile.mingw
1257 gdk/win32/rc/Makefile
1259 gdk/linux-fb/Makefile
1265 gtk/stock-icons/Makefile
1267 modules/input/Makefile
1269 contrib/gdk-pixbuf-xlib/Makefile
1270 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc