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_WITH(glib, [ --with-glib=DIR Use uninstalled copy of glib])
113 AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
115 AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
116 , enable_xim_inst="maybe")
117 AC_ARG_ENABLE(xkb, [ --enable-xkb support XKB [default=maybe]],
118 , enable_xkb="maybe")
119 AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
120 AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
122 AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
125 gdktargetlib=libgdk-x11-1.3.la
126 gtktargetlib=libgtk-x11-1.3.la
127 AC_ARG_WITH(gdktarget, [ --with-gdktarget=[x11/nanox/linux-fb] select GDK target [default=x11] ],
128 gdktarget=$with_gdktarget)
132 x11|nanox|linux-fb) ;;
133 *) AC_MSG_ERROR([Invalid target for GDK: use x11, nanox or linux-fb.]);;
136 AC_ARG_ENABLE(shadowfb, [ --disable-shadowfb disable shadowfb support for linux-fb],,enable_shadowfb=yes)
138 if test "x$enable_debug" = "xyes"; then
139 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
140 GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
142 if test "x$enable_debug" = "xno"; then
143 GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
145 GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
149 AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
152 # Build time sanity check...
155 # Checks for programs.
163 if test "x$GCC" = "xyes"; then
165 *[\ \ ]-Wall[\ \ ]*) ;;
166 *) CFLAGS="$CFLAGS -Wall" ;;
169 if test "x$enable_ansi" = "xyes"; then
171 *[\ \ ]-ansi[\ \ ]*) ;;
172 *) CFLAGS="$CFLAGS -ansi" ;;
176 *[\ \ ]-pedantic[\ \ ]*) ;;
177 *) CFLAGS="$CFLAGS -pedantic" ;;
183 # Honor aclocal flags
184 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
186 # libtool option to control which symbols are exported
187 # right now, symbols starting with _ are not exported
188 LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
189 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
191 # define a MAINT-like variable REBUILD which is set if Perl
192 # and awk are found, so autogenerated sources can be rebuilt
195 AC_CHECK_PROGS(PERL, perl5 perl)
197 # We would like indent, but don't require it.
198 AC_CHECK_PROG(INDENT, indent, indent)
201 if test "x$enable_rebuilds" = "xyes" && \
203 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
204 test -n "$AWK" ; then
209 AC_CHECK_FUNCS(lstat mkstemp sigsetjmp bind_textdomain_codeset)
211 AC_MSG_CHECKING(whether make is GNU Make)
214 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
215 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
222 AC_SUBST(STRIP_DUMMY)
223 AC_SUBST(STRIP_BEGIN)
227 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 no pl pt pt_BR ro ru sk sl sp sr sv tr uk wa zh_TW zh_CN"
229 LIBS="$LIBS $INTLLIBS"
231 # AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
232 # this is the directory where the *.{mo,gmo} files are installed
233 gtklocaledir='${prefix}/${DATADIRNAME}/locale'
234 AC_SUBST(gtklocaledir)
236 dnl The DU4 header files don't provide library prototypes unless
237 dnl -std1 is given to the native cc.
238 AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
242 AC_TRY_RUN([#include <math.h>
243 int main (void) { return (log(1) != log(1.)); }],
244 AC_MSG_RESULT(none needed),
245 gtk_save_CFLAGS="$CFLAGS"
246 CFLAGS="$CFLAGS -std1"
247 AC_TRY_RUN([#include <math.h>
248 int main (void) { return (log(1) != log(1.)); }],
249 AC_MSG_RESULT(-std1),
251 CFLAGS="$gtk_save_CFLAGS"
253 [No ANSI prototypes found in library. (-std1 didn't work.)]),
256 AC_MSG_RESULT(none needed)
262 AC_MSG_CHECKING(for the BeOS)
266 GTK_LIBS_EXTRA="-L\$(top_builddir_full)/gdk/.libs -lgdk"
274 AC_SUBST(GTK_LIBS_EXTRA)
276 dnl NeXTStep cc seems to need this
277 AC_MSG_CHECKING([for extra flags for POSIX compliance])
278 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
279 AC_MSG_RESULT(none needed),
280 gtk_save_CFLAGS="$CFLAGS"
281 CFLAGS="$CFLAGS -posix"
282 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
283 AC_MSG_RESULT(-posix),
285 CFLAGS="$gtk_save_CFLAGS"
286 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
292 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
293 if test x$PKG_CONFIG = xno ; then
294 AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
297 if ! pkg-config --atleast-pkgconfig-version 0.5 ; then
298 AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
301 if test x$with_glib = xyes ; then
303 *** Directory must be specified for --with-glib])
306 if test x$with_glib = x ; then
308 # Look for separately installed glib
310 GLIB_PACKAGES="gobject-2.0 gmodule-2.0 gthread-2.0"
311 GLIB_REQUIRED_VERSION=1.3.2
313 AC_MSG_CHECKING(GLib flags)
314 if $PKG_CONFIG --atleast-version $GLIB_REQUIRED_VERSION glib-2.0 ; then
315 GLIB_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES`
316 GLIB_LIBS=`$PKG_CONFIG --libs $GLIB_PACKAGES`
317 GLIB_DEPLIBS=$GLIB_LIBS
319 AC_MSG_RESULT($GLIB_CFLAGS $GLIB_LIBS)
322 *** GLIB $GLIB_REQUIRED_VERSION or newer is required. The latest version of GLIB
323 *** is always available from ftp://ftp.gtk.org/.
328 # Use uninstalled glib (assume they got the version right)
330 if test -e glib-2.0.pc ; then
333 AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured])
336 # canonicalize relative paths
342 glib_dir="\$(top_builddir)/$with_glib"
346 GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
347 GLIB_LIBS="$glib_dir/libglib-1.3.la $glib_dir/gmodule/libgmodule-1.3.la"
351 CFLAGS="$CFLAGS $GLIB_CFLAGS"
352 AC_SUBST(GLIB_CFLAGS)
354 AC_SUBST(GLIB_DEPLIBS)
356 AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
357 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
358 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
359 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
361 saved_cflags="$CFLAGS"
362 saved_ldflags="$LDFLAGS"
364 if test "x$gdktarget" = "xx11"; then
365 # Find the X11 include and library directories
369 if test "x$x_includes" = "x"; then
370 x_includes="/usr/include"
373 CFLAGS="$CFLAGS $X_CFLAGS"
374 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
376 if test "x$no_x" = "xyes"; then
378 *** X libraries or include files not found. Check 'config.log' for
382 # Checks for libraries.
383 # Check for the X11 library
384 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS",
385 AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
388 if test "x$enable_shm" = "xyes"; then
389 # Check for the Xext library (needed for XShm extention)
390 AC_CHECK_LIB(Xext, XShmAttach,
391 x_libs="-lXext $x_libs",
392 # On AIX, it is in XextSam instead, but we still need -lXext
393 AC_CHECK_LIB(XextSam, XShmAttach,
394 x_libs="-lXextSam -lXext $x_libs",
395 no_xext_lib=yes, $x_libs),
399 # Check for shaped window extension
401 AC_CHECK_LIB(Xext, XShapeCombineMask,
402 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
403 x_libs="-lXext $x_libs"
405 AC_DEFINE(HAVE_SHAPE_EXT),
409 # Check for XConvertCase (X11R6 specific)
411 AC_CHECK_LIB(X11, XConvertCase,
412 AC_DEFINE(HAVE_XCONVERTCASE),
417 # Checks for FreeType
422 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
423 if test "x$FREETYPE_CONFIG" != "xno" ; then
424 FREETYPE_CFLAGS=`freetype-config --cflags`
425 FREETYPE_LIBS=`freetype-config --libs`
427 AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
430 AC_SUBST(FREETYPE_CFLAGS)
433 # Checks for Xft/XRender
438 if test $have_freetype = true ; then
439 AC_CHECK_LIB(Xrender, XRenderFindFormat,
440 AC_CHECK_LIB(Xft, XftFontOpen, have_xft=true, :, -lXrender -lXext $X_LIBS $FREETYPE_LIBS)
443 if $have_xft = 'true' ; then
444 X_LIBS="-lXft -lXrender -lXext $FREETYPE_LIBS $X_LIBS"
450 AM_CONDITIONAL(HAVE_XFT, $have_xft)
452 # Check for XIM support.
454 AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
456 enable_xim_inst="no",
459 # On Solaris, calling XRegisterIMInstantiateCallback seems to
460 # cause an immediate segfault, so we disable it, unless
461 # the user specifically forces it to be on.
463 if test x$enable_xim_inst = xmaybe ; then
469 enable_xim_inst="yes"
474 if test "x$enable_xim" = "xyes"; then
475 GTK_XIM_FLAGS="-DUSE_XIM"
476 if test "x$enable_xim_inst" = "xyes"; then
477 AC_DEFINE(USE_X11R6_XIM)
481 # Check for XKB support.
483 if test "x$enable_xkb" = "xyes"; then
484 AC_MSG_WARN(XKB support explicitly enabled)
486 elif test "x$enable_xkb" = "xmaybe"; then
487 AC_CHECK_LIB(X11, XkbQueryExtension,
492 AC_MSG_WARN(XKB support explicitly disabled)
496 x_ldflags="$X_LDFLAGS $X_LIBS"
498 # set up things for XInput
500 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
501 AC_DEFINE(XINPUT_GXI)
503 x_libs="-lXi $x_libs"
504 elif test "x$with_xinput" = "xxfree"; then
505 AC_DEFINE(XINPUT_XFREE)
506 x_libs="-lXi $x_libs"
508 AC_DEFINE(XINPUT_NONE)
511 AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
512 AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
514 if test "x$enable_shm" = "xyes"; then
515 # Check for shared memory
516 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
517 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
519 # Check for the X shared memory extension header file
520 AC_MSG_CHECKING(X11/extensions/XShm.h)
521 if test "x$no_xext_lib" = "xyes"; then
525 if test -f "$x_includes/X11/extensions/XShm.h"; then
527 AC_DEFINE(HAVE_XSHM_H)
535 more_cflags="$x_cflags"
536 more_ldflags="$x_ldflags"
538 more_includes="$x_includes"
540 # these are already defined above
541 #gdktargetlib = "libgdk-x11-1.3.la"
542 #gtktargetlib = "libgtk-x11-1.3.la"
544 AM_CONDITIONAL(USE_X11, true)
546 AM_CONDITIONAL(USE_X11, false)
549 if test "x$gdktarget" = "xnanox"; then
550 AC_CHECK_LIB(nano-X, GrOpen,,AC_MSG_ERROR([nano-X libraries not found.]))
551 # nano-X may require additional libraries
557 gdktargetlib="libgdk-nanox-1.3.la"
558 gtktargetlib="libgtk-nanox-1.3.la"
561 AC_DEFINE(XINPUT_NONE)
567 AM_CONDITIONAL(USE_NANOX, true)
569 AM_CONDITIONAL(USE_NANOX, false)
572 if test "x$gdktarget" = "xlinux-fb"; then
578 gdktargetlib="libgdk-linux-fb-1.3.la"
579 gtktargetlib="libgtk-linux-fb-1.3.la"
582 AC_DEFINE(XINPUT_NONE)
589 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
590 if test x$FREETYPE_CONFIG = xno ; then
591 AC_MSG_ERROR([*** freetype-config not found])
594 FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
595 FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
596 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
598 if test x$enable_shadowfb = xyes ; then
599 AC_DEFINE(ENABLE_SHADOW_FB)
602 AM_CONDITIONAL(USE_LINUX_FB, true)
604 AM_CONDITIONAL(USE_LINUX_FB, false)
606 AC_SUBST(ENABLE_SHADOW_FB)
607 AC_SUBST(FREETYPE_LIBS)
608 AC_SUBST(FREETYPE_CFLAGS)
611 # Pick correct Pango packages to use
614 if test "x$gdktarget" = "xx11"; then
615 if $have_xft = true ; then
616 PANGO_PACKAGES="pangox pangoxft"
618 PANGO_PACKAGES=pangox
620 elif test "x$gdktarget" = "xlinux-fb"; then
621 PANGO_PACKAGES=pangoft2
626 AC_SUBST(PANGO_PACKAGES)
628 # Check for Pango flags
630 AC_MSG_CHECKING(Pango flags)
631 if $PKG_CONFIG --exists $PANGO_PACKAGES ; then
632 PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES`
633 PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES`
635 AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS)
638 *** Pango not found. Pango is required to build GTK+.
639 *** See http://www.pango.org for Pango information.
640 *** For the framebuffer target, you will need to build
641 *** Pango with freetype support.
645 CFLAGS="$CFLAGS $PANGO_CFLAGS"
647 AC_SUBST(PANGO_CFLAGS)
649 AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
650 *** Can't link to Pango. Pango is required to build
651 *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS $x_ldflags $x_libs)
653 CFLAGS="$saved_cflags"
654 LDFLAGS="$saved_ldflags"
660 AC_SUBST(xinput_progs)
662 AC_SUBST(more_cflags)
663 AC_SUBST(more_includes)
664 AC_SUBST(more_ldflags)
666 AC_SUBST(gdktargetlib)
667 AC_SUBST(gtktargetlib)
670 # Check if X_LOCALE definition is necessary
672 AC_MSG_CHECKING(need -DX_LOCALE)
681 return setlocale (LC_ALL, "${with_locale}") == NULL;
686 AC_MSG_RESULT($need_x_locale)
688 if test $need_x_locale = yes; then
689 GTK_LOCALE_FLAGS="-DX_LOCALE"
692 # Checks for header files.
695 # Checks for typedefs, structures, and compiler characteristics.
698 # Checks for library functions.
702 # Check if <sys/select.h> needs to be included for fd_set
703 AC_MSG_CHECKING([for fd_set])
704 AC_TRY_COMPILE([#include <sys/types.h>],
705 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
706 if test $gtk_ok = yes; then
707 AC_MSG_RESULT([yes, found in sys/types.h])
709 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
710 if test $gtk_ok = yes; then
711 AC_DEFINE(HAVE_SYS_SELECT_H)
712 AC_MSG_RESULT([yes, found in sys/select.h])
719 # `widechar' tests for gdki18n.h
720 AC_MSG_CHECKING(for wchar.h)
721 AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
722 if test $gdk_wchar_h = yes; then
723 AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
725 AC_MSG_RESULT($gdk_wchar_h)
727 # Check for wctype.h (for iswalnum)
728 AC_MSG_CHECKING(for wctype.h)
729 AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
730 if test $gdk_wctype_h = yes; then
731 AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
733 AC_MSG_RESULT($gdk_wctype_h)
735 # in Solaris 2.5, `iswalnum' is in -lw
737 AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
740 LIBS="$LIBS $GDK_WLIBS"
741 # The following is necessary for Linux libc-5.4.38
742 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
743 AC_TRY_LINK([#include <stdlib.h>],[
744 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
745 # ifdef HAVE_WCTYPE_H
753 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
755 iswalnum((wchar_t) 0);
756 ], gdk_working_wctype=yes, gdk_working_wctype=no)
759 if test $gdk_working_wctype = no; then
760 AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
763 AC_MSG_RESULT($gdk_working_wctype)
766 AC_SUBST(GTK_DEBUG_FLAGS)
767 AC_SUBST(GTK_XIM_FLAGS)
768 AC_SUBST(GTK_LOCALE_FLAGS)
770 ##################################################
771 # Checks for gdk-pixbuf
772 ##################################################
774 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
776 AC_ARG_ENABLE(modules, [ --disable-modules Disables dynamic module loading],[
777 if test x$withval = xyes; then
786 if test x$with_modules = xno; then
790 AC_MSG_CHECKING(whether dynamic modules work)
793 CFLAGS="$GLIB_CFLAGS"
800 if (g_module_supported ())
810 dnl Now we check to see if our libtool supports shared lib deps
811 dnl (in a rather ugly way even)
813 pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
814 pixbuf_deplibs_check=`$pixbuf_libtool_config | \
815 grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
816 sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
817 if test "x$pixbuf_deplibs_check" = "xnone" || \
818 test "x$pixbuf_deplibs_check" = "xunknown" || \
819 test "x$pixbuf_deplibs_check" = "x"; then
825 AC_DEFINE(USE_GMODULE)
832 if test -z "$LIBTIFF"; then
833 AC_CHECK_LIB(tiff, TIFFReadScanline,
834 AC_CHECK_HEADER(tiffio.h,
835 TIFF='tiff'; LIBTIFF='-ltiff',
836 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
837 AC_CHECK_LIB(tiff, TIFFWriteScanline,
838 AC_CHECK_HEADER(tiffio.h,
839 TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
840 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
841 AC_CHECK_LIB(tiff34, TIFFFlushData,
842 AC_CHECK_HEADER(tiffio.h,
843 TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
844 AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
845 AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
849 if test -z "$LIBJPEG"; then
850 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
853 AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
854 if test "$jpeg_ok" = yes; then
855 AC_MSG_CHECKING([for jpeglib.h])
860 #include <jpeglib.h>],
863 AC_MSG_RESULT($jpeg_ok)
864 if test "$jpeg_ok" = yes; then
866 AC_CHECK_LIB(jpeg, jpeg_simple_progression,
867 AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
868 AC_MSG_WARN(JPEG library does not support progressive saving.))
870 AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
876 if test -z "$LIBPNG"; then
877 AC_CHECK_LIB(png, png_read_info,
878 AC_CHECK_HEADER(png.h,
881 AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
882 if test "$png_ok" = yes; then
883 AC_MSG_CHECKING([for png_structp in png.h])
884 AC_TRY_COMPILE([#include <png.h>],
885 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
888 AC_MSG_RESULT($png_ok)
889 if test "$png_ok" = yes; then
890 PNG='png'; LIBPNG='-lpng -lz'
892 AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
895 AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
899 deps="$LIBTIFF $LIBJPEG $LIBPNG"
905 AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
908 # Allow building some or all gdk-pixbuf loaders included
910 AC_MSG_CHECKING(pixbuf loaders to build)
912 AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
914 all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm"
916 # If no loaders specified, include all
917 if test "x$with_included_loaders" = x ; then
918 included_loaders="$all_loaders"
920 included_loaders="$with_included_loaders"
923 AC_MSG_RESULT($included_loaders)
926 INCLUDED_LOADER_DEFINE=
928 IFS="${IFS= }"; gtk_save_ifs="$IFS"; IFS=","
929 for loader in $included_loaders; do
930 if ! echo "$all_loaders" | grep "\(^\|\,\)$loader\(\$\|\,\)" > /dev/null; then
931 AC_MSG_ERROR([the specified loader $loader does not exist])
934 INCLUDED_LOADER_OBJ="$INCLUDED_LOADER_OBJ libpixbufloader-static-$loader.la"
935 INCLUDED_LOADER_DEFINE="$INCLUDED_LOADER_DEFINE -DINCLUDE_$loader"
938 AC_SUBST(INCLUDED_LOADER_OBJ)
939 AC_SUBST(INCLUDED_LOADER_DEFINE)
947 AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
948 AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
949 AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
951 GDK_PIXBUF_LIBDIR='-L${libdir}'
952 GDK_PIXBUF_INCLUDEDIR="-I${includedir} $GTK_CFLAGS"
953 GDK_PIXBUF_LIBS="$GLIB_LIBS -lgdk_pixbuf $deps $GTK_LIBS"
954 AC_SUBST(STATIC_LIB_DEPS)
955 STATIC_LIB_DEPS="$deps"
957 AC_SUBST(GDK_PIXBUF_LIBDIR)
958 AC_SUBST(GDK_PIXBUF_INCLUDEDIR)
959 AC_SUBST(GDK_PIXBUF_LIBS)
961 GDK_PIXBUF_XLIB_LIBDIR=$GDK_PIXBUF_LIBDIR
962 GDK_PIXBUF_XLIB_INCLUDEDIR=$GDK_PIXBUF_INCLUDEDIR
963 GDK_PIXBUF_XLIB_LIBS="$GLIB_LIBS -lgdk_pixbuf_xlib $deps $X11_LIBS"
965 AC_SUBST(GDK_PIXBUF_XLIB_LIBDIR)
966 AC_SUBST(GDK_PIXBUF_XLIB_INCLUDEDIR)
967 AC_SUBST(GDK_PIXBUF_XLIB_LIBS)
969 # Checks to see if we should compile in MMX support (there will be
970 # a runtime test when the code is actually run to see if it should
971 # be used - this just checks if we can compile it.)
973 # This code is partially taken from Mesa
975 AC_MSG_CHECKING(for x86 platform)
977 i386|i486|i586|i686|i786|k6|k7)
983 AC_MSG_RESULT($use_x86_asm)
986 if test $use_x86_asm = yes; then
990 AC_MSG_CHECKING(compiler support for MMX)
991 cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
992 if AC_TRY_EVAL(ac_compile); then
999 if test $use_mmx_asm = yes; then
1007 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
1010 ##################################################
1011 # Checks for gtk-doc and docbook-tools
1012 ##################################################
1014 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
1016 if test "x$with_html_dir" = "x" ; then
1017 HTML_DIR='${datadir}/gtk-doc/html'
1019 HTML_DIR=$with_html_dir
1024 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
1025 AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
1026 AC_SUBST(HAVE_GTK_DOC)
1028 AC_CHECK_PROG(DB2HTML, db2html, true, false)
1029 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
1031 dnl Let people disable the gtk-doc stuff.
1032 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
1034 if test x$enable_gtk_doc = xauto ; then
1035 if test x$GTKDOC = xtrue ; then
1042 dnl NOTE: We need to use a separate automake conditional for this
1043 dnl to make this work with the tarballs.
1044 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
1046 GDK_PIXBUF_DIR=`(cd $srcdir; pwd)`
1047 AC_SUBST(GDK_PIXBUF_DIR)
1050 ##################################################
1052 ##################################################
1054 AC_OUTPUT_COMMANDS([
1056 ## Generate `gdk/gdkconfig.h' in two cases
1057 ## 1. `config.status' is run either explicitly, or via configure.
1058 ## Esp. not when it is run in `Makefile' to generate makefiles and
1060 ## 2. CONFIG_OTHER is set explicitly
1062 ## Case 1 is difficult. We know that `automake' sets one of
1063 ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
1064 ## only when AM_CONFIG_HEADER is set, however.
1066 if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
1067 # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
1068 CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
1070 case "$CONFIG_OTHER" in
1072 echo creating gdk/gdkconfig.h
1073 outfile=gdkconfig.h-tmp
1074 cat > $outfile <<\_______EOF
1077 * This is a generated file. Please modify `configure.in'
1085 #endif /* __cplusplus */
1089 cat >>$outfile <<_______EOF
1094 cat >>$outfile <<_______EOF
1098 #endif /* __cplusplus */
1100 #endif /* GDKCONFIG_H */
1104 if cmp -s $outfile gdk/gdkconfig.h; then
1105 echo gdk/gdkconfig.h is unchanged
1108 mv $outfile gdk/gdkconfig.h
1112 # Currently we always use X11 on those systems where we run configure...
1113 if test "x$gdktarget" = "xx11" ; then
1115 #define GDK_WINDOWING_X11'
1116 elif test "x$gdktarget" = "xnanox" ; then
1118 #define GDK_WINDOWING_NANOX'
1119 elif test "x$gdktarget" = "xlinux-fb" ; then
1121 #define GDK_WINDOWING_FB
1122 #define GDK_NATIVE_WINDOW_POINTER'
1125 if test x$gdk_wchar_h = xyes; then
1127 #define GDK_HAVE_WCHAR_H 1'
1129 if test x$gdk_wctype_h = xyes; then
1131 #define GDK_HAVE_WCTYPE_H 1"
1133 if test x$gdk_working_wctype = xno; then
1135 #define GDK_HAVE_BROKEN_WCTYPE 1"
1141 AC_PATH_PROG(SGML2HTML, sgml2html, no)
1142 AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
1154 build/win32/Makefile
1156 demos/gtk-demo/Makefile
1159 docs/reference/Makefile
1160 docs/reference/gdk-pixbuf/Makefile
1161 docs/reference/gdk/Makefile
1162 docs/reference/gtk/Makefile
1164 docs/tutorial/Makefile
1166 gdk-pixbuf/makefile.mingw
1167 gdk-pixbuf/gdk-pixbuf-features.h
1168 gdk-pixbuf/pixops/Makefile
1169 gdk-pixbuf/pixops/makefile.mingw
1174 gdk/win32/makefile.mingw
1175 gdk/win32/rc/Makefile
1178 gdk/linux-fb/Makefile
1184 gtk/stock-icons/Makefile
1186 modules/input/Makefile
1188 contrib/gdk-pixbuf-xlib/Makefile
1189 contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc
1190 ], [chmod +x gtk-config-2.0])