2
# Process this file with autoconf to produce a configure script.
5
AC_INIT([libfm], [1.2.3], [http://pcmanfm.sourceforge.net/])
6
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects no-dist-gzip dist-xz -Wno-portability])
7
AC_CONFIG_MACRO_DIR(m4)
8
AC_CONFIG_HEADERS([config.h])
10
dnl Support silent build rules. Disable by either passing --disable-silent-rules
11
dnl to configure or passing V=1 to make
12
AM_SILENT_RULES([yes])
14
dnl version of API generation
17
# automake 1.12 requires AM_PROG_AR.
18
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
20
# Checks for programs.
25
# Test if we address libfm-extra compilation only
26
AC_ARG_WITH(extra-only,
27
[AC_HELP_STRING([--with-extra-only],
28
[disable all components but libfm-extra library])],
29
[extra_only="${withval}"],
32
AM_CONDITIONAL(EXTRALIB_ONLY, [test x$extra_only = xyes])
35
AC_ARG_ENABLE(actions,
36
[AC_HELP_STRING([--disable-actions],
37
[disable custom actions in context menu if you have no decent Vala compiler])],
38
[enable_actions="${enableval}"],
41
AM_COND_IF(EXTRALIB_ONLY,
43
if test x"$enable_actions" = xyes; then
44
dnl no vala compiler required when sources are from dist tarball
45
if test -f src/actions/libfmactions_la_vala.stamp; then
48
AM_PROG_VALAC([0.13.0])
49
if test x"$VALAC" = x; then
50
AC_ERROR([No Vala compiler found but it is required.])
53
ACTIONS_SUBDIR='actions'
54
AC_DEFINE(HAVE_ACTIONS, 1, [Define to 1 to enable custom actions])
58
AC_SUBST(ACTIONS_SUBDIR)
59
AM_CONDITIONAL(HAVE_ACTIONS, [test x$ACTIONS_SUBDIR = xactions])
61
# Checks for libraries.
63
# Checks for header files.
66
# Checks for typedefs, structures, and compiler characteristics.
68
# Checks for library functions.
70
AC_SEARCH_LIBS([pow], [m])
71
AC_SEARCH_LIBS(dlopen, dl)
74
AC_ARG_ENABLE([largefile],
75
AS_HELP_STRING([--enable-largefile],
76
[enable Large file support (default: yes)]),
77
largefile=$enableval, largefile="yes")
79
if test x"$largefile" = x"yes"; then
80
CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
81
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
82
AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
87
IT_PROG_INTLTOOL([0.40.0])
91
[AC_HELP_STRING([--with-gtk=VER],
92
[choose Gtk+ version for libfm-gtk build (default=2)])
93
AC_HELP_STRING([--without-gtk],
94
[disable libfm-gtk build])],
95
[ac_with_gtk="${withval}"],
98
AM_COND_IF(EXTRALIB_ONLY,
102
if test x"$enable_actions" = xyes; then
103
gio_modules="gio-unix-2.0 >= 2.26.0 glib-2.0 >= 2.26.0"
105
gio_modules="glib-2.0 >= 2.22.0 gio-unix-2.0"
107
gio_modules="$gio_modules gthread-2.0 gobject-2.0"
109
PKG_CHECK_MODULES(GIO, [$gio_modules])
113
if test x"$ac_with_gtk" != xno; then
114
case "$ac_with_gtk" in
116
pkg_modules="$gio_modules gtk+-3.0 pango >= 1.16.0 cairo >= 1.8.0"
117
LIBFM_GTK_LTLIBRARIES=libfm-gtk3.la
118
LIBFM_GTK_PC=libfm-gtk3.pc
122
pkg_modules="$gio_modules gtk+-2.0 >= 2.18.0 pango >= 1.16.0 cairo >= 1.8.0"
123
LIBFM_GTK_LTLIBRARIES=libfm-gtk.la
124
LIBFM_GTK_PC=libfm-gtk.pc
128
PKG_CHECK_MODULES(GTK, [$pkg_modules])
129
LIBFM_PREF_APPS="libfm-pref-apps lxshortcut"
131
dnl automake uses GTK_CFLAGS for glib-compat.c compilation
132
GTK_CFLAGS="${GIO_CFLAGS}"
134
LIBFM_GTK_LTLIBRARIES=
141
AC_SUBST(LIBFM_GTK_LTLIBRARIES)
142
AC_SUBST(LIBFM_PREF_APPS)
143
AC_SUBST(LIBFM_GTK_PC)
144
AM_CONDITIONAL([ENABLE_GTK], [test x$ac_with_gtk != xnone])
146
dnl pango_modules="pango >= 1.16.0"
147
dnl PKG_CHECK_MODULES(PANGO, [$pango_modules])
148
dnl AC_SUBST(PANGO_CFLAGS)
149
dnl AC_SUBST(PANGO_LIBS)
151
dnl gmodule may be used for libfm-chooser-hack.la
152
#gmodule_modules="gmodule-2.0"
153
#PKG_CHECK_MODULES(GMODULE, [$gmodule_modules])
154
#AC_SUBST(GMODULE_CFLAGS)
155
#AC_SUBST(GMODULE_LIBS)
157
AM_COND_IF(EXTRALIB_ONLY,
160
[menu_modules="libmenu-cache >= 0.3.2"
161
PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])])
162
AC_SUBST(MENU_CACHE_CFLAGS)
163
AC_SUBST(MENU_CACHE_LIBS)
165
dnl check for menu-cache versions 0.4.x since no macro MENU_CACHE_CHECK_VERSION
166
dnl is available in those versions
168
LIBS="${LIBS} ${MENU_CACHE_LIBS}"
169
AC_CHECK_FUNCS(menu_cache_dir_list_children)
172
# special checks for glib/gio 2.27 since it contains backward imcompatible changes.
173
# glib 2.26 uses G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME extension point while
174
# glib 2.27 uses x-scheme-handler/* mime-type to register handlers.
175
PKG_CHECK_MODULES(GLIB2_27, [glib-2.0 >= 2.27.0],
176
[have_scheme_handler="yes"],
177
[have_scheme_handler="no"])
178
AM_CONDITIONAL(HAVE_SCHEME_HANDLER, test "x$have_scheme_handler" = "xyes")
179
if test "x$have_scheme_handler" = "xyes"; then
180
AC_DEFINE_UNQUOTED(HAVE_SCHEME_HANDLER, [1], [Have x-scheme/uri handler support])
185
AC_ARG_ENABLE(udisks,
186
[AC_HELP_STRING([--enable-udisks],
187
[build libfm with udisks support (Linux only) @<:@default=yes@:>@])],
188
[enable_udisks="${enableval}"],
191
AM_COND_IF(EXTRALIB_ONLY,
193
AM_CONDITIONAL(ENABLE_UDISKS, test x"$enable_udisks" = x"yes")
194
if test x"$enable_udisks" = x"yes"; then
195
# turn on udisks support
196
AC_DEFINE_UNQUOTED(USE_UDISKS, [1], [Enable UDisks support])
198
# test for availability of dbus
199
dbus_modules="dbus-glib-1"
200
PKG_CHECK_MODULES(DBUS, [$dbus_modules])
201
AC_SUBST(DBUS_CFLAGS)
205
AC_ARG_ENABLE([exif],
206
AS_HELP_STRING([--disable-exif],
207
[disable libexif which is used for faster thumbnail loading.]),
208
[enable_exif="${enableval}"],
211
AM_COND_IF(EXTRALIB_ONLY,
213
AM_CONDITIONAL(ENABLE_EXIF, test x"$enable_exif" != x"no")
214
AS_IF([test x"$enable_exif" != x"no"], [
215
# test for availability of libexif
216
exif_modules="libexif"
217
PKG_CHECK_MODULES(EXIF, [$exif_modules],
218
[# turn on libexif support
220
AC_DEFINE_UNQUOTED(USE_EXIF, [1], [Enable libexif])
221
AC_SUBST(EXIF_CFLAGS)
222
AC_SUBST(EXIF_LIBS)],
223
[AS_IF([test x"$enable_exif" = x"auto"], [enable_exif=no], [
224
AC_ERROR([Package requirements (libexif) were not met:
230
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
233
[AC_HELP_STRING([--enable-demo],
234
[build libfm-demo file manager @<:@default=no@:>@])],
235
[enable_demo="${enableval}"],
238
AM_COND_IF(EXTRALIB_ONLY,
240
AM_CONDITIONAL(ENABLE_DEMO, test x"$enable_demo" = x"yes")
242
# GIO extension module
243
giomodulesdir=$libdir/gio/modules
244
AC_SUBST(giomodulesdir)
247
GETTEXT_PACKAGE=libfm
248
AC_SUBST(GETTEXT_PACKAGE)
250
# Generate po/LINGUAS on the fly rather than relying on translators
251
# to maintain it manually. This also overcome the problem that Transifex
252
# cannot add a language to po/LINGUAS if a new po file is submitted.
253
rm -f $srcdir/po/LINGUAS
254
for po_file in `ls $srcdir/po/*.po | sort`;
256
lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
257
echo $lang >> $srcdir/po/LINGUAS
261
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
264
if test `eval "echo $includedir"` = /usr/include
268
FMINCLUDEADD='-I${includedir}'
270
AC_SUBST(FMINCLUDEADD)
273
[AC_HELP_STRING([--enable-debug],
274
[build libfm with debug support @<:@default=no@:>@])],
275
[enable_debug="${enableval}"],
278
if test "$enable_debug" = "yes"; then
279
# turn on debug and disable optimization
280
CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
283
CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
288
dnl Be more strict on portability
289
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
291
# turn off glib debug checks
292
CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
295
dnl Check linker flags for modules
296
AC_CHECK_LDFLAG(ac_cv_ld_z_defs, [-Wl,-z,defs], LDFLAGS)
298
dnl Check if OS respects POSIX.1-2001 `environ' declaration
299
AC_CHECK_DECLS([environ], [], [], [[#include <unistd.h>]])
301
dnl Fix invalid sysconfdir when --prefix=/usr
302
if test `eval "echo $sysconfdir"` = /usr/etc
307
dnl Make version subfields for FM_CHECK_VERSION macro
308
ac_version_subst_str=`echo $VERSION | awk -F '.' '/.*/ { printf "FM_VERSION_MAJOR=%d FM_VERSION_MINOR=%d FM_VERSION_MICRO=%d", $1, $2, $3 }'`
309
eval ${ac_version_subst_str}
310
AC_SUBST(FM_VERSION_MAJOR)
311
AC_SUBST(FM_VERSION_MINOR)
312
AC_SUBST(FM_VERSION_MICRO)
322
data/libfm-pref-apps.1
327
docs/reference/Makefile
328
docs/reference/libfm/Makefile
329
docs/reference/libfm/version.xml
339
echo "Libfm $VERSION Configuration Summary:"
341
echo "prefix: $prefix"
342
echo "sysconfdir: $sysconfdir"
343
echo "Enable compiler flags and other support for debugging: $enable_debug"
344
echo "Build udisks support (Linux only, experimental): $enable_udisks"
345
echo "Build with libexif for faster thumbnail loading: $enable_exif"
346
echo "Build demo program src/demo/libfm-demo: $enable_demo"
347
echo "Build with custom actions support (requires Vala): $enable_actions"
348
echo "Large file support: $largefile"
349
if test x"$have_scheme_handler" = x"no"; then
350
echo "GIO module for preferred apps (for glib < 2.28 only): $giomodulesdir"
352
echo "GIO module for preferred apps (for glib < 2.28 only): not required"
354
echo "Build libfm-gtk for Gtk+ version: $ac_with_gtk"
355
echo "Build API doc with gtk-doc (recommended for make dist): $enable_gtk_doc"
359
if test x"$sysconfdir" != x'/etc'; then
362
echo 'Warning: sysconfdir is not /etc.'
363
echo 'Please consider passing --sysconfdir=/etc to configure.';
364
echo 'Otherwise default config files will be installed to wrong place.'