~ubuntu-branches/debian/stretch/dropbear/stretch

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape, Matt Johnston, Gerrit Pape
  • Date: 2013-10-25 15:00:48 UTC
  • mfrom: (1.4.6)
  • Revision ID: package-import@ubuntu.com-20131025150048-3jq765x96xayk392
Tags: 2013.60-1
[ Matt Johnston ]
* New upstream release.

[ Gerrit Pape ]
* debian/diff/0004-cve-2013-4421.diff, 0005-user-disclosure.diff:
  remove; fixed upstream.
* debian/dropbear.postinst: don't fail if initramfs-tools it not
  installed (closes: #692653).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf and autoheader to produce a configure script.
 
3
 
 
4
# This Autoconf file was cobbled from various locations. In particular, a bunch
 
5
# of the platform checks have been taken straight from OpenSSH's configure.ac
 
6
# Huge thanks to them for dealing with the horrible platform-specifics :)
 
7
 
 
8
AC_PREREQ(2.50)
 
9
AC_INIT(buffer.c)
 
10
 
 
11
OLDCFLAGS=$CFLAGS
 
12
# Checks for programs.
 
13
AC_PROG_CC
 
14
AC_PROG_MAKE_SET
 
15
 
 
16
if test -z "$LD" ; then
 
17
        LD=$CC
 
18
fi
 
19
AC_SUBST(LD)    
 
20
 
 
21
if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then
 
22
        AC_MSG_NOTICE(No \$CFLAGS set... using "-Os -W -Wall" for GCC)
 
23
        CFLAGS="-Os -W -Wall"
 
24
fi
 
25
 
 
26
# large file support is useful for scp
 
27
AC_SYS_LARGEFILE
 
28
 
 
29
# Host specific options
 
30
# this isn't a definitive list of hosts, they are just added as required
 
31
AC_CANONICAL_HOST
 
32
 
 
33
case "$host" in
 
34
 
 
35
*-*-linux*)
 
36
        no_ptmx_check=1
 
37
        ;;
 
38
 
 
39
*-*-solaris*)
 
40
        CFLAGS="$CFLAGS -I/usr/local/include"
 
41
        LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
 
42
        conf_lastlog_location="/var/adm/lastlog"
 
43
        AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
 
44
        sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
 
45
        if test "$sol2ver" -ge 8; then
 
46
                AC_MSG_RESULT(yes)
 
47
                AC_DEFINE(DISABLE_UTMP,,Disable utmp)
 
48
                AC_DEFINE(DISABLE_WTMP,,Disable wtmp)
 
49
        else
 
50
                AC_MSG_RESULT(no)
 
51
        fi
 
52
        AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
 
53
        AC_CHECK_LIB(nsl, yp_match, LIBS="$LIBS -lnsl")
 
54
        ;;
 
55
 
 
56
*-*-aix*)
 
57
        AC_DEFINE(AIX,,Using AIX)
 
58
        # OpenSSH thinks it's broken. If it isn't, let me know.
 
59
        AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo)
 
60
        ;;
 
61
        
 
62
*-*-hpux*)
 
63
        LIBS="$LIBS -lsec"
 
64
        # It's probably broken.
 
65
        AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo)
 
66
        ;;
 
67
*-dec-osf*)
 
68
        AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo)
 
69
        ;;
 
70
esac
 
71
 
 
72
AC_CHECK_TOOL(AR, ar, :)
 
73
AC_CHECK_TOOL(RANLIB, ranlib, :)
 
74
AC_CHECK_TOOL(STRIP, strip, :)
 
75
AC_CHECK_TOOL(INSTALL, install, :)
 
76
 
 
77
dnl Can't use login() or logout() with uclibc
 
78
AC_CHECK_DECL(__UCLIBC__, 
 
79
        [
 
80
        no_loginfunc_check=1
 
81
        AC_MSG_NOTICE([Using uClibc - login() and logout() probably don't work, so we won't use them.])
 
82
        ],,,)
 
83
 
 
84
# Checks for libraries.
 
85
AC_CHECK_LIB(crypt, crypt, CRYPTLIB="-lcrypt")
 
