Changeset View
Changeset View
Standalone View
Standalone View
configure.ac
# | # | ||||
# Copyright (c) 1999-2004 Damien Miller | # Copyright (c) 1999-2004 Damien Miller | ||||
# | # | ||||
# Permission to use, copy, modify, and distribute this software for any | # Permission to use, copy, modify, and distribute this software for any | ||||
# purpose with or without fee is hereby granted, provided that the above | # purpose with or without fee is hereby granted, provided that the above | ||||
# copyright notice and this permission notice appear in all copies. | # copyright notice and this permission notice appear in all copies. | ||||
# | # | ||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) | ||||
AC_REVISION($Revision: 1.583 $) | AC_CONFIG_MACRO_DIR([m4]) | ||||
AC_CONFIG_SRCDIR([ssh.c]) | AC_CONFIG_SRCDIR([ssh.c]) | ||||
AC_LANG([C]) | AC_LANG([C]) | ||||
AC_CONFIG_HEADER([config.h]) | AC_CONFIG_HEADER([config.h]) | ||||
AC_PROG_CC([cc gcc]) | AC_PROG_CC([cc gcc]) | ||||
AC_CANONICAL_HOST | AC_CANONICAL_HOST | ||||
AC_C_BIGENDIAN | AC_C_BIGENDIAN | ||||
# Checks for programs. | # Checks for programs. | ||||
AC_PROG_AWK | AC_PROG_AWK | ||||
AC_PROG_CPP | AC_PROG_CPP | ||||
AC_PROG_RANLIB | AC_PROG_RANLIB | ||||
AC_PROG_INSTALL | AC_PROG_INSTALL | ||||
AC_PROG_EGREP | AC_PROG_EGREP | ||||
AC_PROG_MKDIR_P | AC_PROG_MKDIR_P | ||||
AC_CHECK_TOOLS([AR], [ar]) | AC_CHECK_TOOLS([AR], [ar]) | ||||
AC_PATH_PROG([CAT], [cat]) | AC_PATH_PROG([CAT], [cat]) | ||||
AC_PATH_PROG([KILL], [kill]) | AC_PATH_PROG([KILL], [kill]) | ||||
AC_PATH_PROG([SED], [sed]) | AC_PATH_PROG([SED], [sed]) | ||||
AC_PATH_PROG([ENT], [ent]) | |||||
AC_SUBST([ENT]) | |||||
AC_PATH_PROG([TEST_MINUS_S_SH], [bash]) | AC_PATH_PROG([TEST_MINUS_S_SH], [bash]) | ||||
AC_PATH_PROG([TEST_MINUS_S_SH], [ksh]) | AC_PATH_PROG([TEST_MINUS_S_SH], [ksh]) | ||||
AC_PATH_PROG([TEST_MINUS_S_SH], [sh]) | AC_PATH_PROG([TEST_MINUS_S_SH], [sh]) | ||||
AC_PATH_PROG([SH], [sh]) | AC_PATH_PROG([SH], [sh]) | ||||
AC_PATH_PROG([GROFF], [groff]) | AC_PATH_PROG([GROFF], [groff]) | ||||
AC_PATH_PROG([NROFF], [nroff]) | AC_PATH_PROG([NROFF], [nroff awf]) | ||||
AC_PATH_PROG([MANDOC], [mandoc]) | AC_PATH_PROG([MANDOC], [mandoc]) | ||||
AC_SUBST([TEST_SHELL], [sh]) | AC_SUBST([TEST_SHELL], [sh]) | ||||
dnl select manpage formatter | dnl select manpage formatter to be used to build "cat" format pages. | ||||
if test "x$MANDOC" != "x" ; then | if test "x$MANDOC" != "x" ; then | ||||
MANFMT="$MANDOC" | MANFMT="$MANDOC" | ||||
elif test "x$NROFF" != "x" ; then | elif test "x$NROFF" != "x" ; then | ||||
MANFMT="$NROFF -mandoc" | MANFMT="$NROFF -mandoc" | ||||
elif test "x$GROFF" != "x" ; then | elif test "x$GROFF" != "x" ; then | ||||
MANFMT="$GROFF -mandoc -Tascii" | MANFMT="$GROFF -mandoc -Tascii" | ||||
else | else | ||||
AC_MSG_WARN([no manpage formatted found]) | AC_MSG_WARN([no manpage formatter found]) | ||||
MANFMT="false" | MANFMT="false" | ||||
fi | fi | ||||
AC_SUBST([MANFMT]) | AC_SUBST([MANFMT]) | ||||
dnl for buildpkg.sh | dnl for buildpkg.sh | ||||
AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd], | AC_PATH_PROG([PATH_GROUPADD_PROG], [groupadd], [groupadd], | ||||
[/usr/sbin${PATH_SEPARATOR}/etc]) | [/usr/sbin${PATH_SEPARATOR}/etc]) | ||||
AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd], | AC_PATH_PROG([PATH_USERADD_PROG], [useradd], [useradd], | ||||
Show All 23 Lines | |||||
dnl use case we overlooked and someone needs to re-enable it. Unless a good | dnl use case we overlooked and someone needs to re-enable it. Unless a good | ||||
dnl reason is found we'll be removing this in future. | dnl reason is found we'll be removing this in future. | ||||
LD="$CC" | LD="$CC" | ||||
AC_SUBST([LD]) | AC_SUBST([LD]) | ||||
AC_C_INLINE | AC_C_INLINE | ||||
AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) | AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) | ||||
AC_CHECK_DECL([LONG_LONG_MAX], [have_long_long_max=1], , [#include <limits.h>]) | |||||
AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ | AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <dev/systrace.h> | #include <dev/systrace.h> | ||||
]) | ]) | ||||
AC_CHECK_DECL([RLIMIT_NPROC], | AC_CHECK_DECL([RLIMIT_NPROC], | ||||
[AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [ | [AC_DEFINE([HAVE_RLIMIT_NPROC], [], [sys/resource.h has RLIMIT_NPROC])], , [ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | [ AC_MSG_RESULT([yes]) | ||||
WERROR="-Werror"], | WERROR="-Werror"], | ||||
[ AC_MSG_RESULT([no]) | [ AC_MSG_RESULT([no]) | ||||
WERROR="" ] | WERROR="" ] | ||||
) | ) | ||||
CFLAGS="$saved_CFLAGS" | CFLAGS="$saved_CFLAGS" | ||||
if test "$GCC" = "yes" || test "$GCC" = "egcs"; then | if test "$GCC" = "yes" || test "$GCC" = "egcs"; then | ||||
OSSH_CHECK_CFLAG_COMPILE([-pipe]) | OSSH_CHECK_CFLAG_COMPILE([-pipe]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) | |||||
OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) | OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wno-error=format-truncation]) | |||||
OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) | |||||
OSSH_CHECK_CFLAG_COMPILE([-Wall]) | OSSH_CHECK_CFLAG_COMPILE([-Wall]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wextra]) | |||||
OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) | OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) | OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) | OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wunused-parameter], [-Wno-unused-parameter]) | |||||
OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-Wimplicit-fallthrough]) | |||||
OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) | ||||
if test "x$use_toolchain_hardening" = "x1"; then | if test "x$use_toolchain_hardening" = "x1"; then | ||||
OSSH_CHECK_CFLAG_COMPILE([-mretpoline]) # clang | OSSH_CHECK_CFLAG_COMPILE([-mretpoline]) # clang | ||||
OSSH_CHECK_LDFLAG_LINK([-Wl,-z,retpolineplt]) | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,retpolineplt]) | ||||
OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) | OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) | ||||
OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) | ||||
OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) | ||||
OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) | OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) | ||||
Show All 33 Lines | if test "x$use_stack_protector" = "x1"; then | ||||
for t in -fstack-protector-strong -fstack-protector-all \ | for t in -fstack-protector-strong -fstack-protector-all \ | ||||
-fstack-protector; do | -fstack-protector; do | ||||
AC_MSG_CHECKING([if $CC supports $t]) | AC_MSG_CHECKING([if $CC supports $t]) | ||||
saved_CFLAGS="$CFLAGS" | saved_CFLAGS="$CFLAGS" | ||||
saved_LDFLAGS="$LDFLAGS" | saved_LDFLAGS="$LDFLAGS" | ||||
CFLAGS="$CFLAGS $t -Werror" | CFLAGS="$CFLAGS $t -Werror" | ||||
LDFLAGS="$LDFLAGS $t -Werror" | LDFLAGS="$LDFLAGS $t -Werror" | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM([[ #include <stdio.h> ]], | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | |||||
int func (int t) {char b[100]; snprintf(b,sizeof b,"%d",t); return t;} | |||||
]], | |||||
[[ | [[ | ||||
char x[256]; | char x[256]; | ||||
snprintf(x, sizeof(x), "XXX"); | snprintf(x, sizeof(x), "XXX%d", func(1)); | ||||
]])], | ]])], | ||||
[ AC_MSG_RESULT([yes]) | [ AC_MSG_RESULT([yes]) | ||||
CFLAGS="$saved_CFLAGS $t" | CFLAGS="$saved_CFLAGS $t" | ||||
LDFLAGS="$saved_LDFLAGS $t" | LDFLAGS="$saved_LDFLAGS $t" | ||||
AC_MSG_CHECKING([if $t works]) | AC_MSG_CHECKING([if $t works]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ #include <stdio.h> ]], | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | |||||
int func (int t) {char b[100]; snprintf(b,sizeof b,"%d",t); return t;} | |||||
]], | |||||
[[ | [[ | ||||
char x[256]; | char x[256]; | ||||
snprintf(x, sizeof(x), "XXX"); | snprintf(x, sizeof(x), "XXX%d", func(1)); | ||||
]])], | ]])], | ||||
[ AC_MSG_RESULT([yes]) | [ AC_MSG_RESULT([yes]) | ||||
break ], | break ], | ||||
[ AC_MSG_RESULT([no]) ], | [ AC_MSG_RESULT([no]) ], | ||||
[ AC_MSG_WARN([cross compiling: cannot test]) | [ AC_MSG_WARN([cross compiling: cannot test]) | ||||
break ] | break ] | ||||
) | ) | ||||
], | ], | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | AC_CHECK_HEADERS([ \ | ||||
crypto/sha2.h \ | crypto/sha2.h \ | ||||
dirent.h \ | dirent.h \ | ||||
endian.h \ | endian.h \ | ||||
elf.h \ | elf.h \ | ||||
err.h \ | err.h \ | ||||
features.h \ | features.h \ | ||||
fcntl.h \ | fcntl.h \ | ||||
floatingpoint.h \ | floatingpoint.h \ | ||||
fnmatch.h \ | |||||
getopt.h \ | getopt.h \ | ||||
glob.h \ | glob.h \ | ||||
ia.h \ | ia.h \ | ||||
iaf.h \ | iaf.h \ | ||||
ifaddrs.h \ | ifaddrs.h \ | ||||
inttypes.h \ | inttypes.h \ | ||||
langinfo.h \ | langinfo.h \ | ||||
limits.h \ | limits.h \ | ||||
Show All 13 Lines | AC_CHECK_HEADERS([ \ | ||||
security/pam_appl.h \ | security/pam_appl.h \ | ||||
sha2.h \ | sha2.h \ | ||||
shadow.h \ | shadow.h \ | ||||
stddef.h \ | stddef.h \ | ||||
stdint.h \ | stdint.h \ | ||||
string.h \ | string.h \ | ||||
strings.h \ | strings.h \ | ||||
sys/bitypes.h \ | sys/bitypes.h \ | ||||
sys/byteorder.h \ | |||||
sys/bsdtty.h \ | sys/bsdtty.h \ | ||||
sys/cdefs.h \ | sys/cdefs.h \ | ||||
sys/dir.h \ | sys/dir.h \ | ||||
sys/file.h \ | sys/file.h \ | ||||
sys/mman.h \ | sys/mman.h \ | ||||
sys/label.h \ | sys/label.h \ | ||||
sys/ndir.h \ | sys/ndir.h \ | ||||
sys/poll.h \ | sys/poll.h \ | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
SPC_MSG="no" | SPC_MSG="no" | ||||
SP_MSG="no" | SP_MSG="no" | ||||
SPP_MSG="no" | SPP_MSG="no" | ||||
# Support for Solaris/Illumos privileges (this test is used by both | # Support for Solaris/Illumos privileges (this test is used by both | ||||
# the --with-solaris-privs option and --with-sandbox=solaris). | # the --with-solaris-privs option and --with-sandbox=solaris). | ||||
SOLARIS_PRIVS="no" | SOLARIS_PRIVS="no" | ||||
AC_CHECK_SIZEOF([size_t]) | |||||
# Check for some target-specific stuff | # Check for some target-specific stuff | ||||
case "$host" in | case "$host" in | ||||
*-*-aix*) | *-*-aix*) | ||||
# Some versions of VAC won't allow macro redefinitions at | # Some versions of VAC won't allow macro redefinitions at | ||||
# -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that | # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that | ||||
# particularly with older versions of vac or xlc. | # particularly with older versions of vac or xlc. | ||||
# It also throws errors about null macro arguments, but these are | # It also throws errors about null macro arguments, but these are | ||||
# not fatal. | # not fatal. | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | #define testmacro bar]], | ||||
AC_CHECK_FUNCS([getgrset setauthdb]) | AC_CHECK_FUNCS([getgrset setauthdb]) | ||||
AC_CHECK_DECL([F_CLOSEM], | AC_CHECK_DECL([F_CLOSEM], | ||||
AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), | AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]), | ||||
[], | [], | ||||
[ #include <limits.h> | [ #include <limits.h> | ||||
#include <fcntl.h> ] | #include <fcntl.h> ] | ||||
) | ) | ||||
check_for_aix_broken_getaddrinfo=1 | check_for_aix_broken_getaddrinfo=1 | ||||
AC_DEFINE([BROKEN_REALPATH], [1], [Define if you have a broken realpath.]) | |||||
AC_DEFINE([SETEUID_BREAKS_SETUID], [1], | AC_DEFINE([SETEUID_BREAKS_SETUID], [1], | ||||
[Define if your platform breaks doing a seteuid before a setuid]) | [Define if your platform breaks doing a seteuid before a setuid]) | ||||
AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) | AC_DEFINE([BROKEN_SETREUID], [1], [Define if your setreuid() is broken]) | ||||
AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) | AC_DEFINE([BROKEN_SETREGID], [1], [Define if your setregid() is broken]) | ||||
dnl AIX handles lastlog as part of its login message | dnl AIX handles lastlog as part of its login message | ||||
AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) | AC_DEFINE([DISABLE_LASTLOG], [1], [Define if you don't want to use lastlog]) | ||||
AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], | AC_DEFINE([LOGIN_NEEDS_UTMPX], [1], | ||||
[Some systems need a utmpx entry for /bin/login to work]) | [Some systems need a utmpx entry for /bin/login to work]) | ||||
Show All 36 Lines | AC_DEFINE([IP_TOS_IS_BROKEN], [1], | ||||
[Define if your system choked on IP TOS setting]) | [Define if your system choked on IP TOS setting]) | ||||
AC_DEFINE([SETEUID_BREAKS_SETUID]) | AC_DEFINE([SETEUID_BREAKS_SETUID]) | ||||
AC_DEFINE([BROKEN_SETREUID]) | AC_DEFINE([BROKEN_SETREUID]) | ||||
AC_DEFINE([BROKEN_SETREGID]) | AC_DEFINE([BROKEN_SETREGID]) | ||||
;; | ;; | ||||
*-*-darwin*) | *-*-darwin*) | ||||
use_pie=auto | use_pie=auto | ||||
AC_MSG_CHECKING([if we have working getaddrinfo]) | AC_MSG_CHECKING([if we have working getaddrinfo]) | ||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h> | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||||
#include <mach-o/dyld.h> | |||||
#include <stdlib.h> | |||||
main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | ||||
exit(0); | exit(0); | ||||
else | else | ||||
exit(1); | exit(1); | ||||
} | } | ||||
]])], | ]])], | ||||
[AC_MSG_RESULT([working])], | [AC_MSG_RESULT([working])], | ||||
[AC_MSG_RESULT([buggy]) | [AC_MSG_RESULT([buggy]) | ||||
Show All 22 Lines | main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | ||||
AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], | AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], | ||||
[Define to a Set Process Title type if your system is | [Define to a Set Process Title type if your system is | ||||
supported by bsd-setproctitle.c]) | supported by bsd-setproctitle.c]) | ||||
AC_CHECK_FUNCS([sandbox_init]) | AC_CHECK_FUNCS([sandbox_init]) | ||||
AC_CHECK_HEADERS([sandbox.h]) | AC_CHECK_HEADERS([sandbox.h]) | ||||
AC_CHECK_LIB([sandbox], [sandbox_apply], [ | AC_CHECK_LIB([sandbox], [sandbox_apply], [ | ||||
SSHDLIBS="$SSHDLIBS -lsandbox" | SSHDLIBS="$SSHDLIBS -lsandbox" | ||||
]) | ]) | ||||
# proc_pidinfo()-based closefrom() replacement. | |||||
AC_CHECK_HEADERS([libproc.h]) | |||||
AC_CHECK_FUNCS([proc_pidinfo]) | |||||
;; | ;; | ||||
*-*-dragonfly*) | *-*-dragonfly*) | ||||
SSHDLIBS="$SSHDLIBS -lcrypt" | SSHDLIBS="$SSHDLIBS -lcrypt" | ||||
TEST_MALLOC_OPTIONS="AFGJPRX" | TEST_MALLOC_OPTIONS="AFGJPRX" | ||||
;; | ;; | ||||
*-*-haiku*) | *-*-haiku*) | ||||
LIBS="$LIBS -lbsd " | LIBS="$LIBS -lbsd " | ||||
CFLAGS="$CFLAGS -D_BSD_SOURCE" | |||||
AC_CHECK_LIB([network], [socket]) | AC_CHECK_LIB([network], [socket]) | ||||
AC_DEFINE([HAVE_U_INT64_T]) | AC_DEFINE([HAVE_U_INT64_T]) | ||||
AC_DEFINE([DISABLE_UTMPX], [1], [no utmpx]) | |||||
MANTYPE=man | MANTYPE=man | ||||
;; | ;; | ||||
*-*-hpux*) | *-*-hpux*) | ||||
# first we define all of the options common to all HP-UX releases | # first we define all of the options common to all HP-UX releases | ||||
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" | CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" | ||||
IPADDR_IN_DISPLAY=yes | IPADDR_IN_DISPLAY=yes | ||||
AC_DEFINE([USE_PIPES]) | AC_DEFINE([USE_PIPES]) | ||||
AC_DEFINE([LOGIN_NEEDS_UTMPX]) | AC_DEFINE([LOGIN_NEEDS_UTMPX]) | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | AC_DEFINE([SSH_TUN_COMPAT_AF], [1], | ||||
[Use tunnel device compatibility to OpenBSD]) | [Use tunnel device compatibility to OpenBSD]) | ||||
AC_DEFINE([SSH_TUN_PREPEND_AF], [1], | AC_DEFINE([SSH_TUN_PREPEND_AF], [1], | ||||
[Prepend the address family to IP tunnel traffic]) | [Prepend the address family to IP tunnel traffic]) | ||||
fi | fi | ||||
AC_CHECK_HEADER([linux/if.h], | AC_CHECK_HEADER([linux/if.h], | ||||
AC_DEFINE([SYS_RDOMAIN_LINUX], [1], | AC_DEFINE([SYS_RDOMAIN_LINUX], [1], | ||||
[Support routing domains using Linux VRF]), [], [ | [Support routing domains using Linux VRF]), [], [ | ||||
#ifdef HAVE_SYS_TYPES_H | #ifdef HAVE_SYS_TYPES_H | ||||
# include <sys/types.H> | # include <sys/types.h> | ||||
#endif | #endif | ||||
]) | ]) | ||||
AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], | AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h], [], | ||||
[], [#include <linux/types.h>]) | [], [#include <linux/types.h>]) | ||||
# Obtain MIPS ABI | # Obtain MIPS ABI | ||||
case "$host" in | case "$host" in | ||||
mips*) | mips*) | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
Show All 14 Lines | #endif | ||||
]) | ]) | ||||
;; | ;; | ||||
esac | esac | ||||
AC_MSG_CHECKING([for seccomp architecture]) | AC_MSG_CHECKING([for seccomp architecture]) | ||||
seccomp_audit_arch= | seccomp_audit_arch= | ||||
case "$host" in | case "$host" in | ||||
x86_64-*) | x86_64-*) | ||||
seccomp_audit_arch=AUDIT_ARCH_X86_64 | seccomp_audit_arch=AUDIT_ARCH_X86_64 | ||||
# X32: AMD64 instructions in 32bit address space. | |||||
if test "x$ac_cv_sizeof_size_t" = "x4" ; then | |||||
seccomp_audit_arch=AUDIT_ARCH_I386 | |||||
fi | |||||
;; | ;; | ||||
i*86-*) | i*86-*) | ||||
seccomp_audit_arch=AUDIT_ARCH_I386 | seccomp_audit_arch=AUDIT_ARCH_I386 | ||||
;; | ;; | ||||
arm*-*) | arm*-*) | ||||
seccomp_audit_arch=AUDIT_ARCH_ARM | seccomp_audit_arch=AUDIT_ARCH_ARM | ||||
;; | ;; | ||||
aarch64*-*) | aarch64*-*) | ||||
Show All 32 Lines | mips64el-*) | ||||
"n32") | "n32") | ||||
seccomp_audit_arch=AUDIT_ARCH_MIPSEL64N32 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64N32 | ||||
;; | ;; | ||||
"n64") | "n64") | ||||
seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 | seccomp_audit_arch=AUDIT_ARCH_MIPSEL64 | ||||
;; | ;; | ||||
esac | esac | ||||
;; | ;; | ||||
riscv64-*) | |||||
seccomp_audit_arch=AUDIT_ARCH_RISCV64 | |||||
;; | |||||
esac | esac | ||||
if test "x$seccomp_audit_arch" != "x" ; then | if test "x$seccomp_audit_arch" != "x" ; then | ||||
AC_MSG_RESULT(["$seccomp_audit_arch"]) | AC_MSG_RESULT(["$seccomp_audit_arch"]) | ||||
AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], | AC_DEFINE_UNQUOTED([SECCOMP_AUDIT_ARCH], [$seccomp_audit_arch], | ||||
[Specify the system call convention in use]) | [Specify the system call convention in use]) | ||||
else | else | ||||
AC_MSG_RESULT([architecture not supported]) | AC_MSG_RESULT([architecture not supported]) | ||||
fi | fi | ||||
Show All 36 Lines | *-*-bsdi*) | ||||
AC_DEFINE([BROKEN_SETREGID]) | AC_DEFINE([BROKEN_SETREGID]) | ||||
;; | ;; | ||||
*-next-*) | *-next-*) | ||||
conf_lastlog_location="/usr/adm/lastlog" | conf_lastlog_location="/usr/adm/lastlog" | ||||
conf_utmp_location=/etc/utmp | conf_utmp_location=/etc/utmp | ||||
conf_wtmp_location=/usr/adm/wtmp | conf_wtmp_location=/usr/adm/wtmp | ||||
maildir=/usr/spool/mail | maildir=/usr/spool/mail | ||||
AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) | ||||
AC_DEFINE([BROKEN_REALPATH]) | |||||
AC_DEFINE([USE_PIPES]) | AC_DEFINE([USE_PIPES]) | ||||
AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) | AC_DEFINE([BROKEN_SAVED_UIDS], [1], [Needed for NeXT]) | ||||
;; | ;; | ||||
*-*-openbsd*) | *-*-openbsd*) | ||||
use_pie=auto | use_pie=auto | ||||
AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) | AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) | ||||
AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) | AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) | ||||
AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) | AC_DEFINE([SSH_TUN_OPENBSD], [1], [Open tunnel devices the OpenBSD way]) | ||||
▲ Show 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | *-*-nto-qnx*) | ||||
*-*-nto-qnx6*) | *-*-nto-qnx6*) | ||||
AC_DEFINE([DISABLE_FD_PASSING]) | AC_DEFINE([DISABLE_FD_PASSING]) | ||||
;; | ;; | ||||
esac | esac | ||||
;; | ;; | ||||
*-*-ultrix*) | *-*-ultrix*) | ||||
AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) | ||||
AC_DEFINE([NEED_SETPGRP]) | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to for controlling tty]) | ||||
AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix]) | AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix]) | ||||
AC_DEFINE([DISABLE_UTMPX], [1], [Disable utmpx]) | |||||
# DISABLE_FD_PASSING so that we call setpgrp as root, otherwise we | |||||
# don't get a controlling tty. | |||||
AC_DEFINE([DISABLE_FD_PASSING], [1], [Need to call setpgrp as root]) | |||||
# On Ultrix some headers are not protected against multiple includes, | |||||
# so we create wrappers and put it where the compiler will find it. | |||||
AC_MSG_WARN([creating compat wrappers for headers]) | |||||
mkdir -p netinet | |||||
for header in netinet/ip.h netdb.h resolv.h; do | |||||
name=`echo $header | tr 'a-z/.' 'A-Z__'` | |||||
cat >$header <<EOD | |||||
#ifndef _SSH_COMPAT_${name} | |||||
#define _SSH_COMPAT_${name} | |||||
#include "/usr/include/${header}" | |||||
#endif | |||||
EOD | |||||
done | |||||
;; | ;; | ||||
*-*-lynxos) | *-*-lynxos) | ||||
CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" | CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" | ||||
AC_DEFINE([BROKEN_SETVBUF], [1], | AC_DEFINE([BROKEN_SETVBUF], [1], | ||||
[LynxOS has broken setvbuf() implementation]) | [LynxOS has broken setvbuf() implementation]) | ||||
;; | ;; | ||||
esac | esac | ||||
AC_MSG_CHECKING([compiler and flags for sanity]) | AC_MSG_CHECKING([compiler and flags for sanity]) | ||||
AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])], | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdlib.h> ]], [[ exit(0); ]])], | ||||
[ AC_MSG_RESULT([yes]) ], | [ AC_MSG_RESULT([yes]) ], | ||||
[ | [ | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) | AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) | ||||
], | ], | ||||
[ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] | [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] | ||||
) | ) | ||||
dnl Checks for header files. | dnl Checks for header files. | ||||
# Checks for libraries. | # Checks for libraries. | ||||
AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) | AC_CHECK_FUNC([setsockopt], , [AC_CHECK_LIB([socket], [setsockopt])]) | ||||
dnl IRIX and Solaris 2.5.1 have dirname() in libgen | dnl IRIX and Solaris 2.5.1 have dirname() in libgen | ||||
AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ | AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS([libgen.h])] , [ | ||||
AC_CHECK_LIB([gen], [dirname], [ | AC_CHECK_LIB([gen], [dirname], [ | ||||
AC_CACHE_CHECK([for broken dirname], | AC_CACHE_CHECK([for broken dirname], | ||||
ac_cv_have_broken_dirname, [ | ac_cv_have_broken_dirname, [ | ||||
save_LIBS="$LIBS" | save_LIBS="$LIBS" | ||||
LIBS="$LIBS -lgen" | LIBS="$LIBS -lgen" | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_SOURCE([[ | [AC_LANG_SOURCE([[ | ||||
#include <libgen.h> | #include <libgen.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <stdlib.h> | |||||
int main(int argc, char **argv) { | int main(int argc, char **argv) { | ||||
char *s, buf[32]; | char *s, buf[32]; | ||||
strncpy(buf,"/etc", 32); | strncpy(buf,"/etc", 32); | ||||
s = dirname(buf); | s = dirname(buf); | ||||
if (!s || strncmp(s, "/", 32) != 0) { | if (!s || strncmp(s, "/", 32) != 0) { | ||||
exit(1); | exit(1); | ||||
Show All 16 Lines | int main(int argc, char **argv) { | ||||
]) | ]) | ||||
]) | ]) | ||||
AC_CHECK_FUNC([getspnam], , | AC_CHECK_FUNC([getspnam], , | ||||
[AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) | [AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])]) | ||||
AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], | ||||
[Define if you have the basename function.])]) | [Define if you have the basename function.])]) | ||||
dnl zlib is required | dnl zlib defaults to enabled | ||||
zlib=yes | |||||
AC_ARG_WITH([zlib], | AC_ARG_WITH([zlib], | ||||
[ --with-zlib=PATH Use zlib in PATH], | [ --with-zlib=PATH Use zlib in PATH], | ||||
[ if test "x$withval" = "xno" ; then | [ if test "x$withval" = "xno" ; then | ||||
AC_MSG_ERROR([*** zlib is required ***]) | zlib=no | ||||
elif test "x$withval" != "xyes"; then | elif test "x$withval" != "xyes"; then | ||||
if test -d "$withval/lib"; then | if test -d "$withval/lib"; then | ||||
if test -n "${rpath_opt}"; then | if test -n "${rpath_opt}"; then | ||||
LDFLAGS="-L${withval}/lib ${rpath_opt}${withval}/lib ${LDFLAGS}" | LDFLAGS="-L${withval}/lib ${rpath_opt}${withval}/lib ${LDFLAGS}" | ||||
else | else | ||||
LDFLAGS="-L${withval}/lib ${LDFLAGS}" | LDFLAGS="-L${withval}/lib ${LDFLAGS}" | ||||
fi | fi | ||||
else | else | ||||
if test -n "${rpath_opt}"; then | if test -n "${rpath_opt}"; then | ||||
LDFLAGS="-L${withval} ${rpath_opt}${withval} ${LDFLAGS}" | LDFLAGS="-L${withval} ${rpath_opt}${withval} ${LDFLAGS}" | ||||
else | else | ||||
LDFLAGS="-L${withval} ${LDFLAGS}" | LDFLAGS="-L${withval} ${LDFLAGS}" | ||||
fi | fi | ||||
fi | fi | ||||
if test -d "$withval/include"; then | if test -d "$withval/include"; then | ||||
CPPFLAGS="-I${withval}/include ${CPPFLAGS}" | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" | ||||
else | else | ||||
CPPFLAGS="-I${withval} ${CPPFLAGS}" | CPPFLAGS="-I${withval} ${CPPFLAGS}" | ||||
fi | fi | ||||
fi ] | fi ] | ||||
) | ) | ||||
AC_MSG_CHECKING([for zlib]) | |||||
if test "x${zlib}" = "xno"; then | |||||
AC_MSG_RESULT([no]) | |||||
else | |||||
AC_MSG_RESULT([yes]) | |||||
AC_DEFINE([WITH_ZLIB], [1], [Enable zlib]) | |||||
AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) | ||||
AC_CHECK_LIB([z], [deflate], , | AC_CHECK_LIB([z], [deflate], , | ||||
[ | [ | ||||
saved_CPPFLAGS="$CPPFLAGS" | saved_CPPFLAGS="$CPPFLAGS" | ||||
saved_LDFLAGS="$LDFLAGS" | saved_LDFLAGS="$LDFLAGS" | ||||
save_LIBS="$LIBS" | save_LIBS="$LIBS" | ||||
dnl Check default zlib install dir | dnl Check default zlib install dir | ||||
if test -n "${rpath_opt}"; then | if test -n "${rpath_opt}"; then | ||||
LDFLAGS="-L/usr/local/lib ${rpath_opt}/usr/local/lib ${saved_LDFLAGS}" | LDFLAGS="-L/usr/local/lib ${rpath_opt}/usr/local/lib ${saved_LDFLAGS}" | ||||
else | else | ||||
LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" | LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}" | ||||
fi | fi | ||||
CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" | CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}" | ||||
LIBS="$LIBS -lz" | LIBS="$LIBS -lz" | ||||
AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], | AC_TRY_LINK_FUNC([deflate], [AC_DEFINE([HAVE_LIBZ])], | ||||
[ | [ | ||||
AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) | AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***]) | ||||
] | ] | ||||
) | ) | ||||
] | ] | ||||
) | ) | ||||
AC_ARG_WITH([zlib-version-check], | AC_ARG_WITH([zlib-version-check], | ||||
[ --without-zlib-version-check Disable zlib version check], | [ --without-zlib-version-check Disable zlib version check], | ||||
[ if test "x$withval" = "xno" ; then | [ if test "x$withval" = "xno" ; then | ||||
zlib_check_nonfatal=1 | zlib_check_nonfatal=1 | ||||
fi | fi | ||||
] | ] | ||||
) | ) | ||||
AC_MSG_CHECKING([for possibly buggy zlib]) | AC_MSG_CHECKING([for possibly buggy zlib]) | ||||
AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <zlib.h> | #include <zlib.h> | ||||
]], | ]], | ||||
[[ | [[ | ||||
int a=0, b=0, c=0, d=0, n, v; | int a=0, b=0, c=0, d=0, n, v; | ||||
n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); | n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); | ||||
if (n != 3 && n != 4) | if (n != 3 && n != 4) | ||||
Show All 21 Lines | |||||
"./configure --without-zlib-version-check". | "./configure --without-zlib-version-check". | ||||
If you are in doubt, upgrade zlib to version 1.2.3 or greater. | If you are in doubt, upgrade zlib to version 1.2.3 or greater. | ||||
See http://www.gzip.org/zlib/ for details.]) | See http://www.gzip.org/zlib/ for details.]) | ||||
else | else | ||||
AC_MSG_WARN([zlib version may have security problems]) | AC_MSG_WARN([zlib version may have security problems]) | ||||
fi | fi | ||||
], | ], | ||||
[ AC_MSG_WARN([cross compiling: not checking zlib version]) ] | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] | ||||
) | ) | ||||
fi | |||||
dnl UnixWare 2.x | dnl UnixWare 2.x | ||||
AC_CHECK_FUNC([strcasecmp], | AC_CHECK_FUNC([strcasecmp], | ||||
[], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] | [], [ AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"]) ] | ||||
) | ) | ||||
AC_CHECK_FUNCS([utimes], | AC_CHECK_FUNCS([utimes], | ||||
[], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) | [], [ AC_CHECK_LIB([c89], [utimes], [AC_DEFINE([HAVE_UTIMES]) | ||||
LIBS="$LIBS -lc89"]) ] | LIBS="$LIBS -lc89"]) ] | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
AC_CHECK_DECL([VIS_ALL], , | AC_CHECK_DECL([VIS_ALL], , | ||||
AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) | AC_DEFINE(BROKEN_STRNVIS, 1, [missing VIS_ALL]), [#include <vis.h>]) | ||||
AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) | AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <dirent.h>]], | #include <dirent.h> | ||||
#include <stdlib.h> | |||||
]], | |||||
[[ | [[ | ||||
struct dirent d; | struct dirent d; | ||||
exit(sizeof(d.d_name)<=sizeof(char)); | exit(sizeof(d.d_name)<=sizeof(char)); | ||||
]])], | ]])], | ||||
[AC_MSG_RESULT([yes])], | [AC_MSG_RESULT([yes])], | ||||
[ | [ | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], | AC_DEFINE([BROKEN_ONE_BYTE_DIRENT_D_NAME], [1], | ||||
Show All 18 Lines | |||||
LDNS_MSG="no" | LDNS_MSG="no" | ||||
AC_ARG_WITH(ldns, | AC_ARG_WITH(ldns, | ||||
[ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], | [ --with-ldns[[=PATH]] Use ldns for DNSSEC support (optionally in PATH)], | ||||
[ | [ | ||||
ldns="" | ldns="" | ||||
if test "x$withval" = "xyes" ; then | if test "x$withval" = "xyes" ; then | ||||
AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) | ||||
if test "x$LDNSCONFIG" = "xno"; then | if test "x$LDNSCONFIG" = "xno"; then | ||||
CPPFLAGS="$CPPFLAGS -I${withval}/include" | |||||
LDFLAGS="$LDFLAGS -L${withval}/lib" | |||||
LIBS="-lldns $LIBS" | LIBS="-lldns $LIBS" | ||||
ldns=yes | ldns=yes | ||||
else | else | ||||
LIBS="$LIBS `$LDNSCONFIG --libs`" | LIBS="$LIBS `$LDNSCONFIG --libs`" | ||||
CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" | CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`" | ||||
ldns=yes | ldns=yes | ||||
fi | fi | ||||
elif test "x$withval" != "xno" ; then | elif test "x$withval" != "xno" ; then | ||||
CPPFLAGS="$CPPFLAGS -I${withval}/include" | CPPFLAGS="$CPPFLAGS -I${withval}/include" | ||||
LDFLAGS="$LDFLAGS -L${withval}/lib" | LDFLAGS="$LDFLAGS -L${withval}/lib" | ||||
LIBS="-lldns $LIBS" | LIBS="-lldns $LIBS" | ||||
ldns=yes | ldns=yes | ||||
fi | fi | ||||
# Verify that it works. | # Verify that it works. | ||||
if test "x$ldns" = "xyes" ; then | if test "x$ldns" = "xyes" ; then | ||||
AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) | AC_DEFINE(HAVE_LDNS, 1, [Define if you want ldns support]) | ||||
LDNS_MSG="yes" | LDNS_MSG="yes" | ||||
AC_MSG_CHECKING([for ldns support]) | AC_MSG_CHECKING([for ldns support]) | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_SOURCE([[ | [AC_LANG_SOURCE([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#ifdef HAVE_STDINT_H | |||||
#include <stdint.h> | # include <stdint.h> | ||||
#endif | |||||
#include <ldns/ldns.h> | #include <ldns/ldns.h> | ||||
int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } | int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } | ||||
]]) | ]]) | ||||
], | ], | ||||
[AC_MSG_RESULT(yes)], | [AC_MSG_RESULT(yes)], | ||||
[ | [ | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) | AC_MSG_ERROR([** Incomplete or missing ldns libraries.]) | ||||
Show All 37 Lines | AC_CHECK_LIB([edit], [el_init], | ||||
LIBEDIT_MSG="yes" | LIBEDIT_MSG="yes" | ||||
AC_SUBST([LIBEDIT]) | AC_SUBST([LIBEDIT]) | ||||
], | ], | ||||
[ AC_MSG_ERROR([libedit not found]) ], | [ AC_MSG_ERROR([libedit not found]) ], | ||||
[ $OTHERLIBS ] | [ $OTHERLIBS ] | ||||
) | ) | ||||
AC_MSG_CHECKING([if libedit version is compatible]) | AC_MSG_CHECKING([if libedit version is compatible]) | ||||
AC_COMPILE_IFELSE( | AC_COMPILE_IFELSE( | ||||
[AC_LANG_PROGRAM([[ #include <histedit.h> ]], | [AC_LANG_PROGRAM([[ | ||||
#include <histedit.h> | |||||
#include <stdlib.h> | |||||
]], | |||||
[[ | [[ | ||||
int i = H_SETSIZE; | int i = H_SETSIZE; | ||||
el_init("", NULL, NULL, NULL); | el_init("", NULL, NULL, NULL); | ||||
exit(0); | exit(0); | ||||
]])], | ]])], | ||||
[ AC_MSG_RESULT([yes]) ], | [ AC_MSG_RESULT([yes]) ], | ||||
[ AC_MSG_RESULT([no]) | [ AC_MSG_RESULT([no]) | ||||
AC_MSG_ERROR([libedit version is not compatible]) ] | AC_MSG_ERROR([libedit version is not compatible]) ] | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
else | else | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
CFLAGS="$SAVED_CFLAGS" | CFLAGS="$SAVED_CFLAGS" | ||||
LDFLAGS="$SAVED_LDFLAGS" | LDFLAGS="$SAVED_LDFLAGS" | ||||
fi | fi | ||||
fi | fi | ||||
AC_MSG_CHECKING([whether -fPIC is accepted]) | |||||
SAVED_CFLAGS="$CFLAGS" | |||||
CFLAGS="$CFLAGS -fPIC" | |||||
AC_COMPILE_IFELSE( | |||||
[AC_LANG_PROGRAM( [[ #include <stdlib.h> ]], [[ exit(0); ]] )], | |||||
[AC_MSG_RESULT([yes]) | |||||
PICFLAG="-fPIC"; ], | |||||
[AC_MSG_RESULT([no]) | |||||
PICFLAG=""; ]) | |||||
CFLAGS="$SAVED_CFLAGS" | |||||
AC_SUBST([PICFLAG]) | |||||
dnl Checks for library functions. Please keep in alphabetical order | dnl Checks for library functions. Please keep in alphabetical order | ||||
AC_CHECK_FUNCS([ \ | AC_CHECK_FUNCS([ \ | ||||
Blowfish_initstate \ | Blowfish_initstate \ | ||||
Blowfish_expandstate \ | Blowfish_expandstate \ | ||||
Blowfish_expand0state \ | Blowfish_expand0state \ | ||||
Blowfish_stream2word \ | Blowfish_stream2word \ | ||||
SHA256Update \ | |||||
SHA384Update \ | |||||
SHA512Update \ | |||||
asprintf \ | asprintf \ | ||||
b64_ntop \ | b64_ntop \ | ||||
__b64_ntop \ | __b64_ntop \ | ||||
b64_pton \ | b64_pton \ | ||||
__b64_pton \ | __b64_pton \ | ||||
bcopy \ | bcopy \ | ||||
bcrypt_pbkdf \ | bcrypt_pbkdf \ | ||||
bindresvport_sa \ | bindresvport_sa \ | ||||
blf_enc \ | blf_enc \ | ||||
bzero \ | bzero \ | ||||
cap_rights_limit \ | cap_rights_limit \ | ||||
clock \ | clock \ | ||||
closefrom \ | closefrom \ | ||||
dirfd \ | dirfd \ | ||||
endgrent \ | endgrent \ | ||||
err \ | err \ | ||||
errx \ | errx \ | ||||
explicit_bzero \ | explicit_bzero \ | ||||
fchmod \ | fchmod \ | ||||
fchmodat \ | fchmodat \ | ||||
fchown \ | fchown \ | ||||
fchownat \ | fchownat \ | ||||
flock \ | flock \ | ||||
fnmatch \ | |||||
freeaddrinfo \ | freeaddrinfo \ | ||||
freezero \ | freezero \ | ||||
fstatfs \ | fstatfs \ | ||||
fstatvfs \ | fstatvfs \ | ||||
futimes \ | futimes \ | ||||
getaddrinfo \ | getaddrinfo \ | ||||
getcwd \ | getcwd \ | ||||
getgrouplist \ | getgrouplist \ | ||||
Show All 11 Lines | AC_CHECK_FUNCS([ \ | ||||
getttyent \ | getttyent \ | ||||
glob \ | glob \ | ||||
group_from_gid \ | group_from_gid \ | ||||
inet_aton \ | inet_aton \ | ||||
inet_ntoa \ | inet_ntoa \ | ||||
inet_ntop \ | inet_ntop \ | ||||
innetgr \ | innetgr \ | ||||
llabs \ | llabs \ | ||||
localtime_r \ | |||||
login_getcapbool \ | login_getcapbool \ | ||||
md5_crypt \ | md5_crypt \ | ||||
memmem \ | |||||
memmove \ | memmove \ | ||||
memset_s \ | memset_s \ | ||||
mkdtemp \ | mkdtemp \ | ||||
ngetaddrinfo \ | ngetaddrinfo \ | ||||
nsleep \ | nsleep \ | ||||
ogetaddrinfo \ | ogetaddrinfo \ | ||||
openlog_r \ | openlog_r \ | ||||
pledge \ | pledge \ | ||||
poll \ | poll \ | ||||
prctl \ | prctl \ | ||||
pstat \ | pstat \ | ||||
raise \ | raise \ | ||||
readpassphrase \ | readpassphrase \ | ||||
reallocarray \ | reallocarray \ | ||||
realpath \ | |||||
recvmsg \ | recvmsg \ | ||||
recallocarray \ | recallocarray \ | ||||
rresvport_af \ | rresvport_af \ | ||||
sendmsg \ | sendmsg \ | ||||
setdtablesize \ | setdtablesize \ | ||||
setegid \ | setegid \ | ||||
setenv \ | setenv \ | ||||
seteuid \ | seteuid \ | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | AC_CHECK_FUNCS([ \ | ||||
user_from_uid \ | user_from_uid \ | ||||
usleep \ | usleep \ | ||||
vasprintf \ | vasprintf \ | ||||
vsnprintf \ | vsnprintf \ | ||||
waitpid \ | waitpid \ | ||||
warn \ | warn \ | ||||
]) | ]) | ||||
AC_CHECK_DECLS([bzero]) | AC_CHECK_DECLS([bzero, memmem]) | ||||
dnl Wide character support. | dnl Wide character support. | ||||
AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) | ||||
TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} | TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes} | ||||
AC_MSG_CHECKING([for utf8 locale support]) | AC_MSG_CHECKING([for utf8 locale support]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
Show All 23 Lines | AC_ARG_ENABLE([pkcs11], | ||||
[ --disable-pkcs11 disable PKCS#11 support code [no]], | [ --disable-pkcs11 disable PKCS#11 support code [no]], | ||||
[ | [ | ||||
if test "x$enableval" = "xno" ; then | if test "x$enableval" = "xno" ; then | ||||
disable_pkcs11=1 | disable_pkcs11=1 | ||||
fi | fi | ||||
] | ] | ||||
) | ) | ||||
# PKCS11 depends on OpenSSL. | disable_sk= | ||||
if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then | AC_ARG_ENABLE([security-key], | ||||
# PKCS#11 support requires dlopen() and co | [ --disable-security-key disable U2F/FIDO support code [no]], | ||||
AC_SEARCH_LIBS([dlopen], [dl], | [ | ||||
AC_CHECK_DECL([RTLD_NOW], | if test "x$enableval" = "xno" ; then | ||||
AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]), | disable_sk=1 | ||||
[], [#include <dlfcn.h>] | fi | ||||
] | |||||
) | ) | ||||
) | enable_sk_internal= | ||||
AC_ARG_WITH([security-key-builtin], | |||||
[ --with-security-key-builtin include builtin U2F/FIDO support], | |||||
[ | |||||
if test "x$withval" != "xno" ; then | |||||
enable_sk_internal=yes | |||||
fi | fi | ||||
] | |||||
) | |||||
test "x$disable_sk" != "x" && enable_sk_internal="" | |||||
AC_SEARCH_LIBS([dlopen], [dl]) | |||||
AC_CHECK_FUNCS([dlopen]) | |||||
AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>]) | |||||
# IRIX has a const char return value for gai_strerror() | # IRIX has a const char return value for gai_strerror() | ||||
AC_CHECK_FUNCS([gai_strerror], [ | AC_CHECK_FUNCS([gai_strerror], [ | ||||
AC_DEFINE([HAVE_GAI_STRERROR]) | AC_DEFINE([HAVE_GAI_STRERROR]) | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <netdb.h> | #include <netdb.h> | ||||
const char *gai_strerror(int); | const char *gai_strerror(int); | ||||
]], [[ | ]], [[ | ||||
char *str; | char *str; | ||||
str = gai_strerror(0); | str = gai_strerror(0); | ||||
]])], [ | ]])], [ | ||||
AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], | AC_DEFINE([HAVE_CONST_GAI_STRERROR_PROTO], [1], | ||||
[Define if gai_strerror() returns const char *])], [])]) | [Define if gai_strerror() returns const char *])], [])]) | ||||
AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], | AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], | ||||
[Some systems put nanosleep outside of libc])]) | [Some systems put nanosleep outside of libc])]) | ||||
AC_SEARCH_LIBS([clock_gettime], [rt], | AC_SEARCH_LIBS([clock_gettime], [rt], | ||||
[AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) | [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) | ||||
dnl check if we need -D_REENTRANT for localtime_r declaration. | |||||
AC_CHECK_DECL([localtime_r], [], | |||||
[ saved_CPPFLAGS="$CFLAGS" | |||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT" | |||||
unset ac_cv_have_decl_localtime_r | |||||
AC_CHECK_DECL([localtime_r], [], | |||||
[ CPPFLAGS="$saved_CPPFLAGS" ], | |||||
[ #include <time.h> ] | |||||
) | |||||
], | |||||
[ #include <time.h> ] | |||||
) | |||||
dnl Make sure prototypes are defined for these before using them. | dnl Make sure prototypes are defined for these before using them. | ||||
AC_CHECK_DECL([strsep], | AC_CHECK_DECL([strsep], | ||||
[AC_CHECK_FUNCS([strsep])], | [AC_CHECK_FUNCS([strsep])], | ||||
[], | [], | ||||
[ | [ | ||||
#ifdef HAVE_STRING_H | #ifdef HAVE_STRING_H | ||||
# include <string.h> | # include <string.h> | ||||
#endif | #endif | ||||
]) | ]) | ||||
dnl tcsendbreak might be a macro | dnl tcsendbreak might be a macro | ||||
AC_CHECK_DECL([tcsendbreak], | AC_CHECK_DECL([tcsendbreak], | ||||
[AC_DEFINE([HAVE_TCSENDBREAK])], | [AC_DEFINE([HAVE_TCSENDBREAK])], | ||||
[AC_CHECK_FUNCS([tcsendbreak])], | [AC_CHECK_FUNCS([tcsendbreak])], | ||||
[#include <termios.h>] | [#include <termios.h>] | ||||
) | ) | ||||
AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) | AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) | ||||
AC_CHECK_DECLS([SHUT_RD], , , | AC_CHECK_DECLS([SHUT_RD, getpeereid], , , | ||||
[ | [ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <unistd.h> | |||||
]) | ]) | ||||
AC_CHECK_DECLS([O_NONBLOCK], , , | AC_CHECK_DECLS([O_NONBLOCK], , , | ||||
[ | [ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#ifdef HAVE_SYS_STAT_H | #ifdef HAVE_SYS_STAT_H | ||||
# include <sys/stat.h> | # include <sys/stat.h> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | else | ||||
[AC_MSG_RESULT([yes])], | [AC_MSG_RESULT([yes])], | ||||
[AC_DEFINE([BROKEN_SETRESGID], [1], | [AC_DEFINE([BROKEN_SETRESGID], [1], | ||||
[Define if your setresgid() is broken]) | [Define if your setresgid() is broken]) | ||||
AC_MSG_RESULT([not implemented])], | AC_MSG_RESULT([not implemented])], | ||||
[AC_MSG_WARN([cross compiling: not checking setresuid])] | [AC_MSG_WARN([cross compiling: not checking setresuid])] | ||||
) | ) | ||||
]) | ]) | ||||
AC_CHECK_FUNCS([realpath], [ | AC_MSG_CHECKING([for working fflush(NULL)]) | ||||
dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given | |||||
dnl path name", however some implementations of realpath (and some | |||||
dnl versions of the POSIX spec) do not work on non-existent files, | |||||
dnl so we use the OpenBSD implementation on those platforms. | |||||
AC_MSG_CHECKING([if realpath works with non-existent files]) | |||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <limits.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <errno.h> | ]], | ||||
]], [[ | [[fflush(NULL); exit(0);]])], | ||||
char buf[PATH_MAX]; | |||||
if (realpath("/opensshnonexistentfilename1234", buf) == NULL) | |||||
if (errno == ENOENT) | |||||
exit(1); | |||||
exit(0); | |||||
]])], | |||||
[AC_MSG_RESULT([yes])], | |||||
[AC_DEFINE([BROKEN_REALPATH], [1], | |||||
[realpath does not work with nonexistent files]) | |||||
AC_MSG_RESULT([no])], | |||||
[AC_MSG_WARN([cross compiling: assuming working])] | |||||
) | |||||
]) | |||||
AC_MSG_CHECKING([for working fflush(NULL)]) | |||||
AC_RUN_IFELSE( | |||||
[AC_LANG_PROGRAM([[#include <stdio.h>]], [[fflush(NULL); exit(0);]])], | |||||
AC_MSG_RESULT([yes]), | AC_MSG_RESULT([yes]), | ||||
[AC_MSG_RESULT([no]) | [AC_MSG_RESULT([no]) | ||||
AC_DEFINE([FFLUSH_NULL_BUG], [1], | AC_DEFINE([FFLUSH_NULL_BUG], [1], | ||||
[define if fflush(NULL) does not work])], | [define if fflush(NULL) does not work])], | ||||
AC_MSG_WARN([cross compiling: assuming working]) | AC_MSG_WARN([cross compiling: assuming working]) | ||||
) | ) | ||||
dnl Checks for time functions | dnl Checks for time functions | ||||
Show All 19 Lines | AC_CHECK_FUNC([getpagesize], | ||||
[AC_CHECK_LIB([ucb], [getpagesize], | [AC_CHECK_LIB([ucb], [getpagesize], | ||||
[LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] | [LIBS="$LIBS -lucb"; AC_DEFINE([HAVE_GETPAGESIZE])])] | ||||
) | ) | ||||
# Check for broken snprintf | # Check for broken snprintf | ||||
if test "x$ac_cv_func_snprintf" = "xyes" ; then | if test "x$ac_cv_func_snprintf" = "xyes" ; then | ||||
AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ #include <stdio.h> ]], | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
]], | |||||
[[ | [[ | ||||
char b[5]; | char b[5]; | ||||
snprintf(b,5,"123456789"); | snprintf(b,5,"123456789"); | ||||
exit(b[4]!='\0'); | exit(b[4]!='\0'); | ||||
]])], | ]])], | ||||
[AC_MSG_RESULT([yes])], | [AC_MSG_RESULT([yes])], | ||||
[ | [ | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
AC_DEFINE([BROKEN_SNPRINTF], [1], | AC_DEFINE([BROKEN_SNPRINTF], [1], | ||||
[Define if your snprintf is busted]) | [Define if your snprintf is busted]) | ||||
AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) | ||||
], | ], | ||||
[ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] | [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ] | ||||
) | ) | ||||
fi | fi | ||||
if test "x$ac_cv_func_snprintf" = "xyes" ; then | if test "x$ac_cv_func_snprintf" = "xyes" ; then | ||||
AC_MSG_CHECKING([whether snprintf understands %zu]) | AC_MSG_CHECKING([whether snprintf understands %zu]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <string.h> | |||||
]], | ]], | ||||
[[ | [[ | ||||
size_t a = 1, b = 2; | size_t a = 1, b = 2; | ||||
char z[128]; | char z[128]; | ||||
snprintf(z, sizeof z, "%zu%zu", a, b); | snprintf(z, sizeof z, "%zu%zu", a, b); | ||||
exit(strcmp(z, "12")); | exit(strcmp(z, "12")); | ||||
]])], | ]])], | ||||
[AC_MSG_RESULT([yes])], | [AC_MSG_RESULT([yes])], | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
fi | fi | ||||
dnl see whether mkstemp() requires XXXXXX | dnl see whether mkstemp() requires XXXXXX | ||||
if test "x$ac_cv_func_mkdtemp" = "xyes" ; then | if test "x$ac_cv_func_mkdtemp" = "xyes" ; then | ||||
AC_MSG_CHECKING([for (overly) strict mkstemp]) | AC_MSG_CHECKING([for (overly) strict mkstemp]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <unistd.h> | |||||
]], [[ | ]], [[ | ||||
char template[]="conftest.mkstemp-test"; | char template[]="conftest.mkstemp-test"; | ||||
if (mkstemp(template) == -1) | if (mkstemp(template) == -1) | ||||
exit(1); | exit(1); | ||||
unlink(template); | unlink(template); | ||||
exit(0); | exit(0); | ||||
]])], | ]])], | ||||
[ | [ | ||||
Show All 11 Lines | |||||
fi | fi | ||||
dnl make sure that openpty does not reacquire controlling terminal | dnl make sure that openpty does not reacquire controlling terminal | ||||
if test ! -z "$check_for_openpty_ctty_bug"; then | if test ! -z "$check_for_openpty_ctty_bug"; then | ||||
AC_MSG_CHECKING([if openpty correctly handles controlling tty]) | AC_MSG_CHECKING([if openpty correctly handles controlling tty]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <unistd.h> | |||||
#include <sys/fcntl.h> | #include <sys/fcntl.h> | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/wait.h> | #include <sys/wait.h> | ||||
]], [[ | ]], [[ | ||||
pid_t pid; | pid_t pid; | ||||
int fd, ptyfd, ttyfd, status; | int fd, ptyfd, ttyfd, status; | ||||
pid = fork(); | pid = fork(); | ||||
Show All 30 Lines | |||||
fi | fi | ||||
if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ | ||||
test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then | test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then | ||||
AC_MSG_CHECKING([if getaddrinfo seems to work]) | AC_MSG_CHECKING([if getaddrinfo seems to work]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <netdb.h> | #include <netdb.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#define TEST_PORT "2222" | #define TEST_PORT "2222" | ||||
]], [[ | ]], [[ | ||||
int err, sock; | int err, sock; | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
fi | fi | ||||
if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ | if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ | ||||
test "x$check_for_aix_broken_getaddrinfo" = "x1"; then | test "x$check_for_aix_broken_getaddrinfo" = "x1"; then | ||||
AC_MSG_CHECKING([if getaddrinfo seems to work]) | AC_MSG_CHECKING([if getaddrinfo seems to work]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <netdb.h> | #include <netdb.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#define TEST_PORT "2222" | #define TEST_PORT "2222" | ||||
]], [[ | ]], [[ | ||||
int err, sock; | int err, sock; | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if test "x$ac_cv_func_getaddrinfo" = "xyes"; then | ||||
AC_CHECK_DECLS(AI_NUMERICSERV, , , | AC_CHECK_DECLS(AI_NUMERICSERV, , , | ||||
[#include <sys/types.h> | [#include <sys/types.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <netdb.h>]) | #include <netdb.h>]) | ||||
fi | fi | ||||
if test "x$check_for_conflicting_getspnam" = "x1"; then | if test "x$check_for_conflicting_getspnam" = "x1"; then | ||||
AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) | AC_MSG_CHECKING([for conflicting getspnam in shadow.h]) | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]], | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <shadow.h> | |||||
#include <stdlib.h> | |||||
]], | |||||
[[ exit(0); ]])], | [[ exit(0); ]])], | ||||
[ | [ | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
], | ], | ||||
[ | [ | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], | AC_DEFINE([GETSPNAM_CONFLICTING_DEFS], [1], | ||||
[Conflicting defs for getspnam]) | [Conflicting defs for getspnam]) | ||||
Show All 13 Lines | |||||
dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); | dnl NetBSD: 2012, strnvis(char *dst, size_t dlen, const char *src, int flag); | ||||
if test "x$ac_cv_func_strnvis" = "xyes"; then | if test "x$ac_cv_func_strnvis" = "xyes"; then | ||||
AC_MSG_CHECKING([for working strnvis]) | AC_MSG_CHECKING([for working strnvis]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <signal.h> | #include <signal.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | |||||
#include <vis.h> | #include <vis.h> | ||||
static void sighandler(int sig) { _exit(1); } | static void sighandler(int sig) { _exit(1); } | ||||
]], [[ | ]], [[ | ||||
char dst[16]; | char dst[16]; | ||||
signal(SIGSEGV, sighandler); | signal(SIGSEGV, sighandler); | ||||
if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) | if (strnvis(dst, "src", 4, 0) && strcmp(dst, "src") == 0) | ||||
exit(0); | exit(0); | ||||
exit(1) | exit(1) | ||||
]])], | ]])], | ||||
[AC_MSG_RESULT([yes])], | [AC_MSG_RESULT([yes])], | ||||
[AC_MSG_RESULT([no]) | [AC_MSG_RESULT([no]) | ||||
AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis detected broken])], | ||||
[AC_MSG_WARN([cross compiling: assuming broken]) | [AC_MSG_WARN([cross compiling: assuming broken]) | ||||
AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] | AC_DEFINE([BROKEN_STRNVIS], [1], [strnvis assumed broken])] | ||||
) | ) | ||||
fi | fi | ||||
AC_MSG_CHECKING([if SA_RESTARTed signals interrupt select()]) | |||||
AC_RUN_IFELSE( | |||||
[AC_LANG_PROGRAM([[ | |||||
#ifdef HAVE_SYS_SELECT | |||||
# include <sys/select.h> | |||||
#endif | |||||
#include <sys/types.h> | |||||
#include <sys/time.h> | |||||
#include <stdlib.h> | |||||
#include <signal.h> | |||||
#include <unistd.h> | |||||
static void sighandler(int sig) { } | |||||
]], [[ | |||||
int r; | |||||
pid_t pid; | |||||
struct sigaction sa; | |||||
sa.sa_handler = sighandler; | |||||
sa.sa_flags = SA_RESTART; | |||||
(void)sigaction(SIGTERM, &sa, NULL); | |||||
if ((pid = fork()) == 0) { /* child */ | |||||
pid = getppid(); | |||||
sleep(1); | |||||
kill(pid, SIGTERM); | |||||
sleep(1); | |||||
if (getppid() == pid) /* if parent did not exit, shoot it */ | |||||
kill(pid, SIGKILL); | |||||
exit(0); | |||||
} else { /* parent */ | |||||
r = select(0, NULL, NULL, NULL, NULL); | |||||
} | |||||
exit(r == -1 ? 0 : 1); | |||||
]])], | |||||
[AC_MSG_RESULT([yes])], | |||||
[AC_MSG_RESULT([no]) | |||||
AC_DEFINE([NO_SA_RESTART], [1], | |||||
[SA_RESTARTed signals do no interrupt select])], | |||||
[AC_MSG_WARN([cross compiling: assuming yes])] | |||||
) | |||||
AC_CHECK_FUNCS([getpgrp],[ | AC_CHECK_FUNCS([getpgrp],[ | ||||
AC_MSG_CHECKING([if getpgrp accepts zero args]) | AC_MSG_CHECKING([if getpgrp accepts zero args]) | ||||
AC_COMPILE_IFELSE( | AC_COMPILE_IFELSE( | ||||
[AC_LANG_PROGRAM([[$ac_includes_default]], [[ getpgrp(); ]])], | [AC_LANG_PROGRAM([[$ac_includes_default]], [[ getpgrp(); ]])], | ||||
[ AC_MSG_RESULT([yes]) | [ AC_MSG_RESULT([yes]) | ||||
AC_DEFINE([GETPGRP_VOID], [1], [getpgrp takes zero args])], | AC_DEFINE([GETPGRP_VOID], [1], [getpgrp takes zero args])], | ||||
[ AC_MSG_RESULT([no]) | [ AC_MSG_RESULT([no]) | ||||
AC_DEFINE([GETPGRP_VOID], [0], [getpgrp takes one arg])] | AC_DEFINE([GETPGRP_VOID], [0], [getpgrp takes one arg])] | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | if test "x$openssl" = "xyes" ; then | ||||
# Determining OpenSSL library version is version dependent. | # Determining OpenSSL library version is version dependent. | ||||
AC_CHECK_FUNCS([OpenSSL_version OpenSSL_version_num]) | AC_CHECK_FUNCS([OpenSSL_version OpenSSL_version_num]) | ||||
# Determine OpenSSL library version | # Determine OpenSSL library version | ||||
AC_MSG_CHECKING([OpenSSL library version]) | AC_MSG_CHECKING([OpenSSL library version]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/opensslv.h> | #include <openssl/opensslv.h> | ||||
#include <openssl/crypto.h> | #include <openssl/crypto.h> | ||||
#define DATA "conftest.ssllibver" | #define DATA "conftest.ssllibver" | ||||
]], [[ | ]], [[ | ||||
FILE *fd; | FILE *fd; | ||||
int rc; | int rc; | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | [ | ||||
AC_MSG_WARN([cross compiling: not checking]) | AC_MSG_WARN([cross compiling: not checking]) | ||||
] | ] | ||||
) | ) | ||||
# Sanity check OpenSSL headers | # Sanity check OpenSSL headers | ||||
AC_MSG_CHECKING([whether OpenSSL's headers match the library]) | AC_MSG_CHECKING([whether OpenSSL's headers match the library]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/opensslv.h> | #include <openssl/opensslv.h> | ||||
#include <openssl/crypto.h> | #include <openssl/crypto.h> | ||||
]], [[ | ]], [[ | ||||
#ifndef HAVE_OPENSSL_VERSION_NUM | #ifndef HAVE_OPENSSL_VERSION_NUM | ||||
# define OpenSSL_version_num SSLeay | # define OpenSSL_version_num SSLeay | ||||
#endif | #endif | ||||
exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1); | exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1); | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | AC_CHECK_FUNCS([ \ | ||||
RSA_meth_set1_name \ | RSA_meth_set1_name \ | ||||
RSA_meth_get_finish \ | RSA_meth_get_finish \ | ||||
RSA_meth_set_priv_enc \ | RSA_meth_set_priv_enc \ | ||||
RSA_meth_set_priv_dec \ | RSA_meth_set_priv_dec \ | ||||
RSA_meth_set_finish \ | RSA_meth_set_finish \ | ||||
EVP_PKEY_get0_RSA \ | EVP_PKEY_get0_RSA \ | ||||
EVP_MD_CTX_new \ | EVP_MD_CTX_new \ | ||||
EVP_MD_CTX_free \ | EVP_MD_CTX_free \ | ||||
EVP_chacha20 \ | |||||
]) | ]) | ||||
if test "x$openssl_engine" = "xyes" ; then | if test "x$openssl_engine" = "xyes" ; then | ||||
AC_MSG_CHECKING([for OpenSSL ENGINE support]) | AC_MSG_CHECKING([for OpenSSL ENGINE support]) | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <openssl/engine.h> | #include <openssl/engine.h> | ||||
]], [[ | ]], [[ | ||||
ENGINE_load_builtin_engines(); | ENGINE_load_builtin_engines(); | ||||
ENGINE_register_all_complete(); | ENGINE_register_all_complete(); | ||||
]])], | ]])], | ||||
[ AC_MSG_RESULT([yes]) | [ AC_MSG_RESULT([yes]) | ||||
AC_DEFINE([USE_OPENSSL_ENGINE], [1], | AC_DEFINE([USE_OPENSSL_ENGINE], [1], | ||||
[Enable OpenSSL engine support]) | [Enable OpenSSL engine support]) | ||||
], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) | ], [ AC_MSG_ERROR([OpenSSL ENGINE support not found]) | ||||
]) | ]) | ||||
fi | fi | ||||
# Check for OpenSSL without EVP_aes_{192,256}_cbc | # Check for OpenSSL without EVP_aes_{192,256}_cbc | ||||
AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) | AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
]], [[ | ]], [[ | ||||
exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); | exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL); | ||||
]])], | ]])], | ||||
[ | [ | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
], | ], | ||||
[ | [ | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], | AC_DEFINE([OPENSSL_LOBOTOMISED_AES], [1], | ||||
[libcrypto is missing AES 192 and 256 bit functions]) | [libcrypto is missing AES 192 and 256 bit functions]) | ||||
] | ] | ||||
) | ) | ||||
# Check for OpenSSL with EVP_aes_*ctr | # Check for OpenSSL with EVP_aes_*ctr | ||||
AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) | AC_MSG_CHECKING([whether OpenSSL has AES CTR via EVP]) | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
]], [[ | ]], [[ | ||||
exit(EVP_aes_128_ctr() == NULL || | exit(EVP_aes_128_ctr() == NULL || | ||||
EVP_aes_192_cbc() == NULL || | EVP_aes_192_cbc() == NULL || | ||||
EVP_aes_256_cbc() == NULL); | EVP_aes_256_cbc() == NULL); | ||||
]])], | ]])], | ||||
[ | [ | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], | AC_DEFINE([OPENSSL_HAVE_EVPCTR], [1], | ||||
[libcrypto has EVP AES CTR]) | [libcrypto has EVP AES CTR]) | ||||
], | ], | ||||
[ | [ | ||||
AC_MSG_RESULT([no]) | AC_MSG_RESULT([no]) | ||||
] | ] | ||||
) | ) | ||||
# Check for OpenSSL with EVP_aes_*gcm | # Check for OpenSSL with EVP_aes_*gcm | ||||
AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) | AC_MSG_CHECKING([whether OpenSSL has AES GCM via EVP]) | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
]], [[ | ]], [[ | ||||
exit(EVP_aes_128_gcm() == NULL || | exit(EVP_aes_128_gcm() == NULL || | ||||
EVP_aes_256_gcm() == NULL || | EVP_aes_256_gcm() == NULL || | ||||
EVP_CTRL_GCM_SET_IV_FIXED == 0 || | EVP_CTRL_GCM_SET_IV_FIXED == 0 || | ||||
EVP_CTRL_GCM_IV_GEN == 0 || | EVP_CTRL_GCM_IV_GEN == 0 || | ||||
EVP_CTRL_GCM_SET_TAG == 0 || | EVP_CTRL_GCM_SET_TAG == 0 || | ||||
Show All 11 Lines | [ | ||||
aes128-gcm@openssh.com \ | aes128-gcm@openssh.com \ | ||||
aes256-gcm@openssh.com" | aes256-gcm@openssh.com" | ||||
] | ] | ||||
) | ) | ||||
AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) | AC_MSG_CHECKING([if EVP_DigestUpdate returns an int]) | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
]], [[ | ]], [[ | ||||
if(EVP_DigestUpdate(NULL, NULL,0)) | if(EVP_DigestUpdate(NULL, NULL,0)) | ||||
exit(0); | exit(0); | ||||
]])], | ]])], | ||||
[ | [ | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
Show All 13 Lines | #endif | ||||
# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the | # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the | ||||
# version in OpenSSL. | # version in OpenSSL. | ||||
if test "x$check_for_libcrypt_later" = "x1"; then | if test "x$check_for_libcrypt_later" = "x1"; then | ||||
AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) | ||||
fi | fi | ||||
AC_CHECK_FUNCS([crypt DES_crypt]) | AC_CHECK_FUNCS([crypt DES_crypt]) | ||||
# Search for SHA256 support in libc and/or OpenSSL | # Check for SHA256, SHA384 and SHA512 support in OpenSSL | ||||
AC_CHECK_FUNCS([SHA256_Update EVP_sha256], , | AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512]) | ||||
[unsupported_algorithms="$unsupported_algorithms \ | |||||
hmac-sha2-256 \ | |||||
hmac-sha2-512 \ | |||||
diffie-hellman-group-exchange-sha256 \ | |||||
hmac-sha2-256-etm@openssh.com \ | |||||
hmac-sha2-512-etm@openssh.com" | |||||
] | |||||
) | |||||
# Search for RIPE-MD support in OpenSSL | |||||
AC_CHECK_FUNCS([EVP_ripemd160], , | |||||
[unsupported_algorithms="$unsupported_algorithms \ | |||||
hmac-ripemd160 \ | |||||
hmac-ripemd160@openssh.com \ | |||||
hmac-ripemd160-etm@openssh.com" | |||||
] | |||||
) | |||||
# Check complete ECC support in OpenSSL | # Check complete ECC support in OpenSSL | ||||
AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <openssl/ec.h> | #include <openssl/ec.h> | ||||
#include <openssl/ecdh.h> | #include <openssl/ecdh.h> | ||||
#include <openssl/ecdsa.h> | #include <openssl/ecdsa.h> | ||||
Show All 39 Lines | #include <openssl/opensslv.h> | ||||
]], [[ | ]], [[ | ||||
EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); | ||||
const EVP_MD *m = EVP_sha512(); /* We need this too */ | const EVP_MD *m = EVP_sha512(); /* We need this too */ | ||||
]])], | ]])], | ||||
[ AC_MSG_RESULT([yes]) | [ AC_MSG_RESULT([yes]) | ||||
AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) | AC_MSG_CHECKING([if OpenSSL's NID_secp521r1 is functional]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <openssl/ec.h> | #include <openssl/ec.h> | ||||
#include <openssl/ecdh.h> | #include <openssl/ecdh.h> | ||||
#include <openssl/ecdsa.h> | #include <openssl/ecdsa.h> | ||||
#include <openssl/evp.h> | #include <openssl/evp.h> | ||||
#include <openssl/objects.h> | #include <openssl/objects.h> | ||||
#include <openssl/opensslv.h> | #include <openssl/opensslv.h> | ||||
]],[[ | ]],[[ | ||||
EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); | EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1); | ||||
Show All 11 Lines | #endif | ||||
COMMENT_OUT_ECC="#no ecc#" | COMMENT_OUT_ECC="#no ecc#" | ||||
TEST_SSH_ECC=no | TEST_SSH_ECC=no | ||||
if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ | if test x$enable_nistp256 = x1 || test x$enable_nistp384 = x1 || \ | ||||
test x$enable_nistp521 = x1; then | test x$enable_nistp521 = x1; then | ||||
AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) | ||||
AC_CHECK_FUNCS([EC_KEY_METHOD_new]) | AC_CHECK_FUNCS([EC_KEY_METHOD_new]) | ||||
openssl_ecc=yes | |||||
else | |||||
openssl_ecc=no | |||||
fi | fi | ||||
if test x$enable_nistp256 = x1; then | if test x$enable_nistp256 = x1; then | ||||
AC_DEFINE([OPENSSL_HAS_NISTP256], [1], | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], | ||||
[libcrypto has NID_X9_62_prime256v1]) | [libcrypto has NID_X9_62_prime256v1]) | ||||
TEST_SSH_ECC=yes | TEST_SSH_ECC=yes | ||||
COMMENT_OUT_ECC="" | COMMENT_OUT_ECC="" | ||||
else | else | ||||
unsupported_algorithms="$unsupported_algorithms \ | unsupported_algorithms="$unsupported_algorithms \ | ||||
Show All 24 Lines | #endif | ||||
AC_SUBST([TEST_SSH_ECC]) | AC_SUBST([TEST_SSH_ECC]) | ||||
AC_SUBST([COMMENT_OUT_ECC]) | AC_SUBST([COMMENT_OUT_ECC]) | ||||
else | else | ||||
AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) | AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) | ||||
AC_CHECK_FUNCS([crypt]) | AC_CHECK_FUNCS([crypt]) | ||||
fi | fi | ||||
# PKCS11/U2F depend on OpenSSL and dlopen(). | |||||
enable_pkcs11=yes | |||||
enable_sk=yes | |||||
if test "x$openssl" != "xyes" ; then | |||||
enable_pkcs11="disabled; missing libcrypto" | |||||
enable_sk="disabled; missing libcrypto" | |||||
fi | |||||
if test "x$openssl_ecc" != "xyes" ; then | |||||
enable_sk="disabled; OpenSSL has no ECC support" | |||||
fi | |||||
if test "x$ac_cv_func_dlopen" != "xyes" ; then | |||||
enable_pkcs11="disabled; missing dlopen(3)" | |||||
enable_sk="disabled; missing dlopen(3)" | |||||
fi | |||||
if test "x$ac_cv_have_decl_RTLD_NOW" != "xyes" ; then | |||||
enable_pkcs11="disabled; missing RTLD_NOW" | |||||
enable_sk="disabled; missing RTLD_NOW" | |||||
fi | |||||
if test ! -z "$disable_pkcs11" ; then | |||||
enable_pkcs11="disabled by user" | |||||
fi | |||||
if test ! -z "$disable_sk" ; then | |||||
enable_sk="disabled by user" | |||||
fi | |||||
AC_MSG_CHECKING([whether to enable PKCS11]) | |||||
if test "x$enable_pkcs11" = "xyes" ; then | |||||
AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) | |||||
fi | |||||
AC_MSG_RESULT([$enable_pkcs11]) | |||||
AC_MSG_CHECKING([whether to enable U2F]) | |||||
if test "x$enable_sk" = "xyes" ; then | |||||
AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support]) | |||||
AC_SUBST(SK_DUMMY_LIBRARY, [regress/misc/sk-dummy/sk-dummy.so]) | |||||
else | |||||
# Do not try to build sk-dummy library. | |||||
AC_SUBST(SK_DUMMY_LIBRARY, [""]) | |||||
fi | |||||
AC_MSG_RESULT([$enable_sk]) | |||||
# Now check for built-in security key support. | |||||
if test "x$enable_sk" = "xyes" -a "x$enable_sk_internal" = "xyes" ; then | |||||
AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | |||||
use_pkgconfig_for_libfido2= | |||||
if test "x$PKGCONFIG" != "xno"; then | |||||
AC_MSG_CHECKING([if $PKGCONFIG knows about libfido2]) | |||||
if "$PKGCONFIG" libfido2; then | |||||
AC_MSG_RESULT([yes]) | |||||
use_pkgconfig_for_libfido2=yes | |||||
else | |||||
AC_MSG_RESULT([no]) | |||||
fi | |||||
fi | |||||
if test "x$use_pkgconfig_for_libfido2" = "xyes"; then | |||||
LIBFIDO2=`$PKGCONFIG --libs libfido2` | |||||
CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libfido2`" | |||||
else | |||||
LIBFIDO2="-lfido2 -lcbor" | |||||
fi | |||||
OTHERLIBS=`echo $LIBFIDO2 | sed 's/-lfido2//'` | |||||
AC_CHECK_LIB([fido2], [fido_init], | |||||
[ | |||||
AC_SUBST([LIBFIDO2]) | |||||
AC_DEFINE([ENABLE_SK_INTERNAL], [], | |||||
[Enable for built-in U2F/FIDO support]) | |||||
enable_sk="built-in" | |||||
], [ AC_MSG_ERROR([no usable libfido2 found]) ], | |||||
[ $OTHERLIBS ] | |||||
) | |||||
saved_LIBS="$LIBS" | |||||
LIBS="$LIBS $LIBFIDO2" | |||||
AC_CHECK_FUNCS([ \ | AC_CHECK_FUNCS([ \ | ||||
fido_cred_prot \ | |||||
fido_cred_set_prot \ | |||||
fido_dev_get_touch_begin \ | |||||
fido_dev_get_touch_status \ | |||||
fido_dev_supports_cred_prot \ | |||||
]) | |||||
LIBS="$saved_LIBS" | |||||
AC_CHECK_HEADER([fido.h], [], | |||||
AC_MSG_ERROR([missing fido.h from libfido2])) | |||||
AC_CHECK_HEADER([fido/credman.h], [], | |||||
AC_MSG_ERROR([missing fido/credman.h from libfido2]), | |||||
[#include <fido.h>] | |||||
) | |||||
fi | |||||
AC_CHECK_FUNCS([ \ | |||||
arc4random \ | arc4random \ | ||||
arc4random_buf \ | arc4random_buf \ | ||||
arc4random_stir \ | arc4random_stir \ | ||||
arc4random_uniform \ | arc4random_uniform \ | ||||
]) | ]) | ||||
saved_LIBS="$LIBS" | saved_LIBS="$LIBS" | ||||
AC_CHECK_LIB([iaf], [ia_openinfo], [ | AC_CHECK_LIB([iaf], [ia_openinfo], [ | ||||
LIBS="$LIBS -liaf" | LIBS="$LIBS -liaf" | ||||
AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" | AC_CHECK_FUNCS([set_id], [SSHDLIBS="$SSHDLIBS -liaf" | ||||
AC_DEFINE([HAVE_LIBIAF], [1], | AC_DEFINE([HAVE_LIBIAF], [1], | ||||
[Define if system has libiaf that supports set_id]) | [Define if system has libiaf that supports set_id]) | ||||
]) | ]) | ||||
]) | ]) | ||||
LIBS="$saved_LIBS" | LIBS="$saved_LIBS" | ||||
### Configure cryptographic random number support | ### Configure cryptographic random number support | ||||
# Check whether OpenSSL seeds itself | # Check whether OpenSSL seeds itself | ||||
if test "x$openssl" = "xyes" ; then | if test "x$openssl" = "xyes" ; then | ||||
AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) | AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <openssl/rand.h> | #include <openssl/rand.h> | ||||
]], [[ | ]], [[ | ||||
exit(RAND_status() == 1 ? 0 : 1); | exit(RAND_status() == 1 ? 0 : 1); | ||||
]])], | ]])], | ||||
[ | [ | ||||
OPENSSL_SEEDS_ITSELF=yes | OPENSSL_SEEDS_ITSELF=yes | ||||
AC_MSG_RESULT([yes]) | AC_MSG_RESULT([yes]) | ||||
▲ Show 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | |||||
#ifdef HAVE_SYS_TIME_H | #ifdef HAVE_SYS_TIME_H | ||||
# include <sys/time.h> | # include <sys/time.h> | ||||
#endif | #endif | ||||
#include <sys/resource.h> | #include <sys/resource.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
]],[[ | ]],[[ | ||||
struct rlimit rl_zero; | struct rlimit rl_zero; | ||||
int fd, r; | int r; | ||||
fd_set fds; | |||||
rl_zero.rlim_cur = rl_zero.rlim_max = 0; | rl_zero.rlim_cur = rl_zero.rlim_max = 0; | ||||
r = setrlimit(RLIMIT_NOFILE, &rl_zero); | r = setrlimit(RLIMIT_NOFILE, &rl_zero); | ||||
exit (r == -1 ? 1 : 0); | exit (r == -1 ? 1 : 0); | ||||
]])], | ]])], | ||||
[AC_MSG_RESULT([yes]) | [AC_MSG_RESULT([yes]) | ||||
rlimit_nofile_zero_works=yes], | rlimit_nofile_zero_works=yes], | ||||
[AC_MSG_RESULT([no]) | [AC_MSG_RESULT([no]) | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
AC_CHECK_SIZEOF([long long int]) | AC_CHECK_SIZEOF([long long int]) | ||||
# Sanity check long long for some platforms (AIX) | # Sanity check long long for some platforms (AIX) | ||||
if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then | if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then | ||||
ac_cv_sizeof_long_long_int=0 | ac_cv_sizeof_long_long_int=0 | ||||
fi | fi | ||||
# compute LLONG_MIN and LLONG_MAX if we don't know them. | # compute LLONG_MIN and LLONG_MAX if we don't know them. | ||||
if test -z "$have_llong_max"; then | if test -z "$have_llong_max" && test -z "$have_long_long_max"; then | ||||
AC_MSG_CHECKING([for max value of long long]) | AC_MSG_CHECKING([for max value of long long]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
/* Why is this so damn hard? */ | /* Why is this so damn hard? */ | ||||
#ifdef __GNUC__ | #ifdef __GNUC__ | ||||
# undef __GNUC__ | # undef __GNUC__ | ||||
#endif | #endif | ||||
#define __USE_ISOC99 | #define __USE_ISOC99 | ||||
#include <limits.h> | #include <limits.h> | ||||
#define DATA "conftest.llminmax" | #define DATA "conftest.llminmax" | ||||
#define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) | #define my_abs(a) ((a) < 0 ? ((a) * -1) : (a)) | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | [ | ||||
AC_MSG_RESULT([not found]) | AC_MSG_RESULT([not found]) | ||||
], | ], | ||||
[ | [ | ||||
AC_MSG_WARN([cross compiling: not checking]) | AC_MSG_WARN([cross compiling: not checking]) | ||||
] | ] | ||||
) | ) | ||||
fi | fi | ||||
AC_CHECK_DECLS([UINT32_MAX], , , [[ | |||||
#ifdef HAVE_SYS_LIMITS_H | |||||
# include <sys/limits.h> | |||||
#endif | |||||
#ifdef HAVE_LIMITS_H | |||||
# include <limits.h> | |||||
#endif | |||||
#ifdef HAVE_STDINT_H | |||||
# include <stdint.h> | |||||
#endif | |||||
]]) | |||||
# More checks for data types | # More checks for data types | ||||
AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], | ||||
[[ u_int a; a = 1;]])], | [[ u_int a; a = 1;]])], | ||||
[ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" | [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" | ||||
]) | ]) | ||||
]) | ]) | ||||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_have_u_char" = "xyes" ; then | if test "x$ac_cv_have_u_char" = "xyes" ; then | ||||
AC_DEFINE([HAVE_U_CHAR], [1], [define if you have u_char data type]) | AC_DEFINE([HAVE_U_CHAR], [1], [define if you have u_char data type]) | ||||
fi | fi | ||||
AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#ifdef HAVE_STDINT_H | |||||
#include <stdint.h> | # include <stdint.h> | ||||
#endif | |||||
]) | ]) | ||||
TYPE_SOCKLEN_T | TYPE_SOCKLEN_T | ||||
AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) | AC_CHECK_TYPES([sig_atomic_t], , , [#include <signal.h>]) | ||||
AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ | AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#ifdef HAVE_SYS_BITYPES_H | #ifdef HAVE_SYS_BITYPES_H | ||||
#include <sys/bitypes.h> | #include <sys/bitypes.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_STATFS_H | #ifdef HAVE_SYS_STATFS_H | ||||
#include <sys/statfs.h> | #include <sys/statfs.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_STATVFS_H | #ifdef HAVE_SYS_STATVFS_H | ||||
#include <sys/statvfs.h> | #include <sys/statvfs.h> | ||||
#endif | #endif | ||||
]) | ]) | ||||
AC_CHECK_MEMBERS([struct statfs.f_flags], [], [], [[ | AC_CHECK_MEMBERS([struct statfs.f_files, struct statfs.f_flags], [], [], [[ | ||||
#include <sys/param.h> | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#ifdef HAVE_SYS_BITYPES_H | #ifdef HAVE_SYS_BITYPES_H | ||||
#include <sys/bitypes.h> | #include <sys/bitypes.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_STATFS_H | #ifdef HAVE_SYS_STATFS_H | ||||
#include <sys/statfs.h> | #include <sys/statfs.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_STATVFS_H | #ifdef HAVE_SYS_STATVFS_H | ||||
#include <sys/statvfs.h> | #include <sys/statvfs.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_VFS_H | #ifdef HAVE_SYS_VFS_H | ||||
#include <sys/vfs.h> | #include <sys/vfs.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_MOUNT_H | |||||
#include <sys/mount.h> | |||||
#endif | |||||
]]) | ]]) | ||||
AC_CHECK_TYPES([in_addr_t, in_port_t], , , | AC_CHECK_TYPES([in_addr_t, in_port_t], , , | ||||
[#include <sys/types.h> | [#include <sys/types.h> | ||||
#include <netinet/in.h>]) | #include <netinet/in.h>]) | ||||
AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ | ||||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | #include <netdb.h> | ||||
[ ac_cv_have_struct_addrinfo="no" | [ ac_cv_have_struct_addrinfo="no" | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then | ||||
AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], | AC_DEFINE([HAVE_STRUCT_ADDRINFO], [1], | ||||
[define if you have struct addrinfo data type]) | [define if you have struct addrinfo data type]) | ||||
fi | fi | ||||
AC_HEADER_TIME | |||||
AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], | ||||
[[ struct timeval tv; tv.tv_sec = 1;]])], | [[ struct timeval tv; tv.tv_sec = 1;]])], | ||||
[ ac_cv_have_struct_timeval="yes" ], | [ ac_cv_have_struct_timeval="yes" ], | ||||
[ ac_cv_have_struct_timeval="no" | [ ac_cv_have_struct_timeval="no" | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_have_struct_timeval" = "xyes" ; then | if test "x$ac_cv_have_struct_timeval" = "xyes" ; then | ||||
AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) | AC_DEFINE([HAVE_STRUCT_TIMEVAL], [1], [define if you have struct timeval]) | ||||
have_struct_timeval=1 | have_struct_timeval=1 | ||||
fi | fi | ||||
AC_CHECK_TYPES([struct timespec]) | AC_CACHE_CHECK([for struct timespec], ac_cv_have_struct_timespec, [ | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |||||
#ifdef TIME_WITH_SYS_TIME | |||||
# include <sys/time.h> | |||||
# include <time.h> | |||||
#else | |||||
# ifdef HAVE_SYS_TIME_H | |||||
# include <sys/time.h> | |||||
# else | |||||
# include <time.h> | |||||
# endif | |||||
#endif | |||||
]], | |||||
[[ struct timespec ts; ts.tv_sec = 1;]])], | |||||
[ ac_cv_have_struct_timespec="yes" ], | |||||
[ ac_cv_have_struct_timespec="no" | |||||
]) | |||||
]) | |||||
if test "x$ac_cv_have_struct_timespec" = "xyes" ; then | |||||
AC_DEFINE([HAVE_STRUCT_TIMESPEC], [1], [define if you have struct timespec]) | |||||
have_struct_timespec=1 | |||||
fi | |||||
# We need int64_t or else certain parts of the compile will fail. | # We need int64_t or else certain parts of the compile will fail. | ||||
if test "x$ac_cv_have_int64_t" = "xno" && \ | if test "x$ac_cv_have_int64_t" = "xno" && \ | ||||
test "x$ac_cv_sizeof_long_int" != "x8" && \ | test "x$ac_cv_sizeof_long_int" != "x8" && \ | ||||
test "x$ac_cv_sizeof_long_long_int" = "x0" ; then | test "x$ac_cv_sizeof_long_long_int" = "x0" ; then | ||||
echo "OpenSSH requires int64_t support. Contact your vendor or install" | echo "OpenSSH requires int64_t support. Contact your vendor or install" | ||||
echo "an alternative compiler (I.E., GCC) before continuing." | echo "an alternative compiler (I.E., GCC) before continuing." | ||||
echo "" | echo "" | ||||
exit 1; | exit 1; | ||||
else | else | ||||
dnl test snprintf (broken on SCO w/gcc) | dnl test snprintf (broken on SCO w/gcc) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_SOURCE([[ | [AC_LANG_SOURCE([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#ifdef HAVE_SNPRINTF | #ifdef HAVE_SNPRINTF | ||||
main() | main() | ||||
{ | { | ||||
char buf[50]; | char buf[50]; | ||||
char expected_out[50]; | char expected_out[50]; | ||||
int mazsize = 50 ; | int mazsize = 50 ; | ||||
#if (SIZEOF_LONG_INT == 8) | #if (SIZEOF_LONG_INT == 8) | ||||
Show All 28 Lines | |||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmp.h], [HAVE_ADDR_IN_UTMP]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr], [utmpx.h], [HAVE_ADDR_IN_UTMPX]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmp.h], [HAVE_ADDR_V6_IN_UTMP]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_addr_v6], [utmpx.h], [HAVE_ADDR_V6_IN_UTMPX]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX]) | OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX]) | ||||
OSSH_CHECK_HEADER_FOR_FIELD([ut_ss], [utmpx.h], [HAVE_SS_IN_UTMPX]) | |||||
AC_CHECK_MEMBERS([struct stat.st_blksize]) | AC_CHECK_MEMBERS([struct stat.st_blksize]) | ||||
AC_CHECK_MEMBERS([struct stat.st_mtim]) | AC_CHECK_MEMBERS([struct stat.st_mtim]) | ||||
AC_CHECK_MEMBERS([struct stat.st_mtime]) | AC_CHECK_MEMBERS([struct stat.st_mtime]) | ||||
AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, | AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, | ||||
struct passwd.pw_change, struct passwd.pw_expire], | struct passwd.pw_change, struct passwd.pw_expire], | ||||
[], [], [[ | [], [], [[ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
dnl make sure we're using the real structure members and not defines | dnl make sure we're using the real structure members and not defines | ||||
AC_CACHE_CHECK([for msg_accrights field in struct msghdr], | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], | ||||
ac_cv_have_accrights_in_msghdr, [ | ac_cv_have_accrights_in_msghdr, [ | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
#include <stdlib.h> | |||||
]], [[ | ]], [[ | ||||
#ifdef msg_accrights | #ifdef msg_accrights | ||||
#error "msg_accrights is a macro" | #error "msg_accrights is a macro" | ||||
exit(1); | exit(1); | ||||
#endif | #endif | ||||
struct msghdr m; | struct msghdr m; | ||||
m.msg_accrights = 0; | m.msg_accrights = 0; | ||||
exit(0); | exit(0); | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
]) | ]) | ||||
AC_CACHE_CHECK([for msg_control field in struct msghdr], | AC_CACHE_CHECK([for msg_control field in struct msghdr], | ||||
ac_cv_have_control_in_msghdr, [ | ac_cv_have_control_in_msghdr, [ | ||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
#include <stdlib.h> | |||||
]], [[ | ]], [[ | ||||
#ifdef msg_control | #ifdef msg_control | ||||
#error "msg_control is a macro" | #error "msg_control is a macro" | ||||
exit(1); | exit(1); | ||||
#endif | #endif | ||||
struct msghdr m; | struct msghdr m; | ||||
m.msg_control = 0; | m.msg_control = 0; | ||||
exit(0); | exit(0); | ||||
]])], | ]])], | ||||
[ ac_cv_have_control_in_msghdr="yes" ], | [ ac_cv_have_control_in_msghdr="yes" ], | ||||
[ ac_cv_have_control_in_msghdr="no" ] | [ ac_cv_have_control_in_msghdr="no" ] | ||||
) | ) | ||||
]) | ]) | ||||
if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then | if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then | ||||
AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], | AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], | ||||
[Define if your system uses ancillary data style | [Define if your system uses ancillary data style | ||||
file descriptor passing]) | file descriptor passing]) | ||||
fi | fi | ||||
AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ | ||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], | ||||
[[ extern char *__progname; printf("%s", __progname); ]])], | [[ extern char *__progname; printf("%s", __progname); ]])], | ||||
[ ac_cv_libc_defines___progname="yes" ], | [ ac_cv_libc_defines___progname="yes" ], | ||||
[ ac_cv_libc_defines___progname="no" | [ ac_cv_libc_defines___progname="no" | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_libc_defines___progname" = "xyes" ; then | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then | ||||
AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) | AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) | ||||
fi | fi | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | AC_CACHE_CHECK([whether getopt has optreset support], | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then | if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then | ||||
AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], | AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], | ||||
[Define if your getopt(3) defines and uses optreset]) | [Define if your getopt(3) defines and uses optreset]) | ||||
fi | fi | ||||
AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ | ||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], | ||||
[[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], | [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])], | ||||
[ ac_cv_libc_defines_sys_errlist="yes" ], | [ ac_cv_libc_defines_sys_errlist="yes" ], | ||||
[ ac_cv_libc_defines_sys_errlist="no" | [ ac_cv_libc_defines_sys_errlist="no" | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then | ||||
AC_DEFINE([HAVE_SYS_ERRLIST], [1], | AC_DEFINE([HAVE_SYS_ERRLIST], [1], | ||||
[Define if your system defines sys_errlist[]]) | [Define if your system defines sys_errlist[]]) | ||||
fi | fi | ||||
AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ | ||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], | ||||
[[ extern int sys_nerr; printf("%i", sys_nerr);]])], | [[ extern int sys_nerr; printf("%i", sys_nerr);]])], | ||||
[ ac_cv_libc_defines_sys_nerr="yes" ], | [ ac_cv_libc_defines_sys_nerr="yes" ], | ||||
[ ac_cv_libc_defines_sys_nerr="no" | [ ac_cv_libc_defines_sys_nerr="no" | ||||
]) | ]) | ||||
]) | ]) | ||||
if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then | ||||
AC_DEFINE([HAVE_SYS_NERR], [1], [Define if your system defines sys_nerr]) | AC_DEFINE([HAVE_SYS_NERR], [1], [Define if your system defines sys_nerr]) | ||||
fi | fi | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | [ if test "x$withval" != "xno" ; then | ||||
SELINUX_MSG="yes" | SELINUX_MSG="yes" | ||||
AC_CHECK_HEADER([selinux/selinux.h], , | AC_CHECK_HEADER([selinux/selinux.h], , | ||||
AC_MSG_ERROR([SELinux support requires selinux.h header])) | AC_MSG_ERROR([SELinux support requires selinux.h header])) | ||||
AC_CHECK_LIB([selinux], [setexeccon], | AC_CHECK_LIB([selinux], [setexeccon], | ||||
[ LIBSELINUX="-lselinux" | [ LIBSELINUX="-lselinux" | ||||
LIBS="$LIBS -lselinux" | LIBS="$LIBS -lselinux" | ||||
], | ], | ||||
AC_MSG_ERROR([SELinux support requires libselinux library])) | AC_MSG_ERROR([SELinux support requires libselinux library])) | ||||
SSHLIBS="$SSHLIBS $LIBSELINUX" | |||||
SSHDLIBS="$SSHDLIBS $LIBSELINUX" | |||||
AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) | AC_CHECK_FUNCS([getseuserbyname get_default_context_with_level]) | ||||
LIBS="$save_LIBS" | LIBS="$save_LIBS $LIBSELINUX" | ||||
fi ] | fi ] | ||||
) | ) | ||||
AC_SUBST([SSHLIBS]) | |||||
AC_SUBST([SSHDLIBS]) | AC_SUBST([SSHDLIBS]) | ||||
# Check whether user wants Kerberos 5 support | # Check whether user wants Kerberos 5 support | ||||
KRB5_MSG="no" | KRB5_MSG="no" | ||||
AC_ARG_WITH([kerberos5], | AC_ARG_WITH([kerberos5], | ||||
[ --with-kerberos5=PATH Enable Kerberos 5 support], | [ --with-kerberos5=PATH Enable Kerberos 5 support], | ||||
[ if test "x$withval" != "xno" ; then | [ if test "x$withval" != "xno" ; then | ||||
if test "x$withval" = "xyes" ; then | if test "x$withval" = "xyes" ; then | ||||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | if test "X$withval" != X && test "x$withval" != xno && \ | ||||
],[ | ],[ | ||||
if test "X$maildir" != "X"; then | if test "X$maildir" != "X"; then | ||||
AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) | ||||
else | else | ||||
AC_MSG_CHECKING([Discovering system mail directory]) | AC_MSG_CHECKING([Discovering system mail directory]) | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#ifdef HAVE_PATHS_H | #ifdef HAVE_PATHS_H | ||||
#include <paths.h> | #include <paths.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_MAILLOCK_H | #ifdef HAVE_MAILLOCK_H | ||||
#include <maillock.h> | #include <maillock.h> | ||||
#endif | #endif | ||||
#define DATA "conftest.maildir" | #define DATA "conftest.maildir" | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | man|cat|doc) | ||||
;; | ;; | ||||
*) | *) | ||||
AC_MSG_ERROR([invalid man type: $withval]) | AC_MSG_ERROR([invalid man type: $withval]) | ||||
;; | ;; | ||||
esac | esac | ||||
] | ] | ||||
) | ) | ||||
if test -z "$MANTYPE"; then | if test -z "$MANTYPE"; then | ||||
TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" | if ${MANDOC} ${srcdir}/ssh.1 >/dev/null 2>&1; then | ||||
AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath]) | |||||
if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then | |||||
MANTYPE=doc | MANTYPE=doc | ||||
elif ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then | |||||
MANTYPE=doc | |||||
elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then | elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then | ||||
MANTYPE=man | MANTYPE=man | ||||
else | else | ||||
MANTYPE=cat | MANTYPE=cat | ||||
fi | fi | ||||
fi | fi | ||||
AC_SUBST([MANTYPE]) | AC_SUBST([MANTYPE]) | ||||
if test "$MANTYPE" = "doc"; then | if test "$MANTYPE" = "doc"; then | ||||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | if test ! -z "$external_path_file" ; then | ||||
AC_MSG_WARN([ | AC_MSG_WARN([ | ||||
If PATH is defined in $external_path_file, ensure the path to scp is included, | If PATH is defined in $external_path_file, ensure the path to scp is included, | ||||
otherwise scp will not work.]) | otherwise scp will not work.]) | ||||
fi | fi | ||||
AC_RUN_IFELSE( | AC_RUN_IFELSE( | ||||
[AC_LANG_PROGRAM([[ | [AC_LANG_PROGRAM([[ | ||||
/* find out what STDPATH is */ | /* find out what STDPATH is */ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | |||||
#ifdef HAVE_PATHS_H | #ifdef HAVE_PATHS_H | ||||
# include <paths.h> | # include <paths.h> | ||||
#endif | #endif | ||||
#ifndef _PATH_STDPATH | #ifndef _PATH_STDPATH | ||||
# ifdef _PATH_USERPATH /* Irix */ | # ifdef _PATH_USERPATH /* Irix */ | ||||
# define _PATH_STDPATH _PATH_USERPATH | # define _PATH_STDPATH _PATH_USERPATH | ||||
# else | # else | ||||
# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" | ||||
▲ Show 20 Lines • Show All 411 Lines • ▼ Show 20 Lines | |||||
AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) | ||||
AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) | ||||
AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) | ||||
AC_SUBST([DEPEND], [$(cat $srcdir/.depend)]) | AC_SUBST([DEPEND], [$(cat $srcdir/.depend)]) | ||||
CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" | ||||
LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" | ||||
# Make a copy of CFLAGS/LDFLAGS without PIE options. | |||||
LDFLAGS_NOPIE=`echo "$LDFLAGS" | sed 's/ -pie//'` | |||||
CFLAGS_NOPIE=`echo "$CFLAGS" | sed 's/ -fPIE//'` | |||||
AC_SUBST([LDFLAGS_NOPIE]) | |||||
AC_SUBST([CFLAGS_NOPIE]) | |||||
AC_EXEEXT | AC_EXEEXT | ||||
AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ | ||||
openbsd-compat/Makefile openbsd-compat/regress/Makefile \ | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ | ||||
survey.sh]) | survey.sh]) | ||||
AC_OUTPUT | AC_OUTPUT | ||||
# Print summary of options | # Print summary of options | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
echo " Solaris process contract support: $SPC_MSG" | echo " Solaris process contract support: $SPC_MSG" | ||||
echo " Solaris project support: $SP_MSG" | echo " Solaris project support: $SP_MSG" | ||||
echo " Solaris privilege support: $SPP_MSG" | echo " Solaris privilege support: $SPP_MSG" | ||||
echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" | ||||
echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | ||||
echo " BSD Auth support: $BSD_AUTH_MSG" | echo " BSD Auth support: $BSD_AUTH_MSG" | ||||
echo " Random number source: $RAND_MSG" | echo " Random number source: $RAND_MSG" | ||||
echo " Privsep sandbox style: $SANDBOX_STYLE" | echo " Privsep sandbox style: $SANDBOX_STYLE" | ||||
echo " PKCS#11 support: $enable_pkcs11" | |||||
echo " U2F/FIDO support: $enable_sk" | |||||
echo "" | echo "" | ||||
echo " Host: ${host}" | echo " Host: ${host}" | ||||
echo " Compiler: ${CC}" | echo " Compiler: ${CC}" | ||||
echo " Compiler flags: ${CFLAGS}" | echo " Compiler flags: ${CFLAGS}" | ||||
echo "Preprocessor flags: ${CPPFLAGS}" | echo "Preprocessor flags: ${CPPFLAGS}" | ||||
echo " Linker flags: ${LDFLAGS}" | echo " Linker flags: ${LDFLAGS}" | ||||
echo " Libraries: ${LIBS}" | echo " Libraries: ${LIBS}" | ||||
if test ! -z "${SSHDLIBS}"; then | if test ! -z "${SSHDLIBS}"; then | ||||
echo " +for sshd: ${SSHDLIBS}" | echo " +for sshd: ${SSHDLIBS}" | ||||
fi | |||||
if test ! -z "${SSHLIBS}"; then | |||||
echo " +for ssh: ${SSHLIBS}" | |||||
fi | fi | ||||
echo "" | echo "" | ||||
if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then | if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then | ||||
echo "SVR4 style packages are supported with \"make package\"" | echo "SVR4 style packages are supported with \"make package\"" | ||||
echo "" | echo "" | ||||
fi | fi | ||||
Show All 23 Lines |