forked from UweOhse/lrzsz
-
Notifications
You must be signed in to change notification settings - Fork 1
/
acinclude.m4
82 lines (78 loc) · 1.96 KB
/
acinclude.m4
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
dnl AC_REPLACE_GNU_GETOPT
AC_DEFUN([AC_REPLACE_GNU_GETOPT],
[AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
AC_SUBST(LIBOBJS)dnl
])
dnl for ease of use
AC_DEFUN([LRZSZ_HEADERS_TERM_IO],[
AC_CHECK_HEADERS(termios.h sys/termios.h termio.h sys/termio.h sgtty.h)dnl
])
dnl LRZSZ_TYPE_SPEED_T
AC_DEFUN([LRZSZ_TYPE_SPEED_T],[
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([LRZSZ_HEADERS_TERM_IO])dnl
AC_MSG_CHECKING(for speed_t)
AC_CACHE_VAL(ac_cv_type_speed_t,
[AC_EGREP_CPP(speed_t, [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#else
#if defined(HAVE_SYS_TERMIOS_H)
#include <sys/termios.h>
#else
#if defined(HAVE_TERMIO_H)
#include <termio.h>
#else
#if defined(HAVE_SYS_TERMIO_H)
#include <sys/termio.h>
#else
#if defined(HAVE_SGTTY_H)
#include <sgtty.h>
#else
#error neither termio.h nor sgtty.h found. Cannot continue. */
#endif
#endif
#endif
#endif
#endif
], ac_cv_type_speed_t=yes, ac_cv_type_speed_t=no)])dnl
AC_MSG_RESULT($ac_cv_type_speed_t)
if test $ac_cv_type_speed_t = no; then
AC_DEFINE([speed_t],long)
fi
])
AC_DEFUN([lrzsz_HEADER_SYS_SELECT],
[AC_CACHE_CHECK([whether sys/time.h and sys/select.h may both be included],
lrzsz_cv_header_sys_select,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/time.h>
#include <sys/select.h>],
[struct tm *tp;], lrzsz_cv_header_sys_select=yes, lrzsz_cv_header_sys_select=no)])
if test $lrzsz_cv_header_sys_select = no; then
AC_DEFINE(SYS_TIME_WITHOUT_SYS_SELECT)
fi
])
AC_DEFUN([UO_TYPE_SOCKLEN_T],[
AC_CACHE_CHECK([for socklen_t],ac_cv_type_socklen_t,
[AC_TRY_COMPILE([
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
],[socklen_t x=0;return x;]
,ac_cv_type_socklen_t=yes,ac_cv_type_socklen_t=no)]
)
if test $ac_cv_type_socklen_t = no; then
cat >> confdefs.h <<\EOF
#define socklen_t int
EOF
AC_DEFINE([socklen_t],int)
fi
]) dnl DEFUN