86
AC_SUBST(CRYPTLIB)      
 
87
 
 
88
# Check if zlib is needed
 
89
AC_ARG_WITH(zlib,
 
90
        [  --with-zlib=PATH        Use zlib in PATH],
 
91
        [
 
92
                # option is given
 
93
                if test -d "$withval/lib"; then
 
94
                        LDFLAGS="-L${withval}/lib ${LDFLAGS}"
 
95
                else
 
96
                        LDFLAGS="-L${withval} ${LDFLAGS}"
 
97
                fi
 
98
                if test -d "$withval/include"; then
 
99
                        CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
 
100
                else
 
101
                        CPPFLAGS="-I${withval} ${CPPFLAGS}"
 
102
                fi
 
103
        ]
 
104
)
 
105
 
 
106
AC_ARG_ENABLE(zlib,
 
107
        [  --disable-zlib          Don't include zlib support],
 
108
        [
 
109
                if test "x$enableval" = "xno"; then
 
110
                        AC_DEFINE(DISABLE_ZLIB,, Use zlib)
 
111
                        AC_MSG_NOTICE(Disabling zlib)
 
112
                else
 
113
                        AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
 
114
                        AC_MSG_NOTICE(Enabling zlib)
 
115
                fi
 
116
        ],
 
117
        [
 
118
                # if not disabled, check for zlib
 
119
                AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
 
120
                AC_MSG_NOTICE(Enabling zlib)
 
121
        ]
 
122
)
 
123
 
 
124
# Check if pam is needed
 
125
AC_ARG_WITH(pam,
 
126
        [  --with-pam=PATH        Use pam in PATH],
 
127
        [
 
128
                # option is given
 
129
                if test -d "$withval/lib"; then
 
130
                        LDFLAGS="-L${withval}/lib ${LDFLAGS}"
 
131
                else
 
132
                        LDFLAGS="-L${withval} ${LDFLAGS}"
 
133
                fi
 
134
                if test -d "$withval/include"; then
 
135
                        CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
 
136
                else
 
137
                        CPPFLAGS="-I${withval} ${CPPFLAGS}"
 
138
                fi
 
139
        ]
 
140
)
 
141
 
 
142
 
 
143
AC_ARG_ENABLE(pam,
 
144
        [  --enable-pam          Try to include PAM support],
 
145
        [
 
146
                if test "x$enableval" = "xyes"; then
 
147
                        AC_CHECK_LIB(pam, pam_authenticate, , AC_MSG_ERROR([*** PAM missing - install first or check config.log ***]))
 
148
                        AC_MSG_NOTICE(Enabling PAM)
 
149
                        AC_CHECK_FUNCS(pam_fail_delay)
 
150
                else
 
151
                        AC_DEFINE(DISABLE_PAM,, Use PAM)
 
152
                        AC_MSG_NOTICE(Disabling PAM)
 
153
                fi
 
154
        ],
 
155
        [
 
156
                # disable it by default
 
157
                AC_DEFINE(DISABLE_PAM,, Use PAM)
 
158
                AC_MSG_NOTICE(Disabling PAM)
 
159
        ]
 
160
)
 
161
 
 
162
AC_ARG_ENABLE(openpty,
 
163
        [  --disable-openpty       Don't use openpty, use alternative method],
 
164
        [
 
165
                if test "x$enableval" = "xno"; then
 
166
                        AC_MSG_NOTICE(Not using openpty)
 
167
                else
 
168
                        AC_MSG_NOTICE(Using openpty if available)
 
169
                        AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
 
170
                fi
 
171
        ],
 
172
        [
 
173
                AC_MSG_NOTICE(Using openpty if available)
 
174
                AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
 
175
        ]
 
176
)
 
177
                
 
178
 
 
179
AC_ARG_ENABLE(syslog,
 
180
        [  --disable-syslog        Don't include syslog support],
 
181
        [
 
182
                if test "x$enableval" = "xno"; then
 
183
                        AC_DEFINE(DISABLE_SYSLOG,, Using syslog)
 
184
                        AC_MSG_NOTICE(Disabling syslog)
 
185
                else
 
186
                        AC_MSG_NOTICE(Enabling syslog)
 
187
                fi
 
188
        ],
 
189
        [
 
190
                AC_MSG_NOTICE(Enabling syslog)
 
191
        ]
 
192
)
 
193
 
 
194
AC_ARG_ENABLE(shadow,
 
195
        [  --disable-shadow        Don't use shadow passwords (if available)],
 
196
        [
 
197
                if test "x$enableval" = "xno"; then
 
198
                        AC_MSG_NOTICE(Not using shadow passwords)
 
199
                else
 
200
                        AC_CHECK_HEADERS([shadow.h])
 
201
                        AC_MSG_NOTICE(Using shadow passwords if available)
 
202
                fi
 
203
        ],
 
204
        [
 
205
                AC_CHECK_HEADERS([shadow.h])
 
206
                AC_MSG_NOTICE(Using shadow passwords if available)
 
207
        ]
 
208
)
 
209
                        
 
210
 
 
211
# Checks for header files.
 
212
AC_HEADER_STDC
 
213
AC_HEADER_SYS_WAIT
 
214
AC_CHECK_HEADERS([fcntl.h limits.h netinet/in.h netinet/tcp.h stdlib.h string.h sys/socket.h sys/time.h termios.h unistd.h crypt.h pty.h ioctl.h libutil.h libgen.h inttypes.h stropts.h utmp.h utmpx.h lastlog.h paths.h util.h netdb.h security/pam_appl.h pam/pam_appl.h netinet/in_systm.h sys/uio.h])
 
215
 
 
216
# Checks for typedefs, structures, and compiler characteristics.
 
217
AC_C_CONST
 
218
AC_TYPE_UID_T
 
219
AC_TYPE_MODE_T
 
220
AC_TYPE_PID_T
 
221
AC_TYPE_SIZE_T
 
222
AC_HEADER_TIME
 
223
 
 
224
AC_CHECK_TYPES([uint16_t, u_int16_t, struct sockaddr_storage])
 
225
AC_CHECK_TYPE([socklen_t], ,[
 
226
        AC_MSG_CHECKING([for socklen_t equivalent])
 
227
        AC_CACHE_VAL([curl_cv_socklen_t_equiv],
 
228
        [
 
229
        # Systems have either "struct sockaddr *" or
 
230
        # "void *" as the second argument to getpeername
 
231
        curl_cv_socklen_t_equiv=
 
232
        for arg2 in "struct sockaddr" void; do
 
233
                for t in int size_t unsigned long "unsigned long"; do
 
234
                AC_TRY_COMPILE([
 
235
                        #include <sys/types.h>
 
236
                        #include <sys/socket.h>
 
237
 
 
238
                        int getpeername (int, $arg2 *, $t *);
 
239
                ],[
 
240
                        $t len;
 
241
                        getpeername(0,0,&len);
 
242
                ],[
 
243
                        curl_cv_socklen_t_equiv="$t"
 
244
                        break
 
245
                ])
 
246
                done
 
247
        done
 
248
 
 
249
        if test "x$curl_cv_socklen_t_equiv" = x; then
 
250
                AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
 
251
        fi
 
252
        ])
 
253
        AC_MSG_RESULT($curl_cv_socklen_t_equiv)
 
254
        AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
 
255
                        [type to use in place of socklen_t if not defined])],
 
256
        [#include <sys/types.h>
 
257
        #include <sys/socket.h>])
 
258
 
 
259
# for the fake-rfc2553 stuff - straight from OpenSSH
 
260
 
 
261
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
 
262
        AC_TRY_COMPILE(
 
263
                [
 
264
#include <sys/types.h>
 
265
#include <sys/socket.h>
 
266
                ],
 
267
                [ struct sockaddr_storage s; ],
 
268
                [ ac_cv_have_struct_sockaddr_storage="yes" ],
 
269
                [ ac_cv_have_struct_sockaddr_storage="no" ]
 
270
        )
 
271
])
 
272
if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
 
273
        AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
 
274
fi
 
275
 
 
276
AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
 
277
        AC_TRY_COMPILE(
 
278
                [
 
279
#include <sys/types.h>
 
280
#include <netinet/in.h>
 
281
                ],
 
282
                [ struct sockaddr_in6 s; s.sin6_family = 0; ],
 
283
                [ ac_cv_have_struct_sockaddr_in6="yes" ],
 
284
                [ ac_cv_have_struct_sockaddr_in6="no" ]
 
285
        )
 
286
])
 
287
if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
 
288
        AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,,Have struct sockaddr_in6)
 
