Git Repositories

Adding the thunar-wallpaper-plugin to the thunar package
[thunar.git] / acinclude.m4
1 dnl $Id$
2 dnl
3 dnl Copyright (c) 2004-2006
4 dnl         The Thunar development team. All rights reserved.
5 dnl
6 dnl Written for Thunar by Benedikt Meurer <benny@xfce.org>.
7 dnl
8
9
10
11 dnl # BM_THUNAR_PLUGIN_APR()
12 dnl #
13 dnl # Check whether the "Advanced Properties" plugin
14 dnl # should be built and installed.
15 dnl #
16 AC_DEFUN([BM_THUNAR_PLUGIN_APR],
17 [
18 AC_ARG_ENABLE([apr-plugin], [AC_HELP_STRING([--disable-apr-plugin], [Don't build the thunar-apr plugin, see plugins/thunar-apr/README])],
19   [ac_bm_thunar_plugin_apr=$enableval], [ac_bm_thunar_plugin_apr=yes])
20 AC_MSG_CHECKING([whether to build the thunar-apr plugin])
21 AM_CONDITIONAL([THUNAR_PLUGIN_APR], [test x"$ac_bm_thunar_plugin_apr" = x"yes"])
22 AC_MSG_RESULT([$ac_bm_thunar_plugin_apr])
23
24 dnl Check for libexif (for the "Image" properties page)
25 XDT_CHECK_OPTIONAL_PACKAGE([EXIF], [libexif], [0.6.0], [exif], [Exif support])
26 ])
27
28
29
30 dnl # BM_THUNAR_PLUGIN_SBR()
31 dnl #
32 dnl # Check whether the "Simple Builtin Renamers" plugin
33 dnl # should be built and installed.
34 dnl #
35 AC_DEFUN([BM_THUNAR_PLUGIN_SBR],
36 [
37 AC_ARG_ENABLE([sbr-plugin], AC_HELP_STRING([--disable-sbr-plugin], [Don't build the thunar-sbr plugin, see plugins/thunar-sbr/README]),
38   [ac_bm_thunar_plugin_sbr=$enableval], [ac_bm_thunar_plugin_sbr=yes])
39 AC_MSG_CHECKING([whether to build the thunar-sbr plugin])
40 AM_CONDITIONAL([THUNAR_PLUGIN_SBR], [test x"$ac_bm_thunar_plugin_sbr" = x"yes"])
41 AC_MSG_RESULT([$ac_bm_thunar_plugin_sbr])
42
43 dnl Check for PCRE (for the "Search & Replace" renamer)
44 XDT_CHECK_OPTIONAL_PACKAGE([PCRE], [libpcre], [6.0], [pcre], [Regular expression support])
45 ])
46
47
48
49 dnl # BM_THUNAR_PLUGIN_TPA()
50 dnl #
51 dnl # Check whether the "Trash Panel Applet" plugin should
52 dnl # be built and installed (this is actually a plugin
53 dnl # for the Xfce panel, not for Thunar).
54 dnl #
55 AC_DEFUN([BM_THUNAR_PLUGIN_TPA],
56 [
57 AC_ARG_ENABLE([tpa-plugin], AC_HELP_STRING([--disable-tpa-plugin], [Don't build the thunar-tpa plugin, see plugins/thunar-tpa/README]),
58   [ac_bm_thunar_plugin_tpa=$enableval], [ac_bm_thunar_plugin_tpa=yes])
59 if test x"$ac_bm_thunar_plugin_tpa" = x"yes"; then
60   XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.90],
61   [
62     dnl # Can only build thunar-tpa if D-BUS was found previously
63     ac_bm_thunar_plugin_tpa=$DBUS_FOUND
64   ],
65   [
66     dnl # Cannot build thunar-tpa if xfce4-panel is not installed
67     ac_bm_thunar_plugin_tpa=no
68   ])
69 else
70   ac_bm_thunar_plugin_tpa=no
71 fi
72 AC_MSG_CHECKING([whether to build the thunar-tpa plugin])
73 AM_CONDITIONAL([THUNAR_PLUGIN_TPA], [test x"$ac_bm_thunar_plugin_tpa" = x"yes"])
74 AC_MSG_RESULT([$ac_bm_thunar_plugin_tpa])
75 ])
76
77
78
79 dnl # BM_THUNAR_PLUGIN_UCA()
80 dnl #
81 dnl # Check whether the "User Customizable Actions" plugin
82 dnl # should be built and installed.
83 dnl #
84 AC_DEFUN([BM_THUNAR_PLUGIN_UCA],
85 [
86 AC_ARG_ENABLE([uca-plugin], AC_HELP_STRING([--disable-uca-plugin], [Don't build the thunar-uca plugin, see plugins/thunar-uca/README]),
87   [ac_bm_thunar_plugin_uca=$enableval], [ac_bm_thunar_plugin_uca=yes])
88 AC_MSG_CHECKING([whether to build the thunar-uca plugin])
89 AM_CONDITIONAL([THUNAR_PLUGIN_UCA], [test x"$ac_bm_thunar_plugin_uca" = x"yes"])
90 AC_MSG_RESULT([$ac_bm_thunar_plugin_uca])
91 ])
92
93 dnl # BM_THUNAR_PLUGIN_WALLPAPER()
94 dnl #
95 dnl # Check whether the "Wallpaper" plugin
96 dnl # should be built and installed.
97 dnl #
98 AC_DEFUN([BM_THUNAR_PLUGIN_WALLPAPER],
99 [
100 AC_ARG_ENABLE([wallpaper-plugin], AC_HELP_STRING([--disable-wallpaper-plugin], [Don't build the thunar-wallpaper plugin, see plugins/thunar-wallpaper/README]),
101   [ac_bm_thunar_plugin_wallpaper=$enableval], [ac_bm_thunar_plugin_wallpaper=yes])
102 AC_MSG_CHECKING([whether to build the thunar-wallpaper plugin])
103 AM_CONDITIONAL([THUNAR_PLUGIN_WALLPAPER], [test x"$ac_bm_thunar_plugin_wallpaper" = x"yes"])
104 AC_MSG_RESULT([$ac_bm_thunar_plugin_wallpaper])
105 XDT_CHECK_OPTIONAL_PACKAGE([XFCONF], [libxfconf-0], [4.5.91], [xfconf], [Xfconf support])
106 ])
107
108
109 dnl # BM_THUNAR_VFS_MONITOR_IMPL()
110 dnl #
111 dnl # Determine the file system monitoring to use for
112 dnl # thunar-vfs.
113 dnl #
114 dnl # Sets LIBFAM_CFLAGS and LIBFAM_LIBS and defines
115 dnl # HAVE_FAM_H and HAVE_LIBFAM if FAM/Gamin were
116 dnl # found.
117 dnl #
118 dnl # Sets $ac_bm_thunar_vfs_monitor_impl to "FAM",
119 dnl # "Gamin" or "none".
120 dnl #
121 AC_DEFUN([BM_THUNAR_VFS_MONITOR_IMPL],
122 [
123 LIBFAM_CFLAGS=""
124 LIBFAM_LIBS=""
125 have_libfam=no
126 ac_bm_thunar_vfs_monitor_impl="none"
127 XDT_CHECK_PACKAGE([LIBFAM], [gamin], [0.1.0],
128 [
129   have_libfam=yes
130   ac_bm_thunar_vfs_monitor_impl="Gamin"
131 ],
132 [
133   dnl Fallback to a generic FAM check
134   AC_CHECK_HEADERS([fam.h],
135   [
136     AC_CHECK_LIB([fam], [FAMOpen],
137     [
138       have_libfam="yes" LIBFAM_LIBS="-lfam"
139       ac_bm_thunar_vfs_monitor_impl="FAM"
140     ])
141   ])
142 ])
143 if test x"$have_libfam" = x"yes"; then
144   dnl Define appropriate symbols
145   AC_DEFINE([HAVE_FAM_H], [1], [Define to 1 if you have the <fam.h> header file.])
146   AC_DEFINE([HAVE_LIBFAM], [1], [Define to 1 if the File Alteration Monitor is available.])
147
148   dnl Check for FAMNoExists (currently Gamin only)
149   save_LIBS="$LIBS"
150   LIBS="$LIBS $LIBFAM_LIBS"
151   AC_CHECK_FUNCS([FAMNoExists])
152   LIBS="$save_LIBS"
153 fi
154 AC_SUBST([LIBFAM_CFLAGS])
155 AC_SUBST([LIBFAM_LIBS])
156 ])
157
158
159
160 dnl # BM_THUNAR_VFS_OS_IMPL()
161 dnl #
162 dnl # Determine the operating system support to use
163 dnl # for thunar-vfs.
164 dnl #
165 dnl # Sets ac_bm_thunar_vfs_os_impl to "bsd" or "generic" and
166 dnl # defines the automake conditional THUNAR_VFS_OS_IMPL_BSD.
167 dnl #
168 AC_DEFUN([BM_THUNAR_VFS_OS_IMPL],
169 [
170   dnl # Auto-detect target operating system support
171   AC_MSG_CHECKING([for operating system support])
172   case "$target_os" in
173   dragonfly*|freebsd*|netbsd*|openbsd*|darwin*)
174     dnl # The BSD Family is fully supported
175     ac_bm_thunar_vfs_os_impl=bsd
176     ;;
177
178   *)
179     dnl # Otherwise fallback to generic OS support
180     ac_bm_thunar_vfs_os_impl=generic
181   esac
182   AC_MSG_RESULT([$ac_bm_thunar_vfs_os_impl])
183
184   dnl # Set automake conditionals appropriately
185   AM_CONDITIONAL([THUNAR_VFS_OS_IMPL_BSD], [test x"$ac_bm_thunar_vfs_os_impl" = x"bsd"])
186 ])
187
188
189
190 dnl # BM_THUNAR_VFS_VOLUME_IMPL()
191 dnl #
192 dnl # Determines the volume manager implementation to
193 dnl # use for thunar-vfs.
194 dnl #
195 dnl # Sets ac_bm_thunar_vfs_volume_impl to "freebsd",
196 dnl # "hal" or "none".
197 dnl #
198 AC_DEFUN([BM_THUNAR_VFS_VOLUME_IMPL],
199 [
200   dnl The --with-volume-manager option
201   AC_ARG_WITH([volume-manager],
202 AC_HELP_STRING([--with-volume-manager=@<:@auto/freebsd/hal/none@:>@], [The volume manager implementation @<:@default=auto@:>@]),
203     [], [with_volume_manager=auto])
204
205   dnl # Check if we should try to auto-detect
206   if test x"$with_volume_manager" = x"freebsd"; then
207     ac_bm_thunar_vfs_volume_impl=freebsd
208   elif test x"$with_volume_manager" = x"hal"; then
209     ac_bm_thunar_vfs_volume_impl=hal
210   elif test x"$with_volume_manager" = x"none"; then
211     ac_bm_thunar_vfs_volume_impl=none
212   else
213     dnl # Check if HAL is available
214     XDT_CHECK_PACKAGE([HAL], [hal-storage], [0.5.0],
215     [
216       dnl # HAL is available, use it
217       ac_bm_thunar_vfs_volume_impl=hal
218     ],
219     [
220       dnl # Check operating system type
221       case "$target_os" in
222       freebsd*)
223         dnl # FreeBSD is fully supported
224         ac_bm_thunar_vfs_volume_impl=freebsd
225         ;;
226       *)
227         dnl # Otherwise no volume support
228         ac_bm_thunar_vfs_volume_impl=none
229         ;;
230       esac
231     ])
232   fi
233
234   dnl # We need HAL >= 0.5.x and D-BUS >= 0.23 for the HAL volume manager
235   if test x"$ac_bm_thunar_vfs_volume_impl" = x"hal"; then
236     XDT_CHECK_PACKAGE([EXO_HAL], [exo-hal-0.3], [0.3.1.13])
237     XDT_CHECK_PACKAGE([HAL], [hal-storage], [0.5.0])
238     XDT_CHECK_PACKAGE([HAL_DBUS], [dbus-glib-1], [0.23])
239   fi
240
241   dnl # Set config.h variables depending on what we're going to use
242   AC_MSG_CHECKING([for the volume manager implemenation])
243   case "$ac_bm_thunar_vfs_volume_impl" in
244   freebsd)
245     AC_DEFINE([THUNAR_VFS_VOLUME_IMPL_FREEBSD], [1], [Define to 1 if the FreeBSD volume manager implementation should be used])
246     ;;
247
248   hal)
249     AC_DEFINE([THUNAR_VFS_VOLUME_IMPL_HAL], [1], [Define to 1 if the HAL volume manager implementation should be used])
250     ;;
251
252   *)
253     AC_DEFINE([THUNAR_VFS_VOLUME_IMPL_NONE], [1], [Define to 1 if no volume manager implementation should be used])
254     ;;
255   esac
256   AC_MSG_RESULT([$ac_bm_thunar_vfs_volume_impl])
257
258   dnl # Set automake conditionals appropriately
259   AM_CONDITIONAL([THUNAR_VFS_VOLUME_IMPL_FREEBSD], [test x"$ac_bm_thunar_vfs_volume_impl" = x"freebsd"])
260   AM_CONDITIONAL([THUNAR_VFS_VOLUME_IMPL_HAL], [test x"$ac_bm_thunar_vfs_volume_impl" = x"hal"])
261   AM_CONDITIONAL([THUNAR_VFS_VOLUME_IMPL_NONE], [test x"$ac_bm_thunar_vfs_volume_impl" = x"none"])
262 ])