Fix the bug in menu button config saving multiple image files.
[lxde/lxpanel.git] / configure.ac
CommitLineData
a52c2257 1AC_PREREQ(2.53)
c14f78d1 2AC_INIT(lxpanel, 0.3.8.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
928b57b6 12AM_PROG_CC_C_O
a52c2257
HJYP
13AC_PROG_INSTALL
14AC_PROG_LN_S
1141e22a 15AC_PROG_LIBTOOL
a52c2257
HJYP
16AC_PROG_INTLTOOL(, [no-xml])
17
18# Checks for libraries.
f1286efa 19pkg_modules="gtk+-2.0 >= 2.12.0 \
70684259
HJYP
20 gthread-2.0 \
21 libmenu-cache"
fb20a9b5 22# libstartup-notification-1.0"
a52c2257
HJYP
23PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
24AC_SUBST(PACKAGE_CFLAGS)
25AC_SUBST(PACKAGE_LIBS)
26
f1286efa 27# Gtk Builder
4bfa602f
HJYP
28#AC_PATH_PROG([GTK_BUILDER_CONVERT],[gtk-builder-convert],[false])
29#if test "$GTK_BUILDER_CONVERT" = "false"; then
30# AC_MSG_ERROR([gtk-builder-convert not found])
31#fi
f1286efa 32
535ac098 33AC_ARG_ENABLE([cast-checks],
24053345
HJYP
34 AS_HELP_STRING([--enable-cast-checks],
35 [enable Glib casting checks (default: disable)]),
36 cast_checks=$enableval, cast_checks="no")
535ac098
JH
37G_CAST_CHECKS=""
38if test x"$cast_checks" = "xno"; then
24053345 39 G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
535ac098
JH
40fi
41AC_SUBST(G_CAST_CHECKS)
42
cc0c9990
JH
43dnl linker tweaking
44# The function of the link flag --as-needed is to prevent unnecesary linking.
45# Example: A -> B -> C
20b3e401
JH
46# Normally, A would link to B and also depend on C, this is of cource
47# unnecesary. In this situation, however we do need to link to C, so this
cc0c9990
JH
48# must be done explicitly. This flag comes in handy when a library ABI
49# is changed, minimizing the amount of recompilations needed.
50AC_MSG_CHECKING([whether $LD accepts --as-needed])
51case `$LD --as-needed -v 2>&1 </dev/null` in
52*GNU* | *'with BFD'*)
20b3e401
JH
53 LDFLAGS="$LDFLAGS -Wl,--as-needed"
54 AC_MSG_RESULT([yes])
55 ;;
cc0c9990 56*)
20b3e401
JH
57 AC_MSG_RESULT([no])
58 ;;
cc0c9990
JH
59esac
60
cae18977
JH
61dnl linker optimizations
62AC_MSG_CHECKING([whether $LD accepts -O1])
63case `$LD -O1 -v 2>&1 </dev/null` in
64*GNU* | *'with BFD'*)
65 LDFLAGS="$LDFLAGS -Wl,-O1"
66 AC_MSG_RESULT([yes])
67 ;;
68*)
69 AC_MSG_RESULT([no])
70 ;;
71esac
72AC_MSG_CHECKING([whether $LD accepts -Bsymbolic-functions])
73case `$LD -Bsymbolic-functions -v 2>&1 </dev/null` in
74*GNU* | *'with BFD'*)
75 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
76 AC_MSG_RESULT([yes])
77 ;;
7e20ea34 78*)
cae18977
JH
79 AC_MSG_RESULT([no])
80 ;;
81esac
85026f6c
JH
82AC_MSG_CHECKING([whether $LD accepts --sort-common])
83case `$LD --sort-common -v 2>&1 </dev/null` in
7e20ea34 84*GNU* | *'with BFD'*)
85026f6c
JH
85 LDFLAGS="$LDFLAGS -Wl,--sort-common"
86 AC_MSG_RESULT([yes])
87 ;;
88*)
89 AC_MSG_RESULT([no])
90 ;;
91esac
cae18977 92
cc0c9990
JH
93dnl FIXME: filter for undefined symbols in plugins
94# when passing "-z defs" to linker, we would better to make sure
95# there are no undefined references. However, we intend not to
96# fix at the moment since we don't have spin-off libraray containing
97# the necessary functions.
98if test ! -z "$LDFLAGS"; then
20b3e401 99 LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-Wl,-z,defs//'`
cc0c9990
JH
100fi
101
102LXPANEL_MODULE="-avoid-version \
103-rpath \$(libdir)/lxpanel/plugins \
104-no-undefined "'-export-symbols-regex "^[[^_]].*"'
105AC_SUBST(LXPANEL_MODULE)
106
c044bccf 107AC_ARG_ENABLE([alsa],
24053345
HJYP
108 AS_HELP_STRING([--disable-alsa],
109 [compile ALSA providers (default: enable)]),
110 compile_alsa=$enableval, compile_alsa="yes")
c044bccf 111if test x"$compile_alsa" = "xyes"; then
24053345
HJYP
112 AC_CHECK_HEADERS([alsa/asoundlib.h],
113 [AC_CHECK_LIB([asound],
114 [snd_seq_open],
115 compile_alsa=yes,compile_alsa=no)],
c044bccf
JH
116 compile_alsa=no)
117fi
118AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes)
119dnl FIXME: check OSS existence
120AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno)
121
e64c0317
JH
122# check libiw for netstat plugin
123AC_ARG_ENABLE([libiw],
124 AS_HELP_STRING([--disable-libiw],
125 [compile libiw-based netstat plugin (default: enable)]),
126 compile_libiw=$enableval, compile_libiw="yes")
127if test x"$compile_libiw" = "xyes"; then
128 AC_CHECK_HEADERS(iwlib.h,
129 [AC_CHECK_LIB(iw,
130 iw_sockets_open,
131 compile_libiw=yes,
132 compile_libiw=no)],
133 compile_libiw=no)
134fi
135AM_CONDITIONAL(BUILD_LIBIW_PLUGINS, test x$compile_libiw = xyes)
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=
19348802 150plugin_netstat=
199c3ea8 151plugin_volume=
15556f61 152plugin_volumealsa=
199c3ea8 153plugin_cpu=
ce728cd9 154plugin_deskno=
8f11d5f8 155plugin_batt=
22242ed4 156plugin_xkb=
7e20ea34 157plugin_kbled=
62550cea 158plugin_thermal=thermal
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: ]
62550cea 166[ netstatus, netstat, volume, volumealsa, cpu, deskno, batt, kbled, xkb, thermal], 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
62550cea 175ALL_PLUGINS_LIST="netstatus netstat volume volumealsa cpu deskno batt kbled xkb thermal"
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
185 plugin_netstat=netstat
186 plugin_volume=volume
187 plugin_volumealsa=volumealsa
188 plugin_cpu=cpu
189 plugin_deskno=deskno
190 plugin_batt=batt
7e20ea34 191 plugin_kbled=kbled
9088628c 192 plugin_xkb=
62550cea 193 plugin_thermal=thermal
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 ;;
205 netstat)
206 plugin_netstat=netstat
207 ;;
208 volume)
209 plugin_volume=volume
210 ;;
211 volumealsa)
212 plugin_volumealsa=volumealsa
213 ;;
214 cpu)
215 plugin_cpu=cpu
216 ;;
217 deskno)
218 plugin_deskno=deskno
219 ;;
220 batt)
22242ed4
HJYP
221 plugin_batt=batt
222 ;;
7e20ea34
HJYP
223 kbled)
224 plugin_kbled=kbled
225 ;;
22242ed4
HJYP
226 xkb)
227 plugin_xkb=xkb
24053345 228 ;;
62550cea
FC
229 thermal)
230 plugin_thermal=thermal
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
e64c0317
JH
252if test x"$compile_libiw" = "xno"; then
253 if test ! -z $plugin_netstat; then
254 AC_MSG_RESULT([no libiw headers/libraries found!])
255 fi
256 plugin_netstat=
257fi
22242ed4 258PLUGINS_LIST="\
7e20ea34
HJYP
259 $plugin_netstatus \
260 $plugin_netstat \
261 $plugin_volume \
262 $plugin_volumealsa \
263 $plugin_cpu \
264 $plugin_deskno \
265 $plugin_batt \
266 $plugin_kbled \
62550cea
FC
267 $plugin_xkb \
268 $plugin_thermal"
22242ed4 269
199c3ea8
JH
270AC_SUBST(PLUGINS_LIST)
271
1141e22a 272
a52c2257
HJYP
273# Checks for header files.
274AC_PATH_X
275AC_HEADER_STDC
276AC_HEADER_SYS_WAIT
277AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
278
279# Checks for typedefs, structures, and compiler characteristics.
280AC_C_CONST
281AC_C_INLINE
282AC_STRUCT_TM
283
284# Checks for library functions.
285AC_FUNC_MALLOC
286AC_FUNC_MEMCMP
287AC_TYPE_SIGNAL
288AC_FUNC_STAT
289AC_FUNC_STRFTIME
290AC_CHECK_FUNCS([bzero memset mkdir setlocale strchr])
291
292
293GETTEXT_PACKAGE=lxpanel
42fe8c5f 294#AM_GNU_GETTEXT([external])
a52c2257
HJYP
295AM_GNU_GETTEXT_VERSION(0.14.1)
296AC_SUBST(GETTEXT_PACKAGE)
297AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
298
52dacfea 299ALL_LINGUAS="zh_TW ko hu sk pl fr pt_BR fi de es zh_CN"
a52c2257
HJYP
300AM_GLIB_GNU_GETTEXT
301
302AC_CONFIG_FILES([
24053345
HJYP
303 Makefile
304 src/Makefile
305 src/plugins/Makefile
306 src/plugins/netstatus/Makefile
307 src/plugins/netstat/Makefile
308 src/plugins/volume/Makefile
309 src/plugins/volumealsa/Makefile
310 src/plugins/cpu/Makefile
311 src/plugins/deskno/Makefile
312 src/plugins/batt/Makefile
7e20ea34 313 src/plugins/kbled/Makefile
22242ed4 314 src/plugins/xkb/Makefile
62550cea 315 src/plugins/thermal/Makefile
24053345
HJYP
316 po/Makefile.in
317 data/Makefile
cf701cb7 318 data/default/panels/panel
70344206 319 man/Makefile
a52c2257
HJYP
320])
321AC_OUTPUT
199c3ea8 322
24053345 323echo
ce728cd9 324echo lxpanel ......................... : Version $VERSION
199c3ea8
JH
325echo
326echo Prefix........................... : $prefix
327if test x$plugins_loading = xyes; then
328echo Building dynamic plugins:
24053345
HJYP
329 if test x"$plugin_netstatus" != x; then
330 AC_MSG_RESULT([ netstatus - Monitor networking status])
331 fi
332 if test x"$plugin_netstat" != x; then
333 AC_MSG_RESULT([ netstat - Monitor networking status (Linux Only)])
334 fi
335 if test x"$plugin_volume" != x; then
336 AC_MSG_RESULT([ volume - Display and adjust volume of sound card])
337 fi
338 if test x"$plugin_volumealsa" != x; then
339 AC_MSG_RESULT([ volumealsa - Display and adjust volume of sound card for ALSA])
340 fi
341 if test x"$plugin_cpu" != x; then
342 AC_MSG_RESULT([ cpu - Display CPU loading])
343 fi
344 if test x"$plugin_deskno" != x; then
345 AC_MSG_RESULT([ deskno - Display desktop number])
346 fi
347 if test x"$plugin_batt" != x; then
348 AC_MSG_RESULT([ batt - Monitor battery status])
349 fi
7e20ea34
HJYP
350 if test x"$plugin_kbled" != x; then
351 AC_MSG_RESULT([ kbled - Indicator for CapsLock, NumLock, and ScrLock])
352 fi
22242ed4
HJYP
353 if test x"$plugin_xkb" != x; then
354 AC_MSG_RESULT([ xkb - Keyboard layout switcher])
355 fi
62550cea
FC
356 if test x"$plugin_thermal" != x; then
357 AC_MSG_RESULT([ thermal - Temperature monitor])
358 fi
199c3ea8
JH
359else
360echo Dynamic loader for plugins....... : disabled.
361fi