289
fi
 
290
 
 
291
AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
 
292
        AC_TRY_COMPILE(
 
293
                [
 
294
#include <sys/types.h>
 
295
#include <netinet/in.h>
 
296
                ],
 
297
                [ struct in6_addr s; s.s6_addr[0] = 0; ],
 
298
                [ ac_cv_have_struct_in6_addr="yes" ],
 
299
                [ ac_cv_have_struct_in6_addr="no" ]
 
300
        )
 
301
])
 
302
if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
 
303
        AC_DEFINE(HAVE_STRUCT_IN6_ADDR,,Have struct in6_addr)
 
304
fi
 
305
 
 
306
AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
 
307
        AC_TRY_COMPILE(
 
308
                [
 
309
#include <sys/types.h>
 
310
#include <sys/socket.h>
 
311
#include <netdb.h>
 
312
                ],
 
313
                [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
 
314
                [ ac_cv_have_struct_addrinfo="yes" ],
 
315
                [ ac_cv_have_struct_addrinfo="no" ]
 
316
        )
 
317
])
 
318
if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
 
319
        AC_DEFINE(HAVE_STRUCT_ADDRINFO,,Have struct addrinfo)
 
320
fi
 
321
 
 
322
 
 
323
# IRIX has a const char return value for gai_strerror()
 
