1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(gdk/gdktypes.h)
4 # In the following, there are a the following variants
5 # of GLib cflags and libs variables
7 # GLIB_CFLAGS: cflags for compiling libraries and example progs
8 # GLIB_LIBS: libraries for linking example programs
9 # GLIB_DEPLIBS: libraries for linking libraries against
12 ## We could have pkg-config uniquify the ldflags and cflags by calling
13 ## it once with both the GLib and Pango package names, but we don't,
14 ## someone should fix that.
17 # Save this value here, since automake will set cflags later
18 cflags_set=${CFLAGS+set}
20 dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
21 dnl are available for $ac_help expansion (don't we all *love* autoconf?)
22 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
25 # GTK_MICRO_VERSION += 1;
26 # GTK_INTERFACE_AGE += 1;
27 # GTK_BINARY_AGE += 1;
28 # if any functions have been added, set GTK_INTERFACE_AGE to 0.
29 # if backwards compatibility has been broken,
30 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
37 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
41 AC_SUBST(GTK_MAJOR_VERSION)
42 AC_SUBST(GTK_MINOR_VERSION)
43 AC_SUBST(GTK_MICRO_VERSION)
44 AC_SUBST(GTK_INTERFACE_AGE)
45 AC_SUBST(GTK_BINARY_AGE)
49 LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
50 LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
51 LT_REVISION=$GTK_INTERFACE_AGE
52 LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
59 # gdk-pixbuf gets versioned separately, and for now, using standard
60 # libtool versioning, not GTK+-style versioning
65 GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
66 AC_SUBST(GDK_PIXBUF_MAJOR)
67 AC_SUBST(GDK_PIXBUF_MINOR)
68 AC_SUBST(GDK_PIXBUF_MICRO)
69 AC_SUBST(GDK_PIXBUF_VERSION)
76 AC_SUBST(GETTEXT_PACKAGE)
77 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
79 # Save this value here, since automake will set cflags later
80 cflags_set=${CFLAGS+set}
82 dnl Initialize automake stuff
83 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
85 # Specify a configuration file
86 AM_CONFIG_HEADER(config.h)
88 dnl Initialize libtool
91 dnl Initialize maintainer mode
96 dnl figure debugging default, prior to $ac_help setup
98 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
99 if test `expr $GTK_MINOR_VERSION \% 2` = 1 ; then
102 debug_default=minimum
106 dnl declare --enable-* args and collect ac_help strings
107 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
108 AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
109 echo $enable_shm, enable_shm="yes")
110 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
112 AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
114 AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
115 , enable_xim_inst="maybe")
116 AC_ARG_ENABLE(xkb, [ --enable-xkb support XKB [default=maybe]],
117 , enable_xkb="maybe")
118 AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
119 AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
121 AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
124 gdktargetlib=libgdk-x11-1.3.la
125 gtktargetlib=libgtk-x11-1.3.la
126 AC_ARG_WITH(gdktarget, [ --with-gdktarget=[x11/nanox/linux-fb] select GDK target [default=x11] ],
127 gdktarget=$with_gdktarget)
131 x11|nanox|linux-fb) ;;
132 *) AC_MSG_ERROR([Invalid target for GDK: use x11, nanox or linux-fb.]);;
135 AC_ARG_ENABLE(shadowfb, [ --disable-shadowfb disable shadowfb support for linux-fb],,enable_shadowfb=yes)
137 if test "x$enable_debug" = "xyes"; then
138 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
139 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
141 if test "x$enable_debug" = "xno"; then
142 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
144 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
148 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
151 # Build time sanity check...
154 # Checks for programs.
162 if test "x$GCC" = "xyes"; then
164 *[\ \ ]-Wall[\ \ ]*) ;;
165 *) CFLAGS="$CFLAGS -Wall" ;;
168 if test "x$enable_ansi" = "xyes"; then
170 *[\ \ ]-ansi[\ \ ]*) ;;
171 *) CFLAGS="$CFLAGS -ansi" ;;
175 *[\ \ ]-pedantic[\ \ ]*) ;;
176 *) CFLAGS="$CFLAGS -pedantic" ;;
182 # Honor aclocal flags
183 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
185 # libtool option to control which symbols are exported
186 # right now, symbols starting with _ are not exported
187 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
188 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
190 # define a MAINT-like variable REBUILD which is set if Perl
191 # and awk are found, so autogenerated sources can be rebuilt
194 AC_CHECK_PROGS(PERL, perl5 perl)
196 # We would like indent, but don't require it.
197 AC_CHECK_PROG(INDENT, indent, indent)
200 if test "x$enable_rebuilds" = "xyes" && \
202 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
203 test -n "$AWK" ; then
208 AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
210 AC_MSG_CHECKING(whether make is GNU Make)
213 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
214 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
221 AC_SUBST(STRIP_DUMMY)
222 AC_SUBST(STRIP_BEGIN)
226 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"
228 LIBS="$LIBS $INTLLIBS"
230 # AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
231 # this is the directory where the *.{mo,gmo} files are installed
232 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
233 AC_SUBST(gtklocaledir)
235 dnl The DU4 header files don't provide library prototypes unless
236 dnl -std1 is given to the native cc.
237 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
241 AC_TRY_RUN([#include <math.h>
242 int main (void) { return (log(1) != log(1.)); }],
243 AC_MSG_RESULT(none needed),
244 gtk_save_CFLAGS="$CFLAGS"
245 CFLAGS="$CFLAGS -std1"
246 AC_TRY_RUN([#include <math.h>
247 int main (void) { return (log(1) != log(1.)); }],
248 AC_MSG_RESULT(-std1),
250 CFLAGS="$gtk_save_CFLAGS"
252 [No ANSI prototypes found in library. (-std1 didn't work.)]),
255 AC_MSG_RESULT(none needed)
261 AC_MSG_CHECKING(for the BeOS)
265 GTK_LIBS_EXTRA="-L\$(top_builddir_full)/gdk/.libs -lgdk"
273 AC_SUBST(GTK_LIBS_EXTRA)
275 dnl NeXTStep cc seems to need this
276 AC_MSG_CHECKING([for extra flags for POSIX compliance])
277 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
278 AC_MSG_RESULT(none needed),
279 gtk_save_CFLAGS="$CFLAGS"
280 CFLAGS="$CFLAGS -posix"
281 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
282 AC_MSG_RESULT(-posix),
284 CFLAGS="$gtk_save_CFLAGS"
285 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
288 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
291 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
292 GLIB_REQUIRED_VERSION=1.3.4
294 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
296 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
297 *** GLIB is always available from ftp://ftp.gtk.org/.]),
298 gobject gmodule gthread)
300 dnl Call pkg-config again since we don't want -lgthread here
301 GLIB_LIBS=`$PKG_CONFIG --libs $GLIB_PACKAGES`
302 GLIB_DEPLIBS=$GLIB_LIBS
304 CFLAGS="$CFLAGS $GLIB_CFLAGS"
305 AC_SUBST(GLIB_CFLAGS)
307 AC_SUBST(GLIB_DEPLIBS)
309 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
310 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
311 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
312 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
314 saved_cflags="$CFLAGS"
315 saved_ldflags="$LDFLAGS"
317 if test "x$gdktarget" = "xx11"; then
318 # Find the X11 include and library directories
322 if test "x$x_includes" = "x"; then
323 x_includes="/usr/include"
326 CFLAGS="$CFLAGS $X_CFLAGS"
327 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
329 if test "x$no_x" = "xyes"; then
331 *** X libraries or include files not found. Check 'config.log' for
335 # Checks for libraries.
336 # Check for the X11 library
337 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS",
338 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
341 if test "x$enable_shm" = "xyes"; then
342 # Check for the Xext library (needed for XShm extention)
343 AC_CHECK_LIB(Xext, XShmAttach,
344 x_libs="-lXext $x_libs",
345 # On AIX, it is in XextSam instead, but we still need -lXext
346 AC_CHECK_LIB(XextSam, XShmAttach,
347 x_libs="-lXextSam -lXext $x_libs",
348 no_xext_lib=yes, $x_libs),
352 # Check for shaped window extension
354 AC_CHECK_LIB(Xext, XShapeCombineMask,
355 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
356 x_libs="-lXext $x_libs"
358 AC_DEFINE(HAVE_SHAPE_EXT),
362 # Check for XConvertCase (X11R6 specific)
364 AC_CHECK_LIB(X11, XConvertCase,
365 AC_DEFINE(HAVE_XCONVERTCASE),
370 # Checks for FreeType
375 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
376 if test "x$FREETYPE_CONFIG" != "xno" ; then
377 FREETYPE_CFLAGS=`freetype-config --cflags`
378 FREETYPE_LIBS=`freetype-config --libs`
380 AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
383 AC_SUBST(FREETYPE_CFLAGS)
386 # Checks for Xft/XRender
391 if test $have_freetype = true ; then
392 AC_CHECK_LIB(Xrender, XRenderFindFormat,
393 AC_CHECK_LIB(Xft, XftFontOpen, have_xft=true, :, -lXrender -lXext $X_LIBS $FREETYPE_LIBS)
396 ## be sure we also have Pango built with xft support
397 if ! $PKG_CONFIG --exists pangoxft ; then
399 AC_MSG_WARN([X render extension found, but Pango lacks Xft support])
402 if $have_xft = 'true' ; then
403 X_LIBS="-lXft -lXrender -lXext $FREETYPE_LIBS $X_LIBS"
409 AM_CONDITIONAL(HAVE_XFT, $have_xft)
411 # Check for XIM support.
413 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
415 enable_xim_inst="no",
418 # On Solaris, calling XRegisterIMInstantiateCallback seems to
419 # cause an immediate segfault, so we disable it, unless
420 # the user specifically forces it to be on.
422 if test x$enable_xim_inst = xmaybe ; then
428 enable_xim_inst="yes"
433 if test "x$enable_xim" = "xyes"; then
434 GTK_XIM_FLAGS="-DUSE_XIM"
435 if test "x$enable_xim_inst" = "xyes"; then
436 AC_DEFINE(USE_X11R6_XIM)
440 # Check for XKB support.
442 if test "x$enable_xkb" = "xyes"; then
443 AC_MSG_WARN(XKB support explicitly enabled)
445 elif test "x$enable_xkb" = "xmaybe"; then
446 AC_CHECK_LIB(X11, XkbQueryExtension,
451 AC_MSG_WARN(XKB support explicitly disabled)
455 x_ldflags="$X_LDFLAGS $X_LIBS"
457 # set up things for XInput
459 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
460 AC_DEFINE(XINPUT_GXI)
462 x_libs="-lXi $x_libs"
463 elif test "x$with_xinput" = "xxfree"; then
464 AC_DEFINE(XINPUT_XFREE)
465 x_libs="-lXi $x_libs"
467 AC_DEFINE(XINPUT_NONE)
470 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
471 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
473 if test "x$enable_shm" = "xyes"; then
474 # Check for shared memory
475 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
476 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
478 # Check for the X shared memory extension header file
479 AC_MSG_CHECKING(X11/extensions/XShm.h)
480 if test "x$no_xext_lib" = "xyes"; then
484 if test -f "$x_includes/X11/extensions/XShm.h"; then
486 AC_DEFINE(HAVE_XSHM_H)
494 more_cflags="$x_cflags"
495 more_ldflags="$x_ldflags"
497 more_includes="$x_includes"
499 # these are already defined above
500 #gdktargetlib = "libgdk-x11-1.3.la"
501 #gtktargetlib = "libgtk-x11-1.3.la"
503 AM_CONDITIONAL(USE_X11, true)
505 AM_CONDITIONAL(USE_X11, false)
508 if test "x$gdktarget" = "xnanox"; then
509 AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
510 # nano-X may require additional libraries
516 gdktargetlib="libgdk-nanox-1.3.la"
517 gtktargetlib="libgtk-nanox-1.3.la"
520 AC_DEFINE(XINPUT_NONE)
526 AM_CONDITIONAL(USE_NANOX, true)
528 AM_CONDITIONAL(USE_NANOX, false)
531 if test "x$gdktarget" = "xlinux-fb"; then
537 gdktargetlib="libgdk-linux-fb-1.3.la"
538 gtktargetlib="libgtk-linux-fb-1.3.la"
541 AC_DEFINE(XINPUT_NONE)
548 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
549 if test x$FREETYPE_CONFIG = xno ; then
550 AC_MSG_ERROR([*** freetype-config not found])
553 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
554 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
555 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
557 if test x$enable_shadowfb = xyes ; then
558 AC_DEFINE(ENABLE_SHADOW_FB)
561 AM_CONDITIONAL(USE_LINUX_FB, true)
563 AM_CONDITIONAL(USE_LINUX_FB, false)
565 AC_SUBST(ENABLE_SHADOW_FB)
566 AC_SUBST(FREETYPE_LIBS)
567 AC_SUBST(FREETYPE_CFLAGS)
570 # Pick correct Pango packages to use
573 if test "x$gdktarget" = "xx11"; then
574 if $have_xft = true ; then
575 PANGO_PACKAGES="pangox pangoxft"
577 PANGO_PACKAGES=pangox
579 elif test "x$gdktarget" = "xlinux-fb"; then
580 PANGO_PACKAGES=pangoft2
585 AC_SUBST(PANGO_PACKAGES)
587 # Check for Pango flags
589 AC_MSG_CHECKING(Pango flags)
590 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
591 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
592 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
594 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
597 *** Pango not found. Pango is required to build GTK+.
598 *** See http://www.pango.org for Pango information.
599 *** For the framebuffer target, you will need to build
600 *** Pango with freetype support.
604 CFLAGS="$CFLAGS $PANGO_CFLAGS"
606 AC_SUBST(PANGO_CFLAGS)
608 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
609 *** Can't link to Pango. Pango is required to build
610 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS $x_ldflags $x_libs)
612 CFLAGS="$saved_cflags"
613 LDFLAGS="$saved_ldflags"
619 AC_SUBST(xinput_progs)
621 AC_SUBST(more_cflags)
622 AC_SUBST(more_includes)
623 AC_SUBST(more_ldflags)
625 AC_SUBST(gdktargetlib)
626 AC_SUBST(gtktargetlib)
629 # Check if X_LOCALE definition is necessary
631 AC_MSG_CHECKING(need -DX_LOCALE)
640 return setlocale (LC_ALL, "${with_locale}") == NULL;
645 AC_MSG_RESULT($need_x_locale)
647 if test $need_x_locale = yes; then
648 GTK_LOCALE_FLAGS="-DX_LOCALE"
651 # Checks for header files.
654 # Checks for typedefs, structures, and compiler characteristics.
657 # Checks for library functions.
661 AC_CHECK_FUNCS(getresuid)
664 # Check if <sys/select.h> needs to be included for fd_set
665 AC_MSG_CHECKING([for fd_set])
666 AC_TRY_COMPILE([#include <sys/types.h>],
667 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
668 if test $gtk_ok = yes; then
669 AC_MSG_RESULT([yes, found in sys/types.h])
671 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
672 if test $gtk_ok = yes; then
673 AC_DEFINE(HAVE_SYS_SELECT_H)
674 AC_MSG_RESULT([yes, found in sys/select.h])
681 # `widechar' tests for gdki18n.h
682 AC_MSG_CHECKING(for wchar.h)
683 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
684 if test $gdk_wchar_h = yes; then
685 AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
687 AC_MSG_RESULT($gdk_wchar_h)
689 # Check for wctype.h (for iswalnum)
690 AC_MSG_CHECKING(for wctype.h)
691 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
692 if test $gdk_wctype_h = yes; then
693 AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
695 AC_MSG_RESULT($gdk_wctype_h)
697 # in Solaris 2.5, `iswalnum' is in -lw
699 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
702 LIBS="$LIBS $GDK_WLIBS"
703 # The following is necessary for Linux libc-5.4.38
704 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
705 AC_TRY_LINK([#include <stdlib.h>],[
706 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
707 # ifdef HAVE_WCTYPE_H
715 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
717 iswalnum((wchar_t) 0);
718 ], gdk_working_wctype=yes, gdk_working_wctype=no)
721 if test $gdk_working_wctype = no; then
722 AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
725 AC_MSG_RESULT($gdk_working_wctype)
728 AC_SUBST(GTK_DEBUG_FLAGS)
729 AC_SUBST(GTK_XIM_FLAGS)
730 AC_SUBST(GTK_LOCALE_FLAGS)
732 ##################################################
733 # Checks for gdk-pixbuf
734 ##################################################
736 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
738 AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[
739 if test x$withval = xyes; then
748 if test x$with_modules = xno; then
752 AC_MSG_CHECKING(whether dynamic modules work)
755 CFLAGS="$GLIB_CFLAGS"
762 if (g_module_supported ())
772 dnl Now we check to see if our libtool supports shared lib deps
773 dnl (in a rather ugly way even)
775 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
776 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
777 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
778 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
779 if test "x$pixbuf_deplibs_check" = "xnone" || \
780 test "x$pixbuf_deplibs_check" = "xunknown" || \
781 test "x$pixbuf_deplibs_check" = "x"; then
787 AC_DEFINE(USE_GMODULE)
794 if test -z "$LIBTIFF"; then
795 AC_CHECK_LIB(tiff, TIFFReadScanline,
796 AC_CHECK_HEADER(tiffio.h,
797 TIFF='tiff'; LIBTIFF='-ltiff',
798 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
799 AC_CHECK_LIB(tiff, TIFFWriteScanline,
800 AC_CHECK_HEADER(tiffio.h,
801 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
802 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
803 AC_CHECK_LIB(tiff34, TIFFFlushData,
804 AC_CHECK_HEADER(tiffio.h,
805 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
806 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
807 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
811 if test -z "$LIBJPEG"; then
812 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
815 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
816 if test "$jpeg_ok" = yes; then
817 AC_MSG_CHECKING([for jpeglib.h])
822 #include <jpeglib.h>],
825 AC_MSG_RESULT($jpeg_ok)
826 if test "$jpeg_ok" = yes; then
828 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
829 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
830 AC_MSG_WARN(JPEG library does not support progressive saving.))
832 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
838 if test -z "$LIBPNG"; then
839 AC_CHECK_LIB(png, png_read_info,
840 AC_CHECK_HEADER(png.h,
843 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
844 if test "$png_ok" = yes; then
845 AC_MSG_CHECKING([for png_structp in png.h])
846 AC_TRY_COMPILE([#include <png.h>],
847 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
850 AC_MSG_RESULT($png_ok)
851 if test "$png_ok" = yes; then
852 PNG='png'; LIBPNG='-lpng -lz'
854 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
857 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
861 deps="$LIBTIFF $LIBJPEG $LIBPNG"
867 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
870 # Allow building some or all gdk-pixbuf loaders included
872 AC_MSG_CHECKING(pixbuf loaders to build)
874 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
876 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm"
878 # If no loaders specified, include all
879 if test "x$with_included_loaders" = xyes ; then
880 included_loaders="$all_loaders"
882 included_loaders="$with_included_loaders"
885 AC_MSG_RESULT($included_loaders)
888 INCLUDED_LOADER_DEFINE=
890 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
891 for loader in $included_loaders; do
892 if ! echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
893 AC_MSG_ERROR([the specified loader $loader does not exist])
896 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
897 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
900 AC_SUBST(INCLUDED_LOADER_OBJ)
901 AC_SUBST(INCLUDED_LOADER_DEFINE)
909 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
910 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
911 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
913 GDK_PIXBUF_LIBDIR='-L${libdir}'
914 GDK_PIXBUF_INCLUDEDIR="-I${includedir} $GTK_CFLAGS"
915 GDK_PIXBUF_LIBS="$GLIB_LIBS -lgdk_pixbuf $deps $GTK_LIBS"
916 AC_SUBST(STATIC_LIB_DEPS)
917 STATIC_LIB_DEPS="$deps"
919 AC_SUBST(GDK_PIXBUF_LIBDIR)
920 AC_SUBST(GDK_PIXBUF_INCLUDEDIR)
921 AC_SUBST(GDK_PIXBUF_LIBS)
923 GDK_PIXBUF_XLIB_LIBDIR=$GDK_PIXBUF_LIBDIR
924 GDK_PIXBUF_XLIB_INCLUDEDIR=$GDK_PIXBUF_INCLUDEDIR
925 GDK_PIXBUF_XLIB_LIBS="$GLIB_LIBS -lgdk_pixbuf_xlib $deps $X11_LIBS"
927 AC_SUBST(GDK_PIXBUF_XLIB_LIBDIR)
928 AC_SUBST(GDK_PIXBUF_XLIB_INCLUDEDIR)
929 AC_SUBST(GDK_PIXBUF_XLIB_LIBS)
931 # Checks to see if we should compile in MMX support (there will be
932 # a runtime test when the code is actually run to see if it should
933 # be used - this just checks if we can compile it.)
935 # This code is partially taken from Mesa
937 AC_MSG_CHECKING(for x86 platform)
939 i386|i486|i586|i686|i786|k6|k7)
945 AC_MSG_RESULT($use_x86_asm)
948 if test $use_x86_asm = yes; then
952 AC_MSG_CHECKING(compiler support for MMX)
953 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
954 if AC_TRY_EVAL(ac_compile); then
961 if test $use_mmx_asm = yes; then
969 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
972 ##################################################
973 # Checks for gtk-doc and docbook-tools
974 ##################################################
976 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
978 if test "x$with_html_dir" = "x" ; then
979 HTML_DIR='${datadir}/gtk-doc/html'
981 HTML_DIR=$with_html_dir
986 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
988 gtk_doc_min_version=0.6
990 gtk_doc_version=`gtkdoc-mkdb --version`
991 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
993 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
994 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1003 AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
1004 AC_SUBST(HAVE_GTK_DOC)
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)
1024 GDK_PIXBUF_DIR=`(cd $srcdir; pwd)`
1025 AC_SUBST(GDK_PIXBUF_DIR)
1028 ##################################################
1030 ##################################################
1032 AC_OUTPUT_COMMANDS([
1034 ## Generate `gdk/gdkconfig.h' in two cases
1035 ## 1. `config.status' is run either explicitly, or via configure.
1036 ## Esp. not when it is run in `Makefile' to generate makefiles and
1038 ## 2. CONFIG_OTHER is set explicitly
1040 ## Case 1 is difficult. We know that `automake' sets one of
1041 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1042 ## only when AM_CONFIG_HEADER is set, however.
1044 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1045 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1046 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1048 case "$CONFIG_OTHER" in
1050 echo creating gdk/gdkconfig.h
1051 outfile=gdkconfig.h-tmp
1052 cat > $outfile <<\_______EOF
1055 * This is a generated file. Please modify `configure.in'
1063 #endif /* __cplusplus */
1067 cat >>$outfile <<_______EOF
1072 cat >>$outfile <<_______EOF
1076 #endif /* __cplusplus */
1078 #endif /* GDKCONFIG_H */
1082 if cmp -s $outfile gdk/gdkconfig.h; then
1083 echo gdk/gdkconfig.h is unchanged
1086 mv $outfile gdk/gdkconfig.h
1090 if test "x$gdktarget" = "xx11" ; then
1092 #define GDK_WINDOWING_X11'
1093 elif test "x$gdktarget" = "xnanox" ; then
1095 #define GDK_WINDOWING_NANOX'
1096 elif test "x$gdktarget" = "xlinux-fb" ; then
1098 #define GDK_WINDOWING_FB
1099 #define GDK_NATIVE_WINDOW_POINTER'
1102 if test x$gdk_wchar_h = xyes; then
1104 #define GDK_HAVE_WCHAR_H 1'
1106 if test x$gdk_wctype_h = xyes; then
1108 #define GDK_HAVE_WCTYPE_H 1"
1110 if test x$gdk_working_wctype = xno; then
1112 #define GDK_HAVE_BROKEN_WCTYPE 1"
1118 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1119 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1131 build/win32/Makefile
1133 demos/gtk-demo/Makefile
1136 docs/reference/Makefile
1137 docs/reference/gdk-pixbuf/Makefile
1138 docs/reference/gdk/Makefile
1139 docs/reference/gtk/Makefile
1141 docs/tutorial/Makefile
1143 gdk-pixbuf/makefile.mingw
1144 gdk-pixbuf/gdk-pixbuf-features.h
1145 gdk-pixbuf/pixops/Makefile
1146 gdk-pixbuf/pixops/makefile.mingw
1151 gdk/win32/makefile.mingw
1152 gdk/win32/rc/Makefile
1155 gdk/linux-fb/Makefile
1161 gtk/stock-icons/Makefile
1163 modules/input/Makefile
1165 contrib/gdk-pixbuf-xlib/Makefile
1166 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc