Rename lxlauncher.menu to lxlauncher-applications.menu.
[lxde/lxpanel.git] / configure.ac
CommitLineData
a52c2257 1AC_PREREQ(2.53)
1234b94c 2AC_INIT(lxpanel, 0.4.0, 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
HJYP
15AC_PROG_INTLTOOL(, [no-xml])
16
17# Checks for libraries.
f1286efa 18pkg_modules="gtk+-2.0 >= 2.12.0 \
ace2a572 19 gthread-2.0"
fb20a9b5 20# libstartup-notification-1.0"
a52c2257
HJYP
21PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
22AC_SUBST(PACKAGE_CFLAGS)
23AC_SUBST(PACKAGE_LIBS)
24
ace2a572
JH
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
f1286efa 39# Gtk Builder
4bfa602f
HJYP
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
f1286efa 44
535ac098 45AC_ARG_ENABLE([cast-checks],
24053345
HJYP
46 AS_HELP_STRING([--enable-cast-checks],
47 [enable Glib casting checks (default: disable)]),
48 cast_checks=$enableval, cast_checks="no")
535ac098
JH
49G_CAST_CHECKS=""
50if test x"$cast_checks" = "xno"; then
24053345 51 G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
535ac098
JH
52fi
53AC_SUBST(G_CAST_CHECKS)
54
cc0c9990
JH
55dnl linker tweaking
56# The function of the link flag --as-needed is to prevent unnecesary linking.
57# Example: A -> B -> C
20b3e401
JH
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
cc0c9990
JH
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'*)
20b3e401
JH
65 LDFLAGS="$LDFLAGS -Wl,--as-needed"
66 AC_MSG_RESULT([yes])
67 ;;
cc0c9990 68*)
20b3e401
JH
69 AC_MSG_RESULT([no])
70 ;;
cc0c9990
JH
71esac
72
cae18977
JH
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 ;;
7e20ea34 90*)
cae18977
JH
91 AC_MSG_RESULT([no])
92 ;;
93esac
85026f6c
JH
94AC_MSG_CHECKING([whether $LD accepts --sort-common])
95case `$LD --sort-common -v 2>&1 </dev/null` in
7e20ea34 96*GNU* | *'with BFD'*)
85026f6c
JH
97 LDFLAGS="$LDFLAGS -Wl,--sort-common"
98 AC_MSG_RESULT([yes])
99 ;;
100*)
101 AC_MSG_RESULT([no])
102 ;;
103esac
cae18977 104
cc0c9990
JH
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
20b3e401 111 LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-Wl,-z,defs//'`
cc0c9990
JH
112fi
113
114LXPANEL_MODULE="-avoid-version \
115-rpath \$(libdir)/lxpanel/plugins \
116-no-undefined "'-export-symbols-regex "^[[^_]].*"'
117AC_SUBST(LXPANEL_MODULE)
118
c044bccf 119AC_ARG_ENABLE([alsa],
24053345
HJYP
120 AS_HELP_STRING([--disable-alsa],
121 [compile ALSA providers (default: enable)]),
122 compile_alsa=$enableval, compile_alsa="yes")
c044bccf 123if test x"$compile_alsa" = "xyes"; then
24053345
HJYP
124 AC_CHECK_HEADERS([alsa/asoundlib.h],
125 [AC_CHECK_LIB([asound],
126 [snd_seq_open],
127 compile_alsa=yes,compile_alsa=no)],
c044bccf
JH
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
e64c0317
JH
134# check libiw for netstat plugin
135AC_ARG_ENABLE([libiw],
136 AS_HELP_STRING([--disable-libiw],
137 [compile libiw-based netstat plugin (default: enable)]),
138 compile_libiw=$enableval, compile_libiw="yes")
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
2d29cc96 149AC_ARG_ENABLE([plugins-loading],
24053345
HJYP
150 AS_HELP_STRING([--disable-plugins-loading],
151 [disable plugin loading (default: enable)]),
152 plugins_loading=$enableval, plugins_loading="yes")
2d29cc96 153
31b80004
JH
154AM_CONDITIONAL(BUILD_PLUGIN_LOADER, test x$plugins_loading = xyes)
155
535ac098 156if test x"$plugins_loading" = "xno"; then
24053345 157 AC_DEFINE(DISABLE_PLUGINS_LOADING, [1], [Disable plugin loading])
2d29cc96
JH
158fi
159
199c3ea8
JH
160dnl Here are plugin listing.
161plugin_netstatus=
19348802 162plugin_netstat=
199c3ea8 163plugin_volume=
15556f61 164plugin_volumealsa=
199c3ea8 165plugin_cpu=
ce728cd9 166plugin_deskno=
8f11d5f8 167plugin_batt=
22242ed4 168plugin_xkb=
7e20ea34 169plugin_kbled=
62550cea 170plugin_thermal=thermal
199c3ea8
JH
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: ]
62550cea 178[ netstatus, netstat, volume, volumealsa, cpu, deskno, batt, kbled, xkb, thermal], plugins="$withval",[plugins="all"])
199c3ea8
JH
179
180if test x"$plugins" != xall -a x"$plugins" != xnone; then
24053345
HJYP
181 if test x"$plugins_loading" = xno; then
182 AC_MSG_ERROR(
183 [--disable-plugins-loading and --with-plugins conflict each other.])
184 fi
199c3ea8
JH
185fi
186
62550cea 187ALL_PLUGINS_LIST="netstatus netstat volume volumealsa cpu deskno batt kbled xkb thermal"
24053345
HJYP
188AC_SUBST(ALL_PLUGINS_LIST)
189
199c3ea8 190if test x"$plugins" = xall; then
24053345
HJYP
191dnl for name in $ALL_PLUGINS
192dnl do
193dnl export plugin_$name="$name"
194dnl done
195
196 plugin_netstatus=netstatus
197 plugin_netstat=netstat
198 plugin_volume=volume
199 plugin_volumealsa=volumealsa
200 plugin_cpu=cpu
201 plugin_deskno=deskno
202 plugin_batt=batt
7e20ea34 203 plugin_kbled=kbled
9088628c 204 plugin_xkb=
62550cea 205 plugin_thermal=thermal
24053345
HJYP
206
207 AC_MSG_RESULT(all)
199c3ea8 208else
24053345
HJYP
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)
22242ed4
HJYP
233 plugin_batt=batt
234 ;;
7e20ea34
HJYP
235 kbled)
236 plugin_kbled=kbled
237 ;;
22242ed4
HJYP
238 xkb)
239 plugin_xkb=xkb
24053345 240 ;;
62550cea
FC
241 thermal)
242 plugin_thermal=thermal
243 ;;
24053345
HJYP
244 *)
245 echo "Unknown plugin $plugin."
246 exit 1
247 ;;
248 esac
249 done
250 AC_MSG_RESULT($plugins)
251 fi
199c3ea8
JH
252fi
253
c044bccf
JH
254dnl FIXME: OSS/ALSA checking
255if test x"$compile_alsa" = "xno"; then
24053345
HJYP
256 if test ! -z $plugin_volumealsa; then
257 AC_MSG_RESULT([no ALSA headers/libraries found!])
258 plugin_volumealsa=
259 fi
c044bccf 260else
24053345
HJYP
261 dnl force OSS plugin to <null>
262 plugin_volume=
c044bccf 263fi
e64c0317
JH
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
22242ed4 270PLUGINS_LIST="\
7e20ea34
HJYP
271 $plugin_netstatus \
272 $plugin_netstat \
273 $plugin_volume \
274 $plugin_volumealsa \
275 $plugin_cpu \
276 $plugin_deskno \
277 $plugin_batt \
278 $plugin_kbled \
62550cea
FC
279 $plugin_xkb \
280 $plugin_thermal"
22242ed4 281
199c3ea8
JH
282AC_SUBST(PLUGINS_LIST)
283
1141e22a 284
a52c2257
HJYP
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
42fe8c5f 306#AM_GNU_GETTEXT([external])
a52c2257
HJYP
307AM_GNU_GETTEXT_VERSION(0.14.1)
308AC_SUBST(GETTEXT_PACKAGE)
309AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
310
52dacfea 311ALL_LINGUAS="zh_TW ko hu sk pl fr pt_BR fi de es zh_CN"
a52c2257
HJYP
312AM_GLIB_GNU_GETTEXT
313
314AC_CONFIG_FILES([
f5c43b11 315 lxpanel.pc
24053345
HJYP
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
7e20ea34 326 src/plugins/kbled/Makefile
22242ed4 327 src/plugins/xkb/Makefile
62550cea 328 src/plugins/thermal/Makefile
24053345
HJYP
329 po/Makefile.in
330 data/Makefile
cf701cb7 331 data/default/panels/panel
70344206 332 man/Makefile
a52c2257
HJYP
333])
334AC_OUTPUT
199c3ea8 335
24053345 336echo
ce728cd9 337echo lxpanel ......................... : Version $VERSION
199c3ea8
JH
338echo
339echo Prefix........................... : $prefix
340if test x$plugins_loading = xyes; then
341echo Building dynamic plugins:
24053345
HJYP
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
7e20ea34
HJYP
363 if test x"$plugin_kbled" != x; then
364 AC_MSG_RESULT([ kbled - Indicator for CapsLock, NumLock, and ScrLock])
365 fi
22242ed4
HJYP
366 if test x"$plugin_xkb" != x; then
367 AC_MSG_RESULT([ xkb - Keyboard layout switcher])
368 fi
62550cea
FC
369 if test x"$plugin_thermal" != x; then
370 AC_MSG_RESULT([ thermal - Temperature monitor])
371 fi
199c3ea8
JH
372else
373echo Dynamic loader for plugins....... : disabled.
374fi
1234b94c
HJYP
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 won't be able to use applications menu.
380