324
AC_CHECK_FUNCS(gai_strerror,[
 
325
        AC_DEFINE(HAVE_GAI_STRERROR)
 
326
        AC_TRY_COMPILE([
 
327
#include <sys/types.h>
 
328
#include <sys/socket.h>
 
329
#include <netdb.h>
 
330
 
 
331
const char *gai_strerror(int);],[
 
332
char *str;
 
333
 
 
334
str = gai_strerror(0);],[
 
335
                AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
 
336
                [Define if gai_strerror() returns const char *])])])
 
337
 
 
338
# for loginrec.c
 
339
 
 
340
AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_pid, struct utmp.ut_type, struct utmp.ut_tv, struct utmp.ut_id, struct utmp.ut_addr, struct utmp.ut_addr_v6, struct utmp.ut_exit, struct utmp.ut_time],,,[
 
341
#include <sys/types.h>
 
342
#if HAVE_UTMP_H
 
343
#include <utmp.h>
 
344
#endif
 
345
])
 
346
 
 
347
AC_CHECK_MEMBERS([struct utmpx.ut_host, struct utmpx.ut_syslen, struct utmpx.ut_type, struct utmpx.ut_id, struct utmpx.ut_addr, struct utmpx.ut_addr_v6, struct utmpx.ut_time, struct utmpx.ut_tv],,,[
 
348
#include <sys/types.h>
 
349
#include <sys/socket.h>
 
350
#if HAVE_UTMPX_H
 
351
#include <utmpx.h>
 
352
#endif
 
353
])
 
354
 
 
355
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],,,[
 
356
#include <sys/types.h>
 
357
#include <sys/socket.h>
 
358
])
 
359
 
 
360
AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
 
361
AC_CHECK_FUNCS(utmpname)
 
362
AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
 
363
AC_CHECK_FUNCS(setutxent utmpxname)
 
364
AC_CHECK_FUNCS(logout updwtmp logwtmp)
 
