5f56cebf5b5d9f4f537aa6c0d18bf1febed14a88
[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 AM_CONFIG_HEADER(config.h)
6
7 dnl ==========================================================================
8 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!
11 dnl
12 dnl ==========================================================================
13
14 GLIB_REQUIRED_VERSION=2.0.0
15 AC_SUBST(GLIB_REQUIRED_VERSION)
16
17 dnl ==========================================================================
18 dnl                              Versioning              
19 dnl ==========================================================================
20
21 dnl Making releases:
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.
28
29 dnl The triplet 
30 ATK_MAJOR_VERSION=1
31 ATK_MINOR_VERSION=1
32 ATK_MICRO_VERSION=0
33 ATK_VERSION=$ATK_MAJOR_VERSION.$ATK_MINOR_VERSION.$ATK_MICRO_VERSION
34
35 dnl The X.Y in -latk-X.Y line. This is expected to stay 1.0 until Atk 2.
36 ATK_API_VERSION=1.0
37
38 dnl Number of releases since we've added interfaces
39 ATK_INTERFACE_AGE=0
40
41 ATK_BINARY_AGE=100
42
43 AC_SUBST(ATK_MAJOR_VERSION)
44 AC_SUBST(ATK_MINOR_VERSION)
45 AC_SUBST(ATK_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)
50
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`
57
58 AC_SUBST(LT_VERSION_INFO)
59 AC_SUBST(LT_CURRENT_MINUS_AGE)
60
61 dnl ==========================================================================
62
63 AM_INIT_AUTOMAKE(atk,$ATK_VERSION)
64
65 GETTEXT_PACKAGE=atk10
66 AC_SUBST(GETTEXT_PACKAGE)
67 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
68
69 ALL_LINGUAS=""
70 AM_GLIB_GNU_GETTEXT
71
72 AC_PROG_CC
73 AM_DISABLE_STATIC
74 AC_LIBTOOL_WIN32_DLL
75 AM_PROG_LIBTOOL
76
77 AC_MSG_CHECKING([for Win32])
78 case "$host" in
79   *-*-mingw*)
80     atk_native_win32=yes
81     ;;
82   *)
83     atk_native_win32=no
84     ;;
85 esac
86 AC_MSG_RESULT([$atk_native_win32])
87 AM_CONDITIONAL(OS_WIN32, test "$atk_native_win32" = "yes")
88
89 if test "$atk_native_win32" = "yes"; then
90   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
91 fi
92 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
93
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"
97 ])
98 ACLOCAL="$ACLOCAL $ac_cv_atk_aclocal_flags"
99
100 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
101
102 changequote(,)dnl
103 if test "x$GCC" = "xyes"; then
104   case " $CFLAGS " in
105   *[\ \ ]-Wall[\ \      ]*) ;;
106   *) CFLAGS="$CFLAGS -Wall" ;;
107   esac
108 fi
109 changequote([,])dnl
110
111 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
112 AC_SUBST(GLIB_PACKAGES)
113
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
116 dnl Makefile
117 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
118   AC_MSG_ERROR([
119 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of 
120 *** GLIB is always available from ftp://ftp.gtk.org/.]),
121   gobject gmodule)
122
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
125         *** Errors follow:
126             $DEP_PKG_ERRORS]))
127
128 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
129 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES gthread-2.0`
130
131 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
132
133 gtk_doc_min_version=0.6
134 if $GTKDOC ; then
135     gtk_doc_version=`gtkdoc-mkdb --version`
136     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
137     if perl <<EOF ; then
138         exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
139             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
140 EOF
141       AC_MSG_RESULT(yes)
142    else
143       AC_MSG_RESULT(no)
144         GTKDOC=false
145    fi
146 fi
147
148 atktargetlib=libatk-$ATK_API_VERSION.la
149
150 AC_SUBST(atktargetlib)
151
152 AC_MSG_CHECKING(whether make is GNU Make)
153 STRIP_BEGIN=
154 STRIP_END=
155 if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
156         STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
157         STRIP_END=')'
158         AC_MSG_RESULT(yes)
159 else
160         AC_MSG_RESULT(no)
161 fi
162 STRIP_DUMMY=
163 AC_SUBST(STRIP_DUMMY)
164 AC_SUBST(STRIP_BEGIN)
165 AC_SUBST(STRIP_END)
166
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)
169
170 if test x$enable_gtk_doc = xyes ; then
171   if test x$GTKDOC = xtrue ; then
172     enable_gtk_doc=yes
173   else
174     enable_gtk_doc=no
175   fi
176 fi
177
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)
181
182 # define a MAINT-like variable REBUILD which is set if Perl
183 # and awk are found, so autogenerated sources can be rebuilt
184
185 AC_PROG_AWK
186 AC_CHECK_PROGS(PERL, perl5 perl)
187
188 REBUILD=\#
189 if test "x$enable_rebuilds" = "xyes" && \
190         test -n "$PERL" && \
191         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
192      test -n "$AWK" ; then
193   REBUILD=
194 fi
195 AC_SUBST(REBUILD)
196
197 AC_OUTPUT([
198 Makefile
199 po/Makefile.in
200 atk.pc
201 atk-uninstalled.pc
202 atk/Makefile
203 tests/Makefile
204 docs/Makefile
205 atk.spec
206 atk-zip.sh
207 ])