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