365
 
 
366
AC_ARG_ENABLE(bundled-libtom,
 
367
[  --enable-bundled-libtom       Force using bundled libtomcrypt/libtommath even if a system version exists.
 
368
  --disable-bundled-libtom      Force using system libtomcrypt/libtommath, fail if it does not exist.
 
369
                                Default is to use system if available, otherwise bundled.],
 
370
        [
 
371
                if test "x$enableval" = "xyes"; then
 
372
                        BUNDLED_LIBTOM=1
 
373
                        AC_MSG_NOTICE(Forcing bundled libtom*)
 
374
                else
 
375
                        BUNDLED_LIBTOM=0
 
376
                        AC_CHECK_LIB(tomcrypt, register_cipher, , 
 
377
                                [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] )
 
378
                        AC_CHECK_LIB(tommath, mp_exptmod, , 
 
379
                                [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] )
 
380
                fi
 
381
        ],
 
382
        [
 
383
                BUNDLED_LIBTOM=0
 
384
                AC_CHECK_LIB(tomcrypt, register_cipher, , BUNDLED_LIBTOM=1)
 
385
                AC_CHECK_LIB(tommath, mp_exptmod, , BUNDLED_LIBTOM=1)
 
386
        ]
 
387
)
 
388
 
 
389
if test $BUNDLED_LIBTOM = 1 ; then
 
390
        AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom) 
 
391
fi
 
392
 
 
393
AC_SUBST(BUNDLED_LIBTOM)
 
394
 
 
395
dnl Added from OpenSSH 3.6.1p2's configure.ac
 
396
 
 
397
dnl allow user to disable some login recording features
 
398
AC_ARG_ENABLE(lastlog,
 
399
        [  --disable-lastlog       Disable use of lastlog even if detected [no]],
 
400
        [ AC_DEFINE(DISABLE_LASTLOG,,Disable use of lastlog()) ]
 
401
)
 
402
AC_ARG_ENABLE(utmp,
 
403
        [  --disable-utmp          Disable use of utmp even if detected [no]],
 
404
        [ AC_DEFINE(DISABLE_UTMP,,Disable use of utmp) ]
 
405
)
 
406
AC_ARG_ENABLE(utmpx,
 
407
        [  --disable-utmpx         Disable use of utmpx even if detected [no]],
 
408
        [ AC_DEFINE(DISABLE_UTMPX,,Disable use of utmpx) ]
 
409
)
 
410
AC_ARG_ENABLE(wtmp,
 
411
        [  --disable-wtmp          Disable use of wtmp even if detected [no]],
 
412
        [ AC_DEFINE(DISABLE_WTMP,,Disable use of wtmp) ]
 
413
)
 
414
AC_ARG_ENABLE(wtmpx,
 
415
        [  --disable-wtmpx         Disable use of wtmpx even if detected [no]],
 
416
        [ AC_DEFINE(DISABLE_WTMPX,,Disable use of wtmpx) ]
 
417
)
 
418
AC_ARG_ENABLE(loginfunc,
 
419
        [  --disable-loginfunc     Disable use of login() etc. [no]],
 
420
        [ no_loginfunc_check=1
 
421
        AC_MSG_NOTICE(Not using login() etc) ]
 
422
)
 
423
AC_ARG_ENABLE(pututline,
 
424
        [  --disable-pututline     Disable use of pututline() etc. ([uw]tmp) [no]],
 
425
        [ AC_DEFINE(DISABLE_PUTUTLINE,,Disable use of pututline()) ]
 
426
)
 
427
AC_ARG_ENABLE(pututxline,
 
428
        [  --disable-pututxline    Disable use of pututxline() etc. ([uw]tmpx) [no]],
 
429
        [ AC_DEFINE(DISABLE_PUTUTXLINE,,Disable use of pututxline()) ]
 
430
)
 
431
AC_ARG_WITH(lastlog,
 
432
  [  --with-lastlog=FILE|DIR specify lastlog location [common locations]],
 
433
        [
 
434
                if test "x$withval" = "xno" ; then      
 
435
                        AC_DEFINE(DISABLE_LASTLOG)
 
436
                else
 
437
                        conf_lastlog_location=$withval
 
438
                fi
 
439
        ]
 
440
)
 
441
 
 
442
if test -z "$no_loginfunc_check"; then
 
443
        dnl    Checks for libutil functions (login(), logout() etc, not openpty() )
 
444
        AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN,,Have login() function)])
 
445
        AC_CHECK_FUNCS(logout updwtmp logwtmp)
 
446
fi
 
447
 
 
448
dnl lastlog, [uw]tmpx? detection
 
