Adding 02-Fix-potential-access-violation.patch from upstream (Closes: #862570).
[debian/menu-cache.git] / configure.ac
CommitLineData
af302956
AG
1dnl Process this file with autoconf to produce a configure script.
2
b94f3144 3AC_INIT([menu-cache], [1.0.2],
38dfb1e4 4 [http://lxde.org/])
38dfb1e4 5
af302956
AG
6AC_CONFIG_MACRO_DIR([m4])
7
ffc118c7 8AM_INIT_AUTOMAKE([no-dist-gzip dist-xz])
38dfb1e4
DB
9AM_CONFIG_HEADER(config.h)
10
2df00678
DB
11# Support silent build rules. Disable by either passing --disable-silent-rules
12# to configure or passing V=1 to make
13AM_SILENT_RULES([yes])
14
ffc118c7 15AM_MAINTAINER_MODE([enable])
38dfb1e4
DB
16
17AC_ISC_POSIX
18AC_PROG_CC
19AM_PROG_CC_C_O
20AC_STDC_HEADERS
21dnl AC_ARG_PROGRAM
22AM_PROG_LIBTOOL
23
24dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
25AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
26
27PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16.0 gio-2.0 >= 2.15.2)
28AC_SUBST(GLIB_CFLAGS)
29AC_SUBST(GLIB_LIBS)
30
2f7ba096
AG
31PKG_CHECK_MODULES(LIBFM_EXTRA, libfm-extra)
32AC_SUBST(LIBFM_EXTRA_CFLAGS)
33AC_SUBST(LIBFM_EXTRA_LIBS)
34
2df00678
DB
35AC_ARG_ENABLE(more_warnings,
36 [AC_HELP_STRING([--enable-more-warnings],
37 [Add more warnings @<:@default=no@:>@])],
38 [enable_more_warnings="${enableval}"],
39 [enable_more_warnings=no]
40)
41
42if test x"$enable_more_warnings" = x"yes"; then
75445cf1 43 ADDITIONAL_FLAGS="-Wall -Wextra -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Werror=inline -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs -fno-strict-aliasing -fmessage-length=0 -Wp,-D_FORTIFY_SOURCE=2 -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
2df00678
DB
44fi
45AC_SUBST(ADDITIONAL_FLAGS)
46
38dfb1e4 47dnl --enable-debug=(yes|minimum|no)
b94f3144 48AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [[default=no]]],,enable_debug=no)
38dfb1e4
DB
49if test "$enable_debug" = "yes"; then
50 DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
51else
52 if test "x$enable_debug" = "xno"; then
53 DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
54 else
55 DEBUG_CFLAGS=""
56 fi
57fi
58AC_SUBST(DEBUG_CFLAGS)
59
75445cf1
AG
60dnl check for gtk-doc
61m4_ifdef([GTK_DOC_CHECK], [
62GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
63],[
64AM_CONDITIONAL([ENABLE_GTK_DOC], false)
65])
66
67dnl Make version subfields for MENU_CACHE_CHECK_VERSION macro
68ac_version_subst_str=`echo $VERSION | awk -F '.' '/.*/ { printf "MC_VERSION_MAJOR=%d MC_VERSION_MINOR=%d MC_VERSION_MICRO=%d", $1, $2, $3 }'`
69eval ${ac_version_subst_str}
70AC_SUBST(MC_VERSION_MAJOR)
71AC_SUBST(MC_VERSION_MINOR)
72AC_SUBST(MC_VERSION_MICRO)
73
ffc118c7
AG
74exec_prefix_save="$exec_prefix"
75test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
76if test `eval echo "$libdir"` = '/usr/lib'
77then
78 PCFILE_LIBDIR=
79else
80 PCFILE_LIBDIR=' -L${libdir}'
81fi
82exec_prefix="$exec_prefix_save"
83AC_SUBST(PCFILE_LIBDIR)
84
38dfb1e4
DB
85AC_OUTPUT([
86Makefile
87libmenu-cache/Makefile
88libmenu-cache/libmenu-cache.pc
75445cf1 89libmenu-cache/menu-cache.h
38dfb1e4
DB
90menu-cache-gen/Makefile
91menu-cache-daemon/Makefile
75445cf1
AG
92docs/Makefile
93docs/reference/Makefile
94docs/reference/libmenu-cache/Makefile
38dfb1e4 95])