]> git.webhop.me Git - lcd4linux.git/commitdiff
disabling some driver if no parport available
authorvolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 18 Nov 2009 17:19:16 +0000 (17:19 +0000)
committervolker <volker@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 18 Nov 2009 17:19:16 +0000 (17:19 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1062 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

configure.in
drivers.m4
event.c

index 7e5a7f46cbfff3d67524070c1ca779ed3ce69b08..ef69b3511ca6dd666fd5104e59f3112d000f4ccc 100644 (file)
@@ -100,6 +100,10 @@ if test "$with_python" = "yes"; then
     AC_PYTHON_DEVEL
 fi
 
+# check for parport
+#AC_CHECK_HEADERS(asm/io.h)
+AC_CHECK_HEADERS([asm/io.h] [linux/parport.h linux/ppdev.h], [has_parport="true"], [has_parport="false"])
+
 # drivers
 sinclude(drivers.m4)
 
@@ -110,8 +114,6 @@ sinclude(plugins.m4)
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h])
-AC_CHECK_HEADERS(asm/io.h)
-AC_CHECK_HEADERS(linux/parport.h linux/ppdev.h)
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index 4ade62d98ac5198de9d51ec97db06fb1da37f876..b2e3d9f895623a76a5cb98ffabf799ebeccd3f76 100644 (file)
@@ -33,12 +33,13 @@ AC_ARG_WITH(
   [                        (try 'all,\!<driver>' if your shell complains...)]
   [                        possible drivers are:]
   [                        BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux, D4D,]
-  [                        G15, GLCD2USB, HD44780, IRLCD, LCD2USB, LCDLinux, LCDTerm,]
-  [                        LPH7508, LUIse, LW_ABP, M50530, MatrixOrbital, MilfordInstruments,]
-  [                        Noritake, NULL, PNG, PPM, Pertelian, PHAnderson, PICGraphic, picoLCD,]
-  [                        picoLCDGraphic, RouterBoard, Sample, serdisplib, ShuttleVFD,]
-  [                        SimpleLCD, st2205, T6963, Trefon, ULA200, USBLCD, USBHUB,]
-  [                        VNC, WincorNixdorf, X11],
+  [                        EA232Graphic, G15, GLCD2USB, HD44780, HD44780-i2c, IRLCD,]
+  [                        LCD2USB, LCDLinux, LEDMatrix, LCDTerm, LPH7508, LUIse,]
+  [                        LW_ABP, M50530, MatrixOrbital, MatrixOrbitalGX,]
+  [                        MilfordInstruments, Noritake, NULL, Pertelian, PHAnderson,]
+  [                        PICGraphic, picoLCD, picoLCDGraphic, PNG, PPM, RouterBoard,]
+  [                        Sample, serdisplib, ShuttleVFD, SimpleLCD, st2205, T6963,]
+  [                        Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11],
   drivers=$withval,
   drivers=all
 )
@@ -69,6 +70,7 @@ for driver in $drivers; do
          G15="yes"
          GLCD2USB="yes"
          HD44780="yes"
+         HD44780_I2C="yes"
         IRLCD="yes"
          LCD2USB="yes"
         LCDLINUX="yes"
@@ -358,13 +360,17 @@ if test "$GLCD2USB" = "yes"; then
 fi
 
 if test "$HD44780" = "yes"; then
-   TEXT="yes"
-   PARPORT="yes"
-   I2C="yes"
-   GPIO="yes"
-   KEYPAD="yes"
-   DRIVERS="$DRIVERS drv_HD44780.o"
-   AC_DEFINE(WITH_HD44780,1,[HD44780 driver])
+   if test "$has_parport" = "true"; then
+      TEXT="yes"
+      PARPORT="yes"
+      I2C="yes"
+      GPIO="yes"
+      KEYPAD="yes"
+      DRIVERS="$DRIVERS drv_HD44780.o"
+      AC_DEFINE(WITH_HD44780,1,[HD44780 driver])
+   else
+      AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: HD44780 driver disabled)
+   fi
 fi
 
 if test "$HD44780_I2C" = "yes"; then
@@ -424,11 +430,15 @@ if test "$LEDMATRIX" = "yes"; then
 fi
 
 if test "$LPH7508" = "yes"; then