449
dnl  NOTE: set the paths in the platform section to avoid the
 
450
dnl   need for command-line parameters
 
451
dnl lastlog and [uw]tmp are subject to a file search if all else fails
 
452
 
 
453
dnl lastlog detection
 
454
dnl  NOTE: the code itself will detect if lastlog is a directory
 
455
AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
 
456
AC_TRY_COMPILE([
 
457
#include <sys/types.h>
 
458
#include <utmp.h>
 
459
#ifdef HAVE_LASTLOG_H
 
460
#  include <lastlog.h>
 
461
#endif
 
462
#ifdef HAVE_PATHS_H
 
463
#  include <paths.h>
 
464
#endif
 
465
#ifdef HAVE_LOGIN_H
 
466
# include <login.h>
 
467
#endif
 
468
        ],
 
469
        [ char *lastlog = LASTLOG_FILE; ],
 
470
        [ AC_MSG_RESULT(yes) ],
 
471
        [
 
472
                AC_MSG_RESULT(no)
 
473
                AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
 
474
                AC_TRY_COMPILE([
 
475
#include <sys/types.h>
 
476
#include <utmp.h>
 
477
#ifdef HAVE_LASTLOG_H
 
478
#  include <lastlog.h>
 
479
#endif
 
480
#ifdef HAVE_PATHS_H
 
481
#  include <paths.h>
 
482
#endif
 
483
                ],
 
484
                [ char *lastlog = _PATH_LASTLOG; ],
 
485
                [ AC_MSG_RESULT(yes) ],
 
486
                [
 
487
                        AC_MSG_RESULT(no)
 
488
                        system_lastlog_path=no
 
489
                ])
 
490
        ]
 
491
)
 
492
 
 
493
if test -z "$conf_lastlog_location"; then
 
494
        if test x"$system_lastlog_path" = x"no" ; then
 
495
                for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
 
496
                                if (test -d "$f" || test -f "$f") ; then
 
497
                                        conf_lastlog_location=$f
 
498
                                fi
 
499
                done
 
500
                if test -z "$conf_lastlog_location"; then
 
501
                        AC_MSG_WARN([** Cannot find lastlog **])
 
502
                        dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
 
503
                fi
 
504
        fi
 
505
fi
 
506
 
 
507
if test -n "$conf_lastlog_location"; then
 
508
        AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location", lastlog file location)
 
509
fi      
 
510
 
 
511
dnl utmp detection
 
512
AC_MSG_CHECKING([if your system defines UTMP_FILE])
 
513
AC_TRY_COMPILE([
 
514
#include <sys/types.h>
 
515
#include <utmp.h>
 
516
#ifdef HAVE_PATHS_H
 
517
#  include <paths.h>
 
518
#endif
 
519
        ],
 
520
        [ char *utmp = UTMP_FILE; ],
 
521
        [ AC_MSG_RESULT(yes) ],
 
522
        [ AC_MSG_RESULT(no)
 
523
          system_utmp_path=no ]
 
524
)
 
525
if test -z "$conf_utmp_location"; then
 
526
        if test x"$system_utmp_path" = x"no" ; then
 
527
                for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
 
528
                        if test -f $f ; then
 
529
                                conf_utmp_location=$f
 
530
                        fi
 
531
                done
 
532
                if test -z "$conf_utmp_location"; then
 
533
                        AC_DEFINE(DISABLE_UTMP)
 
534
                fi
 
535
        fi
 
536
fi
 
537
if test -n "$conf_utmp_location"; then
 
538
        AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location", utmp file location)
 
539
fi      
 
540
 
 
541
dnl wtmp detection
 
542
AC_MSG_CHECKING([if your system defines WTMP_FILE])
 
543
AC_TRY_COMPILE([
 
544
#include <sys/types.h>
 
545
#include <utmp.h>
 
546
#ifdef HAVE_PATHS_H
 
547
#  include <paths.h>
 
548
#endif
 
549
        ],
 
550
        [ char *wtmp = WTMP_FILE; ],
 
551
        [ AC_MSG_RESULT(yes) ],
 
552
        [ AC_MSG_RESULT(no)
 
553
          system_wtmp_path=no ]
 
554
)
 
