summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 3abc3134010ed66396adb1cd2eeb7d8384974cda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# vi:set et ai sw=2 sts=2 ts=2: */
# -
# Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org>
# Copyright (c) 2015 The Xfce Development Team
# 
# This program is free software; you can redistribute it and/or 
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of 
# the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public 
# License along with this program; if not, write to the Free 
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([tumbler_verinfo], [0:0:0])
m4_define([tumbler_version_api_major], [1])
m4_define([tumbler_version_major], [4])
m4_define([tumbler_version_minor], [17])
m4_define([tumbler_version_micro], [0])
m4_define([tumbler_version], [tumbler_version_major().tumbler_version_minor().tumbler_version_micro()])

dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org>])
AC_COPYRIGHT([Copyright (c) 2016-2017 Ali Abdallah <ali@xfce.org>])
AC_INIT([tumbler], [tumbler_version], [https://gitlab.xfce.org/xfce/tumbler])
AC_PREREQ([2.60])
AC_CANONICAL_TARGET()

dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar no-dist-gzip foreign])
AC_CONFIG_MACRO_DIRS([m4])
AC_SUBST([ACLOCAL_AMFLAGS], ["$ACLOCAL_FLAGS -I m4"])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE()
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

dnl **************************
dnl *** Libtool versioning ***
dnl **************************
TUMBLER_VERINFO=tumbler_verinfo()
AC_SUBST([TUMBLER_VERINFO])

dnl ****************************
dnl *** Subst tumbler version ***
dnl ****************************
TUMBLER_VERSION_MAJOR=tumbler_version_major()
TUMBLER_VERSION_MINOR=tumbler_version_minor()
TUMBLER_VERSION_MICRO=tumbler_version_micro()
TUMBLER_VERSION_API_MAJOR=tumbler_version_api_major()
TUMBLER_VERSION_API=$TUMBLER_VERSION_API_MAJOR
AC_SUBST([TUMBLER_VERSION_MAJOR])
AC_SUBST([TUMBLER_VERSION_MINOR])
AC_SUBST([TUMBLER_VERSION_MICRO])
AC_SUBST([TUMBLER_VERSION_API_MAJOR])
AC_SUBST([TUMBLER_VERSION_API])

dnl *******************************
dnl *** Check for UNIX variants ***
dnl *******************************
AC_USE_SYSTEM_EXTENSIONS
AC_SEARCH_LIBS([strerror],[cposix])

dnl ********************************
dnl *** Check for Win32 variants ***
dnl ********************************
AC_MSG_CHECKING([if building for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
  ac_bm_platform_win32=yes
  ;;
*)
  ac_bm_platform_win32=no
  ;;
esac
AC_MSG_RESULT([$ac_bm_platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32], [test x"$ac_bm_platform_win32" = x"yes"])

dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AM_PROG_AS()
AC_PROG_CC()
AM_PROG_CC_C_O()
AC_PROG_INSTALL()
IT_PROG_INTLTOOL([0.35.0], [no-xml])
AC_PROG_GREP()
AC_PROG_EGREP()
AC_PROG_SED()

dnl ***********************
dnl *** Prepare libtool ***
dnl ***********************
LT_PREREQ([2.4])
LT_INIT([disable-static])

dnl ***************************************
dnl *** Check for standard header files ***
dnl ***************************************
AC_CHECK_HEADERS([fcntl.h linux/sched.h memory.h sched.h setjmp.h stdio.h \
                  stdlib.h string.h syscall.h sys/mman.h sys/types.h \
                  sys/stat.h unistd.h sys/select.h pwd.h])

dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()
AC_CHECK_FUNCS([sched_getparam sched_setscheduler getpwnam bind_textdomain_codeset])

dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
linguas=$(ls po/*.po | $SED s/.po//g | $SED sApo/AA | xargs)
XDT_I18N([$linguas])

dnl *************************
dnl *** Check for GTK-Doc ***
dnl *************************
GTK_DOC_CHECK(1.9)

dnl ***********************************
dnl *** Check for gdbus-codegen ***
dnl ***********************************
AC_ARG_VAR([GDBUS_CODEGEN], [D-Bus code and documentation generator from XML D-Bus interface definitions])
AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen], [no])
if test x"$GDBUS_CODEGEN" = x"no"; then
  AC_MSG_ERROR([could not find gdbus-codegen in \$PATH. You can run
  ./configure GDBUS_CODEGEN=/path/to/gdbus-codegen to define 
  a custom location for it.])
fi

dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_56, Warn when using post 2_56 APIs)
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_56, Don't warn about post 2_56 deprecations)
AC_DEFINE(G_LOG_USE_STRUCTURED, 1, Use structured logging)
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.56.0])
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.56.0])
PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.56.0])
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= 2.56.0])
PKG_CHECK_MODULES([GTHREAD], [gthread-2.0 >= 2.56.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.17.1])

dnl ******************************************************************
dnl *** Alternative service name prefix for e.g. Flatpak packaging ***
dnl ******************************************************************
AC_ARG_VAR([TUMBLER_SERVICE_NAME_PREFIX],
           [Alternative prefix to org.freedesktop.thumbnails for Tumbler services])
if test -z "$TUMBLER_SERVICE_NAME_PREFIX"; then
  TUMBLER_SERVICE_NAME_PREFIX='org.freedesktop.thumbnails'
  AC_SUBST([TUMBLER_SERVICE_FILENAME_PREFIX], [org.xfce.Tumbler])
else
  AC_SUBST([TUMBLER_SERVICE_FILENAME_PREFIX], [$TUMBLER_SERVICE_NAME_PREFIX])
fi

AC_SUBST([TUMBLER_SERVICE_PATH_PREFIX],
         [$(printf '%s' $TUMBLER_SERVICE_NAME_PREFIX | $SED -E 's%(^|\.)%/%g')])
AC_DEFINE_UNQUOTED(TUMBLER_SERVICE_NAME_PREFIX, "$TUMBLER_SERVICE_NAME_PREFIX",
                   Name prefix for Tumbler services)
AC_DEFINE_UNQUOTED(TUMBLER_SERVICE_PATH_PREFIX, "$TUMBLER_SERVICE_PATH_PREFIX",
                   Path prefix for Tumbler services)

dnl *************************
dnl *** Check for plugins ***
dnl *************************
TUMBLER_COVER_THUMBNAILER()
TUMBLER_FONT_THUMBNAILER()
TUMBLER_JPEG_THUMBNAILER()
TUMBLER_PIXBUF_THUMBNAILER()
TUMBLER_FFMPEG_THUMBNAILER()
TUMBLER_GSTREAMER_THUMBNAILER()
TUMBLER_ODF_THUMBNAILER()
TUMBLER_POPPLER_THUMBNAILER()
TUMBLER_RAW_THUMBNAILER()
TUMBLER_XDG_CACHE()
TUMBLER_DESKTOP_THUMBNAILER()
TUMBLER_GEPUB_THUMBNAILER()

dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
XDT_FEATURE_DEBUG()

dnl **************************************
dnl *** Check for linker optimizations ***
dnl **************************************
XDT_FEATURE_LINKER_OPTS()

dnl *************************************
dnl *** Compensate for broken gtk-doc ***
dnl *************************************
XDT_SUPPORTED_FLAGS([GTK_DOC_EXTRA_CFLAGS], [-Wno-sign-compare])
AC_SUBST([GTK_DOC_EXTRA_CFLAGS])

AC_CONFIG_FILES([
Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/tumbler/Makefile
docs/reference/tumbler/version.xml
icons/Makefile
icons/32x32/Makefile
plugins/Makefile
plugins/cover-thumbnailer/Makefile
plugins/font-thumbnailer/Makefile
plugins/gst-thumbnailer/Makefile
plugins/jpeg-thumbnailer/Makefile
plugins/pixbuf-thumbnailer/Makefile
plugins/ffmpeg-thumbnailer/Makefile
plugins/odf-thumbnailer/Makefile
plugins/poppler-thumbnailer/Makefile
plugins/raw-thumbnailer/Makefile
plugins/xdg-cache/Makefile
plugins/desktop-thumbnailer/Makefile
plugins/gepub-thumbnailer/Makefile
po/Makefile.in
tumbler/Makefile
tumbler/tumbler-1.pc
tumbler/tumbler-config.h
tumblerd/Makefile
])
AC_OUTPUT

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo "  * Debug:                                            $enable_debug"
echo
echo "Plugins:"
echo
if test x"$ac_tumbler_pixbuf_thumbnailer" = x"yes"; then
echo "  * GdkPixbuf thumbnailer plugin:                     yes"
else
echo "  * GdkPixbuf thumbnailer plugin:                     no"
fi
if test x"$ac_tumbler_cover_thumbnailer" = x"yes"; then
echo "  * Cover thumbnailer plugin:                         yes"
else
echo "  * Cover thumbnailer plugin:                         no"
fi
if test x"$ac_tumbler_font_thumbnailer" = x"yes"; then
echo "  * FreeType font thumbnailer plugin:                 yes"
else
echo "  * FreeType font thumbnailer plugin:                 no"
fi
if test x"$ac_tumbler_jpeg_thumbnailer" = x"yes"; then
echo "  * JPEG thumbnailer plugin with EXIF support:        yes"
else
echo "  * JPEG thumbnailer plugin with EXIF support:        no"
fi
if test x"$ac_tumbler_ffmpeg_thumbnailer" = x"yes"; then
echo "  * Video thumbnailer plugin using ffmpegthumbnailer: yes"
else
echo "  * Video thumbnailer plugin using ffmpegthumbnailer: no"
fi
if test x"$ac_tumbler_gstreamer_thumbnailer" = x"yes"; then
echo "  * Video thumbnailer plugin using GStreamer:         yes"
else
echo "  * Video thumbnailer plugin using GStreamer:         no"
fi
if test x"$ac_tumbler_odf_thumbnailer" = x"yes"; then
echo "  * ODF thumbnailer plugin using libgsf:              yes"
else
echo "  * ODF thumbnailer plugin using libgsf:              no"
fi
if test x"$ac_tumbler_poppler_thumbnailer" = x"yes"; then
echo "  * PDF/PS thumbnailer plugin using poppler:          yes"
else
echo "  * PDF/PS thumbnailer plugin using poppler:          no"
fi
if test x"$ac_tumbler_raw_thumbnailer" = x"yes"; then
echo "  * RAW thumbnailer plugin using libopenraw:          yes"
else
echo "  * RAW thumbnailer plugin using libopenraw:          no"
fi
if test x"$ac_tumbler_xdg_cache" = x"yes"; then
echo "  * Freedesktop.org cache plugin:                     yes"
else
echo "  * Freedesktop.org cache plugin:                     no"
fi
if test x"$ac_tumbler_desktop_thumbnailer" = x"yes"; then
echo "  * Loading thumbnailers from .thumbnailer files:     yes"
else
echo "  * Loading thumbnailers from .thumbnailer files:     no"
fi
if test x"$ac_tumbler_gepub_thumbnailer" = x"yes"; then
echo "  * EPUB thumbnailer using libgepub:                  yes"
else
echo "  * EPUB thumbnailer using libgepub:                  no"
fi
echo