2 # A Nautilus extension which offers configurable context menu actions.
4 # Copyright (C) 2005 The GNOME Foundation
5 # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
6 # Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
8 # Nautilus-Actions 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 # Nautilus-Actions 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 GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Nautilus-Actions; see the file COPYING. If not, see
20 # <http://www.gnu.org/licenses/>.
23 # Frederic Ruaudel <grumz@grumz.net>
24 # Rodrigo Moya <rodrigo@gnome-db.org>
25 # Pierre Wieser <pwieser@trychlos.org>
26 # ... and many others (see AUTHORS)
28 # serial 2 review the macro behavior
29 # add version of selected packages
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],[
45 [--with-gtk=@<:@2|3@:>@],
46 [the Gtk+ version to build against @<:@auto@:>@]),
51 AC_DEFUN([_AC_NA_CHECK_GTK],[
52 if test "${with_gtk}" = "auto"; then
54 if test "${have_gtk3}" != "yes"; then
56 if test "${have_gtk2}" != "yes"; then
57 AC_MSG_WARN([unable to find any suitable Gtk+ development library])
62 if test "${with_gtk}" = "2"; then
64 if test "${have_gtk2}" != "yes"; then
65 AC_MSG_WARN([unable to build against Gtk+ v2; try to install gtk2-devel package])
69 if test "${with_gtk}" = "3"; then
71 if test "${have_gtk3}" != "yes"; then
72 AC_MSG_WARN([unable to build against Gtk+ v3; try to install gtk3-devel package])
76 AC_MSG_WARN([--with-gtk=${with_gtk}: invalid argument])
83 dnl test for Gtk+-3.0 and its dependancies
84 dnl set have_gtk3=yes if all is ok
86 AC_DEFUN([_AC_NA_CHECK_FOR_GTK3],[
87 PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= ${gtk_required}],[have_gtk3=yes],[have_gtk3=no])
89 if test "${have_gtk3}" = "yes"; then
90 NA_CHECK_MODULE([UNIQUE],[unique-3.0],[no])
91 if test "${have_UNIQUE}" != "yes"; then
94 msg_gtk_version=$(pkg-config --modversion gtk+-3.0)
95 msg_unique_version=$(pkg-config --modversion unique-3.0)
96 NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK3_CFLAGS}"
97 NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK3_LIBS}"
102 dnl test for Gtk+-2.0 and its dependancies
103 dnl set have_gtk2=yes if all is ok
105 AC_DEFUN([_AC_NA_CHECK_FOR_GTK2],[
106 PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ${gtk_required}],[have_gtk2=yes],[have_gtk2=no])
108 if test "${have_gtk2}" = "yes"; then
109 NA_CHECK_MODULE([UNIQUE],[unique-1.0],[no])
110 if test "${have_UNIQUE}" != "yes"; then
113 msg_gtk_version=$(pkg-config --modversion gtk+-2.0)
114 msg_unique_version=$(pkg-config --modversion unique-1.0)
115 NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK2_CFLAGS}"
116 NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK2_LIBS}"