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.13
84 PANGO_REQUIRED_VERSION=0.24
85 ATK_REQUIRED_VERSION=0.8
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])
176 AC_ARG_WITH(ie55, [ --with-ie55=DIRECTORY IE5.5 libs and headers (for Active IMM)])
178 GLIB_AC_DIVERT_BEFORE_HELP([
179 if test "$platform_win32" = yes; then
186 AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/linux-fb/win32]] select GDK target [default=$gdktarget]],
187 gdktarget=$with_gdktarget)
191 x11|linux-fb|win32) ;;
192 *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
195 gdktargetlib=libgdk-$gdktarget-1.3.la
196 gtktargetlib=libgtk-$gdktarget-1.3.la
198 AC_SUBST(gdktargetlib)
199 AC_SUBST(gtktargetlib)
201 AC_ARG_ENABLE(shadowfb, [ --disable-shadowfb disable shadowfb support for linux-fb],,enable_shadowfb=yes)
203 AC_ARG_ENABLE(fbmanager, [ --enable-fbmanager enable framebuffer manager support (GtkFB)],enable_fbmanager=yes,enable_fbmanager=no)
205 if test "x$enable_debug" = "xyes"; then
206 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
207 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
209 if test "x$enable_debug" = "xno"; then
210 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
212 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
216 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
219 # Build time sanity check...
222 # Checks for programs.
229 if test "x$GCC" = "xyes"; then
231 *[\ \ ]-Wall[\ \ ]*) ;;
232 *) CFLAGS="$CFLAGS -Wall" ;;
235 if test "x$enable_ansi" = "xyes"; then
237 *[\ \ ]-ansi[\ \ ]*) ;;
238 *) CFLAGS="$CFLAGS -ansi" ;;
242 *[\ \ ]-pedantic[\ \ ]*) ;;
243 *) CFLAGS="$CFLAGS -pedantic" ;;
247 if test "$os_win32" = "yes"; then
248 case "$CC $CFLAGS " in
249 *[[\ \ ]]-fnative-struct[[\ \ ]]*) ;;
250 *) CFLAGS="$CFLAGS -fnative-struct" ;;
256 # Honor aclocal flags
257 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
259 ## Initial sanity check, done here so that users get told they
260 ## have the wrong dependencies as early in the process as possible.
261 ## Later on we actually use the cflags/libs from separate pkg-config
262 ## calls. Oh, also the later pkg-config calls don't include
263 ## the version requirements since those make the module lists
264 ## annoying to construct
265 PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION atk >= $ATK_REQUIRED_VERSION pango >= $PANGO_REQUIRED_VERSION)
267 if test "$os_win32" != yes; then
268 # libtool option to control which symbols are exported
269 # right now, symbols starting with _ are not exported
270 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
272 # We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
273 LIBTOOL_EXPORT_OPTIONS=
275 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
277 # define a MAINT-like variable REBUILD which is set if Perl
278 # and awk are found, so autogenerated sources can be rebuilt
281 AC_CHECK_PROGS(PERL, perl5 perl)
283 # We would like indent, but don't require it.
284 AC_CHECK_PROG(INDENT, indent, indent)
287 if test "x$enable_rebuilds" = "xyes" && \
289 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
290 test -n "$AWK" ; then
295 AC_CHECK_FUNCS(lstat mkstemp bind_textdomain_codeset)
297 # sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
298 AC_MSG_CHECKING(for sigsetjmp)
299 AC_TRY_LINK([#include <setjmp.h>], [
302 ], gtk_ok=yes, gtk_ok=no)
303 AC_MSG_RESULT($gtk_ok)
304 if test "$gtk_ok" = "yes"; then
305 AC_DEFINE(HAVE_SIGSETJMP)
308 AC_MSG_CHECKING(whether make is GNU Make)
311 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
312 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
319 AC_SUBST(STRIP_DUMMY)
320 AC_SUBST(STRIP_BEGIN)
324 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 ms nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
326 LIBS="$LIBS $INTLLIBS"
328 # AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
329 # this is the directory where the *.{mo,gmo} files are installed
330 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
331 AC_SUBST(gtklocaledir)
333 dnl The DU4 header files don't provide library prototypes unless
334 dnl -std1 is given to the native cc.
335 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
339 AC_TRY_RUN([#include <math.h>
340 int main (void) { return (log(1) != log(1.)); }],
341 AC_MSG_RESULT(none needed),
342 gtk_save_CFLAGS="$CFLAGS"
343 CFLAGS="$CFLAGS -std1"
344 AC_TRY_RUN([#include <math.h>
345 int main (void) { return (log(1) != log(1.)); }],
346 AC_MSG_RESULT(-std1),
348 CFLAGS="$gtk_save_CFLAGS"
350 [No ANSI prototypes found in library. (-std1 didn't work.)]),
353 AC_MSG_RESULT(none needed)
358 AC_MSG_CHECKING(for the BeOS)
369 dnl NeXTStep cc seems to need this
370 AC_MSG_CHECKING([for extra flags for POSIX compliance])
371 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
372 AC_MSG_RESULT(none needed),
373 gtk_save_CFLAGS="$CFLAGS"
374 CFLAGS="$CFLAGS -posix"
375 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
376 AC_MSG_RESULT(-posix),
378 CFLAGS="$gtk_save_CFLAGS"
379 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
382 # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
385 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
387 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
389 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
390 *** GLIB is always available from ftp://ftp.gtk.org/.]),
391 gobject gmodule gthread)
393 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
394 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
395 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
396 AC_CHECK_HEADERS(winsock.h, AC_DEFINE(HAVE_WINSOCK_H))
398 if test "${with_ie55+set}" = set && test $with_ie55 != no; then
399 AC_MSG_CHECKING([for dimm.h])
400 saved_CFLAGS="$CFLAGS"
401 CFLAGS="$CFLAGS -idirafter $with_ie55/Include"
402 AC_TRY_COMPILE([#include <windows.h>
405 /* The w32api imm.h clashes a bit with the IE5.5 dimm.h */
406 #define IMEMENUITEMINFOA hidden_IMEMENUITEMINFOA
407 #define IMEMENUITEMINFOW hidden_IMEMENUITEMINFOW
409 #undef IMEMENUITEMINFOA
410 #undef IMEMENUITEMINFOW
416 AC_MSG_CHECKING([for IE55 uuid.lib])
417 if test -f $with_ie55/Lib/uuid.lib ; then
420 AC_DEFINE(HAVE_DIMM_H)
421 IE55_UUID_LIB="$with_ie55/Lib/uuid.lib"
422 AC_SUBST(IE55_UUID_LIB)
425 CFLAGS="$saved_CFLAGS"
430 CFLAGS="$saved_CFLAGS"
433 AM_CONDITIONAL(HAVE_IE55, test x$have_ie55 = xyes)
435 if test "${with_wintab+set}" = set && test $with_wintab != no; then
436 AC_MSG_CHECKING([for wintab.h])
437 saved_CFLAGS="$CFLAGS"
438 CFLAGS="$CFLAGS -I$with_wintab/include"
439 AC_TRY_COMPILE([#include <windows.h>
440 #include <wintab.h>],
443 AC_MSG_CHECKING([for wntab32x.lib])
444 if test -f $with_wintab/lib/i386/wntab32x.lib ; then
447 AC_DEFINE(HAVE_WINTAB)
448 WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
452 CFLAGS="$saved_cflags"
457 CFLAGS="$saved_cflags"
460 AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
462 saved_cflags="$CFLAGS"
463 saved_ldflags="$LDFLAGS"
466 # Checks for header files.
469 # Checks for typedefs, structures, and compiler characteristics.
472 # Checks for library functions.
476 AC_CHECK_FUNCS(getresuid)
479 # Check if <sys/select.h> needs to be included for fd_set
480 AC_MSG_CHECKING([for fd_set])
481 AC_TRY_COMPILE([#include <sys/types.h>],
482 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
483 if test $gtk_ok = yes; then
484 AC_MSG_RESULT([yes, found in sys/types.h])
486 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
487 if test $gtk_ok = yes; then
488 AC_DEFINE(HAVE_SYS_SELECT_H)
489 AC_MSG_RESULT([yes, found in sys/select.h])
496 # `widechar' tests for gdki18n.h
497 AC_MSG_CHECKING(for wchar.h)
498 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
499 if test $gdk_wchar_h = yes; then
500 AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
502 AC_MSG_RESULT($gdk_wchar_h)
504 # Check for wctype.h (for iswalnum)
505 AC_MSG_CHECKING(for wctype.h)
506 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
507 if test $gdk_wctype_h = yes; then
508 AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
510 AC_MSG_RESULT($gdk_wctype_h)
512 # in Solaris 2.5, `iswalnum' is in -lw
514 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
517 LIBS="$LIBS $GDK_WLIBS"
518 # The following is necessary for Linux libc-5.4.38
519 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
520 AC_TRY_LINK([#include <stdlib.h>],[
521 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
522 # ifdef HAVE_WCTYPE_H
530 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
532 iswalnum((wchar_t) 0);
533 ], gdk_working_wctype=yes, gdk_working_wctype=no)
536 if test $gdk_working_wctype = no; then
537 AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
540 AC_MSG_RESULT($gdk_working_wctype)
545 ##################################################
546 # Checks for gdk-pixbuf
547 ##################################################
549 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
551 AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[
552 if test x$withval = xyes; then
561 if test x$with_modules = xno; then
565 AC_MSG_CHECKING(whether dynamic modules work)
566 ## for loop is to strip newline
567 tmp=`pkg-config --variable=gmodule_supported gmodule-2.0`
573 dnl Now we check to see if our libtool supports shared lib deps
574 dnl (in a rather ugly way even)
576 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
577 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
578 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
579 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
580 if test "x$pixbuf_deplibs_check" = "xnone" || \
581 test "x$pixbuf_deplibs_check" = "xunknown" || \
582 test "x$pixbuf_deplibs_check" = "x"; then
588 AC_DEFINE(USE_GMODULE)
594 dnl We allow people to disable image loaders explicitely, but if they don't we error
595 dnl out so that people don't accidentally build without them.
597 AC_ARG_WITH(libpng, [ --without-libpng Disable PNG loader for gdk-pixbuf])
598 AC_ARG_WITH(libjpeg, [ --without-libjpeg Disable JPEG loader for gdk-pixbuf])
599 AC_ARG_WITH(libtiff, [ --without-libtiff Disable TIFF loader for gdk-pixbuf])
602 if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
603 AC_CHECK_LIB(tiff, TIFFReadScanline,
604 [AC_CHECK_HEADER(tiffio.h,
605 TIFF='tiff'; LIBTIFF='-ltiff',
606 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
607 [AC_CHECK_LIB(tiff, TIFFWriteScanline,
608 [AC_CHECK_HEADER(tiffio.h,
609 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
610 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
611 [AC_CHECK_LIB(tiff34, TIFFFlushData,
612 [AC_CHECK_HEADER(tiffio.h,
613 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
614 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***))],
615 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
618 if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
620 *** Checks for TIFF loader failed. You can build without it by passing
621 *** --without-libtiff to configure but some programs using GTK+ may
622 *** not work properly])
626 if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
627 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
630 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
631 if test "$jpeg_ok" = yes; then
632 AC_MSG_CHECKING([for jpeglib.h])
638 #include <jpeglib.h>],
641 AC_MSG_RESULT($jpeg_ok)
642 if test "$jpeg_ok" = yes; then
644 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
645 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
646 AC_MSG_WARN(JPEG library does not support progressive saving.))
648 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
653 if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
655 *** Checks for JPEG loader failed. You can build without it by passing
656 *** --without-libjpeg to configure but some programs using GTK+ may
657 *** not work properly])
661 if test x$with_libpng != xno && test -z "$LIBPNG"; then
662 AC_CHECK_LIB(png, png_read_info,
663 [AC_CHECK_HEADER(png.h,
666 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
667 if test "$png_ok" = yes; then
668 AC_MSG_CHECKING([for png_structp in png.h])
669 AC_TRY_COMPILE([#include <png.h>],
670 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
673 AC_MSG_RESULT($png_ok)
674 if test "$png_ok" = yes; then
675 PNG='png'; LIBPNG='-lpng -lz'
677 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
680 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
684 if test x$with_libpng != xno && test -z "$LIBPNG"; then
686 *** Checks for PNG loader failed. You can build without it by passing
687 *** --without-libpng to configure but many programs using GTK+ will
688 *** not work properly. The PNG loader is also needed if you are compiling
696 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
699 # Allow building some or all gdk-pixbuf loaders included
701 AC_MSG_CHECKING(pixbuf loaders to build)
703 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
708 ## if the option was specified, leave it; otherwise disable included loaders
709 if test x$with_included_loaders = xno; then
710 with_included_loaders=yes
714 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
716 # If no loaders specified, include all
717 if test "x$with_included_loaders" = xyes ; then
718 included_loaders="$all_loaders"
720 included_loaders="$with_included_loaders"
723 AC_MSG_RESULT($included_loaders)
726 INCLUDED_LOADER_DEFINE=
728 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
729 for loader in $included_loaders; do
730 if echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
733 AC_MSG_ERROR([the specified loader $loader does not exist])
736 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
737 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
740 AC_SUBST(INCLUDED_LOADER_OBJ)
741 AC_SUBST(INCLUDED_LOADER_DEFINE)
747 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
748 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
749 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
753 if echo "$included_loaders" | grep "\(^\|\,\)tiff\(\$\|\,\)" > /dev/null; then
754 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBTIFF"
756 if echo "$included_loaders" | grep "\(^\|\,\)jpeg\(\$\|\,\)" > /dev/null; then
757 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJPEG"
759 if echo "$included_loaders" | grep "\(^\|\,\)png\(\$\|\,\)" > /dev/null; then
760 STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
763 STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
766 # Checks to see if we should compile in MMX support (there will be
767 # a runtime test when the code is actually run to see if it should
768 # be used - this just checks if we can compile it.)
770 # This code is partially taken from Mesa
772 AC_MSG_CHECKING(for x86 platform)
774 i386|i486|i586|i686|i786|k6|k7)
780 AC_MSG_RESULT($use_x86_asm)
783 if test $use_x86_asm = yes; then
787 AC_MSG_CHECKING(compiler support for MMX)
788 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
789 if AC_TRY_EVAL(ac_compile); then
796 if test $use_mmx_asm = yes; then
804 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
807 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
808 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
809 GDK_PIXBUF_EXTRA_CFLAGS=
810 GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
811 GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS"
813 AC_SUBST(GDK_PIXBUF_PACKAGES)
814 AC_SUBST(GDK_PIXBUF_EXTRA_LIBS)
815 AC_SUBST(GDK_PIXBUF_EXTRA_CFLAGS)
816 AC_SUBST(GDK_PIXBUF_DEP_LIBS)
817 AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
820 ########################################
821 # Windowing system checks
822 ########################################
824 GDK_EXTRA_LIBS=$GDK_WLIBS
827 if test "x$gdktarget" = "xx11"; then
828 # We start off with the libraries from Pango
830 ## be sure we also have Pango built with xft support
831 if $PKG_CONFIG --exists pangoxft ; then
832 PANGO_PACKAGES="pangox pangoxft"
836 PANGO_PACKAGES="pangox"
840 AM_CONDITIONAL(HAVE_XFT, $have_xft)
842 x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
843 x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
846 ## Strip the .la files
849 for I in $x_libs ; do
852 *) x_libs_for_checks="$x_libs_for_checks $I" ;;
856 # Sanity check for the X11 library
857 AC_CHECK_LIB(X11, XOpenDisplay, :,
858 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
861 if test "x$enable_shm" = "xyes"; then
862 # Check for the Xext library (needed for XShm extention)
863 AC_CHECK_LIB(Xext, XShmAttach,
864 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
865 x_extra_libs="-lXext"
867 # On AIX, it is in XextSam instead, but we still need -lXext
868 AC_CHECK_LIB(XextSam, XShmAttach,
869 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
870 x_extra_libs="-lXextSam -lXext"
872 x_extra_libs="-lXextSam"
873 fi, , $x_libs_for_checks),
877 GDK_PIXBUF_XLIB_EXTRA_CFLAGS="$x_cflags"
878 # Don't ever pull in the pangoxft libraries for gdk-pixbuf-x11
879 GDK_PIXBUF_XLIB_EXTRA_LIBS="$x_extra_libs `$PKG_CONFIG --libs pangox`"
881 # Check for shaped window extension
883 AC_CHECK_LIB(Xext, XShapeCombineMask,
884 if test -z "`echo $x_extra_libs $x_libs | grep "\-lXext" 2> /dev/null`"; then
885 x_extra_libs="-lXext $x_extra_libs"
887 AC_DEFINE(HAVE_SHAPE_EXT),
891 # Check for XConvertCase (X11R6 specific)
893 AC_CHECK_LIB(X11, XConvertCase,
894 AC_DEFINE(HAVE_XCONVERTCASE),
898 # Check for XIM support.
900 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
902 enable_xim_inst="no",
905 # On Solaris, calling XRegisterIMInstantiateCallback seems to
906 # cause an immediate segfault, so we disable it, unless
907 # the user specifically forces it to be on.
909 if test x$enable_xim_inst = xmaybe ; then
915 enable_xim_inst="yes"
920 if test "x$enable_xim" = "xyes"; then
921 GTK_XIM_FLAGS="-DUSE_XIM"
922 if test "x$enable_xim_inst" = "xyes"; then
923 AC_DEFINE(USE_X11R6_XIM)
927 # Check for XKB support.
929 if test "x$enable_xkb" = "xyes"; then
930 AC_MSG_WARN(XKB support explicitly enabled)
932 elif test "x$enable_xkb" = "xmaybe"; then
933 AC_CHECK_LIB(X11, XkbQueryExtension,
938 AC_MSG_WARN(XKB support explicitly disabled)
942 x_ldflags="$X_LDFLAGS"
944 # set up things for XInput
946 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
947 AC_DEFINE(XINPUT_GXI)
949 x_extra_libs="-lXi $x_extra_libs"
950 elif test "x$with_xinput" = "xxfree"; then
951 AC_DEFINE(XINPUT_XFREE)
952 x_extra_libs="-lXi $x_extra_libs"
954 AC_DEFINE(XINPUT_NONE)
957 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
958 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
960 if test "x$enable_shm" = "xyes"; then
961 # Check for shared memory
962 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
963 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
965 # Check for the X shared memory extension header file
967 AC_MSG_CHECKING(X11/extensions/XShm.h)
968 if test "x$no_xext_lib" = "xyes"; then
971 gtk_save_CFLAGS="$CFLAGS"
972 CFLAGS="$CFLAGS $x_cflags"
975 #include <sys/types.h>
978 #include <X11/Xlib.h>
979 #include <X11/Xutil.h>
980 #include <X11/extensions/XShm.h>
981 ], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
982 CFLAGS="$gtk_save_CFLAGS"
984 AC_MSG_RESULT($have_xshm)
985 if test $have_xshm = yes ; then
986 AC_DEFINE(HAVE_XSHM_H)
991 GDK_EXTRA_LIBS="$x_extra_libs"
993 AM_CONDITIONAL(USE_X11, true)
995 AM_CONDITIONAL(USE_X11, false)
998 if test "x$gdktarget" = "xwin32"; then
999 # We start off with the libraries from Pango
1001 ## be sure we also have Pango built with win32 support
1002 PANGO_PACKAGES="pangowin32"
1004 if test x$have_wintab = xyes; then
1005 GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
1006 AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
1009 GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -luuid"
1010 AM_CONDITIONAL(USE_WIN32, true)
1012 AM_CONDITIONAL(USE_WIN32, false)
1015 AC_SUBST(xinput_progs)
1017 GDK_PIXBUF_XLIB_PACKAGES=
1018 GDK_PIXBUF_XLIB_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_XLIB_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1019 GDK_PIXBUF_XLIB_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PIXBUF_XLIB_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_PIXBUF_XLIB_EXTRA_CFLAGS"
1021 AC_SUBST(GDK_PIXBUF_XLIB_PACKAGES)
1022 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_LIBS)
1023 AC_SUBST(GDK_PIXBUF_XLIB_EXTRA_CFLAGS)
1024 AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
1025 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
1027 if test "x$gdktarget" = "xlinux-fb"; then
1028 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
1029 if test x$FREETYPE_CONFIG = xno ; then
1030 AC_MSG_ERROR([*** freetype-config not found])
1033 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
1034 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
1035 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
1037 if test x$enable_shadowfb = xyes ; then
1038 AC_DEFINE(ENABLE_SHADOW_FB)
1041 if test x$enable_fbmanager = xyes ; then
1042 AC_DEFINE(ENABLE_FB_MANAGER)
1043 AM_CONDITIONAL(ENABLE_FB_MANAGER, true)
1045 AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
1048 GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
1049 GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
1051 AM_CONDITIONAL(USE_LINUX_FB, true)
1053 AM_CONDITIONAL(USE_LINUX_FB, false)
1054 AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
1058 # Pick correct Pango packages to use
1061 if test "x$gdktarget" = "xx11"; then
1062 if $have_xft = true ; then
1063 PANGO_PACKAGES="pangox pangoxft"
1065 PANGO_PACKAGES=pangox
1067 elif test "x$gdktarget" = "xwin32"; then
1068 PANGO_PACKAGES=pangowin32
1069 elif test "x$gdktarget" = "xlinux-fb"; then
1070 PANGO_PACKAGES=pangoft2
1072 PANGO_PACKAGES=pango
1075 # Check for Pango flags
1077 AC_MSG_CHECKING(Pango flags)
1078 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
1079 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
1080 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
1082 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
1085 *** Pango not found. Pango is required to build GTK+.
1086 *** See http://www.pango.org for Pango information.
1087 *** For the framebuffer target, you will need to build
1088 *** Pango with freetype support.
1092 CFLAGS="$CFLAGS $PANGO_CFLAGS"
1094 if $PKG_CONFIG --uninstalled $PANGO_PACKAGES; then
1097 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
1098 *** Can't link to Pango. Pango is required to build
1099 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS)
1102 CFLAGS="$saved_cflags"
1103 LDFLAGS="$saved_ldflags"
1105 GDK_PACKAGES=$PANGO_PACKAGES
1106 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
1107 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
1109 AC_SUBST(GDK_PACKAGES)
1110 AC_SUBST(GDK_EXTRA_LIBS)
1111 AC_SUBST(GDK_EXTRA_CFLAGS)
1112 AC_SUBST(GDK_DEP_LIBS)
1113 AC_SUBST(GDK_DEP_CFLAGS)
1116 ########################################
1117 # Check for Accessibility Toolkit flags
1118 ########################################
1121 AC_MSG_CHECKING(ATK flags)
1122 if $PKG_CONFIG --exists $ATK_PACKAGES ; then
1123 ATK_CFLAGS=`$PKG_CONFIG --cflags $ATK_PACKAGES`
1124 ATK_LIBS=`$PKG_CONFIG --libs $ATK_PACKAGES`
1126 AC_MSG_RESULT($ATK_CFLAGS $ATK_LIBS)
1129 *** Accessibility Toolkit not found. Accessibility Toolkit is required
1134 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
1137 AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
1138 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
1139 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
1145 GTK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
1146 GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags $GTK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
1148 AC_SUBST(GTK_PACKAGES)
1149 AC_SUBST(GTK_EXTRA_LIBS)
1150 AC_SUBST(GTK_EXTRA_CFLAGS)
1151 AC_SUBST(GTK_DEP_LIBS)
1152 AC_SUBST(GTK_DEP_CFLAGS)
1155 AC_SUBST(GTK_DEBUG_FLAGS)
1156 AC_SUBST(GTK_XIM_FLAGS)
1158 ##################################################
1159 # Checks for gtk-doc and docbook-tools
1160 ##################################################
1162 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
1164 if test "x$with_html_dir" = "x" ; then
1165 HTML_DIR='${datadir}/gtk-doc/html'
1167 HTML_DIR=$with_html_dir
1172 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1174 gtk_doc_min_version=0.9
1176 gtk_doc_version=`gtkdoc-mkdb --version`
1177 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
1178 if perl <<EOF ; then
1179 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
1180 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
1189 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1190 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1192 dnl Let people disable the gtk-doc stuff.
1193 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1195 if test x$enable_gtk_doc = xauto ; then
1196 if test x$GTKDOC = xtrue ; then
1203 dnl NOTE: We need to use a separate automake conditional for this
1204 dnl to make this work with the tarballs.
1205 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1208 ##################################################
1210 ##################################################
1212 AC_OUTPUT_COMMANDS([
1214 ## Generate `gdk/gdkconfig.h' in two cases
1215 ## 1. `config.status' is run either explicitly, or via configure.
1216 ## Esp. not when it is run in `Makefile' to generate makefiles and
1218 ## 2. CONFIG_OTHER is set explicitly
1220 ## Case 1 is difficult. We know that `automake' sets one of
1221 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1222 ## only when AM_CONFIG_HEADER is set, however.
1224 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1225 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1226 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1228 case "$CONFIG_OTHER" in
1230 echo creating gdk/gdkconfig.h
1231 outfile=gdkconfig.h-tmp
1232 cat > $outfile <<\_______EOF
1235 * This is a generated file. Please modify `configure.in'
1243 #endif /* __cplusplus */
1247 cat >>$outfile <<_______EOF
1252 cat >>$outfile <<_______EOF
1256 #endif /* __cplusplus */
1258 #endif /* GDKCONFIG_H */
1262 if cmp -s $outfile gdk/gdkconfig.h; then
1263 echo gdk/gdkconfig.h is unchanged
1266 mv $outfile gdk/gdkconfig.h
1270 if test "x$gdktarget" = "xx11" ; then
1272 #define GDK_WINDOWING_X11'
1273 elif test "x$gdktarget" = "xwin32" ; then
1275 #define GDK_WINDOWING_WIN32'
1276 elif test "x$gdktarget" = "xlinux-fb" ; then
1278 #define GDK_WINDOWING_FB
1279 #define GDK_NATIVE_WINDOW_POINTER'
1282 if test x$gdk_wchar_h = xyes; then
1284 #define GDK_HAVE_WCHAR_H 1'
1286 if test x$gdk_wctype_h = xyes; then
1288 #define GDK_HAVE_WCTYPE_H 1"
1290 if test x$gdk_working_wctype = xno; then
1292 #define GDK_HAVE_BROKEN_WCTYPE 1"
1298 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1299 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1309 gdk-pixbuf-2.0-uninstalled.pc
1310 gdk-2.0-uninstalled.pc
1311 gtk+-2.0-uninstalled.pc
1315 build/win32/Makefile
1316 build/win32/dirent/Makefile
1318 demos/gtk-demo/Makefile
1321 docs/reference/Makefile
1322 docs/reference/gdk-pixbuf/Makefile
1323 docs/reference/gdk/Makefile
1324 docs/reference/gtk/Makefile
1326 docs/tutorial/Makefile
1328 gdk-pixbuf/makefile.mingw
1329 gdk-pixbuf/gdk-pixbuf-features.h
1330 gdk-pixbuf/pixops/Makefile
1331 gdk-pixbuf/pixops/makefile.mingw
1336 gdk/win32/makefile.mingw
1337 gdk/win32/rc/Makefile
1339 gdk/linux-fb/Makefile
1345 gtk/stock-icons/Makefile
1347 modules/input/Makefile
1349 contrib/gdk-pixbuf-xlib/Makefile
1350 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc