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