1# Nautilus-Actions
2# A Nautilus 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)
6# Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
7#
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.
12#
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.
17#
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/>.
21#
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)
27
28AC_PREREQ([2.53])
29
30AC_INIT([Nautilus-Actions],[3.2.4],[maintainer@nautilus-actions.org],,[http://www.nautilus-actions.org])
31
32m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33AC_CANONICAL_TARGET
34AM_INIT_AUTOMAKE
35
36AC_CONFIG_SRCDIR([src/nact/main.c])
37AC_CONFIG_HEADERS([src/config.h])
38
39AC_CONFIG_MACRO_DIR([m4])
40
41# check for compiler characteristics and options
42AC_PROG_CC
43AC_PROG_GCC_TRADITIONAL
44AC_STDC_HEADERS
45AM_DISABLE_STATIC
46
47# define specific compilation options
48NA_COMPILER_WARNINGS([],[-ansi -Wno-overlength-strings -Wformat=2])
49NA_COMPILER_LINK_AS_NEEDED
50AC_SUBST([AM_CFLAGS],["${AM_CFLAGS} ${WARN_CFLAGS}"])
51
52# other traditional tools
53AC_PROG_INSTALL
54AC_PROG_MAKE_SET
55
56# Gnome stuff
57GNOME_COMMON_INIT
58NA_MAINTAINER_CHECK_MODE
59
60# libtool
61AM_PROG_LIBTOOL
62
63# localization
64# note that this same version is also required by autogen.sh
65IT_PROG_INTLTOOL([0.35.5])
66GETTEXT_PACKAGE=${PACKAGE}
67AC_SUBST([GETTEXT_PACKAGE])
68AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["${GETTEXT_PACKAGE}"],[gettext package])
69AM_GLIB_GNU_GETTEXT
70
71# a counter of fatal warnings emitted
72let na_fatal_count=0
73
74# we are using pkgconfig for all development libraries we need
75AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
76if test "${PKG_CONFIG}" = "no"; then
77	AC_MSG_ERROR([You need to install pkg-config])
78fi
79
80# Have and want GConf support ?
81NA_CHECK_FOR_GCONF
82
83# Oldest supported distribution as of Apr. 2013: Ubuntu 10 LTS (Gnome 2.30)
84glib_required=2.24.0
85gtk_required=2.20.0
86NA_CHECK_FOR_GTK
87NA_CHECK_MODULE([GLIB],    [glib-2.0 >= ${glib_required}])
88NA_CHECK_MODULE([GMODULE], [gmodule-2.0 >= ${glib_required}])
89
90# GDBus comes in GIO with 2.26
91# so uses GDBus if present, or fallback into dbus-glib-1
92NA_CHECK_FOR_GDBUS
93
94# other required libraries
95dnl aclocal complains if the comma is not just after the square bracket
96NA_CHECK_MODULE([GIO_UNIX],[gio-unix-2.0])
97NA_CHECK_MODULE([GTOP],    [libgtop-2.0 >= 2.23.1])
98NA_CHECK_MODULE([LIBXML],  [libxml-2.0 >= 2.6])
99NA_CHECK_MODULE([SM],      [sm >= 1.0])
100NA_CHECK_MODULE([ICE],     [ice])
101NA_CHECK_MODULE([UUID],    [uuid])
102
103# GLib marshaling
104AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
105if test "${GLIB_GENMARSHAL}" = "no"; then
106	AC_MSG_WARN([glib2-devel installed, but glib-genmarshal not found])
107	let na_fatal_count+=1
108fi
109
110##
111## Nautilus file-manager
112##
113NA_CHECK_MODULE([NAUTILUS_EXTENSION],[libnautilus-extension >= 2.16])
114#
115# when working in a test environment, nautilus extensions are typically
116# installed in a non-standard location ; lets specify this location here
117NA_NAUTILUS_EXTDIR
118#
119# Check for menu update function
120AC_CHECK_LIB([nautilus-extension],[nautilus_menu_item_new])
121AC_CHECK_FUNCS([nautilus_menu_provider_emit_items_updated_signal])
122#
123# starting with 2.91.90, Nautilus no more allows extensions to add toolbar items
124AC_CHECK_FUNCS([nautilus_menu_provider_get_toolbar_items])
125
126AC_SUBST([NAUTILUS_ACTIONS_CFLAGS])
127AC_SUBST([NAUTILUS_ACTIONS_LIBS])
128
129# defines a log domain for each component
130NA_LOG_DOMAINS
131
132# add --with-default-io-provider option
133NA_SET_DEFAULT_IO_PROVIDER([io-desktop])
134
135###
136
137AC_CONFIG_FILES([
138	Makefile
139	data/Makefile
140	data/actions/Makefile
141	data/exports/Makefile
142	data/gconf-schemas/Makefile
143	docs/Makefile
144	docs/nact/Makefile
145	docs/reference/Makefile
146	docs/reference/version.xml
147	m4/Makefile
148	icons/Makefile
149	icons/16x16/Makefile
150	icons/22x22/Makefile
151	icons/32x32/Makefile
152	icons/48x48/Makefile
153	icons/scalable/Makefile
154	src/Makefile
155	src/api/Makefile
156	src/core/Makefile
157	src/io-desktop/Makefile
158	src/io-gconf/Makefile
159	src/io-xml/Makefile
160	src/plugin-menu/Makefile
161	src/plugin-tracker/Makefile
162	src/nact/Makefile
163	src/test/Makefile
164	src/utils/Makefile
165	po/Makefile.in
166	maintainer/Makefile
167])
168
169# Enable deprecated functions ?
170NA_MAINTAINER_CHECK_FOR_DEPRECATED
171
172# check for gtk-doc
173# - starting with gtk-doc 1.16, is able to handle srcdir != builddir
174# - API documentation should not be built (would be incomplete) when deprecated
175#   symbols are not enabled
176GTK_DOC_CHECK([1.16],[--flavour no-tmpl])
177if test "${enable_gtk_doc}" = "yes" -a "${enable_deprecated}" = "no"; then
178	AC_MSG_WARN([API documentation will be incomplete as deprecated symbols are disabled])
179fi
180
181# check for gnome-doc-utils
182# - starting with N-A 3.1.5, gnome-doc-utils is no more required when one want
183#   compile the tarball distribution (i.e. without regenerating users's manuals)
184GNOME_DOC_INIT(,,[gdu_cv_have_gdu=no])
185
186# add --enable-html-manuals and --enable-pdf-manuals configure options
187NA_ENABLE_MANUALS
188
189# define NA_MAINTAINER_MODE variable
190NA_MAINTAINER_CHECK_MODE
191AC_DEFINE([NAUTILUS_ACTIONS_DEBUG],["NAUTILUS_ACTIONS_DEBUG"],[Debug environment variable])
192
193# display and keep configuration informations
194config_options="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
195AC_DEFINE_UNQUOTED([NA_CONFIG_OPTIONS],["$0 ${config_options}"],["Configure options"])
196
197AC_OUTPUT
198
199msg_gtk_doc=`if test "x${enable_gtk_doc}" = "xno"; then echo "disabled"; else echo "enabled"; fi`
200msg_gtk_version=""
201if test "${have_gtk3}" = "yes"; then msg_gtk_version="Gtk+ 3.0";
202	elif  test "${have_gtk2}" = "yes"; then msg_gtk_version="Gtk+ 2.0"; fi
203$as_echo "
204	${PACKAGE_STRING} configuration summary:
205
206	Installation prefix             ${prefix}
207	Build system type               ${ac_cv_build}
208	Nautilus extensions directory   ${with_nautilus_extdir}
209	Gtk+ version                    ${msg_gtk_version}
210	Default I/O provider            ${with_default_io_provider}
211	Enable deprecated functions     ${enable_deprecated}
212	GConf enabled                   ${enable_gconf}
213	GConf schemas installation      ${msg_schemas_install}
214	Maintainer mode                 ${msg_maintainer_mode}
215	API Reference generation        ${msg_gtk_doc}
216	HTML User's Manuals generation  ${msg_html_manuals}
217	PDF User's Manuals generation   ${msg_pdf_manuals}
218"
219#	Preprocessor flags              ${AM_CPPFLAGS}
220#	Compiler flags                  ${AM_CFLAGS} ${NAUTILUS_ACTIONS_CFLAGS}
221#	Linker flags                    ${NAUTILUS_ACTIONS_LIBS}
222