Commit | Line | Data |
---|---|---|
a52c2257 | 1 | AC_PREREQ(2.53) |
a002e161 | 2 | AC_INIT(lxpanel, 0.2.8.3, http://lxde.sourceforge.net/) |
42fe8c5f | 3 | AM_INIT_AUTOMAKE |
a52c2257 HJYP |
4 | AC_CONFIG_SRCDIR([src/bg.c]) |
5 | AC_CONFIG_HEADER([config.h]) | |
6 | ||
86db742c JH |
7 | # Force to dynamic |
8 | AC_DISABLE_STATIC | |
9 | ||
a52c2257 HJYP |
10 | # Checks for programs. |
11 | AC_PROG_CC | |
12 | AC_PROG_INSTALL | |
13 | AC_PROG_LN_S | |
1141e22a | 14 | AC_PROG_LIBTOOL |
a52c2257 HJYP |
15 | AC_PROG_INTLTOOL(, [no-xml]) |
16 | ||
17 | # Checks for libraries. | |
18 | pkg_modules="gtk+-2.0 >= 2.6.0 \ | |
fb20a9b5 HJYP |
19 | gthread-2.0" |
20 | # libstartup-notification-1.0" | |
a52c2257 HJYP |
21 | PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) |
22 | AC_SUBST(PACKAGE_CFLAGS) | |
23 | AC_SUBST(PACKAGE_LIBS) | |
24 | ||
535ac098 | 25 | AC_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 |
29 | G_CAST_CHECKS="" |
30 | if test x"$cast_checks" = "xno"; then | |
24053345 | 31 | G_CAST_CHECKS="-DG_DISABLE_CAST_CHECKS" |
535ac098 JH |
32 | fi |
33 | AC_SUBST(G_CAST_CHECKS) | |
34 | ||
cc0c9990 JH |
35 | dnl 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. | |
42 | AC_MSG_CHECKING([whether $LD accepts --as-needed]) | |
43 | case `$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 |
51 | esac |
52 | ||
cae18977 JH |
53 | dnl linker optimizations |
54 | AC_MSG_CHECKING([whether $LD accepts -O1]) | |
55 | case `$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 | ;; | |
63 | esac | |
64 | AC_MSG_CHECKING([whether $LD accepts -Bsymbolic-functions]) | |
65 | case `$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 | ;; | |
73 | esac | |
74 | ||
cc0c9990 JH |
75 | dnl 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. | |
80 | if test ! -z "$LDFLAGS"; then | |
20b3e401 | 81 | LDFLAGS=`echo "$LDFLAGS" | sed -e 's/-Wl,-z,defs//'` |
cc0c9990 JH |
82 | fi |
83 | ||
84 | LXPANEL_MODULE="-avoid-version \ | |
85 | -rpath \$(libdir)/lxpanel/plugins \ | |
86 | -no-undefined "'-export-symbols-regex "^[[^_]].*"' | |
87 | AC_SUBST(LXPANEL_MODULE) | |
88 | ||
c044bccf | 89 | AC_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 | 93 | if 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) |
99 | fi | |
100 | AM_CONDITIONAL(BUILD_ALSA_PLUGINS, test x$compile_alsa = xyes) | |
101 | dnl FIXME: check OSS existence | |
102 | AM_CONDITIONAL(BUILD_OSS_PLUGINS, test x$compile_alsa = xno) | |
103 | ||
e64c0317 JH |
104 | # check libiw for netstat plugin |
105 | AC_ARG_ENABLE([libiw], | |
106 | AS_HELP_STRING([--disable-libiw], | |
107 | [compile libiw-based netstat plugin (default: enable)]), | |
108 | compile_libiw=$enableval, compile_libiw="yes") | |
109 | if 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) | |
116 | fi | |
117 | AM_CONDITIONAL(BUILD_LIBIW_PLUGINS, test x$compile_libiw = xyes) | |
118 | ||
2d29cc96 | 119 | AC_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 |
124 | AM_CONDITIONAL(BUILD_PLUGIN_LOADER, test x$plugins_loading = xyes) |
125 | ||
535ac098 | 126 | if test x"$plugins_loading" = "xno"; then |
24053345 | 127 | AC_DEFINE(DISABLE_PLUGINS_LOADING, [1], [Disable plugin loading]) |
2d29cc96 JH |
128 | fi |
129 | ||
199c3ea8 JH |
130 | dnl Here are plugin listing. |
131 | plugin_netstatus= | |
19348802 | 132 | plugin_netstat= |
199c3ea8 | 133 | plugin_volume= |
15556f61 | 134 | plugin_volumealsa= |
199c3ea8 | 135 | plugin_cpu= |
ce728cd9 | 136 | plugin_deskno= |
8f11d5f8 | 137 | plugin_batt= |
199c3ea8 JH |
138 | |
139 | AC_MSG_CHECKING([which plugins should be built dynamically]) | |
140 | AC_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 | |
147 | if 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 |
152 | fi |
153 | ||
24053345 HJYP |
154 | ALL_PLUGINS_LIST="netstatus netstat volume volumealsa cpu deskno batt" |
155 | AC_SUBST(ALL_PLUGINS_LIST) | |
156 | ||
199c3ea8 | 157 | if test x"$plugins" = xall; then |
24053345 HJYP |
158 | dnl for name in $ALL_PLUGINS |
159 | dnl do | |
160 | dnl export plugin_$name="$name" | |
161 | dnl 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 | 172 | else |
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 |
207 | fi |
208 | ||
c044bccf JH |
209 | dnl FIXME: OSS/ALSA checking |
210 | if 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 | 215 | else |
24053345 HJYP |
216 | dnl force OSS plugin to <null> |
217 | plugin_volume= | |
c044bccf | 218 | fi |
e64c0317 JH |
219 | if 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= | |
224 | fi | |
19348802 | 225 | PLUGINS_LIST="$plugin_netstatus $plugin_netstat $plugin_volume $plugin_volumealsa $plugin_cpu $plugin_deskno $plugin_batt" |
199c3ea8 JH |
226 | AC_SUBST(PLUGINS_LIST) |
227 | ||
1141e22a | 228 | |
a52c2257 HJYP |
229 | # Checks for header files. |
230 | AC_PATH_X | |
231 | AC_HEADER_STDC | |
232 | AC_HEADER_SYS_WAIT | |
233 | AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h]) | |
234 | ||
235 | # Checks for typedefs, structures, and compiler characteristics. | |
236 | AC_C_CONST | |
237 | AC_C_INLINE | |
238 | AC_STRUCT_TM | |
239 | ||
240 | # Checks for library functions. | |
241 | AC_FUNC_MALLOC | |
242 | AC_FUNC_MEMCMP | |
243 | AC_TYPE_SIGNAL | |
244 | AC_FUNC_STAT | |
245 | AC_FUNC_STRFTIME | |
246 | AC_CHECK_FUNCS([bzero memset mkdir setlocale strchr]) | |
247 | ||
248 | ||
249 | GETTEXT_PACKAGE=lxpanel | |
42fe8c5f | 250 | #AM_GNU_GETTEXT([external]) |
a52c2257 HJYP |
251 | AM_GNU_GETTEXT_VERSION(0.14.1) |
252 | AC_SUBST(GETTEXT_PACKAGE) | |
253 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) | |
254 | ||
a134326c FC |
255 | #ALL_LINGUAS="zh_TW ko hu sk pl fr pt_BR" |
256 | ALL_LINGUAS="zh_TW ko hu sk pl fr" | |
a52c2257 HJYP |
257 | AM_GLIB_GNU_GETTEXT |
258 | ||
259 | AC_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 | ]) |
275 | AC_OUTPUT | |
199c3ea8 | 276 | |
24053345 | 277 | echo |
ce728cd9 | 278 | echo lxpanel ......................... : Version $VERSION |
199c3ea8 JH |
279 | echo |
280 | echo Prefix........................... : $prefix | |
281 | if test x$plugins_loading = xyes; then | |
282 | echo 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 |
304 | else |
305 | echo Dynamic loader for plugins....... : disabled. | |
306 | fi |