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