Point BackgroundFile to autotoolized path.
[lxde/lxpanel.git] / configure.ac
CommitLineData
a52c2257 1AC_PREREQ(2.53)
0f732403 2AC_INIT(lxpanel, 0.2.4, 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
JH
25AC_ARG_ENABLE([cast-checks],
26 AS_HELP_STRING([--enable-cast-checks],
27 [enable Glib casting checks (default: disable)]),
28 cast_checks=$enableval, cast_checks="no")
29G_CAST_CHECKS=""
30if test x"$cast_checks" = "xno"; then
31 G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
32fi
33AC_SUBST(G_CAST_CHECKS)
34
c044bccf
JH
35AC_ARG_ENABLE([alsa],
36 AS_HELP_STRING([--disable-alsa],
37 [compile ALSA providers (default: enable)]),
38 compile_alsa=$enableval, compile_alsa="yes")
39if test x"$compile_alsa" = "xyes"; then
40 AC_CHECK_HEADERS([alsa/asoundlib.h],
41 [AC_CHECK_LIB([asound],
42 [snd_seq_open],
43 compile_alsa=yes,compile_alsa=no)],
44 compile_alsa=no)
45fi
46AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes)
47dnl FIXME: check OSS existence
48AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno)
49
2d29cc96
JH
50AC_ARG_ENABLE([plugins-loading],
51 AS_HELP_STRING([--disable-plugins-loading],
52 [disable plugin loading (default: enable)]),
53 plugins_loading=$enableval, plugins_loading="yes")
54
31b80004
JH
55AM_CONDITIONAL(BUILD_PLUGIN_LOADER, test x$plugins_loading = xyes)
56
535ac098 57if test x"$plugins_loading" = "xno"; then
2d29cc96 58 AC_DEFINE(DISABLE_PLUGINS_LOADING, [1], [Disable plugin loading])
2d29cc96
JH
59fi
60
199c3ea8
JH
61dnl Here are plugin listing.
62plugin_netstatus=
63plugin_volume=
15556f61 64plugin_volumealsa=
199c3ea8 65plugin_cpu=
ce728cd9 66plugin_deskno=
8f11d5f8 67plugin_batt=
199c3ea8
JH
68
69AC_MSG_CHECKING([which plugins should be built dynamically])
70AC_ARG_WITH(plugins,
71[ --with-plugins=<list> compile dynamic plugins in <list> ]
72[ plugins may be comma separated ]
73[ 'all' builds all plugins (default), 'none' builds none ]
74[ Possible plugins are: ]
15556f61 75[ netstatus, volume, volumealsa, cpu, deskno, batt], plugins="$withval",[plugins="all"])
199c3ea8
JH
76
77if test x"$plugins" != xall -a x"$plugins" != xnone; then
78 if test x"$plugins_loading" = xno; then
79 AC_MSG_ERROR(
80 [--disable-plugins-loading and --with-plugins conflict each other.])
81 fi
82fi
83
84if test x"$plugins" = xall; then
85 plugin_netstatus=netstatus
86 plugin_volume=volume
15556f61 87 plugin_volumealsa=volumealsa
199c3ea8 88 plugin_cpu=cpu
ce728cd9 89 plugin_deskno=deskno
8f11d5f8 90 plugin_batt=batt
199c3ea8
JH
91 AC_MSG_RESULT(all)
92else
93 if test "$plugins" != "none"; then
94 plugins=`echo $plugins | sed 's/,/ /g'`
95 for plugin in $plugins
96 do
97 case "$plugin" in
98 netstatus)
99 plugin_netstatus=netstatus
100 ;;
101 volume)
102 plugin_volume=volume
103 ;;
15556f61
FC
104 volumealsa)
105 plugin_volumealsa=volumealsa
106 ;;
199c3ea8
JH
107 cpu)
108 plugin_cpu=cpu
109 ;;
ce728cd9
JH
110 deskno)
111 plugin_deskno=deskno
112 ;;
8f11d5f8
HJYP
113 batt)
114 plugin_deskno=batt
115 ;;
199c3ea8
JH
116 *)
117 echo "Unknown plugin $plugin."
118 exit 1
119 ;;
120 esac
121 done
122 AC_MSG_RESULT($plugins)
123 fi
124fi
125
c044bccf
JH
126dnl FIXME: OSS/ALSA checking
127if test x"$compile_alsa" = "xno"; then
128 if test ! -z $plugin_volumealsa; then
129 AC_MSG_RESULT([no ALSA headers/libraries found!])
130 plugin_volumealsa=
131 fi
132else
133 dnl force OSS plugin to <null>
134 plugin_volume=
135fi
15556f61 136PLUGINS_LIST="$plugin_netstatus $plugin_volume $plugin_volumealsa $plugin_cpu $plugin_deskno $plugin_batt"
199c3ea8
JH
137AC_SUBST(PLUGINS_LIST)
138
1141e22a 139
a52c2257
HJYP
140# Checks for header files.
141AC_PATH_X
142AC_HEADER_STDC
143AC_HEADER_SYS_WAIT
144AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
145
146# Checks for typedefs, structures, and compiler characteristics.
147AC_C_CONST
148AC_C_INLINE
149AC_STRUCT_TM
150
151# Checks for library functions.
152AC_FUNC_MALLOC
153AC_FUNC_MEMCMP
154AC_TYPE_SIGNAL
155AC_FUNC_STAT
156AC_FUNC_STRFTIME
157AC_CHECK_FUNCS([bzero memset mkdir setlocale strchr])
158
159
160GETTEXT_PACKAGE=lxpanel
42fe8c5f 161#AM_GNU_GETTEXT([external])
a52c2257
HJYP
162AM_GNU_GETTEXT_VERSION(0.14.1)
163AC_SUBST(GETTEXT_PACKAGE)
164AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
165
7a8ad5ec 166ALL_LINGUAS="zh_TW ko hu sk pl"
a52c2257
HJYP
167AM_GLIB_GNU_GETTEXT
168
169AC_CONFIG_FILES([
66c88ea4
HJYP
170 Makefile
171 src/Makefile
7fe27201 172 src/plugins/Makefile
1141e22a 173 src/plugins/netstatus/Makefile
31b80004 174 src/plugins/volume/Makefile
15556f61 175 src/plugins/volumealsa/Makefile
3cacc158 176 src/plugins/cpu/Makefile
ce728cd9 177 src/plugins/deskno/Makefile
8f11d5f8 178 src/plugins/batt/Makefile
66c88ea4
HJYP
179 po/Makefile.in
180 data/Makefile
181 data/default
a52c2257
HJYP
182])
183AC_OUTPUT
199c3ea8
JH
184
185echo
ce728cd9 186echo lxpanel ......................... : Version $VERSION
199c3ea8
JH
187echo
188echo Prefix........................... : $prefix
189if test x$plugins_loading = xyes; then
190echo Building dynamic plugins:
191 if test x"$plugin_netstatus" != x; then
192 AC_MSG_RESULT([ netstatus - Monitor networking status])
193 fi
194 if test x"$plugin_volume" != x; then
195 AC_MSG_RESULT([ volume - Display and adjust volume of sound card])
196 fi
15556f61
FC
197 if test x"$plugin_volumealsa" != x; then
198 AC_MSG_RESULT([ volumealsa - Display and adjust volume of sound card for ALSA])
199 fi
199c3ea8
JH
200 if test x"$plugin_cpu" != x; then
201 AC_MSG_RESULT([ cpu - Display CPU loading])
202 fi
ce728cd9
JH
203 if test x"$plugin_deskno" != x; then
204 AC_MSG_RESULT([ deskno - Display desktop number])
205 fi
8f11d5f8
HJYP
206 if test x"$plugin_batt" != x; then
207 AC_MSG_RESULT([ batt - Monitor battery status])
208 fi
199c3ea8
JH
209else
210echo Dynamic loader for plugins....... : disabled.
211fi