mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Reduced code duplication in baud rate detection
This commit is contained in:
parent
933792d73f
commit
f701beb408
1 changed files with 29 additions and 15 deletions
44
configure.ac
44
configure.ac
|
|
@ -26,22 +26,36 @@ fi
|
|||
AC_SUBST([BASH_COMPLETION_DIR])
|
||||
AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"])
|
||||
|
||||
# TIO_CHECK_BAUDRATE(N)
|
||||
AC_DEFUN(
|
||||
[TIO_CHECK_BAUDRATE],
|
||||
[AC_CHECK_DECLS([B$1], [AC_SUBST([B$1], [$1])], [], [[#include <termios.h>]])]
|
||||
)
|
||||
|
||||
# TIO_CHECK_BAUDRATES(N1, N2, ...)
|
||||
AC_DEFUN(
|
||||
[TIO_CHECK_BAUDRATES],
|
||||
[m4_foreach([n], [$@], [TIO_CHECK_BAUDRATE(m4_normalize(n))])]
|
||||
)
|
||||
|
||||
# Check for available terminal I/O speeds
|
||||
AC_CHECK_DECLS([B57600], [AC_SUBST([B57600],["57600"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B115200], [AC_SUBST([B115200],["115200"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B230400], [AC_SUBST([B230400],["230400"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B460800], [AC_SUBST([B460800],["460800"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B500000], [AC_SUBST([B500000],["500000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B576000], [AC_SUBST([B576000],["576000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B921600], [AC_SUBST([B921600],["921600"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B1000000], [AC_SUBST([B1000000],["1000000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B1152000], [AC_SUBST([B1152000],["1152000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B1500000], [AC_SUBST([B1500000],["1500000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B2000000], [AC_SUBST([B2000000],["2000000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B2500000], [AC_SUBST([B2500000],["2500000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B3000000], [AC_SUBST([B3000000],["3000000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B3500000], [AC_SUBST([B3500000],["3500000"])], [], [[#include <termios.h>]])
|
||||
AC_CHECK_DECLS([B4000000], [AC_SUBST([B4000000],["4000000"])], [], [[#include <termios.h>]])
|
||||
TIO_CHECK_BAUDRATES(
|
||||
57600,
|
||||
115200,
|
||||
230400,
|
||||
460800,
|
||||
500000,
|
||||
576000,
|
||||
921600,
|
||||
1000000,
|
||||
1152000,
|
||||
1500000,
|
||||
2000000,
|
||||
2500000,
|
||||
3000000,
|
||||
3500000,
|
||||
4000000
|
||||
)
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([src/Makefile])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue