updated
[platform/upstream/atk.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(ChangeLog)
4 AM_INIT_AUTOMAKE(atk, 0.2)
5
6 #
7 # Making releases:
8 #   ATK_MICRO_VERSION += 1;
9 #   ATK_INTERFACE_AGE += 1;
10 #   ATK_BINARY_AGE += 1;
11 # if any functions have been added, set ATK_INTERFACE_AGE to 0.
12 # if backwards compatibility has been broken,
13 # set ATK_BINARY_AGE and ATK_INTERFACE_AGE to 0.
14 #
15
16 ATK_MAJOR_VERSION=0
17 ATK_MINOR_VERSION=0
18 ATK_MICRO_VERSION=2
19 ATK_INTERFACE_AGE=0
20 ATK_BINARY_AGE=0
21 ## post-1.0 you'd add MINOR_VERSION in here, i.e. 0.3->1.0->1.0.1->1.0.2
22 ## note that micro version has to go in the libtool stuff below
23 ATK_VERSION=$ATK_MAJOR_VERSION.$ATK_MICRO_VERSION
24
25 AC_SUBST(ATK_MAJOR_VERSION)
26 AC_SUBST(ATK_MINOR_VERSION)
27 AC_SUBST(ATK_MICRO_VERSION)
28 AC_SUBST(ATK_VERSION)
29
30 # libtool versioning
31 LT_RELEASE=$ATK_MAJOR_VERSION.$ATK_MINOR_VERSION
32 LT_CURRENT=`expr $ATK_MICRO_VERSION - $ATK_INTERFACE_AGE`
33 LT_REVISION=$ATK_INTERFACE_AGE
34 LT_AGE=`expr $ATK_BINARY_AGE - $ATK_INTERFACE_AGE`
35 AC_SUBST(LT_RELEASE)
36 AC_SUBST(LT_CURRENT)
37 AC_SUBST(LT_REVISION)
38 AC_SUBST(LT_AGE)
39
40 AC_PROG_CC
41 AM_DISABLE_STATIC
42 AM_PROG_LIBTOOL
43
44 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
45
46 changequote(,)dnl
47 if test "x$GCC" = "xyes"; then
48   case " $CFLAGS " in
49   *[\ \ ]-Wall[\ \      ]*) ;;
50   *) CFLAGS="$CFLAGS -Wall" ;;
51   esac
52 fi
53 changequote([,])dnl
54
55 GLIB_PACKAGES="gobject-2.0 gmodule-2.0"
56 AC_SUBST(GLIB_PACKAGES)
57 GLIB_REQUIRED_VERSION=1.3.2
58
59 PANGO_PACKAGES="pango"
60 AC_SUBST(PANGO_PACKAGES)
61
62 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and 
63 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
64 dnl Makefile
65 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION)
66
67 PKG_CHECK_MODULES(DEP, glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES $PANGO_PACKAGES, , AC_MSG_ERROR([
68         *** GLib or Pango not found. You can find these on ftp://ftp.gtk.org
69         *** Errors follow:
70             $DEP_PKG_ERRORS]))
71
72 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
73 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES $PANGO_PACKAGES gthread-2.0`
74
75 if $PKG_CONFIG --uninstalled $GLIB_PACKAGES $PANGO_PACKAGES; then
76         :
77 else
78         AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
79                 *** Can't link to Pango. Pango is required to build
80                 *** ATK. For more information see http://www.pango.org]), $DEP_LIBS)
81 fi
82
83 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
84
85 gtk_doc_min_version=0.6
86 if $GTKDOC ; then
87     gtk_doc_version=`gtkdoc-mkdb --version`
88     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
89     if perl <<EOF ; then
90         exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
91             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
92 EOF
93       AC_MSG_RESULT(yes)
94    else
95       AC_MSG_RESULT(no)
96         GTKDOC=false
97    fi
98 fi
99
100 dnl Let people disable the gtk-doc stuff.
101 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
102
103 if test x$enable_gtk_doc = xauto ; then
104   if test x$GTKDOC = xtrue ; then
105     enable_gtk_doc=yes
106   else
107     enable_gtk_doc=no
108   fi
109 fi
110
111 dnl NOTE: We need to use a separate automake conditional for this
112 dnl       to make this work with the tarballs.
113 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
114
115 # define a MAINT-like variable REBUILD which is set if Perl
116 # and awk are found, so autogenerated sources can be rebuilt
117
118 AC_PROG_AWK
119 AC_CHECK_PROGS(PERL, perl5 perl)
120
121 REBUILD=\#
122 if test "x$enable_rebuilds" = "xyes" && \
123         test -n "$PERL" && \
124         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
125      test -n "$AWK" ; then
126   REBUILD=
127 fi
128 AC_SUBST(REBUILD)
129
130 AC_OUTPUT([
131 Makefile
132 atk.pc
133 atk-uninstalled.pc
134 atk/Makefile
135 tests/Makefile
136 docs/Makefile
137 ])