root/tags/0.10.0/drivers.m4

Revision 556, 8.6 kB (checked in by lfcorreia, 4 years ago)

[lcd4linux @ 2005-05-31 20:42:54 by lfcorreia]
new file: lcd4linux_i2c.h
avoid the problems detecting the proper I2C kernel include files

rearrange all the other autoconf stuff to remove I2C detection

new method by Paul Kamphuis to write to the I2C device

Line 
1dnl LCD4Linux Drivers conf part
2dnl
3dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <reinelt@eunet.at>
4dnl Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
5dnl
6dnl This file is part of LCD4Linux.
7dnl
8dnl LCD4Linux is free software; you can redistribute it and/or modify
9dnl it under the terms of the GNU General Public License as published by
10dnl the Free Software Foundation; either version 2, or (at your option)
11dnl any later version.
12dnl
13dnl LCD4Linux is distributed in the hope that it will be useful,
14dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16dnl GNU General Public License for more details.
17dnl
18dnl You should have received a copy of the GNU General Public License
19dnl along with this program; if not, write to the Free Software
20dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22AC_MSG_CHECKING([which drivers to compile])
23AC_ARG_WITH(
24  drivers,
25  [  --with-drivers=<list>   compile driver for displays in <list>,]
26  [                        drivers may be separated with commas,]
27  [                        'all' (default) compiles all available drivers,]
28  [                        drivers may be excluded with 'all,!<driver>',]
29  [                        (try 'all,\!<driver>' if your shell complains...)]
30  [                        possible drivers are:]
31  [                        BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux,]
32  [                        HD44780, LCDLinux, LCDTerm, M50530, MatrixOrbital,]
33  [                        MilfordInstruments, Noritake, NULL, PNG, PPM,]
34  [                        RouterBoard, serdisplib, SimpleLCD, T6963, Trefon,]
35  [                        USBLCD, X11],
36  drivers=$withval,
37  drivers=all
38)
39
40drivers=`echo $drivers|sed 's/,/ /g'`
41
42for driver in $drivers; do
43
44   case $driver in
45      !*)
46         val="no"
47         driver=`echo $driver|cut -c 2-`
48         ;;
49       *)
50         val="yes"
51         ;;
52   esac
53 
54   case "$driver" in
55      all)
56         BECKMANNEGLE="yes"
57         BWCT="yes"
58         CRYSTALFONTZ="yes"
59         CURSES="yes"
60         CWLINUX="yes"
61         HD44780="yes"
62   LCDLINUX="yes"
63         LCDTERM="yes"
64         M50530="yes"
65         MATRIXORBITAL="yes"
66         MILINST="yes"
67         NORITAKE="yes"
68         NULL="yes"
69         PNG="yes"
70         PPM="yes"
71   ROUTERBOARD="yes"
72   SERDISPLIB="yes"
73         SIMPLELCD="yes"
74         T6963="yes"
75         Trefon="yes"
76         USBLCD="yes"
77         X11="yes"
78         ;;
79      BeckmannEgle)
80         BECKMANNEGLE=$val
81         ;;
82      BWCT)
83         BWCT=$val
84         ;;
85      CrystalFontz)
86         CRYSTALFONTZ=$val
87         ;;
88      Curses)
89         CURSES=$val
90         ;;
91      Cwlinux)
92         CWLINUX=$val
93         ;;
94      HD44780)
95         HD44780=$val
96   ;;
97      LCDLINUX)
98         LCDLINUX=$val
99   ;;
100      LCDTerm)
101         LCDTERM=$val
102   ;;
103      M50530)
104         M50530=$val
105         ;;
106      MatrixOrbital)
107         MATRIXORBITAL=$val
108         ;;
109      MilfordInstruments)
110         MILINST=$val
111         ;;
112      Noritake)
113         NORITAKE=$val;
114         ;;
115      NULL)
116         NULL=$val;
117         ;;
118      PNG)
119         PNG=$val
120         ;;
121      PPM)
122         PPM=$val
123         ;;
124      RouterBoard)
125         ROUTERBOARD=$val
126         ;;
127      serdisplib)
128         SERDISPLIB=$val;
129         ;;
130      SimpleLCD)
131         SIMPLELCD=$val
132         ;;
133      T6963)
134         T6963=$val
135         ;;
136      Trefon)
137         Trefon=$val
138         ;;
139      USBLCD)
140         USBLCD=$val
141         ;;
142      X11)
143         X11=$val
144         ;;
145      *) 
146         AC_MSG_ERROR([Unknown driver '$driver'])
147         ;;
148   esac
149done
150
151AC_MSG_RESULT([done])
152
153
154# generic display drivers
155TEXT="no"
156GRAPHIC="no"
157IMAGE="no"
158
159# generiv I/O drivers
160PARPORT="no"
161SERIAL="no"
162I2C="no"
163
164
165if test "$BECKMANNEGLE" = "yes"; then
166   TEXT="yes"
167   SERIAL="yes"
168   DRIVERS="$DRIVERS drv_BeckmannEgle.o"
169   AC_DEFINE(WITH_BECKMANNEGLE,1,[Beckmann&Egle driver])
170fi
171
172if test "$BWCT" = "yes"; then
173   if test "$has_usb" = "true"; then
174      TEXT="yes"
175      DRIVERS="$DRIVERS drv_BWCT.o"
176      DRVLIBS="$DRVLIBS -lusb"
177      AC_DEFINE(WITH_BWCT,1,[BWCT driver])
178   else
179      AC_MSG_WARN(usb.h not found: BWCT driver disabled)
180   fi
181fi
182
183if test "$CRYSTALFONTZ" = "yes"; then
184   TEXT="yes"
185   SERIAL="yes"
186   DRIVERS="$DRIVERS drv_Crystalfontz.o"
187   AC_DEFINE(WITH_CRYSTALFONTZ,1,[Crystalfontz driver])
188fi
189
190if test "$CURSES" = "yes"; then
191   if test "$has_curses" = true; then
192      DRIVERS="$DRIVERS drv_Curses.o"
193      DRVLIBS="$DRVLIBS $CURSES_LIBS"
194      CPPFLAGS="$CPPFLAGS $CURSES_INCLUDES"
195      AC_DEFINE(WITH_CURSES,1,[Curses driver])
196   else
197      AC_MSG_WARN(curses not found: Curses driver disabled)
198   fi   
199fi
200
201if test "$CWLINUX" = "yes"; then
202   TEXT="yes"
203   SERIAL="yes"
204   DRIVERS="$DRIVERS drv_Cwlinux.o"
205   AC_DEFINE(WITH_CWLINUX,1,[CwLinux driver])
206fi
207
208if test "$HD44780" = "yes"; then
209   TEXT="yes"
210   PARPORT="yes"
211   I2C="yes"
212   DRIVERS="$DRIVERS drv_HD44780.o"
213   AC_DEFINE(WITH_HD44780,1,[HD44780 driver])
214fi
215
216if test "$LCDLINUX" = "yes"; then
217   TEXT="yes"
218   DRIVERS="$DRIVERS drv_LCDLinux.o"
219   AC_DEFINE(WITH_LCDLINUX,1,[LCD-Linux driver])
220fi
221
222if test "$LCDTERM" = "yes"; then
223   TEXT="yes"
224   SERIAL="yes"
225   DRIVERS="$DRIVERS drv_LCDTerm.o"
226   AC_DEFINE(WITH_LCDTERM,1,[LCDTerm driver])
227fi
228
229if test "$M50530" = "yes"; then
230   TEXT="yes"
231   PARPORT="yes"
232   DRIVERS="$DRIVERS drv_M50530.o"
233   AC_DEFINE(WITH_M50530,1,[M50530 driver])
234fi
235
236if test "$MATRIXORBITAL" = "yes"; then
237   SERIAL="yes"
238   DRIVERS="$DRIVERS drv_MatrixOrbital.o"
239   AC_DEFINE(WITH_MATRIXORBITAL,1,[MatrixOrbital driver])
240fi
241
242if test "$MILINST" = "yes"; then
243   DRIVERS="$DRIVERS drv_MilfordInstruments.o"
244   AC_DEFINE(WITH_MILINST,1,[Milford Instruments driver])
245fi
246
247if test "$NORITAKE" = "yes"; then
248   TEXT="yes"
249   GRAPHIC="yes"
250   PARPORT="yes"
251   DRIVERS="$DRIVERS drv_Noritake.o"
252   AC_DEFINE(WITH_NORITAKE,1,[Noritake driver])
253fi
254
255if test "$NULL" = "yes"; then
256   DRIVERS="$DRIVERS drv_NULL.o"
257   AC_DEFINE(WITH_NULL,1,[NULL driver])
258fi
259
260if test "$PNG" = "yes"; then
261   if test "$has_gd" = "true"; then
262      GRAPHIC="yes"
263      IMAGE="yes"
264      DRVLIBS="$DRVLIBS -lgd"
265      AC_DEFINE(WITH_PNG,1,[ driver])
266   else
267      AC_MSG_WARN(gd.h not found: PNG driver disabled)
268   fi
269fi
270
271if test "$PPM" = "yes"; then
272   GRAPHIC="yes"
273   IMAGE="yes"
274   AC_DEFINE(WITH_PPM,1,[ driver])
275fi
276
277if test "$IMAGE" = "yes"; then
278   DRIVERS="$DRIVERS drv_Image.o"
279fi
280
281if test "$ROUTERBOARD" = "yes"; then
282   TEXT="yes"
283   DRIVERS="$DRIVERS drv_RouterBoard.o"
284   AC_DEFINE(WITH_ROUTERBOARD,1,[RouterBoard driver])
285fi
286
287if test "$SERDISPLIB" = "yes"; then
288   if test "$has_serdisplib" = "true"; then
289      GRAPHIC="yes"
290      DRIVERS="$DRIVERS drv_serdisplib.o"
291      DRVLIBS="$DRVLIBS -L/usr/local/lib -lserdisp"
292      AC_DEFINE(WITH_SERDISPLIB,1,[serdisplib driver])
293   else
294      AC_MSG_WARN(serdisp.h not found: serdisplib driver disabled)
295   fi
296fi
297
298if test "$SIMPLELCD" = "yes"; then
299   TEXT="yes"
300   SERIAL="yes"
301   DRIVERS="$DRIVERS drv_SimpleLCD.o"
302   AC_DEFINE(WITH_SIMPLELCD,1,[SimpleLCD driver])
303fi
304
305if test "$T6963" = "yes"; then
306   GRAPHIC="yes"
307   PARPORT="yes"
308   DRIVERS="$DRIVERS drv_T6963.o"
309   AC_DEFINE(WITH_T6963,1,[T6963 driver])
310fi
311
312if test "$Trefon" = "yes"; then
313   if test "$has_usb" = "true"; then
314      TEXT="yes"
315      DRIVERS="$DRIVERS drv_Trefon.o"
316      DRVLIBS="$DRVLIBS -lusb"
317      AC_DEFINE(WITH_TREFON,1,[TREFON driver])
318   else
319      AC_MSG_WARN(usb.h not found: Trefon driver disabled)
320   fi
321fi
322
323if test "$USBLCD" = "yes"; then
324   TEXT="yes"
325   SERIAL="yes"
326   DRIVERS="$DRIVERS drv_USBLCD.o"
327   if test "$has_usb" = "true"; then
328      DRVLIBS="$DRVLIBS -lusb"
329   fi
330   AC_DEFINE(WITH_USBLCD,1,[USBLCD driver])
331fi
332
333if test "$X11" = "yes"; then
334   if test "$no_x" = "yes"; then
335      AC_MSG_WARN(X11 headers or libraries not available: X11 driver disabled)
336   else
337      GRAPHIC="yes"
338      DRIVERS="$DRIVERS drv_X11.o"
339      DRVLIBS="$DRVLIBS -L$ac_x_libraries -lX11"
340      CPP_FLAGS="$CPPFLAGS $X_CFLAGS"
341      AC_DEFINE(WITH_X11, 1, [X11 driver])
342   fi
343fi
344
345
346if test "$DRIVERS" = ""; then
347   AC_MSG_ERROR([You should activate at least one driver...])
348fi
349   
350
351# generic text driver
352if test "$TEXT" = "yes"; then
353   DRIVERS="$DRIVERS drv_generic_text.o"
354fi
355
356# generic graphic driver
357if test "$GRAPHIC" = "yes"; then
358:
359   DRIVERS="$DRIVERS drv_generic_graphic.o"
360fi
361
362
363# generic parport driver
364if test "$PARPORT" = "yes"; then
365   DRIVERS="$DRIVERS drv_generic_parport.o"
366fi
367
368# generic serial driver
369if test "$SERIAL" = "yes"; then
370   DRIVERS="$DRIVERS drv_generic_serial.o"
371fi
372
373# generic i2c driver
374if test "$I2C" = "yes"; then
375   DRIVERS="$DRIVERS drv_generic_i2c.o"
376   AC_DEFINE(WITH_I2C, 1, [I2C bus driver])
377fi
378
379
380AC_SUBST(DRIVERS)
381AC_SUBST(DRVLIBS)
Note: See TracBrowser for help on using the browser.