]> git.webhop.me Git - lcd4linux.git/commitdiff
fix automake - check for libftdi
authormichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sun, 23 Nov 2008 00:20:58 +0000 (00:20 +0000)
committermichux <michux@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sun, 23 Nov 2008 00:20:58 +0000 (00:20 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@902 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

config.h.in
configure
configure.in
drivers.m4

index ad784b4c18b237a4d722ef2d8139bb21fb7626f9..ee5a8d266720b8445da78faeb3db0ff9964672df 100644 (file)
@@ -28,6 +28,9 @@
 /* Define to 1 if you have the `fork' function. */
 #undef HAVE_FORK
 
+/* Define to 1 if you have the <ftdi.h> header file. */
+#undef HAVE_FTDI_H
+
 /* Define to 1 if you have the <gd/gd.h> header file. */
 #undef HAVE_GD_GD_H
 
index 753668545a5f46e2708ca08ab779efa444099676..f28d8cf20caf05612e2048af9d5daf72fc6dceb9 100755 (executable)
--- a/configure
+++ b/configure
@@ -7253,6 +7253,155 @@ fi
 done
 
 
+# check for ftdi.h (ULA200)
+
+for ac_header in ftdi.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------- ##
+## Report this to lcd4linux-users@lists.sourceforge.net ##
+## ---------------------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ has_ftdi="true"
+else
+  has_ftdi="false"; break
+fi
+
+done
+
+
 # check for python
 { echo "$as_me:$LINENO: checking if python support is wanted" >&5
 echo $ECHO_N "checking if python support is wanted... $ECHO_C" >&6; }
@@ -8197,15 +8346,20 @@ echo "$as_me: WARNING: usb.h not found: Trefon driver disabled" >&2;}
 fi
 
 if test "$ULA200" = "yes"; then
-   TEXT="yes"
-   LIBUSB="yes"
-   LIBFTDI="yes"
-   DRIVERS="$DRIVERS drv_ula200.o"
+   if test "$has_ftdi" = "true"; then
+      TEXT="yes"
+      LIBUSB="yes"
+      LIBFTDI="yes"
+      DRIVERS="$DRIVERS drv_ula200.o"
 
 cat >>confdefs.h <<\_ACEOF
 #define WITH_ULA200 1
 _ACEOF
 
+   else
+      { echo "$as_me:$LINENO: WARNING: ftdi.h not found: ULA200 driver disabled" >&5
+echo "$as_me: WARNING: ftdi.h not found: ULA200 driver disabled" >&2;}
+   fi
 fi
 
 if test "$USBHUB" = "yes"; then
index 78ff1e68cf742d27f0dbcdc87d074766e952ec3c..837a3b937bd15b0c45cd8d0f83959b47e2ad89c4 100644 (file)
@@ -83,6 +83,9 @@ AC_CHECK_HEADERS(st2205.h, [has_st2205="true"], [has_st2205="false"])
 # check for LCD-Linux
 AC_CHECK_HEADERS(linux/lcd-linux.h linux/hd44780.h, [has_lcd_linux="true"], [has_lcd_linux="false"; break])
 
+# check for ftdi.h (ULA200)
+AC_CHECK_HEADERS(ftdi.h, [has_ftdi="true"], [has_ftdi="false"; break])
+
 # check for python
 AC_MSG_CHECKING(if python support is wanted)
 AC_ARG_WITH(python,
index deab189c1df791124c213f94b762254abe195d58..4f5a3927f13892824835b9031257295b5267d41d 100644 (file)
@@ -567,11 +567,15 @@ if test "$Trefon" = "yes"; then
 fi
 
 if test "$ULA200" = "yes"; then
-   TEXT="yes"
-   LIBUSB="yes"
-   LIBFTDI="yes"
-   DRIVERS="$DRIVERS drv_ula200.o"
-   AC_DEFINE(WITH_ULA200,1,[ULA200 driver])
+   if test "$has_ftdi" = "true"; then
+      TEXT="yes"
+      LIBUSB="yes"
+      LIBFTDI="yes"
+      DRIVERS="$DRIVERS drv_ula200.o"
+      AC_DEFINE(WITH_ULA200,1,[ULA200 driver])
+   else
+      AC_MSG_WARN(ftdi.h not found: ULA200 driver disabled)
+   fi
 fi
 
 if test "$USBHUB" = "yes"; then