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