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 if test "$platform_win32" = yes; then
183 AC_ARG_WITH(gdktarget, [ --with-gdktarget=[x11/linux-fb/win32] select GDK target [default=$gdktarget]],
184 gdktarget=$with_gdktarget)
188 x11|linux-fb|win32) ;;
189 *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
192 gdktargetlib=libgdk-$gdktarget-1.3.la
193 gtktargetlib=libgtk-$gdktarget-1.3.la
195 AC_SUBST(gdktargetlib)
196 AC_SUBST(gtktargetlib)
198 AC_ARG_ENABLE(shadowfb, [ --disable-shadowfb disable shadowfb support for linux-fb],,enable_shadowfb=yes)
200 AC_ARG_ENABLE(fbmanager, [ --enable-fbmanager enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
202 if test "x$enable_debug" = "xyes"; then
203 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
204 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
206 if test "x$enable_debug" = "xno"; then
207 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
209 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
213 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
216 # Build time sanity check...
219 # Checks for programs.
226 if test "x$GCC" = "xyes"; then
228 *[\ \ ]-Wall[\ \ ]*) ;;
229 *) CFLAGS="$CFLAGS -Wall" ;;
232 if test "x$enable_ansi" = "xyes"; then
234 *[\ \ ]-ansi[\ \ ]*) ;;
235 *) CFLAGS="$CFLAGS -ansi" ;;
239 *[\ \ ]-pedantic[\ \ ]*) ;;
240 *) CFLAGS="$CFLAGS -pedantic" ;;
244 if test "$os_win32" = "yes"; then
245 case "$CC $CFLAGS " in
246 *[[\ \ ]]-fnative-struct[[\ \ ]]*) ;;
247 *) CFLAGS="$CFLAGS -fnative-struct" ;;
253 # Honor aclocal flags
254 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
256 ## Initial sanity check, done here so that users get told they
257 ## have the wrong dependencies as early in the process as possible.
258 ## Later on we actually use the cflags/libs from separate pkg-config
259 ## calls. Oh, also the later pkg-config calls don't include
260 ## the version requirements since those make the module lists
261 ## annoying to construct
262 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION atk >= $ATK_REQUIRED_VERSION pango >= $PANGO_REQUIRED_VERSION)
264 if test "$os_win32" != yes; then
265 # libtool option to control which symbols are exported
266 # right now, symbols starting with _ are not exported
267 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
269 # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
270 LIBTOOL_EXPORT_OPTIONS=
272 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
274 # define a MAINT-like variable REBUILD which is set if Perl
275 # and awk are found, so autogenerated sources can be rebuilt
278 AC_CHECK_PROGS(PERL, perl5 perl)
280 # We would like indent, but don't require it.
281 AC_CHECK_PROG(INDENT, indent, indent)
284 if test "x$enable_rebuilds" = "xyes" && \
286 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
287 test -n "$AWK" ; then
292 AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
294 AC_MSG_CHECKING(whether make is GNU Make)
297 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
298 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
305 AC_SUBST(STRIP_DUMMY)
306 AC_SUBST(STRIP_BEGIN)
310 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"
312 LIBS="$LIBS $INTLLIBS"
314 # AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
315 # this is the directory where the *.{mo,gmo} files are installed
316 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
317 AC_SUBST(gtklocaledir)
319 dnl The DU4 header files don't provide library prototypes unless
320 dnl -std1 is given to the native cc.
321 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
325 AC_TRY_RUN([#include <math.h>
326 int main (void) { return (log(1) != log(1.)); }],
327 AC_MSG_RESULT(none needed),
328 gtk_save_CFLAGS="$CFLAGS"
329 CFLAGS="$CFLAGS -std1"
330 AC_TRY_RUN([#include <math.h>
331 int main (void) { return (log(1) != log(1.)); }],
332 AC_MSG_RESULT(-std1),
334 CFLAGS="$gtk_save_CFLAGS"
336 [No ANSI prototypes found in library. (-std1 didn't work.)]),
339 AC_MSG_RESULT(none needed)
344 AC_MSG_CHECKING(for the BeOS)
355 dnl NeXTStep cc seems to need this
356 AC_MSG_CHECKING([for extra flags for POSIX compliance])
357 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
358 AC_MSG_RESULT(none needed),
359 gtk_save_CFLAGS="$CFLAGS"
360 CFLAGS="$CFLAGS -posix"
361 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
362 AC_MSG_RESULT(-posix),
364 CFLAGS="$gtk_save_CFLAGS"
365 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
368 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
371 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
373 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
375 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
376 *** GLIB is always available from ftp://ftp.gtk.org/.]),
377 gobject gmodule gthread)
379 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
380 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
381 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
382 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
383 AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
384 AC_CHECK_HEADERS(dimm.h, AC_DEFINE(HAVE_DIMM_H))
386 if test ${with_wintab+set} = set && test $with_wintab != no; then
387 AC_MSG_CHECKING([for wintab.h])
388 saved_CFLAGS="$CFLAGS"
389 CFLAGS="$CFLAGS -I$with_wintab/include"
390 AC_TRY_COMPILE([#include <windows.h>
391 #include <wintab.h>],
394 if test -f $with_wintab/lib/i386/wntab32x.lib ; then
396 AC_DEFINE(HAVE_WINTAB)
397 WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
405 CFLAGS="$saved_cflags"
407 AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
409 saved_cflags="$CFLAGS"
410 saved_ldflags="$LDFLAGS"
413 # Checks for header files.
416 # Checks for typedefs, structures, and compiler characteristics.
419 # Checks for library functions.
423 AC_CHECK_FUNCS(getresuid)
426 # Check if <sys/select.h> needs to be included for fd_set
427 AC_MSG_CHECKING([for fd_set])
428 AC_TRY_COMPILE([#include <sys/types.h>],
429 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
430 if test $gtk_ok = yes; then
431 AC_MSG_RESULT([yes, found in sys/types.h])
433 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
434 if test $gtk_ok = yes; then
435 AC_DEFINE(HAVE_SYS_SELECT_H)
436 AC_MSG_RESULT([yes, found in sys/select.h])
443 # `widechar' tests for gdki18n.h
444 AC_MSG_CHECKING(for wchar.h)
445 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
446 if test $gdk_wchar_h = yes; then
447 AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
449 AC_MSG_RESULT($gdk_wchar_h)
451 # Check for wctype.h (for iswalnum)
452 AC_MSG_CHECKING(for wctype.h)
453 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
454 if test $gdk_wctype_h = yes; then
455 AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
457 AC_MSG_RESULT($gdk_wctype_h)
459 # in Solaris 2.5, `iswalnum' is in -lw
461 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
464 LIBS="$LIBS $GDK_WLIBS"
465 # The following is necessary for Linux libc-5.4.38
466 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
467 AC_TRY_LINK([#include <stdlib.h>],[
468 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
469 # ifdef HAVE_WCTYPE_H
477 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
479 iswalnum((wchar_t) 0);
480 ], gdk_working_wctype=yes, gdk_working_wctype=no)
483 if test $gdk_working_wctype = no; then
484 AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
487 AC_MSG_RESULT($gdk_working_wctype)
492 ##################################################
493 # Checks for gdk-pixbuf
494 ##################################################
496 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
498 AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[
499 if test x$withval = xyes; then
508 if test x$with_modules = xno; then
512 AC_MSG_CHECKING(whether dynamic modules work)
513 ## for loop is to strip newline
514 tmp=`pkg-config --variable=gmodule_supported gmodule-2.0`
520 dnl Now we check to see if our libtool supports shared lib deps
521 dnl (in a rather ugly way even)
523 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
524 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
525 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
526 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
527 if test "x$pixbuf_deplibs_check" = "xnone" || \
528 test "x$pixbuf_deplibs_check" = "xunknown" || \
529 test "x$pixbuf_deplibs_check" = "x"; then
535 AC_DEFINE(USE_GMODULE)
542 if test -z "$LIBTIFF"; then
543 AC_CHECK_LIB(tiff, TIFFReadScanline,
544 [AC_CHECK_HEADER(tiffio.h,
545 TIFF='tiff'; LIBTIFF='-ltiff',
546 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
547 [AC_CHECK_LIB(tiff, TIFFWriteScanline,
548 [AC_CHECK_HEADER(tiffio.h,
549 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
550 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
551 [AC_CHECK_LIB(tiff34, TIFFFlushData,
552 [AC_CHECK_HEADER(tiffio.h,
553 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
554 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
555 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
559 if test -z "$LIBJPEG"; then
560 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
563 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
564 if test "$jpeg_ok" = yes; then
565 AC_MSG_CHECKING([for jpeglib.h])
570 #include <jpeglib.h>],
573 AC_MSG_RESULT($jpeg_ok)
574 if test "$jpeg_ok" = yes; then
576 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
577 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
578 AC_MSG_WARN(JPEG library does not support progressive saving.))
580 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
586 if test -z "$LIBPNG"; then
587 AC_CHECK_LIB(png, png_read_info,
588 [AC_CHECK_HEADER(png.h,
591 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
592 if test "$png_ok" = yes; then
593 AC_MSG_CHECKING([for png_structp in png.h])
594 AC_TRY_COMPILE([#include <png.h>],
595 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
598 AC_MSG_RESULT($png_ok)
599 if test "$png_ok" = yes; then
600 PNG='png'; LIBPNG='-lpng -lz'
602 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
605 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
613 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
616 # Allow building some or all gdk-pixbuf loaders included
618 AC_MSG_CHECKING(pixbuf loaders to build)
620 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
625 ## if the option was specified, leave it; otherwise disable included loaders
626 if test x$with_included_loaders = xno; then
627 with_included_loaders=yes
631 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
633 # If no loaders specified, include all
634 if test "x$with_included_loaders" = xyes ; then
635 included_loaders="$all_loaders"
637 included_loaders="$with_included_loaders"
640 AC_MSG_RESULT($included_loaders)
643 INCLUDED_LOADER_DEFINE=
645 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
646 for loader in $included_loaders; do
647 if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
650 AC_MSG_ERROR([the specified loader $loader does not exist])
653 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
654 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
657 AC_SUBST(INCLUDED_LOADER_OBJ)
658 AC_SUBST(INCLUDED_LOADER_DEFINE)
665 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
666 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
667 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
671 if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
672 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
674 if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
675 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
677 if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
678 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
681 STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
684 # Checks to see if we should compile in MMX support (there will be
685 # a runtime test when the code is actually run to see if it should
686 # be used - this just checks if we can compile it.)
688 # This code is partially taken from Mesa
690 AC_MSG_CHECKING(for x86 platform)
692 i386|i486|i586|i686|i786|k6|k7)
698 AC_MSG_RESULT($use_x86_asm)
701 if test $use_x86_asm = yes; then
705 AC_MSG_CHECKING(compiler support for MMX)
706 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
707 if AC_TRY_EVAL(ac_compile); then
714 if test $use_mmx_asm = yes; then
722 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
725 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
726 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
727 GDK_PIXBUF_EXTRA_CFLAGS=
728 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
729 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
731 AC_SUBST(GDK_PIXBUF_PACKAGES)
732 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
733 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
734 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
735 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
738 ########################################
739 # Windowing system checks
740 ########################################
742 GDK_EXTRA_LIBS=$GDK_WLIBS
745 if test "x$gdktarget" = "xx11"; then
746 # We start off with the libraries from Pango
748 ## be sure we also have Pango built with xft support
749 if $PKG_CONFIG --exists pangoxft ; then
750 PANGO_PACKAGES="pangox pangoxft"
754 PANGO_PACKAGES="pangox"
758 AM_CONDITIONAL(HAVE_XFT, $have_xft)
760 x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
761 x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
764 ## Strip the .la files
767 for I in $x_libs ; do
770 *) x_libs_for_checks="$x_libs_for_checks $I" ;;
774 # Sanity check for the X11 library
775 AC_CHECK_LIB(X11, XOpenDisplay, :,
776 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
779 if test "x$enable_shm" = "xyes"; then
780 # Check for the Xext library (needed for XShm extention)
781 AC_CHECK_LIB(Xext, XShmAttach,
782 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
783 x_extra_libs="-lXext"
785 # On AIX, it is in XextSam instead, but we still need -lXext
786 AC_CHECK_LIB(XextSam, XShmAttach,
787 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
788 x_extra_libs="-lXextSam -lXext"
790 x_extra_libs="-lXextSam"
791 fi, , $x_libs_for_checks),
795 GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
796 # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
797 GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
799 # Check for shaped window extension
801 AC_CHECK_LIB(Xext, XShapeCombineMask,
802 if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
803 x_extra_libs="-lXext $x_extra_libs"
805 AC_DEFINE(HAVE_SHAPE_EXT),
809 # Check for XConvertCase (X11R6 specific)
811 AC_CHECK_LIB(X11, XConvertCase,
812 AC_DEFINE(HAVE_XCONVERTCASE),
816 # Check for XIM support.
818 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
820 enable_xim_inst="no",
823 # On Solaris, calling XRegisterIMInstantiateCallback seems to
824 # cause an immediate segfault, so we disable it, unless
825 # the user specifically forces it to be on.
827 if test x$enable_xim_inst = xmaybe ; then
833 enable_xim_inst="yes"
838 if test "x$enable_xim" = "xyes"; then
839 GTK_XIM_FLAGS="-DUSE_XIM"
840 if test "x$enable_xim_inst" = "xyes"; then
841 AC_DEFINE(USE_X11R6_XIM)
845 # Check for XKB support.
847 if test "x$enable_xkb" = "xyes"; then
848 AC_MSG_WARN(XKB support explicitly enabled)
850 elif test "x$enable_xkb" = "xmaybe"; then
851 AC_CHECK_LIB(X11, XkbQueryExtension,
856 AC_MSG_WARN(XKB support explicitly disabled)
860 x_ldflags="$X_LDFLAGS"
862 # set up things for XInput
864 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
865 AC_DEFINE(XINPUT_GXI)
867 x_extra_libs="-lXi $x_extra_libs"
868 elif test "x$with_xinput" = "xxfree"; then
869 AC_DEFINE(XINPUT_XFREE)
870 x_extra_libs="-lXi $x_extra_libs"
872 AC_DEFINE(XINPUT_NONE)
875 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
876 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
878 if test "x$enable_shm" = "xyes"; then
879 # Check for shared memory
880 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
881 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
883 # Check for the X shared memory extension header file
885 AC_MSG_CHECKING(X11/extensions/XShm.h)
886 if test "x$no_xext_lib" = "xyes"; then
889 gtk_save_CFLAGS="$CFLAGS"
890 CFLAGS="$CFLAGS $x_cflags"
893 #include <sys/types.h>
896 #include <X11/Xlib.h>
897 #include <X11/Xutil.h>
898 #include <X11/extensions/XShm.h>
899 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
900 CFLAGS="$gtk_save_CFLAGS"
902 AC_MSG_RESULT($have_xshm)
903 if test $have_xshm = yes ; then
904 AC_DEFINE(HAVE_XSHM_H)
909 GDK_EXTRA_LIBS="$x_extra_libs"
911 AM_CONDITIONAL(USE_X11, true)
913 AM_CONDITIONAL(USE_X11, false)
916 if test "x$gdktarget" = "xwin32"; then
917 # We start off with the libraries from Pango
919 ## be sure we also have Pango built with win32 support
920 PANGO_PACKAGES="pangowin32"
922 if test x$have_wintab = xyes; then
923 GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
924 AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
927 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
928 AM_CONDITIONAL(USE_WIN32, true)
930 AM_CONDITIONAL(USE_WIN32, false)
933 AC_SUBST(xinput_progs)
935 GDK_PIXBUF_XLIB_PACKAGES=
936 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
937 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
939 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
940 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
941 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
942 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
943 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
945 if test "x$gdktarget" = "xlinux-fb"; then
946 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
947 if test x$FREETYPE_CONFIG = xno ; then
948 AC_MSG_ERROR([*** freetype-config not found])
951 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
952 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
953 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
955 if test x$enable_shadowfb = xyes ; then
956 AC_DEFINE(ENABLE_SHADOW_FB)
959 if test x$enable_fbmanager = xyes ; then
960 AC_DEFINE(ENABLE_FB_MANAGER)
961 AM_CONDITIONAL(ENABLE_FB_MANAGER, true)
963 AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
966 GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
967 GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
969 AM_CONDITIONAL(USE_LINUX_FB, true)
971 AM_CONDITIONAL(USE_LINUX_FB, false)
972 AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
976 # Pick correct Pango packages to use
979 if test "x$gdktarget" = "xx11"; then
980 if $have_xft = true ; then
981 PANGO_PACKAGES="pangox pangoxft"
983 PANGO_PACKAGES=pangox
985 elif test "x$gdktarget" = "xwin32"; then
986 PANGO_PACKAGES=pangowin32
987 elif test "x$gdktarget" = "xlinux-fb"; then
988 PANGO_PACKAGES=pangoft2
993 # Check for Pango flags
995 AC_MSG_CHECKING(Pango flags)
996 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
997 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
998 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1000 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1003 *** Pango not found. Pango is required to build GTK+.
1004 *** See http://www.pango.org for Pango information.
1005 *** For the framebuffer target, you will need to build
1006 *** Pango with freetype support.
1010 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1012 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1015 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
1016 *** Can't link to Pango. Pango is required to build
1017 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
1020 CFLAGS="$saved_cflags"
1021 LDFLAGS="$saved_ldflags"
1023 GDK_PACKAGES=$PANGO_PACKAGES
1024 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1025 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1027 AC_SUBST(GDK_PACKAGES)
1028 AC_SUBST(GDK_EXTRA_LIBS)
1029 AC_SUBST(GDK_EXTRA_CFLAGS)
1030 AC_SUBST(GDK_DEP_LIBS)
1031 AC_SUBST(GDK_DEP_CFLAGS)
1034 ########################################
1035 # Check for Accessibility Toolkit flags
1036 ########################################
1039 AC_MSG_CHECKING(ATK flags)
1040 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1041 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1042 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1044 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1047 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1052 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1055 AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
1056 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1057 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
1063 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1064 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1066 AC_SUBST(GTK_PACKAGES)
1067 AC_SUBST(GTK_EXTRA_LIBS)
1068 AC_SUBST(GTK_EXTRA_CFLAGS)
1069 AC_SUBST(GTK_DEP_LIBS)
1070 AC_SUBST(GTK_DEP_CFLAGS)
1073 AC_SUBST(GTK_DEBUG_FLAGS)
1074 AC_SUBST(GTK_XIM_FLAGS)
1076 ##################################################
1077 # Checks for gtk-doc and docbook-tools
1078 ##################################################
1080 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
1082 if test "x$with_html_dir" = "x" ; then
1083 HTML_DIR='${datadir}/gtk-doc/html'
1085 HTML_DIR=$with_html_dir
1090 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1092 gtk_doc_min_version=0.6
1094 gtk_doc_version=`gtkdoc-mkdb --version`
1095 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
1096 if perl <<EOF ; then
1097 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
1098 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1107 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1108 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1110 dnl Let people disable the gtk-doc stuff.
1111 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1113 if test x$enable_gtk_doc = xauto ; then
1114 if test x$GTKDOC = xtrue ; then
1121 dnl NOTE: We need to use a separate automake conditional for this
1122 dnl to make this work with the tarballs.
1123 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1126 ##################################################
1128 ##################################################
1130 AC_OUTPUT_COMMANDS([
1132 ## Generate `gdk/gdkconfig.h' in two cases
1133 ## 1. `config.status' is run either explicitly, or via configure.
1134 ## Esp. not when it is run in `Makefile' to generate makefiles and
1136 ## 2. CONFIG_OTHER is set explicitly
1138 ## Case 1 is difficult. We know that `automake' sets one of
1139 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1140 ## only when AM_CONFIG_HEADER is set, however.
1142 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1143 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1144 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1146 case "$CONFIG_OTHER" in
1148 echo creating gdk/gdkconfig.h
1149 outfile=gdkconfig.h-tmp
1150 cat > $outfile <<\_______EOF
1153 * This is a generated file. Please modify `configure.in'
1161 #endif /* __cplusplus */
1165 cat >>$outfile <<_______EOF
1170 cat >>$outfile <<_______EOF
1174 #endif /* __cplusplus */
1176 #endif /* GDKCONFIG_H */
1180 if cmp -s $outfile gdk/gdkconfig.h; then
1181 echo gdk/gdkconfig.h is unchanged
1184 mv $outfile gdk/gdkconfig.h
1188 if test "x$gdktarget" = "xx11" ; then
1190 #define GDK_WINDOWING_X11'
1191 elif test "x$gdktarget" = "xwin32" ; then
1193 #define GDK_WINDOWING_WIN32'
1194 elif test "x$gdktarget" = "xlinux-fb" ; then
1196 #define GDK_WINDOWING_FB
1197 #define GDK_NATIVE_WINDOW_POINTER'
1200 if test x$gdk_wchar_h = xyes; then
1202 #define GDK_HAVE_WCHAR_H 1'
1204 if test x$gdk_wctype_h = xyes; then
1206 #define GDK_HAVE_WCTYPE_H 1"
1208 if test x$gdk_working_wctype = xno; then
1210 #define GDK_HAVE_BROKEN_WCTYPE 1"
1216 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1217 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1227 gdk-pixbuf-2.0-uninstalled.pc
1228 gdk-2.0-uninstalled.pc
1229 gtk+-2.0-uninstalled.pc
1233 build/win32/Makefile
1234 build/win32/dirent/Makefile
1236 demos/gtk-demo/Makefile
1239 docs/reference/Makefile
1240 docs/reference/gdk-pixbuf/Makefile
1241 docs/reference/gdk/Makefile
1242 docs/reference/gtk/Makefile
1244 docs/tutorial/Makefile
1246 gdk-pixbuf/makefile.mingw
1247 gdk-pixbuf/gdk-pixbuf-features.h
1248 gdk-pixbuf/pixops/Makefile
1249 gdk-pixbuf/pixops/makefile.mingw
1254 gdk/win32/makefile.mingw
1255 gdk/win32/rc/Makefile
1257 gdk/linux-fb/Makefile
1263 gtk/stock-icons/Makefile
1265 modules/input/Makefile
1267 contrib/gdk-pixbuf-xlib/Makefile
1268 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc