~siretart/lcd4linux/debian

« back to all changes in this revision

Viewing changes to plugins.m4

  • Committer: Reinhard Tartler
  • Date: 2011-04-27 17:24:15 UTC
  • mto: This revision was merged to the branch mainline in revision 750.
  • Revision ID: siretart@tauware.de-20110427172415-6n4aptmvmz0eztvm
Tags: upstream-0.11.0~svn1143
ImportĀ upstreamĀ versionĀ 0.11.0~svn1143

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 $
 
3
 
 
4
 
 
5
dnl LCD4Linux Plugins conf part
 
6
dnl
 
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>
 
9
dnl
 
10
dnl This file is part of LCD4Linux.
 
11
dnl
 
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.
 
16
dnl
 
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.
 
21
dnl
 
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.
 
25
 
 
26
AC_MSG_CHECKING([which plugins to compile])
 
27
AC_ARG_WITH(
 
28
  plugins, 
 
29
  [  --with-plugins=<list>   choose which plugins to compile.]
 
30
  [                        type --with-plugins=list for a list] 
 
31
  [                        of avaible plugins]
 
32
  [                        plugins may be excluded with 'all,!<plugin>',]       
 
33
  [                        (try 'all,\!<plugin>' if your shell complains...)],
 
34
  plugins=$withval, 
 
35
  plugins=all
 
36
)
 
37
 
 
38
plugins=`echo $plugins|sed 's/,/ /g'`
 
39
 
 
40
for plugin in $plugins; do
 
41
 
 
42
   case $plugin in 
 
43
      !*) 
 
44
         val="no"
 
45
         plugin=`echo $plugin|cut -c 2-`
 
46
         ;;
 
47
       *) 
 
48
         val="yes"
 
49
         ;;
 
50
   esac
 
51
        
 
52
   case "$plugin" in
 
53
      list)
 
54
         AC_MSG_RESULT(
 
55
            [available plugins:]
 
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=...])
 
62
         ;;
 
63
      all)
 
64
         PLUGIN_APM="yes"
 
65
         PLUGIN_ASTERISK="yes"
 
66
         PLUGIN_BUTTON_EXEC="yes"
 
67
         PLUGIN_CPUINFO="yes"
 
68
         PLUGIN_DBUS="yes"
 
69
         PLUGIN_DISKSTATS="yes"
 
70
         PLUGIN_DVB="yes"
 
71
         PLUGIN_EXEC="yes"
 
72
         PLUGIN_EVENT="yes"
 
73
         PLUGIN_FIFO="yes"
 
74
         PLUGIN_FILE="yes"
 
75
         PLUGIN_GPS="yes"
 
76
         PLUGIN_HDDTEMP="yes"
 
77
         PLUGIN_HUAWEI="yes"
 
78
         PLUGIN_I2C_SENSORS="yes"
 
79
         PLUGIN_ICONV="yes"
 
80
         PLUGIN_IMON="yes"
 
81
         PLUGIN_ISDN="yes"
 
82
         PLUGIN_KVV="yes"
 
83
         PLUGIN_LOADAVG="yes"
 
84
         PLUGIN_MEMINFO="yes"
 
85
         PLUGIN_MPD="yes"
 
86
         PLUGIN_MPRIS_DBUS="yes"
 
87
         PLUGIN_MYSQL="yes"
 
88
         PLUGIN_NETDEV="yes"
 
89
         PLUGIN_NETINFO="yes"
 
90
         PLUGIN_POP3="yes"
 
91
         PLUGIN_PPP="yes"
 
92
         PLUGIN_PROC_STAT="yes"
 
93
         PLUGIN_PYTHON=$with_python
 
94
         PLUGIN_QNAPLOG="yes"
 
95
         PLUGIN_SAMPLE="yes"
 
96
         PLUGIN_SETI="yes"
 
97
         PLUGIN_STATFS="yes"
 
98
         PLUGIN_UNAME="yes"
 
99
         PLUGIN_UPTIME="yes"
 
100
         PLUGIN_W1RETAP="yes"            
 
101
         PLUGIN_WIRELESS="yes"
 
102
         PLUGIN_XMMS="yes"   
 
103
         ;;
 
104
      apm)
 
105
         PLUGIN_APM=$val
 
106
         ;;
 
107
      button_exec)
 
108
         PLUGIN_BUTTON_EXEC=$val
 
109
         ;;
 
110
      asterisk)
 
111
         PLUGIN_ASTERISK=$val
 
112
         ;;
 
113
      cpuinfo)
 
114
         PLUGIN_CPUINFO=$val
 
115
         ;;
 
116
      dbus)
 
117
         PLUGIN_DBUS=$val
 
