c1de6e1e080cde2a31c0fc9de3155163fea671d5
[platform/upstream/atk.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 ATK_MAJOR_VERSION=0
4 ATK_MINOR_VERSION=1
5
6 AC_SUBST(ATK_MAJOR_VERSION)
7 AC_SUBST(ATK_MINOR_VERSION)
8
9 AC_INIT(ChangeLog)
10 AM_INIT_AUTOMAKE(atk, 0.1)
11
12 AC_PROG_CC
13 AM_DISABLE_STATIC
14 AM_PROG_LIBTOOL
15
16 AC_ARG_ENABLE(rebuilds, [  --disable-rebuilds      disable all source autogeneration rules],,enable_rebuilds=yes)
17
18 changequote(,)dnl
19 if test "x$GCC" = "xyes"; then
20   case " $CFLAGS " in
21   *[\ \ ]-Wall[\ \      ]*) ;;
22   *) CFLAGS="$CFLAGS -Wall" ;;
23   esac
24 fi
25 changequote([,])dnl
26
27 GLIB_PACKAGES="gobject-2.0 gmodule-2.0 gthread-2.0"
28 AC_SUBST(GLIB_PACKAGES)
29 GLIB_REQUIRED_VERSION=1.3.2
30
31 PANGO_PACKAGES="pango"
32 AC_SUBST(PANGO_PACKAGES)
33
34 dnl This PATH_GLIB is somewhat redundant, but does a sanity compile and 
35 dnl importantly defines the GLIB_GENMARSHAL variable for subst into the
36 dnl Makefile
37 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION)
38
39 PKG_CHECK_MODULES(DEP, glib-2.0 >= $GLIB_REQUIRED_VERSION $GLIB_PACKAGES $PANGO_PACKAGES, , AC_MSG_ERROR([
40         *** GLib or Pango not found. You can find these on ftp://ftp.gtk.org
41         *** Errors follow:
42             $DEP_PKG_ERRORS]))
43
44 if $PKG_CONFIG --uninstalled $GLIB_PACKAGES $PANGO_PACKAGES; then
45         :
46 else
47         AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
48                 *** Can't link to Pango. Pango is required to build
49                 *** GTK+. For more information see http://www.pango.org]), $DEP_LIBS)
50 fi
51
52 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
53
54 gtk_doc_min_version=0.6
55 if $GTKDOC ; then
56     gtk_doc_version=`gtkdoc-mkdb --version`
57     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
58     if perl <<EOF ; then
59         exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
60             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
61 EOF
62       AC_MSG_RESULT(yes)
63    else
64       AC_MSG_RESULT(no)
65         GTKDOC=false
66    fi
67 fi
68
69 dnl Let people disable the gtk-doc stuff.
70 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
71
72 if test x$enable_gtk_doc = xauto ; then
73   if test x$GTKDOC = xtrue ; then
74     enable_gtk_doc=yes
75   else
76     enable_gtk_doc=no
77   fi
78 fi
79
80 dnl NOTE: We need to use a separate automake conditional for this
81 dnl       to make this work with the tarballs.
82 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
83
84 # define a MAINT-like variable REBUILD which is set if Perl
85 # and awk are found, so autogenerated sources can be rebuilt
86
87 AC_PROG_AWK
88 AC_CHECK_PROGS(PERL, perl5 perl)
89
90 REBUILD=\#
91 if test "x$enable_rebuilds" = "xyes" && \
92         test -n "$PERL" && \
93         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
94      test -n "$AWK" ; then
95   REBUILD=
96 fi
97 AC_SUBST(REBUILD)
98
99 AC_OUTPUT([
100 Makefile
101 atk.pc
102 atk-uninstalled.pc
103 atk/Makefile
104 tests/Makefile
105 docs/Makefile
106 ])