555
if test -z "$conf_wtmp_location"; then
 
556
        if test x"$system_wtmp_path" = x"no" ; then
 
557
                for f in /usr/adm/wtmp /var/log/wtmp; do
 
558
                        if test -f $f ; then
 
559
                                conf_wtmp_location=$f
 
560
                        fi
 
561
                done
 
562
                if test -z "$conf_wtmp_location"; then
 
563
                        AC_DEFINE(DISABLE_WTMP)
 
564
                fi
 
565
        fi
 
566
fi
 
567
if test -n "$conf_wtmp_location"; then
 
568
        AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location", wtmp file location)
 
569
fi      
 
570
 
 
571
 
 
572
dnl utmpx detection - I don't know any system so perverse as to require
 
573
dnl  utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
 
574
dnl  there, though.
 
575
AC_MSG_CHECKING([if your system defines UTMPX_FILE])
 
576
AC_TRY_COMPILE([
 
577
#include <sys/types.h>
 
578
#include <utmp.h>
 
579
#ifdef HAVE_UTMPX_H
 
580
#include <utmpx.h>
 
581
#endif
 
582
#ifdef HAVE_PATHS_H
 
583
#  include <paths.h>
 
584
#endif
 
585
        ],
 
586
        [ char *utmpx = UTMPX_FILE; ],
 
587
        [ AC_MSG_RESULT(yes) ],
 
588
        [ AC_MSG_RESULT(no)
 
589
          system_utmpx_path=no ]
 
590
)
 
591
if test -z "$conf_utmpx_location"; then
 
592
        if test x"$system_utmpx_path" = x"no" ; then
 
593
                AC_DEFINE(DISABLE_UTMPX)
 
594
        fi
 
595
else
 
596
        AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location", utmpx file location)
 
597
fi      
 
598
 
 
599
dnl wtmpx detection
 
600
AC_MSG_CHECKING([if your system defines WTMPX_FILE])
 
601
AC_TRY_COMPILE([
 
602
#include <sys/types.h>
 
603
#include <utmp.h>
 
604
#ifdef HAVE_UTMPX_H
 
605
#include <utmpx.h>
 
606
#endif
 
607
#ifdef HAVE_PATHS_H
 
608
#  include <paths.h>
 
609
#endif
 
610
        ],
 
611
        [ char *wtmpx = WTMPX_FILE; ],
 
612
        [ AC_MSG_RESULT(yes) ],
 
613
        [ AC_MSG_RESULT(no)
 
614
          system_wtmpx_path=no ]
 
615
)
 
616
if test -z "$conf_wtmpx_location"; then
 
617
        if test x"$system_wtmpx_path" = x"no" ; then
 
618
                AC_DEFINE(DISABLE_WTMPX)
 
619
        fi
 
620
else
 
621
        AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location", wtmpx file location)
 
622
fi      
 
623
 
 
624
# Checks for library functions.
 
625
AC_PROG_GCC_TRADITIONAL
 
626
AC_FUNC_MEMCMP
 
627
AC_FUNC_SELECT_ARGTYPES
 
628
AC_TYPE_SIGNAL
 
629
AC_CHECK_FUNCS([dup2 getspnam getusershell memset putenv select socket strdup clearenv strlcpy strlcat daemon basename _getpty getaddrinfo freeaddrinfo getnameinfo fork writev])
 
630
 
 
631
AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
 
632
 
 
633
# Solaris needs ptmx
 
634
if test -z "$no_ptmx_check" ; then
 
635
        if test x"$cross_compiling" = x"no" ; then
 
636
                AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx))
 
637
        else
 
