na_updater_is_item_writable is renamed as na_updater_check_item_writability_status
[nautilus-actions.git] / m4 / na-check-for-gtk.m4
blobf8a7c6c50963f61c167c5a9fda2cc7297a2e366c
1 # Nautilus-Actions
2 # A Nautilus extension which offers configurable context menu actions.
4 # Copyright (C) 2005 The GNOME Foundation
5 # Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
6 # Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
8 # This Program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This Program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public
19 # License along with this Library; see the file COPYING.  If not,
20 # write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307, USA.
23 # Authors:
24 #   Frederic Ruaudel <grumz@grumz.net>
25 #   Rodrigo Moya <rodrigo@gnome-db.org>
26 #   Pierre Wieser <pwieser@trychlos.org>
27 #   ... and many others (see AUTHORS)
29 # serial 1 creation
31 dnl let the user choose the Gtk+ version he wants build against
32 dnl --with-gtk+=[2|3]
33 dnl
34 dnl if the --with-gtk+ option is specified, an argument is required
35 dnl else, Gtk+-3.0 is first tested, then Gtk+-2.0
37 AC_DEFUN([NA_CHECK_FOR_GTK],[
38         AC_REQUIRE([_AC_NA_ARG_GTK])dnl
39         AC_REQUIRE([_AC_NA_CHECK_GTK])dnl
42 AC_DEFUN([_AC_NA_ARG_GTK],[
43         AC_ARG_WITH(
44                 [gtk],
45                 AC_HELP_STRING(
46                         [--with-gtk=@<:@2|3@:>@],
47                         [the Gtk+ version to build against @<:@auto@:>@]
48                 ),
49         [with_gtk=$withval],
50         [with_gtk="auto"]
51         )
54 AC_DEFUN([_AC_NA_CHECK_GTK],[
55         if test "${with_gtk}" = "auto"; then
56                 _AC_NA_CHECK_FOR_GTK3
57                 if test "${have_gtk3}" != "yes"; then
58                         _AC_NA_CHECK_FOR_GTK2
59                         if test "${have_gtk2}" != "yes"; then
60                                 AC_MSG_ERROR([unable to find any suitable Gtk+ library])
61                         fi
62                 fi
63         else
64                 if test "${with_gtk}" = "2"; then
65                         _AC_NA_CHECK_FOR_GTK2
66                         if test "${have_gtk2}" != "yes"; then
67                                 AC_MSG_ERROR([unable to build against Gtk+-2.0 library])
68                         fi
69                 else
70                         if test "${with_gtk}" = "3"; then
71                                 _AC_NA_CHECK_FOR_GTK3
72                                 if test "${have_gtk3}" != "yes"; then
73                                         AC_MSG_ERROR([unable to build against Gtk+-3.0 library])
74                                 fi
75                         else
76                                 AC_MSG_ERROR([--with-gtk=${with_gtk}: invalid argument])
77                         fi
78                 fi
79         fi
82 dnl test for Gtk+-3.0 and its dependancies
83 dnl set have_gtk3=yes if all is ok
85 AC_DEFUN([_AC_NA_CHECK_FOR_GTK3],[
86         PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= ${gtk_required}],[have_gtk3=yes],[have_gtk3=no])
88         if test "${have_gtk3}" = "yes"; then
89                 NA_CHECK_MODULE([UNIQUE],[unique-3.0],[no])
90                 if test "${have_UNIQUE}" != "yes"; then
91                         have_gtk3="no"
92                 else 
93                         NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK3_CFLAGS}"
94                         NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK3_LIBS}"
95                 fi
96         fi
99 dnl test for Gtk+-2.0 and its dependancies
100 dnl set have_gtk2=yes if all is ok
102 AC_DEFUN([_AC_NA_CHECK_FOR_GTK2],[
103         PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ${gtk_required}],[have_gtk2=yes],[have_gtk2=no])
105         if test "${have_gtk2}" = "yes"; then
106                 NA_CHECK_MODULE([UNIQUE],[unique-1.0],[no])
107                 if test "${have_UNIQUE}" != "yes"; then
108                         have_gtk2="no"
109                 else 
110                         NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK2_CFLAGS}"
111                         NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK2_LIBS}"
112                 fi
113         fi