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