Only include gthread-2.0 in CFLAGS, not in LIBS. (Always linking with
[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"
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 # Rerun PKG_CONFIG to add gthread-2.0 cflags, but not libs
45 DEP_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES $PANGO_PACKAGES gthread-2.0`
46
47 if $PKG_CONFIG --uninstalled $GLIB_PACKAGES $PANGO_PACKAGES; then
48         :
49 else
50         AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([
51                 *** Can't link to Pango. Pango is required to build
52                 *** GTK+. For more information see http://www.pango.org]), $DEP_LIBS)
53 fi
54
55 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
56
57 gtk_doc_min_version=0.6
58 if $GTKDOC ; then
59     gtk_doc_version=`gtkdoc-mkdb --version`
60     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
61     if perl <<EOF ; then
62         exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
63             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
64 EOF
65       AC_MSG_RESULT(yes)
66    else
67       AC_MSG_RESULT(no)
68         GTKDOC=false
69    fi
70 fi
71
72 dnl Let people disable the gtk-doc stuff.
73 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
74
75 if test x$enable_gtk_doc = xauto ; then
76   if test x$GTKDOC = xtrue ; then
77     enable_gtk_doc=yes
78   else
79     enable_gtk_doc=no
80   fi
81 fi
82
83 dnl NOTE: We need to use a separate automake conditional for this
84 dnl       to make this work with the tarballs.
85 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
86
87 # define a MAINT-like variable REBUILD which is set if Perl
88 # and awk are found, so autogenerated sources can be rebuilt
89
90 AC_PROG_AWK
91 AC_CHECK_PROGS(PERL, perl5 perl)
92
93 REBUILD=\#
94 if test "x$enable_rebuilds" = "xyes" && \
95         test -n "$PERL" && \
96         $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
97      test -n "$AWK" ; then
98   REBUILD=
99 fi
100 AC_SUBST(REBUILD)
101
102 AC_OUTPUT([
103 Makefile
104 atk.pc
105 atk-uninstalled.pc
106 atk/Makefile
107 tests/Makefile
108 docs/Makefile
109 ])