Updated and new screenshots for Nautilus-Actions Configuration Tool 3.1
[nautilus-actions.git] / m4 / na-check-module.m4
blob49a2733221ff2d26fb9833d2381c43d217489d5e
1 # Nautilus-Actions
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.
23 # Authors:
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)
29 # serial 1 creation
31 dnl usage:  NA_CHECK_MODULE(var,condition[,error])
32 dnl
33 dnl this macro checks that gtk+-2.0 and gtk+-3.0 libraries are not mixed
34 dnl
35 dnl if 'error' != 'no', then displays an error message if condition is
36 dnl not met.
37 # translit($1, 'a-z', 'A-Z'),
39 AC_DEFUN([NA_CHECK_MODULE],[
40         PKG_CHECK_MODULES([$1],[$2],[have_$1="yes"],[have_$1="no"])
42         #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3"
43         #echo "$1_CFLAGS='${$1_CFLAGS}'"
44         #echo "$1_LIBS='${$1_LIBS}'"
45         #echo "against Gtk2: $(echo ${$1_LIBS} | grep -E 'gtk-@<:@^-@:>@+-2\.0')"
46         #echo "against Gtk3: $(echo ${$1_LIBS} | grep -E 'gtk-@<:@^-@:>@+-3\.0')"
48         if test "${have_$1}" = "yes"; then
49                 if test "${have_gtk3}" = "yes"; then
50                         if echo ${$1_LIBS} | grep -qE 'gtk-@<:@^-@:>@+-2\.0'; then
51                                 _NA_CHECK_MODULE_MSG([$3],[$1: compiling with Gtk+-3 but adresses Gtk+-2 libraries])
52                                 have_$1="no"
53                         fi
54                 elif test "${have_gtk2}" = "yes"; then
55                         if echo ${$1_LIBS} | grep -qE 'gtk-@<:@^-@:>@+-3.0'; then
56                                 _NA_CHECK_MODULE_MSG([$3],[$1: compiling with Gtk+-2 but adresses Gtk+-3 libraries])
57                                 have_$1="no"
58                         fi
59                 fi
60         else
61                 _NA_CHECK_MODULE_MSG([$3],[$1: condition $2 not satisfied])
62         fi
64         if test "${have_$1}" = "yes"; then
65                 NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${$1_CFLAGS}"
66                 NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${$1_LIBS}"
67         fi
70 AC_DEFUN([_NA_CHECK_MODULE_MSG],[
71         if test "$1" = "no"; then
72                 AC_MSG_RESULT([warning: $2])
73         else
74                 AC_MSG_ERROR([$2])
75         fi