root/branches/volker_dev/drivers.m4

Revision 839, 13.6 kB (checked in by volker, 17 months ago)

additional information about decision which plugin and drivers are included via configure

  • Property svn:keywords set to Id URL
Line 
1dnl $Id$
2dnl $URL$
3
4
5dnl LCD4Linux Drivers conf part
6dnl
7dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <reinelt@eunet.at>
8dnl Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
9dnl
10dnl This file is part of LCD4Linux.
11dnl
12dnl LCD4Linux is free software; you can redistribute it and/or modify
13dnl it under the terms of the GNU General Public License as published by
14dnl the Free Software Foundation; either version 2, or (at your option)
15dnl any later version.
16dnl
17dnl LCD4Linux is distributed in the hope that it will be useful,
18dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20dnl GNU General Public License for more details.
21dnl
22dnl You should have received a copy of the GNU General Public License
23dnl along with this program; if not, write to the Free Software
24dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
26AC_MSG_CHECKING([which drivers to compile])
27AC_ARG_WITH(
28  drivers,
29  [  --with-drivers=<list>   compile driver for displays in <list>,]
30  [                        drivers may be separated with commas,]
31  [                        'all' (default) compiles all available drivers,]
32  [                        drivers may be excluded with 'all,!<driver>',]
33  [                        (try 'all,\!<driver>' if your shell complains...)]
34  [                        possible drivers are:]
35  [                        BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux,]
36  [                        G15, HD44780, LCD2USB LCDLinux, LCDTerm, LPH7508,]
37  [                        LUIse, M50530, MatrixOrbital, MilfordInstruments,]
38  [                        Noritake, NULL, PNG, PPM, picoLCD, RouterBoard, Sample,]
39  [                        serdisplib, SimpleLCD, T6963, Trefon, USBLCD,]
40  [                        USBHUB, WincorNixdorf, X11],
41  drivers=$withval,
42  drivers=all
43)
44
45drivers=`echo $drivers|sed 's/,/ /g'`
46
47for driver in $drivers; do
48
49   case $driver in
50      !*)
51         val="no"
52         driver=`echo $driver|cut -c 2-`
53         ;;
54       *)
55         val="yes"
56         ;;
57   esac
58 
59   case "$driver" in
60      all)
61         BECKMANNEGLE="yes"
62         BWCT="yes"
63         CRYSTALFONTZ="yes"
64         CURSES="yes"
65         CWLINUX="yes"
66         EA232graphic="yes"
67         G15="yes"
68         HD44780="yes"
69         LCD2USB="yes"
70   LCDLINUX="yes"
71         LCDTERM="yes"
72         LEDMATRIX="yes"
73   LPH7508="yes"
74         LUISE="yes"
75         M50530="yes"
76         MATRIXORBITAL="yes"
77         MILINST="yes"
78         NORITAKE="yes"
79         NULL="yes"
80         picoLCD="yes"
81         PNG="yes"
82         PPM="yes"
83         ROUTERBOARD="yes"
84         SAMPLE="yes"
85   SERDISPLIB="yes"
86         SIMPLELCD="yes"
87         T6963="yes"
88         Trefon="yes"
89   USBHUB="yes"
90         USBLCD="yes"
91   WINCORNIXDORF="yes"
92         X11="yes"
93         ;;
94      BeckmannEgle)
95         BECKMANNEGLE=$val
96         ;;
97      BWCT)
98         BWCT=$val
99         ;;
100      CrystalFontz)
101         CRYSTALFONTZ=$val
102         ;;
103      Curses)
104         CURSES=$val
105         ;;
106      Cwlinux)
107         CWLINUX=$val
108         ;;
109      EA232graphic)
110         EA232graphic=$val
111         ;;
112      G15)
113         G15=$val
114         ;;
115      HD44780)
116         HD44780=$val
117   ;;
118      HD44780-I2C)
119         HD44780_I2C=$val
120   ;;
121      LCD2USB)
122         LCD2USB=$val
123         ;;
124      LCDLinux)
125         LCDLINUX=$val
126   ;;
127      LCDTerm)
128         LCDTERM=$val
129   ;;
130      LEDMatrix)
131         LEDMATRIX=$val
132   ;;
133      LPH7508)
134         LPH7508=$val
135         ;;
136      LUIse)
137         LUISE=$val
138         ;;
139      M50530)
140         M50530=$val
141         ;;
142      MatrixOrbital)
143         MATRIXORBITAL=$val
144         ;;
145      MilfordInstruments)
146         MILINST=$val
147         ;;
148      Noritake)
149         NORITAKE=$val;
150         ;;
151      NULL)
152         NULL=$val;
153         ;;
154      picoLCD)
155         picoLCD=$val
156         ;;         
157      PNG)
158         PNG=$val
159         ;;
160      PPM)
161         PPM=$val
162         ;;
163      RouterBoard)
164         ROUTERBOARD=$val
165         ;;
166      Sample)
167         SAMPLE=$val
168         ;;
169      serdisplib)
170         SERDISPLIB=$val;
171         ;;
172      SimpleLCD)
173         SIMPLELCD=$val
174         ;;
175      T6963)
176         T6963=$val
177         ;;
178      Trefon)
179         Trefon=$val
180         ;;
181      USBHUB)
182         USBHUB=$val
183         ;;
184      USBLCD)
185         USBLCD=$val
186         ;;
187      WincorNixdorf)
188         WINCORNIXDORF=$val
189         ;;
190      X11)
191         X11=$val
192         ;;
193      *) 
194         AC_MSG_ERROR([Unknown driver '$driver'])
195         ;;
196   esac
197done
198
199AC_MSG_RESULT([done])
200
201
202# generic display drivers
203TEXT="no"
204GRAPHIC="no"
205IMAGE="no"
206GPIO="no"
207
208# generiv I/O drivers
209PARPORT="no"
210SERIAL="no"
211I2C="no"
212KEYPAD="no"
213
214# generic libraries
215LIBUSB="no"
216
217if test "$BECKMANNEGLE" = "yes"; then
218   TEXT="yes"
219   GPIO="yes"
220   SERIAL="yes"
221   DRIVERS="$DRIVERS drv_BeckmannEgle.o"
222   AC_DEFINE(WITH_BECKMANNEGLE,1,[Beckmann&Egle driver])
223fi
224
225if test "$BWCT" = "yes"; then
226   if test "$has_usb" = "true"; then
227      TEXT="yes"
228      DRIVERS="$DRIVERS drv_BWCT.o"
229      LIBUSB="yes"
230      AC_DEFINE(WITH_BWCT,1,[BWCT driver])
231   else
232      AC_MSG_WARN(usb.h not found: BWCT driver disabled)
233   fi
234fi
235
236if test "$CRYSTALFONTZ" = "yes"; then
237   TEXT="yes"
238   GPIO="yes"
239   SERIAL="yes"
240   KEYPAD="yes"
241   DRIVERS="$DRIVERS drv_Crystalfontz.o"
242   AC_DEFINE(WITH_CRYSTALFONTZ,1,[Crystalfontz driver])
243fi
244
245if test "$CURSES" = "yes"; then
246   if test "$has_curses" = true; then
247      TEXT="yes"
248      KEYPAD="yes"
249      DRIVERS="$DRIVERS drv_Curses.o"
250      DRVLIBS="$DRVLIBS $CURSES_LIBS"
251      CPPFLAGS="$CPPFLAGS $CURSES_INCLUDES"
252      AC_DEFINE(WITH_CURSES,1,[Curses driver])
253   else
254      AC_MSG_WARN(curses not found: Curses driver disabled)
255   fi   
256fi
257
258if test "$CWLINUX" = "yes"; then
259   TEXT="yes"
260   # CW12232 is graphic, but can be driven as a text display
261   ## GRAPHIC="yes"
262   GPIO="yes"
263   SERIAL="yes"
264   KEYPAD="yes"
265   DRIVERS="$DRIVERS drv_Cwlinux.o"
266   AC_DEFINE(WITH_CWLINUX,1,[CwLinux driver])
267fi
268
269if test "$EA232graphic" = "yes"; then
270   GRAPHIC="yes"
271   SERIAL="yes"
272   GPIO="yes"
273   DRIVERS="$DRIVERS drv_EA232graphic.o"
274   AC_DEFINE(WITH_EA232graphic,1,[Electronic Assembly RS232 graphic driver])
275fi
276
277if test "$G15" = "yes"; then
278   if test "$has_usb" = "true"; then
279      GRAPHIC="yes"
280      LIBUSB="yes"
281      DRIVERS="$DRIVERS drv_G15.o"
282      AC_DEFINE(WITH_G15,1,[G-15 driver])
283   else
284      AC_MSG_WARN(usb.h not found: G15 driver disabled)
285   fi
286fi
287
288if test "$HD44780" = "yes"; then
289   TEXT="yes"
290   PARPORT="yes"
291   I2C="yes"
292   GPIO="yes"
293   DRIVERS="$DRIVERS drv_HD44780.o"
294   AC_DEFINE(WITH_HD44780,1,[HD44780 driver])
295fi
296
297if test "$HD44780_I2C" = "yes"; then
298   TEXT="yes"
299   I2C="yes"
300   GPIO="yes"
301   DRIVERS="$DRIVERS drv_HD44780.o"
302   AC_DEFINE(WITH_HD44780,1,[HD44780 driver])
303fi
304
305if test "$LCD2USB" = "yes"; then
306   if test "$has_usb" = "true"; then
307      TEXT="yes"
308      SERIAL="yes"
309      KEYPAD="yes"
310      DRIVERS="$DRIVERS drv_LCD2USB.o"
311      LIBUSB="yes"
312      AC_DEFINE(WITH_LCD2USB,1,[LCD2USB driver])
313   else
314      AC_MSG_WARN(usb.h not found: LCD2USB driver disabled)
315   fi
316fi
317
318if test "$LCDLINUX" = "yes"; then
319   if test "$has_lcd_linux" = true; then
320      TEXT="yes"
321      DRIVERS="$DRIVERS drv_LCDLinux.o"
322      AC_DEFINE(WITH_LCDLINUX,1,[LCD-Linux driver])
323   else
324      AC_MSG_WARN(linux/lcd-linux.h or linux/hd44780.h not found: LCD-Linux driver disabled)
325   fi   
326fi
327
328if test "$LCDTERM" = "yes"; then
329   TEXT="yes"
330   SERIAL="yes"
331   DRIVERS="$DRIVERS drv_LCDTerm.o"
332   AC_DEFINE(WITH_LCDTERM,1,[LCDTerm driver])
333fi
334
335if test "$LEDMATRIX" = "yes"; then
336   GRAPHIC="yes"
337   DRIVERS="$DRIVERS drv_LEDMatrix.o"
338   AC_DEFINE(WITH_LEDMATRIX,1,[LEDMatrix driver])
339fi
340
341if test "$LPH7508" = "yes"; then
342   GRAPHIC="yes"
343   GPIO="yes"
344   PARPORT="yes"
345   DRIVERS="$DRIVERS drv_LPH7508.o"
346   AC_DEFINE(WITH_LPH7508,1,[LPH7508 driver])
347fi
348
349if test "$LUISE" = "yes"; then
350   if test "$has_luise" = "true"; then
351      GRAPHIC="yes"
352      DRIVERS="$DRIVERS drv_LUIse.o"
353      DRVLIBS="$DRVLIBS -L/usr/local/lib -lluise"
354      AC_DEFINE(WITH_LUISE,1,[LUIse driver])
355   else
356      AC_MSG_WARN(luise.h not found: LUIse driver disabled)
357   fi
358fi
359
360if test "$M50530" = "yes"; then
361   TEXT="yes"
362   GPIO="yes"
363   PARPORT="yes"
364   DRIVERS="$DRIVERS drv_M50530.o"
365   AC_DEFINE(WITH_M50530,1,[M50530 driver])
366fi
367
368if test "$MATRIXORBITAL" = "yes"; then
369   TEXT="yes"
370   GPIO="yes"
371   SERIAL="yes"
372   DRIVERS="$DRIVERS drv_MatrixOrbital.o"
373   AC_DEFINE(WITH_MATRIXORBITAL,1,[MatrixOrbital driver])
374fi
375
376if test "$MILINST" = "yes"; then
377   TEXT="yes"
378   SERIAL="yes"
379   DRIVERS="$DRIVERS drv_MilfordInstruments.o"
380   AC_DEFINE(WITH_MILINST,1,[Milford Instruments driver])
381fi
382
383if test "$NORITAKE" = "yes"; then
384   TEXT="yes"
385   GRAPHIC="yes"
386   PARPORT="yes"
387   DRIVERS="$DRIVERS drv_Noritake.o"
388   AC_DEFINE(WITH_NORITAKE,1,[Noritake driver])
389fi
390
391if test "$NULL" = "yes"; then
392   TEXT="yes"
393   DRIVERS="$DRIVERS drv_NULL.o"
394   AC_DEFINE(WITH_NULL,1,[NULL driver])
395fi
396
397if test "$picoLCD" = "yes"; then
398   if test "$has_usb" = "true"; then
399      TEXT="yes"
400      GPIO="yes"
401      SERIAL="yes"
402      LIBUSB="yes"
403      DRIVERS="$DRIVERS drv_picoLCD.o"
404      AC_DEFINE(WITH_picoLCD,1,[picoLCD driver])
405   else
406      AC_MSG_WARN(usb.h not found: picoLCD driver disabled)
407   fi
408fi
409
410if test "$PNG" = "yes"; then
411   if test "$has_gd" = "true"; then
412      IMAGE="yes"
413      AC_DEFINE(WITH_PNG,1,[PNG driver])
414   else
415      AC_MSG_WARN(gd.h not found: PNG driver disabled)
416   fi
417fi
418
419if test "$PPM" = "yes"; then
420   IMAGE="yes"
421   AC_DEFINE(WITH_PPM,1,[PPM driver])
422fi
423
424if test "$ROUTERBOARD" = "yes"; then
425   if test "$has_io_h" = "true"; then
426      TEXT="yes"
427      GPIO="yes"
428      DRIVERS="$DRIVERS drv_RouterBoard.o"
429      AC_DEFINE(WITH_ROUTERBOARD,1,[RouterBoard driver])
430   else
431      AC_MSG_WARN(sys/io.h not found: RouterBoard driver disabled)
432   fi
433fi
434
435if test "$SAMPLE" = "yes"; then
436   # select either text or graphics mode
437   TEXT="yes"
438   GRAPHIC="yes"
439   # support for GPIO's
440   GPIO="yes"
441   # select bus: serial (including USB), parallel or i2c
442   SERIAL="yes"
443   PARPORT="yes"
444   #I2C="yes"
445   DRIVERS="$DRIVERS drv_Sample.o"
446   AC_DEFINE(WITH_SAMPLE,1,[Sample driver])
447fi
448
449if test "$SERDISPLIB" = "yes"; then
450   if test "$has_serdisplib" = "true"; then
451      GRAPHIC="yes"
452      DRIVERS="$DRIVERS drv_serdisplib.o"
453      DRVLIBS="$DRVLIBS -L/usr/local/lib -lserdisp"
454      AC_DEFINE(WITH_SERDISPLIB,1,[serdisplib driver])
455      if test "$has_usb" = "true"; then
456         LIBUSB="yes"
457      fi
458   else
459      AC_MSG_WARN(serdisp.h not found: serdisplib driver disabled)
460   fi
461fi
462
463if test "$SIMPLELCD" = "yes"; then
464   TEXT="yes"
465   SERIAL="yes"
466   DRIVERS="$DRIVERS drv_SimpleLCD.o"
467   AC_DEFINE(WITH_SIMPLELCD,1,[SimpleLCD driver])
468fi
469
470if test "$T6963" = "yes"; then
471   GRAPHIC="yes"
472   PARPORT="yes"
473   DRIVERS="$DRIVERS drv_T6963.o"
474   AC_DEFINE(WITH_T6963,1,[T6963 driver])
475fi
476
477if test "$Trefon" = "yes"; then
478   if test "$has_usb" = "true"; then
479      TEXT="yes"
480      DRIVERS="$DRIVERS drv_Trefon.o"
481      LIBUSB="yes"
482      AC_DEFINE(WITH_TREFON,1,[TREFON driver])
483   else
484      AC_MSG_WARN(usb.h not found: Trefon driver disabled)
485   fi
486fi
487
488if test "$USBHUB" = "yes"; then
489   if test "$has_usb" = "true"; then
490      GPIO="yes"
491      DRIVERS="$DRIVERS drv_USBHUB.o"
492      LIBUSB="yes"
493      AC_DEFINE(WITH_USBHUB,1,[USBHUB driver])
494   else
495      AC_MSG_WARN(usb.h not found: USB-Hub driver disabled)
496   fi
497fi
498
499if test "$USBLCD" = "yes"; then
500   TEXT="yes"
501   SERIAL="yes"
502   DRIVERS="$DRIVERS drv_USBLCD.o"
503   if test "$has_usb" = "true"; then
504      LIBUSB="yes"
505   fi
506   AC_DEFINE(WITH_USBLCD,1,[USBLCD driver])
507fi
508
509if test "$WINCORNIXDORF" = "yes"; then
510   TEXT="yes"
511   SERIAL="yes"
512   DRIVERS="$DRIVERS drv_WincorNixdorf.o"
513   AC_DEFINE(WITH_WINCORNIXDORF,1,[WincorNixdorf driver])
514fi
515
516if test "$X11" = "yes"; then
517   if test "$no_x" = "yes"; then
518      AC_MSG_WARN(X11 headers or libraries not available: X11 driver disabled)
519   else
520      GRAPHIC="yes"
521      KEYPAD="yes"
522      DRIVERS="$DRIVERS drv_X11.o"
523      if test "x$ac_x_libraries" = "x"; then
524  DRVLIBS="$DRVLIBS -lX11"
525      else
526        DRVLIBS="$DRVLIBS -L$ac_x_libraries -lX11"
527      fi
528      CPP_FLAGS="$CPPFLAGS $X_CFLAGS"
529      AC_DEFINE(WITH_X11, 1, [X11 driver])
530   fi
531fi
532
533
534# Image driver
535if test "$IMAGE" = "yes"; then
536   GRAPHIC="yes"
537   DRIVERS="$DRIVERS drv_Image.o"
538fi
539
540if test "$DRIVERS" = ""; then
541   AC_MSG_ERROR([You should activate at least one driver...])
542fi
543   
544# generic text driver
545if test "$TEXT" = "yes"; then
546   DRIVERS="$DRIVERS drv_generic_text.o"
547fi
548
549# generic graphic driver
550if test "$GRAPHIC" = "yes"; then
551   DRIVERS="$DRIVERS drv_generic_graphic.o"
552   if test "$has_gd" = "true"; then
553      DRIVERS="$DRIVERS widget_image.o"
554      DRVLIBS="$DRVLIBS -lgd"
555      AC_DEFINE(WITH_GD, 1, [GD library])
556      AC_DEFINE(WITH_IMAGE, 1, [image widget])
557   fi
558fi
559
560# generic GPIO driver
561if test "$GPIO" = "yes"; then
562   DRIVERS="$DRIVERS drv_generic_gpio.o"
563fi
564
565# generic parport driver
566if test "$PARPORT" = "yes"; then
567   DRIVERS="$DRIVERS drv_generic_parport.o"
568   AC_DEFINE(WITH_PARPORT, 1, [parport bus driver])
569fi
570
571# generic serial driver
572if test "$SERIAL" = "yes"; then
573   DRIVERS="$DRIVERS drv_generic_serial.o"
574   AC_DEFINE(WITH_SERIAL, 1, [serial bus driver])
575fi
576
577# generic i2c driver
578if test "$I2C" = "yes"; then
579   DRIVERS="$DRIVERS drv_generic_i2c.o"
580   AC_DEFINE(WITH_I2C, 1, [I2C bus driver])
581fi
582
583# generic keypad driver
584if test "$KEYPAD" = "yes"; then
585   DRIVERS="$DRIVERS drv_generic_keypad.o"
586fi
587
588# libusb
589if test "$LIBUSB" = "yes"; then
590   DRVLIBS="$DRVLIBS -lusb"
591fi
592
593if test "$DRIVERS" = ""; then
594   AC_MSG_ERROR([You should include at least one driver...])
595else
596   AC_MSG_RESULT(
597[-----------------------------------------]
598[including drivers:]
599[  $DRIVERS]
600[-----------------------------------------]
601   )
602fi
603   
604AC_SUBST(DRIVERS)
605AC_SUBST(DRVLIBS)
Note: See TracBrowser for help on using the browser.