118
         ;;
 
119
      diskstats)
 
120
         PLUGIN_DISKSTATS=$val
 
121
         ;;
 
122
      dvb)
 
123
         PLUGIN_DVB=$val
 
124
         ;;
 
125
      exec)
 
126
         PLUGIN_EXEC=$val
 
127
         ;;
 
128
      event)
 
129
         PLUGIN_EVENT=$val
 
130
         ;;
 
131
      fifo)
 
132
         PLUGIN_FIFO=$val
 
133
         ;;
 
134
      file)
 
135
         PLUGIN_FILE=$val
 
136
         ;;
 
137
      gps)
 
138
         PLUGIN_GPS=$val
 
139
         ;;
 
140
      hddtemp)
 
141
         PLUGIN_HDDTEMP=$val
 
142
         ;;
 
143
      huawei)
 
144
         PLUGIN_HUAWEI=$val
 
145
         ;;
 
146
      i2c_sensors)
 
147
         PLUGIN_I2C_SENSORS=$val
 
148
         ;;
 
149
      iconv)
 
150
        PLUGIN_ICONV=$val
 
151
        ;;
 
152
      imon)
 
153
         PLUGIN_IMON=$val
 
154
         ;;
 
155
      isdn)
 
156
         PLUGIN_ISDN=$val
 
157
         ;;
 
158
      kvv)
 
159
         PLUGIN_KVV=$val
 
160
         ;;
 
161
      loadavg)
 
162
         PLUGIN_LOADAVG=$val
 
163
         ;;
 
164
      meminfo)
 
165
         PLUGIN_MEMINFO=$val
 
166
         ;;
 
167
      mpd)
 
168
         PLUGIN_MPD=$val
 
169
         ;;
 
170
      mpris_dbus)
 
171
         PLUGIN_MPRIS_DBUS=$val
 
172
         ;;      
 
173
      mysql)
 
174
         PLUGIN_MYSQL=$val
 
175
         ;;
 
176
      netdev)
 
177
         PLUGIN_NETDEV=$val
 
178
         ;;
 
179
      netinfo)
 
180
         PLUGIN_NETINFO=$val
 
181
         ;;
 
182
      pop3)
 
183
         PLUGIN_POP3=$val
 
184
         ;;
 
185
      ppp)
 
186
         PLUGIN_PPP=$val
 
187
         ;;
 
188
      proc_stat)
 
189
         PLUGIN_PROC_STAT=$val
 
190
         ;;
 
191
      python)
 
192
         PLUGIN_PYTHON=$val
 
193
         ;;
 
194
      qnaplog)
 
195
         PLUGIN_QNAPLOG=$val
 
196
         ;;
 
197
      sample)
 
198
         PLUGIN_SAMPLE=$val
 
199
         ;;
 
200
      seti)
 
201
         PLUGIN_SETI=$val
 
202
         ;;
 
203
      statfs)
 
204
         PLUGIN_STATFS=$val
 
205
         ;;
 
206
      uname)
 
207
         PLUGIN_UNAME=$val
 
208
         ;;
 
209
      uptime)
 
210
         PLUGIN_UPTIME=$val
 
211
         ;;
 
212
      w1retap)
 
213
         PLUGIN_W1RETAP=$val
 
214
         ;;
 
215
      wireless)
 
216
         PLUGIN_WIRELESS=$val
 
217
         ;;
 
218
      xmms)
 
219
         PLUGIN_XMMS=$val
 
220
         ;;         
 
221
      *)        
 
222
         AC_MSG_ERROR([Unknown plugin '$plugin'])
 
223
         ;;
 
224
   esac
 
225
done
 
226
 
 
227
AC_MSG_RESULT([done])
 
228
 
 
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])
 
235
   else
 
236
      AC_MSG_WARN(asm/types.h header not found: apm plugin disabled)
 
237
   fi
 
238
fi
 
239
 
 
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])
 
243
fi
 
244
 
 
245
if test "$PLUGIN_ASTERISK" = "yes"; then
 
246
   PLUGINS="$PLUGINS plugin_asterisk.o"
 
247
   AC_DEFINE(PLUGIN_ASTERISK,1,[asterisk plugin])
 
248
fi
 
249
 
 
250
# /proc/cpuinfo
 
251
if test "$PLUGIN_CPUINFO" = "yes"; then
 
252
   PLUGINS="$PLUGINS plugin_cpuinfo.o"
 
253
   AC_DEFINE(PLUGIN_CPUINFO,1,[cpuinfo plugin])
 
254
fi
 
255
 
 
256
#DBus
 
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])
 
264
 
 
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)
 
269
 
 
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])
 
273
   else
 
274
      AC_MSG_WARN(dbus-1 not found check that PKG_CONFIG_PATH is set correctly: dbus plugin disabled)
 
275
   fi
 
276
fi
 
277
 
 
278
# /proc/diskstat
 
279
if test "$PLUGIN_DISKSTATS" = "yes"; then
 
280
   PLUGINS="$PLUGINS plugin_diskstats.o"
 
281
   AC_DEFINE(PLUGIN_DISKSTATS,1,[diskstats plugin])
 
282
fi
 
283
 
 
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])
 
292
       else
 
293
          PLUGINS="$PLUGINS plugin_dvb.o"
 
294
          AC_MSG_WARN(linux/dvb/frontend.h header not found: using ioctl)
 
295
       fi
 
296
   else
 
297
       AC_MSG_WARN(asm/types.h header not found: dvb plugin disabled)
 
298
   fi
 
299
fi
 
300
 
 
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])
 
305
fi
 
306
 
 
307
# event
 
308
if test "$PLUGIN_EVENT" = "yes"; then
 
309
   PLUGINS="$PLUGINS plugin_event.o"
 
310
   AC_DEFINE(PLUGIN_EVENT,1,[event plugin])
 
311
fi
 
312
 
 
313
# file
 
314
if test "$PLUGIN_FILE" = "yes"; then
 
315
   PLUGINS="$PLUGINS plugin_file.o"
 
316
   AC_DEFINE(PLUGIN_FILE,1,[file plugin])
 
317
fi
 
318
 
 
319
# FIFO
 
320
if test "$PLUGIN_FIFO" = "yes"; then
 
321
   PLUGINS="$PLUGINS plugin_fifo.o"
 
322
   AC_DEFINE(PLUGIN_FIFO,1,[fifo plugin])
 
323
fi
 
324
 
 
325
# GPS
 
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])
 
334
      else
 
335
        AC_MSG_WARN(libnmeap lib not found: gps plugin disabled)
 
336
      fi
 
337
   else
 
338
      AC_MSG_WARN(nmeap.h header not found: gps plugin disabled)
 
339
   fi 
 
340
fi
 
341
 
 
342
# hddtemp
 
343
if test "$PLUGIN_HDDTEMP" = "yes"; then
 
344
   PLUGINS="$PLUGINS plugin_hddtemp.o"
 
345
   AC_DEFINE(PLUGIN_HDDTEMP,1,[hddtemp plugin])
 
346
fi
 
347
 
 
348
# Huawei
 
349
if test "$PLUGIN_HUAWEI" = "yes"; then
 
350
   PLUGINS="$PLUGINS plugin_huawei.o"
 
351
   AC_DEFINE(PLUGIN_HUAWEI,1,[huawei plugin])
 
352
fi
 
353
 
 
354
# I2C
 
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])
 
358
fi
 
359
 
 
360
# IConv
 
361
if test "$PLUGIN_ICONV" = "yes"; then
 
362
   AM_ICONV
 
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])
 
367
   else
 
368
      AC_MSG_WARN(iconv not found: iconv plugin disabled)
 
369
   fi
 
370
fi
 
371
 
 
372
# ISDN monitor
 
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])
 
378
   else
 
379
       AC_MSG_WARN(linux/errno.h header not found: imon plugin disabled)
 
380
   fi
 
381
fi
 
382
 
 
383
# ISDN
 
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)
 
388
   fi   
 
389
   PLUGINS="$PLUGINS plugin_isdn.o"
 
390
   AC_DEFINE(PLUGIN_ISDN,1,[ISDN plugin])
 
391
fi
 
392
 
 
393
# Karlsruher Verkehrsverbund
 
394
if test "$PLUGIN_KVV" = "yes"; then
 
395
   PLUGINS="$PLUGINS plugin_kvv.o"
 
396
   AC_DEFINE(PLUGIN_KVV,1,[kvv plugin])
 
397
fi
 
398
 
 
399
# load average
 
400
if test "$PLUGIN_LOADAVG" = "yes"; then
 
401
   PLUGINS="$PLUGINS plugin_loadavg.o"
 
402
   AC_DEFINE(PLUGIN_LOADAVG,1,[loadavg plugin])
 
403
fi
 
404
 
 
405
# meminfo
 
406
if test "$PLUGIN_MEMINFO" = "yes"; then
 
407
   PLUGINS="$PLUGINS plugin_meminfo.o"
 
408
   AC_DEFINE(PLUGIN_MEMINFO,1,[meminfo plugin])
 
409
fi
 
410
 
 
411
# MPD
 
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])      
 
419
   else
 
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.)
 
423
   fi
 
424
fi
 
425
 
 
426
# MPRIS D-Bus
 
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])
 
435
      else
 
436
          AC_MSG_WARN(libdbus-1 lib not found: mpris_dbus plugin disabled)
 
437
      fi
 
438
   else
 
439
      AC_MSG_WARN(dbus/dbus.h header not found: mpris_dbus plugin disabled)
 
440
   fi
 
441
fi
 
442
 
 
443
 
 
444
# MySQL
 
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])
 
453
      else
 
454
        AC_MSG_WARN(mysqlclient lib not found: mysql plugin disabled)
 
455
      fi
 
456
   else
 
457
      AC_MSG_WARN(mysql/mysql.h header not found: mysql plugin disabled)
 
458
   fi 
 
459
fi
 
460
 
 
461
# /proc/net/dev
 
462
if test "$PLUGIN_NETDEV" = "yes"; then
 
463
   PLUGINS="$PLUGINS plugin_netdev.o"
 
464
   AC_DEFINE(PLUGIN_NETDEV,1,[netdev plugin])
 
465
fi
 
466
 
 
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])
 
471
fi
 
472
 
 
473
# POP3
 
474
if test "$PLUGIN_POP3" = "yes"; then
 
475
   PLUGINS="$PLUGINS plugin_pop3.o"
 
476
   AC_DEFINE(PLUGIN_POP3,1,[POP3 plugin])
 
477
fi
 
478
 
 
479
# PPP
 
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])
 
485
   else
 
486
      AC_MSG_WARN(net/if_ppp.h header not found: ppp plugin disabled)
 
487
   fi 
 
488
fi
 
489
 
 
490
# /proc/stat
 
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])
 
494
fi
 
495
 
 
496
# python
 
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))
 
500
   else
 
501
      if test -z "$python_path"; then
 
502
         AC_MSG_WARN(python headers not found: python plugin disabled)
 
503
      else
 
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])
 
508
      fi 
 
509
   fi 
 
510
fi
 
511
 
 
512
# Qnaplog
 
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])
 
521
      else
 
522
        AC_MSG_WARN(sqlite3 lib not found: qnaplog plugin disabled)
 
523
      fi
 
524
   else
 
525
      AC_MSG_WARN(sqlite3.h header not found: qnaplog plugin disabled)
 
526
   fi 
 
527
fi
 
528
 
 
529
# sample
 
530
if test "$PLUGIN_SAMPLE" = "yes"; then
 
531
   PLUGINS="$PLUGINS plugin_sample.o"
 
532
   AC_DEFINE(PLUGIN_SAMPLE,1,[sample plugin])
 
533
fi
 
534
 
 
535
# SETI
 
536
if test "$PLUGIN_SETI" = "yes"; then
 
537
   PLUGINS="$PLUGINS plugin_seti.o"
 
538
   AC_DEFINE(PLUGIN_SETI,1,[seti plugin])
 
539
fi
 
540
 
 
541
# statfs()
 
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])
 
547
   else
 
548
      AC_MSG_WARN(sys/vfs.h header not found: statfs plugin disabled)
 
549
   fi 
 
550
fi
 
551
 
 
552
# uname
 
553
if test "$PLUGIN_UNAME" = "yes"; then
 
554
   PLUGINS="$PLUGINS plugin_uname.o"
 
555
   AC_DEFINE(PLUGIN_UNAME,1,[uname plugin])
 
556
fi
 
557
 
 
558
# uptime
 
559
if test "$PLUGIN_UPTIME" = "yes"; then
 
560
   PLUGINS="$PLUGINS plugin_uptime.o"
 
561
   AC_DEFINE(PLUGIN_UPTIME,1,[uptime plugin])
 
562
fi
 
563
 
 
564
if test "$PLUGIN_W1RETAP" = "yes"; then
 
565
   PLUGINS="$PLUGINS plugin_w1retap.o"
 
566
   AC_DEFINE(PLUGIN_W1RETAP,1,[w1retap plugin])
 
567
fi
 
568
 
 
569
# WLAN
 
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])
 
575
   else
 
576
      AC_MSG_WARN(linux/wireless.h header not found: wireless plugin disabled)
 
577
   fi 
 
578
fi
 
579
 
 
580
# XMMS
 
581
if test "$PLUGIN_XMMS" = "yes"; then
 
582
   PLUGINS="$PLUGINS plugin_xmms.o"
 
583
   AC_DEFINE(PLUGIN_XMMS,1,[xmms plugin])
 
584
fi
 
585
 
 
586
if test "$PLUGINS" = ""; then
 
587
   AC_MSG_ERROR([You should include at least one plugin...])
 
588
fi
 
589
   
 
590
AC_SUBST(PLUGINS)
 
591
AC_SUBST(PLUGINLIBS)