Releasing debian version 0.2.5-1.
[debian/lxlauncher.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(lxlauncher, 0.2.5, http://lxde.org)
4 AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz])
5 AM_CONFIG_HEADER(config.h)
6 # Support silent build rules. Disable by either passing --disable-silent-rules
7 # to configure or passing V=1 to make
8 AM_SILENT_RULES([yes])
9
10 AM_MAINTAINER_MODE([enable])
11
12 # Init intltool
13 IT_PROG_INTLTOOL
14
15 AC_ISC_POSIX
16 AC_PROG_CC
17 AM_PROG_CC_STDC
18 AC_HEADER_STDC
19
20 AC_ARG_ENABLE(more_warnings,
21        [AC_HELP_STRING([--enable-more-warnings],
22                [Add more warnings @<:@default=no@:>@])],
23        [enable_more_warnings="${enableval}"],
24        [enable_more_warnings=no]
25 )
26
27 AC_ARG_ENABLE(gtk3,
28 AC_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]),
29 [case "${enableval}" in
30   yes)  enable_gtk3=yes ;;
31   no)   enable_gtk3=no ;;
32   *) AC_MSG_ERROR([bad value "${enableval}" for --enable-gtk3, use "yes" (default) or "no".]) ;;
33 esac],[])
34
35 if test "x$enable_gtk3" = "xyes" ; then
36   CFLAGS="$CFLAGS -DENABLE_GTK3"
37   gtk_modules="gtk+-3.0 >= 3.0.0"
38 else
39   gtk_modules="gtk+-2.0 >= 2.10.0"
40 fi
41 PKG_CHECK_MODULES(GTK, [$gtk_modules])
42 AC_SUBST(GTK_CFLAGS)
43 AC_SUBST(GTK_LIBS)
44
45 sn_modules="libstartup-notification-1.0"
46 PKG_CHECK_MODULES(SN, [$sn_modules])
47 AC_SUBST(SN_CFLAGS)
48 AC_SUBST(SN_LIBS)
49
50 gmenu_modules="libmenu-cache"
51 PKG_CHECK_MODULES(GMENU, [$gmenu_modules])
52 AC_SUBST(GMENU_CFLAGS)
53 AC_SUBST(GMENU_LIBS)
54 dnl check for menu-cache versions 0.4.x
55 LIBS_save="${LIBS}"
56 LIBS="${LIBS} ${GMENU_LIBS}"
57 AC_CHECK_FUNCS(menu_cache_dir_list_children)
58 LIBS="${LIBS_save}"
59
60 x11_modules="x11"
61 PKG_CHECK_MODULES(X11, [x11])
62 AC_SUBST(X11_CFLAGS)
63 AC_SUBST(X11_LIBS)
64
65 if test x"$enable_more_warnings" = x"yes"; then
66   ADDITIONAL_FLAGS="-Wall -Werror=all -Werror=format -Werror=implicit-function-declaration -Werror=implicit-int -Werror=missing-braces -Werror=parentheses -Werror=return-type -Werror=strict-aliasing -Werror=switch -Wuninitialized -Werror=unused-label -Werror=unused-value -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-declarations -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Werror=inline -Werror=format-nonliteral -Wformat-nonliteral -Werror=format-security -Wformat-security -Winit-self -Werror=missing-include-dirs -Werror=undef -Werror=aggregate-return -Wmissing-format-attribute -Werror=nested-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"
67 fi
68 AC_SUBST(ADDITIONAL_FLAGS)
69
70 GETTEXT_PACKAGE=lxlauncher
71 AC_SUBST(GETTEXT_PACKAGE)
72 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
73
74 # Generate po/LINGUAS on the fly rather than relying on translators
75 # to maintain it manually. This also overcome the problem that Transifex
76 # cannot add a language to po/LINGUAS if a new po file is submitted.
77 rm -f $srcdir/po/LINGUAS
78 for po_file in `ls $srcdir/po/*.po | sort`;
79 do
80     lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
81     echo $lang >> $srcdir/po/LINGUAS
82 done
83
84 AM_GLIB_GNU_GETTEXT
85
86 AC_OUTPUT([
87 Makefile
88 settings.conf
89 src/Makefile
90 po/Makefile.in
91 data/lxlauncher.1
92 ])
93