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.
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)
31 dnl let the user choose the Gtk+ version he wants build against
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],[
46 [--with-gtk=@<:@2|3@:>@],
47 [the Gtk+ version to build against @<:@auto@:>@]
54 AC_DEFUN([_AC_NA_CHECK_GTK],[
55 if test "${with_gtk}" = "auto"; then
57 if test "${have_gtk3}" != "yes"; then
59 if test "${have_gtk2}" != "yes"; then
60 AC_MSG_ERROR([unable to find any suitable Gtk+ library])
64 if test "${with_gtk}" = "2"; then
66 if test "${have_gtk2}" != "yes"; then
67 AC_MSG_ERROR([unable to build against Gtk+-2.0 library])
70 if test "${with_gtk}" = "3"; then
72 if test "${have_gtk3}" != "yes"; then
73 AC_MSG_ERROR([unable to build against Gtk+-3.0 library])
76 AC_MSG_ERROR([--with-gtk=${with_gtk}: invalid argument])
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
93 NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK3_CFLAGS}"
94 NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK3_LIBS}"
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
110 NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK2_CFLAGS}"
111 NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK2_LIBS}"