Automatic translation update from Pootle
[lxde/lxsession.git] / configure.ac
1 AC_INIT([lxsession],[0.5.3],[],[lxsession])
2
3 # Autotols programs
4 AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror foreign no-dist-gzip dist-xz])
5 AC_PREREQ([2.68])
6 IT_PROG_INTLTOOL([0.40.0],[no-xml])
7
8 # Support silent build rules. Disable by either passing --disable-silent-rules
9 # to configure or passing V=1 to make
10 AM_SILENT_RULES([yes])
11
12 AC_CONFIG_HEADERS([config.h])
13 AC_CONFIG_MACRO_DIR([m4])
14
15 # C compiler
16 AC_PROG_CC
17 AC_PROG_INSTALL
18 AM_PROG_CC_C_O
19 AC_PROG_CC_STDC
20
21
22 AC_CHECK_FUNC([mkstemp],
23    AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the 'mkstemp' function.]))
24
25 AC_ARG_ENABLE(man,
26        [AS_HELP_STRING([--enable-man],
27                [regenerate roff man pages from Docbook @<:@default=yes@:>@])],
28        [enable_man="${enableval}"],
29        [enable_man=yes]
30 )
31
32 AC_ARG_ENABLE(more_warnings,
33        [AS_HELP_STRING([--enable-more-warnings],
34                [Add more warnings @<:@default=no@:>@])],
35        [enable_more_warnings="${enableval}"],
36        [enable_more_warnings=no]
37 )
38
39 if test x"$enable_more_warnings" = x"yes"; then
40   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"
41 fi
42 AC_SUBST(ADDITIONAL_FLAGS)
43
44 PKG_CHECK_MODULES(X11, [x11])
45 AC_SUBST(X11_CFLAGS)
46 AC_SUBST(X11_LIBS)
47
48 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0])
49 AC_SUBST(GLIB_CFLAGS)
50 AC_SUBST(GLIB_LIBS)
51
52 PKG_CHECK_MODULES(GIO, [gio-unix-2.0])
53 AC_SUBST(GIO_CFLAGS)
54 AC_SUBST(GIO_LIBS)
55
56 AC_ARG_ENABLE(
57     [gtk],
58     AS_HELP_STRING([--enable-gtk],
59                    [Build with gtk support (default: yes)]),
60     use_gtk=$enableval, use_gtk="yes")
61
62 AM_CONDITIONAL(USE_GTK, test "$use_gtk" = "yes")
63
64 if test "x$use_gtk" = "xno" ; then
65   enable_gtk3="no"
66   use_buildin_clipboard="no"
67   use_buildin_polkit="no"
68 else
69   AC_ARG_ENABLE([gtk3],
70       AS_HELP_STRING([--enable-gtk3],
71                      [enable to use gtk-3.0 instead of gtk-2.0]),
72       enable_gtk3=$enableval, enable_gtk3="no")
73
74   if test "x$enable_gtk3" = "xyes" ; then
75     CFLAGS="$CFLAGS -D USE_GTK3"
76     gtk_modules="gtk+-3.0 >= 3.0.0"
77     VALA_GTK_LIBS="gtk+-3.0"
78   else
79     CFLAGS="$CFLAGS -D USE_GTK2"
80     gtk_modules="gtk+-2.0 >= 2.6.0"
81     VALA_GTK_LIBS="gtk+-2.0"
82
83     PKG_CHECK_MODULES(UNIQUE, [unique-1.0])
84     AC_SUBST(UNIQUE_CFLAGS)
85     AC_SUBST(UNIQUE_LIBS)
86
87   fi
88   PKG_CHECK_MODULES(GTK, [$gtk_modules])
89   AC_SUBST(GTK_CFLAGS)
90   AC_SUBST(GTK_LIBS)
91
92   AC_SUBST(VALA_GTK_LIBS)
93
94   polkit_modules="polkit-agent-1"
95   PKG_CHECK_MODULES(POLKIT, [$polkit_modules])
96   AC_SUBST(POLKIT_CFLAGS)
97   AC_SUBST(POLKIT_LIBS)
98
99   AC_ARG_ENABLE(
100       [buildin-clipboard],
101       AS_HELP_STRING([--enable-buildin-clipboard],
102                      [Build with build-in clipboard support (default: no)]),
103       use_buildin_clipboard=$enableval, use_buildin_clipboard="no")
104
105   AC_ARG_ENABLE(
106       [buildin-polkit],
107       AS_HELP_STRING([--enable-buildin-polkit],
108                      [Build with build-in polkit-agent support (default: no)]),
109       use_buildin_polkit=$enableval, use_buildin_polkit="no")
110
111   AC_ARG_ENABLE(
112       [advanced-notifications],
113       AS_HELP_STRING([--enable-advanced-notifications],
114                      [Build with advanced notification using indicators and libnotify (default: no)]),
115       use_advanced_notifications=$enableval, use_advanced_notifications="no")
116
117 fi
118
119 AM_CONDITIONAL(USE_BUILDIN_CLIPBOARD, test "$use_buildin_clipboard" = "yes")
120 AM_CONDITIONAL(USE_BUILDIN_POLKIT, test "$use_buildin_polkit" = "yes")
121 AM_CONDITIONAL(USE_GTK3, test "$enable_gtk3" = "yes")
122 AM_CONDITIONAL(USE_ADVANCED_NOTIFICATIONS, test "$use_advanced_notifications" = "yes")
123
124 if test "$use_advanced_notifications" = "yes"; then
125   PKG_CHECK_MODULES(INDICATORS, [indicator-0.4 >= 0.4.93 appindicator-0.1])
126   AC_SUBST(INDICATORS_CFLAGS)
127   AC_SUBST(INDICATORS_LIBS)
128
129   PKG_CHECK_MODULES(LIBNOTIFY, [libnotify])
130   AC_SUBST(LIBNOTIFY_CFLAGS)
131   AC_SUBST(LIBNOTIFY_LIBS)
132 fi
133
134 if test "$use_buildin_polkit" = "yes"; then
135   HIDE_LXPOLKIT_AUTOSTART=true
136 else
137   HIDE_LXPOLKIT_AUTOSTART=false
138 fi
139 AC_SUBST(HIDE_LXPOLKIT_AUTOSTART)
140
141 AM_PROG_VALAC([0.16.0])
142 if test "x$VALAC" = "x"; then
143   AC_MSG_ERROR([You need Vala compiler])
144 fi
145
146 # debug flags
147 AC_ARG_ENABLE(debug,
148     [AS_HELP_STRING([--enable-debug],[build libfm with debug support @<:@default=no@:>@])],
149     [enable_debug="${enableval}"],
150     [enable_debug=no]
151 )
152 if test "$enable_debug" = "yes"; then
153     # turn on debug and disable optimization
154     CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
155 else
156     # turn off glib debug checks
157     CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
158 fi
159
160 # Generate po/LINGUAS on the fly rather than relying on translators
161 # to maintain it manually. This also overcome the problem that Transifex
162 # cannot add a language to po/LINGUAS if a new po file is submitted.
163 rm -f $srcdir/po/LINGUAS
164 for po_file in `ls $srcdir/po/*.po | sort`;
165 do
166     lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
167     echo $lang >> $srcdir/po/LINGUAS
168 done
169
170 GETTEXT_PACKAGE=lxsession
171 AC_SUBST(GETTEXT_PACKAGE)
172 AM_GLIB_GNU_GETTEXT
173 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
174
175 if test x"$enable_man" = x"yes"; then
176         AC_PATH_PROG([XSLTPROC], [xsltproc])
177         if test -z "$XSLTPROC"; then
178                 enable_man=no
179         fi
180
181         dnl check for DocBook DTD and stylesheets in the local catalog.
182         JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
183                 [DocBook XML DTD V4.1.2], [], enable_man=no)
184         JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
185                 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
186 fi
187
188 AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
189
190 dnl Fix invalid sysconfdir when --prefix=/usr
191 if test `eval "echo $sysconfdir"` = /usr/etc
192 then
193     sysconfdir=/etc
194 fi
195
196 AC_CONFIG_FILES([
197   Makefile
198   data/Makefile
199   data/ui/Makefile
200   data/lxpolkit.desktop.in
201   man/Makefile
202   po/Makefile.in
203 ])
204 AC_OUTPUT
205
206 echo
207 echo LXSession.................................... : Version $VERSION
208 echo
209 echo Prefix....................................... : $prefix
210 echo Sysconfdir................................... : $sysconfdir
211 echo GTK support.................................. : $use_gtk
212 echo GTK Cliboard build-in suport................. : $use_buildin_clipboard
213 echo GTK Polkit-agent build-in suport............. : $use_buildin_polkit
214 echo Enable GTK3 support.......................... : $enable_gtk3
215 echo Enable debug................................. : $enable_debug
216 echo Man pages generation support................. : $enable_man
217 echo
218 echo The binary will be installed in $prefix/bin
219 echo
220 echo http://lxde.org/
221 echo
222 echo Have fun!
223 echo