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