1
dnl $Id: plugins.m4 1096 2010-01-28 17:19:58Z michael $
2
dnl $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugins.m4 $
5
dnl LCD4Linux Plugins conf part
7
dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <michael@reinelt.co.at>
8
dnl Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
10
dnl This file is part of LCD4Linux.
12
dnl LCD4Linux is free software; you can redistribute it and/or modify
13
dnl it under the terms of the GNU General Public License as published by
14
dnl the Free Software Foundation; either version 2, or (at your option)
15
dnl any later version.
17
dnl LCD4Linux is distributed in the hope that it will be useful,
18
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
dnl GNU General Public License for more details.
22
dnl You should have received a copy of the GNU General Public License
23
dnl along with this program; if not, write to the Free Software
24
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
AC_MSG_CHECKING([which plugins to compile])
29
[ --with-plugins=<list> choose which plugins to compile.]
30
[ type --with-plugins=list for a list]
32
[ plugins may be excluded with 'all,!<plugin>',]
33
[ (try 'all,\!<plugin>' if your shell complains...)],
38
plugins=`echo $plugins|sed 's/,/ /g'`
40
for plugin in $plugins; do
45
plugin=`echo $plugin|cut -c 2-`
56
[ apm,asterisk,button_exec,cpuinfo,dbus,diskstats,dvb,exec,event,]
57
[ fifo,file,gps,hddtemp,huawei,i2c_sensors,iconv,imon,isdn,kvv,]
58
[ loadavg,meminfo,mpd,mpris_dbus,mysql,netdev,netinfo,pop3,ppp,]
59
[ proc_stat,python,qnaplog,sample,seti,statfs,uname,uptime,]
60
[ w1retap,wireless,xmms])
61
AC_MSG_ERROR([run ./configure --with-plugins=...])
66
PLUGIN_BUTTON_EXEC="yes"
69
PLUGIN_DISKSTATS="yes"
78
PLUGIN_I2C_SENSORS="yes"
86
PLUGIN_MPRIS_DBUS="yes"
92
PLUGIN_PROC_STAT="yes"
93
PLUGIN_PYTHON=$with_python
101
PLUGIN_WIRELESS="yes"
108
PLUGIN_BUTTON_EXEC=$val
120
PLUGIN_DISKSTATS=$val
147
PLUGIN_I2C_SENSORS=$val
171
PLUGIN_MPRIS_DBUS=$val
189
PLUGIN_PROC_STAT=$val
222
AC_MSG_ERROR([Unknown plugin '$plugin'])
227
AC_MSG_RESULT([done])
229
# Advanced Power Management
230
if test "$PLUGIN_APM" = "yes"; then
231
AC_CHECK_HEADERS(asm/types.h, [has_asm_types="true"], [has_asm_types="false"])
232
if test "$has_asm_types" = "true"; then
233
PLUGINS="$PLUGINS plugin_apm.o"
234
AC_DEFINE(PLUGIN_APM,1,[apm plugin])
236
AC_MSG_WARN(asm/types.h header not found: apm plugin disabled)
240
if test "$PLUGIN_BUTTON_EXEC" = "yes"; then
241
PLUGINS="$PLUGINS plugin_button_exec.o"
242
AC_DEFINE(PLUGIN_BUTTON_EXEC,1,[button_exec plugin])
245
if test "$PLUGIN_ASTERISK" = "yes"; then
246
PLUGINS="$PLUGINS plugin_asterisk.o"
247
AC_DEFINE(PLUGIN_ASTERISK,1,[asterisk plugin])
251
if test "$PLUGIN_CPUINFO" = "yes"; then
252
PLUGINS="$PLUGINS plugin_cpuinfo.o"
253
AC_DEFINE(PLUGIN_CPUINFO,1,[cpuinfo plugin])
257
if test "$PLUGIN_DBUS" = "yes"; then
258
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0.0, HAVE_DBUS="yes", HAVE_DBUS="no")
259
if test "x$HAVE_DBUS" == "xyes"; then
260
PLUGINS="$PLUGINS plugin_dbus.o"
261
PLUGINLIBS="$PLUGINLIBS $DBUS_LIBS"
262
CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
263
AC_DEFINE(PLUGIN_DBUS,1,[dbus plugin])
265
DBUS_VERSION=$($PKG_CONFIG --modversion dbus-1)
266
DBUS_VERSION_MAJOR=$(echo $DBUS_VERSION | cut -d . -f 1)
267
DBUS_VERSION_MINOR=$(echo $DBUS_VERSION | cut -d . -f 2)
268
DBUS_VERSION_MICRO=$(echo $DBUS_VERSION | cut -d . -f 3)
270
AC_DEFINE_UNQUOTED(DBUS_VERSION_MAJOR, $DBUS_VERSION_MAJOR, [DBus Major Version])
271
AC_DEFINE_UNQUOTED(DBUS_VERSION_MINOR, $DBUS_VERSION_MINOR, [DBus Minor Version])
272
AC_DEFINE_UNQUOTED(DBUS_VERSION_MICRO, $DBUS_VERSION_MICRO, [DBus Micro Version])
274
AC_MSG_WARN(dbus-1 not found check that PKG_CONFIG_PATH is set correctly: dbus plugin disabled)
279
if test "$PLUGIN_DISKSTATS" = "yes"; then
280
PLUGINS="$PLUGINS plugin_diskstats.o"
281
AC_DEFINE(PLUGIN_DISKSTATS,1,[diskstats plugin])
284
# Digital Video Broadcasting
285
if test "$PLUGIN_DVB" = "yes"; then
286
AC_CHECK_HEADERS(asm/types.h, [has_asm_types="true"], [has_asm_types="false"])
287
if test "$has_asm_types" = "true"; then
288
AC_CHECK_HEADERS(linux/dvb/frontend.h, [has_dvb_header="true"], [has_dvb_header="false"])
289
if test "$has_dvb_header" = "true"; then
290
PLUGINS="$PLUGINS plugin_dvb.o"
291
AC_DEFINE(PLUGIN_DVB,1,[dvb plugin])
293
PLUGINS="$PLUGINS plugin_dvb.o"
294
AC_MSG_WARN(linux/dvb/frontend.h header not found: using ioctl)
297
AC_MSG_WARN(asm/types.h header not found: dvb plugin disabled)
301
# start external commands (exec)
302
if test "$PLUGIN_EXEC" = "yes"; then
303
PLUGINS="$PLUGINS plugin_exec.o"
304
AC_DEFINE(PLUGIN_EXEC,1,[exec plugin])
308
if test "$PLUGIN_EVENT" = "yes"; then
309
PLUGINS="$PLUGINS plugin_event.o"
310
AC_DEFINE(PLUGIN_EVENT,1,[event plugin])
314
if test "$PLUGIN_FILE" = "yes"; then
315
PLUGINS="$PLUGINS plugin_file.o"
316
AC_DEFINE(PLUGIN_FILE,1,[file plugin])
320
if test "$PLUGIN_FIFO" = "yes"; then
321
PLUGINS="$PLUGINS plugin_fifo.o"
322
AC_DEFINE(PLUGIN_FIFO,1,[fifo plugin])
326
if test "$PLUGIN_GPS" = "yes"; then
327
AC_CHECK_HEADERS(nmeap.h, [has_nmeap_header="true"], [has_nmeap_header="false"])
328
if test "$has_nmeap_header" = "true"; then
329
AC_CHECK_LIB(nmeap, nmeap_init, [has_libnmeap_lib="true"], [has_libnmeap_lib="false"])
330
if test "$has_libnmeap_lib" = "true"; then
331
PLUGINS="$PLUGINS plugin_gps.o"
332
PLUGINLIBS="$PLUGINLIBS -lnmeap"
333
AC_DEFINE(PLUGIN_GPS,1,[gps plugin])
335
AC_MSG_WARN(libnmeap lib not found: gps plugin disabled)
338
AC_MSG_WARN(nmeap.h header not found: gps plugin disabled)
343
if test "$PLUGIN_HDDTEMP" = "yes"; then
344
PLUGINS="$PLUGINS plugin_hddtemp.o"
345
AC_DEFINE(PLUGIN_HDDTEMP,1,[hddtemp plugin])
349
if test "$PLUGIN_HUAWEI" = "yes"; then
350
PLUGINS="$PLUGINS plugin_huawei.o"
351
AC_DEFINE(PLUGIN_HUAWEI,1,[huawei plugin])
355
if test "$PLUGIN_I2C_SENSORS" = "yes"; then
356
PLUGINS="$PLUGINS plugin_i2c_sensors.o"
357
AC_DEFINE(PLUGIN_I2C_SENSORS,1,[i2c sensors plugin])
361
if test "$PLUGIN_ICONV" = "yes"; then
363
if test "$am_cv_func_iconv" = "yes"; then
364
PLUGINS="$PLUGINS plugin_iconv.o"
365
PLUGINLIBS="$PLUGINLIBS $LIBICONV"
366
AC_DEFINE(PLUGIN_ICONV,1,[iconv charset converter plugin])
368
AC_MSG_WARN(iconv not found: iconv plugin disabled)
373
if test "$PLUGIN_IMON" = "yes"; then
374
AC_CHECK_HEADERS(linux/errno.h, [has_linux_errno="true"], [has_linux_errno="false"])
375
if test "$has_linux_errno" = "true"; then
376
PLUGINS="$PLUGINS plugin_imon.o"
377
AC_DEFINE(PLUGIN_IMON,1,[imon plugin])
379
AC_MSG_WARN(linux/errno.h header not found: imon plugin disabled)
384
if test "$PLUGIN_ISDN" = "yes"; then
385
AC_CHECK_HEADERS(linux/isdn.h, [has_isdn_header="true"], [has_isdn_header="false"])
386
if test "$has_dvb_header" = "false"; then
387
AC_MSG_WARN(linux/isdn.h header not found: isdn plugin CPS disabled)
389
PLUGINS="$PLUGINS plugin_isdn.o"
390
AC_DEFINE(PLUGIN_ISDN,1,[ISDN plugin])
393
# Karlsruher Verkehrsverbund
394
if test "$PLUGIN_KVV" = "yes"; then
395
PLUGINS="$PLUGINS plugin_kvv.o"
396
AC_DEFINE(PLUGIN_KVV,1,[kvv plugin])
400
if test "$PLUGIN_LOADAVG" = "yes"; then
401
PLUGINS="$PLUGINS plugin_loadavg.o"
402
AC_DEFINE(PLUGIN_LOADAVG,1,[loadavg plugin])
406
if test "$PLUGIN_MEMINFO" = "yes"; then
407
PLUGINS="$PLUGINS plugin_meminfo.o"
408
AC_DEFINE(PLUGIN_MEMINFO,1,[meminfo plugin])
412
if test "$PLUGIN_MPD" = "yes"; then
413
AC_CHECK_LIB(libmpd, [mpd_newConnection], [has_mpd_header="true"], [has_mpd_header="false"])
414
if test "$has_mpd_header" = "true"; then
415
PLUGINS="$PLUGINS plugin_mpd.o"
416
PLUGINLIBS="$PLUGINLIBS `pkg-config libmpd --libs`"
417
CPPFLAGS="$CPPFLAGS `pkg-config libmpd --cflags`"
418
AC_DEFINE(PLUGIN_MPD,1,[mpd plugin])
420
AC_MSG_WARN(libmpdclient.h header not found: mpd plugin disabled)
421
AC_MSG_WARN(get libmpdclient.h from http://www.musicpd.org/libmpdclient.shtml)
422
AC_MSG_WARN(and copy those 2 files in the lcd4linux directory.)
427
if test "$PLUGIN_MPRIS_DBUS" = "yes"; then
428
AC_CHECK_HEADERS(dbus/dbus.h, [has_dbus_header="true"], [has_dbus_header="false"])
429
if test "$has_dbus_header" = "true"; then
430
AC_CHECK_LIB(dbus-1, dbus_bus_get, [has_libdbus1_lib="true"], [has_libdbus1_lib="false"])
431
if test "$has_libdbus1_lib" = "true"; then
432
PLUGINS="$PLUGINS plugin_mpris_dbus.o"
433
PLUGINLIBS="$PLUGINLIBS -ldbus-1"
434
AC_DEFINE(PLUGIN_MPRIS_DBUS,1,[mpris_dbus plugin])
436
AC_MSG_WARN(libdbus-1 lib not found: mpris_dbus plugin disabled)
439
AC_MSG_WARN(dbus/dbus.h header not found: mpris_dbus plugin disabled)
445
if test "$PLUGIN_MYSQL" = "yes"; then
446
AC_CHECK_HEADERS(mysql/mysql.h, [has_mysql_header="true"], [has_mysql_header="false"])
447
if test "$has_mysql_header" = "true"; then
448
AC_CHECK_LIB(mysqlclient, mysql_init, [has_mysql_lib="true"], [has_mysql_lib="false"])
449
if test "$has_mysql_lib" = "true"; then
450
PLUGINS="$PLUGINS plugin_mysql.o"
451
PLUGINLIBS="$PLUGINLIBS -lmysqlclient"
452
AC_DEFINE(PLUGIN_MYSQL,1,[mysql plugin])
454
AC_MSG_WARN(mysqlclient lib not found: mysql plugin disabled)
457
AC_MSG_WARN(mysql/mysql.h header not found: mysql plugin disabled)
462
if test "$PLUGIN_NETDEV" = "yes"; then
463
PLUGINS="$PLUGINS plugin_netdev.o"
464
AC_DEFINE(PLUGIN_NETDEV,1,[netdev plugin])
467
# configuration of network devices
468
if test "$PLUGIN_NETINFO" = "yes"; then
469
PLUGINS="$PLUGINS plugin_netinfo.o"
470
AC_DEFINE(PLUGIN_NETINFO,1,[netinfo plugin])
474
if test "$PLUGIN_POP3" = "yes"; then
475
PLUGINS="$PLUGINS plugin_pop3.o"
476
AC_DEFINE(PLUGIN_POP3,1,[POP3 plugin])
480
if test "$PLUGIN_PPP" = "yes"; then
481
AC_CHECK_HEADERS(net/if_ppp.h, [has_ppp_header="true"], [has_ppp_header="false"])
482
if test "$has_ppp_header" = "true"; then
483
PLUGINS="$PLUGINS plugin_ppp.o"
484
AC_DEFINE(PLUGIN_PPP,1,[ppp plugin])
486
AC_MSG_WARN(net/if_ppp.h header not found: ppp plugin disabled)
491
if test "$PLUGIN_PROC_STAT" = "yes"; then
492
PLUGINS="$PLUGINS plugin_proc_stat.o"
493
AC_DEFINE(PLUGIN_PROC_STAT,1,[proc_stat plugin])
497
if test "$PLUGIN_PYTHON" = "yes"; then
498
if test "$with_python" != "yes"; then
499
AC_MSG_WARN(python support not enabled: python plugin disabled (use --with-python to enable))
501
if test -z "$python_path"; then
502
AC_MSG_WARN(python headers not found: python plugin disabled)
504
PLUGINS="$PLUGINS plugin_python.o"
505
CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
506
PLUGINLIBS="$PLUGINLIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS"
507
AC_DEFINE(PLUGIN_PYTHON,1,[python plugin])
513
if test "$PLUGIN_QNAPLOG" = "yes"; then
514
AC_CHECK_HEADERS(sqlite3.h, [has_sqlite3_header="true"], [has_sqlite3_header="false"])
515
if test "$has_sqlite3_header" = "true"; then
516
AC_CHECK_LIB(sqlite3, sqlite3_initialize, [has_sqlite3_lib="true"], [has_sqlite3_lib="false"])
517
if test "$has_sqlite3_lib" = "true"; then
518
PLUGINS="$PLUGINS plugin_qnaplog.o"
519
PLUGINLIBS="$PLUGINLIBS -lsqlite3"
520
AC_DEFINE(PLUGIN_QNAPLOG,1,[qnaplog plugin])
522
AC_MSG_WARN(sqlite3 lib not found: qnaplog plugin disabled)
525
AC_MSG_WARN(sqlite3.h header not found: qnaplog plugin disabled)
530
if test "$PLUGIN_SAMPLE" = "yes"; then
531
PLUGINS="$PLUGINS plugin_sample.o"
532
AC_DEFINE(PLUGIN_SAMPLE,1,[sample plugin])
536
if test "$PLUGIN_SETI" = "yes"; then
537
PLUGINS="$PLUGINS plugin_seti.o"
538
AC_DEFINE(PLUGIN_SETI,1,[seti plugin])
542
if test "$PLUGIN_STATFS" = "yes"; then
543
AC_CHECK_HEADERS(sys/vfs.h, [has_vfs_header="true"], [has_vfs_header="false"])
544
if test "$has_vfs_header" = "true"; then
545
PLUGINS="$PLUGINS plugin_statfs.o"
546
AC_DEFINE(PLUGIN_STATFS,1,[statfs plugin])
548
AC_MSG_WARN(sys/vfs.h header not found: statfs plugin disabled)
553
if test "$PLUGIN_UNAME" = "yes"; then
554
PLUGINS="$PLUGINS plugin_uname.o"
555
AC_DEFINE(PLUGIN_UNAME,1,[uname plugin])
559
if test "$PLUGIN_UPTIME" = "yes"; then
560
PLUGINS="$PLUGINS plugin_uptime.o"
561
AC_DEFINE(PLUGIN_UPTIME,1,[uptime plugin])
564
if test "$PLUGIN_W1RETAP" = "yes"; then
565
PLUGINS="$PLUGINS plugin_w1retap.o"
566
AC_DEFINE(PLUGIN_W1RETAP,1,[w1retap plugin])
570
if test "$PLUGIN_WIRELESS" = "yes"; then
571
AC_CHECK_HEADERS(linux/wireless.h, [has_wireless_header="true"], [has_wireless_header="false"])
572
if test "$has_wireless_header" = "true"; then
573
PLUGINS="$PLUGINS plugin_wireless.o"
574
AC_DEFINE(PLUGIN_WIRELESS,1,[wireless plugin])
576
AC_MSG_WARN(linux/wireless.h header not found: wireless plugin disabled)
581
if test "$PLUGIN_XMMS" = "yes"; then
582
PLUGINS="$PLUGINS plugin_xmms.o"
583
AC_DEFINE(PLUGIN_XMMS,1,[xmms plugin])
586
if test "$PLUGINS" = ""; then
587
AC_MSG_ERROR([You should include at least one plugin...])