-
Notifications
You must be signed in to change notification settings - Fork 1
/
acinclude.m4
75 lines (70 loc) · 1.86 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
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
dnl taken from taylor uucp
AC_DEFUN(LRZSZ_ERRNO_DECL,[
AC_MSG_CHECKING(for errno declaration)
AC_CACHE_VAL(lrzsz_cv_decl_errno,
[AC_TRY_COMPILE([#include <errno.h>], [int i = errno; errno = 1;],
lrzsz_cv_decl_errno=yes, lrzsz_cv_decl_errno=no)])
AC_MSG_RESULT($lrzsz_cv_decl_errno)
if test $lrzsz_cv_decl_errno = yes; then
AC_DEFINE([HAVE_ERRNO_DECLARATION])
fi
])
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
])