fma-fm-nautilus.m4 3.06 KB
Newer Older
1 2
# FileManager-Actions
# A file-manager extension which offers configurable context menu actions.
3 4
#
# Copyright (C) 2005 The GNOME Foundation
5
# Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
Pierre Wieser's avatar
Pierre Wieser committed
6
# Copyright (C) 2009-2015 Pierre Wieser and others (see AUTHORS)
7
#
8
# FileManager-Actions is free software; you can redistribute it and/or
9 10
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
11 12
# the License, or (at your option) any later version.
#
13
# FileManager-Actions is distributed in the hope that it will be useful,
14 15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
# General Public License for more details.
17
#
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/>.
21 22 23 24 25
#
# Authors:
#   Frederic Ruaudel <grumz@grumz.net>
#   Rodrigo Moya <rodrigo@gnome-db.org>
#   Pierre Wieser <pwieser@trychlos.org>
Pierre Wieser's avatar
Pierre Wieser committed
26
#   ... and many others (see AUTHORS)
27

28
# serial 3 introduce FMA_CHECK_FOR_NAUTILUS
29

30 31 32 33 34 35 36 37 38 39 40
dnl Usage: FMA_CHECK_FOR_NAUTILUS
dnl Decription: Whether the user has specified '--with-nautilus' or does
dnl   not have specified anything (while he does not have specified
dnl   --without-nautilus), we are checking here if Nautilus is a suitable
dnl   target file manager.
dnl   This requires that the extensions library be installed, and that
dnl   the extensions directory be defined.
dnl
AC_DEFUN([FMA_CHECK_FOR_NAUTILUS],[
	with_nautilus_ok="no"
	AC_REQUIRE([_FMA_NAUTILUS_EXTDIR])
41
	if test "${with_nautilus_extdir}" = ""; then
42
		AC_MSG_WARN([Unable to determine Nautilus extension folder, please use --with-nautilus-extdir option])
43
	else
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
		FMA_CHECK_MODULE([NAUTILUS_EXTENSION],[libnautilus-extension],[${nautilus_required}],[yes])
		if test "${have_NAUTILUS_EXTENSION}" = "yes"; then
			with_nautilus_ok="yes"
		fi
	fi
	if test "${with_nautilus_ok}" = "yes"; then
		# Check for menu update function
		AC_CHECK_LIB([nautilus-extension],[nautilus_menu_item_new],[],[with_nautilus_ok="no"])
		# doesn't make the two following checks fatal
		AC_CHECK_FUNCS([nautilus_menu_provider_emit_items_updated_signal])
		# starting with 2.91.90, Nautilus no more allows extensions to
		#  add toolbar items
		AC_CHECK_FUNCS([nautilus_menu_provider_get_toolbar_items])
	fi
	if test "${with_nautilus_ok}" = "yes"; then
		AC_MSG_NOTICE([installing Nautilus plugins in ${with_nautilus_extdir}])
60
		AC_SUBST([NAUTILUS_EXTENSIONS_DIR],[${with_nautilus_extdir}])
61 62 63
	fi
])

64 65 66 67 68 69
# let the user specify an alternate nautilus-extension dir
# --with-nautilus-extdir=<dir>
#
AC_DEFUN([_FMA_NAUTILUS_EXTDIR],[
	
	AC_ARG_WITH([nautilus-extdir],
70 71
		AC_HELP_STRING(
			[--with-nautilus-extdir=DIR],
72 73 74
			[Nautilus extensions directory @<:@auto@:>@]),
		[with_nautilus_extdir=$withval],
		[with_nautilus_extdir=""])
75

76
	if test "${with_nautilus_extdir}" = ""; then
77
		if test "{PKG_CONFIG}" != ""; then
78
			with_nautilus_extdir=`${PKG_CONFIG} --variable=extensiondir libnautilus-extension`
79 80 81
		fi
	fi
])