Release 2.15.4
[atk.git] / configure.ac
blobb19025168c369eebc73783f307dfe098469d9c1b
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.63])
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], [2])
19 m4_define([atk_minor_version], [15])
20 m4_define([atk_micro_version], [4])
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 3.
25 m4_define([atk_api_version], [1.0])
27 dnl Number of releases since we've added interfaces
28 m4_define([atk_interface_age], [1])
30 dnl binary_age includes major version as ATK 2 is still fully API and ABI compatible
31 m4_define([atk_binary_age],
32           [m4_eval(10000 * atk_major_version + 100 * atk_minor_version + 10 + atk_micro_version)])
34 m4_define([lt_current],
35           [m4_eval(10000 * atk_major_version + 100 * atk_minor_version + 10 + atk_micro_version - atk_interface_age)])
36 m4_define([lt_revision], [atk_interface_age])
37 m4_define([lt_age], [m4_eval(atk_binary_age - atk_interface_age)])
38 m4_define([lt_version_info], [lt_current:lt_revision:lt_age])
39 m4_define([lt_current_minus_age], [m4_eval(lt_current - lt_age)])
41 AC_INIT([atk],
42         [atk_version],
43         [http://bugzilla.gnome.org/enter_bug.cgi?product=atk],
44         [atk])
46 AC_CONFIG_HEADERS([config.h])
47 AC_CONFIG_SRCDIR([ChangeLog])
48 AC_CONFIG_MACRO_DIR([m4])
50 AM_INIT_AUTOMAKE([1.10 -Wno-portability])
52 # Support silent build rules, requires at least automake-1.11. Disable
53 # by either passing --disable-silent-rules to configure or passing V=1
54 # to make
55 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
57 dnl ==========================================================================
58 dnl
59 dnl If you add a version number here, you *must* add an AC_SUBST line for
60 dnl it too, or it will never make it into the spec file!
61 dnl
62 dnl ==========================================================================
64 ATK_MAJOR_VERSION=atk_major_version
65 ATK_MINOR_VERSION=atk_minor_version
66 ATK_MICRO_VERSION=atk_micro_version
67 ATK_VERSION=atk_version
68 ATK_API_VERSION=atk_api_version
69 ATK_INTERFACE_AGE=atk_interface_age
70 ATK_BINARY_AGE=atk_binary_age
72 AC_SUBST(ATK_MAJOR_VERSION)
73 AC_SUBST(ATK_MINOR_VERSION)
74 AC_SUBST(ATK_VERSION)
75 AC_SUBST(ATK_API_VERSION)
76 AC_SUBST(ATK_MICRO_VERSION)
77 AC_SUBST(ATK_INTERFACE_AGE)
78 AC_SUBST(ATK_BINARY_AGE)
80 dnl libtool versioning
81 LT_VERSION_INFO=lt_version_info
82 LT_CURRENT_MINUS_AGE=lt_current_minus_age
83 AC_SUBST(LT_VERSION_INFO)
84 AC_SUBST(LT_CURRENT_MINUS_AGE)
86 dnl ==========================================================================
88 # Check for programs
89 AC_PROG_CC
91 # Initialize libtool
92 LT_PREREQ([2.2])
93 LT_INIT([disable-static win32-dll])
95 AC_CHECK_FUNCS(bind_textdomain_codeset)
97 AC_MSG_CHECKING([for some Win32 platform])
98 case "$host" in
99   *-*-mingw*|*-*-cygwin*)
100     platform_win32=yes
101     ;;
102   *)
103     platform_win32=no
104     ;;
105 esac
106 AC_MSG_RESULT([$platform_win32])
107 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
109 AC_MSG_CHECKING([for native Win32 platform])
110 case "$host" in
111   *-*-mingw*)
112     atk_native_win32=yes
113     case "$host" in
114       x86_64-*-*)
115         LIB_EXE_MACHINE_FLAG=X64
116         ;;
117       *)
118         LIB_EXE_MACHINE_FLAG=X86
119         ;;
120     esac
121     ;;
122   *)
123     atk_native_win32=no
124     ;;
125 esac
126 AC_MSG_RESULT([$atk_native_win32])
127 AM_CONDITIONAL(OS_WIN32, test "$atk_native_win32" = "yes")
129 AC_SUBST(LIB_EXE_MACHINE_FLAG)
131 if test "$atk_native_win32" = "yes"; then
132   AC_CHECK_TOOL(WINDRES, windres, no)
133   if test "$WINDRES" = no; then
134     AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
135   fi
136   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
139 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
141 dnl Cache $ACLOCAL_FLAGS
142 AC_CACHE_CHECK([for aclocal flags], ac_cv_atk_aclocal_flags,[
143    ac_cv_atk_aclocal_flags="$ACLOCAL_FLAGS"
145 ACLOCAL="$ACLOCAL $ac_cv_atk_aclocal_flags"
147 AC_ARG_ENABLE(rebuilds,
148               [AS_HELP_STRING([--disable-rebuilds],
149                               [disable all source autogeneration rules])],,
150               [enable_rebuilds=yes])
152 CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES"
154 changequote(,)dnl
155 if test "x$GCC" = "xyes"; then
156   case " $CFLAGS " in
157   *[\ \ ]-Wall[\ \      ]*) ;;
158   *) CFLAGS="$CFLAGS -Wall" ;;
159   esac
161 changequote([,])dnl
163 GLIB_REQUIRED_VERSION=2.31.2
164 GLIB_PACKAGES="gobject-2.0"
165 AC_SUBST(GLIB_PACKAGES)
166 AC_SUBST(GLIB_REQUIRED_VERSION)
168 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and 
169 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
170 dnl Makefile
171 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
172   AC_MSG_ERROR([
173 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
174 *** GLIB is always available from ftp://ftp.gtk.org/. If GLIB is installed
175 *** but not in the same location as pkg-config add the location of the file 
176 *** glib-2.0.pc to the environment variable PKG_CONFIG_PATH.]),
177   gobject)
179 PKG_CHECK_MODULES(DEP, glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES, ,
180   AC_MSG_ERROR([
181         *** GLib not found. You can find it on ftp://ftp.gtk.org
182         *** Errors follow:
183             $DEP_PKG_ERRORS]))
185 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
186 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
188 # i18n stuff
189 GETTEXT_PACKAGE=atk10
190 AC_SUBST(GETTEXT_PACKAGE)
191 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"],
192   [Define the gettext package to be used])
194 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
195 AM_GLIB_GNU_GETTEXT
197 # Introspection support
198 GOBJECT_INTROSPECTION_CHECK([0.6.7])
200 # Documentation support
201 GTK_DOC_CHECK([1.13])
203 # define a MAINT-like variable REBUILD which is set if Perl
204 # and awk are found, so autogenerated sources can be rebuilt
206 AC_PROG_AWK
207 AC_CHECK_PROGS(PERL, perl5 perl)
209 REBUILD=\#
210 if test "x$enable_rebuilds" = "xyes" && \
211         test -n "$PERL" && \
212         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
213      test -n "$AWK" ; then
214   REBUILD=
216 AC_SUBST(REBUILD)
218 # option to specify python interpreter to use; this just sets $PYTHON, so that
219 # we will fallback to reading $PYTHON if --with-python is not given, and
220 # python.m4 will get the expected input.
221 # This dependency on Python is for 'make dist', so normal builds would not
222 # need Python
223 AC_ARG_WITH(python,
224             AS_HELP_STRING([--with-python=PATH],
225                            [Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
226             [PYTHON="$withval"], [])
227 if test x"$PYTHON" = xyes; then
228   AC_MSG_ERROR([--with-python option requires a path or program argument])
230 AM_PATH_PYTHON(2.5,,PYTHON="/usr/bin/env python2.5")
232 # Check for the visibility flags
233 ATK_HIDDEN_VISIBILITY_CFLAGS=""
234 case "$host" in
235   *-*-mingw*)
236     dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
237     AC_DEFINE([_ATK_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
238               [defines how to decorate public symbols while building])
239     CFLAGS="${CFLAGS} -fvisibility=hidden"
240     ;;
241   *)
242     dnl on other compilers, check if we can do -fvisibility=hidden
243     SAVED_CFLAGS="${CFLAGS}"
244     CFLAGS="-fvisibility=hidden"
245     AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
246     AC_TRY_COMPILE([], [int main (void) { return 0; }],
247                    AC_MSG_RESULT(yes)
248                    enable_fvisibility_hidden=yes,
249                    AC_MSG_RESULT(no)
250                    enable_fvisibility_hidden=no)
251     CFLAGS="${SAVED_CFLAGS}"
253     AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
254       AC_DEFINE([_ATK_EXTERN], [__attribute__((visibility("default"))) extern],
255                 [defines how to decorate public symbols while building])
256       ATK_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
257     ])
258     ;;
259 esac
260 AC_SUBST(ATK_HIDDEN_VISIBILITY_CFLAGS)
262 GNOME_COMPILE_WARNINGS([maximum])
264 AC_CONFIG_FILES([
265 Makefile
266 po/Makefile.in
267 atk.pc
268 atk-uninstalled.pc
269 atk/Makefile
270 atk/atk.rc
271 atk/atkversion.h
272 tests/Makefile
273 build/Makefile
274 build/win32/Makefile
275 build/win32/vs9/Makefile
276 build/win32/vs10/Makefile
277 build/win32/vs11/Makefile
278 build/win32/vs12/Makefile
279 docs/Makefile
280 docs/version.xml
281 atk.spec
282 atk-zip.sh
283 config.h.win32
286 AC_OUTPUT