comparison configure.ac @ 1400:238a439670f5 coverity

merge
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Jun 2017 00:10:58 +0800
parents 47a3a3cb7d45
children 8d9bad0a1c86
comparison
equal deleted inserted replaced
1344:b90da477ab63 1400:238a439670f5
43 conf_lastlog_location="/var/adm/lastlog" 43 conf_lastlog_location="/var/adm/lastlog"
44 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) 44 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
45 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` 45 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
46 if test "$sol2ver" -ge 8; then 46 if test "$sol2ver" -ge 8; then
47 AC_MSG_RESULT(yes) 47 AC_MSG_RESULT(yes)
48 AC_DEFINE(DISABLE_UTMP,,Disable utmp) 48 AC_DEFINE(DISABLE_UTMP,1,Disable utmp)
49 AC_DEFINE(DISABLE_WTMP,,Disable wtmp) 49 AC_DEFINE(DISABLE_WTMP,1,Disable wtmp)
50 else 50 else
51 AC_MSG_RESULT(no) 51 AC_MSG_RESULT(no)
52 fi 52 fi
53 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") 53 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
54 AC_CHECK_LIB(nsl, yp_match, LIBS="$LIBS -lnsl") 54 AC_CHECK_LIB(nsl, yp_match, LIBS="$LIBS -lnsl")
55 ;; 55 ;;
56 56
57 *-*-aix*) 57 *-*-aix*)
58 AC_DEFINE(AIX,,Using AIX) 58 AC_DEFINE(AIX,1,Using AIX)
59 # OpenSSH thinks it's broken. If it isn't, let me know. 59 # OpenSSH thinks it's broken. If it isn't, let me know.
60 AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo) 60 AC_DEFINE(BROKEN_GETADDRINFO,1,Broken getaddrinfo)
61 ;; 61 ;;
62 62
63 *-*-hpux*) 63 *-*-hpux*)
64 LIBS="$LIBS -lsec" 64 LIBS="$LIBS -lsec"
65 # It's probably broken. 65 # It's probably broken.
66 AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo) 66 AC_DEFINE(BROKEN_GETADDRINFO,1,Broken getaddrinfo)
67 ;; 67 ;;
68 *-dec-osf*) 68 *-dec-osf*)
69 AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo) 69 AC_DEFINE(BROKEN_GETADDRINFO,1,Broken getaddrinfo)
70 ;; 70 ;;
71 esac 71 esac
72 72
73 AC_CHECK_TOOL(AR, ar, :) 73 AC_CHECK_TOOL(AR, ar, :)
74 AC_CHECK_TOOL(RANLIB, ranlib, :) 74 AC_CHECK_TOOL(RANLIB, ranlib, :)
78 dnl Can't use login() or logout() with uclibc 78 dnl Can't use login() or logout() with uclibc
79 AC_CHECK_DECL(__UCLIBC__, 79 AC_CHECK_DECL(__UCLIBC__,
80 [ 80 [
81 no_loginfunc_check=1 81 no_loginfunc_check=1
82 AC_MSG_NOTICE([Using uClibc - login() and logout() probably don't work, so we won't use them.]) 82 AC_MSG_NOTICE([Using uClibc - login() and logout() probably don't work, so we won't use them.])
83 ],,,) 83 ],,)
84 84
85 dnl We test for crypt() specially. On Linux (and others?) it resides in libcrypt 85 dnl We test for crypt() specially. On Linux (and others?) it resides in libcrypt
86 dnl but we don't want link all binaries to -lcrypt, just dropbear server. 86 dnl but we don't want link all binaries to -lcrypt, just dropbear server.
87 dnl OS X doesn't need -lcrypt 87 dnl OS X doesn't need -lcrypt
88 AC_CHECK_FUNC(crypt, found_crypt_func=here) 88 AC_CHECK_FUNC(crypt, found_crypt_func=here)
116 116
117 AC_ARG_ENABLE(zlib, 117 AC_ARG_ENABLE(zlib,
118 [ --disable-zlib Don't include zlib support], 118 [ --disable-zlib Don't include zlib support],
119 [ 119 [
120 if test "x$enableval" = "xno"; then 120 if test "x$enableval" = "xno"; then
121 AC_DEFINE(DISABLE_ZLIB,, Use zlib) 121 AC_DEFINE(DISABLE_ZLIB,1,Use zlib)
122 AC_MSG_NOTICE(Disabling zlib) 122 AC_MSG_NOTICE(Disabling zlib)
123 else 123 else
124 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***])) 124 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
125 AC_MSG_NOTICE(Enabling zlib) 125 AC_MSG_NOTICE(Enabling zlib)
126 fi 126 fi
157 if test "x$enableval" = "xyes"; then 157 if test "x$enableval" = "xyes"; then
158 AC_CHECK_LIB(pam, pam_authenticate, , AC_MSG_ERROR([*** PAM missing - install first or check config.log ***])) 158 AC_CHECK_LIB(pam, pam_authenticate, , AC_MSG_ERROR([*** PAM missing - install first or check config.log ***]))
159 AC_MSG_NOTICE(Enabling PAM) 159 AC_MSG_NOTICE(Enabling PAM)
160 AC_CHECK_FUNCS(pam_fail_delay) 160 AC_CHECK_FUNCS(pam_fail_delay)
161 else 161 else
162 AC_DEFINE(DISABLE_PAM,, Use PAM) 162 AC_DEFINE(DISABLE_PAM,1,Use PAM)
163 AC_MSG_NOTICE(Disabling PAM) 163 AC_MSG_NOTICE(Disabling PAM)
164 fi 164 fi
165 ], 165 ],
166 [ 166 [
167 # disable it by default 167 # disable it by default
168 AC_DEFINE(DISABLE_PAM,, Use PAM) 168 AC_DEFINE(DISABLE_PAM,1,Use PAM)
169 AC_MSG_NOTICE(Disabling PAM) 169 AC_MSG_NOTICE(Disabling PAM)
170 ] 170 ]
171 ) 171 )
172 172
173 AC_ARG_ENABLE(openpty, 173 AC_ARG_ENABLE(openpty,
175 [ 175 [
176 if test "x$enableval" = "xno"; then 176 if test "x$enableval" = "xno"; then
177 AC_MSG_NOTICE(Not using openpty) 177 AC_MSG_NOTICE(Not using openpty)
178 else 178 else
179 AC_MSG_NOTICE(Using openpty if available) 179 AC_MSG_NOTICE(Using openpty if available)
180 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)]) 180 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,1,[Have openpty() function])])
181 fi 181 fi
182 ], 182 ],
183 [ 183 [
184 AC_MSG_NOTICE(Using openpty if available) 184 AC_MSG_NOTICE(Using openpty if available)
185 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)]) 185 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
189 189
190 AC_ARG_ENABLE(syslog, 190 AC_ARG_ENABLE(syslog,
191 [ --disable-syslog Don't include syslog support], 191 [ --disable-syslog Don't include syslog support],
192 [ 192 [
193 if test "x$enableval" = "xno"; then 193 if test "x$enableval" = "xno"; then
194 AC_DEFINE(DISABLE_SYSLOG,, Using syslog) 194 AC_DEFINE(DISABLE_SYSLOG,1,Using syslog)
195 AC_MSG_NOTICE(Disabling syslog) 195 AC_MSG_NOTICE(Disabling syslog)
196 else 196 else
197 AC_MSG_NOTICE(Enabling syslog) 197 AC_MSG_NOTICE(Enabling syslog)
198 fi 198 fi
199 ], 199 ],
293 [ ac_cv_have_struct_sockaddr_in6="yes" ], 293 [ ac_cv_have_struct_sockaddr_in6="yes" ],
294 [ ac_cv_have_struct_sockaddr_in6="no" ] 294 [ ac_cv_have_struct_sockaddr_in6="no" ]
295 ) 295 )
296 ]) 296 ])
297 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then 297 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
298 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,,Have struct sockaddr_in6) 298 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,Have struct sockaddr_in6)
299 fi 299 fi
300 300
301 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ 301 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
302 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 302 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
303 #include <sys/types.h> 303 #include <sys/types.h>
307 [ ac_cv_have_struct_in6_addr="yes" ], 307 [ ac_cv_have_struct_in6_addr="yes" ],
308 [ ac_cv_have_struct_in6_addr="no" ] 308 [ ac_cv_have_struct_in6_addr="no" ]
309 ) 309 )
310 ]) 310 ])
311 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then 311 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
312 AC_DEFINE(HAVE_STRUCT_IN6_ADDR,,Have struct in6_addr) 312 AC_DEFINE(HAVE_STRUCT_IN6_ADDR,1,Have struct in6_addr)
313 fi 313 fi
314 314
315 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ 315 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
316 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 316 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
317 #include <sys/types.h> 317 #include <sys/types.h>
322 [ ac_cv_have_struct_addrinfo="yes" ], 322 [ ac_cv_have_struct_addrinfo="yes" ],
323 [ ac_cv_have_struct_addrinfo="no" ] 323 [ ac_cv_have_struct_addrinfo="no" ]
324 ) 324 )
325 ]) 325 ])
326 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then 326 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
327 AC_DEFINE(HAVE_STRUCT_ADDRINFO,,Have struct addrinfo) 327 AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,Have struct addrinfo)
328 fi 328 fi
329 329
330 330
331 # IRIX has a const char return value for gai_strerror() 331 # IRIX has a const char return value for gai_strerror()
332 AC_CHECK_FUNCS(gai_strerror,[ 332 AC_CHECK_FUNCS(gai_strerror,[
400 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1) 400 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1)
401 ] 401 ]
402 ) 402 )
403 403
404 if test $BUNDLED_LIBTOM = 1 ; then 404 if test $BUNDLED_LIBTOM = 1 ; then
405 AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom) 405 AC_DEFINE(BUNDLED_LIBTOM,1,Use bundled libtom)
406 fi 406 fi
407 407
408 AC_SUBST(LIBTOM_LIBS) 408 AC_SUBST(LIBTOM_LIBS)
409 AC_SUBST(BUNDLED_LIBTOM) 409 AC_SUBST(BUNDLED_LIBTOM)
410 410
411 dnl Added from OpenSSH 3.6.1p2's configure.ac 411 dnl Added from OpenSSH 3.6.1p2's configure.ac
412 412
413 dnl allow user to disable some login recording features 413 dnl allow user to disable some login recording features
414 AC_ARG_ENABLE(lastlog, 414 AC_ARG_ENABLE(lastlog,
415 [ --disable-lastlog Disable use of lastlog even if detected [no]], 415 [ --disable-lastlog Disable use of lastlog even if detected [no]],
416 [ AC_DEFINE(DISABLE_LASTLOG,,Disable use of lastlog()) ] 416 [
417 if test "x$enableval" = "xno" ; then
418 AC_DEFINE(DISABLE_LASTLOG,1,Disable use of lastlog())
419 fi
420 ]
417 ) 421 )
418 AC_ARG_ENABLE(utmp, 422 AC_ARG_ENABLE(utmp,
419 [ --disable-utmp Disable use of utmp even if detected [no]], 423 [ --disable-utmp Disable use of utmp even if detected [no]],
420 [ AC_DEFINE(DISABLE_UTMP,,Disable use of utmp) ] 424 [
425 if test "x$enableval" = "xno" ; then
426 AC_DEFINE(DISABLE_UTMP,1,Disable use of utmp)
427 fi
428 ]
421 ) 429 )
422 AC_ARG_ENABLE(utmpx, 430 AC_ARG_ENABLE(utmpx,
423 [ --disable-utmpx Disable use of utmpx even if detected [no]], 431 [ --disable-utmpx Disable use of utmpx even if detected [no]],
424 [ AC_DEFINE(DISABLE_UTMPX,,Disable use of utmpx) ] 432 [
433 if test "x$enableval" = "xno" ; then
434 AC_DEFINE(DISABLE_UTMPX,1,Disable use of utmpx)
435 fi
436 ]
425 ) 437 )
426 AC_ARG_ENABLE(wtmp, 438 AC_ARG_ENABLE(wtmp,
427 [ --disable-wtmp Disable use of wtmp even if detected [no]], 439 [ --disable-wtmp Disable use of wtmp even if detected [no]],
428 [ AC_DEFINE(DISABLE_WTMP,,Disable use of wtmp) ] 440 [
441 if test "x$enableval" = "xno" ; then
442 AC_DEFINE(DISABLE_WTMP,1,Disable use of wtmp)
443 fi
444 ]
429 ) 445 )
430 AC_ARG_ENABLE(wtmpx, 446 AC_ARG_ENABLE(wtmpx,
431 [ --disable-wtmpx Disable use of wtmpx even if detected [no]], 447 [ --disable-wtmpx Disable use of wtmpx even if detected [no]],
432 [ AC_DEFINE(DISABLE_WTMPX,,Disable use of wtmpx) ] 448 [
449 if test "x$enableval" = "xno" ; then
450 AC_DEFINE(DISABLE_WTMPX,1,Disable use of wtmpx)
451 fi
452 ]
433 ) 453 )
434 AC_ARG_ENABLE(loginfunc, 454 AC_ARG_ENABLE(loginfunc,
435 [ --disable-loginfunc Disable use of login() etc. [no]], 455 [ --disable-loginfunc Disable use of login() etc. [no]],
436 [ no_loginfunc_check=1 456 [ no_loginfunc_check=1
437 AC_MSG_NOTICE(Not using login() etc) ] 457 AC_MSG_NOTICE([Not using login() etc]) ]
438 ) 458 )
439 AC_ARG_ENABLE(pututline, 459 AC_ARG_ENABLE(pututline,
440 [ --disable-pututline Disable use of pututline() etc. ([uw]tmp) [no]], 460 [ --disable-pututline Disable use of pututline() etc. ([uw]tmp) [no]],
441 [ AC_DEFINE(DISABLE_PUTUTLINE,,Disable use of pututline()) ] 461 [
462 if test "x$enableval" = "xno" ; then
463 AC_DEFINE(DISABLE_PUTUTLINE,1,Disable use of pututline())
464 fi
465 ]
442 ) 466 )
443 AC_ARG_ENABLE(pututxline, 467 AC_ARG_ENABLE(pututxline,
444 [ --disable-pututxline Disable use of pututxline() etc. ([uw]tmpx) [no]], 468 [ --disable-pututxline Disable use of pututxline() etc. ([uw]tmpx) [no]],
445 [ AC_DEFINE(DISABLE_PUTUTXLINE,,Disable use of pututxline()) ] 469 [
470 if test "x$enableval" = "xno" ; then
471 AC_DEFINE(DISABLE_PUTUTXLINE,1,Disable use of pututxline())
472 fi
473 ]
446 ) 474 )
447 AC_ARG_WITH(lastlog, 475 AC_ARG_WITH(lastlog,
448 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], 476 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
449 [ 477 [
450 if test "x$withval" = "xno" ; then 478 if test "x$withval" = "xno" ; then
455 ] 483 ]
456 ) 484 )
457 485
458 if test -z "$no_loginfunc_check"; then 486 if test -z "$no_loginfunc_check"; then
459 dnl Checks for libutil functions (login(), logout() etc, not openpty() ) 487 dnl Checks for libutil functions (login(), logout() etc, not openpty() )
460 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN,,Have login() function)]) 488 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN,1,[Have login() function])])
461 AC_CHECK_FUNCS(logout updwtmp logwtmp) 489 AC_CHECK_FUNCS(logout updwtmp logwtmp)
462 fi 490 fi
463 491
464 dnl lastlog, [uw]tmpx? detection 492 dnl lastlog, [uw]tmpx? detection
465 dnl NOTE: set the paths in the platform section to avoid the 493 dnl NOTE: set the paths in the platform section to avoid the
651 679
652 # Solaris needs ptmx 680 # Solaris needs ptmx
653 if test -z "$no_ptmx_check" ; then 681 if test -z "$no_ptmx_check" ; then
654 if test x"$cross_compiling" = x"no" ; then 682 if test x"$cross_compiling" = x"no" ; then
655 if test -e /dev/ptmx ; then 683 if test -e /dev/ptmx ; then
656 AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx) 684 AC_DEFINE(USE_DEV_PTMX,1,Use /dev/ptmx)
657 fi 685 fi
658 else 686 else
659 AC_MSG_NOTICE([Not checking for /dev/ptmx, we're cross-compiling]) 687 AC_MSG_NOTICE([Not checking for /dev/ptmx, we're cross-compiling])
660 fi 688 fi
661 fi 689 fi
662 690
663 if test -z "$no_ptc_check" ; then 691 if test -z "$no_ptc_check" ; then
664 if test x"$cross_compiling" = x"no" ; then 692 if test x"$cross_compiling" = x"no" ; then
665 if test -e /dev/ptc ; then 693 if test -e /dev/ptc ; then
666 AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts) 694 AC_DEFINE(HAVE_DEV_PTS_AND_PTC,1,Use /dev/ptc & /dev/pts)
667 fi 695 fi
668 else 696 else
669 AC_MSG_NOTICE([Not checking for /dev/ptc & /dev/pts since we're cross-compiling]) 697 AC_MSG_NOTICE([Not checking for /dev/ptc & /dev/pts since we're cross-compiling])
670 fi 698 fi
671 fi 699 fi