Automatically generates plugins for available file-managers
[nautilus-actions.git] / m4 / fma-fm-nemo.m4
blob4ddf6e4bb8e97bb831c0903a6d310d616e134a39
1 # FileManager-Actions
2 # A file-manager 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-2015 Pierre Wieser and others (see AUTHORS)
8 # FileManager-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 # FileManager-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 FileManager-Actions; see the file COPYING. If not, see
20 # <http://www.gnu.org/licenses/>.
22 # Authors:
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 1 introduce FMA_CHECK_FOR_NEMO
30 dnl Usage: FMA_CHECK_FOR_NEMO
31 dnl Decription: Whether the user has specified '--with-nemo' or does
32 dnl   not have specified anything (while he does not have specified
33 dnl   --without-nemo), we are checking here if Nemo is a suitable
34 dnl   target file manager.
35 dnl   This requires that the extensions library be installed, and that
36 dnl   the extensions directory be defined.
37 dnl
38 AC_DEFUN([FMA_CHECK_FOR_NEMO],[
39         with_nemo_ok="no"
40         AC_REQUIRE([_FMA_NEMO_EXTDIR])
41         if test "${with_nemo_extdir}" = ""; then
42                 AC_MSG_WARN([Unable to determine Nemo extension folder, please use --with-nemo-extdir option])
43         else
44                 FMA_CHECK_MODULE([NEMO_EXTENSION],[libnemo-extension],[${nemo_required}],[yes])
45                 if test "${have_NEMO_EXTENSION}" = "yes"; then
46                         with_nemo_ok="yes"
47                 fi
48         fi
49         if test "${with_nemo_ok}" = "yes"; then
50                 # Check for menu update function
51                 AC_CHECK_LIB([nemo-extension],[nemo_menu_item_new],[],[with_nemo_ok="no"])
52                 # doesn't make these two checks fatal
53                 AC_CHECK_FUNCS([nemo_menu_provider_emit_items_updated_signal])
54                 AC_CHECK_FUNCS([nemo_menu_provider_get_toolbar_items])
55         fi
56         if test "${with_nemo_ok}" = "yes"; then
57                 AC_MSG_NOTICE([installing Nemo plugins in ${with_nemo_extdir}])
58                 AC_SUBST([NEMO_EXTENSIONS_DIR],[${with_nemo_extdir}])
59         fi
62 # let the user specify an alternate nemo-extension dir
63 # --with-nemo-extdir=<dir>
65 AC_DEFUN([_FMA_NEMO_EXTDIR],[
66         
67         AC_ARG_WITH([nemo-extdir],
68                 AC_HELP_STRING(
69                         [--with-nemo-extdir=DIR],
70                         [Nemo extensions directory @<:@auto@:>@]),
71                 [with_nemo_extdir=$withval],
72                 [with_nemo_extdir=""])
74         if test "${with_nemo_extdir}" = ""; then
75                 if test "{PKG_CONFIG}" != ""; then
76                         with_nemo_extdir=`${PKG_CONFIG} --variable=extensiondir libnemo-extension`
77                 fi
78         fi