translations sync
[lxde/lxpanel.git] / configure.ac
CommitLineData
a52c2257 1AC_PREREQ(2.53)
0df82ec6 2AC_INIT(lxpanel, 0.5.7, http://lxde.org/)
8e4890cb 3AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign])
a52c2257
HJYP
4AC_CONFIG_HEADER([config.h])
5
8e4890cb
JL
6# Support silent build rules. Disable by either passing --disable-silent-rules
7# to configure or passing V=1 to make
8AM_SILENT_RULES([yes])
9
86db742c
JH
10# Force to dynamic
11AC_DISABLE_STATIC
12
a52c2257
HJYP
13# Checks for programs.
14AC_PROG_CC
15AC_PROG_INSTALL
16AC_PROG_LN_S
17AC_PROG_INTLTOOL(, [no-xml])
e7a42ecf 18AM_PROG_CC_C_O
a52c2257 19
8e4890cb
JL
20#Initialize libtool
21LT_PREREQ([2.2])
22LT_INIT
23
a52c2257 24# Checks for libraries.
b3139230 25pkg_modules="gtk+-2.0 >= 2.12.0 \
1d434622 26 gio-unix-2.0 \
ace2a572 27 gthread-2.0"
fb20a9b5 28# libstartup-notification-1.0"
a52c2257
HJYP
29PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
30AC_SUBST(PACKAGE_CFLAGS)
31AC_SUBST(PACKAGE_LIBS)
32
9bf13ef5
MTW
33pkg_modules="x11"
34PKG_CHECK_MODULES(X11, [$pkg_modules])
35AC_SUBST(X11_LIBS)
36
ace2a572
JH
37pkg_modules="libmenu-cache"
38PKG_CHECK_MODULES(MENU_CACHE, [$pkg_modules],
39 enable_menu_cache=yes, enable_menu_cache=no)
40if test x"$enable_menu_cache" = "xno"; then
41 AC_WARN([No libmenu-cache found. All menu related routines are not built.])
42 AC_DEFINE(DISABLE_MENU, [1], [Disable menu related routines])
43fi
44AC_SUBST(MENU_CACHE_CFLAGS)
45AC_SUBST(MENU_CACHE_LIBS)
ade9c95c 46AM_CONDITIONAL(ENABLE_MENU_CACHE, test x"$enable_menu_cache" = x"yes")
ace2a572 47
77f69cbd
JL
48AC_ARG_ENABLE(more_warnings,
49 [AC_HELP_STRING([--enable-more-warnings],
50 [Add more warnings @<:@default=no@:>@])],
51 [enable_more_warnings="${enableval}"],
52 [enable_more_warnings=no]
53)
54
55if test x"$enable_more_warnings" = x"yes"; then
56 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"
57fi
58AC_SUBST(ADDITIONAL_FLAGS)
ade9c95c 59
77f69cbd 60PACKAGE_CFLAGS="$PACKAGE_CFLAGS $MENU_CACHE_CFLAGS $ADDITIONAL_FLAGS"
ace2a572
JH
61PACKAGE_LIBS="$PACKAGE_LIBS $MENU_CACHE_LIBS"
62
40189d64
JH
63AC_ARG_ENABLE(man,
64 [AC_HELP_STRING([--enable-man],
65 [regenerate roff man pages from Docbook @<:@default=no@:>@])],
66 [enable_man="${enableval}"],
67 [enable_man=no]
68)
69
535ac098 70AC_ARG_ENABLE([cast-checks],
24053345
HJYP
71 AS_HELP_STRING([--enable-cast-checks],
72 [enable Glib casting checks (default: disable)]),
73 cast_checks=$enableval, cast_checks="no")
535ac098
JH
74G_CAST_CHECKS=""
75if test x"$cast_checks" = "xno"; then
24053345 76 G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
535ac098
JH
77fi
78AC_SUBST(G_CAST_CHECKS)
79
cc0c9990
JH
80dnl linker tweaking
81# The function of the link flag --as-needed is to prevent unnecesary linking.
82# Example: A -> B -> C
20b3e401
JH
83# Normally, A would link to B and also depend on C, this is of cource
84# unnecesary. In this situation, however we do need to link to C, so this
cc0c9990
JH
85# must be done explicitly. This flag comes in handy when a library ABI
86# is changed, minimizing the amount of recompilations needed.
87AC_MSG_CHECKING([whether $LD accepts --as-needed])
88case `$LD --as-needed -v 2>&1 </dev/null` in
89*GNU* | *'with BFD'*)
20b3e401
JH
90 LDFLAGS="$LDFLAGS -Wl,--as-needed"
91 AC_MSG_RESULT([yes])
92 ;;
cc0c9990 93*)
20b3e401
JH
94 AC_MSG_RESULT([no])
95 ;;
cc0c9990
JH
96esac
97
cae18977
JH
98dnl linker optimizations
99AC_MSG_CHECKING([whether $LD accepts -O1])
100case `$LD -O1 -v 2>&1 </dev/null` in
101*GNU* | *'with BFD'*)
102 LDFLAGS="$LDFLAGS -Wl,-O1"
103 AC_MSG_RESULT([yes])
104 ;;
105*)
106 AC_MSG_RESULT([no])
107 ;;
108esac
109AC_MSG_CHECKING([whether $LD accepts -Bsymbolic-functions])
110case `$LD -Bsymbolic-functions -v 2>&1 </dev/null` in
111*GNU* | *'with BFD'*)
112 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
113 AC_MSG_RESULT([yes])
114 ;;
7e20ea34 115*)
cae18977
JH
116 AC_MSG_RESULT([no])
117 ;;
118esac
85026f6c
JH
119AC_MSG_CHECKING([whether $LD accepts --sort-common])
120case `$LD --sort-common -v 2>&1 </dev/null` in
7e20ea34 121*GNU* | *'with BFD'*)
85026f6c
JH
122 LDFLAGS="$LDFLAGS -Wl,--sort-common"
123 AC_MSG_RESULT([yes])
124 ;;
125*)
126 AC_MSG_RESULT([no])
127 ;;
128esac
cae18977 129
cc0c9990
JH
130dnl FIXME: filter for undefined symbols in plugins
131# when passing "-z defs" to linker, we would better to make sure
132# there are no undefined references. However, we intend not to
133# fix at the moment since we don't have spin-off libraray containing
134# the necessary functions.
135if test ! -z "$LDFLAGS"; then
20b3e401 136 LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-Wl,-z,defs//'`
cc0c9990
JH
137fi
138
139LXPANEL_MODULE="-avoid-version \
140-rpath \$(libdir)/lxpanel/plugins \
141-no-undefined "'-export-symbols-regex "^[[^_]].*"'
142AC_SUBST(LXPANEL_MODULE)
143
c044bccf 144AC_ARG_ENABLE([alsa],
24053345
HJYP
145 AS_HELP_STRING([--disable-alsa],
146 [compile ALSA providers (default: enable)]),
147 compile_alsa=$enableval, compile_alsa="yes")
c044bccf 148if test x"$compile_alsa" = "xyes"; then
24053345
HJYP
149 AC_CHECK_HEADERS([alsa/asoundlib.h],
150 [AC_CHECK_LIB([asound],
151 [snd_seq_open],
152 compile_alsa=yes,compile_alsa=no)],
c044bccf
JH
153 compile_alsa=no)
154fi
155AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes)
156dnl FIXME: check OSS existence
157AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno)
158
2d29cc96 159AC_ARG_ENABLE([plugins-loading],
24053345
HJYP
160 AS_HELP_STRING([--disable-plugins-loading],
161 [disable plugin loading (default: enable)]),
162 plugins_loading=$enableval, plugins_loading="yes")
2d29cc96 163
31b80004
JH
164AM_CONDITIONAL(BUILD_PLUGIN_LOADER, test x$plugins_loading = xyes)
165
535ac098 166if test x"$plugins_loading" = "xno"; then
24053345 167 AC_DEFINE(DISABLE_PLUGINS_LOADING, [1], [Disable plugin loading])
2d29cc96
JH
168fi
169
199c3ea8
JH
170dnl Here are plugin listing.
171plugin_netstatus=
172plugin_volume=
15556f61 173plugin_volumealsa=
199c3ea8 174plugin_cpu=
ce728cd9 175plugin_deskno=
8f11d5f8 176plugin_batt=
22242ed4 177plugin_xkb=
7e20ea34 178plugin_kbled=
09f498a1 179plugin_thermal=
c03f7bd0 180plugin_cpufreq=
199c3ea8
JH
181
182AC_MSG_CHECKING([which plugins should be built dynamically])
183AC_ARG_WITH(plugins,
184[ --with-plugins=<list> compile dynamic plugins in <list> ]
185[ plugins may be comma separated ]
186[ 'all' builds all plugins (default), 'none' builds none ]
187[ Possible plugins are: ]
c03f7bd0 188[ netstatus, volume, volumealsa, cpu, deskno, batt, kbled, xkb, thermal, cpufreq], plugins="$withval",[plugins="all"])
199c3ea8
JH
189
190if test x"$plugins" != xall -a x"$plugins" != xnone; then
24053345
HJYP
191 if test x"$plugins_loading" = xno; then
192 AC_MSG_ERROR(
193 [--disable-plugins-loading and --with-plugins conflict each other.])
194 fi
199c3ea8
JH
195fi
196
974881a1 197ALL_PLUGINS_LIST="netstatus volume volumealsa cpu deskno batt kbled xkb thermal cpufreq"
24053345
HJYP
198AC_SUBST(ALL_PLUGINS_LIST)
199
199c3ea8 200if test x"$plugins" = xall; then
24053345
HJYP
201dnl for name in $ALL_PLUGINS
202dnl do
203dnl export plugin_$name="$name"
204dnl done
205
206 plugin_netstatus=netstatus
24053345
HJYP
207 plugin_volume=volume
208 plugin_volumealsa=volumealsa
209 plugin_cpu=cpu
210 plugin_deskno=deskno
211 plugin_batt=batt
7e20ea34 212 plugin_kbled=kbled
8f9e6256 213 plugin_xkb=xkb
62550cea 214 plugin_thermal=thermal
c03f7bd0 215 plugin_cpufreq=cpufreq
24053345
HJYP
216
217 AC_MSG_RESULT(all)
199c3ea8 218else
24053345
HJYP
219 if test "$plugins" != "none"; then
220 plugins=`echo $plugins | sed 's/,/ /g'`
221 for plugin in $plugins
222 do
223 case "$plugin" in
224 netstatus)
225 plugin_netstatus=netstatus
226 ;;
24053345
HJYP
227 volume)
228 plugin_volume=volume
229 ;;
230 volumealsa)
231 plugin_volumealsa=volumealsa
232 ;;
233 cpu)
234 plugin_cpu=cpu
235 ;;
236 deskno)
237 plugin_deskno=deskno
238 ;;
239 batt)
22242ed4
HJYP
240 plugin_batt=batt
241 ;;
7e20ea34
HJYP
242 kbled)
243 plugin_kbled=kbled
244 ;;
22242ed4
HJYP
245 xkb)
246 plugin_xkb=xkb
24053345 247 ;;
62550cea
FC
248 thermal)
249 plugin_thermal=thermal
250 ;;
c03f7bd0
DK
251 cpufreq)
252 plugin_cpufreq=cpufreq
253 ;;
24053345
HJYP
254 *)
255 echo "Unknown plugin $plugin."
256 exit 1
257 ;;
258 esac
259 done
260 AC_MSG_RESULT($plugins)
261 fi
199c3ea8
JH
262fi
263
c044bccf
JH
264dnl FIXME: OSS/ALSA checking
265if test x"$compile_alsa" = "xno"; then
24053345
HJYP
266 if test ! -z $plugin_volumealsa; then
267 AC_MSG_RESULT([no ALSA headers/libraries found!])
268 plugin_volumealsa=
269 fi
c044bccf 270else
24053345
HJYP
271 dnl force OSS plugin to <null>
272 plugin_volume=
c044bccf 273fi
22242ed4 274PLUGINS_LIST="\
7e20ea34 275 $plugin_netstatus \
7e20ea34
HJYP
276 $plugin_volume \
277 $plugin_volumealsa \
278 $plugin_cpu \
279 $plugin_deskno \
280 $plugin_batt \
281 $plugin_kbled \
62550cea 282 $plugin_xkb \
c03f7bd0
DK
283 $plugin_thermal \
284 $plugin_cpufreq"
22242ed4 285
199c3ea8
JH
286AC_SUBST(PLUGINS_LIST)
287
1141e22a 288
a52c2257
HJYP
289# Checks for header files.
290AC_PATH_X
291AC_HEADER_STDC
292AC_HEADER_SYS_WAIT
293AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
294
295# Checks for typedefs, structures, and compiler characteristics.
296AC_C_CONST
297AC_C_INLINE
298AC_STRUCT_TM
299
300# Checks for library functions.
301AC_FUNC_MALLOC
302AC_FUNC_MEMCMP
303AC_TYPE_SIGNAL
304AC_FUNC_STAT
305AC_FUNC_STRFTIME
306AC_CHECK_FUNCS([bzero memset mkdir setlocale strchr])
307
308
5f9e4cb1
JL
309# Generate po/LINGUAS on the fly rather than relying on translators
310# to maintain it manually. This also overcome the problem that Transifex
311# cannot add a language to po/LINGUAS if a new po file is submitted.
312rm -f $srcdir/po/LINGUAS
313for po_file in `ls $srcdir/po/*.po | sort`;
314do
315 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
316 echo $lang >> $srcdir/po/LINGUAS
317done
318
a52c2257 319GETTEXT_PACKAGE=lxpanel
42fe8c5f 320#AM_GNU_GETTEXT([external])
a52c2257
HJYP
321AM_GNU_GETTEXT_VERSION(0.14.1)
322AC_SUBST(GETTEXT_PACKAGE)
323AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
324
a52c2257
HJYP
325AM_GLIB_GNU_GETTEXT
326
40189d64
JH
327if test x"$enable_man" = x"yes"; then
328 AC_PATH_PROG([XSLTPROC], [xsltproc])
329 if test -z "$XSLTPROC"; then
330 enable_man=no
331 fi
332
333 dnl check for DocBook DTD and stylesheets in the local catalog.
334 JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
335 [DocBook XML DTD V4.1.2], [], enable_man=no)
336 JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
337 [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no)
338fi
339
340AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")
341
a52c2257 342AC_CONFIG_FILES([
f5c43b11 343 lxpanel.pc
24053345
HJYP
344 Makefile
345 src/Makefile
346 src/plugins/Makefile
347 src/plugins/netstatus/Makefile
24053345
HJYP
348 src/plugins/volume/Makefile
349 src/plugins/volumealsa/Makefile
350 src/plugins/cpu/Makefile
351 src/plugins/deskno/Makefile
352 src/plugins/batt/Makefile
7e20ea34 353 src/plugins/kbled/Makefile
22242ed4 354 src/plugins/xkb/Makefile
62550cea 355 src/plugins/thermal/Makefile
c03f7bd0 356 src/plugins/cpufreq/Makefile
24053345
HJYP
357 po/Makefile.in
358 data/Makefile
cf701cb7 359 data/default/panels/panel
70344206 360 man/Makefile
a52c2257
HJYP
361])
362AC_OUTPUT
199c3ea8 363
24053345 364echo
ce728cd9 365echo lxpanel ......................... : Version $VERSION
199c3ea8
JH
366echo
367echo Prefix........................... : $prefix
368if test x$plugins_loading = xyes; then
369echo Building dynamic plugins:
24053345
HJYP
370 if test x"$plugin_netstatus" != x; then
371 AC_MSG_RESULT([ netstatus - Monitor networking status])
372 fi
24053345 373 if test x"$plugin_volume" != x; then
8f9e6256 374 AC_MSG_RESULT([ volume - Display and adjust volume of sound card for OSS])
24053345
HJYP
375 fi
376 if test x"$plugin_volumealsa" != x; then
377 AC_MSG_RESULT([ volumealsa - Display and adjust volume of sound card for ALSA])
378 fi
379 if test x"$plugin_cpu" != x; then
380 AC_MSG_RESULT([ cpu - Display CPU loading])
381 fi
382 if test x"$plugin_deskno" != x; then
383 AC_MSG_RESULT([ deskno - Display desktop number])
384 fi
385 if test x"$plugin_batt" != x; then
386 AC_MSG_RESULT([ batt - Monitor battery status])
387 fi
7e20ea34
HJYP
388 if test x"$plugin_kbled" != x; then
389 AC_MSG_RESULT([ kbled - Indicator for CapsLock, NumLock, and ScrLock])
390 fi
22242ed4
HJYP
391 if test x"$plugin_xkb" != x; then
392 AC_MSG_RESULT([ xkb - Keyboard layout switcher])
393 fi
62550cea
FC
394 if test x"$plugin_thermal" != x; then
395 AC_MSG_RESULT([ thermal - Temperature monitor])
396 fi
c03f7bd0
DK
397 if test x"$plugin_cpufreq" != x; then
398 AC_MSG_RESULT([ cpufreq - CpuFreq frontend])
399 fi
199c3ea8
JH
400else
401echo Dynamic loader for plugins....... : disabled.
402fi
1234b94c
HJYP
403
404echo
46cea569
HJYP
405echo 'LXPanel requires menu-cache and lxmenu-data packages since'
406echo 'version 0.4.0. Please make sure they are correctly installed.'
407echo 'Otherwise, you will not be able to use applications menu.'
408echo
1234b94c 409