aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2018-04-02 12:59:40 +0100
committerfishsoupisgood <github@madingley.org>2018-04-02 12:59:40 +0100
commitccdba936a920b99a4c2cad74c3824c66ea2d6066 (patch)
tree6de2c86b3302cc75a2b85ce1b69a31da2ad841ae
parentc945112e89222e697c3733c69eab685f606a5be5 (diff)
downloadsympathy-ccdba936a920b99a4c2cad74c3824c66ea2d6066.tar.gz
sympathy-ccdba936a920b99a4c2cad74c3824c66ea2d6066.tar.bz2
sympathy-ccdba936a920b99a4c2cad74c3824c66ea2d6066.zip
openwrt build
-rw-r--r--configure.in9
-rw-r--r--src/project.h6
-rw-r--r--src/sympathy.h.head.in48
3 files changed, 61 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index ad86f29..f38380b 100644
--- a/configure.in
+++ b/configure.in
@@ -89,7 +89,7 @@ dnl AC_DEFINE_UNQUOTED(LIBSYMPATHY_MICRO_VERSION, $LIBSYMPATHY_MICRO_VERSION)
AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)
AC_CHECK_HEADERS(sys/scsi/impl/uscsi.h scsi/sg.h stdint.h)
AC_CHECK_HEADERS(sys/int_types.h string.h strings.h)
-AC_CHECK_HEADERS(dirent.h sys/stat.h)
+AC_CHECK_HEADERS(dirent.h sys/stat.h temrio.h)
AC_C_INLINE
AC_C_CONST
@@ -119,8 +119,12 @@ G2_HAVE_STDINT_H=0
if test "$ac_cv_header_stdint_h" = "yes"; then
G2_HAVE_STDINT_H=1
fi
+G2_HAVE_TERMIO_H=0
+if test "$ac_cv_header_termio_h" = "yes"; then
+ G2_HAVE_TERMIO_H=1
+fi
G2_TIME_WITH_SYS_TIME=0
-if test "$ac_cv_header_time_h" = "yes"; then
+if test "$ac_cv_header_sys_time_h" = "yes"; then
G2_TIME_WITH_SYS_TIME=1
fi
G2_TM_IN_SYS_TIME=0
@@ -137,6 +141,7 @@ AC_SUBST(G2_HAVE_SYS_INT_TYPES_H)
AC_SUBST(G2_HAVE_UNISTD_H)
AC_SUBST(G2_HAVE_MALLOC_H)
AC_SUBST(G2_HAVE_STDINT_H)
+AC_SUBST(G2_HAVE_TERMIO_H)
AC_SUBST(G2_TIME_WITH_SYS_TIME)
AC_SUBST(G2_TM_IN_SYS_TIME)
diff --git a/src/project.h b/src/project.h
index 59ba8c7..1eda998 100644
--- a/src/project.h
+++ b/src/project.h
@@ -93,9 +93,15 @@
#include <sys/int_types.h>
#endif
+#if defined(HAVE_TERMIO_H)
#include <termio.h>
+#endif
#include <termios.h>
+#if defined (HAVE_SYS_STAT_H)
+#include <sys/stat.h>
+#endif
+
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/src/sympathy.h.head.in b/src/sympathy.h.head.in
index 22fcc1e..8d9ba2c 100644
--- a/src/sympathy.h.head.in
+++ b/src/sympathy.h.head.in
@@ -47,6 +47,8 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
+
/* the integer constants here are set by configure */
/* get uint32_t and friends defined */
@@ -92,6 +94,52 @@ extern "C" {
#include <sys/int_types.h>
#endif
+#if @G2_HAVE_TERMIO_H@
#include <termio.h>
+#endif
#include <termios.h>
+
+#ifndef TIOCM_LE
+#define TIOCM_LE 0x001 /* line enable */
+#endif
+#ifndef TIOCM_DTR
+#define TIOCM_DTR 0x002 /* data terminal ready */
+#endif
+#ifndef TIOCM_RTS
+#define TIOCM_RTS 0x004 /* request to send */
+#endif
+#ifndef TIOCM_ST
+#define TIOCM_ST 0x010 /* secondary transmit */
+#endif
+#ifndef TIOCM_SR
+#define TIOCM_SR 0x020 /* secondary receive */
+#endif
+#ifndef TIOCM_CTS
+#define TIOCM_CTS 0x040 /* clear to send */
+#endif
+#ifndef TIOCM_CAR
+#define TIOCM_CAR 0x100 /* carrier detect */
+#endif
+#ifndef TIOCM_CD
+#define TIOCM_CD TIOCM_CAR
+#endif
+#ifndef TIOCM_RNG
+#define TIOCM_RNG 0x200 /* ring */
+#endif
+#ifndef TIOCM_RI
+#define TIOCM_RI TIOCM_RNG
+#endif
+#ifndef TIOCM_DSR
+#define TIOCM_DSR 0x400 /* data set ready */
+#endif
+#ifndef TIOCM_OUT1
+#define TIOCM_OUT1 0x2000
+#endif
+#ifndef TIOCM_OUT2
+#define TIOCM_OUT2 0x4000
+#endif
+#ifndef TIOCM_LOOP
+#define TIOCM_LOOP 0x8000
+#endif
+
#include <string.h>