-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
75 lines (67 loc) · 2.62 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
# Process this file with autoconf to produce a configure script.
AC_INIT(wy60, 2.0.10, markus+wy60@wy60.gutschke.com)
AM_INIT_AUTOMAKE(wy60, 2.0.10, markus+wy60@wy60.gutschke.com)
AM_CONFIG_HEADER(config.h)
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
# Checks for libraries.
AC_CHECK_FUNCS(setupterm, [],
[AC_CHECK_LIB(curses, setupterm, LIBS="-lcurses $LIBS",
[AC_CHECK_LIB(ncurses, setupterm, LIBS="-lncurses $LIBS")])])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([curses.h errno.h fcntl.h grp.h ncurses.h ncurses/term.h \
netinet/in.h pty.h setjmp.h signal.h stdarg.h stdio.h \
stdlib.h string.h strings.h stropts.h sys/filio.h \
sys/ioctl.h sys/poll.h sys/select.h sys/time.h \
sys/ttydefaults.h sys/types.h syslog.h term.h termios.h \
unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_CHECK_FUNCS([atexit cfmakeraw dup2 gettimeofday memmove memset putenv \
strcasecmp strchr strdup strrchr unsetenv ])
AC_TRY_LINK([#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>],
[getpt();],
[AC_DEFINE(HAVE_GETPT, 1,
Define to 1 if you have UNIX98 style PTYs)],
[AC_DEFINE(HAVE_GETPT, 0)])
AC_TRY_LINK([#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>],
[grantpt(0);],
[AC_DEFINE(HAVE_GRANTPT, 1,
Define to 1 if you have UNIX98 style PTYs)],
[AC_DEFINE(HAVE_GRANTPT, 0)])
AC_TRY_COMPILE([#include <sys/ioctl.h>],
[ioctl(0, TIOCSCTTY, 0);],
[AC_DEFINE(HAVE_TIOCSCTTY, 1,
Define to 1 if you have the BSD style TIOCSCTTY ioctl)],
[AC_DEFINE(HAVE_TIOCSCTTY, 0)])
AC_TRY_COMPILE([#define macro(arg, args...) ({ fnc(arg, ##args); })
int fnc(int arg0, int arg1, int arg2) { return; }],
[macro(1,2,3);],
[AC_DEFINE(HAVE_VARIADICMACROS, 1,
Define to 1 if you have GCC style variadic macros)],
[AC_DEFINE(HAVE_VARIADICMACROS, 0)])
#endif
AH_VERBATIM([_GNU_SOURCE],
[/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT