f403a6b670b6a5de625e3261bb2992dab3ea537f
[platform/upstream/atk.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(ChangeLog)
4
5 dnl ==========================================================================
6 dnl
7 dnl If you add a version number here, you *must* add an AC_SUBST line for
8 dnl it too, or it will never make it into the spec file!
9 dnl
10 dnl ==========================================================================
11
12 GLIB_REQUIRED_VERSION=2.0.0
13 AC_SUBST(GLIB_REQUIRED_VERSION)
14
15 dnl ==========================================================================
16 dnl                              Versioning              
17 dnl ==========================================================================
18
19 dnl Making releases:
20 dnl   ATK_MICRO_VERSION += 1;
21 dnl   ATK_INTERFACE_AGE += 1;
22 dnl   ATK_BINARY_AGE += 1;
23 dnl if any functions have been added, set ATK_INTERFACE_AGE to 0.
24 dnl if backwards compatibility has been broken,
25 dnl set ATK_BINARY_AGE _and_ ATK_INTERFACE_AGE to 0.
26
27 dnl The triplet 
28 ATK_MAJOR_VERSION=1
29 ATK_MINOR_VERSION=0
30 ATK_MICRO_VERSION=3
31 ATK_VERSION=$ATK_MAJOR_VERSION.$ATK_MINOR_VERSION.$ATK_MICRO_VERSION
32
33 dnl The X.Y in -latk-X.Y line. This is expected to stay 1.0 until Atk 2.
34 ATK_API_VERSION=1.0
35
36 dnl Number of releases since we've added interfaces
37 ATK_INTERFACE_AGE=3
38
39 dnl Number of releases since we've broken binary compatibility. Should equal
40 dnl ATK_MICRO_VERSION for a stable release
41 # ATK_BINARY_AGE=0
42 ATK_BINARY_AGE=$ATK_MICRO_VERSION
43
44 AC_SUBST(ATK_MAJOR_VERSION)
45 AC_SUBST(ATK_MINOR_VERSION)
46 AC_SUBST(ATK_VERSION)
47 AC_SUBST(ATK_API_VERSION)
48 AC_SUBST(ATK_MICRO_VERSION)
49 AC_SUBST(ATK_INTERFACE_AGE)
50 AC_SUBST(ATK_BINARY_AGE)
51
52 dnl libtool versioning
53 lt_current=`expr $ATK_MICRO_VERSION - $ATK_INTERFACE_AGE`
54 lt_revision=$ATK_INTERFACE_AGE
55 lt_age=`expr $ATK_BINARY_AGE - $ATK_INTERFACE_AGE`
56 LT_VERSION_INFO="$lt_current:$lt_revision:$lt_age"
57 LT_CURRENT_MINUS_AGE=`expr $lt_current - $lt_age`
58
59 AC_SUBST(LT_VERSION_INFO)
60 AC_SUBST(LT_CURRENT_MINUS_AGE)
61
62 dnl ==========================================================================
63
64 AM_INIT_AUTOMAKE(atk,$ATK_VERSION)
65
66 AC_PROG_CC
67 AM_DISABLE_STATIC
68 AC_LIBTOOL_WIN32_DLL
69 AM_PROG_LIBTOOL
70
71 AC_MSG_CHECKING([for Win32])
72 case "$host" in
73   *-*-mingw*)
74     atk_native_win32=yes
75     ;;
76   *)
77     atk_native_win32=no
78     ;;
79 esac
80 AC_MSG_RESULT([$atk_native_win32])
81 AM_CONDITIONAL(OS_WIN32, test "$atk_native_win32" = "yes")
82
83 if test "$atk_native_win32" = "yes"; then
84   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
85 fi
86 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
87
88 dnl Cache $ACLOCAL_FLAGS
89 AC_CACHE_CHECK([for aclocal flags], ac_cv_atk_aclocal_flags,[
90    ac_cv_atk_aclocal_flags="$ACLOCAL_FLAGS"
91 ])
92 ACLOCAL="$ACLOCAL $ac_cv_atk_aclocal_flags"
93
94 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
95
96 changequote(,)dnl
97 if test "x$GCC" = "xyes"; then
98   case " $CFLAGS " in
99   *[\ \ ]-Wall[\ \      ]*) ;;
100   *) CFLAGS="$CFLAGS -Wall" ;;
101   esac
102 fi
103 changequote([,])dnl
104
105 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
106 AC_SUBST(GLIB_PACKAGES)
107
108 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and 
109 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
110 dnl Makefile
111 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
112   AC_MSG_ERROR([
113 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
114 *** GLIB is always available from ftp://ftp.gtk.org/.]),
115   gobject gmodule)
116
117 PKG_CHECK_MODULES(DEP, glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES, , AC_MSG_ERROR([
118         *** GLib not found. You can find it on ftp://ftp.gtk.org
119         *** Errors follow:
120             $DEP_PKG_ERRORS]))
121
122 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
123 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
124
125 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
126
127 gtk_doc_min_version=0.6
128 if $GTKDOC ; then
129     gtk_doc_version=`gtkdoc-mkdb --version`
130     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
131     if perl <<EOF ; then
132         exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
133             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
134 EOF
135       AC_MSG_RESULT(yes)
136    else
137       AC_MSG_RESULT(no)
138         GTKDOC=false
139    fi
140 fi
141
142 atktargetlib=libatk-$ATK_API_VERSION.la
143
144 AC_SUBST(atktargetlib)
145
146 AC_MSG_CHECKING(whether make is GNU Make)
147 STRIP_BEGIN=
148 STRIP_END=
149 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
150         STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
151         STRIP_END=')'
152         AC_MSG_RESULT(yes)
153 else
154         AC_MSG_RESULT(no)
155 fi
156 STRIP_DUMMY=
157 AC_SUBST(STRIP_DUMMY)
158 AC_SUBST(STRIP_BEGIN)
159 AC_SUBST(STRIP_END)
160
161 dnl Disable the gtk-doc stuff by default to avoid Jade hassles
162 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
163
164 if test x$enable_gtk_doc = xyes ; then
165   if test x$GTKDOC = xtrue ; then
166     enable_gtk_doc=yes
167   else
168     enable_gtk_doc=no
169   fi
170 fi
171
172 dnl NOTE: We need to use a separate automake conditional for this
173 dnl       to make this work with the tarballs.
174 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
175
176 # define a MAINT-like variable REBUILD which is set if Perl
177 # and awk are found, so autogenerated sources can be rebuilt
178
179 AC_PROG_AWK
180 AC_CHECK_PROGS(PERL, perl5 perl)
181
182 REBUILD=\#
183 if test "x$enable_rebuilds" = "xyes" && \
184         test -n "$PERL" && \
185         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
186      test -n "$AWK" ; then
187   REBUILD=
188 fi
189 AC_SUBST(REBUILD)
190
191 AC_OUTPUT([
192 Makefile
193 atk.pc
194 atk-uninstalled.pc
195 atk/Makefile
196 tests/Makefile
197 docs/Makefile
198 atk.spec
199 atk-zip.sh
200 ])