-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
212 lines (184 loc) · 5.86 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
dnl Process this file with autoconf to produce a configure script.
AC_INIT([viewglob], [2.0.4])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])
RELEASE_DATE="April 26, 2006"
AC_DEFINE_UNQUOTED([VG_RELEASE_DATE], ["$RELEASE_DATE"] , [Date of release])
CFLAGS="$CFLAGS -Wall"
if test x"$USE_MAINTAINER_MODE" = xyes; then
CFLAGS="$CFLAGS -g3"
fi
dnl Optionally build only vgseer (and the other programs it needs).
VGSEER_ONLY=
AC_ARG_ENABLE(vgseer-only,
[AC_HELP_STRING(
[--enable-vgseer-only],
[Only build and install the client side of Viewglob])],
[VGSEER_ONLY=yep], [VGSEER_ONLY=nope])
AM_CONDITIONAL([FULL_BUILD], [test "$VGSEER_ONLY" = nope])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_HEADER_TIOCGWINSZ
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/time.h time.h sys/select.h])
AC_CHECK_HEADERS([ \
fnmatch.h sys/un.h \
fcntl.h errno.h stdlib.h \
string.h sys/ioctl.h termios.h \
unistd.h stdlib.h arpa/inet.h \
netdb.h netinet/in.h sys/socket.h],,
AC_MSG_ERROR([Required header missing!]))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_CHECK_TYPES([ptrdiff_t],,,)
dnl Checks for functions.
AC_FUNC_CLOSEDIR_VOID
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS([ \
stat lstat \
dup2 getcwd memmove \
memset pathconf select \
strchr setsid socket \
bind listen accept \
connect setsockopt],,
AC_MSG_ERROR([Required function missing!]))
dnl Determine whether to use getaddrinfo or gethostbyname and inet_aton.
AC_CHECK_FUNCS([getaddrinfo],,
[AC_CHECK_FUNCS([gethostbyname inet_aton],,
[AC_MSG_ERROR([Socket interface is incomplete!])])])
dnl Determine necessary libraries for sockets.
LIB_SOCKET_NSL
TYPE_SOCKLEN_T
AM_PATH_GLIB_2_0(2.2.0,,
AC_MSG_ERROR(GLib 2.2.0+ is required to build Viewglob))
dnl Test for bash.
AC_PATH_PROG(BASH_FULL_PATH, bash, nope)
if test "x$BASH_FULL_PATH" = xnope; then
AC_MSG_ERROR([Viewglob requires bash])
fi
AC_SUBST(BASH_FULL_PATH)
dnl Test for sed.
AC_CHECK_PROGS(SED,[sed],no)
if test "$SED" = "no"; then
AC_MSG_ERROR([Viewglob installation requires sed])
fi
dnl =====================================================================
dnl The following is for pty stuff and is taken from rxvt 2.7.10.
dnl =====================================================================
AC_CHECK_FUNCS([setpgid setpgrp isastream getpt grantpt unlockpt])
AC_FUNC_GETPGRP
AC_FUNC_SETPGRP
AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt,
[AC_TRY_LINK([#define _GNU_SOURCE
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif],
[(void)getpt();],
rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)])
if test x$rxvt_cv_func_getpt = xyes; then
AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() )
fi
dnl# if we don't guess right then it's up to the user
AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys,
[if test x$ac_cv_func_openpty = xyes; then
rxvt_cv_ptys=OPENPTY
else if test x$ac_cv_func__getpty = xyes; then
rxvt_cv_ptys=SGI4
else if test -c /dev/ttyp20; then
rxvt_cv_ptys=SCO
else if test -c /dev/ptym/clone; then
rxvt_cv_ptys=HPUX
else if test x$rxvt_cv_func_getpt = xyes; then
rxvt_cv_ptys=GLIBC
else if test -c /dev/ptc -a -c /dev/pts; then
rxvt_cv_ptys=PTC
else if test -c /dev/ptc -a -d /dev/pts; then
rxvt_cv_ptys=PTC
else if test -c /dev/ptmx -a -c /dev/pts/0; then
rxvt_cv_ptys=STREAMS
else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then
dnl# catch CYGWIN
rxvt_cv_ptys=STREAMS
else
rxvt_cv_ptys=BSD
fi
fi
fi
fi
fi
fi
fi
fi
fi
])
if test x$rxvt_cv_ptys = xOPENPTY; then
AC_DEFINE(PTYS_ARE_OPENPTY, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xSCO; then
AC_DEFINE(PTYS_ARE_NUMERIC, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xSTREAMS; then
AC_DEFINE(PTYS_ARE_PTMX, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xPTC; then
AC_DEFINE(PTYS_ARE_PTC, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xSGI4; then
AC_DEFINE(PTYS_ARE__GETPTY, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xCONVEX; then
AC_DEFINE(PTYS_ARE_GETPTY, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xGLIBC; then
AC_DEFINE(PTYS_ARE_GETPT, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xHPUX; then
AC_DEFINE(PTYS_ARE_CLONE, 1, Define for this pty type)
fi
if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then
AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type)
fi
AC_CHECKING(for pty ranges)
ptys=`echo /dev/pty??`
pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
if test x$pch1 != x; then
AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX)
fi
if test x$pch2 != x; then
AC_DEFINE_UNQUOTED(PTYCHAR2, "$pch2", Define for second char in devptyXX)
fi
dnl =====================================================================
dnl End of pty stuff.
dnl =====================================================================
dnl Output release stuff so the shell scripts can get to it.
AC_SUBST(PACKAGE_NAME)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(RELEASE_DATE)
if test "$VGSEER_ONLY" = nope; then
dnl This stuff is specific to vgd and the displays.
AC_CHECK_HEADERS([syslog.h],,
AC_MSG_ERROR([Required header missing!]))
AC_CHECK_FUNCS([strtoul],,
AC_MSG_ERROR([Required function missing!]))
dnl For advanced Xlib stuff
AC_PATH_XTRA
dnl The displays require GTK+ 2.4.0.
AM_PATH_GTK_2_0(2.4.0,,
AC_MSG_ERROR(GTK+ 2.4.0+ is required to build Viewglob))
fi
AC_CONFIG_FILES([ \
Makefile vgseer/Makefile vgd/Makefile \
vgdisplay/Makefile vgexpand/Makefile vgping/Makefile \
shell/Makefile common/Makefile])
AC_OUTPUT