summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2860
1 files changed, 1383 insertions, 1477 deletions
diff --git a/configure.ac b/configure.ac
index ad3c4ab0f..58da1f167 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.469.4.1 2011/02/04 00:42:14 djm Exp $ 1# $Id: configure.ac,v 1.480 2011/08/18 04:48:24 tim Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -14,23 +14,12 @@
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.469.4.1 $) 18AC_REVISION($Revision: 1.480 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C])
20 21
21# local macros 22AC_CONFIG_HEADER([config.h])
22AC_DEFUN([OPENSSH_CHECK_CFLAG_COMPILE], [{
23 AC_MSG_CHECKING([if $CC supports $1])
24 saved_CFLAGS="$CFLAGS"
25 CFLAGS="$CFLAGS $1"
26 AC_COMPILE_IFELSE([void main(void) { return 0; }],
27 [ AC_MSG_RESULT(yes) ],
28 [ AC_MSG_RESULT(no)
29 CFLAGS="$saved_CFLAGS" ]
30 )
31}])
32
33AC_CONFIG_HEADER(config.h)
34AC_PROG_CC 23AC_PROG_CC
35AC_CANONICAL_HOST 24AC_CANONICAL_HOST
36AC_C_BIGENDIAN 25AC_C_BIGENDIAN
@@ -41,22 +30,22 @@ AC_PROG_CPP
41AC_PROG_RANLIB 30AC_PROG_RANLIB
42AC_PROG_INSTALL 31AC_PROG_INSTALL
43AC_PROG_EGREP 32AC_PROG_EGREP
44AC_PATH_PROG(AR, ar) 33AC_PATH_PROG([AR], [ar])
45AC_PATH_PROG(CAT, cat) 34AC_PATH_PROG([CAT], [cat])
46AC_PATH_PROG(KILL, kill) 35AC_PATH_PROG([KILL], [kill])
47AC_PATH_PROGS(PERL, perl5 perl) 36AC_PATH_PROGS([PERL], [perl5 perl])
48AC_PATH_PROG(SED, sed) 37AC_PATH_PROG([SED], [sed])
49AC_SUBST(PERL) 38AC_SUBST([PERL])
50AC_PATH_PROG(ENT, ent) 39AC_PATH_PROG([ENT], [ent])
51AC_SUBST(ENT) 40AC_SUBST([ENT])
52AC_PATH_PROG(TEST_MINUS_S_SH, bash) 41AC_PATH_PROG([TEST_MINUS_S_SH], [bash])
53AC_PATH_PROG(TEST_MINUS_S_SH, ksh) 42AC_PATH_PROG([TEST_MINUS_S_SH], [ksh])
54AC_PATH_PROG(TEST_MINUS_S_SH, sh) 43AC_PATH_PROG([TEST_MINUS_S_SH], [sh])
55AC_PATH_PROG(SH, sh) 44AC_PATH_PROG([SH], [sh])
56AC_PATH_PROG(GROFF, groff) 45AC_PATH_PROG([GROFF], [groff])
57AC_PATH_PROG(NROFF, nroff) 46AC_PATH_PROG([NROFF], [nroff])
58AC_PATH_PROG(MANDOC, mandoc) 47AC_PATH_PROG([MANDOC], [mandoc])
59AC_SUBST(TEST_SHELL,sh) 48AC_SUBST([TEST_SHELL], [sh])
60 49
61dnl select manpage formatter 50dnl select manpage formatter
62if test "x$MANDOC" != "x" ; then 51if test "x$MANDOC" != "x" ; then
@@ -69,18 +58,18 @@ else
69 AC_MSG_WARN([no manpage formatted found]) 58 AC_MSG_WARN([no manpage formatted found])
70 MANFMT="false" 59 MANFMT="false"
71fi 60fi
72AC_SUBST(MANFMT) 61AC_SUBST([MANFMT])
73 62
74dnl for buildpkg.sh 63dnl for buildpkg.sh
75AC_PATH_PROG(PATH_GROUPADD_PROG, groupadd, groupadd, 64AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd],
76 [/usr/sbin${PATH_SEPARATOR}/etc]) 65 [/usr/sbin${PATH_SEPARATOR}/etc])
77AC_PATH_PROG(PATH_USERADD_PROG, useradd, useradd, 66AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd],
78 [/usr/sbin${PATH_SEPARATOR}/etc]) 67 [/usr/sbin${PATH_SEPARATOR}/etc])
79AC_CHECK_PROG(MAKE_PACKAGE_SUPPORTED, pkgmk, yes, no) 68AC_CHECK_PROG([MAKE_PACKAGE_SUPPORTED], [pkgmk], [yes], [no])
80if test -x /sbin/sh; then 69if test -x /sbin/sh; then
81 AC_SUBST(STARTUP_SCRIPT_SHELL,/sbin/sh) 70 AC_SUBST([STARTUP_SCRIPT_SHELL], [/sbin/sh])
82else 71else
83 AC_SUBST(STARTUP_SCRIPT_SHELL,/bin/sh) 72 AC_SUBST([STARTUP_SCRIPT_SHELL], [/bin/sh])
84fi 73fi
85 74
86# System features 75# System features
@@ -92,34 +81,44 @@ fi
92 81
93# Use LOGIN_PROGRAM from environment if possible 82# Use LOGIN_PROGRAM from environment if possible
94if test ! -z "$LOGIN_PROGRAM" ; then 83if test ! -z "$LOGIN_PROGRAM" ; then
95 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM", 84 AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM"],
96 [If your header files don't define LOGIN_PROGRAM, 85 [If your header files don't define LOGIN_PROGRAM,
97 then use this (detected) from environment and PATH]) 86 then use this (detected) from environment and PATH])
98else 87else
99 # Search for login 88 # Search for login
100 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) 89 AC_PATH_PROG([LOGIN_PROGRAM_FALLBACK], [login])
101 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then 90 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
102 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") 91 AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM_FALLBACK"])
103 fi 92 fi
104fi 93fi
105 94
106AC_PATH_PROG(PATH_PASSWD_PROG, passwd) 95AC_PATH_PROG([PATH_PASSWD_PROG], [passwd])
107if test ! -z "$PATH_PASSWD_PROG" ; then 96if test ! -z "$PATH_PASSWD_PROG" ; then
108 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG", 97 AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"],
109 [Full path of your "passwd" program]) 98 [Full path of your "passwd" program])
110fi 99fi
111 100
112if test -z "$LD" ; then 101if test -z "$LD" ; then
113 LD=$CC 102 LD=$CC
114fi 103fi
115AC_SUBST(LD) 104AC_SUBST([LD])
116 105
117AC_C_INLINE 106AC_C_INLINE
118 107
119AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>]) 108AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>])
109AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [
110 #include <sys/types.h>
111 #include <sys/param.h>
112 #include <dev/systrace.h>
113])
114AC_CHECK_DECL([RLIMIT_NPROC],
115 [AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [
116 #include <sys/types.h>
117 #include <sys/resource.h>
118])
120 119
121use_stack_protector=1 120use_stack_protector=1
122AC_ARG_WITH(stackprotect, 121AC_ARG_WITH([stackprotect],
123 [ --without-stackprotect Don't use compiler's stack protection], [ 122 [ --without-stackprotect Don't use compiler's stack protection], [
124 if test "x$withval" = "xno"; then 123 if test "x$withval" = "xno"; then
125 use_stack_protector=0 124 use_stack_protector=0
@@ -127,15 +126,15 @@ AC_ARG_WITH(stackprotect,
127 126
128 127
129if test "$GCC" = "yes" || test "$GCC" = "egcs"; then 128if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
130 OPENSSH_CHECK_CFLAG_COMPILE([-Wall]) 129 OSSH_CHECK_CFLAG_COMPILE([-Wall])
131 OPENSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) 130 OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith])
132 OPENSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) 131 OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized])
133 OPENSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) 132 OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare])
134 OPENSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) 133 OSSH_CHECK_CFLAG_COMPILE([-Wformat-security])
135 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-pointer-sign]) 134 OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign])
136 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-unused-result]) 135 OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result])
137 OPENSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) 136 OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing])
138 AC_MSG_CHECKING(gcc version) 137 AC_MSG_CHECKING([gcc version])
139 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` 138 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
140 case $GCC_VER in 139 case $GCC_VER in
141 1.*) no_attrib_nonnull=1 ;; 140 1.*) no_attrib_nonnull=1 ;;
@@ -145,52 +144,52 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
145 2.*) no_attrib_nonnull=1 ;; 144 2.*) no_attrib_nonnull=1 ;;
146 *) ;; 145 *) ;;
147 esac 146 esac
148 AC_MSG_RESULT($GCC_VER) 147 AC_MSG_RESULT([$GCC_VER])
149 148
150 AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset) 149 AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset])
151 saved_CFLAGS="$CFLAGS" 150 saved_CFLAGS="$CFLAGS"
152 CFLAGS="$CFLAGS -fno-builtin-memset" 151 CFLAGS="$CFLAGS -fno-builtin-memset"
153 AC_LINK_IFELSE( [AC_LANG_SOURCE([[ 152 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]],
154#include <string.h> 153 [[ char b[10]; memset(b, 0, sizeof(b)); ]])],
155int main(void){char b[10]; memset(b, 0, sizeof(b));} 154 [ AC_MSG_RESULT([yes]) ],
156 ]])], 155 [ AC_MSG_RESULT([no])
157 [ AC_MSG_RESULT(yes) ],
158 [ AC_MSG_RESULT(no)
159 CFLAGS="$saved_CFLAGS" ] 156 CFLAGS="$saved_CFLAGS" ]
160) 157 )
161 158
162 # -fstack-protector-all doesn't always work for some GCC versions 159 # -fstack-protector-all doesn't always work for some GCC versions
163 # and/or platforms, so we test if we can. If it's not supported 160 # and/or platforms, so we test if we can. If it's not supported
164 # on a given platform gcc will emit a warning so we use -Werror. 161 # on a given platform gcc will emit a warning so we use -Werror.
165 if test "x$use_stack_protector" = "x1"; then 162 if test "x$use_stack_protector" = "x1"; then
166 for t in -fstack-protector-all -fstack-protector; do 163 for t in -fstack-protector-all -fstack-protector; do
167 AC_MSG_CHECKING(if $CC supports $t) 164 AC_MSG_CHECKING([if $CC supports $t])
168 saved_CFLAGS="$CFLAGS" 165 saved_CFLAGS="$CFLAGS"
169 saved_LDFLAGS="$LDFLAGS" 166 saved_LDFLAGS="$LDFLAGS"
170 CFLAGS="$CFLAGS $t -Werror" 167 CFLAGS="$CFLAGS $t -Werror"
171 LDFLAGS="$LDFLAGS $t -Werror" 168 LDFLAGS="$LDFLAGS $t -Werror"
172 AC_LINK_IFELSE( 169 AC_LINK_IFELSE(
173 [AC_LANG_SOURCE([ 170 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
174#include <stdio.h> 171 [[
175int main(void){char x[[256]]; snprintf(x, sizeof(x), "XXX"); return 0;} 172 char x[256];
176 ])], 173 snprintf(x, sizeof(x), "XXX");
177 [ AC_MSG_RESULT(yes) 174 ]])],
175 [ AC_MSG_RESULT([yes])
178 CFLAGS="$saved_CFLAGS $t" 176 CFLAGS="$saved_CFLAGS $t"
179 LDFLAGS="$saved_LDFLAGS $t" 177 LDFLAGS="$saved_LDFLAGS $t"
180 AC_MSG_CHECKING(if $t works) 178 AC_MSG_CHECKING([if $t works])
181 AC_RUN_IFELSE( 179 AC_RUN_IFELSE(
182 [AC_LANG_SOURCE([ 180 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
183#include <stdio.h> 181 [[
184int main(void){char x[[256]]; snprintf(x, sizeof(x), "XXX"); return 0;} 182 char x[256];
185 ])], 183 snprintf(x, sizeof(x), "XXX");
186 [ AC_MSG_RESULT(yes) 184 ]])],
185 [ AC_MSG_RESULT([yes])
187 break ], 186 break ],
188 [ AC_MSG_RESULT(no) ], 187 [ AC_MSG_RESULT([no]) ],
189 [ AC_MSG_WARN([cross compiling: cannot test]) 188 [ AC_MSG_WARN([cross compiling: cannot test])
190 break ] 189 break ]
191 ) 190 )
192 ], 191 ],
193 [ AC_MSG_RESULT(no) ] 192 [ AC_MSG_RESULT([no]) ]
194 ) 193 )
195 CFLAGS="$saved_CFLAGS" 194 CFLAGS="$saved_CFLAGS"
196 LDFLAGS="$saved_LDFLAGS" 195 LDFLAGS="$saved_LDFLAGS"
@@ -202,7 +201,7 @@ int main(void){char x[[256]]; snprintf(x, sizeof(x), "XXX"); return 0;}
202 unset ac_cv_have_decl_LLONG_MAX 201 unset ac_cv_have_decl_LLONG_MAX
203 saved_CFLAGS="$CFLAGS" 202 saved_CFLAGS="$CFLAGS"
204 CFLAGS="$CFLAGS -std=gnu99" 203 CFLAGS="$CFLAGS -std=gnu99"
205 AC_CHECK_DECL(LLONG_MAX, 204 AC_CHECK_DECL([LLONG_MAX],
206 [have_llong_max=1], 205 [have_llong_max=1],
207 [CFLAGS="$saved_CFLAGS"], 206 [CFLAGS="$saved_CFLAGS"],
208 [#include <limits.h>] 207 [#include <limits.h>]
@@ -211,10 +210,10 @@ int main(void){char x[[256]]; snprintf(x, sizeof(x), "XXX"); return 0;}
211fi 210fi
212 211
213if test "x$no_attrib_nonnull" != "x1" ; then 212if test "x$no_attrib_nonnull" != "x1" ; then
214 AC_DEFINE(HAVE_ATTRIBUTE__NONNULL__, 1, [Have attribute nonnull]) 213 AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull])
215fi 214fi
216 215
217AC_ARG_WITH(rpath, 216AC_ARG_WITH([rpath],
218 [ --without-rpath Disable auto-added -R linker paths], 217 [ --without-rpath Disable auto-added -R linker paths],
219 [ 218 [
220 if test "x$withval" = "xno" ; then 219 if test "x$withval" = "xno" ; then
@@ -227,7 +226,7 @@ AC_ARG_WITH(rpath,
227) 226)
228 227
229# Allow user to specify flags 228# Allow user to specify flags
230AC_ARG_WITH(cflags, 229AC_ARG_WITH([cflags],
231 [ --with-cflags Specify additional flags to pass to compiler], 230 [ --with-cflags Specify additional flags to pass to compiler],
232 [ 231 [
233 if test -n "$withval" && test "x$withval" != "xno" && \ 232 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -236,7 +235,7 @@ AC_ARG_WITH(cflags,
236 fi 235 fi
237 ] 236 ]
238) 237)
239AC_ARG_WITH(cppflags, 238AC_ARG_WITH([cppflags],
240 [ --with-cppflags Specify additional flags to pass to preprocessor] , 239 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
241 [ 240 [
242 if test -n "$withval" && test "x$withval" != "xno" && \ 241 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -245,7 +244,7 @@ AC_ARG_WITH(cppflags,
245 fi 244 fi
246 ] 245 ]
247) 246)
248AC_ARG_WITH(ldflags, 247AC_ARG_WITH([ldflags],
249 [ --with-ldflags Specify additional flags to pass to linker], 248 [ --with-ldflags Specify additional flags to pass to linker],
250 [ 249 [
251 if test -n "$withval" && test "x$withval" != "xno" && \ 250 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -254,7 +253,7 @@ AC_ARG_WITH(ldflags,
254 fi 253 fi
255 ] 254 ]
256) 255)
257AC_ARG_WITH(libs, 256AC_ARG_WITH([libs],
258 [ --with-libs Specify additional libraries to link with], 257 [ --with-libs Specify additional libraries to link with],
259 [ 258 [
260 if test -n "$withval" && test "x$withval" != "xno" && \ 259 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -263,7 +262,7 @@ AC_ARG_WITH(libs,
263 fi 262 fi
264 ] 263 ]
265) 264)
266AC_ARG_WITH(Werror, 265AC_ARG_WITH([Werror],
267 [ --with-Werror Build main code with -Werror], 266 [ --with-Werror Build main code with -Werror],
268 [ 267 [
269 if test -n "$withval" && test "x$withval" != "xno"; then 268 if test -n "$withval" && test "x$withval" != "xno"; then
@@ -275,7 +274,7 @@ AC_ARG_WITH(Werror,
275 ] 274 ]
276) 275)
277 276
278AC_CHECK_HEADERS( \ 277AC_CHECK_HEADERS([ \
279 bstring.h \ 278 bstring.h \
280 crypt.h \ 279 crypt.h \
281 crypto/sha2.h \ 280 crypto/sha2.h \
@@ -339,29 +338,29 @@ AC_CHECK_HEADERS( \
339 utmp.h \ 338 utmp.h \
340 utmpx.h \ 339 utmpx.h \
341 vis.h \ 340 vis.h \
342) 341])
343 342
344# lastlog.h requires sys/time.h to be included first on Solaris 343# lastlog.h requires sys/time.h to be included first on Solaris
345AC_CHECK_HEADERS(lastlog.h, [], [], [ 344AC_CHECK_HEADERS([lastlog.h], [], [], [
346#ifdef HAVE_SYS_TIME_H 345#ifdef HAVE_SYS_TIME_H
347# include <sys/time.h> 346# include <sys/time.h>
348#endif 347#endif
349]) 348])
350 349
351# sys/ptms.h requires sys/stream.h to be included first on Solaris 350# sys/ptms.h requires sys/stream.h to be included first on Solaris
352AC_CHECK_HEADERS(sys/ptms.h, [], [], [ 351AC_CHECK_HEADERS([sys/ptms.h], [], [], [
353#ifdef HAVE_SYS_STREAM_H 352#ifdef HAVE_SYS_STREAM_H
354# include <sys/stream.h> 353# include <sys/stream.h>
355#endif 354#endif
356]) 355])
357 356
358# login_cap.h requires sys/types.h on NetBSD 357# login_cap.h requires sys/types.h on NetBSD
359AC_CHECK_HEADERS(login_cap.h, [], [], [ 358AC_CHECK_HEADERS([login_cap.h], [], [], [
360#include <sys/types.h> 359#include <sys/types.h>
361]) 360])
362 361
363# older BSDs need sys/param.h before sys/mount.h 362# older BSDs need sys/param.h before sys/mount.h
364AC_CHECK_HEADERS(sys/mount.h, [], [], [ 363AC_CHECK_HEADERS([sys/mount.h], [], [], [
365#include <sys/param.h> 364#include <sys/param.h>
366]) 365])
367 366
@@ -378,15 +377,14 @@ case "$host" in
378 # particularly with older versions of vac or xlc. 377 # particularly with older versions of vac or xlc.
379 # It also throws errors about null macro argments, but these are 378 # It also throws errors about null macro argments, but these are
380 # not fatal. 379 # not fatal.
381 AC_MSG_CHECKING(if compiler allows macro redefinitions) 380 AC_MSG_CHECKING([if compiler allows macro redefinitions])
382 AC_COMPILE_IFELSE( 381 AC_COMPILE_IFELSE(
383 [AC_LANG_SOURCE([[ 382 [AC_LANG_PROGRAM([[
384#define testmacro foo 383#define testmacro foo
385#define testmacro bar 384#define testmacro bar]],
386int main(void) { exit(0); } 385 [[ exit(0); ]])],
387 ]])], 386 [ AC_MSG_RESULT([yes]) ],
388 [ AC_MSG_RESULT(yes) ], 387 [ AC_MSG_RESULT([no])
389 [ AC_MSG_RESULT(no)
390 CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`" 388 CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
391 LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`" 389 LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`"
392 CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`" 390 CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`"
@@ -407,21 +405,22 @@ int main(void) { exit(0); }
407 for tryflags in $flags ;do 405 for tryflags in $flags ;do
408 if (test -z "$blibflags"); then 406 if (test -z "$blibflags"); then
409 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" 407 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
410 AC_TRY_LINK([], [], [blibflags=$tryflags]) 408 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
409 [blibflags=$tryflags], [])
411 fi 410 fi
412 done 411 done
413 if (test -z "$blibflags"); then 412 if (test -z "$blibflags"); then
414 AC_MSG_RESULT(not found) 413 AC_MSG_RESULT([not found])
415 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log]) 414 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
416 else 415 else
417 AC_MSG_RESULT($blibflags) 416 AC_MSG_RESULT([$blibflags])
418 fi 417 fi
419 LDFLAGS="$saved_LDFLAGS" 418 LDFLAGS="$saved_LDFLAGS"
420 dnl Check for authenticate. Might be in libs.a on older AIXes 419 dnl Check for authenticate. Might be in libs.a on older AIXes
421 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE, 1, 420 AC_CHECK_FUNC([authenticate], [AC_DEFINE([WITH_AIXAUTHENTICATE], [1],
422 [Define if you want to enable AIX4's authenticate function])], 421 [Define if you want to enable AIX4's authenticate function])],
423 [AC_CHECK_LIB(s,authenticate, 422 [AC_CHECK_LIB([s], [authenticate],
424 [ AC_DEFINE(WITH_AIXAUTHENTICATE) 423 [ AC_DEFINE([WITH_AIXAUTHENTICATE])
425 LIBS="$LIBS -ls" 424 LIBS="$LIBS -ls"
426 ]) 425 ])
427 ]) 426 ])
@@ -429,147 +428,154 @@ int main(void) { exit(0); }
429 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, 428 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
430 passwdexpired, setauthdb], , , [#include <usersec.h>]) 429 passwdexpired, setauthdb], , , [#include <usersec.h>])
431 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) 430 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
432 AC_CHECK_DECLS(loginfailed, 431 AC_CHECK_DECLS([loginfailed],
433 [AC_MSG_CHECKING(if loginfailed takes 4 arguments) 432 [AC_MSG_CHECKING([if loginfailed takes 4 arguments])
434 AC_TRY_COMPILE( 433 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <usersec.h> ]],
435 [#include <usersec.h>], 434 [[ (void)loginfailed("user","host","tty",0); ]])],
436 [(void)loginfailed("user","host","tty",0);], 435 [AC_MSG_RESULT([yes])
437 [AC_MSG_RESULT(yes) 436 AC_DEFINE([AIX_LOGINFAILED_4ARG], [1],
438 AC_DEFINE(AIX_LOGINFAILED_4ARG, 1, 437 [Define if your AIX loginfailed() function
439 [Define if your AIX loginfailed() function 438 takes 4 arguments (AIX >= 5.2)])], [AC_MSG_RESULT([no])
440 takes 4 arguments (AIX >= 5.2)])], 439 ])],
441 [AC_MSG_RESULT(no)] 440 [],
442 )], 441 [#include <usersec.h>]
443 [],
444 [#include <usersec.h>]
445 ) 442 )
446 AC_CHECK_FUNCS(getgrset setauthdb) 443 AC_CHECK_FUNCS([getgrset setauthdb])
447 AC_CHECK_DECL(F_CLOSEM, 444 AC_CHECK_DECL([F_CLOSEM],
448 AC_DEFINE(HAVE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]), 445 AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]),
449 [], 446 [],
450 [ #include <limits.h> 447 [ #include <limits.h>
451 #include <fcntl.h> ] 448 #include <fcntl.h> ]
452 ) 449 )
453 check_for_aix_broken_getaddrinfo=1 450 check_for_aix_broken_getaddrinfo=1
454 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.]) 451 AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.])
455 AC_DEFINE(SETEUID_BREAKS_SETUID, 1, 452 AC_DEFINE([SETEUID_BREAKS_SETUID], [1],
456 [Define if your platform breaks doing a seteuid before a setuid]) 453 [Define if your platform breaks doing a seteuid before a setuid])
457 AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken]) 454 AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken])
458 AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken]) 455 AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken])
459 dnl AIX handles lastlog as part of its login message 456 dnl AIX handles lastlog as part of its login message
460 AC_DEFINE(DISABLE_LASTLOG, 1, [Define if you don't want to use lastlog]) 457 AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog])
461 AC_DEFINE(LOGIN_NEEDS_UTMPX, 1, 458 AC_DEFINE([LOGIN_NEEDS_UTMPX], [1],
462 [Some systems need a utmpx entry for /bin/login to work]) 459 [Some systems need a utmpx entry for /bin/login to work])
463 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV, 460 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV],
464 [Define to a Set Process Title type if your system is 461 [Define to a Set Process Title type if your system is
465 supported by bsd-setproctitle.c]) 462 supported by bsd-setproctitle.c])
466 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1, 463 AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1],
467 [AIX 5.2 and 5.3 (and presumably newer) require this]) 464 [AIX 5.2 and 5.3 (and presumably newer) require this])
468 AC_DEFINE(PTY_ZEROREAD, 1, [read(1) can return 0 for a non-closed fd]) 465 AC_DEFINE([PTY_ZEROREAD], [1], [read(1) can return 0 for a non-closed fd])
469 ;; 466 ;;
470*-*-cygwin*) 467*-*-cygwin*)
471 check_for_libcrypt_later=1 468 check_for_libcrypt_later=1
472 LIBS="$LIBS /usr/lib/textreadmode.o" 469 LIBS="$LIBS /usr/lib/textreadmode.o"
473 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin]) 470 AC_DEFINE([HAVE_CYGWIN], [1], [Define if you are on Cygwin])
474 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()]) 471 AC_DEFINE([USE_PIPES], [1], [Use PIPES instead of a socketpair()])
475 AC_DEFINE(DISABLE_SHADOW, 1, 472 AC_DEFINE([DISABLE_SHADOW], [1],
476 [Define if you want to disable shadow passwords]) 473 [Define if you want to disable shadow passwords])
477 AC_DEFINE(NO_X11_UNIX_SOCKETS, 1, 474 AC_DEFINE([NO_X11_UNIX_SOCKETS], [1],
478 [Define if X11 doesn't support AF_UNIX sockets on that system]) 475 [Define if X11 doesn't support AF_UNIX sockets on that system])
479 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT, 1, 476 AC_DEFINE([NO_IPPORT_RESERVED_CONCEPT], [1],
480 [Define if the concept of ports only accessible to 477 [Define if the concept of ports only accessible to
481 superusers isn't known]) 478 superusers isn't known])
482 AC_DEFINE(DISABLE_FD_PASSING, 1, 479 AC_DEFINE([DISABLE_FD_PASSING], [1],
483 [Define if your platform needs to skip post auth 480 [Define if your platform needs to skip post auth
484 file descriptor passing]) 481 file descriptor passing])
485 AC_DEFINE(SSH_IOBUFSZ, 65535, [Windows is sensitive to read buffer size]) 482 AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size])
486 AC_DEFINE(FILESYSTEM_NO_BACKSLASH, 1, [File names may not contain backslash characters]) 483 AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters])
487 ;; 484 ;;
488*-*-dgux*) 485*-*-dgux*)
489 AC_DEFINE(IP_TOS_IS_BROKEN, 1, 486 AC_DEFINE([IP_TOS_IS_BROKEN], [1],
490 [Define if your system choked on IP TOS setting]) 487 [Define if your system choked on IP TOS setting])
491 AC_DEFINE(SETEUID_BREAKS_SETUID) 488 AC_DEFINE([SETEUID_BREAKS_SETUID])
492 AC_DEFINE(BROKEN_SETREUID) 489 AC_DEFINE([BROKEN_SETREUID])
493 AC_DEFINE(BROKEN_SETREGID) 490 AC_DEFINE([BROKEN_SETREGID])
494 ;; 491 ;;
495*-*-darwin*) 492*-*-darwin*)
496 AC_MSG_CHECKING(if we have working getaddrinfo) 493 AC_MSG_CHECKING([if we have working getaddrinfo])
497 AC_TRY_RUN([#include <mach-o/dyld.h> 494 AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h>
498main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) 495main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
499 exit(0); 496 exit(0);
500 else 497 else
501 exit(1); 498 exit(1);
502}], [AC_MSG_RESULT(working)], 499}
503 [AC_MSG_RESULT(buggy) 500 ]])],
504 AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])], 501 [AC_MSG_RESULT([working])],
505 [AC_MSG_RESULT(assume it is working)]) 502 [AC_MSG_RESULT([buggy])
506 AC_DEFINE(SETEUID_BREAKS_SETUID) 503 AC_DEFINE([BROKEN_GETADDRINFO], [1],
507 AC_DEFINE(BROKEN_SETREUID) 504 [getaddrinfo is broken (if present)])
508 AC_DEFINE(BROKEN_SETREGID) 505 ],
509 AC_DEFINE(BROKEN_GLOB, 1, [OS X glob does not do what we expect]) 506 [AC_MSG_RESULT([assume it is working])])
510 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1, 507 AC_DEFINE([SETEUID_BREAKS_SETUID])
508 AC_DEFINE([BROKEN_SETREUID])
509 AC_DEFINE([BROKEN_SETREGID])
510 AC_DEFINE([BROKEN_GLOB], [1], [OS X glob does not do what we expect])
511 AC_DEFINE_UNQUOTED([BIND_8_COMPAT], [1],
511 [Define if your resolver libs need this for getrrsetbyname]) 512 [Define if your resolver libs need this for getrrsetbyname])
512 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) 513 AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
513 AC_DEFINE(SSH_TUN_COMPAT_AF, 1, 514 AC_DEFINE([SSH_TUN_COMPAT_AF], [1],
514 [Use tunnel device compatibility to OpenBSD]) 515 [Use tunnel device compatibility to OpenBSD])
515 AC_DEFINE(SSH_TUN_PREPEND_AF, 1, 516 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
516 [Prepend the address family to IP tunnel traffic]) 517 [Prepend the address family to IP tunnel traffic])
517 AC_MSG_CHECKING(if we have the Security Authorization Session API) 518 AC_MSG_CHECKING([if we have the Security Authorization Session API])
518 AC_TRY_COMPILE([#include <Security/AuthSession.h>], 519 AC_TRY_COMPILE([#include <Security/AuthSession.h>],
519 [SessionCreate(0, 0);], 520 [SessionCreate(0, 0);],
520 [ac_cv_use_security_session_api="yes" 521 [ac_cv_use_security_session_api="yes"
521 AC_DEFINE(USE_SECURITY_SESSION_API, 1, 522 AC_DEFINE([USE_SECURITY_SESSION_API], [1],
522 [platform has the Security Authorization Session API]) 523 [platform has the Security Authorization Session API])
523 LIBS="$LIBS -framework Security" 524 LIBS="$LIBS -framework Security"
524 AC_MSG_RESULT(yes)], 525 AC_MSG_RESULT([yes])],
525 [ac_cv_use_security_session_api="no" 526 [ac_cv_use_security_session_api="no"
526 AC_MSG_RESULT(no)]) 527 AC_MSG_RESULT([no])])
527 AC_MSG_CHECKING(if we have an in-memory credentials cache) 528 AC_MSG_CHECKING([if we have an in-memory credentials cache])
528 AC_TRY_COMPILE( 529 AC_TRY_COMPILE(
529 [#include <Kerberos/Kerberos.h>], 530 [#include <Kerberos/Kerberos.h>],
530 [cc_context_t c; 531 [cc_context_t c;
531 (void) cc_initialize (&c, 0, NULL, NULL);], 532 (void) cc_initialize (&c, 0, NULL, NULL);],
532 [AC_DEFINE(USE_CCAPI, 1, 533 [AC_DEFINE([USE_CCAPI], [1],
533 [platform uses an in-memory credentials cache]) 534 [platform uses an in-memory credentials cache])
534 LIBS="$LIBS -framework Security" 535 LIBS="$LIBS -framework Security"
535 AC_MSG_RESULT(yes) 536 AC_MSG_RESULT([yes])
536 if test "x$ac_cv_use_security_session_api" = "xno"; then 537 if test "x$ac_cv_use_security_session_api" = "xno"; then
537 AC_MSG_ERROR(*** Need a security framework to use the credentials cache API ***) 538 AC_MSG_ERROR([*** Need a security framework to use the credentials cache API ***])
538 fi], 539 fi],
539 [AC_MSG_RESULT(no)] 540 [AC_MSG_RESULT([no])]
540 ) 541 )
541 m4_pattern_allow(AU_IPv) 542 m4_pattern_allow([AU_IPv])
542 AC_CHECK_DECL(AU_IPv4, [], 543 AC_CHECK_DECL([AU_IPv4], [],
543 AC_DEFINE(AU_IPv4, 0, [System only supports IPv4 audit records]) 544 AC_DEFINE([AU_IPv4], [0], [System only supports IPv4 audit records])
544 [#include <bsm/audit.h>] 545 [#include <bsm/audit.h>]
545 AC_DEFINE(LASTLOG_WRITE_PUTUTXLINE, 1, 546 AC_DEFINE([LASTLOG_WRITE_PUTUTXLINE], [1],
546 [Define if pututxline updates lastlog too]) 547 [Define if pututxline updates lastlog too])
547 ) 548 )
549 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV],
550 [Define to a Set Process Title type if your system is
551 supported by bsd-setproctitle.c])
552 AC_CHECK_FUNCS([sandbox_init])
553 AC_CHECK_HEADERS([sandbox.h])
548 ;; 554 ;;
549*-*-dragonfly*) 555*-*-dragonfly*)
550 SSHDLIBS="$SSHDLIBS -lcrypt" 556 SSHDLIBS="$SSHDLIBS -lcrypt"
551 ;; 557 ;;
552*-*-haiku*) 558*-*-haiku*)
553 LIBS="$LIBS -lbsd " 559 LIBS="$LIBS -lbsd "
554 AC_CHECK_LIB(network, socket) 560 AC_CHECK_LIB([network], [socket])
555 AC_DEFINE(HAVE_U_INT64_T) 561 AC_DEFINE([HAVE_U_INT64_T])
556 MANTYPE=man 562 MANTYPE=man
557 ;; 563 ;;
558*-*-hpux*) 564*-*-hpux*)
559 # first we define all of the options common to all HP-UX releases 565 # first we define all of the options common to all HP-UX releases
560 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" 566 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
561 IPADDR_IN_DISPLAY=yes 567 IPADDR_IN_DISPLAY=yes
562 AC_DEFINE(USE_PIPES) 568 AC_DEFINE([USE_PIPES])
563 AC_DEFINE(LOGIN_NO_ENDOPT, 1, 569 AC_DEFINE([LOGIN_NO_ENDOPT], [1],
564 [Define if your login program cannot handle end of options ("--")]) 570 [Define if your login program cannot handle end of options ("--")])
565 AC_DEFINE(LOGIN_NEEDS_UTMPX) 571 AC_DEFINE([LOGIN_NEEDS_UTMPX])
566 AC_DEFINE(LOCKED_PASSWD_STRING, "*", 572 AC_DEFINE([LOCKED_PASSWD_STRING], ["*"],
567 [String used in /etc/passwd to denote locked account]) 573 [String used in /etc/passwd to denote locked account])
568 AC_DEFINE(SPT_TYPE,SPT_PSTAT) 574 AC_DEFINE([SPT_TYPE], [SPT_PSTAT])
569 MAIL="/var/mail/username" 575 maildir="/var/mail"
570 LIBS="$LIBS -lsec" 576 LIBS="$LIBS -lsec"
571 AC_CHECK_LIB(xnet, t_error, , 577 AC_CHECK_LIB([xnet], [t_error], ,
572 AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) 578 [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])])
573 579
574 # next, we define all of the options specific to major releases 580 # next, we define all of the options specific to major releases
575 case "$host" in 581 case "$host" in
@@ -579,13 +585,13 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
579 fi 585 fi
580 ;; 586 ;;
581 *-*-hpux11*) 587 *-*-hpux11*)
582 AC_DEFINE(PAM_SUN_CODEBASE, 1, 588 AC_DEFINE([PAM_SUN_CODEBASE], [1],
583 [Define if you are using Solaris-derived PAM which 589 [Define if you are using Solaris-derived PAM which
584 passes pam_messages to the conversation function 590 passes pam_messages to the conversation function
585 with an extra level of indirection]) 591 with an extra level of indirection])
586 AC_DEFINE(DISABLE_UTMP, 1, 592 AC_DEFINE([DISABLE_UTMP], [1],
587 [Define if you don't want to use utmp]) 593 [Define if you don't want to use utmp])
588 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) 594 AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins])
589 check_for_hpux_broken_getaddrinfo=1 595 check_for_hpux_broken_getaddrinfo=1
590 check_for_conflicting_getspnam=1 596 check_for_conflicting_getspnam=1
591 ;; 597 ;;
@@ -594,7 +600,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
594 # lastly, we define options specific to minor releases 600 # lastly, we define options specific to minor releases
595 case "$host" in 601 case "$host" in
596 *-*-hpux10.26) 602 *-*-hpux10.26)
597 AC_DEFINE(HAVE_SECUREWARE, 1, 603 AC_DEFINE([HAVE_SECUREWARE], [1],
598 [Define if you have SecureWare-based 604 [Define if you have SecureWare-based
599 protected password database]) 605 protected password database])
600 disable_ptmx_check=yes 606 disable_ptmx_check=yes
@@ -604,79 +610,79 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
604 ;; 610 ;;
605*-*-irix5*) 611*-*-irix5*)
606 PATH="$PATH:/usr/etc" 612 PATH="$PATH:/usr/etc"
607 AC_DEFINE(BROKEN_INET_NTOA, 1, 613 AC_DEFINE([BROKEN_INET_NTOA], [1],
608 [Define if you system's inet_ntoa is busted 614 [Define if you system's inet_ntoa is busted
609 (e.g. Irix gcc issue)]) 615 (e.g. Irix gcc issue)])
610 AC_DEFINE(SETEUID_BREAKS_SETUID) 616 AC_DEFINE([SETEUID_BREAKS_SETUID])
611 AC_DEFINE(BROKEN_SETREUID) 617 AC_DEFINE([BROKEN_SETREUID])
612 AC_DEFINE(BROKEN_SETREGID) 618 AC_DEFINE([BROKEN_SETREGID])
613 AC_DEFINE(WITH_ABBREV_NO_TTY, 1, 619 AC_DEFINE([WITH_ABBREV_NO_TTY], [1],
614 [Define if you shouldn't strip 'tty' from your 620 [Define if you shouldn't strip 'tty' from your
615 ttyname in [uw]tmp]) 621 ttyname in [uw]tmp])
616 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 622 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
617 ;; 623 ;;
618*-*-irix6*) 624*-*-irix6*)
619 PATH="$PATH:/usr/etc" 625 PATH="$PATH:/usr/etc"
620 AC_DEFINE(WITH_IRIX_ARRAY, 1, 626 AC_DEFINE([WITH_IRIX_ARRAY], [1],
621 [Define if you have/want arrays 627 [Define if you have/want arrays
622 (cluster-wide session managment, not C arrays)]) 628 (cluster-wide session managment, not C arrays)])
623 AC_DEFINE(WITH_IRIX_PROJECT, 1, 629 AC_DEFINE([WITH_IRIX_PROJECT], [1],
624 [Define if you want IRIX project management]) 630 [Define if you want IRIX project management])
625 AC_DEFINE(WITH_IRIX_AUDIT, 1, 631 AC_DEFINE([WITH_IRIX_AUDIT], [1],
626 [Define if you want IRIX audit trails]) 632 [Define if you want IRIX audit trails])
627 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS, 1, 633 AC_CHECK_FUNC([jlimit_startjob], [AC_DEFINE([WITH_IRIX_JOBS], [1],
628 [Define if you want IRIX kernel jobs])]) 634 [Define if you want IRIX kernel jobs])])
629 AC_DEFINE(BROKEN_INET_NTOA) 635 AC_DEFINE([BROKEN_INET_NTOA])
630 AC_DEFINE(SETEUID_BREAKS_SETUID) 636 AC_DEFINE([SETEUID_BREAKS_SETUID])
631 AC_DEFINE(BROKEN_SETREUID) 637 AC_DEFINE([BROKEN_SETREUID])
632 AC_DEFINE(BROKEN_SETREGID) 638 AC_DEFINE([BROKEN_SETREGID])
633 AC_DEFINE(BROKEN_UPDWTMPX, 1, [updwtmpx is broken (if present)]) 639 AC_DEFINE([BROKEN_UPDWTMPX], [1], [updwtmpx is broken (if present)])
634 AC_DEFINE(WITH_ABBREV_NO_TTY) 640 AC_DEFINE([WITH_ABBREV_NO_TTY])
635 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 641 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
636 ;; 642 ;;
637*-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) 643*-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
638 check_for_libcrypt_later=1 644 check_for_libcrypt_later=1
639 AC_DEFINE(PAM_TTY_KLUDGE) 645 AC_DEFINE([PAM_TTY_KLUDGE])
640 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!") 646 AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"])
641 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) 647 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
642 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts]) 648 AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts])
643 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) 649 AC_DEFINE([USE_BTMP], [1], [Use btmp to log bad logins])
644 ;; 650 ;;
645*-*-linux*) 651*-*-linux*)
646 no_dev_ptmx=1 652 no_dev_ptmx=1
647 check_for_libcrypt_later=1 653 check_for_libcrypt_later=1
648 check_for_openpty_ctty_bug=1 654 check_for_openpty_ctty_bug=1
649 AC_DEFINE(PAM_TTY_KLUDGE, 1, 655 AC_DEFINE([PAM_TTY_KLUDGE], [1],
650 [Work around problematic Linux PAM modules handling of PAM_TTY]) 656 [Work around problematic Linux PAM modules handling of PAM_TTY])
651 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!", 657 AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"],
652 [String used in /etc/passwd to denote locked account]) 658 [String used in /etc/passwd to denote locked account])
653 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) 659 AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
654 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM, 660 AC_DEFINE([LINK_OPNOTSUPP_ERRNO], [EPERM],
655 [Define to whatever link() returns for "not supported" 661 [Define to whatever link() returns for "not supported"
656 if it doesn't return EOPNOTSUPP.]) 662 if it doesn't return EOPNOTSUPP.])
657 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts]) 663 AC_DEFINE([_PATH_BTMP], ["/var/log/btmp"], [log for bad login attempts])
658 AC_DEFINE(USE_BTMP) 664 AC_DEFINE([USE_BTMP])
659 AC_DEFINE(LINUX_OOM_ADJUST, 1, [Adjust Linux out-of-memory killer]) 665 AC_DEFINE([LINUX_OOM_ADJUST], [1], [Adjust Linux out-of-memory killer])
660 inet6_default_4in6=yes 666 inet6_default_4in6=yes
661 case `uname -r` in 667 case `uname -r` in
662 1.*|2.0.*) 668 1.*|2.0.*)
663 AC_DEFINE(BROKEN_CMSG_TYPE, 1, 669 AC_DEFINE([BROKEN_CMSG_TYPE], [1],
664 [Define if cmsg_type is not passed correctly]) 670 [Define if cmsg_type is not passed correctly])
665 ;; 671 ;;
666 esac 672 esac
667 # tun(4) forwarding compat code 673 # tun(4) forwarding compat code
668 AC_CHECK_HEADERS(linux/if_tun.h) 674 AC_CHECK_HEADERS([linux/if_tun.h])
669 if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then 675 if test "x$ac_cv_header_linux_if_tun_h" = "xyes" ; then
670 AC_DEFINE(SSH_TUN_LINUX, 1, 676 AC_DEFINE([SSH_TUN_LINUX], [1],
671 [Open tunnel devices the Linux tun/tap way]) 677 [Open tunnel devices the Linux tun/tap way])
672 AC_DEFINE(SSH_TUN_COMPAT_AF, 1, 678 AC_DEFINE([SSH_TUN_COMPAT_AF], [1],
673 [Use tunnel device compatibility to OpenBSD]) 679 [Use tunnel device compatibility to OpenBSD])
674 AC_DEFINE(SSH_TUN_PREPEND_AF, 1, 680 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
675 [Prepend the address family to IP tunnel traffic]) 681 [Prepend the address family to IP tunnel traffic])
676 fi 682 fi
677 ;; 683 ;;
678mips-sony-bsd|mips-sony-newsos4) 684mips-sony-bsd|mips-sony-newsos4)
679 AC_DEFINE(NEED_SETPGRP, 1, [Need setpgrp to acquire controlling tty]) 685 AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to acquire controlling tty])
680 SONY=1 686 SONY=1
681 ;; 687 ;;
682*-*-netbsd*) 688*-*-netbsd*)
@@ -684,91 +690,91 @@ mips-sony-bsd|mips-sony-newsos4)
684 if test "x$withval" != "xno" ; then 690 if test "x$withval" != "xno" ; then
685 need_dash_r=1 691 need_dash_r=1
686 fi 692 fi
687 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) 693 AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
688 AC_CHECK_HEADER([net/if_tap.h], , 694 AC_CHECK_HEADER([net/if_tap.h], ,
689 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support])) 695 AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support]))
690 AC_DEFINE(SSH_TUN_PREPEND_AF, 1, 696 AC_DEFINE([SSH_TUN_PREPEND_AF], [1],
691 [Prepend the address family to IP tunnel traffic]) 697 [Prepend the address family to IP tunnel traffic])
692 ;; 698 ;;
693*-*-freebsd*) 699*-*-freebsd*)
694 check_for_libcrypt_later=1 700 check_for_libcrypt_later=1
695 AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)]) 701 AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)])
696 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way]) 702 AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
697 AC_CHECK_HEADER([net/if_tap.h], , 703 AC_CHECK_HEADER([net/if_tap.h], ,
698 AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support])) 704 AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support]))
699 AC_DEFINE(BROKEN_GLOB, 1, [FreeBSD glob does not do what we need]) 705 AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need])
700 ;; 706 ;;
701*-*-bsdi*) 707*-*-bsdi*)
702 AC_DEFINE(SETEUID_BREAKS_SETUID) 708 AC_DEFINE([SETEUID_BREAKS_SETUID])
703 AC_DEFINE(BROKEN_SETREUID) 709 AC_DEFINE([BROKEN_SETREUID])
704 AC_DEFINE(BROKEN_SETREGID) 710 AC_DEFINE([BROKEN_SETREGID])
705 ;; 711 ;;
706*-next-*) 712*-next-*)
707 conf_lastlog_location="/usr/adm/lastlog" 713 conf_lastlog_location="/usr/adm/lastlog"
708 conf_utmp_location=/etc/utmp 714 conf_utmp_location=/etc/utmp
709 conf_wtmp_location=/usr/adm/wtmp 715 conf_wtmp_location=/usr/adm/wtmp
710 MAIL=/usr/spool/mail 716 maildir=/usr/spool/mail
711 AC_DEFINE(HAVE_NEXT, 1, [Define if you are on NeXT]) 717 AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT])
712 AC_DEFINE(BROKEN_REALPATH) 718 AC_DEFINE([BROKEN_REALPATH])
713 AC_DEFINE(USE_PIPES) 719 AC_DEFINE([USE_PIPES])
714 AC_DEFINE(BROKEN_SAVED_UIDS, 1, [Needed for NeXT]) 720 AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT])
715 ;; 721 ;;
716*-*-openbsd*) 722*-*-openbsd*)
717 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel]) 723 AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel])
718 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded]) 724 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded])
719 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way]) 725 AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way])
720 AC_DEFINE(SYSLOG_R_SAFE_IN_SIGHAND, 1, 726 AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1],
721 [syslog_r function is safe to use in in a signal handler]) 727 [syslog_r function is safe to use in in a signal handler])
722 ;; 728 ;;
723*-*-solaris*) 729*-*-solaris*)
724 if test "x$withval" != "xno" ; then 730 if test "x$withval" != "xno" ; then
725 need_dash_r=1 731 need_dash_r=1
726 fi 732 fi
727 AC_DEFINE(PAM_SUN_CODEBASE) 733 AC_DEFINE([PAM_SUN_CODEBASE])
728 AC_DEFINE(LOGIN_NEEDS_UTMPX) 734 AC_DEFINE([LOGIN_NEEDS_UTMPX])
729 AC_DEFINE(LOGIN_NEEDS_TERM, 1, 735 AC_DEFINE([LOGIN_NEEDS_TERM], [1],
730 [Some versions of /bin/login need the TERM supplied 736 [Some versions of /bin/login need the TERM supplied
731 on the commandline]) 737 on the commandline])
732 AC_DEFINE(PAM_TTY_KLUDGE) 738 AC_DEFINE([PAM_TTY_KLUDGE])
733 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1, 739 AC_DEFINE([SSHPAM_CHAUTHTOK_NEEDS_RUID], [1],
734 [Define if pam_chauthtok wants real uid set 740 [Define if pam_chauthtok wants real uid set
735 to the unpriv'ed user]) 741 to the unpriv'ed user])
736 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 742 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
737 # Pushing STREAMS modules will cause sshd to acquire a controlling tty. 743 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
738 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1, 744 AC_DEFINE([SSHD_ACQUIRES_CTTY], [1],
739 [Define if sshd somehow reacquires a controlling TTY 745 [Define if sshd somehow reacquires a controlling TTY
740 after setsid()]) 746 after setsid()])
741 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd 747 AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd
742 in case the name is longer than 8 chars]) 748 in case the name is longer than 8 chars])
743 AC_DEFINE(BROKEN_TCGETATTR_ICANON, 1, [tcgetattr with ICANON may hang]) 749 AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang])
744 external_path_file=/etc/default/login 750 external_path_file=/etc/default/login
745 # hardwire lastlog location (can't detect it on some versions) 751 # hardwire lastlog location (can't detect it on some versions)
746 conf_lastlog_location="/var/adm/lastlog" 752 conf_lastlog_location="/var/adm/lastlog"
747 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) 753 AC_MSG_CHECKING([for obsolete utmp and wtmp in solaris2.x])
748 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` 754 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
749 if test "$sol2ver" -ge 8; then 755 if test "$sol2ver" -ge 8; then
750 AC_MSG_RESULT(yes) 756 AC_MSG_RESULT([yes])
751 AC_DEFINE(DISABLE_UTMP) 757 AC_DEFINE([DISABLE_UTMP])
752 AC_DEFINE(DISABLE_WTMP, 1, 758 AC_DEFINE([DISABLE_WTMP], [1],
753 [Define if you don't want to use wtmp]) 759 [Define if you don't want to use wtmp])
754 else 760 else
755 AC_MSG_RESULT(no) 761 AC_MSG_RESULT([no])
756 fi 762 fi
757 AC_ARG_WITH(solaris-contracts, 763 AC_ARG_WITH([solaris-contracts],
758 [ --with-solaris-contracts Enable Solaris process contracts (experimental)], 764 [ --with-solaris-contracts Enable Solaris process contracts (experimental)],
759 [ 765 [
760 AC_CHECK_LIB(contract, ct_tmpl_activate, 766 AC_CHECK_LIB([contract], [ct_tmpl_activate],
761 [ AC_DEFINE(USE_SOLARIS_PROCESS_CONTRACTS, 1, 767 [ AC_DEFINE([USE_SOLARIS_PROCESS_CONTRACTS], [1],
762 [Define if you have Solaris process contracts]) 768 [Define if you have Solaris process contracts])
763 SSHDLIBS="$SSHDLIBS -lcontract" 769 SSHDLIBS="$SSHDLIBS -lcontract"
764 SPC_MSG="yes" ], ) 770 SPC_MSG="yes" ], )
765 ], 771 ],
766 ) 772 )
767 AC_ARG_WITH(solaris-projects, 773 AC_ARG_WITH([solaris-projects],
768 [ --with-solaris-projects Enable Solaris projects (experimental)], 774 [ --with-solaris-projects Enable Solaris projects (experimental)],
769 [ 775 [
770 AC_CHECK_LIB(project, setproject, 776 AC_CHECK_LIB([project], [setproject],
771 [ AC_DEFINE(USE_SOLARIS_PROJECTS, 1, 777 [ AC_DEFINE([USE_SOLARIS_PROJECTS], [1],
772 [Define if you have Solaris projects]) 778 [Define if you have Solaris projects])
773 SSHDLIBS="$SSHDLIBS -lproject" 779 SSHDLIBS="$SSHDLIBS -lproject"
774 SP_MSG="yes" ], ) 780 SP_MSG="yes" ], )
@@ -777,33 +783,33 @@ mips-sony-bsd|mips-sony-newsos4)
777 ;; 783 ;;
778*-*-sunos4*) 784*-*-sunos4*)
779 CPPFLAGS="$CPPFLAGS -DSUNOS4" 785 CPPFLAGS="$CPPFLAGS -DSUNOS4"
780 AC_CHECK_FUNCS(getpwanam) 786 AC_CHECK_FUNCS([getpwanam])
781 AC_DEFINE(PAM_SUN_CODEBASE) 787 AC_DEFINE([PAM_SUN_CODEBASE])
782 conf_utmp_location=/etc/utmp 788 conf_utmp_location=/etc/utmp
783 conf_wtmp_location=/var/adm/wtmp 789 conf_wtmp_location=/var/adm/wtmp
784 conf_lastlog_location=/var/adm/lastlog 790 conf_lastlog_location=/var/adm/lastlog
785 AC_DEFINE(USE_PIPES) 791 AC_DEFINE([USE_PIPES])
786 ;; 792 ;;
787*-ncr-sysv*) 793*-ncr-sysv*)
788 LIBS="$LIBS -lc89" 794 LIBS="$LIBS -lc89"
789 AC_DEFINE(USE_PIPES) 795 AC_DEFINE([USE_PIPES])
790 AC_DEFINE(SSHD_ACQUIRES_CTTY) 796 AC_DEFINE([SSHD_ACQUIRES_CTTY])
791 AC_DEFINE(SETEUID_BREAKS_SETUID) 797 AC_DEFINE([SETEUID_BREAKS_SETUID])
792 AC_DEFINE(BROKEN_SETREUID) 798 AC_DEFINE([BROKEN_SETREUID])
793 AC_DEFINE(BROKEN_SETREGID) 799 AC_DEFINE([BROKEN_SETREGID])
794 ;; 800 ;;
795*-sni-sysv*) 801*-sni-sysv*)
796 # /usr/ucblib MUST NOT be searched on ReliantUNIX 802 # /usr/ucblib MUST NOT be searched on ReliantUNIX
797 AC_CHECK_LIB(dl, dlsym, ,) 803 AC_CHECK_LIB([dl], [dlsym], ,)
798 # -lresolv needs to be at the end of LIBS or DNS lookups break 804 # -lresolv needs to be at the end of LIBS or DNS lookups break
799 AC_CHECK_LIB(resolv, res_query, [ LIBS="$LIBS -lresolv" ]) 805 AC_CHECK_LIB([resolv], [res_query], [ LIBS="$LIBS -lresolv" ])
800 IPADDR_IN_DISPLAY=yes 806 IPADDR_IN_DISPLAY=yes
801 AC_DEFINE(USE_PIPES) 807 AC_DEFINE([USE_PIPES])
802 AC_DEFINE(IP_TOS_IS_BROKEN) 808 AC_DEFINE([IP_TOS_IS_BROKEN])
803 AC_DEFINE(SETEUID_BREAKS_SETUID) 809 AC_DEFINE([SETEUID_BREAKS_SETUID])
804 AC_DEFINE(BROKEN_SETREUID) 810 AC_DEFINE([BROKEN_SETREUID])
805 AC_DEFINE(BROKEN_SETREGID) 811 AC_DEFINE([BROKEN_SETREGID])
806 AC_DEFINE(SSHD_ACQUIRES_CTTY) 812 AC_DEFINE([SSHD_ACQUIRES_CTTY])
807 external_path_file=/etc/default/login 813 external_path_file=/etc/default/login
808 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX 814 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
809 # Attention: always take care to bind libsocket and libnsl before libc, 815 # Attention: always take care to bind libsocket and libnsl before libc,
@@ -811,36 +817,37 @@ mips-sony-bsd|mips-sony-newsos4)
811 ;; 817 ;;
812# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel. 818# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
813*-*-sysv4.2*) 819*-*-sysv4.2*)
814 AC_DEFINE(USE_PIPES) 820 AC_DEFINE([USE_PIPES])
815 AC_DEFINE(SETEUID_BREAKS_SETUID) 821 AC_DEFINE([SETEUID_BREAKS_SETUID])
816 AC_DEFINE(BROKEN_SETREUID) 822 AC_DEFINE([BROKEN_SETREUID])
817 AC_DEFINE(BROKEN_SETREGID) 823 AC_DEFINE([BROKEN_SETREGID])
818 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) 824 AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd])
819 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 825 AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
820 ;; 826 ;;
821# UnixWare 7.x, OpenUNIX 8 827# UnixWare 7.x, OpenUNIX 8
822*-*-sysv5*) 828*-*-sysv5*)
823 CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf" 829 CPPFLAGS="$CPPFLAGS -Dvsnprintf=_xvsnprintf -Dsnprintf=_xsnprintf"
824 AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) 830 AC_DEFINE([UNIXWARE_LONG_PASSWORDS], [1], [Support passwords > 8 chars])
825 AC_DEFINE(USE_PIPES) 831 AC_DEFINE([USE_PIPES])
826 AC_DEFINE(SETEUID_BREAKS_SETUID) 832 AC_DEFINE([SETEUID_BREAKS_SETUID])
827 AC_DEFINE(BROKEN_GETADDRINFO) 833 AC_DEFINE([BROKEN_GETADDRINFO])
828 AC_DEFINE(BROKEN_SETREUID) 834 AC_DEFINE([BROKEN_SETREUID])
829 AC_DEFINE(BROKEN_SETREGID) 835 AC_DEFINE([BROKEN_SETREGID])
830 AC_DEFINE(PASSWD_NEEDS_USERNAME) 836 AC_DEFINE([PASSWD_NEEDS_USERNAME])
831 case "$host" in 837 case "$host" in
832 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x 838 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
839 maildir=/var/spool/mail
833 TEST_SHELL=/u95/bin/sh 840 TEST_SHELL=/u95/bin/sh
834 AC_DEFINE(BROKEN_LIBIAF, 1, 841 AC_DEFINE([BROKEN_LIBIAF], [1],
835 [ia_uinfo routines not supported by OS yet]) 842 [ia_uinfo routines not supported by OS yet])
836 AC_DEFINE(BROKEN_UPDWTMPX) 843 AC_DEFINE([BROKEN_UPDWTMPX])
837 AC_CHECK_LIB(prot, getluid,[ LIBS="$LIBS -lprot" 844 AC_CHECK_LIB([prot], [getluid], [ LIBS="$LIBS -lprot"
838 AC_CHECK_FUNCS(getluid setluid,,,-lprot) 845 AC_CHECK_FUNCS([getluid setluid], , , [-lprot])
839 AC_DEFINE(HAVE_SECUREWARE) 846 AC_DEFINE([HAVE_SECUREWARE])
840 AC_DEFINE(DISABLE_SHADOW) 847 AC_DEFINE([DISABLE_SHADOW])
841 ],,) 848 ], , )
842 ;; 849 ;;
843 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 850 *) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"])
844 check_for_libcrypt_later=1 851 check_for_libcrypt_later=1
845 ;; 852 ;;
846 esac 853 esac
@@ -858,132 +865,128 @@ mips-sony-bsd|mips-sony-newsos4)
858 fi 865 fi
859 LIBS="$LIBS -lprot -lx -ltinfo -lm" 866 LIBS="$LIBS -lprot -lx -ltinfo -lm"
860 no_dev_ptmx=1 867 no_dev_ptmx=1
861 AC_DEFINE(USE_PIPES) 868 AC_DEFINE([USE_PIPES])
862 AC_DEFINE(HAVE_SECUREWARE) 869 AC_DEFINE([HAVE_SECUREWARE])
863 AC_DEFINE(DISABLE_SHADOW) 870 AC_DEFINE([DISABLE_SHADOW])
864 AC_DEFINE(DISABLE_FD_PASSING) 871 AC_DEFINE([DISABLE_FD_PASSING])
865 AC_DEFINE(SETEUID_BREAKS_SETUID) 872 AC_DEFINE([SETEUID_BREAKS_SETUID])
866 AC_DEFINE(BROKEN_GETADDRINFO) 873 AC_DEFINE([BROKEN_GETADDRINFO])
867 AC_DEFINE(BROKEN_SETREUID) 874 AC_DEFINE([BROKEN_SETREUID])
868 AC_DEFINE(BROKEN_SETREGID) 875 AC_DEFINE([BROKEN_SETREGID])
869 AC_DEFINE(WITH_ABBREV_NO_TTY) 876 AC_DEFINE([WITH_ABBREV_NO_TTY])
870 AC_DEFINE(BROKEN_UPDWTMPX) 877 AC_DEFINE([BROKEN_UPDWTMPX])
871 AC_DEFINE(PASSWD_NEEDS_USERNAME) 878 AC_DEFINE([PASSWD_NEEDS_USERNAME])
872 AC_CHECK_FUNCS(getluid setluid) 879 AC_CHECK_FUNCS([getluid setluid])
873 MANTYPE=man 880 MANTYPE=man
874 TEST_SHELL=ksh 881 TEST_SHELL=ksh
875 ;; 882 ;;
876*-*-unicosmk*) 883*-*-unicosmk*)
877 AC_DEFINE(NO_SSH_LASTLOG, 1, 884 AC_DEFINE([NO_SSH_LASTLOG], [1],
878 [Define if you don't want to use lastlog in session.c]) 885 [Define if you don't want to use lastlog in session.c])
879 AC_DEFINE(SETEUID_BREAKS_SETUID) 886 AC_DEFINE([SETEUID_BREAKS_SETUID])
880 AC_DEFINE(BROKEN_SETREUID) 887 AC_DEFINE([BROKEN_SETREUID])
881 AC_DEFINE(BROKEN_SETREGID) 888 AC_DEFINE([BROKEN_SETREGID])
882 AC_DEFINE(USE_PIPES) 889 AC_DEFINE([USE_PIPES])
883 AC_DEFINE(DISABLE_FD_PASSING) 890 AC_DEFINE([DISABLE_FD_PASSING])
884 LDFLAGS="$LDFLAGS" 891 LDFLAGS="$LDFLAGS"
885 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" 892 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
886 MANTYPE=cat 893 MANTYPE=cat
887 ;; 894 ;;
888*-*-unicosmp*) 895*-*-unicosmp*)
889 AC_DEFINE(SETEUID_BREAKS_SETUID) 896 AC_DEFINE([SETEUID_BREAKS_SETUID])
890 AC_DEFINE(BROKEN_SETREUID) 897 AC_DEFINE([BROKEN_SETREUID])
891 AC_DEFINE(BROKEN_SETREGID) 898 AC_DEFINE([BROKEN_SETREGID])
892 AC_DEFINE(WITH_ABBREV_NO_TTY) 899 AC_DEFINE([WITH_ABBREV_NO_TTY])
893 AC_DEFINE(USE_PIPES) 900 AC_DEFINE([USE_PIPES])
894 AC_DEFINE(DISABLE_FD_PASSING) 901 AC_DEFINE([DISABLE_FD_PASSING])
895 LDFLAGS="$LDFLAGS" 902 LDFLAGS="$LDFLAGS"
896 LIBS="$LIBS -lgen -lacid -ldb" 903 LIBS="$LIBS -lgen -lacid -ldb"
897 MANTYPE=cat 904 MANTYPE=cat
898 ;; 905 ;;
899*-*-unicos*) 906*-*-unicos*)
900 AC_DEFINE(SETEUID_BREAKS_SETUID) 907 AC_DEFINE([SETEUID_BREAKS_SETUID])
901 AC_DEFINE(BROKEN_SETREUID) 908 AC_DEFINE([BROKEN_SETREUID])
902 AC_DEFINE(BROKEN_SETREGID) 909 AC_DEFINE([BROKEN_SETREGID])
903 AC_DEFINE(USE_PIPES) 910 AC_DEFINE([USE_PIPES])
904 AC_DEFINE(DISABLE_FD_PASSING) 911 AC_DEFINE([DISABLE_FD_PASSING])
905 AC_DEFINE(NO_SSH_LASTLOG) 912 AC_DEFINE([NO_SSH_LASTLOG])
906 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" 913 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
907 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" 914 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
908 MANTYPE=cat 915 MANTYPE=cat
909 ;; 916 ;;
910*-dec-osf*) 917*-dec-osf*)
911 AC_MSG_CHECKING(for Digital Unix SIA) 918 AC_MSG_CHECKING([for Digital Unix SIA])
912 no_osfsia="" 919 no_osfsia=""
913 AC_ARG_WITH(osfsia, 920 AC_ARG_WITH([osfsia],
914 [ --with-osfsia Enable Digital Unix SIA], 921 [ --with-osfsia Enable Digital Unix SIA],
915 [ 922 [
916 if test "x$withval" = "xno" ; then 923 if test "x$withval" = "xno" ; then
917 AC_MSG_RESULT(disabled) 924 AC_MSG_RESULT([disabled])
918 no_osfsia=1 925 no_osfsia=1
919 fi 926 fi
920 ], 927 ],
921 ) 928 )
922 if test -z "$no_osfsia" ; then 929 if test -z "$no_osfsia" ; then
923 if test -f /etc/sia/matrix.conf; then 930 if test -f /etc/sia/matrix.conf; then
924 AC_MSG_RESULT(yes) 931 AC_MSG_RESULT([yes])
925 AC_DEFINE(HAVE_OSF_SIA, 1, 932 AC_DEFINE([HAVE_OSF_SIA], [1],
926 [Define if you have Digital Unix Security 933 [Define if you have Digital Unix Security
927 Integration Architecture]) 934 Integration Architecture])
928 AC_DEFINE(DISABLE_LOGIN, 1, 935 AC_DEFINE([DISABLE_LOGIN], [1],
929 [Define if you don't want to use your 936 [Define if you don't want to use your
930 system's login() call]) 937 system's login() call])
931 AC_DEFINE(DISABLE_FD_PASSING) 938 AC_DEFINE([DISABLE_FD_PASSING])
932 LIBS="$LIBS -lsecurity -ldb -lm -laud" 939 LIBS="$LIBS -lsecurity -ldb -lm -laud"
933 SIA_MSG="yes" 940 SIA_MSG="yes"
934 else 941 else
935 AC_MSG_RESULT(no) 942 AC_MSG_RESULT([no])
936 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin", 943 AC_DEFINE([LOCKED_PASSWD_SUBSTR], ["Nologin"],
937 [String used in /etc/passwd to denote locked account]) 944 [String used in /etc/passwd to denote locked account])
938 fi 945 fi
939 fi 946 fi
940 AC_DEFINE(BROKEN_GETADDRINFO) 947 AC_DEFINE([BROKEN_GETADDRINFO])
941 AC_DEFINE(SETEUID_BREAKS_SETUID) 948 AC_DEFINE([SETEUID_BREAKS_SETUID])
942 AC_DEFINE(BROKEN_SETREUID) 949 AC_DEFINE([BROKEN_SETREUID])
943 AC_DEFINE(BROKEN_SETREGID) 950 AC_DEFINE([BROKEN_SETREGID])
944 AC_DEFINE(BROKEN_READV_COMPARISON, 1, [Can't do comparisons on readv]) 951 AC_DEFINE([BROKEN_READV_COMPARISON], [1], [Can't do comparisons on readv])
945 ;; 952 ;;
946 953
947*-*-nto-qnx*) 954*-*-nto-qnx*)
948 AC_DEFINE(USE_PIPES) 955 AC_DEFINE([USE_PIPES])
949 AC_DEFINE(NO_X11_UNIX_SOCKETS) 956 AC_DEFINE([NO_X11_UNIX_SOCKETS])
950 AC_DEFINE(MISSING_NFDBITS, 1, [Define on *nto-qnx systems]) 957 AC_DEFINE([MISSING_NFDBITS], [1], [Define on *nto-qnx systems])
951 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems]) 958 AC_DEFINE([MISSING_HOWMANY], [1], [Define on *nto-qnx systems])
952 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems]) 959 AC_DEFINE([MISSING_FD_MASK], [1], [Define on *nto-qnx systems])
953 AC_DEFINE(DISABLE_LASTLOG) 960 AC_DEFINE([DISABLE_LASTLOG])
954 AC_DEFINE(SSHD_ACQUIRES_CTTY) 961 AC_DEFINE([SSHD_ACQUIRES_CTTY])
955 AC_DEFINE(BROKEN_SHADOW_EXPIRE, 1, [QNX shadow support is broken]) 962 AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken])
956 enable_etc_default_login=no # has incompatible /etc/default/login 963 enable_etc_default_login=no # has incompatible /etc/default/login
957 case "$host" in 964 case "$host" in
958 *-*-nto-qnx6*) 965 *-*-nto-qnx6*)
959 AC_DEFINE(DISABLE_FD_PASSING) 966 AC_DEFINE([DISABLE_FD_PASSING])
960 ;; 967 ;;
961 esac 968 esac
962 ;; 969 ;;
963 970
964*-*-ultrix*) 971*-*-ultrix*)
965 AC_DEFINE(BROKEN_GETGROUPS, 1, [getgroups(0,NULL) will return -1]) 972 AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1])
966 AC_DEFINE(BROKEN_MMAP, 1, [Ultrix mmap can't map files]) 973 AC_DEFINE([BROKEN_MMAP], [1], [Ultrix mmap can't map files])
967 AC_DEFINE(NEED_SETPGRP) 974 AC_DEFINE([NEED_SETPGRP])
968 AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix]) 975 AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix])
969 ;; 976 ;;
970 977
971*-*-lynxos) 978*-*-lynxos)
972 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" 979 CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
973 AC_DEFINE(MISSING_HOWMANY) 980 AC_DEFINE([MISSING_HOWMANY])
974 AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation]) 981 AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation])
975 ;; 982 ;;
976esac 983esac
977 984
978AC_MSG_CHECKING(compiler and flags for sanity) 985AC_MSG_CHECKING([compiler and flags for sanity])
979AC_RUN_IFELSE( 986AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])],
980 [AC_LANG_SOURCE([ 987 [ AC_MSG_RESULT([yes]) ],
981#include <stdio.h>
982int main(){exit(0);}
983 ])],
984 [ AC_MSG_RESULT(yes) ],
985 [ 988 [
986 AC_MSG_RESULT(no) 989 AC_MSG_RESULT([no])
987 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) 990 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
988 ], 991 ],
989 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] 992 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
@@ -991,12 +994,12 @@ int main(){exit(0);}
991 994
992dnl Checks for header files. 995dnl Checks for header files.
993# Checks for libraries. 996# Checks for libraries.
994AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) 997AC_CHECK_FUNC([yp_match], , [AC_CHECK_LIB([nsl], [yp_match])])
995AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) 998AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])])
996 999
997dnl IRIX and Solaris 2.5.1 have dirname() in libgen 1000dnl IRIX and Solaris 2.5.1 have dirname() in libgen
998AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ 1001AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [
999 AC_CHECK_LIB(gen, dirname,[ 1002 AC_CHECK_LIB([gen], [dirname], [
1000 AC_CACHE_CHECK([for broken dirname], 1003 AC_CACHE_CHECK([for broken dirname],
1001 ac_cv_have_broken_dirname, [ 1004 ac_cv_have_broken_dirname, [
1002 save_LIBS="$LIBS" 1005 save_LIBS="$LIBS"
@@ -1026,19 +1029,19 @@ int main(int argc, char **argv) {
1026 ]) 1029 ])
1027 if test "x$ac_cv_have_broken_dirname" = "xno" ; then 1030 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
1028 LIBS="$LIBS -lgen" 1031 LIBS="$LIBS -lgen"
1029 AC_DEFINE(HAVE_DIRNAME) 1032 AC_DEFINE([HAVE_DIRNAME])
1030 AC_CHECK_HEADERS(libgen.h) 1033 AC_CHECK_HEADERS([libgen.h])
1031 fi 1034 fi
1032 ]) 1035 ])
1033]) 1036])
1034 1037
1035AC_CHECK_FUNC(getspnam, , 1038AC_CHECK_FUNC([getspnam], ,
1036 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")) 1039 [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])])
1037AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME, 1, 1040AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1],
1038 [Define if you have the basename function.])) 1041 [Define if you have the basename function.])])
1039 1042
1040dnl zlib is required 1043dnl zlib is required
1041AC_ARG_WITH(zlib, 1044AC_ARG_WITH([zlib],
1042 [ --with-zlib=PATH Use zlib in PATH], 1045 [ --with-zlib=PATH Use zlib in PATH],
1043 [ if test "x$withval" = "xno" ; then 1046 [ if test "x$withval" = "xno" ; then
1044 AC_MSG_ERROR([*** zlib is required ***]) 1047 AC_MSG_ERROR([*** zlib is required ***])
@@ -1064,8 +1067,8 @@ AC_ARG_WITH(zlib,
1064 fi ] 1067 fi ]
1065) 1068)
1066 1069
1067AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])) 1070AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])])
1068AC_CHECK_LIB(z, deflate, , 1071AC_CHECK_LIB([z], [deflate], ,
1069 [ 1072 [
1070 saved_CPPFLAGS="$CPPFLAGS" 1073 saved_CPPFLAGS="$CPPFLAGS"
1071 saved_LDFLAGS="$LDFLAGS" 1074 saved_LDFLAGS="$LDFLAGS"
@@ -1078,7 +1081,7 @@ AC_CHECK_LIB(z, deflate, ,
1078 fi 1081 fi
1079 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" 1082 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
1080 LIBS="$LIBS -lz" 1083 LIBS="$LIBS -lz"
1081 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ), 1084 AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])],
1082 [ 1085 [
1083 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) 1086 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
1084 ] 1087 ]
@@ -1086,7 +1089,7 @@ AC_CHECK_LIB(z, deflate, ,
1086 ] 1089 ]
1087) 1090)
1088 1091
1089AC_ARG_WITH(zlib-version-check, 1092AC_ARG_WITH([zlib-version-check],
1090 [ --without-zlib-version-check Disable zlib version check], 1093 [ --without-zlib-version-check Disable zlib version check],
1091 [ if test "x$withval" = "xno" ; then 1094 [ if test "x$withval" = "xno" ; then
1092 zlib_check_nonfatal=1 1095 zlib_check_nonfatal=1
@@ -1094,12 +1097,12 @@ AC_ARG_WITH(zlib-version-check,
1094 ] 1097 ]
1095) 1098)
1096 1099
1097AC_MSG_CHECKING(for possibly buggy zlib) 1100AC_MSG_CHECKING([for possibly buggy zlib])
1098AC_RUN_IFELSE([AC_LANG_SOURCE([[ 1101AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1099#include <stdio.h> 1102#include <stdio.h>
1100#include <zlib.h> 1103#include <zlib.h>
1101int main() 1104 ]],
1102{ 1105 [[
1103 int a=0, b=0, c=0, d=0, n, v; 1106 int a=0, b=0, c=0, d=0, n, v;
1104 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); 1107 n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
1105 if (n != 3 && n != 4) 1108 if (n != 3 && n != 4)
@@ -1116,10 +1119,9 @@ int main()
1116 exit(0); 1119 exit(0);
1117 1120
1118 exit(2); 1121 exit(2);
1119}
1120 ]])], 1122 ]])],
1121 AC_MSG_RESULT(no), 1123 AC_MSG_RESULT([no]),
1122 [ AC_MSG_RESULT(yes) 1124 [ AC_MSG_RESULT([yes])
1123 if test -z "$zlib_check_nonfatal" ; then 1125 if test -z "$zlib_check_nonfatal" ; then
1124 AC_MSG_ERROR([*** zlib too old - check config.log *** 1126 AC_MSG_ERROR([*** zlib too old - check config.log ***
1125Your reported zlib version has known security problems. It's possible your 1127Your reported zlib version has known security problems. It's possible your
@@ -1136,25 +1138,25 @@ See http://www.gzip.org/zlib/ for details.])
1136) 1138)
1137 1139
1138dnl UnixWare 2.x 1140dnl UnixWare 2.x
1139AC_CHECK_FUNC(strcasecmp, 1141AC_CHECK_FUNC([strcasecmp],
1140 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] 1142 [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ]
1141) 1143)
1142AC_CHECK_FUNCS(utimes, 1144AC_CHECK_FUNCS([utimes],
1143 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES) 1145 [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES])
1144 LIBS="$LIBS -lc89"]) ] 1146 LIBS="$LIBS -lc89"]) ]
1145) 1147)
1146 1148
1147dnl Checks for libutil functions 1149dnl Checks for libutil functions
1148AC_CHECK_HEADERS(libutil.h) 1150AC_CHECK_HEADERS([libutil.h])
1149AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN, 1, 1151AC_SEARCH_LIBS([login], [util bsd], [AC_DEFINE([HAVE_LOGIN], [1],
1150 [Define if your libraries define login()])]) 1152 [Define if your libraries define login()])])
1151AC_CHECK_FUNCS(fmt_scaled logout updwtmp logwtmp) 1153AC_CHECK_FUNCS([fmt_scaled logout updwtmp logwtmp])
1152 1154
1153AC_FUNC_STRFTIME 1155AC_FUNC_STRFTIME
1154 1156
1155# Check for ALTDIRFUNC glob() extension 1157# Check for ALTDIRFUNC glob() extension
1156AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support) 1158AC_MSG_CHECKING([for GLOB_ALTDIRFUNC support])
1157AC_EGREP_CPP(FOUNDIT, 1159AC_EGREP_CPP([FOUNDIT],
1158 [ 1160 [
1159 #include <glob.h> 1161 #include <glob.h>
1160 #ifdef GLOB_ALTDIRFUNC 1162 #ifdef GLOB_ALTDIRFUNC
@@ -1162,87 +1164,83 @@ AC_EGREP_CPP(FOUNDIT,
1162 #endif 1164 #endif
1163 ], 1165 ],
1164 [ 1166 [
1165 AC_DEFINE(GLOB_HAS_ALTDIRFUNC, 1, 1167 AC_DEFINE([GLOB_HAS_ALTDIRFUNC], [1],
1166 [Define if your system glob() function has 1168 [Define if your system glob() function has
1167 the GLOB_ALTDIRFUNC extension]) 1169 the GLOB_ALTDIRFUNC extension])
1168 AC_MSG_RESULT(yes) 1170 AC_MSG_RESULT([yes])
1169 ], 1171 ],
1170 [ 1172 [
1171 AC_MSG_RESULT(no) 1173 AC_MSG_RESULT([no])
1172 ] 1174 ]
1173) 1175)
1174 1176
1175# Check for g.gl_matchc glob() extension 1177# Check for g.gl_matchc glob() extension
1176AC_MSG_CHECKING(for gl_matchc field in glob_t) 1178AC_MSG_CHECKING([for gl_matchc field in glob_t])
1177AC_TRY_COMPILE( 1179AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]],
1178 [ #include <glob.h> ], 1180 [[ glob_t g; g.gl_matchc = 1; ]])],
1179 [glob_t g; g.gl_matchc = 1;],
1180 [ 1181 [
1181 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1, 1182 AC_DEFINE([GLOB_HAS_GL_MATCHC], [1],
1182 [Define if your system glob() function has 1183 [Define if your system glob() function has
1183 gl_matchc options in glob_t]) 1184 gl_matchc options in glob_t])
1184 AC_MSG_RESULT(yes) 1185 AC_MSG_RESULT([yes])
1185 ], 1186 ], [
1186 [ 1187 AC_MSG_RESULT([no])
1187 AC_MSG_RESULT(no) 1188])
1188 ]
1189)
1190 1189
1191# Check for g.gl_statv glob() extension 1190# Check for g.gl_statv glob() extension
1192AC_MSG_CHECKING(for gl_statv and GLOB_KEEPSTAT extensions for glob) 1191AC_MSG_CHECKING([for gl_statv and GLOB_KEEPSTAT extensions for glob])
1193AC_TRY_COMPILE( 1192AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <glob.h> ]], [[
1194 [ #include <glob.h> ],
1195 [
1196#ifndef GLOB_KEEPSTAT 1193#ifndef GLOB_KEEPSTAT
1197#error "glob does not support GLOB_KEEPSTAT extension" 1194#error "glob does not support GLOB_KEEPSTAT extension"
1198#endif 1195#endif
1199glob_t g; 1196glob_t g;
1200g.gl_statv = NULL; 1197g.gl_statv = NULL;
1201], 1198]])],
1202 [ 1199 [
1203 AC_DEFINE(GLOB_HAS_GL_STATV, 1, 1200 AC_DEFINE([GLOB_HAS_GL_STATV], [1],
1204 [Define if your system glob() function has 1201 [Define if your system glob() function has
1205 gl_statv options in glob_t]) 1202 gl_statv options in glob_t])
1206 AC_MSG_RESULT(yes) 1203 AC_MSG_RESULT([yes])
1207 ], 1204 ], [
1208 [ 1205 AC_MSG_RESULT([no])
1209 AC_MSG_RESULT(no) 1206
1210 ] 1207])
1211)
1212 1208
1213AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>]) 1209AC_CHECK_DECLS([GLOB_NOMATCH], , , [#include <glob.h>])
1214 1210
1215AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) 1211AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
1216AC_RUN_IFELSE( 1212AC_RUN_IFELSE(
1217 [AC_LANG_SOURCE([[ 1213 [AC_LANG_PROGRAM([[
1218#include <sys/types.h> 1214#include <sys/types.h>
1219#include <dirent.h> 1215#include <dirent.h>]],
1220int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} 1216 [[
1217 struct dirent d;
1218 exit(sizeof(d.d_name)<=sizeof(char));
1221 ]])], 1219 ]])],
1222 [AC_MSG_RESULT(yes)], 1220 [AC_MSG_RESULT([yes])],
1223 [ 1221 [
1224 AC_MSG_RESULT(no) 1222 AC_MSG_RESULT([no])
1225 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1, 1223 AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1],
1226 [Define if your struct dirent expects you to 1224 [Define if your struct dirent expects you to
1227 allocate extra space for d_name]) 1225 allocate extra space for d_name])
1228 ], 1226 ],
1229 [ 1227 [
1230 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) 1228 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
1231 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) 1229 AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME])
1232 ] 1230 ]
1233) 1231)
1234 1232
1235AC_MSG_CHECKING([for /proc/pid/fd directory]) 1233AC_MSG_CHECKING([for /proc/pid/fd directory])
1236if test -d "/proc/$$/fd" ; then 1234if test -d "/proc/$$/fd" ; then
1237 AC_DEFINE(HAVE_PROC_PID, 1, [Define if you have /proc/$pid/fd]) 1235 AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd])
1238 AC_MSG_RESULT(yes) 1236 AC_MSG_RESULT([yes])
1239else 1237else
1240 AC_MSG_RESULT(no) 1238 AC_MSG_RESULT([no])
1241fi 1239fi
1242 1240
1243# Check whether user wants S/Key support 1241# Check whether user wants S/Key support
1244SKEY_MSG="no" 1242SKEY_MSG="no"
1245AC_ARG_WITH(skey, 1243AC_ARG_WITH([skey],
1246 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)], 1244 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
1247 [ 1245 [
1248 if test "x$withval" != "xno" ; then 1246 if test "x$withval" != "xno" ; then
@@ -1252,40 +1250,46 @@ AC_ARG_WITH(skey,
1252 LDFLAGS="$LDFLAGS -L${withval}/lib" 1250 LDFLAGS="$LDFLAGS -L${withval}/lib"
1253 fi 1251 fi
1254 1252
1255 AC_DEFINE(SKEY, 1, [Define if you want S/Key support]) 1253 AC_DEFINE([SKEY], [1], [Define if you want S/Key support])
1256 LIBS="-lskey $LIBS" 1254 LIBS="-lskey $LIBS"
1257 SKEY_MSG="yes" 1255 SKEY_MSG="yes"
1258 1256
1259 AC_MSG_CHECKING([for s/key support]) 1257 AC_MSG_CHECKING([for s/key support])
1260 AC_LINK_IFELSE( 1258 AC_LINK_IFELSE(
1261 [AC_LANG_SOURCE([[ 1259 [AC_LANG_PROGRAM([[
1262#include <stdio.h> 1260#include <stdio.h>
1263#include <skey.h> 1261#include <skey.h>
1264int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); } 1262 ]], [[
1263 char *ff = skey_keyinfo(""); ff="";
1264 exit(0);
1265 ]])], 1265 ]])],
1266 [AC_MSG_RESULT(yes)], 1266 [AC_MSG_RESULT([yes])],
1267 [ 1267 [
1268 AC_MSG_RESULT(no) 1268 AC_MSG_RESULT([no])
1269 AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) 1269 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
1270 ]) 1270 ])
1271 AC_MSG_CHECKING(if skeychallenge takes 4 arguments) 1271 AC_MSG_CHECKING([if skeychallenge takes 4 arguments])
1272 AC_TRY_COMPILE( 1272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1273 [#include <stdio.h> 1273#include <stdio.h>
1274 #include <skey.h>], 1274#include <skey.h>
1275 [(void)skeychallenge(NULL,"name","",0);], 1275 ]], [[
1276 [AC_MSG_RESULT(yes) 1276 (void)skeychallenge(NULL,"name","",0);
1277 AC_DEFINE(SKEYCHALLENGE_4ARG, 1, 1277 ]])],
1278 [
1279 AC_MSG_RESULT([yes])
1280 AC_DEFINE([SKEYCHALLENGE_4ARG], [1],
1278 [Define if your skeychallenge() 1281 [Define if your skeychallenge()
1279 function takes 4 arguments (NetBSD)])], 1282 function takes 4 arguments (NetBSD)])],
1280 [AC_MSG_RESULT(no)] 1283 [
1281 ) 1284 AC_MSG_RESULT([no])
1285 ])
1282 fi 1286 fi
1283 ] 1287 ]
1284) 1288)
1285 1289
1286# Check whether user wants TCP wrappers support 1290# Check whether user wants TCP wrappers support
1287TCPW_MSG="no" 1291TCPW_MSG="no"
1288AC_ARG_WITH(tcp-wrappers, 1292AC_ARG_WITH([tcp-wrappers],
1289 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)], 1293 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
1290 [ 1294 [
1291 if test "x$withval" != "xno" ; then 1295 if test "x$withval" != "xno" ; then
@@ -1314,28 +1318,26 @@ AC_ARG_WITH(tcp-wrappers,
1314 fi 1318 fi
1315 fi 1319 fi
1316 LIBS="-lwrap $LIBS" 1320 LIBS="-lwrap $LIBS"
1317 AC_MSG_CHECKING(for libwrap) 1321 AC_MSG_CHECKING([for libwrap])
1318 AC_TRY_LINK( 1322 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1319 [
1320#include <sys/types.h> 1323#include <sys/types.h>
1321#include <sys/socket.h> 1324#include <sys/socket.h>
1322#include <netinet/in.h> 1325#include <netinet/in.h>
1323#include <tcpd.h> 1326#include <tcpd.h>
1324 int deny_severity = 0, allow_severity = 0; 1327int deny_severity = 0, allow_severity = 0;
1325 ], 1328 ]], [[
1326 [hosts_access(0);], 1329 hosts_access(0);
1327 [ 1330 ]])], [
1328 AC_MSG_RESULT(yes) 1331 AC_MSG_RESULT([yes])
1329 AC_DEFINE(LIBWRAP, 1, 1332 AC_DEFINE([LIBWRAP], [1],
1330 [Define if you want 1333 [Define if you want
1331 TCP Wrappers support]) 1334 TCP Wrappers support])
1332 SSHDLIBS="$SSHDLIBS -lwrap" 1335 SSHDLIBS="$SSHDLIBS -lwrap"
1333 TCPW_MSG="yes" 1336 TCPW_MSG="yes"
1334 ], 1337 ], [
1335 [
1336 AC_MSG_ERROR([*** libwrap missing]) 1338 AC_MSG_ERROR([*** libwrap missing])
1337 ] 1339
1338 ) 1340 ])
1339 LIBS="$saved_LIBS" 1341 LIBS="$saved_LIBS"
1340 fi 1342 fi
1341 ] 1343 ]
@@ -1343,18 +1345,18 @@ AC_ARG_WITH(tcp-wrappers,
1343 1345
1344# Check whether user wants libedit support 1346# Check whether user wants libedit support
1345LIBEDIT_MSG="no" 1347LIBEDIT_MSG="no"
1346AC_ARG_WITH(libedit, 1348AC_ARG_WITH([libedit],
1347 [ --with-libedit[[=PATH]] Enable libedit support for sftp], 1349 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
1348 [ if test "x$withval" != "xno" ; then 1350 [ if test "x$withval" != "xno" ; then
1349 if test "x$withval" = "xyes" ; then 1351 if test "x$withval" = "xyes" ; then
1350 AC_PATH_PROG(PKGCONFIG, pkg-config, no) 1352 AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
1351 if test "x$PKGCONFIG" != "xno"; then 1353 if test "x$PKGCONFIG" != "xno"; then
1352 AC_MSG_CHECKING(if $PKGCONFIG knows about libedit) 1354 AC_MSG_CHECKING([if $PKGCONFIG knows about libedit])
1353 if "$PKGCONFIG" libedit; then 1355 if "$PKGCONFIG" libedit; then
1354 AC_MSG_RESULT(yes) 1356 AC_MSG_RESULT([yes])
1355 use_pkgconfig_for_libedit=yes 1357 use_pkgconfig_for_libedit=yes
1356 else 1358 else
1357 AC_MSG_RESULT(no) 1359 AC_MSG_RESULT([no])
1358 fi 1360 fi
1359 fi 1361 fi
1360 else 1362 else
@@ -1372,73 +1374,70 @@ AC_ARG_WITH(libedit,
1372 LIBEDIT="-ledit -lcurses" 1374 LIBEDIT="-ledit -lcurses"
1373 fi 1375 fi
1374 OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` 1376 OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'`
1375 AC_CHECK_LIB(edit, el_init, 1377 AC_CHECK_LIB([edit], [el_init],
1376 [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp]) 1378 [ AC_DEFINE([USE_LIBEDIT], [1], [Use libedit for sftp])
1377 LIBEDIT_MSG="yes" 1379 LIBEDIT_MSG="yes"
1378 AC_SUBST(LIBEDIT) 1380 AC_SUBST([LIBEDIT])
1379 ], 1381 ],
1380 [ AC_MSG_ERROR(libedit not found) ], 1382 [ AC_MSG_ERROR([libedit not found]) ],
1381 [ $OTHERLIBS ] 1383 [ $OTHERLIBS ]
1382 ) 1384 )
1383 AC_MSG_CHECKING(if libedit version is compatible) 1385 AC_MSG_CHECKING([if libedit version is compatible])
1384 AC_COMPILE_IFELSE( 1386 AC_COMPILE_IFELSE(
1385 [AC_LANG_SOURCE([[ 1387 [AC_LANG_PROGRAM([[ #include <histedit.h> ]],
1386#include <histedit.h> 1388 [[
1387int main(void)
1388{
1389 int i = H_SETSIZE; 1389 int i = H_SETSIZE;
1390 el_init("", NULL, NULL, NULL); 1390 el_init("", NULL, NULL, NULL);
1391 exit(0); 1391 exit(0);
1392}
1393 ]])], 1392 ]])],
1394 [ AC_MSG_RESULT(yes) ], 1393 [ AC_MSG_RESULT([yes]) ],
1395 [ AC_MSG_RESULT(no) 1394 [ AC_MSG_RESULT([no])
1396 AC_MSG_ERROR(libedit version is not compatible) ] 1395 AC_MSG_ERROR([libedit version is not compatible]) ]
1397 ) 1396 )
1398 fi ] 1397 fi ]
1399) 1398)
1400 1399
1401AUDIT_MODULE=none 1400AUDIT_MODULE=none
1402AC_ARG_WITH(audit, 1401AC_ARG_WITH([audit],
1403 [ --with-audit=module Enable audit support (modules=debug,bsm,linux)], 1402 [ --with-audit=module Enable audit support (modules=debug,bsm,linux)],
1404 [ 1403 [
1405 AC_MSG_CHECKING(for supported audit module) 1404 AC_MSG_CHECKING([for supported audit module])
1406 case "$withval" in 1405 case "$withval" in
1407 bsm) 1406 bsm)
1408 AC_MSG_RESULT(bsm) 1407 AC_MSG_RESULT([bsm])
1409 AUDIT_MODULE=bsm 1408 AUDIT_MODULE=bsm
1410 dnl Checks for headers, libs and functions 1409 dnl Checks for headers, libs and functions
1411 AC_CHECK_HEADERS(bsm/audit.h, [], 1410 AC_CHECK_HEADERS([bsm/audit.h], [],
1412 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)], 1411 [AC_MSG_ERROR([BSM enabled and bsm/audit.h not found])],
1413 [ 1412 [
1414#ifdef HAVE_TIME_H 1413#ifdef HAVE_TIME_H
1415# include <time.h> 1414# include <time.h>
1416#endif 1415#endif
1417 ] 1416 ]
1418) 1417)
1419 AC_CHECK_LIB(bsm, getaudit, [], 1418 AC_CHECK_LIB([bsm], [getaudit], [],
1420 [AC_MSG_ERROR(BSM enabled and required library not found)]) 1419 [AC_MSG_ERROR([BSM enabled and required library not found])])
1421 AC_CHECK_FUNCS(getaudit, [], 1420 AC_CHECK_FUNCS([getaudit], [],
1422 [AC_MSG_ERROR(BSM enabled and required function not found)]) 1421 [AC_MSG_ERROR([BSM enabled and required function not found])])
1423 # These are optional 1422 # These are optional
1424 AC_CHECK_FUNCS(getaudit_addr aug_get_machine) 1423 AC_CHECK_FUNCS([getaudit_addr aug_get_machine])
1425 AC_DEFINE(USE_BSM_AUDIT, 1, [Use BSM audit module]) 1424 AC_DEFINE([USE_BSM_AUDIT], [1], [Use BSM audit module])
1426 ;; 1425 ;;
1427 linux) 1426 linux)
1428 AC_MSG_RESULT(linux) 1427 AC_MSG_RESULT([linux])
1429 AUDIT_MODULE=linux 1428 AUDIT_MODULE=linux
1430 dnl Checks for headers, libs and functions 1429 dnl Checks for headers, libs and functions
1431 AC_CHECK_HEADERS(libaudit.h) 1430 AC_CHECK_HEADERS([libaudit.h])
1432 SSHDLIBS="$SSHDLIBS -laudit" 1431 SSHDLIBS="$SSHDLIBS -laudit"
1433 AC_DEFINE(USE_LINUX_AUDIT, 1, [Use Linux audit module]) 1432 AC_DEFINE([USE_LINUX_AUDIT], [1], [Use Linux audit module])
1434 ;; 1433 ;;
1435 debug) 1434 debug)
1436 AUDIT_MODULE=debug 1435 AUDIT_MODULE=debug
1437 AC_MSG_RESULT(debug) 1436 AC_MSG_RESULT([debug])
1438 AC_DEFINE(SSH_AUDIT_EVENTS, 1, [Use audit debugging module]) 1437 AC_DEFINE([SSH_AUDIT_EVENTS], [1], [Use audit debugging module])
1439 ;; 1438 ;;
1440 no) 1439 no)
1441 AC_MSG_RESULT(no) 1440 AC_MSG_RESULT([no])
1442 ;; 1441 ;;
1443 *) 1442 *)
1444 AC_MSG_ERROR([Unknown audit module $withval]) 1443 AC_MSG_ERROR([Unknown audit module $withval])
@@ -1447,7 +1446,7 @@ AC_ARG_WITH(audit,
1447) 1446)
1448 1447
1449dnl Checks for library functions. Please keep in alphabetical order 1448dnl Checks for library functions. Please keep in alphabetical order
1450AC_CHECK_FUNCS( \ 1449AC_CHECK_FUNCS([ \
1451 arc4random \ 1450 arc4random \
1452 arc4random_buf \ 1451 arc4random_buf \
1453 arc4random_uniform \ 1452 arc4random_uniform \
@@ -1543,46 +1542,43 @@ AC_CHECK_FUNCS( \
1543 vhangup \ 1542 vhangup \
1544 vsnprintf \ 1543 vsnprintf \
1545 waitpid \ 1544 waitpid \
1546) 1545])
1547 1546
1548AC_LINK_IFELSE( 1547AC_LINK_IFELSE(
1549[ 1548 [AC_LANG_PROGRAM(
1550#include <ctype.h> 1549 [[ #include <ctype.h> ]],
1551int main(void) 1550 [[ return (isblank('a')); ]])],
1552{ 1551 [AC_DEFINE([HAVE_ISBLANK], [1], [Define if you have isblank(3C).])
1553 return (isblank('a'));
1554}
1555],
1556 [AC_DEFINE(HAVE_ISBLANK, 1, [Define if you have isblank(3C).])
1557]) 1552])
1558 1553
1559# PKCS#11 support requires dlopen() and co 1554# PKCS#11 support requires dlopen() and co
1560AC_SEARCH_LIBS(dlopen, dl, 1555AC_SEARCH_LIBS([dlopen], [dl],
1561 AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) 1556 [AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support])]
1562) 1557)
1563 1558
1564# IRIX has a const char return value for gai_strerror() 1559# IRIX has a const char return value for gai_strerror()
1565AC_CHECK_FUNCS(gai_strerror,[ 1560AC_CHECK_FUNCS([gai_strerror], [
1566 AC_DEFINE(HAVE_GAI_STRERROR) 1561 AC_DEFINE([HAVE_GAI_STRERROR])
1567 AC_TRY_COMPILE([ 1562 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1568#include <sys/types.h> 1563#include <sys/types.h>
1569#include <sys/socket.h> 1564#include <sys/socket.h>
1570#include <netdb.h> 1565#include <netdb.h>
1571 1566
1572const char *gai_strerror(int);],[ 1567const char *gai_strerror(int);
1573char *str; 1568 ]], [[
1574 1569 char *str;
1575str = gai_strerror(0);],[ 1570 str = gai_strerror(0);
1576 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1, 1571 ]])], [
1577 [Define if gai_strerror() returns const char *])])]) 1572 AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1],
1573 [Define if gai_strerror() returns const char *])], [])])
1578 1574
1579AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, 1575AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1],
1580 [Some systems put nanosleep outside of libc])) 1576 [Some systems put nanosleep outside of libc])])
1581 1577
1582dnl Make sure prototypes are defined for these before using them. 1578dnl Make sure prototypes are defined for these before using them.
1583AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)]) 1579AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])])
1584AC_CHECK_DECL(strsep, 1580AC_CHECK_DECL([strsep],
1585 [AC_CHECK_FUNCS(strsep)], 1581 [AC_CHECK_FUNCS([strsep])],
1586 [], 1582 [],
1587 [ 1583 [
1588#ifdef HAVE_STRING_H 1584#ifdef HAVE_STRING_H
@@ -1591,21 +1587,21 @@ AC_CHECK_DECL(strsep,
1591 ]) 1587 ])
1592 1588
1593dnl tcsendbreak might be a macro 1589dnl tcsendbreak might be a macro
1594AC_CHECK_DECL(tcsendbreak, 1590AC_CHECK_DECL([tcsendbreak],
1595 [AC_DEFINE(HAVE_TCSENDBREAK)], 1591 [AC_DEFINE([HAVE_TCSENDBREAK])],
1596 [AC_CHECK_FUNCS(tcsendbreak)], 1592 [AC_CHECK_FUNCS([tcsendbreak])],
1597 [#include <termios.h>] 1593 [#include <termios.h>]
1598) 1594)
1599 1595
1600AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>]) 1596AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>])
1601 1597
1602AC_CHECK_DECLS(SHUT_RD, , , 1598AC_CHECK_DECLS([SHUT_RD], , ,
1603 [ 1599 [
1604#include <sys/types.h> 1600#include <sys/types.h>
1605#include <sys/socket.h> 1601#include <sys/socket.h>
1606 ]) 1602 ])
1607 1603
1608AC_CHECK_DECLS(O_NONBLOCK, , , 1604AC_CHECK_DECLS([O_NONBLOCK], , ,
1609 [ 1605 [
1610#include <sys/types.h> 1606#include <sys/types.h>
1611#ifdef HAVE_SYS_STAT_H 1607#ifdef HAVE_SYS_STAT_H
@@ -1616,90 +1612,104 @@ AC_CHECK_DECLS(O_NONBLOCK, , ,
1616#endif 1612#endif
1617 ]) 1613 ])
1618 1614
1619AC_CHECK_DECLS(writev, , , [ 1615AC_CHECK_DECLS([writev], , , [
1620#include <sys/types.h> 1616#include <sys/types.h>
1621#include <sys/uio.h> 1617#include <sys/uio.h>
1622#include <unistd.h> 1618#include <unistd.h>
1623 ]) 1619 ])
1624 1620
1625AC_CHECK_DECLS(MAXSYMLINKS, , , [ 1621AC_CHECK_DECLS([MAXSYMLINKS], , , [
1626#include <sys/param.h> 1622#include <sys/param.h>
1627 ]) 1623 ])
1628 1624
1629AC_CHECK_DECLS(offsetof, , , [ 1625AC_CHECK_DECLS([offsetof], , , [
1630#include <stddef.h> 1626#include <stddef.h>
1631 ]) 1627 ])
1632 1628
1633AC_CHECK_FUNCS(setresuid, [ 1629AC_CHECK_FUNCS([setresuid], [
1634 dnl Some platorms have setresuid that isn't implemented, test for this 1630 dnl Some platorms have setresuid that isn't implemented, test for this
1635 AC_MSG_CHECKING(if setresuid seems to work) 1631 AC_MSG_CHECKING([if setresuid seems to work])
1636 AC_RUN_IFELSE( 1632 AC_RUN_IFELSE(
1637 [AC_LANG_SOURCE([[ 1633 [AC_LANG_PROGRAM([[
1638#include <stdlib.h> 1634#include <stdlib.h>
1639#include <errno.h> 1635#include <errno.h>
1640int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} 1636 ]], [[
1637 errno=0;
1638 setresuid(0,0,0);
1639 if (errno==ENOSYS)
1640 exit(1);
1641 else
1642 exit(0);
1641 ]])], 1643 ]])],
1642 [AC_MSG_RESULT(yes)], 1644 [AC_MSG_RESULT([yes])],
1643 [AC_DEFINE(BROKEN_SETRESUID, 1, 1645 [AC_DEFINE([BROKEN_SETRESUID], [1],
1644 [Define if your setresuid() is broken]) 1646 [Define if your setresuid() is broken])
1645 AC_MSG_RESULT(not implemented)], 1647 AC_MSG_RESULT([not implemented])],
1646 [AC_MSG_WARN([cross compiling: not checking setresuid])] 1648 [AC_MSG_WARN([cross compiling: not checking setresuid])]
1647 ) 1649 )
1648]) 1650])
1649 1651
1650AC_CHECK_FUNCS(setresgid, [ 1652AC_CHECK_FUNCS([setresgid], [
1651 dnl Some platorms have setresgid that isn't implemented, test for this 1653 dnl Some platorms have setresgid that isn't implemented, test for this
1652 AC_MSG_CHECKING(if setresgid seems to work) 1654 AC_MSG_CHECKING([if setresgid seems to work])
1653 AC_RUN_IFELSE( 1655 AC_RUN_IFELSE(
1654 [AC_LANG_SOURCE([[ 1656 [AC_LANG_PROGRAM([[
1655#include <stdlib.h> 1657#include <stdlib.h>
1656#include <errno.h> 1658#include <errno.h>
1657int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} 1659 ]], [[
1660 errno=0;
1661 setresgid(0,0,0);
1662 if (errno==ENOSYS)
1663 exit(1);
1664 else
1665 exit(0);
1658 ]])], 1666 ]])],
1659 [AC_MSG_RESULT(yes)], 1667 [AC_MSG_RESULT([yes])],
1660 [AC_DEFINE(BROKEN_SETRESGID, 1, 1668 [AC_DEFINE([BROKEN_SETRESGID], [1],
1661 [Define if your setresgid() is broken]) 1669 [Define if your setresgid() is broken])
1662 AC_MSG_RESULT(not implemented)], 1670 AC_MSG_RESULT([not implemented])],
1663 [AC_MSG_WARN([cross compiling: not checking setresuid])] 1671 [AC_MSG_WARN([cross compiling: not checking setresuid])]
1664 ) 1672 )
1665]) 1673])
1666 1674
1667dnl Checks for time functions 1675dnl Checks for time functions
1668AC_CHECK_FUNCS(gettimeofday time) 1676AC_CHECK_FUNCS([gettimeofday time])
1669dnl Checks for utmp functions 1677dnl Checks for utmp functions
1670AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) 1678AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent])
1671AC_CHECK_FUNCS(utmpname) 1679AC_CHECK_FUNCS([utmpname])
1672dnl Checks for utmpx functions 1680dnl Checks for utmpx functions
1673AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline getutxuser pututxline) 1681AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline getutxuser pututxline])
1674AC_CHECK_FUNCS(setutxdb setutxent utmpxname) 1682AC_CHECK_FUNCS([setutxdb setutxent utmpxname])
1675dnl Checks for lastlog functions 1683dnl Checks for lastlog functions
1676AC_CHECK_FUNCS(getlastlogxbyname) 1684AC_CHECK_FUNCS([getlastlogxbyname])
1677 1685
1678AC_CHECK_FUNC(daemon, 1686AC_CHECK_FUNC([daemon],
1679 [AC_DEFINE(HAVE_DAEMON, 1, [Define if your libraries define daemon()])], 1687 [AC_DEFINE([HAVE_DAEMON], [1], [Define if your libraries define daemon()])],
1680 [AC_CHECK_LIB(bsd, daemon, 1688 [AC_CHECK_LIB([bsd], [daemon],
1681 [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] 1689 [LIBS="$LIBS -lbsd"; AC_DEFINE([HAVE_DAEMON])])]
1682) 1690)
1683 1691
1684AC_CHECK_FUNC(getpagesize, 1692AC_CHECK_FUNC([getpagesize],
1685 [AC_DEFINE(HAVE_GETPAGESIZE, 1, 1693 [AC_DEFINE([HAVE_GETPAGESIZE], [1],
1686 [Define if your libraries define getpagesize()])], 1694 [Define if your libraries define getpagesize()])],
1687 [AC_CHECK_LIB(ucb, getpagesize, 1695 [AC_CHECK_LIB([ucb], [getpagesize],
1688 [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] 1696 [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])]
1689) 1697)
1690 1698
1691# Check for broken snprintf 1699# Check for broken snprintf
1692if test "x$ac_cv_func_snprintf" = "xyes" ; then 1700if test "x$ac_cv_func_snprintf" = "xyes" ; then
1693 AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) 1701 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
1694 AC_RUN_IFELSE( 1702 AC_RUN_IFELSE(
1695 [AC_LANG_SOURCE([[ 1703 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
1696#include <stdio.h> 1704 [[
1697int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} 1705 char b[5];
1706 snprintf(b,5,"123456789");
1707 exit(b[4]!='\0');
1698 ]])], 1708 ]])],
1699 [AC_MSG_RESULT(yes)], 1709 [AC_MSG_RESULT([yes])],
1700 [ 1710 [
1701 AC_MSG_RESULT(no) 1711 AC_MSG_RESULT([no])
1702 AC_DEFINE(BROKEN_SNPRINTF, 1, 1712 AC_DEFINE([BROKEN_SNPRINTF], [1],
1703 [Define if your snprintf is busted]) 1713 [Define if your snprintf is busted])
1704 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) 1714 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
1705 ], 1715 ],
@@ -1714,7 +1724,7 @@ if test "x$ac_cv_func_asprintf" != "xyes" && \
1714 test "x$ac_cv_func_vsnprintf" = "xyes" ; then 1724 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1715 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) 1725 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1716 AC_RUN_IFELSE( 1726 AC_RUN_IFELSE(
1717 [AC_LANG_SOURCE([[ 1727 [AC_LANG_PROGRAM([[
1718#include <sys/types.h> 1728#include <sys/types.h>
1719#include <stdio.h> 1729#include <stdio.h>
1720#include <stdarg.h> 1730#include <stdarg.h>
@@ -1725,15 +1735,14 @@ int x_snprintf(char *str,size_t count,const char *fmt,...)
1725 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap); 1735 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
1726 return ret; 1736 return ret;
1727} 1737}
1728int main(void) 1738 ]], [[
1729{
1730 char x[1]; 1739 char x[1];
1731 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1); 1740 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
1732} ]])], 1741 ]])],
1733 [AC_MSG_RESULT(yes)], 1742 [AC_MSG_RESULT([yes])],
1734 [ 1743 [
1735 AC_MSG_RESULT(no) 1744 AC_MSG_RESULT([no])
1736 AC_DEFINE(BROKEN_SNPRINTF, 1, 1745 AC_DEFINE([BROKEN_SNPRINTF], [1],
1737 [Define if your snprintf is busted]) 1746 [Define if your snprintf is busted])
1738 AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor]) 1747 AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor])
1739 ], 1748 ],
@@ -1745,71 +1754,69 @@ fi
1745# check that the fmt argument is const char * or just char *. 1754# check that the fmt argument is const char * or just char *.
1746# This is only useful for when BROKEN_SNPRINTF 1755# This is only useful for when BROKEN_SNPRINTF
1747AC_MSG_CHECKING([whether snprintf can declare const char *fmt]) 1756AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
1748AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 1757AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1749 int snprintf(char *a, size_t b, const char *c, ...) { return 0; } 1758#include <stdio.h>
1750 int main(void) { snprintf(0, 0, 0); } 1759int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
1751 ]])], 1760 ]], [[
1752 [AC_MSG_RESULT(yes) 1761 snprintf(0, 0, 0);
1753 AC_DEFINE(SNPRINTF_CONST, [const], 1762 ]])],
1763 [AC_MSG_RESULT([yes])
1764 AC_DEFINE([SNPRINTF_CONST], [const],
1754 [Define as const if snprintf() can declare const char *fmt])], 1765 [Define as const if snprintf() can declare const char *fmt])],
1755 [AC_MSG_RESULT(no) 1766 [AC_MSG_RESULT([no])
1756 AC_DEFINE(SNPRINTF_CONST, [/* not const */])]) 1767 AC_DEFINE([SNPRINTF_CONST], [/* not const */])])
1757 1768
1758# Check for missing getpeereid (or equiv) support 1769# Check for missing getpeereid (or equiv) support
1759NO_PEERCHECK="" 1770NO_PEERCHECK=""
1760if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "xyes"; then 1771if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "xyes"; then
1761 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt]) 1772 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
1762 AC_TRY_COMPILE( 1773 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1763 [#include <sys/types.h> 1774#include <sys/types.h>
1764 #include <sys/socket.h>], 1775#include <sys/socket.h>]], [[int i = SO_PEERCRED;]])],
1765 [int i = SO_PEERCRED;], 1776 [ AC_MSG_RESULT([yes])
1766 [ AC_MSG_RESULT(yes) 1777 AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have PEERCRED socket option])
1767 AC_DEFINE(HAVE_SO_PEERCRED, 1, [Have PEERCRED socket option]) 1778 ], [AC_MSG_RESULT([no])
1768 ], 1779 NO_PEERCHECK=1
1769 [AC_MSG_RESULT(no) 1780 ])
1770 NO_PEERCHECK=1]
1771 )
1772fi 1781fi
1773 1782
1774dnl see whether mkstemp() requires XXXXXX 1783dnl see whether mkstemp() requires XXXXXX
1775if test "x$ac_cv_func_mkdtemp" = "xyes" ; then 1784if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
1776AC_MSG_CHECKING([for (overly) strict mkstemp]) 1785AC_MSG_CHECKING([for (overly) strict mkstemp])
1777AC_RUN_IFELSE( 1786AC_RUN_IFELSE(
1778 [AC_LANG_SOURCE([[ 1787 [AC_LANG_PROGRAM([[
1779#include <stdlib.h> 1788#include <stdlib.h>
1780main() { char template[]="conftest.mkstemp-test"; 1789 ]], [[
1781if (mkstemp(template) == -1) 1790 char template[]="conftest.mkstemp-test";
1782 exit(1); 1791 if (mkstemp(template) == -1)
1783unlink(template); exit(0); 1792 exit(1);
1784} 1793 unlink(template);
1794 exit(0);
1785 ]])], 1795 ]])],
1786 [ 1796 [
1787 AC_MSG_RESULT(no) 1797 AC_MSG_RESULT([no])
1788 ], 1798 ],
1789 [ 1799 [
1790 AC_MSG_RESULT(yes) 1800 AC_MSG_RESULT([yes])
1791 AC_DEFINE(HAVE_STRICT_MKSTEMP, 1, [Silly mkstemp()]) 1801 AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()])
1792 ], 1802 ],
1793 [ 1803 [
1794 AC_MSG_RESULT(yes) 1804 AC_MSG_RESULT([yes])
1795 AC_DEFINE(HAVE_STRICT_MKSTEMP) 1805 AC_DEFINE([HAVE_STRICT_MKSTEMP])
1796 ] 1806 ]
1797) 1807)
1798fi 1808fi
1799 1809
1800dnl make sure that openpty does not reacquire controlling terminal 1810dnl make sure that openpty does not reacquire controlling terminal
1801if test ! -z "$check_for_openpty_ctty_bug"; then 1811if test ! -z "$check_for_openpty_ctty_bug"; then
1802 AC_MSG_CHECKING(if openpty correctly handles controlling tty) 1812 AC_MSG_CHECKING([if openpty correctly handles controlling tty])
1803 AC_RUN_IFELSE( 1813 AC_RUN_IFELSE(
1804 [AC_LANG_SOURCE([[ 1814 [AC_LANG_PROGRAM([[
1805#include <stdio.h> 1815#include <stdio.h>
1806#include <sys/fcntl.h> 1816#include <sys/fcntl.h>
1807#include <sys/types.h> 1817#include <sys/types.h>
1808#include <sys/wait.h> 1818#include <sys/wait.h>
1809 1819 ]], [[
1810int
1811main()
1812{
1813 pid_t pid; 1820 pid_t pid;
1814 int fd, ptyfd, ttyfd, status; 1821 int fd, ptyfd, ttyfd, status;
1815 1822
@@ -1832,26 +1839,25 @@ main()
1832 else 1839 else
1833 exit(0); /* Did not acquire ctty: OK */ 1840 exit(0); /* Did not acquire ctty: OK */
1834 } 1841 }
1835}
1836 ]])], 1842 ]])],
1837 [ 1843 [
1838 AC_MSG_RESULT(yes) 1844 AC_MSG_RESULT([yes])
1839 ], 1845 ],
1840 [ 1846 [
1841 AC_MSG_RESULT(no) 1847 AC_MSG_RESULT([no])
1842 AC_DEFINE(SSHD_ACQUIRES_CTTY) 1848 AC_DEFINE([SSHD_ACQUIRES_CTTY])
1843 ], 1849 ],
1844 [ 1850 [
1845 AC_MSG_RESULT(cross-compiling, assuming yes) 1851 AC_MSG_RESULT([cross-compiling, assuming yes])
1846 ] 1852 ]
1847 ) 1853 )
1848fi 1854fi
1849 1855
1850if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ 1856if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1851 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then 1857 test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1852 AC_MSG_CHECKING(if getaddrinfo seems to work) 1858 AC_MSG_CHECKING([if getaddrinfo seems to work])
1853 AC_RUN_IFELSE( 1859 AC_RUN_IFELSE(
1854 [AC_LANG_SOURCE([[ 1860 [AC_LANG_PROGRAM([[
1855#include <stdio.h> 1861#include <stdio.h>
1856#include <sys/socket.h> 1862#include <sys/socket.h>
1857#include <netdb.h> 1863#include <netdb.h>
@@ -1859,10 +1865,7 @@ if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1859#include <netinet/in.h> 1865#include <netinet/in.h>
1860 1866
1861#define TEST_PORT "2222" 1867#define TEST_PORT "2222"
1862 1868 ]], [[
1863int
1864main(void)
1865{
1866 int err, sock; 1869 int err, sock;
1867 struct addrinfo *gai_ai, *ai, hints; 1870 struct addrinfo *gai_ai, *ai, hints;
1868 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; 1871 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
@@ -1904,26 +1907,25 @@ main(void)
1904 } 1907 }
1905 } 1908 }
1906 exit(0); 1909 exit(0);
1907}
1908 ]])], 1910 ]])],
1909 [ 1911 [
1910 AC_MSG_RESULT(yes) 1912 AC_MSG_RESULT([yes])
1911 ], 1913 ],
1912 [ 1914 [
1913 AC_MSG_RESULT(no) 1915 AC_MSG_RESULT([no])
1914 AC_DEFINE(BROKEN_GETADDRINFO) 1916 AC_DEFINE([BROKEN_GETADDRINFO])
1915 ], 1917 ],
1916 [ 1918 [
1917 AC_MSG_RESULT(cross-compiling, assuming yes) 1919 AC_MSG_RESULT([cross-compiling, assuming yes])
1918 ] 1920 ]
1919 ) 1921 )
1920fi 1922fi
1921 1923
1922if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ 1924if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1923 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then 1925 test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1924 AC_MSG_CHECKING(if getaddrinfo seems to work) 1926 AC_MSG_CHECKING([if getaddrinfo seems to work])
1925 AC_RUN_IFELSE( 1927 AC_RUN_IFELSE(
1926 [AC_LANG_SOURCE([[ 1928 [AC_LANG_PROGRAM([[
1927#include <stdio.h> 1929#include <stdio.h>
1928#include <sys/socket.h> 1930#include <sys/socket.h>
1929#include <netdb.h> 1931#include <netdb.h>
@@ -1931,10 +1933,7 @@ if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
1931#include <netinet/in.h> 1933#include <netinet/in.h>
1932 1934
1933#define TEST_PORT "2222" 1935#define TEST_PORT "2222"
1934 1936 ]], [[
1935int
1936main(void)
1937{
1938 int err, sock; 1937 int err, sock;
1939 struct addrinfo *gai_ai, *ai, hints; 1938 struct addrinfo *gai_ai, *ai, hints;
1940 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; 1939 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
@@ -1964,37 +1963,33 @@ main(void)
1964 } 1963 }
1965 } 1964 }
1966 exit(0); 1965 exit(0);
1967}
1968 ]])], 1966 ]])],
1969 [ 1967 [
1970 AC_MSG_RESULT(yes) 1968 AC_MSG_RESULT([yes])
1971 AC_DEFINE(AIX_GETNAMEINFO_HACK, 1, 1969 AC_DEFINE([AIX_GETNAMEINFO_HACK], [1],
1972 [Define if you have a getaddrinfo that fails 1970 [Define if you have a getaddrinfo that fails
1973 for the all-zeros IPv6 address]) 1971 for the all-zeros IPv6 address])
1974 ], 1972 ],
1975 [ 1973 [
1976 AC_MSG_RESULT(no) 1974 AC_MSG_RESULT([no])
1977 AC_DEFINE(BROKEN_GETADDRINFO) 1975 AC_DEFINE([BROKEN_GETADDRINFO])
1978 ], 1976 ],
1979 [ 1977 [
1980 AC_MSG_RESULT(cross-compiling, assuming no) 1978 AC_MSG_RESULT([cross-compiling, assuming no])
1981 ] 1979 ]
1982 ) 1980 )
1983fi 1981fi
1984 1982
1985if test "x$check_for_conflicting_getspnam" = "x1"; then 1983if test "x$check_for_conflicting_getspnam" = "x1"; then
1986 AC_MSG_CHECKING(for conflicting getspnam in shadow.h) 1984 AC_MSG_CHECKING([for conflicting getspnam in shadow.h])
1987 AC_COMPILE_IFELSE( 1985 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]],
1986 [[ exit(0); ]])],
1988 [ 1987 [
1989#include <shadow.h> 1988 AC_MSG_RESULT([no])
1990int main(void) {exit(0);}
1991 ],
1992 [
1993 AC_MSG_RESULT(no)
1994 ], 1989 ],
1995 [ 1990 [
1996 AC_MSG_RESULT(yes) 1991 AC_MSG_RESULT([yes])
1997 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1, 1992 AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1],
1998 [Conflicting defs for getspnam]) 1993 [Conflicting defs for getspnam])
1999 ] 1994 ]
2000 ) 1995 )
@@ -2005,7 +2000,7 @@ AC_FUNC_GETPGRP
2005# Search for OpenSSL 2000# Search for OpenSSL
2006saved_CPPFLAGS="$CPPFLAGS" 2001saved_CPPFLAGS="$CPPFLAGS"
2007saved_LDFLAGS="$LDFLAGS" 2002saved_LDFLAGS="$LDFLAGS"
2008AC_ARG_WITH(ssl-dir, 2003AC_ARG_WITH([ssl-dir],
2009 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], 2004 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
2010 [ 2005 [
2011 if test "x$withval" != "xno" ; then 2006 if test "x$withval" != "xno" ; then
@@ -2041,9 +2036,9 @@ AC_ARG_WITH(ssl-dir,
2041 ] 2036 ]
2042) 2037)
2043LIBS="-lcrypto $LIBS" 2038LIBS="-lcrypto $LIBS"
2044AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1, 2039AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL], [1],
2045 [Define if your ssl headers are included 2040 [Define if your ssl headers are included
2046 with #include <openssl/header.h>]), 2041 with #include <openssl/header.h>])],
2047 [ 2042 [
2048 dnl Check default openssl install dir 2043 dnl Check default openssl install dir
2049 if test -n "${need_dash_r}"; then 2044 if test -n "${need_dash_r}"; then
@@ -2053,8 +2048,8 @@ AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
2053 fi 2048 fi
2054 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" 2049 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
2055 AC_CHECK_HEADER([openssl/opensslv.h], , 2050 AC_CHECK_HEADER([openssl/opensslv.h], ,
2056 AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])) 2051 [AC_MSG_ERROR([*** OpenSSL headers missing - please install first or check config.log ***])])
2057 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), 2052 AC_TRY_LINK_FUNC([RAND_add], [AC_DEFINE([HAVE_OPENSSL])],
2058 [ 2053 [
2059 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***]) 2054 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
2060 ] 2055 ]
@@ -2065,12 +2060,12 @@ AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
2065# Determine OpenSSL header version 2060# Determine OpenSSL header version
2066AC_MSG_CHECKING([OpenSSL header version]) 2061AC_MSG_CHECKING([OpenSSL header version])
2067AC_RUN_IFELSE( 2062AC_RUN_IFELSE(
2068 [AC_LANG_SOURCE([[ 2063 [AC_LANG_PROGRAM([[
2069#include <stdio.h> 2064#include <stdio.h>
2070#include <string.h> 2065#include <string.h>
2071#include <openssl/opensslv.h> 2066#include <openssl/opensslv.h>
2072#define DATA "conftest.sslincver" 2067#define DATA "conftest.sslincver"
2073int main(void) { 2068 ]], [[
2074 FILE *fd; 2069 FILE *fd;
2075 int rc; 2070 int rc;
2076 2071
@@ -2082,15 +2077,14 @@ int main(void) {
2082 exit(1); 2077 exit(1);
2083 2078
2084 exit(0); 2079 exit(0);
2085}
2086 ]])], 2080 ]])],
2087 [ 2081 [
2088 ssl_header_ver=`cat conftest.sslincver` 2082 ssl_header_ver=`cat conftest.sslincver`
2089 AC_MSG_RESULT($ssl_header_ver) 2083 AC_MSG_RESULT([$ssl_header_ver])
2090 ], 2084 ],
2091 [ 2085 [
2092 AC_MSG_RESULT(not found) 2086 AC_MSG_RESULT([not found])
2093 AC_MSG_ERROR(OpenSSL version header not found.) 2087 AC_MSG_ERROR([OpenSSL version header not found.])
2094 ], 2088 ],
2095 [ 2089 [
2096 AC_MSG_WARN([cross compiling: not checking]) 2090 AC_MSG_WARN([cross compiling: not checking])
@@ -2100,13 +2094,13 @@ int main(void) {
2100# Determine OpenSSL library version 2094# Determine OpenSSL library version
2101AC_MSG_CHECKING([OpenSSL library version]) 2095AC_MSG_CHECKING([OpenSSL library version])
2102AC_RUN_IFELSE( 2096AC_RUN_IFELSE(
2103 [AC_LANG_SOURCE([[ 2097 [AC_LANG_PROGRAM([[
2104#include <stdio.h> 2098#include <stdio.h>
2105#include <string.h> 2099#include <string.h>
2106#include <openssl/opensslv.h> 2100#include <openssl/opensslv.h>
2107#include <openssl/crypto.h> 2101#include <openssl/crypto.h>
2108#define DATA "conftest.ssllibver" 2102#define DATA "conftest.ssllibver"
2109int main(void) { 2103 ]], [[
2110 FILE *fd; 2104 FILE *fd;
2111 int rc; 2105 int rc;
2112 2106
@@ -2118,22 +2112,21 @@ int main(void) {
2118 exit(1); 2112 exit(1);
2119 2113
2120 exit(0); 2114 exit(0);
2121}
2122 ]])], 2115 ]])],
2123 [ 2116 [
2124 ssl_library_ver=`cat conftest.ssllibver` 2117 ssl_library_ver=`cat conftest.ssllibver`
2125 AC_MSG_RESULT($ssl_library_ver) 2118 AC_MSG_RESULT([$ssl_library_ver])
2126 ], 2119 ],
2127 [ 2120 [
2128 AC_MSG_RESULT(not found) 2121 AC_MSG_RESULT([not found])
2129 AC_MSG_ERROR(OpenSSL library not found.) 2122 AC_MSG_ERROR([OpenSSL library not found.])
2130 ], 2123 ],
2131 [ 2124 [
2132 AC_MSG_WARN([cross compiling: not checking]) 2125 AC_MSG_WARN([cross compiling: not checking])
2133 ] 2126 ]
2134) 2127)
2135 2128
2136AC_ARG_WITH(openssl-header-check, 2129AC_ARG_WITH([openssl-header-check],
2137 [ --without-openssl-header-check Disable OpenSSL version consistency check], 2130 [ --without-openssl-header-check Disable OpenSSL version consistency check],
2138 [ if test "x$withval" = "xno" ; then 2131 [ if test "x$withval" = "xno" ; then
2139 openssl_check_nonfatal=1 2132 openssl_check_nonfatal=1
@@ -2144,16 +2137,17 @@ AC_ARG_WITH(openssl-header-check,
2144# Sanity check OpenSSL headers 2137# Sanity check OpenSSL headers
2145AC_MSG_CHECKING([whether OpenSSL's headers match the library]) 2138AC_MSG_CHECKING([whether OpenSSL's headers match the library])
2146AC_RUN_IFELSE( 2139AC_RUN_IFELSE(
2147 [AC_LANG_SOURCE([[ 2140 [AC_LANG_PROGRAM([[
2148#include <string.h> 2141#include <string.h>
2149#include <openssl/opensslv.h> 2142#include <openssl/opensslv.h>
2150int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } 2143 ]], [[
2144 exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
2151 ]])], 2145 ]])],
2152 [ 2146 [
2153 AC_MSG_RESULT(yes) 2147 AC_MSG_RESULT([yes])
2154 ], 2148 ],
2155 [ 2149 [
2156 AC_MSG_RESULT(no) 2150 AC_MSG_RESULT([no])
2157 if test "x$openssl_check_nonfatal" = "x"; then 2151 if test "x$openssl_check_nonfatal" = "x"; then
2158 AC_MSG_ERROR([Your OpenSSL headers do not match your 2152 AC_MSG_ERROR([Your OpenSSL headers do not match your
2159library. Check config.log for details. 2153library. Check config.log for details.
@@ -2174,85 +2168,84 @@ Also see contrib/findssl.sh for help identifying header/library mismatches.])
2174 2168
2175AC_MSG_CHECKING([if programs using OpenSSL functions will link]) 2169AC_MSG_CHECKING([if programs using OpenSSL functions will link])
2176AC_LINK_IFELSE( 2170AC_LINK_IFELSE(
2177 [AC_LANG_SOURCE([[ 2171 [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]],
2178#include <openssl/evp.h> 2172 [[ SSLeay_add_all_algorithms(); ]])],
2179int main(void) { SSLeay_add_all_algorithms(); }
2180 ]])],
2181 [ 2173 [
2182 AC_MSG_RESULT(yes) 2174 AC_MSG_RESULT([yes])
2183 ], 2175 ],
2184 [ 2176 [
2185 AC_MSG_RESULT(no) 2177 AC_MSG_RESULT([no])
2186 saved_LIBS="$LIBS" 2178 saved_LIBS="$LIBS"
2187 LIBS="$LIBS -ldl" 2179 LIBS="$LIBS -ldl"
2188 AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) 2180 AC_MSG_CHECKING([if programs using OpenSSL need -ldl])
2189 AC_LINK_IFELSE( 2181 AC_LINK_IFELSE(
2190 [AC_LANG_SOURCE([[ 2182 [AC_LANG_PROGRAM([[ #include <openssl/evp.h> ]],
2191#include <openssl/evp.h> 2183 [[ SSLeay_add_all_algorithms(); ]])],
2192int main(void) { SSLeay_add_all_algorithms(); }
2193 ]])],
2194 [ 2184 [
2195 AC_MSG_RESULT(yes) 2185 AC_MSG_RESULT([yes])
2196 ], 2186 ],
2197 [ 2187 [
2198 AC_MSG_RESULT(no) 2188 AC_MSG_RESULT([no])
2199 LIBS="$saved_LIBS" 2189 LIBS="$saved_LIBS"
2200 ] 2190 ]
2201 ) 2191 )
2202 ] 2192 ]
2203) 2193)
2204 2194
2205AC_CHECK_FUNCS(RSA_generate_key_ex DSA_generate_parameters_ex BN_is_prime_ex RSA_get_default_method) 2195AC_CHECK_FUNCS([RSA_generate_key_ex DSA_generate_parameters_ex BN_is_prime_ex RSA_get_default_method])
2206 2196
2207AC_ARG_WITH(ssl-engine, 2197AC_ARG_WITH([ssl-engine],
2208 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ], 2198 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ],
2209 [ if test "x$withval" != "xno" ; then 2199 [ if test "x$withval" != "xno" ; then
2210 AC_MSG_CHECKING(for OpenSSL ENGINE support) 2200 AC_MSG_CHECKING([for OpenSSL ENGINE support])
2211 AC_TRY_COMPILE( 2201 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2212 [ #include <openssl/engine.h>], 2202#include <openssl/engine.h>
2213 [ 2203 ]], [[
2214ENGINE_load_builtin_engines();ENGINE_register_all_complete(); 2204 ENGINE_load_builtin_engines();
2215 ], 2205 ENGINE_register_all_complete();
2216 [ AC_MSG_RESULT(yes) 2206 ]])],
2217 AC_DEFINE(USE_OPENSSL_ENGINE, 1, 2207 [ AC_MSG_RESULT([yes])
2208 AC_DEFINE([USE_OPENSSL_ENGINE], [1],
2218 [Enable OpenSSL engine support]) 2209 [Enable OpenSSL engine support])
2219 ], 2210 ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found])
2220 [ AC_MSG_ERROR(OpenSSL ENGINE support not found)] 2211 ])
2221 )
2222 fi ] 2212 fi ]
2223) 2213)
2224 2214
2225# Check for OpenSSL without EVP_aes_{192,256}_cbc 2215# Check for OpenSSL without EVP_aes_{192,256}_cbc
2226AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) 2216AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
2227AC_LINK_IFELSE( 2217AC_LINK_IFELSE(
2228 [AC_LANG_SOURCE([[ 2218 [AC_LANG_PROGRAM([[
2229#include <string.h> 2219#include <string.h>
2230#include <openssl/evp.h> 2220#include <openssl/evp.h>
2231int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);} 2221 ]], [[
2222 exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
2232 ]])], 2223 ]])],
2233 [ 2224 [
2234 AC_MSG_RESULT(no) 2225 AC_MSG_RESULT([no])
2235 ], 2226 ],
2236 [ 2227 [
2237 AC_MSG_RESULT(yes) 2228 AC_MSG_RESULT([yes])
2238 AC_DEFINE(OPENSSL_LOBOTOMISED_AES, 1, 2229 AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1],
2239 [libcrypto is missing AES 192 and 256 bit functions]) 2230 [libcrypto is missing AES 192 and 256 bit functions])
2240 ] 2231 ]
2241) 2232)
2242 2233
2243AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) 2234AC_MSG_CHECKING([if EVP_DigestUpdate returns an int])
2244AC_LINK_IFELSE( 2235AC_LINK_IFELSE(
2245 [AC_LANG_SOURCE([[ 2236 [AC_LANG_PROGRAM([[
2246#include <string.h> 2237#include <string.h>
2247#include <openssl/evp.h> 2238#include <openssl/evp.h>
2248int main(void) { if(EVP_DigestUpdate(NULL, NULL,0)) exit(0); } 2239 ]], [[
2240 if(EVP_DigestUpdate(NULL, NULL,0))
2241 exit(0);
2249 ]])], 2242 ]])],
2250 [ 2243 [
2251 AC_MSG_RESULT(yes) 2244 AC_MSG_RESULT([yes])
2252 ], 2245 ],
2253 [ 2246 [
2254 AC_MSG_RESULT(no) 2247 AC_MSG_RESULT([no])
2255 AC_DEFINE(OPENSSL_EVP_DIGESTUPDATE_VOID, 1, 2248 AC_DEFINE([OPENSSL_EVP_DIGESTUPDATE_VOID], [1],
2256 [Define if EVP_DigestUpdate returns void]) 2249 [Define if EVP_DigestUpdate returns void])
2257 ] 2250 ]
2258) 2251)
@@ -2260,24 +2253,24 @@ int main(void) { if(EVP_DigestUpdate(NULL, NULL,0)) exit(0); }
2260# Some systems want crypt() from libcrypt, *not* the version in OpenSSL, 2253# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
2261# because the system crypt() is more featureful. 2254# because the system crypt() is more featureful.
2262if test "x$check_for_libcrypt_before" = "x1"; then 2255if test "x$check_for_libcrypt_before" = "x1"; then
2263 AC_CHECK_LIB(crypt, crypt) 2256 AC_CHECK_LIB([crypt], [crypt])
2264fi 2257fi
2265 2258
2266# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the 2259# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
2267# version in OpenSSL. 2260# version in OpenSSL.
2268if test "x$check_for_libcrypt_later" = "x1"; then 2261if test "x$check_for_libcrypt_later" = "x1"; then
2269 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") 2262 AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"])
2270fi 2263fi
2271 2264
2272# Search for SHA256 support in libc and/or OpenSSL 2265# Search for SHA256 support in libc and/or OpenSSL
2273AC_CHECK_FUNCS(SHA256_Update EVP_sha256, [TEST_SSH_SHA256=yes], 2266AC_CHECK_FUNCS([SHA256_Update EVP_sha256], [TEST_SSH_SHA256=yes],
2274 [TEST_SSH_SHA256=no]) 2267 [TEST_SSH_SHA256=no])
2275AC_SUBST(TEST_SSH_SHA256) 2268AC_SUBST([TEST_SSH_SHA256])
2276 2269
2277# Check complete ECC support in OpenSSL 2270# Check complete ECC support in OpenSSL
2278AC_MSG_CHECKING([whether OpenSSL has complete ECC support]) 2271AC_MSG_CHECKING([whether OpenSSL has complete ECC support])
2279AC_LINK_IFELSE( 2272AC_LINK_IFELSE(
2280 [AC_LANG_SOURCE([[ 2273 [AC_LANG_PROGRAM([[
2281#include <openssl/ec.h> 2274#include <openssl/ec.h>
2282#include <openssl/ecdh.h> 2275#include <openssl/ecdh.h>
2283#include <openssl/ecdsa.h> 2276#include <openssl/ecdsa.h>
@@ -2287,32 +2280,31 @@ AC_LINK_IFELSE(
2287#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */ 2280#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
2288# error "OpenSSL < 0.9.8g has unreliable ECC code" 2281# error "OpenSSL < 0.9.8g has unreliable ECC code"
2289#endif 2282#endif
2290int main(void) { 2283 ]], [[
2291 EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); 2284 EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
2292 const EVP_MD *m = EVP_sha512(); /* We need this too */ 2285 const EVP_MD *m = EVP_sha512(); /* We need this too */
2293}
2294 ]])], 2286 ]])],
2295 [ 2287 [
2296 AC_MSG_RESULT(yes) 2288 AC_MSG_RESULT([yes])
2297 AC_DEFINE(OPENSSL_HAS_ECC, 1, 2289 AC_DEFINE([OPENSSL_HAS_ECC], [1],
2298 [libcrypto includes complete ECC support]) 2290 [libcrypto includes complete ECC support])
2299 TEST_SSH_ECC=yes 2291 TEST_SSH_ECC=yes
2300 COMMENT_OUT_ECC="" 2292 COMMENT_OUT_ECC=""
2301 ], 2293 ],
2302 [ 2294 [
2303 AC_MSG_RESULT(no) 2295 AC_MSG_RESULT([no])
2304 TEST_SSH_ECC=no 2296 TEST_SSH_ECC=no
2305 COMMENT_OUT_ECC="#no ecc#" 2297 COMMENT_OUT_ECC="#no ecc#"
2306 ] 2298 ]
2307) 2299)
2308AC_SUBST(TEST_SSH_ECC) 2300AC_SUBST([TEST_SSH_ECC])
2309AC_SUBST(COMMENT_OUT_ECC) 2301AC_SUBST([COMMENT_OUT_ECC])
2310 2302
2311saved_LIBS="$LIBS" 2303saved_LIBS="$LIBS"
2312AC_CHECK_LIB(iaf, ia_openinfo, [ 2304AC_CHECK_LIB([iaf], [ia_openinfo], [
2313 LIBS="$LIBS -liaf" 2305 LIBS="$LIBS -liaf"
2314 AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf" 2306 AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf"
2315 AC_DEFINE(HAVE_LIBIAF, 1, 2307 AC_DEFINE([HAVE_LIBIAF], [1],
2316 [Define if system has libiaf that supports set_id]) 2308 [Define if system has libiaf that supports set_id])
2317 ]) 2309 ])
2318]) 2310])
@@ -2323,128 +2315,29 @@ LIBS="$saved_LIBS"
2323# Check wheter OpenSSL seeds itself 2315# Check wheter OpenSSL seeds itself
2324AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) 2316AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
2325AC_RUN_IFELSE( 2317AC_RUN_IFELSE(
2326 [AC_LANG_SOURCE([[ 2318 [AC_LANG_PROGRAM([[
2327#include <string.h> 2319#include <string.h>
2328#include <openssl/rand.h> 2320#include <openssl/rand.h>
2329int main(void) { exit(RAND_status() == 1 ? 0 : 1); } 2321 ]], [[
2322 exit(RAND_status() == 1 ? 0 : 1);
2330 ]])], 2323 ]])],
2331 [ 2324 [
2332 OPENSSL_SEEDS_ITSELF=yes 2325 OPENSSL_SEEDS_ITSELF=yes
2333 AC_MSG_RESULT(yes) 2326 AC_MSG_RESULT([yes])
2334 ], 2327 ],
2335 [ 2328 [
2336 AC_MSG_RESULT(no) 2329 AC_MSG_RESULT([no])
2337 # Default to use of the rand helper if OpenSSL doesn't
2338 # seed itself
2339 USE_RAND_HELPER=yes
2340 ], 2330 ],
2341 [ 2331 [
2342 AC_MSG_WARN([cross compiling: assuming yes]) 2332 AC_MSG_WARN([cross compiling: assuming yes])
2343 # This is safe, since all recent OpenSSL versions will 2333 # This is safe, since we will fatal() at runtime if
2344 # complain at runtime if not seeded correctly. 2334 # OpenSSL is not seeded correctly.
2345 OPENSSL_SEEDS_ITSELF=yes 2335 OPENSSL_SEEDS_ITSELF=yes
2346 ] 2336 ]
2347) 2337)
2348 2338
2349# Check for PAM libs
2350PAM_MSG="no"
2351AC_ARG_WITH(pam,
2352 [ --with-pam Enable PAM support ],
2353 [
2354 if test "x$withval" != "xno" ; then
2355 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
2356 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
2357 AC_MSG_ERROR([PAM headers not found])
2358 fi
2359
2360 saved_LIBS="$LIBS"
2361 AC_CHECK_LIB(dl, dlopen, , )
2362 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
2363 AC_CHECK_FUNCS(pam_getenvlist)
2364 AC_CHECK_FUNCS(pam_putenv)
2365 LIBS="$saved_LIBS"
2366
2367 PAM_MSG="yes"
2368
2369 SSHDLIBS="$SSHDLIBS -lpam"
2370 AC_DEFINE(USE_PAM, 1,
2371 [Define if you want to enable PAM support])
2372
2373 if test $ac_cv_lib_dl_dlopen = yes; then
2374 case "$LIBS" in
2375 *-ldl*)
2376 # libdl already in LIBS
2377 ;;
2378 *)
2379 SSHDLIBS="$SSHDLIBS -ldl"
2380 ;;
2381 esac
2382 fi
2383 fi
2384 ]
2385)
2386
2387# Check for older PAM
2388if test "x$PAM_MSG" = "xyes" ; then
2389 # Check PAM strerror arguments (old PAM)
2390 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
2391 AC_TRY_COMPILE(
2392 [
2393#include <stdlib.h>
2394#if defined(HAVE_SECURITY_PAM_APPL_H)
2395#include <security/pam_appl.h>
2396#elif defined (HAVE_PAM_PAM_APPL_H)
2397#include <pam/pam_appl.h>
2398#endif
2399 ],
2400 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
2401 [AC_MSG_RESULT(no)],
2402 [
2403 AC_DEFINE(HAVE_OLD_PAM, 1,
2404 [Define if you have an old version of PAM
2405 which takes only one argument to pam_strerror])
2406 AC_MSG_RESULT(yes)
2407 PAM_MSG="yes (old library)"
2408 ]
2409 )
2410fi
2411
2412# Do we want to force the use of the rand helper?
2413AC_ARG_WITH(rand-helper,
2414 [ --with-rand-helper Use subprocess to gather strong randomness ],
2415 [
2416 if test "x$withval" = "xno" ; then
2417 # Force use of OpenSSL's internal RNG, even if
2418 # the previous test showed it to be unseeded.
2419 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
2420 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
2421 OPENSSL_SEEDS_ITSELF=yes
2422 USE_RAND_HELPER=""
2423 fi
2424 else
2425 USE_RAND_HELPER=yes
2426 fi
2427 ],
2428)
2429
2430# Which randomness source do we use?
2431if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then
2432 # OpenSSL only
2433 AC_DEFINE(OPENSSL_PRNG_ONLY, 1,
2434 [Define if you want OpenSSL's internally seeded PRNG only])
2435 RAND_MSG="OpenSSL internal ONLY"
2436 INSTALL_SSH_RAND_HELPER=""
2437elif test ! -z "$USE_RAND_HELPER" ; then
2438 # install rand helper
2439 RAND_MSG="ssh-rand-helper"
2440 INSTALL_SSH_RAND_HELPER="yes"
2441fi
2442AC_SUBST(INSTALL_SSH_RAND_HELPER)
2443
2444### Configuration of ssh-rand-helper
2445
2446# PRNGD TCP socket 2339# PRNGD TCP socket
2447AC_ARG_WITH(prngd-port, 2340AC_ARG_WITH([prngd-port],
2448 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT], 2341 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
2449 [ 2342 [
2450 case "$withval" in 2343 case "$withval" in
@@ -2454,19 +2347,19 @@ AC_ARG_WITH(prngd-port,
2454 [[0-9]]*) 2347 [[0-9]]*)
2455 ;; 2348 ;;
2456 *) 2349 *)
2457 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port) 2350 AC_MSG_ERROR([You must specify a numeric port number for --with-prngd-port])
2458 ;; 2351 ;;
2459 esac 2352 esac
2460 if test ! -z "$withval" ; then 2353 if test ! -z "$withval" ; then
2461 PRNGD_PORT="$withval" 2354 PRNGD_PORT="$withval"
2462 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT, 2355 AC_DEFINE_UNQUOTED([PRNGD_PORT], [$PRNGD_PORT],
2463 [Port number of PRNGD/EGD random number socket]) 2356 [Port number of PRNGD/EGD random number socket])
2464 fi 2357 fi
2465 ] 2358 ]
2466) 2359)
2467 2360
2468# PRNGD Unix domain socket 2361# PRNGD Unix domain socket
2469AC_ARG_WITH(prngd-socket, 2362AC_ARG_WITH([prngd-socket],
2470 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)], 2363 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
2471 [ 2364 [
2472 case "$withval" in 2365 case "$withval" in
@@ -2479,59 +2372,119 @@ AC_ARG_WITH(prngd-socket,
2479 /*) 2372 /*)
2480 ;; 2373 ;;
2481 *) 2374 *)
2482 AC_MSG_ERROR(You must specify an absolute path to the entropy socket) 2375 AC_MSG_ERROR([You must specify an absolute path to the entropy socket])
2483 ;; 2376 ;;
2484 esac 2377 esac
2485 2378
2486 if test ! -z "$withval" ; then 2379 if test ! -z "$withval" ; then
2487 if test ! -z "$PRNGD_PORT" ; then 2380 if test ! -z "$PRNGD_PORT" ; then
2488 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket) 2381 AC_MSG_ERROR([You may not specify both a PRNGD/EGD port and socket])
2489 fi 2382 fi
2490 if test ! -r "$withval" ; then 2383 if test ! -r "$withval" ; then
2491 AC_MSG_WARN(Entropy socket is not readable) 2384 AC_MSG_WARN([Entropy socket is not readable])
2492 fi 2385 fi
2493 PRNGD_SOCKET="$withval" 2386 PRNGD_SOCKET="$withval"
2494 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", 2387 AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"],
2495 [Location of PRNGD/EGD random number socket]) 2388 [Location of PRNGD/EGD random number socket])
2496 fi 2389 fi
2497 ], 2390 ],
2498 [ 2391 [
2499 # Check for existing socket only if we don't have a random device already 2392 # Check for existing socket only if we don't have a random device already
2500 if test "$USE_RAND_HELPER" = yes ; then 2393 if test "x$OPENSSL_SEEDS_ITSELF" != "xyes" ; then
2501 AC_MSG_CHECKING(for PRNGD/EGD socket) 2394 AC_MSG_CHECKING([for PRNGD/EGD socket])
2502 # Insert other locations here 2395 # Insert other locations here
2503 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do 2396 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
2504 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then 2397 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
2505 PRNGD_SOCKET="$sock" 2398 PRNGD_SOCKET="$sock"
2506 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET") 2399 AC_DEFINE_UNQUOTED([PRNGD_SOCKET], ["$PRNGD_SOCKET"])
2507 break; 2400 break;
2508 fi 2401 fi
2509 done 2402 done
2510 if test ! -z "$PRNGD_SOCKET" ; then 2403 if test ! -z "$PRNGD_SOCKET" ; then
2511 AC_MSG_RESULT($PRNGD_SOCKET) 2404 AC_MSG_RESULT([$PRNGD_SOCKET])
2512 else 2405 else
2513 AC_MSG_RESULT(not found) 2406 AC_MSG_RESULT([not found])
2514 fi 2407 fi
2515 fi 2408 fi
2516 ] 2409 ]
2517) 2410)
2518 2411
2519# Change default command timeout for hashing entropy source 2412# Which randomness source do we use?
2520entropy_timeout=200 2413if test ! -z "$PRNGD_PORT" ; then
2521AC_ARG_WITH(entropy-timeout, 2414 RAND_MSG="PRNGd port $PRNGD_PORT"
2522 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], 2415elif test ! -z "$PRNGD_SOCKET" ; then
2416 RAND_MSG="PRNGd socket $PRNGD_SOCKET"
2417elif test ! -z "$OPENSSL_SEEDS_ITSELF" ; then
2418 AC_DEFINE([OPENSSL_PRNG_ONLY], [1],
2419 [Define if you want OpenSSL's internally seeded PRNG only])
2420 RAND_MSG="OpenSSL internal ONLY"
2421else
2422 AC_MSG_ERROR([OpenSSH has no source of random numbers. Please configure OpenSSL with an entropy source or re-run configure using one of the --with-prngd-port or --with-prngd-socket options])
2423fi
2424
2425# Check for PAM libs
2426PAM_MSG="no"
2427AC_ARG_WITH([pam],
2428 [ --with-pam Enable PAM support ],
2523 [ 2429 [
2524 if test -n "$withval" && test "x$withval" != "xno" && \ 2430 if test "x$withval" != "xno" ; then
2525 test "x${withval}" != "xyes"; then 2431 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
2526 entropy_timeout=$withval 2432 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
2433 AC_MSG_ERROR([PAM headers not found])
2434 fi
2435
2436 saved_LIBS="$LIBS"
2437 AC_CHECK_LIB([dl], [dlopen], , )
2438 AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])])
2439 AC_CHECK_FUNCS([pam_getenvlist])
2440 AC_CHECK_FUNCS([pam_putenv])
2441 LIBS="$saved_LIBS"
2442
2443 PAM_MSG="yes"
2444
2445 SSHDLIBS="$SSHDLIBS -lpam"
2446 AC_DEFINE([USE_PAM], [1],
2447 [Define if you want to enable PAM support])
2448
2449 if test $ac_cv_lib_dl_dlopen = yes; then
2450 case "$LIBS" in
2451 *-ldl*)
2452 # libdl already in LIBS
2453 ;;
2454 *)
2455 SSHDLIBS="$SSHDLIBS -ldl"
2456 ;;
2457 esac
2458 fi
2527 fi 2459 fi
2528 ] 2460 ]
2529) 2461)
2530AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout, 2462
2531 [Builtin PRNG command timeout]) 2463# Check for older PAM
2464if test "x$PAM_MSG" = "xyes" ; then
2465 # Check PAM strerror arguments (old PAM)
2466 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
2467 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2468#include <stdlib.h>
2469#if defined(HAVE_SECURITY_PAM_APPL_H)
2470#include <security/pam_appl.h>
2471#elif defined (HAVE_PAM_PAM_APPL_H)
2472#include <pam/pam_appl.h>
2473#endif
2474 ]], [[
2475(void)pam_strerror((pam_handle_t *)NULL, -1);
2476 ]])], [AC_MSG_RESULT([no])], [
2477 AC_DEFINE([HAVE_OLD_PAM], [1],
2478 [Define if you have an old version of PAM
2479 which takes only one argument to pam_strerror])
2480 AC_MSG_RESULT([yes])
2481 PAM_MSG="yes (old library)"
2482
2483 ])
2484fi
2532 2485
2533SSH_PRIVSEP_USER=sshd 2486SSH_PRIVSEP_USER=sshd
2534AC_ARG_WITH(privsep-user, 2487AC_ARG_WITH([privsep-user],
2535 [ --with-privsep-user=user Specify non-privileged user for privilege separation], 2488 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
2536 [ 2489 [
2537 if test -n "$withval" && test "x$withval" != "xno" && \ 2490 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -2540,59 +2493,49 @@ AC_ARG_WITH(privsep-user,
2540 fi 2493 fi
2541 ] 2494 ]
2542) 2495)
2543AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER", 2496AC_DEFINE_UNQUOTED([SSH_PRIVSEP_USER], ["$SSH_PRIVSEP_USER"],
2544 [non-privileged user for privilege separation]) 2497 [non-privileged user for privilege separation])
2545AC_SUBST(SSH_PRIVSEP_USER) 2498AC_SUBST([SSH_PRIVSEP_USER])
2546
2547# We do this little dance with the search path to insure
2548# that programs that we select for use by installed programs
2549# (which may be run by the super-user) come from trusted
2550# locations before they come from the user's private area.
2551# This should help avoid accidentally configuring some
2552# random version of a program in someone's personal bin.
2553
2554OPATH=$PATH
2555PATH=/bin:/usr/bin
2556test -h /bin 2> /dev/null && PATH=/usr/bin
2557test -d /sbin && PATH=$PATH:/sbin
2558test -d /usr/sbin && PATH=$PATH:/usr/sbin
2559PATH=$PATH:/etc:$OPATH
2560
2561# These programs are used by the command hashing source to gather entropy
2562OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
2563OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
2564OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
2565OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
2566OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
2567OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
2568OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
2569OSSH_PATH_ENTROPY_PROG(PROG_W, w)
2570OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
2571OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
2572OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
2573OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
2574OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
2575OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
2576OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
2577OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
2578# restore PATH
2579PATH=$OPATH
2580
2581# Where does ssh-rand-helper get its randomness from?
2582INSTALL_SSH_PRNG_CMDS=""
2583if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
2584 if test ! -z "$PRNGD_PORT" ; then
2585 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
2586 elif test ! -z "$PRNGD_SOCKET" ; then
2587 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
2588 else
2589 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
2590 RAND_HELPER_CMDHASH=yes
2591 INSTALL_SSH_PRNG_CMDS="yes"
2592 fi
2593fi
2594AC_SUBST(INSTALL_SSH_PRNG_CMDS)
2595 2499
2500# Decide which sandbox style to use
2501sandbox_arg=""
2502AC_ARG_WITH([sandbox],
2503 [ --with-sandbox=style Specify privilege separation sandbox (no, darwin, rlimit, systrace)],
2504 [
2505 if test "x$withval" = "xyes" ; then
2506 sandbox_arg=""
2507 else
2508 sandbox_arg="$withval"
2509 fi
2510 ]
2511)
2512if test "x$sandbox_arg" = "xsystrace" || \
2513 ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then
2514 test "x$have_systr_policy_kill" != "x1" && \
2515 AC_MSG_ERROR([systrace sandbox requires systrace headers and SYSTR_POLICY_KILL support])
2516 SANDBOX_STYLE="systrace"
2517 AC_DEFINE([SANDBOX_SYSTRACE], [1], [Sandbox using systrace(4)])
2518elif test "x$sandbox_arg" = "xdarwin" || \
2519 ( test -z "$sandbox_arg" && test "x$ac_cv_func_sandbox_init" = "xyes" && \
2520 test "x$ac_cv_header_sandbox_h" = "xyes") ; then
2521 test "x$ac_cv_func_sandbox_init" != "xyes" -o \
2522 "x$ac_cv_header_sandbox_h" != "xyes" && \
2523 AC_MSG_ERROR([Darwin seatbelt sandbox requires sandbox.h and sandbox_init function])
2524 SANDBOX_STYLE="darwin"
2525 AC_DEFINE([SANDBOX_DARWIN], [1], [Sandbox using Darwin sandbox_init(3)])
2526elif test "x$sandbox_arg" = "xrlimit" || \
2527 ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" ) ; then
2528 test "x$ac_cv_func_setrlimit" != "xyes" && \
2529 AC_MSG_ERROR([rlimit sandbox requires setrlimit function])
2530 SANDBOX_STYLE="rlimit"
2531 AC_DEFINE([SANDBOX_RLIMIT], [1], [Sandbox using setrlimit(2)])
2532elif test -z "$sandbox_arg" || test "x$sandbox_arg" = "xno" || \
2533 test "x$sandbox_arg" = "xnone" || test "x$sandbox_arg" = "xnull" ; then
2534 SANDBOX_STYLE="none"
2535 AC_DEFINE([SANDBOX_NULL], [1], [no privsep sandboxing])
2536else
2537 AC_MSG_ERROR([unsupported --with-sandbox])
2538fi
2596 2539
2597# Cheap hack to ensure NEWS-OS libraries are arranged right. 2540# Cheap hack to ensure NEWS-OS libraries are arranged right.
2598if test ! -z "$SONY" ; then 2541if test ! -z "$SONY" ; then
@@ -2603,11 +2546,11 @@ fi
2603AC_CHECK_TYPES([long long, unsigned long long, long double]) 2546AC_CHECK_TYPES([long long, unsigned long long, long double])
2604 2547
2605# Check datatype sizes 2548# Check datatype sizes
2606AC_CHECK_SIZEOF(char, 1) 2549AC_CHECK_SIZEOF([char], [1])
2607AC_CHECK_SIZEOF(short int, 2) 2550AC_CHECK_SIZEOF([short int], [2])
2608AC_CHECK_SIZEOF(int, 4) 2551AC_CHECK_SIZEOF([int], [4])
2609AC_CHECK_SIZEOF(long int, 4) 2552AC_CHECK_SIZEOF([long int], [4])
2610AC_CHECK_SIZEOF(long long int, 8) 2553AC_CHECK_SIZEOF([long long int], [8])
2611 2554
2612# Sanity check long long for some platforms (AIX) 2555# Sanity check long long for some platforms (AIX)
2613if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then 2556if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
@@ -2618,7 +2561,7 @@ fi
2618if test -z "$have_llong_max"; then 2561if test -z "$have_llong_max"; then
2619 AC_MSG_CHECKING([for max value of long long]) 2562 AC_MSG_CHECKING([for max value of long long])
2620 AC_RUN_IFELSE( 2563 AC_RUN_IFELSE(
2621 [AC_LANG_SOURCE([[ 2564 [AC_LANG_PROGRAM([[
2622#include <stdio.h> 2565#include <stdio.h>
2623/* Why is this so damn hard? */ 2566/* Why is this so damn hard? */
2624#ifdef __GNUC__ 2567#ifdef __GNUC__
@@ -2654,8 +2597,7 @@ fprint_ll(FILE *f, long long n)
2654 return -1; 2597 return -1;
2655 return 0; 2598 return 0;
2656} 2599}
2657 2600 ]], [[
2658int main(void) {
2659 FILE *f; 2601 FILE *f;
2660 long long i, llmin, llmax = 0; 2602 long long i, llmin, llmax = 0;
2661 2603
@@ -2689,22 +2631,21 @@ int main(void) {
2689 if (fclose(f) < 0) 2631 if (fclose(f) < 0)
2690 exit(5); 2632 exit(5);
2691 exit(0); 2633 exit(0);
2692}
2693 ]])], 2634 ]])],
2694 [ 2635 [
2695 llong_min=`$AWK '{print $1}' conftest.llminmax` 2636 llong_min=`$AWK '{print $1}' conftest.llminmax`
2696 llong_max=`$AWK '{print $2}' conftest.llminmax` 2637 llong_max=`$AWK '{print $2}' conftest.llminmax`
2697 2638
2698 AC_MSG_RESULT($llong_max) 2639 AC_MSG_RESULT([$llong_max])
2699 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], 2640 AC_DEFINE_UNQUOTED([LLONG_MAX], [${llong_max}LL],
2700 [max value of long long calculated by configure]) 2641 [max value of long long calculated by configure])
2701 AC_MSG_CHECKING([for min value of long long]) 2642 AC_MSG_CHECKING([for min value of long long])
2702 AC_MSG_RESULT($llong_min) 2643 AC_MSG_RESULT([$llong_min])
2703 AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL], 2644 AC_DEFINE_UNQUOTED([LLONG_MIN], [${llong_min}LL],
2704 [min value of long long calculated by configure]) 2645 [min value of long long calculated by configure])
2705 ], 2646 ],
2706 [ 2647 [
2707 AC_MSG_RESULT(not found) 2648 AC_MSG_RESULT([not found])
2708 ], 2649 ],
2709 [ 2650 [
2710 AC_MSG_WARN([cross compiling: not checking]) 2651 AC_MSG_WARN([cross compiling: not checking])
@@ -2715,28 +2656,24 @@ fi
2715 2656
2716# More checks for data types 2657# More checks for data types
2717AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ 2658AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
2718 AC_TRY_COMPILE( 2659 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2719 [ #include <sys/types.h> ], 2660 [[ u_int a; a = 1;]])],
2720 [ u_int a; a = 1;], 2661 [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no"
2721 [ ac_cv_have_u_int="yes" ], 2662 ])
2722 [ ac_cv_have_u_int="no" ]
2723 )
2724]) 2663])
2725if test "x$ac_cv_have_u_int" = "xyes" ; then 2664if test "x$ac_cv_have_u_int" = "xyes" ; then
2726 AC_DEFINE(HAVE_U_INT, 1, [define if you have u_int data type]) 2665 AC_DEFINE([HAVE_U_INT], [1], [define if you have u_int data type])
2727 have_u_int=1 2666 have_u_int=1
2728fi 2667fi
2729 2668
2730AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ 2669AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
2731 AC_TRY_COMPILE( 2670 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2732 [ #include <sys/types.h> ], 2671 [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],
2733 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], 2672 [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no"
2734 [ ac_cv_have_intxx_t="yes" ], 2673 ])
2735 [ ac_cv_have_intxx_t="no" ]
2736 )
2737]) 2674])
2738if test "x$ac_cv_have_intxx_t" = "xyes" ; then 2675if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2739 AC_DEFINE(HAVE_INTXX_T, 1, [define if you have intxx_t data type]) 2676 AC_DEFINE([HAVE_INTXX_T], [1], [define if you have intxx_t data type])
2740 have_intxx_t=1 2677 have_intxx_t=1
2741fi 2678fi
2742 2679
@@ -2744,20 +2681,17 @@ if (test -z "$have_intxx_t" && \
2744 test "x$ac_cv_header_stdint_h" = "xyes") 2681 test "x$ac_cv_header_stdint_h" = "xyes")
2745then 2682then
2746 AC_MSG_CHECKING([for intXX_t types in stdint.h]) 2683 AC_MSG_CHECKING([for intXX_t types in stdint.h])
2747 AC_TRY_COMPILE( 2684 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]],
2748 [ #include <stdint.h> ], 2685 [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],
2749 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
2750 [ 2686 [
2751 AC_DEFINE(HAVE_INTXX_T) 2687 AC_DEFINE([HAVE_INTXX_T])
2752 AC_MSG_RESULT(yes) 2688 AC_MSG_RESULT([yes])
2753 ], 2689 ], [ AC_MSG_RESULT([no])
2754 [ AC_MSG_RESULT(no) ] 2690 ])
2755 )
2756fi 2691fi
2757 2692
2758AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ 2693AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2759 AC_TRY_COMPILE( 2694 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2760 [
2761#include <sys/types.h> 2695#include <sys/types.h>
2762#ifdef HAVE_STDINT_H 2696#ifdef HAVE_STDINT_H
2763# include <stdint.h> 2697# include <stdint.h>
@@ -2766,139 +2700,124 @@ AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
2766#ifdef HAVE_SYS_BITYPES_H 2700#ifdef HAVE_SYS_BITYPES_H
2767# include <sys/bitypes.h> 2701# include <sys/bitypes.h>
2768#endif 2702#endif
2769 ], 2703 ]], [[
2770 [ int64_t a; a = 1;], 2704int64_t a; a = 1;
2771 [ ac_cv_have_int64_t="yes" ], 2705 ]])],
2772 [ ac_cv_have_int64_t="no" ] 2706 [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no"
2773 ) 2707 ])
2774]) 2708])
2775if test "x$ac_cv_have_int64_t" = "xyes" ; then 2709if test "x$ac_cv_have_int64_t" = "xyes" ; then
2776 AC_DEFINE(HAVE_INT64_T, 1, [define if you have int64_t data type]) 2710 AC_DEFINE([HAVE_INT64_T], [1], [define if you have int64_t data type])
2777fi 2711fi
2778 2712
2779AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ 2713AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
2780 AC_TRY_COMPILE( 2714 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2781 [ #include <sys/types.h> ], 2715 [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],
2782 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], 2716 [ ac_cv_have_u_intxx_t="yes" ], [ ac_cv_have_u_intxx_t="no"
2783 [ ac_cv_have_u_intxx_t="yes" ], 2717 ])
2784 [ ac_cv_have_u_intxx_t="no" ]
2785 )
2786]) 2718])
2787if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then 2719if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2788 AC_DEFINE(HAVE_U_INTXX_T, 1, [define if you have u_intxx_t data type]) 2720 AC_DEFINE([HAVE_U_INTXX_T], [1], [define if you have u_intxx_t data type])
2789 have_u_intxx_t=1 2721 have_u_intxx_t=1
2790fi 2722fi
2791 2723
2792if test -z "$have_u_intxx_t" ; then 2724if test -z "$have_u_intxx_t" ; then
2793 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) 2725 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
2794 AC_TRY_COMPILE( 2726 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]],
2795 [ #include <sys/socket.h> ], 2727 [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],
2796 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
2797 [ 2728 [
2798 AC_DEFINE(HAVE_U_INTXX_T) 2729 AC_DEFINE([HAVE_U_INTXX_T])
2799 AC_MSG_RESULT(yes) 2730 AC_MSG_RESULT([yes])
2800 ], 2731 ], [ AC_MSG_RESULT([no])
2801 [ AC_MSG_RESULT(no) ] 2732 ])
2802 )
2803fi 2733fi
2804 2734
2805AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ 2735AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
2806 AC_TRY_COMPILE( 2736 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2807 [ #include <sys/types.h> ], 2737 [[ u_int64_t a; a = 1;]])],
2808 [ u_int64_t a; a = 1;], 2738 [ ac_cv_have_u_int64_t="yes" ], [ ac_cv_have_u_int64_t="no"
2809 [ ac_cv_have_u_int64_t="yes" ], 2739 ])
2810 [ ac_cv_have_u_int64_t="no" ]
2811 )
2812]) 2740])
2813if test "x$ac_cv_have_u_int64_t" = "xyes" ; then 2741if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2814 AC_DEFINE(HAVE_U_INT64_T, 1, [define if you have u_int64_t data type]) 2742 AC_DEFINE([HAVE_U_INT64_T], [1], [define if you have u_int64_t data type])
2815 have_u_int64_t=1 2743 have_u_int64_t=1
2816fi 2744fi
2817 2745
2818if test -z "$have_u_int64_t" ; then 2746if test -z "$have_u_int64_t" ; then
2819 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) 2747 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
2820 AC_TRY_COMPILE( 2748 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]],
2821 [ #include <sys/bitypes.h> ], 2749 [[ u_int64_t a; a = 1]])],
2822 [ u_int64_t a; a = 1],
2823 [ 2750 [
2824 AC_DEFINE(HAVE_U_INT64_T) 2751 AC_DEFINE([HAVE_U_INT64_T])
2825 AC_MSG_RESULT(yes) 2752 AC_MSG_RESULT([yes])
2826 ], 2753 ], [ AC_MSG_RESULT([no])
2827 [ AC_MSG_RESULT(no) ] 2754 ])
2828 )
2829fi 2755fi
2830 2756
2831if test -z "$have_u_intxx_t" ; then 2757if test -z "$have_u_intxx_t" ; then
2832 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ 2758 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
2833 AC_TRY_COMPILE( 2759 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2834 [
2835#include <sys/types.h> 2760#include <sys/types.h>
2836 ], 2761 ]], [[
2837 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], 2762 uint8_t a;
2838 [ ac_cv_have_uintxx_t="yes" ], 2763 uint16_t b;
2839 [ ac_cv_have_uintxx_t="no" ] 2764 uint32_t c;
2840 ) 2765 a = b = c = 1;
2766 ]])],
2767 [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no"
2768 ])
2841 ]) 2769 ])
2842 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then 2770 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2843 AC_DEFINE(HAVE_UINTXX_T, 1, 2771 AC_DEFINE([HAVE_UINTXX_T], [1],
2844 [define if you have uintxx_t data type]) 2772 [define if you have uintxx_t data type])
2845 fi 2773 fi
2846fi 2774fi
2847 2775
2848if test -z "$have_uintxx_t" ; then 2776if test -z "$have_uintxx_t" ; then
2849 AC_MSG_CHECKING([for uintXX_t types in stdint.h]) 2777 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
2850 AC_TRY_COMPILE( 2778 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]],
2851 [ #include <stdint.h> ], 2779 [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])],
2852 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
2853 [ 2780 [
2854 AC_DEFINE(HAVE_UINTXX_T) 2781 AC_DEFINE([HAVE_UINTXX_T])
2855 AC_MSG_RESULT(yes) 2782 AC_MSG_RESULT([yes])
2856 ], 2783 ], [ AC_MSG_RESULT([no])
2857 [ AC_MSG_RESULT(no) ] 2784 ])
2858 )
2859fi 2785fi
2860 2786
2861if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ 2787if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2862 test "x$ac_cv_header_sys_bitypes_h" = "xyes") 2788 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2863then 2789then
2864 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) 2790 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2865 AC_TRY_COMPILE( 2791 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2866 [
2867#include <sys/bitypes.h> 2792#include <sys/bitypes.h>
2868 ], 2793 ]], [[
2869 [
2870 int8_t a; int16_t b; int32_t c; 2794 int8_t a; int16_t b; int32_t c;
2871 u_int8_t e; u_int16_t f; u_int32_t g; 2795 u_int8_t e; u_int16_t f; u_int32_t g;
2872 a = b = c = e = f = g = 1; 2796 a = b = c = e = f = g = 1;
2873 ], 2797 ]])],
2874 [ 2798 [
2875 AC_DEFINE(HAVE_U_INTXX_T) 2799 AC_DEFINE([HAVE_U_INTXX_T])
2876 AC_DEFINE(HAVE_INTXX_T) 2800 AC_DEFINE([HAVE_INTXX_T])
2877 AC_MSG_RESULT(yes) 2801 AC_MSG_RESULT([yes])
2878 ], 2802 ], [AC_MSG_RESULT([no])
2879 [AC_MSG_RESULT(no)] 2803 ])
2880 )
2881fi 2804fi
2882 2805
2883 2806
2884AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ 2807AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
2885 AC_TRY_COMPILE( 2808 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2886 [ 2809 [[ u_char foo; foo = 125; ]])],
2887#include <sys/types.h> 2810 [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no"
2888 ], 2811 ])
2889 [ u_char foo; foo = 125; ],
2890 [ ac_cv_have_u_char="yes" ],
2891 [ ac_cv_have_u_char="no" ]
2892 )
2893]) 2812])
2894if test "x$ac_cv_have_u_char" = "xyes" ; then 2813if test "x$ac_cv_have_u_char" = "xyes" ; then
2895 AC_DEFINE(HAVE_U_CHAR, 1, [define if you have u_char data type]) 2814 AC_DEFINE([HAVE_U_CHAR], [1], [define if you have u_char data type])
2896fi 2815fi
2897 2816
2898TYPE_SOCKLEN_T 2817TYPE_SOCKLEN_T
2899 2818
2900AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) 2819AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>])
2901AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t],,,[ 2820AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [
2902#include <sys/types.h> 2821#include <sys/types.h>
2903#ifdef HAVE_SYS_BITYPES_H 2822#ifdef HAVE_SYS_BITYPES_H
2904#include <sys/bitypes.h> 2823#include <sys/bitypes.h>
@@ -2911,156 +2830,125 @@ AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t],,,[
2911#endif 2830#endif
2912]) 2831])
2913 2832
2914AC_CHECK_TYPES([in_addr_t, in_port_t],,, 2833AC_CHECK_TYPES([in_addr_t, in_port_t], , ,
2915[#include <sys/types.h> 2834[#include <sys/types.h>
2916#include <netinet/in.h>]) 2835#include <netinet/in.h>])
2917 2836
2918AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ 2837AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
2919 AC_TRY_COMPILE( 2838 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2920 [ 2839 [[ size_t foo; foo = 1235; ]])],
2921#include <sys/types.h> 2840 [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no"
2922 ], 2841 ])
2923 [ size_t foo; foo = 1235; ],
2924 [ ac_cv_have_size_t="yes" ],
2925 [ ac_cv_have_size_t="no" ]
2926 )
2927]) 2842])
2928if test "x$ac_cv_have_size_t" = "xyes" ; then 2843if test "x$ac_cv_have_size_t" = "xyes" ; then
2929 AC_DEFINE(HAVE_SIZE_T, 1, [define if you have size_t data type]) 2844 AC_DEFINE([HAVE_SIZE_T], [1], [define if you have size_t data type])
2930fi 2845fi
2931 2846
2932AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ 2847AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
2933 AC_TRY_COMPILE( 2848 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2934 [ 2849 [[ ssize_t foo; foo = 1235; ]])],
2935#include <sys/types.h> 2850 [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no"
2936 ], 2851 ])
2937 [ ssize_t foo; foo = 1235; ],
2938 [ ac_cv_have_ssize_t="yes" ],
2939 [ ac_cv_have_ssize_t="no" ]
2940 )
2941]) 2852])
2942if test "x$ac_cv_have_ssize_t" = "xyes" ; then 2853if test "x$ac_cv_have_ssize_t" = "xyes" ; then
2943 AC_DEFINE(HAVE_SSIZE_T, 1, [define if you have ssize_t data type]) 2854 AC_DEFINE([HAVE_SSIZE_T], [1], [define if you have ssize_t data type])
2944fi 2855fi
2945 2856
2946AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ 2857AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
2947 AC_TRY_COMPILE( 2858 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <time.h> ]],
2948 [ 2859 [[ clock_t foo; foo = 1235; ]])],
2949#include <time.h> 2860 [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no"
2950 ], 2861 ])
2951 [ clock_t foo; foo = 1235; ],
2952 [ ac_cv_have_clock_t="yes" ],
2953 [ ac_cv_have_clock_t="no" ]
2954 )
2955]) 2862])
2956if test "x$ac_cv_have_clock_t" = "xyes" ; then 2863if test "x$ac_cv_have_clock_t" = "xyes" ; then
2957 AC_DEFINE(HAVE_CLOCK_T, 1, [define if you have clock_t data type]) 2864 AC_DEFINE([HAVE_CLOCK_T], [1], [define if you have clock_t data type])
2958fi 2865fi
2959 2866
2960AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ 2867AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
2961 AC_TRY_COMPILE( 2868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2962 [
2963#include <sys/types.h> 2869#include <sys/types.h>
2964#include <sys/socket.h> 2870#include <sys/socket.h>
2965 ], 2871 ]], [[ sa_family_t foo; foo = 1235; ]])],
2966 [ sa_family_t foo; foo = 1235; ], 2872 [ ac_cv_have_sa_family_t="yes" ],
2967 [ ac_cv_have_sa_family_t="yes" ], 2873 [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2968 [ AC_TRY_COMPILE(
2969 [
2970#include <sys/types.h> 2874#include <sys/types.h>
2971#include <sys/socket.h> 2875#include <sys/socket.h>
2972#include <netinet/in.h> 2876#include <netinet/in.h>
2973 ], 2877 ]], [[ sa_family_t foo; foo = 1235; ]])],
2974 [ sa_family_t foo; foo = 1235; ],
2975 [ ac_cv_have_sa_family_t="yes" ], 2878 [ ac_cv_have_sa_family_t="yes" ],
2976
2977 [ ac_cv_have_sa_family_t="no" ] 2879 [ ac_cv_have_sa_family_t="no" ]
2978 )]
2979 ) 2880 )
2881 ])
2980]) 2882])
2981if test "x$ac_cv_have_sa_family_t" = "xyes" ; then 2883if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
2982 AC_DEFINE(HAVE_SA_FAMILY_T, 1, 2884 AC_DEFINE([HAVE_SA_FAMILY_T], [1],
2983 [define if you have sa_family_t data type]) 2885 [define if you have sa_family_t data type])
2984fi 2886fi
2985 2887
2986AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ 2888AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
2987 AC_TRY_COMPILE( 2889 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
2988 [ 2890 [[ pid_t foo; foo = 1235; ]])],
2989#include <sys/types.h> 2891 [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no"
2990 ], 2892 ])
2991 [ pid_t foo; foo = 1235; ],
2992 [ ac_cv_have_pid_t="yes" ],
2993 [ ac_cv_have_pid_t="no" ]
2994 )
2995]) 2893])
2996if test "x$ac_cv_have_pid_t" = "xyes" ; then 2894if test "x$ac_cv_have_pid_t" = "xyes" ; then
2997 AC_DEFINE(HAVE_PID_T, 1, [define if you have pid_t data type]) 2895 AC_DEFINE([HAVE_PID_T], [1], [define if you have pid_t data type])
2998fi 2896fi
2999 2897
3000AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ 2898AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
3001 AC_TRY_COMPILE( 2899 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]],
3002 [ 2900 [[ mode_t foo; foo = 1235; ]])],
3003#include <sys/types.h> 2901 [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no"
3004 ], 2902 ])
3005 [ mode_t foo; foo = 1235; ],
3006 [ ac_cv_have_mode_t="yes" ],
3007 [ ac_cv_have_mode_t="no" ]
3008 )
3009]) 2903])
3010if test "x$ac_cv_have_mode_t" = "xyes" ; then 2904if test "x$ac_cv_have_mode_t" = "xyes" ; then
3011 AC_DEFINE(HAVE_MODE_T, 1, [define if you have mode_t data type]) 2905 AC_DEFINE([HAVE_MODE_T], [1], [define if you have mode_t data type])
3012fi 2906fi
3013 2907
3014 2908
3015AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ 2909AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
3016 AC_TRY_COMPILE( 2910 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3017 [
3018#include <sys/types.h> 2911#include <sys/types.h>
3019#include <sys/socket.h> 2912#include <sys/socket.h>
3020 ], 2913 ]], [[ struct sockaddr_storage s; ]])],
3021 [ struct sockaddr_storage s; ], 2914 [ ac_cv_have_struct_sockaddr_storage="yes" ],
3022 [ ac_cv_have_struct_sockaddr_storage="yes" ], 2915 [ ac_cv_have_struct_sockaddr_storage="no"
3023 [ ac_cv_have_struct_sockaddr_storage="no" ] 2916 ])
3024 )
3025]) 2917])
3026if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then 2918if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
3027 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, 2919 AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1],
3028 [define if you have struct sockaddr_storage data type]) 2920 [define if you have struct sockaddr_storage data type])
3029fi 2921fi
3030 2922
3031AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ 2923AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
3032 AC_TRY_COMPILE( 2924 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3033 [
3034#include <sys/types.h> 2925#include <sys/types.h>
3035#include <netinet/in.h> 2926#include <netinet/in.h>
3036 ], 2927 ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])],
3037 [ struct sockaddr_in6 s; s.sin6_family = 0; ], 2928 [ ac_cv_have_struct_sockaddr_in6="yes" ],
3038 [ ac_cv_have_struct_sockaddr_in6="yes" ], 2929 [ ac_cv_have_struct_sockaddr_in6="no"
3039 [ ac_cv_have_struct_sockaddr_in6="no" ] 2930 ])
3040 )
3041]) 2931])
3042if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then 2932if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
3043 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, 2933 AC_DEFINE([HAVE_STRUCT_SOCKADDR_IN6], [1],
3044 [define if you have struct sockaddr_in6 data type]) 2934 [define if you have struct sockaddr_in6 data type])
3045fi 2935fi
3046 2936
3047AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ 2937AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
3048 AC_TRY_COMPILE( 2938 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3049 [
3050#include <sys/types.h> 2939#include <sys/types.h>
3051#include <netinet/in.h> 2940#include <netinet/in.h>
3052 ], 2941 ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])],
3053 [ struct in6_addr s; s.s6_addr[0] = 0; ], 2942 [ ac_cv_have_struct_in6_addr="yes" ],
3054 [ ac_cv_have_struct_in6_addr="yes" ], 2943 [ ac_cv_have_struct_in6_addr="no"
3055 [ ac_cv_have_struct_in6_addr="no" ] 2944 ])
3056 )
3057]) 2945])
3058if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then 2946if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
3059 AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, 2947 AC_DEFINE([HAVE_STRUCT_IN6_ADDR], [1],
3060 [define if you have struct in6_addr data type]) 2948 [define if you have struct in6_addr data type])
3061 2949
3062dnl Now check for sin6_scope_id 2950dnl Now check for sin6_scope_id
3063 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, 2951 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], , ,
3064 [ 2952 [
3065#ifdef HAVE_SYS_TYPES_H 2953#ifdef HAVE_SYS_TYPES_H
3066#include <sys/types.h> 2954#include <sys/types.h>
@@ -3070,36 +2958,33 @@ dnl Now check for sin6_scope_id
3070fi 2958fi
3071 2959
3072AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ 2960AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
3073 AC_TRY_COMPILE( 2961 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3074 [
3075#include <sys/types.h> 2962#include <sys/types.h>
3076#include <sys/socket.h> 2963#include <sys/socket.h>
3077#include <netdb.h> 2964#include <netdb.h>
3078 ], 2965 ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])],
3079 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], 2966 [ ac_cv_have_struct_addrinfo="yes" ],
3080 [ ac_cv_have_struct_addrinfo="yes" ], 2967 [ ac_cv_have_struct_addrinfo="no"
3081 [ ac_cv_have_struct_addrinfo="no" ] 2968 ])
3082 )
3083]) 2969])
3084if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then 2970if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
3085 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, 2971 AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1],
3086 [define if you have struct addrinfo data type]) 2972 [define if you have struct addrinfo data type])
3087fi 2973fi
3088 2974
3089AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ 2975AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
3090 AC_TRY_COMPILE( 2976 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]],
3091 [ #include <sys/time.h> ], 2977 [[ struct timeval tv; tv.tv_sec = 1;]])],
3092 [ struct timeval tv; tv.tv_sec = 1;], 2978 [ ac_cv_have_struct_timeval="yes" ],
3093 [ ac_cv_have_struct_timeval="yes" ], 2979 [ ac_cv_have_struct_timeval="no"
3094 [ ac_cv_have_struct_timeval="no" ] 2980 ])
3095 )
3096]) 2981])
3097if test "x$ac_cv_have_struct_timeval" = "xyes" ; then 2982if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
3098 AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if you have struct timeval]) 2983 AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval])
3099 have_struct_timeval=1 2984 have_struct_timeval=1
3100fi 2985fi
3101 2986
3102AC_CHECK_TYPES(struct timespec) 2987AC_CHECK_TYPES([struct timespec])
3103 2988
3104# We need int64_t or else certian parts of the compile will fail. 2989# We need int64_t or else certian parts of the compile will fail.
3105if test "x$ac_cv_have_int64_t" = "xno" && \ 2990if test "x$ac_cv_have_int64_t" = "xno" && \
@@ -3135,32 +3020,32 @@ main()
3135#else 3020#else
3136main() { exit(0); } 3021main() { exit(0); }
3137#endif 3022#endif
3138 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ], 3023 ]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ],
3139 AC_MSG_WARN([cross compiling: Assuming working snprintf()]) 3024 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
3140 ) 3025 )
3141fi 3026fi
3142 3027
3143dnl Checks for structure members 3028dnl Checks for structure members
3144OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) 3029OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmp.h], [HAVE_HOST_IN_UTMP])
3145OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) 3030OSSH_CHECK_HEADER_FOR_FIELD([ut_host], [utmpx.h], [HAVE_HOST_IN_UTMPX])
3146OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) 3031OSSH_CHECK_HEADER_FOR_FIELD([syslen], [utmpx.h], [HAVE_SYSLEN_IN_UTMPX])
3147OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) 3032OSSH_CHECK_HEADER_FOR_FIELD([ut_pid], [utmp.h], [HAVE_PID_IN_UTMP])
3148OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP) 3033OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmp.h], [HAVE_TYPE_IN_UTMP])
3149OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX) 3034OSSH_CHECK_HEADER_FOR_FIELD([ut_type], [utmpx.h], [HAVE_TYPE_IN_UTMPX])
3150OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) 3035OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmp.h], [HAVE_TV_IN_UTMP])
3151OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP) 3036OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmp.h], [HAVE_ID_IN_UTMP])
3152OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX) 3037OSSH_CHECK_HEADER_FOR_FIELD([ut_id], [utmpx.h], [HAVE_ID_IN_UTMPX])
3153OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) 3038OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP])
3154OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) 3039OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX])
3155OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) 3040OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP])
3156OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX) 3041OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX])
3157OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) 3042OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP])
3158OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) 3043OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP])
3159OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) 3044OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX])
3160OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) 3045OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX])
3161 3046
3162AC_CHECK_MEMBERS([struct stat.st_blksize]) 3047AC_CHECK_MEMBERS([struct stat.st_blksize])
3163AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state, 3048AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state],
3164 [Define if we don't have struct __res_state in resolv.h])], 3049 [Define if we don't have struct __res_state in resolv.h])],
3165[ 3050[
3166#include <stdio.h> 3051#include <stdio.h>
@@ -3174,94 +3059,79 @@ AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state,
3174 3059
3175AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], 3060AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
3176 ac_cv_have_ss_family_in_struct_ss, [ 3061 ac_cv_have_ss_family_in_struct_ss, [
3177 AC_TRY_COMPILE( 3062 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3178 [
3179#include <sys/types.h> 3063#include <sys/types.h>
3180#include <sys/socket.h> 3064#include <sys/socket.h>
3181 ], 3065 ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])],
3182 [ struct sockaddr_storage s; s.ss_family = 1; ], 3066 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
3183 [ ac_cv_have_ss_family_in_struct_ss="yes" ], 3067 [ ac_cv_have_ss_family_in_struct_ss="no" ])
3184 [ ac_cv_have_ss_family_in_struct_ss="no" ],
3185 )
3186]) 3068])
3187if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then 3069if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
3188 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Fields in struct sockaddr_storage]) 3070 AC_DEFINE([HAVE_SS_FAMILY_IN_SS], [1], [Fields in struct sockaddr_storage])
3189fi 3071fi
3190 3072
3191AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], 3073AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
3192 ac_cv_have___ss_family_in_struct_ss, [ 3074 ac_cv_have___ss_family_in_struct_ss, [
3193 AC_TRY_COMPILE( 3075 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3194 [
3195#include <sys/types.h> 3076#include <sys/types.h>
3196#include <sys/socket.h> 3077#include <sys/socket.h>
3197 ], 3078 ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])],
3198 [ struct sockaddr_storage s; s.__ss_family = 1; ], 3079 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
3199 [ ac_cv_have___ss_family_in_struct_ss="yes" ], 3080 [ ac_cv_have___ss_family_in_struct_ss="no"
3200 [ ac_cv_have___ss_family_in_struct_ss="no" ] 3081 ])
3201 )
3202]) 3082])
3203if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then 3083if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
3204 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, 3084 AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1],
3205 [Fields in struct sockaddr_storage]) 3085 [Fields in struct sockaddr_storage])
3206fi 3086fi
3207 3087
3208AC_CACHE_CHECK([for pw_class field in struct passwd], 3088AC_CACHE_CHECK([for pw_class field in struct passwd],
3209 ac_cv_have_pw_class_in_struct_passwd, [ 3089 ac_cv_have_pw_class_in_struct_passwd, [
3210 AC_TRY_COMPILE( 3090 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3211 [ 3091 [[ struct passwd p; p.pw_class = 0; ]])],
3212#include <pwd.h> 3092 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
3213 ], 3093 [ ac_cv_have_pw_class_in_struct_passwd="no"
3214 [ struct passwd p; p.pw_class = 0; ], 3094 ])
3215 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
3216 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
3217 )
3218]) 3095])
3219if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then 3096if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
3220 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD, 1, 3097 AC_DEFINE([HAVE_PW_CLASS_IN_PASSWD], [1],
3221 [Define if your password has a pw_class field]) 3098 [Define if your password has a pw_class field])
3222fi 3099fi
3223 3100
3224AC_CACHE_CHECK([for pw_expire field in struct passwd], 3101AC_CACHE_CHECK([for pw_expire field in struct passwd],
3225 ac_cv_have_pw_expire_in_struct_passwd, [ 3102 ac_cv_have_pw_expire_in_struct_passwd, [
3226 AC_TRY_COMPILE( 3103 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3227 [ 3104 [[ struct passwd p; p.pw_expire = 0; ]])],
3228#include <pwd.h> 3105 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
3229 ], 3106 [ ac_cv_have_pw_expire_in_struct_passwd="no"
3230 [ struct passwd p; p.pw_expire = 0; ], 3107 ])
3231 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
3232 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
3233 )
3234]) 3108])
3235if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then 3109if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
3236 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD, 1, 3110 AC_DEFINE([HAVE_PW_EXPIRE_IN_PASSWD], [1],
3237 [Define if your password has a pw_expire field]) 3111 [Define if your password has a pw_expire field])
3238fi 3112fi
3239 3113
3240AC_CACHE_CHECK([for pw_change field in struct passwd], 3114AC_CACHE_CHECK([for pw_change field in struct passwd],
3241 ac_cv_have_pw_change_in_struct_passwd, [ 3115 ac_cv_have_pw_change_in_struct_passwd, [
3242 AC_TRY_COMPILE( 3116 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
3243 [ 3117 [[ struct passwd p; p.pw_change = 0; ]])],
3244#include <pwd.h> 3118 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
3245 ], 3119 [ ac_cv_have_pw_change_in_struct_passwd="no"
3246 [ struct passwd p; p.pw_change = 0; ], 3120 ])
3247 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
3248 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
3249 )
3250]) 3121])
3251if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then 3122if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
3252 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD, 1, 3123 AC_DEFINE([HAVE_PW_CHANGE_IN_PASSWD], [1],
3253 [Define if your password has a pw_change field]) 3124 [Define if your password has a pw_change field])
3254fi 3125fi
3255 3126
3256dnl make sure we're using the real structure members and not defines 3127dnl make sure we're using the real structure members and not defines
3257AC_CACHE_CHECK([for msg_accrights field in struct msghdr], 3128AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
3258 ac_cv_have_accrights_in_msghdr, [ 3129 ac_cv_have_accrights_in_msghdr, [
3259 AC_COMPILE_IFELSE( 3130 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3260 [
3261#include <sys/types.h> 3131#include <sys/types.h>
3262#include <sys/socket.h> 3132#include <sys/socket.h>
3263#include <sys/uio.h> 3133#include <sys/uio.h>
3264int main() { 3134 ]], [[
3265#ifdef msg_accrights 3135#ifdef msg_accrights
3266#error "msg_accrights is a macro" 3136#error "msg_accrights is a macro"
3267exit(1); 3137exit(1);
@@ -3269,20 +3139,19 @@ exit(1);
3269struct msghdr m; 3139struct msghdr m;
3270m.msg_accrights = 0; 3140m.msg_accrights = 0;
3271exit(0); 3141exit(0);
3272} 3142 ]])],
3273 ],
3274 [ ac_cv_have_accrights_in_msghdr="yes" ], 3143 [ ac_cv_have_accrights_in_msghdr="yes" ],
3275 [ ac_cv_have_accrights_in_msghdr="no" ] 3144 [ ac_cv_have_accrights_in_msghdr="no" ]
3276 ) 3145 )
3277]) 3146])
3278if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then 3147if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
3279 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR, 1, 3148 AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1],
3280 [Define if your system uses access rights style 3149 [Define if your system uses access rights style
3281 file descriptor passing]) 3150 file descriptor passing])
3282fi 3151fi
3283 3152
3284AC_MSG_CHECKING(if struct statvfs.f_fsid is integral type) 3153AC_MSG_CHECKING([if struct statvfs.f_fsid is integral type])
3285AC_TRY_COMPILE([ 3154AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3286#include <sys/types.h> 3155#include <sys/types.h>
3287#include <sys/stat.h> 3156#include <sys/stat.h>
3288#ifdef HAVE_SYS_TIME_H 3157#ifdef HAVE_SYS_TIME_H
@@ -3294,37 +3163,36 @@ AC_TRY_COMPILE([
3294#ifdef HAVE_SYS_STATVFS_H 3163#ifdef HAVE_SYS_STATVFS_H
3295#include <sys/statvfs.h> 3164#include <sys/statvfs.h>
3296#endif 3165#endif
3297], [struct statvfs s; s.f_fsid = 0;], 3166 ]], [[ struct statvfs s; s.f_fsid = 0; ]])],
3298[ AC_MSG_RESULT(yes) ], 3167 [ AC_MSG_RESULT([yes]) ],
3299[ AC_MSG_RESULT(no) 3168 [ AC_MSG_RESULT([no])
3300 3169
3301 AC_MSG_CHECKING(if fsid_t has member val) 3170 AC_MSG_CHECKING([if fsid_t has member val])
3302 AC_TRY_COMPILE([ 3171 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3303#include <sys/types.h> 3172#include <sys/types.h>
3304#include <sys/statvfs.h>], 3173#include <sys/statvfs.h>
3305 [fsid_t t; t.val[0] = 0;], 3174 ]], [[ fsid_t t; t.val[0] = 0; ]])],
3306 [ AC_MSG_RESULT(yes) 3175 [ AC_MSG_RESULT([yes])
3307 AC_DEFINE(FSID_HAS_VAL, 1, fsid_t has member val) ], 3176 AC_DEFINE([FSID_HAS_VAL], [1], [fsid_t has member val]) ],
3308 [ AC_MSG_RESULT(no) ]) 3177 [ AC_MSG_RESULT([no]) ])
3309 3178
3310 AC_MSG_CHECKING(if f_fsid has member __val) 3179 AC_MSG_CHECKING([if f_fsid has member __val])
3311 AC_TRY_COMPILE([ 3180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3312#include <sys/types.h> 3181#include <sys/types.h>
3313#include <sys/statvfs.h>], 3182#include <sys/statvfs.h>
3314 [fsid_t t; t.__val[0] = 0;], 3183 ]], [[ fsid_t t; t.__val[0] = 0; ]])],
3315 [ AC_MSG_RESULT(yes) 3184 [ AC_MSG_RESULT([yes])
3316 AC_DEFINE(FSID_HAS___VAL, 1, fsid_t has member __val) ], 3185 AC_DEFINE([FSID_HAS___VAL], [1], [fsid_t has member __val]) ],
3317 [ AC_MSG_RESULT(no) ]) 3186 [ AC_MSG_RESULT([no]) ])
3318]) 3187])
3319 3188
3320AC_CACHE_CHECK([for msg_control field in struct msghdr], 3189AC_CACHE_CHECK([for msg_control field in struct msghdr],
3321 ac_cv_have_control_in_msghdr, [ 3190 ac_cv_have_control_in_msghdr, [
3322 AC_COMPILE_IFELSE( 3191 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3323 [
3324#include <sys/types.h> 3192#include <sys/types.h>
3325#include <sys/socket.h> 3193#include <sys/socket.h>
3326#include <sys/uio.h> 3194#include <sys/uio.h>
3327int main() { 3195 ]], [[
3328#ifdef msg_control 3196#ifdef msg_control
3329#error "msg_control is a macro" 3197#error "msg_control is a macro"
3330exit(1); 3198exit(1);
@@ -3332,178 +3200,161 @@ exit(1);
3332struct msghdr m; 3200struct msghdr m;
3333m.msg_control = 0; 3201m.msg_control = 0;
3334exit(0); 3202exit(0);
3335} 3203 ]])],
3336 ],
3337 [ ac_cv_have_control_in_msghdr="yes" ], 3204 [ ac_cv_have_control_in_msghdr="yes" ],
3338 [ ac_cv_have_control_in_msghdr="no" ] 3205 [ ac_cv_have_control_in_msghdr="no" ]
3339 ) 3206 )
3340]) 3207])
3341if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then 3208if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
3342 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR, 1, 3209 AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1],
3343 [Define if your system uses ancillary data style 3210 [Define if your system uses ancillary data style
3344 file descriptor passing]) 3211 file descriptor passing])
3345fi 3212fi
3346 3213
3347AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ 3214AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
3348 AC_TRY_LINK([], 3215 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
3349 [ extern char *__progname; printf("%s", __progname); ], 3216 [[ extern char *__progname; printf("%s", __progname); ]])],
3350 [ ac_cv_libc_defines___progname="yes" ], 3217 [ ac_cv_libc_defines___progname="yes" ],
3351 [ ac_cv_libc_defines___progname="no" ] 3218 [ ac_cv_libc_defines___progname="no"
3352 ) 3219 ])
3353]) 3220])
3354if test "x$ac_cv_libc_defines___progname" = "xyes" ; then 3221if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
3355 AC_DEFINE(HAVE___PROGNAME, 1, [Define if libc defines __progname]) 3222 AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname])
3356fi 3223fi
3357 3224
3358AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ 3225AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
3359 AC_TRY_LINK([ 3226 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]],
3360#include <stdio.h> 3227 [[ printf("%s", __FUNCTION__); ]])],
3361], 3228 [ ac_cv_cc_implements___FUNCTION__="yes" ],
3362 [ printf("%s", __FUNCTION__); ], 3229 [ ac_cv_cc_implements___FUNCTION__="no"
3363 [ ac_cv_cc_implements___FUNCTION__="yes" ], 3230 ])
3364 [ ac_cv_cc_implements___FUNCTION__="no" ]
3365 )
3366]) 3231])
3367if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then 3232if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
3368 AC_DEFINE(HAVE___FUNCTION__, 1, 3233 AC_DEFINE([HAVE___FUNCTION__], [1],
3369 [Define if compiler implements __FUNCTION__]) 3234 [Define if compiler implements __FUNCTION__])
3370fi 3235fi
3371 3236
3372AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ 3237AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
3373 AC_TRY_LINK([ 3238 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]],
3374#include <stdio.h> 3239 [[ printf("%s", __func__); ]])],
3375], 3240 [ ac_cv_cc_implements___func__="yes" ],
3376 [ printf("%s", __func__); ], 3241 [ ac_cv_cc_implements___func__="no"
3377 [ ac_cv_cc_implements___func__="yes" ], 3242 ])
3378 [ ac_cv_cc_implements___func__="no" ]
3379 )
3380]) 3243])
3381if test "x$ac_cv_cc_implements___func__" = "xyes" ; then 3244if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
3382 AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__]) 3245 AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__])
3383fi 3246fi
3384 3247
3385AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ 3248AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
3386 AC_TRY_LINK( 3249 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3387 [#include <stdarg.h> 3250#include <stdarg.h>
3388 va_list x,y;], 3251va_list x,y;
3389 [va_copy(x,y);], 3252 ]], [[ va_copy(x,y); ]])],
3390 [ ac_cv_have_va_copy="yes" ], 3253 [ ac_cv_have_va_copy="yes" ],
3391 [ ac_cv_have_va_copy="no" ] 3254 [ ac_cv_have_va_copy="no"
3392 ) 3255 ])
3393]) 3256])
3394if test "x$ac_cv_have_va_copy" = "xyes" ; then 3257if test "x$ac_cv_have_va_copy" = "xyes" ; then
3395 AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists]) 3258 AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists])
3396fi 3259fi
3397 3260
3398AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ 3261AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
3399 AC_TRY_LINK( 3262 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3400 [#include <stdarg.h> 3263#include <stdarg.h>
3401 va_list x,y;], 3264va_list x,y;
3402 [__va_copy(x,y);], 3265 ]], [[ __va_copy(x,y); ]])],
3403 [ ac_cv_have___va_copy="yes" ], 3266 [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no"
3404 [ ac_cv_have___va_copy="no" ] 3267 ])
3405 )
3406]) 3268])
3407if test "x$ac_cv_have___va_copy" = "xyes" ; then 3269if test "x$ac_cv_have___va_copy" = "xyes" ; then
3408 AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists]) 3270 AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists])
3409fi 3271fi
3410 3272
3411AC_CACHE_CHECK([whether getopt has optreset support], 3273AC_CACHE_CHECK([whether getopt has optreset support],
3412 ac_cv_have_getopt_optreset, [ 3274 ac_cv_have_getopt_optreset, [
3413 AC_TRY_LINK( 3275 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <getopt.h> ]],
3414 [ 3276 [[ extern int optreset; optreset = 0; ]])],
3415#include <getopt.h> 3277 [ ac_cv_have_getopt_optreset="yes" ],
3416 ], 3278 [ ac_cv_have_getopt_optreset="no"
3417 [ extern int optreset; optreset = 0; ], 3279 ])
3418 [ ac_cv_have_getopt_optreset="yes" ],
3419 [ ac_cv_have_getopt_optreset="no" ]
3420 )
3421]) 3280])
3422if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then 3281if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
3423 AC_DEFINE(HAVE_GETOPT_OPTRESET, 1, 3282 AC_DEFINE([HAVE_GETOPT_OPTRESET], [1],
3424 [Define if your getopt(3) defines and uses optreset]) 3283 [Define if your getopt(3) defines and uses optreset])
3425fi 3284fi
3426 3285
3427AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ 3286AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
3428 AC_TRY_LINK([], 3287 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
3429 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], 3288[[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])],
3430 [ ac_cv_libc_defines_sys_errlist="yes" ], 3289 [ ac_cv_libc_defines_sys_errlist="yes" ],
3431 [ ac_cv_libc_defines_sys_errlist="no" ] 3290 [ ac_cv_libc_defines_sys_errlist="no"
3432 ) 3291 ])
3433]) 3292])
3434if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then 3293if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
3435 AC_DEFINE(HAVE_SYS_ERRLIST, 1, 3294 AC_DEFINE([HAVE_SYS_ERRLIST], [1],
3436 [Define if your system defines sys_errlist[]]) 3295 [Define if your system defines sys_errlist[]])
3437fi 3296fi
3438 3297
3439 3298
3440AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ 3299AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
3441 AC_TRY_LINK([], 3300 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
3442 [ extern int sys_nerr; printf("%i", sys_nerr);], 3301[[ extern int sys_nerr; printf("%i", sys_nerr);]])],
3443 [ ac_cv_libc_defines_sys_nerr="yes" ], 3302 [ ac_cv_libc_defines_sys_nerr="yes" ],
3444 [ ac_cv_libc_defines_sys_nerr="no" ] 3303 [ ac_cv_libc_defines_sys_nerr="no"
3445 ) 3304 ])
3446]) 3305])
3447if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then 3306if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
3448 AC_DEFINE(HAVE_SYS_NERR, 1, [Define if your system defines sys_nerr]) 3307 AC_DEFINE([HAVE_SYS_NERR], [1], [Define if your system defines sys_nerr])
3449fi 3308fi
3450 3309
3451# Check libraries needed by DNS fingerprint support 3310# Check libraries needed by DNS fingerprint support
3452AC_SEARCH_LIBS(getrrsetbyname, resolv, 3311AC_SEARCH_LIBS([getrrsetbyname], [resolv],
3453 [AC_DEFINE(HAVE_GETRRSETBYNAME, 1, 3312 [AC_DEFINE([HAVE_GETRRSETBYNAME], [1],
3454 [Define if getrrsetbyname() exists])], 3313 [Define if getrrsetbyname() exists])],
3455 [ 3314 [
3456 # Needed by our getrrsetbyname() 3315 # Needed by our getrrsetbyname()
3457 AC_SEARCH_LIBS(res_query, resolv) 3316 AC_SEARCH_LIBS([res_query], [resolv])
3458 AC_SEARCH_LIBS(dn_expand, resolv) 3317 AC_SEARCH_LIBS([dn_expand], [resolv])
3459 AC_MSG_CHECKING(if res_query will link) 3318 AC_MSG_CHECKING([if res_query will link])
3460 AC_LINK_IFELSE([ 3319 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3461#include "confdefs.h"
3462#include <sys/types.h> 3320#include <sys/types.h>
3463#include <netinet/in.h> 3321#include <netinet/in.h>
3464#include <arpa/nameser.h> 3322#include <arpa/nameser.h>
3465#include <netdb.h> 3323#include <netdb.h>
3466#include <resolv.h> 3324#include <resolv.h>
3467int main() 3325 ]], [[
3468{
3469 res_query (0, 0, 0, 0, 0); 3326 res_query (0, 0, 0, 0, 0);
3470 return 0; 3327 ]])],
3471} 3328 AC_MSG_RESULT([yes]),
3472 ], 3329 [AC_MSG_RESULT([no])
3473 AC_MSG_RESULT(yes),
3474 [AC_MSG_RESULT(no)
3475 saved_LIBS="$LIBS" 3330 saved_LIBS="$LIBS"
3476 LIBS="$LIBS -lresolv" 3331 LIBS="$LIBS -lresolv"
3477 AC_MSG_CHECKING(for res_query in -lresolv) 3332 AC_MSG_CHECKING([for res_query in -lresolv])
3478 AC_LINK_IFELSE([ 3333 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3479#include "confdefs.h"
3480#include <sys/types.h> 3334#include <sys/types.h>
3481#include <netinet/in.h> 3335#include <netinet/in.h>
3482#include <arpa/nameser.h> 3336#include <arpa/nameser.h>
3483#include <netdb.h> 3337#include <netdb.h>
3484#include <resolv.h> 3338#include <resolv.h>
3485int main() 3339 ]], [[
3486{
3487 res_query (0, 0, 0, 0, 0); 3340 res_query (0, 0, 0, 0, 0);
3488 return 0; 3341 ]])],
3489} 3342 [AC_MSG_RESULT([yes])],
3490 ],
3491 [AC_MSG_RESULT(yes)],
3492 [LIBS="$saved_LIBS" 3343 [LIBS="$saved_LIBS"
3493 AC_MSG_RESULT(no)]) 3344 AC_MSG_RESULT([no])])
3494 ]) 3345 ])
3495 AC_CHECK_FUNCS(_getshort _getlong) 3346 AC_CHECK_FUNCS([_getshort _getlong])
3496 AC_CHECK_DECLS([_getshort, _getlong], , , 3347 AC_CHECK_DECLS([_getshort, _getlong], , ,
3497 [#include <sys/types.h> 3348 [#include <sys/types.h>
3498 #include <arpa/nameser.h>]) 3349 #include <arpa/nameser.h>])
3499 AC_CHECK_MEMBER(HEADER.ad, 3350 AC_CHECK_MEMBER([HEADER.ad],
3500 [AC_DEFINE(HAVE_HEADER_AD, 1, 3351 [AC_DEFINE([HAVE_HEADER_AD], [1],
3501 [Define if HEADER.ad exists in arpa/nameser.h])],, 3352 [Define if HEADER.ad exists in arpa/nameser.h])], ,
3502 [#include <arpa/nameser.h>]) 3353 [#include <arpa/nameser.h>])
3503 ]) 3354 ])
3504 3355
3505AC_MSG_CHECKING(if struct __res_state _res is an extern) 3356AC_MSG_CHECKING([if struct __res_state _res is an extern])
3506AC_LINK_IFELSE([ 3357AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3507#include <stdio.h> 3358#include <stdio.h>
3508#if HAVE_SYS_TYPES_H 3359#if HAVE_SYS_TYPES_H
3509# include <sys/types.h> 3360# include <sys/types.h>
@@ -3512,43 +3363,43 @@ AC_LINK_IFELSE([
3512#include <arpa/nameser.h> 3363#include <arpa/nameser.h>
3513#include <resolv.h> 3364#include <resolv.h>
3514extern struct __res_state _res; 3365extern struct __res_state _res;
3515int main() { return 0; } 3366 ]], [[ ]])],
3516 ], 3367 [AC_MSG_RESULT([yes])
3517 [AC_MSG_RESULT(yes) 3368 AC_DEFINE([HAVE__RES_EXTERN], [1],
3518 AC_DEFINE(HAVE__RES_EXTERN, 1,
3519 [Define if you have struct __res_state _res as an extern]) 3369 [Define if you have struct __res_state _res as an extern])
3520 ], 3370 ],
3521 [ AC_MSG_RESULT(no) ] 3371 [ AC_MSG_RESULT([no]) ]
3522) 3372)
3523 3373
3524# Check whether user wants SELinux support 3374# Check whether user wants SELinux support
3525SELINUX_MSG="no" 3375SELINUX_MSG="no"
3526LIBSELINUX="" 3376LIBSELINUX=""
3527AC_ARG_WITH(selinux, 3377AC_ARG_WITH([selinux],
3528 [ --with-selinux Enable SELinux support], 3378 [ --with-selinux Enable SELinux support],
3529 [ if test "x$withval" != "xno" ; then 3379 [ if test "x$withval" != "xno" ; then
3530 save_LIBS="$LIBS" 3380 save_LIBS="$LIBS"
3531 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.]) 3381 AC_DEFINE([WITH_SELINUX], [1],
3382 [Define if you want SELinux support.])
3532 SELINUX_MSG="yes" 3383 SELINUX_MSG="yes"
3533 AC_CHECK_HEADER([selinux/selinux.h], , 3384 AC_CHECK_HEADER([selinux/selinux.h], ,
3534 AC_MSG_ERROR(SELinux support requires selinux.h header)) 3385 AC_MSG_ERROR([SELinux support requires selinux.h header]))
3535 AC_CHECK_LIB(selinux, setexeccon, 3386 AC_CHECK_LIB([selinux], [setexeccon],
3536 [ LIBSELINUX="-lselinux" 3387 [ LIBSELINUX="-lselinux"
3537 LIBS="$LIBS -lselinux" 3388 LIBS="$LIBS -lselinux"
3538 ], 3389 ],
3539 AC_MSG_ERROR(SELinux support requires libselinux library)) 3390 AC_MSG_ERROR([SELinux support requires libselinux library]))
3540 SSHLIBS="$SSHLIBS $LIBSELINUX" 3391 SSHLIBS="$SSHLIBS $LIBSELINUX"
3541 SSHDLIBS="$SSHDLIBS $LIBSELINUX" 3392 SSHDLIBS="$SSHDLIBS $LIBSELINUX"
3542 AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level) 3393 AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level])
3543 LIBS="$save_LIBS" 3394 LIBS="$save_LIBS"
3544 fi ] 3395 fi ]
3545) 3396)
3546AC_SUBST(SSHLIBS) 3397AC_SUBST([SSHLIBS])
3547AC_SUBST(SSHDLIBS) 3398AC_SUBST([SSHDLIBS])
3548 3399
3549# Check whether user wants Kerberos 5 support 3400# Check whether user wants Kerberos 5 support
3550KRB5_MSG="no" 3401KRB5_MSG="no"
3551AC_ARG_WITH(kerberos5, 3402AC_ARG_WITH([kerberos5],
3552 [ --with-kerberos5=PATH Enable Kerberos 5 support], 3403 [ --with-kerberos5=PATH Enable Kerberos 5 support],
3553 [ if test "x$withval" != "xno" ; then 3404 [ if test "x$withval" != "xno" ; then
3554 if test "x$withval" = "xyes" ; then 3405 if test "x$withval" = "xyes" ; then
@@ -3557,73 +3408,72 @@ AC_ARG_WITH(kerberos5,
3557 KRB5ROOT=${withval} 3408 KRB5ROOT=${withval}
3558 fi 3409 fi
3559 3410
3560 AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support]) 3411 AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support])
3561 KRB5_MSG="yes" 3412 KRB5_MSG="yes"
3562 3413
3563 AC_PATH_PROG([KRB5CONF],[krb5-config], 3414 AC_PATH_PROG([KRB5CONF], [krb5-config],
3564 [$KRB5ROOT/bin/krb5-config], 3415 [$KRB5ROOT/bin/krb5-config],
3565 [$KRB5ROOT/bin:$PATH]) 3416 [$KRB5ROOT/bin:$PATH])
3566 if test -x $KRB5CONF ; then 3417 if test -x $KRB5CONF ; then
3567 3418
3568 AC_MSG_CHECKING(for gssapi support) 3419 AC_MSG_CHECKING([for gssapi support])
3569 if $KRB5CONF | grep gssapi >/dev/null ; then 3420 if $KRB5CONF | grep gssapi >/dev/null ; then
3570 AC_MSG_RESULT(yes) 3421 AC_MSG_RESULT([yes])
3571 AC_DEFINE(GSSAPI, 1, 3422 AC_DEFINE([GSSAPI], [1],
3572 [Define this if you want GSSAPI 3423 [Define this if you want GSSAPI
3573 support in the version 2 protocol]) 3424 support in the version 2 protocol])
3574 k5confopts=gssapi 3425 k5confopts=gssapi
3575 else 3426 else
3576 AC_MSG_RESULT(no) 3427 AC_MSG_RESULT([no])
3577 k5confopts="" 3428 k5confopts=""
3578 fi 3429 fi
3579 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`" 3430 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
3580 K5LIBS="`$KRB5CONF --libs $k5confopts`" 3431 K5LIBS="`$KRB5CONF --libs $k5confopts`"
3581 CPPFLAGS="$CPPFLAGS $K5CFLAGS" 3432 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
3582 AC_MSG_CHECKING(whether we are using Heimdal) 3433 AC_MSG_CHECKING([whether we are using Heimdal])
3583 AC_TRY_COMPILE([ #include <krb5.h> ], 3434 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h>
3584 [ char *tmp = heimdal_version; ], 3435 ]], [[ char *tmp = heimdal_version; ]])],
3585 [ AC_MSG_RESULT(yes) 3436 [ AC_MSG_RESULT([yes])
3586 AC_DEFINE(HEIMDAL, 1, 3437 AC_DEFINE([HEIMDAL], [1],
3587 [Define this if you are using the 3438 [Define this if you are using the Heimdal
3588 Heimdal version of Kerberos V5]) ], 3439 version of Kerberos V5]) ],
3589 AC_MSG_RESULT(no) 3440 [AC_MSG_RESULT([no])
3590 ) 3441 ])
3591 else 3442 else
3592 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" 3443 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
3593 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" 3444 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
3594 AC_MSG_CHECKING(whether we are using Heimdal) 3445 AC_MSG_CHECKING([whether we are using Heimdal])
3595 AC_TRY_COMPILE([ #include <krb5.h> ], 3446 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h>
3596 [ char *tmp = heimdal_version; ], 3447 ]], [[ char *tmp = heimdal_version; ]])],
3597 [ AC_MSG_RESULT(yes) 3448 [ AC_MSG_RESULT([yes])
3598 AC_DEFINE(HEIMDAL) 3449 AC_DEFINE([HEIMDAL])
3599 K5LIBS="-lkrb5" 3450 K5LIBS="-lkrb5"
3600 K5LIBS="$K5LIBS -lcom_err -lasn1" 3451 K5LIBS="$K5LIBS -lcom_err -lasn1"
3601 AC_CHECK_LIB(roken, net_write, 3452 AC_CHECK_LIB([roken], [net_write],
3602 [K5LIBS="$K5LIBS -lroken"]) 3453 [K5LIBS="$K5LIBS -lroken"])
3603 AC_CHECK_LIB(des, des_cbc_encrypt, 3454 AC_CHECK_LIB([des], [des_cbc_encrypt],
3604 [K5LIBS="$K5LIBS -ldes"]) 3455 [K5LIBS="$K5LIBS -ldes"])
3605 ], 3456 ], [ AC_MSG_RESULT([no])
3606 [ AC_MSG_RESULT(no)
3607 K5LIBS="-lkrb5 -lk5crypto -lcom_err" 3457 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
3608 ] 3458
3609 ) 3459 ])
3610 AC_SEARCH_LIBS(dn_expand, resolv) 3460 AC_SEARCH_LIBS([dn_expand], [resolv])
3611 3461
3612 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, 3462 AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context],
3613 [ AC_DEFINE(GSSAPI) 3463 [ AC_DEFINE([GSSAPI])
3614 K5LIBS="-lgssapi_krb5 $K5LIBS" ], 3464 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
3615 [ AC_CHECK_LIB(gssapi, gss_init_sec_context, 3465 [ AC_CHECK_LIB([gssapi], [gss_init_sec_context],
3616 [ AC_DEFINE(GSSAPI) 3466 [ AC_DEFINE([GSSAPI])
3617 K5LIBS="-lgssapi $K5LIBS" ], 3467 K5LIBS="-lgssapi $K5LIBS" ],
3618 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]), 3468 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
3619 $K5LIBS) 3469 $K5LIBS)
3620 ], 3470 ],
3621 $K5LIBS) 3471 $K5LIBS)
3622 3472
3623 AC_CHECK_HEADER(gssapi.h, , 3473 AC_CHECK_HEADER([gssapi.h], ,
3624 [ unset ac_cv_header_gssapi_h 3474 [ unset ac_cv_header_gssapi_h
3625 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" 3475 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3626 AC_CHECK_HEADERS(gssapi.h, , 3476 AC_CHECK_HEADERS([gssapi.h], ,
3627 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail]) 3477 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
3628 ) 3478 )
3629 ] 3479 ]
@@ -3631,7 +3481,7 @@ AC_ARG_WITH(kerberos5,
3631 3481
3632 oldCPP="$CPPFLAGS" 3482 oldCPP="$CPPFLAGS"
3633 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" 3483 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
3634 AC_CHECK_HEADER(gssapi_krb5.h, , 3484 AC_CHECK_HEADER([gssapi_krb5.h], ,
3635 [ CPPFLAGS="$oldCPP" ]) 3485 [ CPPFLAGS="$oldCPP" ])
3636 3486
3637 fi 3487 fi
@@ -3642,13 +3492,13 @@ AC_ARG_WITH(kerberos5,
3642 blibpath="$blibpath:${KRB5ROOT}/lib" 3492 blibpath="$blibpath:${KRB5ROOT}/lib"
3643 fi 3493 fi
3644 3494
3645 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h) 3495 AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
3646 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h) 3496 AC_CHECK_HEADERS([gssapi_krb5.h gssapi/gssapi_krb5.h])
3647 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h) 3497 AC_CHECK_HEADERS([gssapi_generic.h gssapi/gssapi_generic.h])
3648 3498
3649 LIBS="$LIBS $K5LIBS" 3499 LIBS="$LIBS $K5LIBS"
3650 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS, 1, 3500 AC_SEARCH_LIBS([k_hasafs], [kafs], [AC_DEFINE([USE_AFS], [1],
3651 [Define this if you want to use libkafs' AFS support])) 3501 [Define this if you want to use libkafs' AFS support])])
3652 fi 3502 fi
3653 ] 3503 ]
3654) 3504)
@@ -3656,7 +3506,7 @@ AC_ARG_WITH(kerberos5,
3656# Looking for programs, paths and files 3506# Looking for programs, paths and files
3657 3507
3658PRIVSEP_PATH=/var/empty 3508PRIVSEP_PATH=/var/empty
3659AC_ARG_WITH(privsep-path, 3509AC_ARG_WITH([privsep-path],
3660 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], 3510 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
3661 [ 3511 [
3662 if test -n "$withval" && test "x$withval" != "xno" && \ 3512 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -3665,9 +3515,9 @@ AC_ARG_WITH(privsep-path,
3665 fi 3515 fi
3666 ] 3516 ]
3667) 3517)
3668AC_SUBST(PRIVSEP_PATH) 3518AC_SUBST([PRIVSEP_PATH])
3669 3519
3670AC_ARG_WITH(xauth, 3520AC_ARG_WITH([xauth],
3671 [ --with-xauth=PATH Specify path to xauth program ], 3521 [ --with-xauth=PATH Specify path to xauth program ],
3672 [ 3522 [
3673 if test -n "$withval" && test "x$withval" != "xno" && \ 3523 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -3681,7 +3531,7 @@ AC_ARG_WITH(xauth,
3681 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" 3531 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
3682 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" 3532 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
3683 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" 3533 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
3684 AC_PATH_PROG(xauth_path, xauth, , $TestPath) 3534 AC_PATH_PROG([xauth_path], [xauth], , [$TestPath])
3685 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then 3535 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
3686 xauth_path="/usr/openwin/bin/xauth" 3536 xauth_path="/usr/openwin/bin/xauth"
3687 fi 3537 fi
@@ -3689,7 +3539,7 @@ AC_ARG_WITH(xauth,
3689) 3539)
3690 3540
3691STRIP_OPT=-s 3541STRIP_OPT=-s
3692AC_ARG_ENABLE(strip, 3542AC_ARG_ENABLE([strip],
3693 [ --disable-strip Disable calling strip(1) on install], 3543 [ --disable-strip Disable calling strip(1) on install],
3694 [ 3544 [
3695 if test "x$enableval" = "xno" ; then 3545 if test "x$enableval" = "xno" ; then
@@ -3697,24 +3547,99 @@ AC_ARG_ENABLE(strip,
3697 fi 3547 fi
3698 ] 3548 ]
3699) 3549)
3700AC_SUBST(STRIP_OPT) 3550AC_SUBST([STRIP_OPT])
3701 3551
3702if test -z "$xauth_path" ; then 3552if test -z "$xauth_path" ; then
3703 XAUTH_PATH="undefined" 3553 XAUTH_PATH="undefined"
3704 AC_SUBST(XAUTH_PATH) 3554 AC_SUBST([XAUTH_PATH])
3705else 3555else
3706 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path", 3556 AC_DEFINE_UNQUOTED([XAUTH_PATH], ["$xauth_path"],
3707 [Define if xauth is found in your path]) 3557 [Define if xauth is found in your path])
3708 XAUTH_PATH=$xauth_path 3558 XAUTH_PATH=$xauth_path
3709 AC_SUBST(XAUTH_PATH) 3559 AC_SUBST([XAUTH_PATH])
3710fi 3560fi
3711 3561
3712# Check for mail directory (last resort if we cannot get it from headers) 3562dnl # --with-maildir=/path/to/mail gets top priority.
3713if test ! -z "$MAIL" ; then 3563dnl # if maildir is set in the platform case statement above we use that.
3714 maildir=`dirname $MAIL` 3564dnl # Otherwise we run a program to get the dir from system headers.
3715 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir", 3565dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL
3716 [Set this to your mail directory if you don't have maillock.h]) 3566dnl # If we find _PATH_MAILDIR we do nothing because that is what
3717fi 3567dnl # session.c expects anyway. Otherwise we set to the value found
3568dnl # stripping any trailing slash. If for some strage reason our program
3569dnl # does not find what it needs, we default to /var/spool/mail.
3570# Check for mail directory
3571AC_ARG_WITH([maildir],
3572 [ --with-maildir=/path/to/mail Specify your system mail directory],
3573 [
3574 if test "X$withval" != X && test "x$withval" != xno && \
3575 test "x${withval}" != xyes; then
3576 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"],
3577 [Set this to your mail directory if you do not have _PATH_MAILDIR])
3578 fi
3579 ],[
3580 if test "X$maildir" != "X"; then
3581 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"])
3582 else
3583 AC_MSG_CHECKING([Discovering system mail directory])
3584 AC_RUN_IFELSE(
3585 [AC_LANG_PROGRAM([[
3586#include <stdio.h>
3587#include <string.h>
3588#ifdef HAVE_PATHS_H
3589#include <paths.h>
3590#endif
3591#ifdef HAVE_MAILLOCK_H
3592#include <maillock.h>
3593#endif
3594#define DATA "conftest.maildir"
3595 ]], [[
3596 FILE *fd;
3597 int rc;
3598
3599 fd = fopen(DATA,"w");
3600 if(fd == NULL)
3601 exit(1);
3602
3603#if defined (_PATH_MAILDIR)
3604 if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
3605 exit(1);
3606#elif defined (MAILDIR)
3607 if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
3608 exit(1);
3609#elif defined (_PATH_MAIL)
3610 if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
3611 exit(1);
3612#else
3613 exit (2);
3614#endif
3615
3616 exit(0);
3617 ]])],
3618 [
3619 maildir_what=`awk -F: '{print $1}' conftest.maildir`
3620 maildir=`awk -F: '{print $2}' conftest.maildir \
3621 | sed 's|/$||'`
3622 AC_MSG_RESULT([Using: $maildir from $maildir_what])
3623 if test "x$maildir_what" != "x_PATH_MAILDIR"; then
3624 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"])
3625 fi
3626 ],
3627 [
3628 if test "X$ac_status" = "X2";then
3629# our test program didn't find it. Default to /var/spool/mail
3630 AC_MSG_RESULT([Using: default value of /var/spool/mail])
3631 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"])
3632 else
3633 AC_MSG_RESULT([*** not found ***])
3634 fi
3635 ],
3636 [
3637 AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail])
3638 ]
3639 )
3640 fi
3641 ]
3642) # maildir
3718 3643
3719if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then 3644if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
3720 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) 3645 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
@@ -3722,9 +3647,9 @@ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
3722fi 3647fi
3723if test -z "$no_dev_ptmx" ; then 3648if test -z "$no_dev_ptmx" ; then
3724 if test "x$disable_ptmx_check" != "xyes" ; then 3649 if test "x$disable_ptmx_check" != "xyes" ; then
3725 AC_CHECK_FILE("/dev/ptmx", 3650 AC_CHECK_FILE(["/dev/ptmx"],
3726 [ 3651 [
3727 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, 3652 AC_DEFINE_UNQUOTED([HAVE_DEV_PTMX], [1],
3728 [Define if you have /dev/ptmx]) 3653 [Define if you have /dev/ptmx])
3729 have_dev_ptmx=1 3654 have_dev_ptmx=1
3730 ] 3655 ]
@@ -3733,9 +3658,9 @@ if test -z "$no_dev_ptmx" ; then
3733fi 3658fi
3734 3659
3735if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then 3660if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
3736 AC_CHECK_FILE("/dev/ptc", 3661 AC_CHECK_FILE(["/dev/ptc"],
3737 [ 3662 [
3738 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, 3663 AC_DEFINE_UNQUOTED([HAVE_DEV_PTS_AND_PTC], [1],
3739 [Define if you have /dev/ptc]) 3664 [Define if you have /dev/ptc])
3740 have_dev_ptc=1 3665 have_dev_ptc=1
3741 ] 3666 ]
@@ -3745,7 +3670,7 @@ else
3745fi 3670fi
3746 3671
3747# Options from here on. Some of these are preset by platform above 3672# Options from here on. Some of these are preset by platform above
3748AC_ARG_WITH(mantype, 3673AC_ARG_WITH([mantype],
3749 [ --with-mantype=man|cat|doc Set man page type], 3674 [ --with-mantype=man|cat|doc Set man page type],
3750 [ 3675 [
3751 case "$withval" in 3676 case "$withval" in
@@ -3753,14 +3678,14 @@ AC_ARG_WITH(mantype,
3753 MANTYPE=$withval 3678 MANTYPE=$withval
3754 ;; 3679 ;;
3755 *) 3680 *)
3756 AC_MSG_ERROR(invalid man type: $withval) 3681 AC_MSG_ERROR([invalid man type: $withval])
3757 ;; 3682 ;;
3758 esac 3683 esac
3759 ] 3684 ]
3760) 3685)
3761if test -z "$MANTYPE"; then 3686if test -z "$MANTYPE"; then
3762 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" 3687 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
3763 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath) 3688 AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath])
3764 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then 3689 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
3765 MANTYPE=doc 3690 MANTYPE=doc
3766 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then 3691 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
@@ -3769,21 +3694,21 @@ if test -z "$MANTYPE"; then
3769 MANTYPE=cat 3694 MANTYPE=cat
3770 fi 3695 fi
3771fi 3696fi
3772AC_SUBST(MANTYPE) 3697AC_SUBST([MANTYPE])
3773if test "$MANTYPE" = "doc"; then 3698if test "$MANTYPE" = "doc"; then
3774 mansubdir=man; 3699 mansubdir=man;
3775else 3700else
3776 mansubdir=$MANTYPE; 3701 mansubdir=$MANTYPE;
3777fi 3702fi
3778AC_SUBST(mansubdir) 3703AC_SUBST([mansubdir])
3779 3704
3780# Check whether to enable MD5 passwords 3705# Check whether to enable MD5 passwords
3781MD5_MSG="no" 3706MD5_MSG="no"
3782AC_ARG_WITH(md5-passwords, 3707AC_ARG_WITH([md5-passwords],
3783 [ --with-md5-passwords Enable use of MD5 passwords], 3708 [ --with-md5-passwords Enable use of MD5 passwords],
3784 [ 3709 [
3785 if test "x$withval" != "xno" ; then 3710 if test "x$withval" != "xno" ; then
3786 AC_DEFINE(HAVE_MD5_PASSWORDS, 1, 3711 AC_DEFINE([HAVE_MD5_PASSWORDS], [1],
3787 [Define if you want to allow MD5 passwords]) 3712 [Define if you want to allow MD5 passwords])
3788 MD5_MSG="yes" 3713 MD5_MSG="yes"
3789 fi 3714 fi
@@ -3791,11 +3716,11 @@ AC_ARG_WITH(md5-passwords,
3791) 3716)
3792 3717
3793# Whether to disable shadow password support 3718# Whether to disable shadow password support
3794AC_ARG_WITH(shadow, 3719AC_ARG_WITH([shadow],
3795 [ --without-shadow Disable shadow password support], 3720 [ --without-shadow Disable shadow password support],
3796 [ 3721 [
3797 if test "x$withval" = "xno" ; then 3722 if test "x$withval" = "xno" ; then
3798 AC_DEFINE(DISABLE_SHADOW) 3723 AC_DEFINE([DISABLE_SHADOW])
3799 disable_shadow=yes 3724 disable_shadow=yes
3800 fi 3725 fi
3801 ] 3726 ]
@@ -3803,37 +3728,36 @@ AC_ARG_WITH(shadow,
3803 3728
3804if test -z "$disable_shadow" ; then 3729if test -z "$disable_shadow" ; then
3805 AC_MSG_CHECKING([if the systems has expire shadow information]) 3730 AC_MSG_CHECKING([if the systems has expire shadow information])
3806 AC_TRY_COMPILE( 3731 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3807 [
3808#include <sys/types.h> 3732#include <sys/types.h>
3809#include <shadow.h> 3733#include <shadow.h>
3810 struct spwd sp; 3734struct spwd sp;
3811 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], 3735 ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])],
3812 [ sp_expire_available=yes ], [] 3736 [ sp_expire_available=yes ], [
3813 ) 3737 ])
3814 3738
3815 if test "x$sp_expire_available" = "xyes" ; then 3739 if test "x$sp_expire_available" = "xyes" ; then
3816 AC_MSG_RESULT(yes) 3740 AC_MSG_RESULT([yes])
3817 AC_DEFINE(HAS_SHADOW_EXPIRE, 1, 3741 AC_DEFINE([HAS_SHADOW_EXPIRE], [1],
3818 [Define if you want to use shadow password expire field]) 3742 [Define if you want to use shadow password expire field])
3819 else 3743 else
3820 AC_MSG_RESULT(no) 3744 AC_MSG_RESULT([no])
3821 fi 3745 fi
3822fi 3746fi
3823 3747
3824# Use ip address instead of hostname in $DISPLAY 3748# Use ip address instead of hostname in $DISPLAY
3825if test ! -z "$IPADDR_IN_DISPLAY" ; then 3749if test ! -z "$IPADDR_IN_DISPLAY" ; then
3826 DISPLAY_HACK_MSG="yes" 3750 DISPLAY_HACK_MSG="yes"
3827 AC_DEFINE(IPADDR_IN_DISPLAY, 1, 3751 AC_DEFINE([IPADDR_IN_DISPLAY], [1],
3828 [Define if you need to use IP address 3752 [Define if you need to use IP address
3829 instead of hostname in $DISPLAY]) 3753 instead of hostname in $DISPLAY])
3830else 3754else
3831 DISPLAY_HACK_MSG="no" 3755 DISPLAY_HACK_MSG="no"
3832 AC_ARG_WITH(ipaddr-display, 3756 AC_ARG_WITH([ipaddr-display],
3833 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], 3757 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
3834 [ 3758 [
3835 if test "x$withval" != "xno" ; then 3759 if test "x$withval" != "xno" ; then
3836 AC_DEFINE(IPADDR_IN_DISPLAY) 3760 AC_DEFINE([IPADDR_IN_DISPLAY])
3837 DISPLAY_HACK_MSG="yes" 3761 DISPLAY_HACK_MSG="yes"
3838 fi 3762 fi
3839 ] 3763 ]
@@ -3841,7 +3765,7 @@ else
3841fi 3765fi
3842 3766
3843# check for /etc/default/login and use it if present. 3767# check for /etc/default/login and use it if present.
3844AC_ARG_ENABLE(etc-default-login, 3768AC_ARG_ENABLE([etc-default-login],
3845 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]], 3769 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
3846 [ if test "x$enableval" = "xno"; then 3770 [ if test "x$enableval" = "xno"; then
3847 AC_MSG_NOTICE([/etc/default/login handling disabled]) 3771 AC_MSG_NOTICE([/etc/default/login handling disabled])
@@ -3859,10 +3783,10 @@ AC_ARG_ENABLE(etc-default-login,
3859) 3783)
3860 3784
3861if test "x$etc_default_login" != "xno"; then 3785if test "x$etc_default_login" != "xno"; then
3862 AC_CHECK_FILE("/etc/default/login", 3786 AC_CHECK_FILE(["/etc/default/login"],
3863 [ external_path_file=/etc/default/login ]) 3787 [ external_path_file=/etc/default/login ])
3864 if test "x$external_path_file" = "x/etc/default/login"; then 3788 if test "x$external_path_file" = "x/etc/default/login"; then
3865 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1, 3789 AC_DEFINE([HAVE_ETC_DEFAULT_LOGIN], [1],
3866 [Define if your system has /etc/default/login]) 3790 [Define if your system has /etc/default/login])
3867 fi 3791 fi
3868fi 3792fi
@@ -3875,7 +3799,7 @@ fi
3875 3799
3876# Whether to mess with the default path 3800# Whether to mess with the default path
3877SERVER_PATH_MSG="(default)" 3801SERVER_PATH_MSG="(default)"
3878AC_ARG_WITH(default-path, 3802AC_ARG_WITH([default-path],
3879 [ --with-default-path= Specify default \$PATH environment for server], 3803 [ --with-default-path= Specify default \$PATH environment for server],
3880 [ 3804 [
3881 if test "x$external_path_file" = "x/etc/login.conf" ; then 3805 if test "x$external_path_file" = "x/etc/login.conf" ; then
@@ -3901,7 +3825,7 @@ If PATH is defined in $external_path_file, ensure the path to scp is included,
3901otherwise scp will not work.]) 3825otherwise scp will not work.])
3902 fi 3826 fi
3903 AC_RUN_IFELSE( 3827 AC_RUN_IFELSE(
3904 [AC_LANG_SOURCE([[ 3828 [AC_LANG_PROGRAM([[
3905/* find out what STDPATH is */ 3829/* find out what STDPATH is */
3906#include <stdio.h> 3830#include <stdio.h>
3907#ifdef HAVE_PATHS_H 3831#ifdef HAVE_PATHS_H
@@ -3918,9 +3842,7 @@ otherwise scp will not work.])
3918#include <sys/stat.h> 3842#include <sys/stat.h>
3919#include <fcntl.h> 3843#include <fcntl.h>
3920#define DATA "conftest.stdpath" 3844#define DATA "conftest.stdpath"
3921 3845 ]], [[
3922main()
3923{
3924 FILE *fd; 3846 FILE *fd;
3925 int rc; 3847 int rc;
3926 3848
@@ -3932,7 +3854,6 @@ main()
3932 exit(1); 3854 exit(1);
3933 3855
3934 exit(0); 3856 exit(0);
3935}
3936 ]])], 3857 ]])],
3937 [ user_path=`cat conftest.stdpath` ], 3858 [ user_path=`cat conftest.stdpath` ],
3938 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ], 3859 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
@@ -3951,23 +3872,23 @@ main()
3951 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 3872 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
3952 if test $? -ne 0 ; then 3873 if test $? -ne 0 ; then
3953 user_path=$user_path:$t_bindir 3874 user_path=$user_path:$t_bindir
3954 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work) 3875 AC_MSG_RESULT([Adding $t_bindir to USER_PATH so scp will work])
3955 fi 3876 fi
3956 fi 3877 fi
3957 fi ] 3878 fi ]
3958) 3879)
3959if test "x$external_path_file" != "x/etc/login.conf" ; then 3880if test "x$external_path_file" != "x/etc/login.conf" ; then
3960 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path", [Specify default $PATH]) 3881 AC_DEFINE_UNQUOTED([USER_PATH], ["$user_path"], [Specify default $PATH])
3961 AC_SUBST(user_path) 3882 AC_SUBST([user_path])
3962fi 3883fi
3963 3884
3964# Set superuser path separately to user path 3885# Set superuser path separately to user path
3965AC_ARG_WITH(superuser-path, 3886AC_ARG_WITH([superuser-path],
3966 [ --with-superuser-path= Specify different path for super-user], 3887 [ --with-superuser-path= Specify different path for super-user],
3967 [ 3888 [
3968 if test -n "$withval" && test "x$withval" != "xno" && \ 3889 if test -n "$withval" && test "x$withval" != "xno" && \
3969 test "x${withval}" != "xyes"; then 3890 test "x${withval}" != "xyes"; then
3970 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval", 3891 AC_DEFINE_UNQUOTED([SUPERUSER_PATH], ["$withval"],
3971 [Define if you want a different $PATH 3892 [Define if you want a different $PATH
3972 for the superuser]) 3893 for the superuser])
3973 superuser_path=$withval 3894 superuser_path=$withval
@@ -3982,18 +3903,18 @@ AC_ARG_WITH(4in6,
3982 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], 3903 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
3983 [ 3904 [
3984 if test "x$withval" != "xno" ; then 3905 if test "x$withval" != "xno" ; then
3985 AC_MSG_RESULT(yes) 3906 AC_MSG_RESULT([yes])
3986 AC_DEFINE(IPV4_IN_IPV6, 1, 3907 AC_DEFINE([IPV4_IN_IPV6], [1],
3987 [Detect IPv4 in IPv6 mapped addresses 3908 [Detect IPv4 in IPv6 mapped addresses
3988 and treat as IPv4]) 3909 and treat as IPv4])
3989 IPV4_IN6_HACK_MSG="yes" 3910 IPV4_IN6_HACK_MSG="yes"
3990 else 3911 else
3991 AC_MSG_RESULT(no) 3912 AC_MSG_RESULT([no])
3992 fi 3913 fi
3993 ],[ 3914 ], [
3994 if test "x$inet6_default_4in6" = "xyes"; then 3915 if test "x$inet6_default_4in6" = "xyes"; then
3995 AC_MSG_RESULT([yes (default)]) 3916 AC_MSG_RESULT([yes (default)])
3996 AC_DEFINE(IPV4_IN_IPV6) 3917 AC_DEFINE([IPV4_IN_IPV6])
3997 IPV4_IN6_HACK_MSG="yes" 3918 IPV4_IN6_HACK_MSG="yes"
3998 else 3919 else
3999 AC_MSG_RESULT([no (default)]) 3920 AC_MSG_RESULT([no (default)])
@@ -4003,11 +3924,11 @@ AC_ARG_WITH(4in6,
4003 3924
4004# Whether to enable BSD auth support 3925# Whether to enable BSD auth support
4005BSD_AUTH_MSG=no 3926BSD_AUTH_MSG=no
4006AC_ARG_WITH(bsd-auth, 3927AC_ARG_WITH([bsd-auth],
4007 [ --with-bsd-auth Enable BSD auth support], 3928 [ --with-bsd-auth Enable BSD auth support],
4008 [ 3929 [
4009 if test "x$withval" != "xno" ; then 3930 if test "x$withval" != "xno" ; then
4010 AC_DEFINE(BSD_AUTH, 1, 3931 AC_DEFINE([BSD_AUTH], [1],
4011 [Define if you have BSD auth support]) 3932 [Define if you have BSD auth support])
4012 BSD_AUTH_MSG=yes 3933 BSD_AUTH_MSG=yes
4013 fi 3934 fi
@@ -4024,7 +3945,7 @@ if test ! -d $piddir ; then
4024 esac 3945 esac
4025fi 3946fi
4026 3947
4027AC_ARG_WITH(pid-dir, 3948AC_ARG_WITH([pid-dir],
4028 [ --with-pid-dir=PATH Specify location of ssh.pid file], 3949 [ --with-pid-dir=PATH Specify location of ssh.pid file],
4029 [ 3950 [
4030 if test -n "$withval" && test "x$withval" != "xno" && \ 3951 if test -n "$withval" && test "x$withval" != "xno" && \
@@ -4037,85 +3958,86 @@ AC_ARG_WITH(pid-dir,
4037 ] 3958 ]
4038) 3959)
4039 3960
4040AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir", [Specify location of ssh.pid]) 3961AC_DEFINE_UNQUOTED([_PATH_SSH_PIDDIR], ["$piddir"],
4041AC_SUBST(piddir) 3962 [Specify location of ssh.pid])
3963AC_SUBST([piddir])
4042 3964
4043dnl allow user to disable some login recording features 3965dnl allow user to disable some login recording features
4044AC_ARG_ENABLE(lastlog, 3966AC_ARG_ENABLE([lastlog],
4045 [ --disable-lastlog disable use of lastlog even if detected [no]], 3967 [ --disable-lastlog disable use of lastlog even if detected [no]],
4046 [ 3968 [
4047 if test "x$enableval" = "xno" ; then 3969 if test "x$enableval" = "xno" ; then
4048 AC_DEFINE(DISABLE_LASTLOG) 3970 AC_DEFINE([DISABLE_LASTLOG])
4049 fi 3971 fi
4050 ] 3972 ]
4051) 3973)
4052AC_ARG_ENABLE(utmp, 3974AC_ARG_ENABLE([utmp],
4053 [ --disable-utmp disable use of utmp even if detected [no]], 3975 [ --disable-utmp disable use of utmp even if detected [no]],
4054 [ 3976 [
4055 if test "x$enableval" = "xno" ; then 3977 if test "x$enableval" = "xno" ; then
4056 AC_DEFINE(DISABLE_UTMP) 3978 AC_DEFINE([DISABLE_UTMP])
4057 fi 3979 fi
4058 ] 3980 ]
4059) 3981)
4060AC_ARG_ENABLE(utmpx, 3982AC_ARG_ENABLE([utmpx],
4061 [ --disable-utmpx disable use of utmpx even if detected [no]], 3983 [ --disable-utmpx disable use of utmpx even if detected [no]],
4062 [ 3984 [
4063 if test "x$enableval" = "xno" ; then 3985 if test "x$enableval" = "xno" ; then
4064 AC_DEFINE(DISABLE_UTMPX, 1, 3986 AC_DEFINE([DISABLE_UTMPX], [1],
4065 [Define if you don't want to use utmpx]) 3987 [Define if you don't want to use utmpx])
4066 fi 3988 fi
4067 ] 3989 ]
4068) 3990)
4069AC_ARG_ENABLE(wtmp, 3991AC_ARG_ENABLE([wtmp],
4070 [ --disable-wtmp disable use of wtmp even if detected [no]], 3992 [ --disable-wtmp disable use of wtmp even if detected [no]],
4071 [ 3993 [
4072 if test "x$enableval" = "xno" ; then 3994 if test "x$enableval" = "xno" ; then
4073 AC_DEFINE(DISABLE_WTMP) 3995 AC_DEFINE([DISABLE_WTMP])
4074 fi 3996 fi
4075 ] 3997 ]
4076) 3998)
4077AC_ARG_ENABLE(wtmpx, 3999AC_ARG_ENABLE([wtmpx],
4078 [ --disable-wtmpx disable use of wtmpx even if detected [no]], 4000 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
4079 [ 4001 [
4080 if test "x$enableval" = "xno" ; then 4002 if test "x$enableval" = "xno" ; then
4081 AC_DEFINE(DISABLE_WTMPX, 1, 4003 AC_DEFINE([DISABLE_WTMPX], [1],
4082 [Define if you don't want to use wtmpx]) 4004 [Define if you don't want to use wtmpx])
4083 fi 4005 fi
4084 ] 4006 ]
4085) 4007)
4086AC_ARG_ENABLE(libutil, 4008AC_ARG_ENABLE([libutil],
4087 [ --disable-libutil disable use of libutil (login() etc.) [no]], 4009 [ --disable-libutil disable use of libutil (login() etc.) [no]],
4088 [ 4010 [
4089 if test "x$enableval" = "xno" ; then 4011 if test "x$enableval" = "xno" ; then
4090 AC_DEFINE(DISABLE_LOGIN) 4012 AC_DEFINE([DISABLE_LOGIN])
4091 fi 4013 fi
4092 ] 4014 ]
4093) 4015)
4094AC_ARG_ENABLE(pututline, 4016AC_ARG_ENABLE([pututline],
4095 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], 4017 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
4096 [ 4018 [
4097 if test "x$enableval" = "xno" ; then 4019 if test "x$enableval" = "xno" ; then
4098 AC_DEFINE(DISABLE_PUTUTLINE, 1, 4020 AC_DEFINE([DISABLE_PUTUTLINE], [1],
4099 [Define if you don't want to use pututline() 4021 [Define if you don't want to use pututline()
4100 etc. to write [uw]tmp]) 4022 etc. to write [uw]tmp])
4101 fi 4023 fi
4102 ] 4024 ]
4103) 4025)
4104AC_ARG_ENABLE(pututxline, 4026AC_ARG_ENABLE([pututxline],
4105 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], 4027 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
4106 [ 4028 [
4107 if test "x$enableval" = "xno" ; then 4029 if test "x$enableval" = "xno" ; then
4108 AC_DEFINE(DISABLE_PUTUTXLINE, 1, 4030 AC_DEFINE([DISABLE_PUTUTXLINE], [1],
4109 [Define if you don't want to use pututxline() 4031 [Define if you don't want to use pututxline()
4110 etc. to write [uw]tmpx]) 4032 etc. to write [uw]tmpx])
4111 fi 4033 fi
4112 ] 4034 ]
4113) 4035)
4114AC_ARG_WITH(lastlog, 4036AC_ARG_WITH([lastlog],
4115 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], 4037 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
4116 [ 4038 [
4117 if test "x$withval" = "xno" ; then 4039 if test "x$withval" = "xno" ; then
4118 AC_DEFINE(DISABLE_LASTLOG) 4040 AC_DEFINE([DISABLE_LASTLOG])
4119 elif test -n "$withval" && test "x${withval}" != "xyes"; then 4041 elif test -n "$withval" && test "x${withval}" != "xyes"; then
4120 conf_lastlog_location=$withval 4042 conf_lastlog_location=$withval
4121 fi 4043 fi
@@ -4130,7 +4052,7 @@ dnl lastlog and [uw]tmp are subject to a file search if all else fails
4130dnl lastlog detection 4052dnl lastlog detection
4131dnl NOTE: the code itself will detect if lastlog is a directory 4053dnl NOTE: the code itself will detect if lastlog is a directory
4132AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) 4054AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
4133AC_TRY_COMPILE([ 4055AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4134#include <sys/types.h> 4056#include <sys/types.h>
4135#include <utmp.h> 4057#include <utmp.h>
4136#ifdef HAVE_LASTLOG_H 4058#ifdef HAVE_LASTLOG_H
@@ -4142,13 +4064,12 @@ AC_TRY_COMPILE([
4142#ifdef HAVE_LOGIN_H 4064#ifdef HAVE_LOGIN_H
4143# include <login.h> 4065# include <login.h>
4144#endif 4066#endif
4145 ], 4067 ]], [[ char *lastlog = LASTLOG_FILE; ]])],
4146 [ char *lastlog = LASTLOG_FILE; ], 4068 [ AC_MSG_RESULT([yes]) ],
4147 [ AC_MSG_RESULT(yes) ], 4069 [
4148 [ 4070 AC_MSG_RESULT([no])
4149 AC_MSG_RESULT(no)
4150 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) 4071 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
4151 AC_TRY_COMPILE([ 4072 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4152#include <sys/types.h> 4073#include <sys/types.h>
4153#include <utmp.h> 4074#include <utmp.h>
4154#ifdef HAVE_LASTLOG_H 4075#ifdef HAVE_LASTLOG_H
@@ -4157,15 +4078,13 @@ AC_TRY_COMPILE([
4157#ifdef HAVE_PATHS_H 4078#ifdef HAVE_PATHS_H
4158# include <paths.h> 4079# include <paths.h>
4159#endif 4080#endif
4160 ], 4081 ]], [[ char *lastlog = _PATH_LASTLOG; ]])],
4161 [ char *lastlog = _PATH_LASTLOG; ], 4082 [ AC_MSG_RESULT([yes]) ],
4162 [ AC_MSG_RESULT(yes) ],
4163 [ 4083 [
4164 AC_MSG_RESULT(no) 4084 AC_MSG_RESULT([no])
4165 system_lastlog_path=no 4085 system_lastlog_path=no
4166 ]) 4086 ])
4167 ] 4087])
4168)
4169 4088
4170if test -z "$conf_lastlog_location"; then 4089if test -z "$conf_lastlog_location"; then
4171 if test x"$system_lastlog_path" = x"no" ; then 4090 if test x"$system_lastlog_path" = x"no" ; then
@@ -4182,24 +4101,23 @@ if test -z "$conf_lastlog_location"; then
4182fi 4101fi
4183 4102
4184if test -n "$conf_lastlog_location"; then 4103if test -n "$conf_lastlog_location"; then
4185 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location", 4104 AC_DEFINE_UNQUOTED([CONF_LASTLOG_FILE], ["$conf_lastlog_location"],
4186 [Define if you want to specify the path to your lastlog file]) 4105 [Define if you want to specify the path to your lastlog file])
4187fi 4106fi
4188 4107
4189dnl utmp detection 4108dnl utmp detection
4190AC_MSG_CHECKING([if your system defines UTMP_FILE]) 4109AC_MSG_CHECKING([if your system defines UTMP_FILE])
4191AC_TRY_COMPILE([ 4110AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4192#include <sys/types.h> 4111#include <sys/types.h>
4193#include <utmp.h> 4112#include <utmp.h>
4194#ifdef HAVE_PATHS_H 4113#ifdef HAVE_PATHS_H
4195# include <paths.h> 4114# include <paths.h>
4196#endif 4115#endif
4197 ], 4116 ]], [[ char *utmp = UTMP_FILE; ]])],
4198 [ char *utmp = UTMP_FILE; ], 4117 [ AC_MSG_RESULT([yes]) ],
4199 [ AC_MSG_RESULT(yes) ], 4118 [ AC_MSG_RESULT([no])
4200 [ AC_MSG_RESULT(no) 4119 system_utmp_path=no
4201 system_utmp_path=no ] 4120])
4202)
4203if test -z "$conf_utmp_location"; then 4121if test -z "$conf_utmp_location"; then
4204 if test x"$system_utmp_path" = x"no" ; then 4122 if test x"$system_utmp_path" = x"no" ; then
4205 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do 4123 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
@@ -4208,29 +4126,28 @@ if test -z "$conf_utmp_location"; then
4208 fi 4126 fi
4209 done 4127 done
4210 if test -z "$conf_utmp_location"; then 4128 if test -z "$conf_utmp_location"; then
4211 AC_DEFINE(DISABLE_UTMP) 4129 AC_DEFINE([DISABLE_UTMP])
4212 fi 4130 fi
4213 fi 4131 fi
4214fi 4132fi
4215if test -n "$conf_utmp_location"; then 4133if test -n "$conf_utmp_location"; then
4216 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location", 4134 AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"],
4217 [Define if you want to specify the path to your utmp file]) 4135 [Define if you want to specify the path to your utmp file])
4218fi 4136fi
4219 4137
4220dnl wtmp detection 4138dnl wtmp detection
4221AC_MSG_CHECKING([if your system defines WTMP_FILE]) 4139AC_MSG_CHECKING([if your system defines WTMP_FILE])
4222AC_TRY_COMPILE([ 4140AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4223#include <sys/types.h> 4141#include <sys/types.h>
4224#include <utmp.h> 4142#include <utmp.h>
4225#ifdef HAVE_PATHS_H 4143#ifdef HAVE_PATHS_H
4226# include <paths.h> 4144# include <paths.h>
4227#endif 4145#endif
4228 ], 4146 ]], [[ char *wtmp = WTMP_FILE; ]])],
4229 [ char *wtmp = WTMP_FILE; ], 4147 [ AC_MSG_RESULT([yes]) ],
4230 [ AC_MSG_RESULT(yes) ], 4148 [ AC_MSG_RESULT([no])
4231 [ AC_MSG_RESULT(no) 4149 system_wtmp_path=no
4232 system_wtmp_path=no ] 4150])
4233)
4234if test -z "$conf_wtmp_location"; then 4151if test -z "$conf_wtmp_location"; then
4235 if test x"$system_wtmp_path" = x"no" ; then 4152 if test x"$system_wtmp_path" = x"no" ; then
4236 for f in /usr/adm/wtmp /var/log/wtmp; do 4153 for f in /usr/adm/wtmp /var/log/wtmp; do
@@ -4239,19 +4156,19 @@ if test -z "$conf_wtmp_location"; then
4239 fi 4156 fi
4240 done 4157 done
4241 if test -z "$conf_wtmp_location"; then 4158 if test -z "$conf_wtmp_location"; then
4242 AC_DEFINE(DISABLE_WTMP) 4159 AC_DEFINE([DISABLE_WTMP])
4243 fi 4160 fi
4244 fi 4161 fi
4245fi 4162fi
4246if test -n "$conf_wtmp_location"; then 4163if test -n "$conf_wtmp_location"; then
4247 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location", 4164 AC_DEFINE_UNQUOTED([CONF_WTMP_FILE], ["$conf_wtmp_location"],
4248 [Define if you want to specify the path to your wtmp file]) 4165 [Define if you want to specify the path to your wtmp file])
4249fi 4166fi
4250 4167
4251 4168
4252dnl wtmpx detection 4169dnl wtmpx detection
4253AC_MSG_CHECKING([if your system defines WTMPX_FILE]) 4170AC_MSG_CHECKING([if your system defines WTMPX_FILE])
4254AC_TRY_COMPILE([ 4171AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4255#include <sys/types.h> 4172#include <sys/types.h>
4256#include <utmp.h> 4173#include <utmp.h>
4257#ifdef HAVE_UTMPX_H 4174#ifdef HAVE_UTMPX_H
@@ -4260,18 +4177,17 @@ AC_TRY_COMPILE([
4260#ifdef HAVE_PATHS_H 4177#ifdef HAVE_PATHS_H
4261# include <paths.h> 4178# include <paths.h>
4262#endif 4179#endif
4263 ], 4180 ]], [[ char *wtmpx = WTMPX_FILE; ]])],
4264 [ char *wtmpx = WTMPX_FILE; ], 4181 [ AC_MSG_RESULT([yes]) ],
4265 [ AC_MSG_RESULT(yes) ], 4182 [ AC_MSG_RESULT([no])
4266 [ AC_MSG_RESULT(no) 4183 system_wtmpx_path=no
4267 system_wtmpx_path=no ] 4184])
4268)
4269if test -z "$conf_wtmpx_location"; then 4185if test -z "$conf_wtmpx_location"; then
4270 if test x"$system_wtmpx_path" = x"no" ; then 4186 if test x"$system_wtmpx_path" = x"no" ; then
4271 AC_DEFINE(DISABLE_WTMPX) 4187 AC_DEFINE([DISABLE_WTMPX])
4272 fi 4188 fi
4273else 4189else
4274 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location", 4190 AC_DEFINE_UNQUOTED([CONF_WTMPX_FILE], ["$conf_wtmpx_location"],
4275 [Define if you want to specify the path to your wtmpx file]) 4191 [Define if you want to specify the path to your wtmpx file])
4276fi 4192fi
4277 4193
@@ -4290,13 +4206,13 @@ if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
4290else 4206else
4291 TEST_SSH_IPV6=yes 4207 TEST_SSH_IPV6=yes
4292fi 4208fi
4293AC_CHECK_DECL(BROKEN_GETADDRINFO, TEST_SSH_IPV6=no) 4209AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no])
4294AC_SUBST(TEST_SSH_IPV6, $TEST_SSH_IPV6) 4210AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6])
4295 4211
4296AC_EXEEXT 4212AC_EXEEXT
4297AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ 4213AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
4298 openbsd-compat/Makefile openbsd-compat/regress/Makefile \ 4214 openbsd-compat/Makefile openbsd-compat/regress/Makefile \
4299 ssh_prng_cmds survey.sh]) 4215 survey.sh])
4300AC_OUTPUT 4216AC_OUTPUT
4301 4217
4302# Print summary of options 4218# Print summary of options
@@ -4351,9 +4267,7 @@ echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
4351echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 4267echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
4352echo " BSD Auth support: $BSD_AUTH_MSG" 4268echo " BSD Auth support: $BSD_AUTH_MSG"
4353echo " Random number source: $RAND_MSG" 4269echo " Random number source: $RAND_MSG"
4354if test ! -z "$USE_RAND_HELPER" ; then 4270echo " Privsep sandbox style: $SANDBOX_STYLE"
4355echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
4356fi
4357 4271
4358echo "" 4272echo ""
4359 4273
@@ -4385,14 +4299,6 @@ if test "x$PAM_MSG" = "xyes" ; then
4385 echo "" 4299 echo ""
4386fi 4300fi
4387 4301
4388if test ! -z "$RAND_HELPER_CMDHASH" ; then
4389 echo "WARNING: you are using the builtin random number collection "
4390 echo "service. Please read WARNING.RNG and request that your OS "
4391 echo "vendor includes kernel-based random number collection in "
4392 echo "future versions of your OS."
4393 echo ""
4394fi
4395
4396if test ! -z "$NO_PEERCHECK" ; then 4302if test ! -z "$NO_PEERCHECK" ; then
4397 echo "WARNING: the operating system that you are using does not" 4303 echo "WARNING: the operating system that you are using does not"
4398 echo "appear to support getpeereid(), getpeerucred() or the" 4304 echo "appear to support getpeereid(), getpeerucred() or the"