e7a20d979e5a89d62b422776490ecbd667a0b80f
[debian/menu-cache.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT([menu-cache], [1.0.1],
4         [http://lxde.org/])
5
6 AC_CONFIG_MACRO_DIR([m4])
7
8 AM_INIT_AUTOMAKE([no-dist-gzip dist-xz])
9 AM_CONFIG_HEADER(config.h)
10
11 # Support silent build rules. Disable by either passing --disable-silent-rules
12 # to configure or passing V=1 to make
13 AM_SILENT_RULES([yes])
14
15 AM_MAINTAINER_MODE([enable])
16
17 AC_ISC_POSIX
18 AC_PROG_CC
19 AM_PROG_CC_C_O
20 AC_STDC_HEADERS
21 dnl AC_ARG_PROGRAM
22 AM_PROG_LIBTOOL
23
24 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
25 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
26
27 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16.0 gio-2.0 >= 2.15.2)
28 AC_SUBST(GLIB_CFLAGS)
29 AC_SUBST(GLIB_LIBS)
30
31 PKG_CHECK_MODULES(LIBFM_EXTRA, libfm-extra)
32 AC_SUBST(LIBFM_EXTRA_CFLAGS)
33 AC_SUBST(LIBFM_EXTRA_LIBS)
34
35 AC_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
42 if test x"$enable_more_warnings" = x"yes"; then
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"
44 fi
45 AC_SUBST(ADDITIONAL_FLAGS)
46
47 dnl --enable-debug=(yes|minimum|no)
48 AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes]   turn on debugging [[default=no]]],,enable_debug=yes)
49 if test "$enable_debug" = "yes"; then
50   DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
51 else
52   if test "x$enable_debug" = "xno"; then
53     DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
54   else
55     DEBUG_CFLAGS=""
56   fi
57 fi
58 AC_SUBST(DEBUG_CFLAGS)
59
60 dnl check for gtk-doc
61 m4_ifdef([GTK_DOC_CHECK], [
62 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
63 ],[
64 AM_CONDITIONAL([ENABLE_GTK_DOC], false)
65 ])
66
67 dnl Make version subfields for MENU_CACHE_CHECK_VERSION macro
68 ac_version_subst_str=`echo $VERSION | awk -F '.' '/.*/ { printf "MC_VERSION_MAJOR=%d MC_VERSION_MINOR=%d MC_VERSION_MICRO=%d", $1, $2, $3 }'`
69 eval ${ac_version_subst_str}
70 AC_SUBST(MC_VERSION_MAJOR)
71 AC_SUBST(MC_VERSION_MINOR)
72 AC_SUBST(MC_VERSION_MICRO)
73
74 exec_prefix_save="$exec_prefix"
75 test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
76 if test `eval echo "$libdir"` = '/usr/lib'
77 then
78     PCFILE_LIBDIR=
79 else
80     PCFILE_LIBDIR=' -L${libdir}'
81 fi
82 exec_prefix="$exec_prefix_save"
83 AC_SUBST(PCFILE_LIBDIR)
84
85 AC_OUTPUT([
86 Makefile
87 libmenu-cache/Makefile
88 libmenu-cache/libmenu-cache.pc
89 libmenu-cache/menu-cache.h
90 menu-cache-gen/Makefile
91 menu-cache-daemon/Makefile
92 docs/Makefile
93 docs/reference/Makefile
94 docs/reference/libmenu-cache/Makefile
95 ])