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