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