This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
95 lines (87 loc) · 2.29 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
AC_PREREQ([2.68])
AC_INIT([tio], [1.32], [], [tio], [https://tio.github.io])
AC_CONFIG_HEADERS([src/include/config.h])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip -Wall -Werror])
AM_SILENT_RULES([yes])
AC_PROG_CC
AC_LANG([C])
AC_PROG_INSTALL
AC_SYS_LARGEFILE
# Handle bash completion
AC_ARG_WITH([bash-completion-dir],
AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
[Install the bash auto-completion script in this directory. @<:@default=yes@:>@]),
[],
[with_bash_completion_dir=yes])
if test "x$with_bash_completion_dir" = "xyes"; then
BASH_COMPLETION_DIR="${datadir}/bash-completion/completions"
else
BASH_COMPLETION_DIR="$with_bash_completion_dir"
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_DECL([B$1], [tio_have_decl=1], [tio_have_decl=0], [[#include <termios.h>]])
AS_IF([test $tio_have_decl = 1], [
AC_SUBST([BAUDRATES], ["$BAUDRATES $1"])
AC_SUBST([BAUDRATE_CASES], ["$BAUDRATE_CASES case $1: baudrate = B$1; break;"])]
)
]
)
# 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
BAUDRATES=
BAUDRATE_CASES=
TIO_CHECK_BAUDRATES(
0,
50,
75,
110,
134,
150,
200,
300,
600,
1200,
1800,
2400,
4800,
7200,
9600,
14400,
19200,
28800,
38400,
57600,
76800,
115200,
230400,
460800,
500000,
576000,
921600,
1000000,
1152000,
1500000,
2000000,
2500000,
3000000,
3500000,
4000000
)
AC_DEFINE_UNQUOTED([AUTOCONF_BAUDRATE_CASES],[$BAUDRATE_CASES],[Switch cases for detected baud rates])
# Check for interface for setting arbitrary I/O speeds
AC_CHECK_DECL([TCGETS2], [AC_DEFINE([HAVE_TERMIOS2],[1],[Define if termios2 exists.]) have_termios2=yes], , [[#include <asm/termios.h>]])
AM_CONDITIONAL([ADD_SETSPEED2],[test "x$have_termios2" = "xyes"])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([src/bash-completion/tio])
AC_CONFIG_FILES([man/Makefile])
AC_OUTPUT