===== Released 1.5.3=====
[atk.git] / configure.in
blob4cd44e7eba27be853dae7fe143061056f2f8c0d1
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.54)
5 dnl ==========================================================================
6 dnl                              Versioning              
7 dnl ==========================================================================
9 dnl Making releases:
10 dnl   ATK_MICRO_VERSION += 1;
11 dnl   ATK_INTERFACE_AGE += 1;
12 dnl   ATK_BINARY_AGE += 1;
13 dnl if any functions have been added, set ATK_INTERFACE_AGE to 0.
14 dnl if backwards compatibility has been broken,
15 dnl set ATK_BINARY_AGE _and_ ATK_INTERFACE_AGE to 0.
17 dnl The triplet 
18 m4_define([atk_major_version], [1])
19 m4_define([atk_minor_version], [5])
20 m4_define([atk_micro_version], [3])
21 m4_define([atk_version],
22           [atk_major_version.atk_minor_version.atk_micro_version])
24 dnl The X.Y in -latk-X.Y line. This is expected to stay 1.0 until Atk 2.
25 m4_define([atk_api_version], [1.0])
27 dnl Number of releases since we've added interfaces
28 m4_define([atk_interface_age], [2])
30 m4_define([atk_binary_age],
31           [m4_eval(100 * atk_minor_version + atk_micro_version)])
33 m4_define([lt_current],
34           [m4_eval(100 * atk_minor_version + atk_micro_version - atk_interface_age)])`
35 m4_define([lt_revision], [atk_interface_age])
36 m4_define([lt_age], [m4_eval(atk_binary_age - atk_interface_age)])
37 m4_define([lt_version_info], [lt_current:lt_revision:lt_age])
38 m4_define([lt_current_minus_age], [m4_eval(lt_current - lt_age)])
41 AC_INIT(atk, [atk_version],
42         [http://bugzilla.gnome.org/enter_bug.cgi?product=atk])
43 AC_CONFIG_SRCDIR([ChangeLog])
45 AM_CONFIG_HEADER(config.h)
47 AM_INIT_AUTOMAKE
49 dnl ==========================================================================
50 dnl
51 dnl If you add a version number here, you *must* add an AC_SUBST line for
52 dnl it too, or it will never make it into the spec file!
53 dnl
54 dnl ==========================================================================
56 GLIB_REQUIRED_VERSION=2.0.0
57 AC_SUBST(GLIB_REQUIRED_VERSION)
60 ATK_MAJOR_VERSION=atk_major_version
61 ATK_MINOR_VERSION=atk_minor_version
62 ATK_MICRO_VERSION=atk_micro_version
63 ATK_VERSION=atk_version
64 ATK_API_VERSION=atk_api_version
65 ATK_INTERFACE_AGE=atk_interface_age
66 ATK_BINARY_AGE=atk_binary_age
68 AC_SUBST(ATK_MAJOR_VERSION)
69 AC_SUBST(ATK_MINOR_VERSION)
70 AC_SUBST(ATK_VERSION)
71 AC_SUBST(ATK_API_VERSION)
72 AC_SUBST(ATK_MICRO_VERSION)
73 AC_SUBST(ATK_INTERFACE_AGE)
74 AC_SUBST(ATK_BINARY_AGE)
76 dnl libtool versioning
77 LT_VERSION_INFO=lt_version_info
78 LT_CURRENT_MINUS_AGE=lt_current_minus_age
79 AC_SUBST(LT_VERSION_INFO)
80 AC_SUBST(LT_CURRENT_MINUS_AGE)
82 dnl ==========================================================================
84 GETTEXT_PACKAGE=atk10
85 AC_SUBST(GETTEXT_PACKAGE)
86 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"],
87   [Define the gettext package to be used])
89 AC_PROG_CC
90 AM_DISABLE_STATIC
91 AC_LIBTOOL_WIN32_DLL
92 AM_PROG_LIBTOOL
94 AC_MSG_CHECKING([for Win32])
95 case "$host" in
96   *-*-mingw*)
97     atk_native_win32=yes
98     ;;
99   *)
100     atk_native_win32=no
101     ;;
102 esac
103 AC_MSG_RESULT([$atk_native_win32])
104 AM_CONDITIONAL(OS_WIN32, test "$atk_native_win32" = "yes")
106 if test "$atk_native_win32" = "yes"; then
107   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
109 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
111 dnl Cache $ACLOCAL_FLAGS
112 AC_CACHE_CHECK([for aclocal flags], ac_cv_atk_aclocal_flags,[
113    ac_cv_atk_aclocal_flags="$ACLOCAL_FLAGS"
115 ACLOCAL="$ACLOCAL $ac_cv_atk_aclocal_flags"
117 AC_ARG_ENABLE(rebuilds,
118               [AC_HELP_STRING([--disable-rebuilds],
119                               [disable all source autogeneration rules])],,
120               [enable_rebuilds=yes])
122 changequote(,)dnl
123 if test "x$GCC" = "xyes"; then
124   case " $CFLAGS " in
125   *[\ \ ]-Wall[\ \      ]*) ;;
126   *) CFLAGS="$CFLAGS -Wall" ;;
127   esac
129 changequote([,])dnl
131 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
132 AC_SUBST(GLIB_PACKAGES)
134 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and 
135 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
136 dnl Makefile
137 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
138   AC_MSG_ERROR([
139 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
140 *** GLIB is always available from ftp://ftp.gtk.org/. If GLIB is installed
141 *** but not in the same location as pkg-config add the location of the file 
142 *** glib-2.0.pc to the environment variable PKG_CONFIG_PATH.]),
143   gobject gmodule)
145 PKG_CHECK_MODULES(DEP, glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES, ,
146   AC_MSG_ERROR([
147         *** GLib not found. You can find it on ftp://ftp.gtk.org
148         *** Errors follow:
149             $DEP_PKG_ERRORS]))
151 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
152 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
154 ALL_LINGUAS="af am az be bg bn ca cs cy da de en_GB el eo es fa fi fr ga he hi hr hu kn ko id is it ja li lv lt ml mk mn ms ne nl nn no pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta tr uk vi yi zh_CN zh_TW"
155 AM_GLIB_GNU_GETTEXT
157 AM_GLIB_DEFINE_LOCALEDIR(ATK_LOCALEDIR)
159 AC_CHECK_FUNCS(bind_textdomain_codeset)
161 GTK_DOC_CHECK([1.0])
163 # define a MAINT-like variable REBUILD which is set if Perl
164 # and awk are found, so autogenerated sources can be rebuilt
166 AC_PROG_AWK
167 AC_CHECK_PROGS(PERL, perl5 perl)
169 REBUILD=\#
170 if test "x$enable_rebuilds" = "xyes" && \
171         test -n "$PERL" && \
172         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
173      test -n "$AWK" ; then
174   REBUILD=
176 AC_SUBST(REBUILD)
178 AC_CONFIG_FILES([
179 Makefile
180 po/Makefile.in
181 atk.pc
182 atk-uninstalled.pc
183 atk/Makefile
184 atk/atk.rc
185 tests/Makefile
186 docs/Makefile
187 docs/version.xml
188 atk.spec
189 atk-zip.sh
192 AC_OUTPUT