-   GRAPHIC="yes"
-   GPIO="yes"
-   PARPORT="yes"
-   DRIVERS="$DRIVERS drv_LPH7508.o"
-   AC_DEFINE(WITH_LPH7508,1,[LPH7508 driver])
+   if test "$has_parport" = "true"; then
+      GRAPHIC="yes"
+      GPIO="yes"
+      PARPORT="yes"
+      DRIVERS="$DRIVERS drv_LPH7508.o"
+      AC_DEFINE(WITH_LPH7508,1,[LPH7508 driver])
+   else
+      AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: LPH7508 driver disabled)
+   fi
 fi
 
 if test "$LUISE" = "yes"; then
@@ -450,11 +460,15 @@ if test "$LW_ABP" = "yes"; then
 fi
 
 if test "$M50530" = "yes"; then
-   TEXT="yes"
-   GPIO="yes"
-   PARPORT="yes"
-   DRIVERS="$DRIVERS drv_M50530.o"
-   AC_DEFINE(WITH_M50530,1,[M50530 driver])
+   if test "$has_parport" = "true"; then
+      TEXT="yes"
+      GPIO="yes"
+      PARPORT="yes"
+      DRIVERS="$DRIVERS drv_M50530.o"
+      AC_DEFINE(WITH_M50530,1,[M50530 driver])
+   else
+      AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: M50530 driver disabled)
+   fi
 fi
 
 if test "$MATRIXORBITAL" = "yes"; then
@@ -485,11 +499,15 @@ if test "$MILINST" = "yes"; then
 fi
 
 if test "$NORITAKE" = "yes"; then
-   TEXT="yes"
-   GRAPHIC="yes"
-   PARPORT="yes"
-   DRIVERS="$DRIVERS drv_Noritake.o"
-   AC_DEFINE(WITH_NORITAKE,1,[Noritake driver])
+   if test "$has_parport" = "true"; then
+      TEXT="yes"
+      GRAPHIC="yes"
+      PARPORT="yes"
+      DRIVERS="$DRIVERS drv_Noritake.o"
+      AC_DEFINE(WITH_NORITAKE,1,[Noritake driver])
+   else
+      AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: NORITAKE driver disabled)
+   fi
 fi
 
 if test "$NULL" = "yes"; then
@@ -575,17 +593,21 @@ if test "$ROUTERBOARD" = "yes"; then
 fi
 
 if test "$SAMPLE" = "yes"; then
-   # select either text or graphics mode
-   TEXT="yes"
-   GRAPHIC="yes"
-   # support for GPIO's
-   GPIO="yes"
-   # select bus: serial (including USB), parallel or i2c
-   SERIAL="yes"
-   PARPORT="yes"
-   #I2C="yes"
-   DRIVERS="$DRIVERS drv_Sample.o"
-   AC_DEFINE(WITH_SAMPLE,1,[Sample driver])
+   if test "$has_parport" = "true"; then
+      # select either text or graphics mode
+      TEXT="yes"
+      GRAPHIC="yes"
+      # support for GPIO's
+      GPIO="yes"
+      # select bus: serial (including USB), parallel or i2c
+      SERIAL="yes"
+      PARPORT="yes"
+      #I2C="yes"
+      DRIVERS="$DRIVERS drv_Sample.o"
+      AC_DEFINE(WITH_SAMPLE,1,[Sample driver])
+   else
+      AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: SAMPLE driver disabled)
+   fi
 fi
 
 if test "$SERDISPLIB" = "yes"; then
@@ -633,10 +655,14 @@ if test "$ST2205" = "yes"; then
 fi
 
 if test "$T6963" = "yes"; then
-   GRAPHIC="yes"
-   PARPORT="yes"
-   DRIVERS="$DRIVERS drv_T6963.o"
-   AC_DEFINE(WITH_T6963,1,[T6963 driver])
+   if test "$has_parport" = "true"; then
+      GRAPHIC="yes"
+      PARPORT="yes"
+      DRIVERS="$DRIVERS drv_T6963.o"
+      AC_DEFINE(WITH_T6963,1,[T6963 driver])
+   else
+      AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: T6963 driver disabled)
+   fi
 fi
 
 if test "$Trefon" = "yes"; then
diff --git a/event.c b/event.c
index 10919e4db9948e0b90322e97deec97a667bb6f32..bff2a968d51119af8e58958a41bef33bd0378605 100644 (file)
--- a/event.c
+++ b/event.c
@@ -126,7 +126,7 @@ int event_process(const struct timespec *timeout)
 #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4)
     int ready = ppoll(fds, j, timeout, NULL);
 #else
-    int ready = poll(fds, j, timeout->tv_sec * 1000000 + timeout->tv_nsec / 1000000);
+    int ready = poll(fds, j, timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000);
 #endif
 
     if (ready > 0) {