-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
203 lines (178 loc) · 6.69 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
dnl File: configure.in
dnl Created: 00/05/04
dnl Author: Michel Hoche-Mong ([email protected])
dnl
dnl $Id: configure.in,v 1.19 2001/07/04 00:36:46 hoche Exp $
dnl
dnl standard startup stuff
AC_INIT
AC_CONFIG_SRCDIR([server/main.c])
AC_LANG(C)
AC_CONFIG_HEADER(config.h)
AH_BOTTOM([#include "icb_config.h"])
AC_ARG_ENABLE(debugging,
[ --enable-debugging Outputs extra debugging information at all
times. Normally, you should not enable this,
but instead use the -D flag of the commands,
which toggles debbuging output at runtime.
--disable-debugging Disallows debugging code to be built in.
This might provide some speed benefits.],
AC_DEFINE_UNQUOTED([DEBUG], 1, [Define to 1 to enable debugging output.]))
AC_ARG_ENABLE(ssl,
[ --enable-ssl Enable SSL using OpenSSL. (Experimental)],
ssl="$enable_ssl", ssl="no")
AC_ARG_ENABLE(brick,
[ --disable-brick Turns off the brick feature.],
brick="$enable_brick", brick="yes")
AC_ARG_WITH(max_users,
[ --with-max-users=<num> Maximum number of users.],
max_users="$with_max_users")
AC_ARG_WITH(admin_pwd,
[ --with-admin-pwd=<pwd> REQUIRED. Password for the admin user. To
become the admin user, you will need to log in
with another user name that has the SAME password,
register (/p <password>), then become the admin
user (/name admin), and reregister (/p <password>).],
admin_pwd="$with_admin_pwd")
AC_ARG_VAR(ADMIN_PWD, [Password for the admin user. Overridden by --with-admin-pwd])
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
AC_PROG_CPP
dnl these checks are inane. make them be useful, hoche. -hoche.
AC_CHECK_PROG(RM, rm, rm, rm)
AC_CHECK_PROG(AR, ar, ar, ar)
AC_CHECK_PROG(CTAGS, ctags, ctags, ctags)
AC_CHECK_PROG(LINT, lint, lint, lint)
AC_CHECK_PROG(CXREF, cxref, cxref, cxref)
AC_CHECK_PROG(COMPRESS, gzip, gzip, compress)
AC_CHECK_PROG(TAR, tar, tar, tar)
AC_CHECK_PROG(MAKEDEPEND, makedepend, makedepend, mkdep)
AC_PROG_RANLIB
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h unistd.h stdarg.h time.h)
AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/time.h sys/select.h)
dnl eff you, autoconf
dnl some linux systems (redhat) have ndbm.h in /usr/include/gdbm/ndbm.h
dnl other systems (debian/ubuntu) have ndbm.h in /usr/include/gdbm-ndbm.h
dnl autoconf maps both "gdbm/ndbm.h" and "gdbm-ndbm.h" to HAVE_GDBM_NDBM_H
dnl so we test for "./gdbm-ndbm.h", which maps to HAVE__GDMB_NDBM_H, with
dnl an extra underscore.
dnl almost everything else has it in just /usr/include/ndbm.h
ndbm=no
AC_CHECK_HEADERS(ndbm.h, ndbm=yes)
if test $ndbm = no; then
AC_CHECK_HEADERS(gdbm/ndbm.h, ndbm=yes)
fi
if test $ndbm = no; then
AC_CHECK_HEADERS(./gdbm-ndbm.h, ndbm=yes)
fi
dnl Checks for libraries.
dnl for those systems that use the gdbm/ndbm.h, look for gdbm lib
dnl compile and look for gdbm_version. If it exists, presume it's gdbm.
if test $ndbm = yes; then
AC_CHECK_LIB(gdbm, gdbm_version, [LIBS="$LIBS -lgdbm -lgdbm_compat"], [], [-lgdbm_compat])
else
AC_MSG_ERROR([Cannot find either gdbm or ndbm. Please install one or the other.])
fi
dnl do we have _res?
AC_CHECK_LIB(resolv, _res)
dnl check for solaris sockets and the extra libs solaris needs to link 'em
AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket -lnsl")
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl do we have socklen_t in sys/socket.h ?
AC_MSG_CHECKING(for socklen_t in sys/socket.h)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
]],
[[
socklen_t foo;
]])
],
[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([HAVE_SOCKLEN_T], 1, [Define to 1 if you have socklen_t.])
],
[
AC_MSG_RESULT([no])
])
dnl Do we have the XOpen fdset.__fds_bits or the alternate fdset.fds_bits?
AC_MSG_CHECKING(for XOpen fds_bits)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <sys/types.h>
]],
[[
fd_set fdset;
long bits;
bits = fdset.__fds_bits[0];
]])
],
[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([HAVE_XOPEN_FDS_BITS], 1, [Define to 1 if you have the XOpen fdset.])
],
[
AC_MSG_RESULT([no])
])
dnl Set Max users
ICB_AC_FD_SETSIZE
AC_MSG_CHECKING(max_users value)
if test x"$max_users" != x ; then
if test $max_users -ge $ac_cv_icb_fd_setsize ; then
AC_MSG_ERROR(max_users must be less than the FD_SETSIZE value in /usr/include/sys/types.h!)
fi
else
max_users=`expr $ac_cv_icb_fd_setsize - 1`
fi
AC_MSG_RESULT($max_users)
AC_DEFINE_UNQUOTED([MAX_USERS], $max_users, [Set to the maximum number of users you want to allow.])
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(gethostname gettimeofday select socket strdup strerror)
AC_CHECK_FUNCS(snprintf)
dnl Locate SSL libs.
if test x"$ssl" = x"yes" ; then
dnl Order matters!
if test "$PORTNAME" != "win32"; then
AC_SEARCH_LIBS(CRYPTO_new_ex_data, crypto, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
FOUND_SSL_LIB="no"
AC_SEARCH_LIBS(OPENSSL_init_ssl, ssl, [], [FOUND_SSL_LIB="yes"])
AC_SEARCH_LIBS(SSL_library_init, ssl, [], [FOUND_SSL_LIB="yes"])
AS_IF([test "x$FOUND_SSL_LIB" = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
else
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
FOUND_SSL_LIB="no"
AC_SEARCH_LIBS(OPENSSL_init_ssl, ssleay32 ssl, [], [FOUND_SSL_LIB="yes"])
AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [], [FOUND_SSL_LIB="yes"])
AS_IF([test "x$FOUND_SSL_LIB" = xno], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
fi
fi
if test x"$brick" = x"yes" ; then
AC_DEFINE_UNQUOTED([BRICK], 1, [Define to 1 to enable bricks.])
fi
if test x"$FOUND_SSL_LIB" = x"yes" ; then
AC_DEFINE_UNQUOTED([HAVE_SSL], 1, [Define to enable SSL])
AC_CHECK_FUNCS(TLS_server_method)
fi
if test x"$admin_pwd" = x ; then
if test x"$ADMIN_PWD" != x ; then
admin_pwd="$ADMIN_PWD"
else
AC_MSG_ERROR([either --with-admin-pwd must be used or the ADMIN_PWD environment variable must be set])
fi
fi
AC_MSG_RESULT([Setting ADMIN_PWD to "$admin_pwd"])
AC_DEFINE_UNQUOTED([ADMIN_PWD], "$admin_pwd", [Sets the admin password.])
AC_CONFIG_FILES([server/Makefile Makefile pktserv/Makefile])
AC_OUTPUT