1 dnl Process this file with autoconf to produce a configure script.
5 AM_CONFIG_HEADER(config.h)
7 dnl ==========================================================================
9 dnl If you add a version number here, you *must* add an AC_SUBST line for
10 dnl it too, or it will never make it into the spec file!
12 dnl ==========================================================================
14 GLIB_REQUIRED_VERSION=2.0.0
15 AC_SUBST(GLIB_REQUIRED_VERSION)
17 dnl ==========================================================================
19 dnl ==========================================================================
22 dnl ATK_MICRO_VERSION += 1;
23 dnl ATK_INTERFACE_AGE += 1;
24 dnl ATK_BINARY_AGE += 1;
25 dnl if any functions have been added, set ATK_INTERFACE_AGE to 0.
26 dnl if backwards compatibility has been broken,
27 dnl set ATK_BINARY_AGE _and_ ATK_INTERFACE_AGE to 0.
33 ATK_VERSION=$ATK_MAJOR_VERSION.$ATK_MINOR_VERSION.$ATK_MICRO_VERSION
35 dnl The X.Y in -latk-X.Y line. This is expected to stay 1.0 until Atk 2.
38 dnl Number of releases since we've added interfaces
43 AC_SUBST(ATK_MAJOR_VERSION)
44 AC_SUBST(ATK_MINOR_VERSION)
46 AC_SUBST(ATK_API_VERSION)
47 AC_SUBST(ATK_MICRO_VERSION)
48 AC_SUBST(ATK_INTERFACE_AGE)
49 AC_SUBST(ATK_BINARY_AGE)
51 dnl libtool versioning
52 lt_current=`expr 100 '*' $ATK_MINOR_VERSION + $ATK_MICRO_VERSION - $ATK_INTERFACE_AGE`
53 lt_revision=$ATK_INTERFACE_AGE
54 lt_age=`expr $ATK_BINARY_AGE - $ATK_INTERFACE_AGE`
55 LT_VERSION_INFO="$lt_current:$lt_revision:$lt_age"
56 LT_CURRENT_MINUS_AGE=`expr $lt_current - $lt_age`
58 AC_SUBST(LT_VERSION_INFO)
59 AC_SUBST(LT_CURRENT_MINUS_AGE)
61 dnl ==========================================================================
63 AM_INIT_AUTOMAKE(atk,$ATK_VERSION)
66 AC_SUBST(GETTEXT_PACKAGE)
67 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
77 AC_MSG_CHECKING([for Win32])
86 AC_MSG_RESULT([$atk_native_win32])
87 AM_CONDITIONAL(OS_WIN32, test "$atk_native_win32" = "yes")
89 if test "$atk_native_win32" = "yes"; then
90 AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
92 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
94 dnl Cache $ACLOCAL_FLAGS
95 AC_CACHE_CHECK([for aclocal flags], ac_cv_atk_aclocal_flags,[
96 ac_cv_atk_aclocal_flags="$ACLOCAL_FLAGS"
98 ACLOCAL="$ACLOCAL $ac_cv_atk_aclocal_flags"
100 AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
103 if test "x$GCC" = "xyes"; then
105 *[\ \ ]-Wall[\ \ ]*) ;;
106 *) CFLAGS="$CFLAGS -Wall" ;;
111 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
112 AC_SUBST(GLIB_PACKAGES)
114 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and
115 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
117 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
119 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
120 *** GLIB is always available from ftp://ftp.gtk.org/.]),
123 PKG_CHECK_MODULES(DEP, glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES, , AC_MSG_ERROR([
124 *** GLib not found. You can find it on ftp://ftp.gtk.org
128 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
129 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
131 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
133 gtk_doc_min_version=0.6
135 gtk_doc_version=`gtkdoc-mkdb --version`
136 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
138 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
139 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
148 atktargetlib=libatk-$ATK_API_VERSION.la
150 AC_SUBST(atktargetlib)
152 AC_MSG_CHECKING(whether make is GNU Make)
155 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
156 STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
163 AC_SUBST(STRIP_DUMMY)
164 AC_SUBST(STRIP_BEGIN)
167 dnl Disable the gtk-doc stuff by default to avoid Jade hassles
168 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
170 if test x$enable_gtk_doc = xyes ; then
171 if test x$GTKDOC = xtrue ; then
178 dnl NOTE: We need to use a separate automake conditional for this
179 dnl to make this work with the tarballs.
180 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
182 # define a MAINT-like variable REBUILD which is set if Perl
183 # and awk are found, so autogenerated sources can be rebuilt
186 AC_CHECK_PROGS(PERL, perl5 perl)
189 if test "x$enable_rebuilds" = "xyes" && \
191 $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
192 test -n "$AWK" ; then