Delete unused files.
[lxde/lxpanel.git] / configure.ac
1 AC_PREREQ(2.53)
2 AC_INIT(lxpanel, 0.2.5, http://lxde.sourceforge.net/)
3 AM_INIT_AUTOMAKE
4 AC_CONFIG_SRCDIR([src/bg.c])
5 AC_CONFIG_HEADER([config.h])
6
7 # Force to dynamic
8 AC_DISABLE_STATIC
9
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_INSTALL
13 AC_PROG_LN_S
14 AC_PROG_LIBTOOL
15 AC_PROG_INTLTOOL(, [no-xml])
16
17 # Checks for libraries.
18 pkg_modules="gtk+-2.0 >= 2.6.0 \
19              gthread-2.0"
20 #             libstartup-notification-1.0"
21 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
22 AC_SUBST(PACKAGE_CFLAGS)
23 AC_SUBST(PACKAGE_LIBS)
24
25 AC_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")
29 G_CAST_CHECKS=""
30 if test x"$cast_checks" = "xno"; then
31         G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS"
32 fi
33 AC_SUBST(G_CAST_CHECKS)
34
35 AC_ARG_ENABLE([alsa],
36         AS_HELP_STRING([--disable-alsa],
37                         [compile ALSA providers (default: enable)]),
38                         compile_alsa=$enableval, compile_alsa="yes")
39 if 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)
45 fi
46 AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes)
47 dnl FIXME: check OSS existence
48 AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno)
49
50 AC_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
55 AM_CONDITIONAL(BUILD_PLUGIN_LOADER, test x$plugins_loading = xyes)
56
57 if test x"$plugins_loading" = "xno"; then
58         AC_DEFINE(DISABLE_PLUGINS_LOADING, [1], [Disable plugin loading])
59 fi
60
61 dnl Here are plugin listing.
62 plugin_netstatus=
63 plugin_netstat=
64 plugin_volume=
65 plugin_volumealsa=
66 plugin_cpu=
67 plugin_deskno=
68 plugin_batt=
69
70 AC_MSG_CHECKING([which plugins should be built dynamically])
71 AC_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: ]
76 [                         netstatus, netstat, volume, volumealsa, cpu, deskno, batt], plugins="$withval",[plugins="all"])
77
78 if test x"$plugins" != xall -a x"$plugins" != xnone; then
79         if test x"$plugins_loading" = xno; then
80                 AC_MSG_ERROR(
81                 [--disable-plugins-loading and --with-plugins conflict each other.])
82         fi
83 fi
84
85 if test x"$plugins" = xall; then
86         plugin_netstatus=netstatus
87         plugin_netstat=netstat
88         plugin_volume=volume
89         plugin_volumealsa=volumealsa
90         plugin_cpu=cpu
91         plugin_deskno=deskno
92         plugin_batt=batt
93         AC_MSG_RESULT(all)
94 else
95         if test "$plugins" != "none"; then
96                 plugins=`echo $plugins | sed 's/,/ /g'`
97                 for plugin in $plugins
98                 do
99                 case "$plugin" in
100                         netstatus)
101                                 plugin_netstatus=netstatus
102                                 ;;
103                         netstat)
104                                 plugin_netstat=netstat
105                                 ;;
106                         volume)
107                                 plugin_volume=volume
108                                 ;;
109                         volumealsa)
110                                 plugin_volumealsa=volumealsa
111                                 ;;
112                         cpu)
113                                 plugin_cpu=cpu
114                                 ;;
115                         deskno)
116                                 plugin_deskno=deskno
117                                 ;;
118                         batt)
119                                 plugin_deskno=batt
120                                 ;;
121                         *)
122                                 echo "Unknown plugin $plugin."
123                                 exit 1
124                                 ;;
125                 esac
126                 done
127                 AC_MSG_RESULT($plugins)
128         fi
129 fi
130
131 dnl FIXME: OSS/ALSA checking
132 if test x"$compile_alsa" = "xno"; then
133         if test ! -z $plugin_volumealsa; then
134                 AC_MSG_RESULT([no ALSA headers/libraries found!])
135                 plugin_volumealsa=
136         fi
137 else
138         dnl force OSS plugin to <null>
139         plugin_volume=
140 fi
141 PLUGINS_LIST="$plugin_netstatus $plugin_netstat $plugin_volume $plugin_volumealsa $plugin_cpu $plugin_deskno $plugin_batt"
142 AC_SUBST(PLUGINS_LIST)
143
144
145 # Checks for header files.
146 AC_PATH_X
147 AC_HEADER_STDC
148 AC_HEADER_SYS_WAIT
149 AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
150
151 # Checks for typedefs, structures, and compiler characteristics.
152 AC_C_CONST
153 AC_C_INLINE
154 AC_STRUCT_TM
155
156 # Checks for library functions.
157 AC_FUNC_MALLOC
158 AC_FUNC_MEMCMP
159 AC_TYPE_SIGNAL
160 AC_FUNC_STAT
161 AC_FUNC_STRFTIME
162 AC_CHECK_FUNCS([bzero memset mkdir setlocale strchr])
163
164
165 GETTEXT_PACKAGE=lxpanel
166 #AM_GNU_GETTEXT([external])
167 AM_GNU_GETTEXT_VERSION(0.14.1)
168 AC_SUBST(GETTEXT_PACKAGE)
169 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
170
171 ALL_LINGUAS="zh_TW ko hu sk pl"
172 AM_GLIB_GNU_GETTEXT
173
174 AC_CONFIG_FILES([
175         Makefile
176         src/Makefile
177         src/plugins/Makefile
178         src/plugins/netstatus/Makefile
179         src/plugins/netstat/Makefile
180         src/plugins/volume/Makefile
181         src/plugins/volumealsa/Makefile
182         src/plugins/cpu/Makefile
183         src/plugins/deskno/Makefile
184         src/plugins/batt/Makefile
185         po/Makefile.in
186         data/Makefile
187         data/default
188 ])
189 AC_OUTPUT
190
191 echo                                                                                                
192 echo lxpanel ......................... : Version $VERSION
193 echo
194 echo Prefix........................... : $prefix
195 if test x$plugins_loading = xyes; then
196 echo Building dynamic plugins:
197         if test x"$plugin_netstatus" != x; then
198                 AC_MSG_RESULT([    netstatus - Monitor networking status])
199         fi
200         if test x"$plugin_netstat" != x; then
201                 AC_MSG_RESULT([    netstat - Monitor networking status (Linux Only)])
202         fi
203         if test x"$plugin_volume" != x; then
204                 AC_MSG_RESULT([    volume - Display and adjust volume of sound card])
205         fi
206         if test x"$plugin_volumealsa" != x; then
207                 AC_MSG_RESULT([    volumealsa - Display and adjust volume of sound card for ALSA])
208         fi
209         if test x"$plugin_cpu" != x; then
210                 AC_MSG_RESULT([    cpu - Display CPU loading])
211         fi
212         if test x"$plugin_deskno" != x; then
213                 AC_MSG_RESULT([    deskno - Display desktop number])
214         fi
215         if test x"$plugin_batt" != x; then
216                 AC_MSG_RESULT([    batt - Monitor battery status])
217         fi
218 else
219 echo Dynamic loader for plugins....... : disabled.
220 fi