-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.in
266 lines (239 loc) · 8.32 KB
/
configure.in
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
AC_PREREQ(2.57)
AC_INIT(daydream, 2.14.9, [email protected])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([main/daydream.c])
AC_CONFIG_HEADER([config.h])
AC_PREFIX_DEFAULT(/home/bbs)
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_CC_WARNINGS
AC_C_BOUNDED
dnl automake has some support for yaccless computers but it is
dnl braindead enough to look for the intermediate C file only
dnl in the build directory and not at all in the source directory.
dnl Therefore we need a kludge here.
AC_PROG_YACC
if test "x$YACC" = "xyacc"; then
YACC=""
AC_CHECK_PROG(YACC, yacc, yacc, [])
fi
if test "x$YACC" = "x"; then
YACC='$(SHELL) $(top_srcdir)/fakeyacc'
fi
AC_PATH_PROG(LOGIN, login)
# Use -D_GNU_SOURCE only if we have the GNU C library.
AC_CACHE_CHECK([for GNU C library], ac_cv_libc_gnu, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <features.h>
#if !defined __GLIBC__
#error __GLIBC__ not defined
#endif
]])], [ac_cv_libc_gnu="yes"], [ac_cv_libc_gnu="no"])])
if test "x$ac_cv_libc_gnu" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
fi
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h arpa/telnet.h err.h fcntl.h inttypes.h libutil.h netdb.h netinet/in.h paths.h pty.h sac.h stdarg.h stdbool.h stdint.h strings.h stropts.h sys/file.h sys/filio.h sys/ioctl.h syslog.h sys/mman.h sys/param.h sys/pty.h sys/ptyio.h sys/ptyvar.h sys/resource.h sys/select.h sys/socket.h sys/stat.h sys/statvfs.h sys/stream.h sys/stropts.h sys/str_tty.h sys/strtty.h sys/time.h sys/tty.h sys/types.h sys/uio.h sys/utsname.h sys/vfs.h sys/wait.h termio.h termios.h tmpdir.h unistd.h util.h utmp.h utmpx.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
# Checks for libraries
AC_CHECK_LIB(nsl, main, LIBNSL="-lnsl")
AC_CHECK_LIB(socket, main, LIBSOCKET="-lsocket")
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MMAP
AC_FUNC_SETVBUF_REVERSED
AC_CHECK_FUNCS([alphasort cfmakeraw scandir setproctitle setsid statvfs uname gettosbyname parsetos setsockopt revoke vhangup _getpty getpt grantpt unlockpt ptsname ttyname setutent getutent endutent setutxent getutxent endutxent])
AC_REPLACE_FUNCS([setenv strlcat strlcpy unsetenv vasprintf])
# Checks for terminal flags in termios.h.
AC_CACHE_CHECK([for IUCLC], ac_cv_termios_iuclc, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <termios.h>
unsigned int t = IUCLC;
]])], [ac_cv_termios_iuclc="yes"], [ac_cv_termios_iuclc="no"])])
if test "x$ac_cv_termios_iuclc" = "xyes"; then
AC_DEFINE([HAVE_IUCLC], 1, [Define to 1 if you have the IUCLC constant.])
fi
AC_CACHE_CHECK([for XCASE], ac_cv_termios_xcase, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <termios.h>
unsigned int t = XCASE;
]])], [ac_cv_termios_xcase="yes"], [ac_cv_termios_xcase="no"])])
if test "x$ac_cv_termios_xcase" = "xyes"; then
AC_DEFINE([HAVE_XCASE], 1, [Define to 1 if you have the XCASE constant.])
fi
# Check whether we have TIOCSCTTY in sys/ioctl.h.
AC_CACHE_CHECK([for TIOCSCTTY], ac_cv_ioctl_tiocsctty, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/ioctl.h>
unsigned int t = TIOCSCTTY;
]])], [ac_cv_ioctl_tiocsctty="yes"], [ac_cv_ioctl_tiocsctty="no"])])
if test "x$ac_cv_ioctl_tiocsctty" = "xyes"; then
AC_DEFINE([HAVE_TIOCSCTTY], 1, [Define to 1 if you have the TIOCSCTTY constant.])
fi
# Check whether we have O_NOFOLLOW flag for open().
AC_CACHE_CHECK([for O_NOFOLLOW], ac_cv_o_nofollow, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
mode_t m = O_NOFOLLOW;
]])], [ac_cv_o_nofollow="yes"], [ac_cv_o_nofollow="no"])])
if test "x$ac_cv_o_nofollow" = "xyes"; then
AC_DEFINE([HAVE_O_NOFOLLOW], 1, [Define to 1 if you have the O_NOFOLLOW constant.])
fi
dnl utmp entries are different of BSD and Linux
AC_CHECK_TYPES([struct utmpx],,, [#include <utmpx.h>])
AC_CHECK_MEMBERS([struct utmpx.e_exit, struct utmpx.ut_syslen, struct utmpx.ut_id],,, [#include <utmpx.h>])
dnl Revert to old getpty() if getpt(), grantpt(), unlockpt() and ptsname()
dnl are not available.
if test "x${ac_cv_func_getpt}" = "xyes" -a \
"x${ac_cv_func_grantpt}" = "xyes" -a \
"x${ac_cv_func_unlockpt}" = "xyes" -a \
"x${ac_cv_func_ptsname}" = "xyes"; then
dnl FIXME: Solaris does have grantpt and unlockpt but not getpt...
AC_DEFINE([HAVE_PTY_UTILS], 1,
[Define this if you have the getpt, grantpt, unlockpt and ptsname functions.])
fi
dnl Python support?
AC_ARG_WITH(python, [ --without-python don't compile Python support])
if test "x${with_python}" = "x" -o "x${with_python}" = "xyes"; then
python_cmd="python"
elif test "x${with_python}" != "xno"; then
# this error message is a little misleading, but who cares
AC_MSG_ERROR([
*** --with-python and --without-python don't take arguments])
fi
_PYTHON=false
if test "x${python_cmd}" != "x"; then
python_found=""
AC_CHECK_PROG(python_found, $python_cmd, "yes")
if test "x$python_found" = "x"; then
AC_MSG_WARN([python not found])
else
AC_MSG_CHECKING([for Python headers])
python_headers=""
python_prefix=`python -c "import sys; print sys.prefix"`
changequote({, })
python_version=`python -c 'import sys; print sys.version' |
head -1 | sed -e 's/^\([12]\..\).*$/\\1/'`
changequote([, ])
python_incpath="${python_prefix}/include/python${python_version}"
saved_cpp_flags=$CPPFLAGS
CPPFLAGS="-I${python_incpath} ${save_cpp_flags}"
AC_TRY_CPP([#include <Python.h>], python_headers="${python_incpath}")
if test "x$python_headers" = "x"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([Python header files not found])
else
AC_MSG_RESULT(${python_headers})
AC_MSG_CHECKING([for Python library path])
python_prefix=`python -c "import sys; print sys.exec_prefix"`
python_libpath="${python_prefix}/lib/python${python_version}"
if test -d ${python_libpath} -a "${python_incpath}"; then
_PYTHON=true
AC_MSG_RESULT(${python_libpath})
else
python_libpath=""
AC_MSG_RESULT([doesn't exist])
AC_MSG_WARN([Python library path incorrect or missing])
fi
fi
CPPFLAGS=$saved_cpp_flags
fi
fi
AM_CONDITIONAL(BUILD_PYTHON, test x$_PYTHON = xtrue)
dnl which curses does have all the required functions?
AC_CHECK_LIB(curses, start_color,
[CURSES_LIBS="-lcurses" CURSES_INCS="curses.h"],
AC_CHECK_LIB(ncurses, start_color,
[CURSES_LIBS="-lncurses" CURSES_INCS="ncurses.h"]))
AC_CHECK_HEADER(${CURSES_INCS},, CURSES_LIBS="")
if test "x${CURSES_LIBS}" != "x"; then
save_LIBS=${LIBS}
LIBS="${LIBS} ${CURSES_LIBS}"
AC_TRY_LINK([#include <${CURSES_INCS}>],
[WINDOW *win; wsetscrreg(win, 0, 0);],
AC_DEFINE([HAVE_WSETSCRREG], 1,
[Define this if you have the wsetscrreg function.]))
AC_TRY_LINK([#include <${CURSES_INCS}>],
[WINDOW *win; redrawwin(win);],
AC_DEFINE([HAVE_REDRAWWIN], 1,
[Define this if you have the redrawwin function.]))
LIBS=${save_LIBS}
fi
if test "x${CURSES_LIBS}" = "x"; then
AC_MSG_WARN([*** curses not found, hydracom will not be compiled])
else
AM_CONDITIONAL(BUILD_HYDRACOM, true)
fi
########################################################################
AC_ARG_WITH(server, [ --with-server build graphical frontend])
AM_CONDITIONAL(BUILD_SERVER, [ test "x${with_server}" = "xyes" ])
AC_SUBST(CURSES_INCS)
AC_SUBST(CURSES_LIBS)
AC_SUBST(LIBNSL)
AC_SUBST(LIBSOCKET)
AC_SUBST(LIBS)
AC_SUBST(LOGIN)
AC_SUBST(python_incpath)
AC_SUBST(python_libpath)
AH_BOTTOM([
#ifdef HAVE_BOUNDED
#define __attr_bounded__(__type__, __buf__, __size__) \
__attribute__ ((__bounded__ (__type__, __buf__, __size__)))
#else
#define __attr_bounded__(__type__, __buf__, __size__)
#endif
])
AC_CONFIG_FILES([daydream-config
ddlogin
secure.sh
Makefile
batch/Makefile
bulletins/Makefile
configs/Makefile
configs/ddtop_designs/Makefile
data/Makefile
ddftp/Makefile
ddfv/Makefile
ddsnoop/Makefile
ddz/Makefile
display/Makefile
display/iso/Makefile
docs/Makefile
docs/html/Makefile
doors/Makefile
hydracom/Makefile
hydracom/mycurses.h
lib/Makefile
main/Makefile
python/Makefile
python/examples/Makefile
questionnaire/Makefile
scripts/Makefile
server/Makefile
telnetd/Makefile
utils/Makefile
])
AC_OUTPUT