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