Update translation of lxpanel.
[lxde/lxpanel.git] / configure.ac
CommitLineData
a52c2257 1AC_PREREQ(2.53)
4d1028b5 2AC_INIT(lxpanel, 0.2.8.2, http://lxde.sourceforge.net/)
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 ;;
70*)
71 AC_MSG_RESULT([no])
72 ;;
73esac
74
cc0c9990
JH
75dnl FIXME: filter for undefined symbols in plugins
76# when passing "-z defs" to linker, we would better to make sure
77# there are no undefined references. However, we intend not to
78# fix at the moment since we don't have spin-off libraray containing
79# the necessary functions.
80if test ! -z "$LDFLAGS"; then
20b3e401 81 LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-Wl,-z,defs//'`
cc0c9990
JH
82fi
83
84LXPANEL_MODULE="-avoid-version \
85-rpath \$(libdir)/lxpanel/plugins \
86-no-undefined "'-export-symbols-regex "^[[^_]].*"'
87AC_SUBST(LXPANEL_MODULE)
88
c044bccf 89AC_ARG_ENABLE([alsa],
24053345
HJYP
90 AS_HELP_STRING([--disable-alsa],
91 [compile ALSA providers (default: enable)]),
92 compile_alsa=$enableval, compile_alsa="yes")
c044bccf 93if test x"$compile_alsa" = "xyes"; then
24053345
HJYP
94 AC_CHECK_HEADERS([alsa/asoundlib.h],
95 [AC_CHECK_LIB([asound],
96 [snd_seq_open],
97 compile_alsa=yes,compile_alsa=no)],
c044bccf
JH
98 compile_alsa=no)
99fi
100AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes)
101dnl FIXME: check OSS existence
102AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno)
103
e64c0317
JH
104# check libiw for netstat plugin
105AC_ARG_ENABLE([libiw],
106 AS_HELP_STRING([--disable-libiw],
107 [compile libiw-based netstat plugin (default: enable)]),
108 compile_libiw=$enableval, compile_libiw="yes")
109if test x"$compile_libiw" = "xyes"; then
110 AC_CHECK_HEADERS(iwlib.h,
111 [AC_CHECK_LIB(iw,
112 iw_sockets_open,
113 compile_libiw=yes,
114 compile_libiw=no)],
115 compile_libiw=no)
116fi
117AM_CONDITIONAL(BUILD_LIBIW_PLUGINS, test x$compile_libiw = xyes)
118
2d29cc96 119AC_ARG_ENABLE([plugins-loading],
24053345
HJYP
120 AS_HELP_STRING([--disable-plugins-loading],
121 [disable plugin loading (default: enable)]),
122 plugins_loading=$enableval, plugins_loading="yes")
2d29cc96 123
31b80004
JH
124AM_CONDITIONAL(BUILD_PLUGIN_LOADER, test x$plugins_loading = xyes)
125
535ac098 126if test x"$plugins_loading" = "xno"; then
24053345 127 AC_DEFINE(DISABLE_PLUGINS_LOADING, [1], [Disable plugin loading])
2d29cc96
JH
128fi
129
199c3ea8
JH
130dnl Here are plugin listing.
131plugin_netstatus=
19348802 132plugin_netstat=
199c3ea8 133plugin_volume=
15556f61 134plugin_volumealsa=
199c3ea8 135plugin_cpu=
ce728cd9 136plugin_deskno=
8f11d5f8 137plugin_batt=
199c3ea8
JH
138
139AC_MSG_CHECKING([which plugins should be built dynamically])
140AC_ARG_WITH(plugins,
141[ --with-plugins=<list> compile dynamic plugins in <list> ]
142[ plugins may be comma separated ]
143[ 'all' builds all plugins (default), 'none' builds none ]
144[ Possible plugins are: ]
19348802 145[ netstatus, netstat, volume, volumealsa, cpu, deskno, batt], plugins="$withval",[plugins="all"])
199c3ea8
JH
146
147if test x"$plugins" != xall -a x"$plugins" != xnone; then
24053345
HJYP
148 if test x"$plugins_loading" = xno; then
149 AC_MSG_ERROR(
150 [--disable-plugins-loading and --with-plugins conflict each other.])
151 fi
199c3ea8
JH
152fi
153
24053345
HJYP
154ALL_PLUGINS_LIST="netstatus netstat volume volumealsa cpu deskno batt"
155AC_SUBST(ALL_PLUGINS_LIST)
156
199c3ea8 157if test x"$plugins" = xall; then
24053345
HJYP
158dnl for name in $ALL_PLUGINS
159dnl do
160dnl export plugin_$name="$name"
161dnl done
162
163 plugin_netstatus=netstatus
164 plugin_netstat=netstat
165 plugin_volume=volume
166 plugin_volumealsa=volumealsa
167 plugin_cpu=cpu
168 plugin_deskno=deskno
169 plugin_batt=batt
170
171 AC_MSG_RESULT(all)
199c3ea8 172else
24053345
HJYP
173 if test "$plugins" != "none"; then
174 plugins=`echo $plugins | sed 's/,/ /g'`
175 for plugin in $plugins
176 do
177 case "$plugin" in
178 netstatus)
179 plugin_netstatus=netstatus
180 ;;
181 netstat)
182 plugin_netstat=netstat
183 ;;
184 volume)
185 plugin_volume=volume
186 ;;
187 volumealsa)
188 plugin_volumealsa=volumealsa
189 ;;
190 cpu)
191 plugin_cpu=cpu
192 ;;
193 deskno)
194 plugin_deskno=deskno
195 ;;
196 batt)
197 plugin_deskno=batt
198 ;;
199 *)
200 echo "Unknown plugin $plugin."
201 exit 1
202 ;;
203 esac
204 done
205 AC_MSG_RESULT($plugins)
206 fi
199c3ea8
JH
207fi
208
c044bccf
JH
209dnl FIXME: OSS/ALSA checking
210if test x"$compile_alsa" = "xno"; then
24053345
HJYP
211 if test ! -z $plugin_volumealsa; then
212 AC_MSG_RESULT([no ALSA headers/libraries found!])
213 plugin_volumealsa=
214 fi
c044bccf 215else
24053345
HJYP
216 dnl force OSS plugin to <null>
217 plugin_volume=
c044bccf 218fi
e64c0317
JH
219if test x"$compile_libiw" = "xno"; then
220 if test ! -z $plugin_netstat; then
221 AC_MSG_RESULT([no libiw headers/libraries found!])
222 fi
223 plugin_netstat=
224fi
19348802 225PLUGINS_LIST="$plugin_netstatus $plugin_netstat $plugin_volume $plugin_volumealsa $plugin_cpu $plugin_deskno $plugin_batt"
199c3ea8
JH
226AC_SUBST(PLUGINS_LIST)
227
1141e22a 228
a52c2257
HJYP
229# Checks for header files.
230AC_PATH_X
231AC_HEADER_STDC
232AC_HEADER_SYS_WAIT
233AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
234
235# Checks for typedefs, structures, and compiler characteristics.
236AC_C_CONST
237AC_C_INLINE
238AC_STRUCT_TM
239
240# Checks for library functions.
241AC_FUNC_MALLOC
242AC_FUNC_MEMCMP
243AC_TYPE_SIGNAL
244AC_FUNC_STAT
245AC_FUNC_STRFTIME
246AC_CHECK_FUNCS([bzero memset mkdir setlocale strchr])
247
248
249GETTEXT_PACKAGE=lxpanel
42fe8c5f 250#AM_GNU_GETTEXT([external])
a52c2257
HJYP
251AM_GNU_GETTEXT_VERSION(0.14.1)
252AC_SUBST(GETTEXT_PACKAGE)
253AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
254
a134326c
FC
255#ALL_LINGUAS="zh_TW ko hu sk pl fr pt_BR"
256ALL_LINGUAS="zh_TW ko hu sk pl fr"
a52c2257
HJYP
257AM_GLIB_GNU_GETTEXT
258
259AC_CONFIG_FILES([
24053345
HJYP
260 Makefile
261 src/Makefile
262 src/plugins/Makefile
263 src/plugins/netstatus/Makefile
264 src/plugins/netstat/Makefile
265 src/plugins/volume/Makefile
266 src/plugins/volumealsa/Makefile
267 src/plugins/cpu/Makefile
268 src/plugins/deskno/Makefile
269 src/plugins/batt/Makefile
270 po/Makefile.in
271 data/Makefile
272 data/default/config
70344206 273 man/Makefile
a52c2257
HJYP
274])
275AC_OUTPUT
199c3ea8 276
24053345 277echo
ce728cd9 278echo lxpanel ......................... : Version $VERSION
199c3ea8
JH
279echo
280echo Prefix........................... : $prefix
281if test x$plugins_loading = xyes; then
282echo Building dynamic plugins:
24053345
HJYP
283 if test x"$plugin_netstatus" != x; then
284 AC_MSG_RESULT([ netstatus - Monitor networking status])
285 fi
286 if test x"$plugin_netstat" != x; then
287 AC_MSG_RESULT([ netstat - Monitor networking status (Linux Only)])
288 fi
289 if test x"$plugin_volume" != x; then
290 AC_MSG_RESULT([ volume - Display and adjust volume of sound card])
291 fi
292 if test x"$plugin_volumealsa" != x; then
293 AC_MSG_RESULT([ volumealsa - Display and adjust volume of sound card for ALSA])
294 fi
295 if test x"$plugin_cpu" != x; then
296 AC_MSG_RESULT([ cpu - Display CPU loading])
297 fi
298 if test x"$plugin_deskno" != x; then
299 AC_MSG_RESULT([ deskno - Display desktop number])
300 fi
301 if test x"$plugin_batt" != x; then
302 AC_MSG_RESULT([ batt - Monitor battery status])
303 fi
199c3ea8
JH
304else
305echo Dynamic loader for plugins....... : disabled.
306fi