638
                AC_MSG_NOTICE([Not checking for /dev/ptmx, we're cross-compiling])
 
639
        fi
 
640
fi
 
641
 
 
642
if test -z "$no_ptc_check" ; then
 
643
        if test x"$cross_compiling" = x"no" ; then
 
644
                AC_CHECK_FILE("/dev/ptc", AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts))
 
645
        else
 
646
                AC_MSG_NOTICE([Not checking for /dev/ptc & /dev/pts since we're cross-compiling])
 
647
        fi
 
648
fi
 
649
 
 
650
AC_EXEEXT
 
651
 
 
652
# XXX there must be a nicer way to do this
 
653
AS_MKDIR_P(libtomcrypt/src/ciphers/aes)
 
654
AS_MKDIR_P(libtomcrypt/src/ciphers/safer)
 
655
AS_MKDIR_P(libtomcrypt/src/ciphers/twofish)
 
656
AS_MKDIR_P(libtomcrypt/src/encauth/ccm)
 
657
AS_MKDIR_P(libtomcrypt/src/encauth/eax)
 
658
AS_MKDIR_P(libtomcrypt/src/encauth/gcm)
 
659
AS_MKDIR_P(libtomcrypt/src/encauth/ocb)
 
660
AS_MKDIR_P(libtomcrypt/src/hashes)
 
661
AS_MKDIR_P(libtomcrypt/src/hashes/chc)
 
662
AS_MKDIR_P(libtomcrypt/src/hashes/helper)
 
663
AS_MKDIR_P(libtomcrypt/src/hashes/sha2)
 
664
AS_MKDIR_P(libtomcrypt/src/hashes/whirl)
 
665
AS_MKDIR_P(libtomcrypt/src/mac/hmac)
 
666
AS_MKDIR_P(libtomcrypt/src/mac/omac)
 
667
AS_MKDIR_P(libtomcrypt/src/mac/pelican)
 
668
AS_MKDIR_P(libtomcrypt/src/mac/pmac)
 
669
AS_MKDIR_P(libtomcrypt/src/mac/f9)
 
670
AS_MKDIR_P(libtomcrypt/src/mac/xcbc)
 
671
AS_MKDIR_P(libtomcrypt/src/math/fp)
 
672
AS_MKDIR_P(libtomcrypt/src/misc/base64)
 
673
AS_MKDIR_P(libtomcrypt/src/misc/crypt)
 
674
AS_MKDIR_P(libtomcrypt/src/misc/mpi)
 
675
AS_MKDIR_P(libtomcrypt/src/misc/pkcs5)
 
676
AS_MKDIR_P(libtomcrypt/src/modes/cbc)
 
677
AS_MKDIR_P(libtomcrypt/src/modes/cfb)
 
678
AS_MKDIR_P(libtomcrypt/src/modes/ctr)
 
679
AS_MKDIR_P(libtomcrypt/src/modes/ecb)
 
680
AS_MKDIR_P(libtomcrypt/src/modes/ofb)
 
681
AS_MKDIR_P(libtomcrypt/src/modes/f8)
 
682
AS_MKDIR_P(libtomcrypt/src/modes/lrw)
 
683
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit)
 
684
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice)
 
685
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/ia5)
 
686
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/integer)
 
687
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/object_identifier)
 
688
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/octet)
 
689
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/printable_string)
 
690
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/sequence)
 
691
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/short_integer)
 
692
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utctime)
 
693
AS_MKDIR_P(libtomcrypt/src/pk/dh)
 
694
AS_MKDIR_P(libtomcrypt/src/pk/dsa)
 
695
AS_MKDIR_P(libtomcrypt/src/pk/ecc)
 
696
AS_MKDIR_P(libtomcrypt/src/pk/pkcs1)
 
697
AS_MKDIR_P(libtomcrypt/src/pk/rsa)
 
698
AS_MKDIR_P(libtomcrypt/src/prng)
 
699
AC_CONFIG_HEADER(config.h)
 
700
AC_OUTPUT(Makefile)
 
701
AC_OUTPUT(libtomcrypt/Makefile)
 
702
AC_OUTPUT(libtommath/Makefile)
 
703
 
 
704
AC_MSG_NOTICE()
 
705
if test $BUNDLED_LIBTOM = 1 ; then
 
706
AC_MSG_NOTICE(Using bundled libtomcrypt and libtommath)
 
707
else
 
708
AC_MSG_NOTICE(Using system libtomcrypt and libtommath)
 
709
fi
 
710
 
 
711
AC_MSG_NOTICE()
 
712
AC_MSG_NOTICE(Now edit options.h to choose features.)