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