From 2647c8a7cf9a5f618d4300a52e7ad046d77acec5 Mon Sep 17 00:00:00 2001 From: Lutz Mueller Date: Thu, 4 Oct 2001 13:22:00 +0000 Subject: [PATCH] =?UTF-8?q?2001-10-04=20=20Lutz=20M=EF=BF=BDller=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * acconfig.h: * configure.in: * serial/unix.c: Use baudboy.h if available (Red Hat) git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2373 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2_port/ChangeLog | 6 ++++++ libgphoto2_port/acconfig.h | 1 + libgphoto2_port/configure.in | 21 +++++++++++++++++++-- libgphoto2_port/serial/unix.c | 8 +++++--- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/libgphoto2_port/ChangeLog b/libgphoto2_port/ChangeLog index 003d8d04d..8d225fc40 100644 --- a/libgphoto2_port/ChangeLog +++ b/libgphoto2_port/ChangeLog @@ -1,3 +1,9 @@ +2001-10-04 Lutz Müller + + * acconfig.h: + * configure.in: + * serial/unix.c: Use baudboy.h if available (Red Hat) + 2001-10-04 Lutz Müller Thanks to Bill Richardson : diff --git a/libgphoto2_port/acconfig.h b/libgphoto2_port/acconfig.h index 170d54d64..5ece5b9eb 100644 --- a/libgphoto2_port/acconfig.h +++ b/libgphoto2_port/acconfig.h @@ -14,5 +14,6 @@ #undef HAVE_RTS_IOCTL /* Serial port locking */ +#undef HAVE_BAUDBOY #undef HAVE_TTYLOCK #undef HAVE_LOCKDEV diff --git a/libgphoto2_port/configure.in b/libgphoto2_port/configure.in index 4578bc3a5..fb0792e06 100644 --- a/libgphoto2_port/configure.in +++ b/libgphoto2_port/configure.in @@ -74,13 +74,21 @@ IOLIB_CFLAGS="-DGP_PORT_SUPPORTED_SERIAL" dnl ----------------------------------------- dnl Serial port locking: We try to use either -dnl (1) ttylock.h -dnl (2) lockdev.h +dnl (1) baudboy.h +dnl (2) ttylock.h +dnl (3) lockdev.h dnl ----------------------------------------- +baudboy_msg=no ttylock_msg=no lockdev_msg=no +try_baudboy_msg=true try_ttylock=true try_lockdev=true +AC_ARG_WITH(baudboy, [ --without-baudboy Use baudboy library], + if test x$withval = xno; then + try_baudboy=false + fi +) AC_ARG_WITH(ttylock, [ --without-ttylock Use ttylock library], if test x$withval = xno; then try_ttylock=false @@ -91,6 +99,14 @@ AC_ARG_WITH(lockdev, [ --without-lockdev Use lockdev library], try_lockdev=false fi ) +if $try_baudboy; then + AC_CHECK_HEADER(baudboy.h, + baudboy_msg=yes + try_ttylock=false + try_lockdev=false + AC_DEFINE(HAVE_BAUDBOY) + ) +fi if $try_ttylock; then AC_CHECK_HEADER(ttylock.h, AC_MSG_CHECKING(if ttylock needs lockdev) @@ -200,6 +216,7 @@ Configuration Source code location: ${srcdir} Compiler: ${CC} + Use baudboy: $baudboy_msg Use ttylock: $ttylock_msg Use lockdev: $lockdev_msg " diff --git a/libgphoto2_port/serial/unix.c b/libgphoto2_port/serial/unix.c index 8979baf09..e22e2cdee 100644 --- a/libgphoto2_port/serial/unix.c +++ b/libgphoto2_port/serial/unix.c @@ -50,7 +50,9 @@ #include #endif -#if HAVE_TTYLOCK +#if HAVE_BAUDBOY +# include +#elif HAVE_TTYLOCK # include #elif HAVE_LOCKDEV # include @@ -138,7 +140,7 @@ gp_port_operations *gp_port_library_operations () { static int gp_port_serial_lock (gp_port *dev) { -#if HAVE_TTYLOCK +#if HAVE_TTYLOCK || HAVE_BAUDBOY const char *port; port = strchr (dev->settings.serial.port, ':'); @@ -295,7 +297,7 @@ gp_port_serial_lock (gp_port *dev) static int gp_port_serial_unlock (gp_port *dev) { -#if HAVE_TTYLOCK +#if HAVE_TTYLOCK || HAVE_BAUDBOY const char *port; port = strchr (dev->settings.serial.port, ':');