Automatic translation update from Pootle
[lxde/lxsession.git] / configure.ac
CommitLineData
a3f8c0ed 1AC_INIT([lxsession],[0.5.3],[],[lxsession])
ce77a3dc
JL
2
3# Autotols programs
25f570b7 4AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror foreign no-dist-gzip dist-xz])
d835c36b 5AC_PREREQ([2.68])
ce77a3dc
JL
6IT_PROG_INTLTOOL([0.40.0],[no-xml])
7
3ba2ea5c
JL
8# Support silent build rules. Disable by either passing --disable-silent-rules
9# to configure or passing V=1 to make
10AM_SILENT_RULES([yes])
dd69beb8 11
ce77a3dc 12AC_CONFIG_HEADERS([config.h])
3ba2ea5c 13AC_CONFIG_MACRO_DIR([m4])
dd69beb8 14
ce77a3dc 15# C compiler
dd69beb8
FC
16AC_PROG_CC
17AC_PROG_INSTALL
18AM_PROG_CC_C_O
3ba2ea5c
JL
19AC_PROG_CC_STDC
20
dd69beb8
FC
21
22AC_CHECK_FUNC([mkstemp],
5857ef5d 23 AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the 'mkstemp' function.]))
dd69beb8 24
6afdcce3 25AC_ARG_ENABLE(man,
8c902148
JL
26 [AS_HELP_STRING([--enable-man],
27 [regenerate roff man pages from Docbook @<:@default=yes@:>@])],
6afdcce3 28 [enable_man="${enableval}"],
8c902148 29 [enable_man=yes]
6afdcce3
JH
30)
31
7dfdd58f 32AC_ARG_ENABLE(more_warnings,
8c902148 33 [AS_HELP_STRING([--enable-more-warnings],
7dfdd58f
JL
34 [Add more warnings @<:@default=no@:>@])],
35 [enable_more_warnings="${enableval}"],
36 [enable_more_warnings=no]
37)
38
39if test x"$enable_more_warnings" = x"yes"; then
ede8d15f
JL
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"
41fi
42AC_SUBST(ADDITIONAL_FLAGS)
4f4f340d 43
21f44a4a
JL
44PKG_CHECK_MODULES(X11, [x11])
45AC_SUBST(X11_CFLAGS)
46AC_SUBST(X11_LIBS)
47
dd69beb8
FC
48PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0])
49AC_SUBST(GLIB_CFLAGS)
50AC_SUBST(GLIB_LIBS)
51
da9632e2
JL
52PKG_CHECK_MODULES(GIO, [gio-unix-2.0])
53AC_SUBST(GIO_CFLAGS)
54AC_SUBST(GIO_LIBS)
55
7201c0b3 56AC_ARG_ENABLE(
bb379177
JL
57 [gtk],
58 AS_HELP_STRING([--enable-gtk],
59 [Build with gtk support (default: yes)]),
60 use_gtk=$enableval, use_gtk="yes")
7201c0b3 61
bb379177 62AM_CONDITIONAL(USE_GTK, test "$use_gtk" = "yes")
7201c0b3 63
bb379177
JL
64if test "x$use_gtk" = "xno" ; then
65 enable_gtk3="no"
66 use_buildin_clipboard="no"
67 use_buildin_polkit="no"
68else
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
1c659108 75 CFLAGS="$CFLAGS -D USE_GTK3"
bb379177 76 gtk_modules="gtk+-3.0 >= 3.0.0"
1c659108 77 VALA_GTK_LIBS="gtk+-3.0"
bb379177 78 else
1c659108 79 CFLAGS="$CFLAGS -D USE_GTK2"
bb379177 80 gtk_modules="gtk+-2.0 >= 2.6.0"
1c659108
JL
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
bb379177
JL
87 fi
88 PKG_CHECK_MODULES(GTK, [$gtk_modules])
89 AC_SUBST(GTK_CFLAGS)
90 AC_SUBST(GTK_LIBS)
91
1c659108
JL
92 AC_SUBST(VALA_GTK_LIBS)
93
bb379177
JL
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")
3264dafa 110
699c1695
JL
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
bb379177
JL
117fi
118
119AM_CONDITIONAL(USE_BUILDIN_CLIPBOARD, test "$use_buildin_clipboard" = "yes")
3264dafa 120AM_CONDITIONAL(USE_BUILDIN_POLKIT, test "$use_buildin_polkit" = "yes")
1c659108 121AM_CONDITIONAL(USE_GTK3, test "$enable_gtk3" = "yes")
699c1695
JL
122AM_CONDITIONAL(USE_ADVANCED_NOTIFICATIONS, test "$use_advanced_notifications" = "yes")
123
124if 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)
132fi
1c659108 133
6fd94349
AG
134if test "$use_buildin_polkit" = "yes"; then
135 HIDE_LXPOLKIT_AUTOSTART=true
136else
137 HIDE_LXPOLKIT_AUTOSTART=false
138fi
139AC_SUBST(HIDE_LXPOLKIT_AUTOSTART)
3264dafa 140
c241133f 141AM_PROG_VALAC([0.16.0])
7201c0b3 142if test "x$VALAC" = "x"; then
bb379177 143 AC_MSG_ERROR([You need Vala compiler])
7201c0b3
JL
144fi
145
da9632e2
JL
146# debug flags
147AC_ARG_ENABLE(debug,
ce77a3dc 148 [AS_HELP_STRING([--enable-debug],[build libfm with debug support @<:@default=no@:>@])],
da9632e2
JL
149 [enable_debug="${enableval}"],
150 [enable_debug=no]
151)
152if test "$enable_debug" = "yes"; then
153 # turn on debug and disable optimization
154 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
155else
156 # turn off glib debug checks
157 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
158fi
7201c0b3 159
d2508534
HJYP
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.
163rm -f $srcdir/po/LINGUAS
164for po_file in `ls $srcdir/po/*.po | sort`;
165do
166 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
167 echo $lang >> $srcdir/po/LINGUAS
168done
169
dd69beb8 170GETTEXT_PACKAGE=lxsession
dd69beb8 171AC_SUBST(GETTEXT_PACKAGE)
dd69beb8 172AM_GLIB_GNU_GETTEXT
d2508534 173AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
dd69beb8 174
6afdcce3
JH
175if 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)
186fi
187
188AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
189
6fd94349
AG
190dnl Fix invalid sysconfdir when --prefix=/usr
191if test `eval "echo $sysconfdir"` = /usr/etc
192then
193 sysconfdir=/etc
194fi
195
ce77a3dc 196AC_CONFIG_FILES([
dd69beb8 197 Makefile
ca0088ce
JL
198 data/Makefile
199 data/ui/Makefile
6fd94349 200 data/lxpolkit.desktop.in
dd69beb8 201 man/Makefile
cc60c88e 202 po/Makefile.in
dd69beb8 203])
ce77a3dc 204AC_OUTPUT
dd69beb8
FC
205
206echo
207echo LXSession.................................... : Version $VERSION
208echo
209echo Prefix....................................... : $prefix
6fd94349 210echo Sysconfdir................................... : $sysconfdir
bb379177
JL
211echo GTK support.................................. : $use_gtk
212echo GTK Cliboard build-in suport................. : $use_buildin_clipboard
213echo GTK Polkit-agent build-in suport............. : $use_buildin_polkit
da9632e2
JL
214echo Enable GTK3 support.......................... : $enable_gtk3
215echo Enable debug................................. : $enable_debug
a0cc98b9 216echo Man pages generation support................. : $enable_man
dd69beb8
FC
217echo
218echo The binary will be installed in $prefix/bin
219echo
a2d20055 220echo http://lxde.org/
dd69beb8
FC
221echo
222echo Have fun!
223echo