diff options
author | Colin Watson <cjwatson@debian.org> | 2020-02-21 11:57:14 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-02-21 11:57:14 +0000 |
commit | f0de78bd4f29fa688c5df116f3f9cd43543a76d0 (patch) | |
tree | 856b0dee3f2764c13a32dad5ffe2424fab7fef41 /configure.ac | |
parent | 4213eec74e74de6310c27a40c3e9759a08a73996 (diff) | |
parent | 8aa3455b16fddea4c0144a7c4a1edb10ec67dcc8 (diff) |
Import openssh_8.2p1.orig.tar.gz
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 255 |
1 files changed, 214 insertions, 41 deletions
diff --git a/configure.ac b/configure.ac index 3e93c0276..b689db4b5 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -164,6 +164,7 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then | |||
164 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) | 164 | OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) |
165 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) | 165 | OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) |
166 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) | 166 | OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) |
167 | OSSH_CHECK_CFLAG_COMPILE([-Wimplicit-fallthrough]) | ||
167 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) | 168 | OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) |
168 | if test "x$use_toolchain_hardening" = "x1"; then | 169 | if test "x$use_toolchain_hardening" = "x1"; then |
169 | OSSH_CHECK_CFLAG_COMPILE([-mretpoline]) # clang | 170 | OSSH_CHECK_CFLAG_COMPILE([-mretpoline]) # clang |
@@ -213,20 +214,26 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then | |||
213 | CFLAGS="$CFLAGS $t -Werror" | 214 | CFLAGS="$CFLAGS $t -Werror" |
214 | LDFLAGS="$LDFLAGS $t -Werror" | 215 | LDFLAGS="$LDFLAGS $t -Werror" |
215 | AC_LINK_IFELSE( | 216 | AC_LINK_IFELSE( |
216 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], | 217 | [AC_LANG_PROGRAM([[ |
218 | #include <stdio.h> | ||
219 | int func (int t) {char b[100]; snprintf(b,sizeof b,"%d",t); return t;} | ||
220 | ]], | ||
217 | [[ | 221 | [[ |
218 | char x[256]; | 222 | char x[256]; |
219 | snprintf(x, sizeof(x), "XXX"); | 223 | snprintf(x, sizeof(x), "XXX%d", func(1)); |
220 | ]])], | 224 | ]])], |
221 | [ AC_MSG_RESULT([yes]) | 225 | [ AC_MSG_RESULT([yes]) |
222 | CFLAGS="$saved_CFLAGS $t" | 226 | CFLAGS="$saved_CFLAGS $t" |
223 | LDFLAGS="$saved_LDFLAGS $t" | 227 | LDFLAGS="$saved_LDFLAGS $t" |
224 | AC_MSG_CHECKING([if $t works]) | 228 | AC_MSG_CHECKING([if $t works]) |
225 | AC_RUN_IFELSE( | 229 | AC_RUN_IFELSE( |
226 | [AC_LANG_PROGRAM([[ #include <stdio.h> ]], | 230 | [AC_LANG_PROGRAM([[ |
231 | #include <stdio.h> | ||
232 | int func (int t) {char b[100]; snprintf(b,sizeof b,"%d",t); return t;} | ||
233 | ]], | ||
227 | [[ | 234 | [[ |
228 | char x[256]; | 235 | char x[256]; |
229 | snprintf(x, sizeof(x), "XXX"); | 236 | snprintf(x, sizeof(x), "XXX%d", func(1)); |
230 | ]])], | 237 | ]])], |
231 | [ AC_MSG_RESULT([yes]) | 238 | [ AC_MSG_RESULT([yes]) |
232 | break ], | 239 | break ], |
@@ -376,6 +383,7 @@ AC_CHECK_HEADERS([ \ | |||
376 | features.h \ | 383 | features.h \ |
377 | fcntl.h \ | 384 | fcntl.h \ |
378 | floatingpoint.h \ | 385 | floatingpoint.h \ |
386 | fnmatch.h \ | ||
379 | getopt.h \ | 387 | getopt.h \ |
380 | glob.h \ | 388 | glob.h \ |
381 | ia.h \ | 389 | ia.h \ |
@@ -691,8 +699,10 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | |||
691 | ;; | 699 | ;; |
692 | *-*-haiku*) | 700 | *-*-haiku*) |
693 | LIBS="$LIBS -lbsd " | 701 | LIBS="$LIBS -lbsd " |
702 | CFLAGS="$CFLAGS -D_BSD_SOURCE" | ||
694 | AC_CHECK_LIB([network], [socket]) | 703 | AC_CHECK_LIB([network], [socket]) |
695 | AC_DEFINE([HAVE_U_INT64_T]) | 704 | AC_DEFINE([HAVE_U_INT64_T]) |
705 | AC_DEFINE([DISABLE_UTMPX], [1], [no utmpx]) | ||
696 | MANTYPE=man | 706 | MANTYPE=man |
697 | ;; | 707 | ;; |
698 | *-*-hpux*) | 708 | *-*-hpux*) |
@@ -1192,8 +1202,25 @@ mips-sony-bsd|mips-sony-newsos4) | |||
1192 | 1202 | ||
1193 | *-*-ultrix*) | 1203 | *-*-ultrix*) |
1194 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) | 1204 | AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1]) |
1195 | AC_DEFINE([NEED_SETPGRP]) | 1205 | AC_DEFINE([NEED_SETPGRP], [1], [Need setpgrp to for controlling tty]) |
1196 | AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix]) | 1206 | AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix]) |
1207 | AC_DEFINE([DISABLE_UTMPX], [1], [Disable utmpx]) | ||
1208 | # DISABLE_FD_PASSING so that we call setpgrp as root, otherwise we | ||
1209 | # don't get a controlling tty. | ||
1210 | AC_DEFINE([DISABLE_FD_PASSING], [1], [Need to call setpgrp as root]) | ||
1211 | # On Ultrix some headers are not protected against multiple includes, | ||
1212 | # so we create wrappers and put it where the compiler will find it. | ||
1213 | AC_MSG_WARN([creating compat wrappers for headers]) | ||
1214 | mkdir -p netinet | ||
1215 | for header in netinet/ip.h netdb.h resolv.h; do | ||
1216 | name=`echo $header | tr 'a-z/.' 'A-Z__'` | ||
1217 | cat >$header <<EOD | ||
1218 | #ifndef _SSH_COMPAT_${name} | ||
1219 | #define _SSH_COMPAT_${name} | ||
1220 | #include "/usr/include/${header}" | ||
1221 | #endif | ||
1222 | EOD | ||
1223 | done | ||
1197 | ;; | 1224 | ;; |
1198 | 1225 | ||
1199 | *-*-lynxos) | 1226 | *-*-lynxos) |
@@ -1260,11 +1287,12 @@ AC_CHECK_FUNC([getspnam], , | |||
1260 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], | 1287 | AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], [1], |
1261 | [Define if you have the basename function.])]) | 1288 | [Define if you have the basename function.])]) |
1262 | 1289 | ||
1263 | dnl zlib is required | 1290 | dnl zlib defaults to enabled |
1291 | zlib=yes | ||
1264 | AC_ARG_WITH([zlib], | 1292 | AC_ARG_WITH([zlib], |
1265 | [ --with-zlib=PATH Use zlib in PATH], | 1293 | [ --with-zlib=PATH Use zlib in PATH], |
1266 | [ if test "x$withval" = "xno" ; then | 1294 | [ if test "x$withval" = "xno" ; then |
1267 | AC_MSG_ERROR([*** zlib is required ***]) | 1295 | zlib=no |
1268 | elif test "x$withval" != "xyes"; then | 1296 | elif test "x$withval" != "xyes"; then |
1269 | if test -d "$withval/lib"; then | 1297 | if test -d "$withval/lib"; then |
1270 | if test -n "${rpath_opt}"; then | 1298 | if test -n "${rpath_opt}"; then |
@@ -1287,8 +1315,14 @@ AC_ARG_WITH([zlib], | |||
1287 | fi ] | 1315 | fi ] |
1288 | ) | 1316 | ) |
1289 | 1317 | ||
1290 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) | 1318 | AC_MSG_CHECKING([for zlib]) |
1291 | AC_CHECK_LIB([z], [deflate], , | 1319 | if test "x${zlib}" = "xno"; then |
1320 | AC_MSG_RESULT([no]) | ||
1321 | else | ||
1322 | AC_MSG_RESULT([yes]) | ||
1323 | AC_DEFINE([WITH_ZLIB], [1], [Enable zlib]) | ||
1324 | AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) | ||
1325 | AC_CHECK_LIB([z], [deflate], , | ||
1292 | [ | 1326 | [ |
1293 | saved_CPPFLAGS="$CPPFLAGS" | 1327 | saved_CPPFLAGS="$CPPFLAGS" |
1294 | saved_LDFLAGS="$LDFLAGS" | 1328 | saved_LDFLAGS="$LDFLAGS" |
@@ -1307,18 +1341,18 @@ AC_CHECK_LIB([z], [deflate], , | |||
1307 | ] | 1341 | ] |
1308 | ) | 1342 | ) |
1309 | ] | 1343 | ] |
1310 | ) | 1344 | ) |
1311 | 1345 | ||
1312 | AC_ARG_WITH([zlib-version-check], | 1346 | AC_ARG_WITH([zlib-version-check], |
1313 | [ --without-zlib-version-check Disable zlib version check], | 1347 | [ --without-zlib-version-check Disable zlib version check], |
1314 | [ if test "x$withval" = "xno" ; then | 1348 | [ if test "x$withval" = "xno" ; then |
1315 | zlib_check_nonfatal=1 | 1349 | zlib_check_nonfatal=1 |
1316 | fi | 1350 | fi |
1317 | ] | 1351 | ] |
1318 | ) | 1352 | ) |
1319 | 1353 | ||
1320 | AC_MSG_CHECKING([for possibly buggy zlib]) | 1354 | AC_MSG_CHECKING([for possibly buggy zlib]) |
1321 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | 1355 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
1322 | #include <stdio.h> | 1356 | #include <stdio.h> |
1323 | #include <stdlib.h> | 1357 | #include <stdlib.h> |
1324 | #include <zlib.h> | 1358 | #include <zlib.h> |
@@ -1356,7 +1390,8 @@ See http://www.gzip.org/zlib/ for details.]) | |||
1356 | fi | 1390 | fi |
1357 | ], | 1391 | ], |
1358 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] | 1392 | [ AC_MSG_WARN([cross compiling: not checking zlib version]) ] |
1359 | ) | 1393 | ) |
1394 | fi | ||
1360 | 1395 | ||
1361 | dnl UnixWare 2.x | 1396 | dnl UnixWare 2.x |
1362 | AC_CHECK_FUNC([strcasecmp], | 1397 | AC_CHECK_FUNC([strcasecmp], |
@@ -1506,8 +1541,6 @@ AC_ARG_WITH(ldns, | |||
1506 | if test "x$withval" = "xyes" ; then | 1541 | if test "x$withval" = "xyes" ; then |
1507 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) | 1542 | AC_PATH_TOOL([LDNSCONFIG], [ldns-config], [no]) |
1508 | if test "x$LDNSCONFIG" = "xno"; then | 1543 | if test "x$LDNSCONFIG" = "xno"; then |
1509 | CPPFLAGS="$CPPFLAGS -I${withval}/include" | ||
1510 | LDFLAGS="$LDFLAGS -L${withval}/lib" | ||
1511 | LIBS="-lldns $LIBS" | 1544 | LIBS="-lldns $LIBS" |
1512 | ldns=yes | 1545 | ldns=yes |
1513 | else | 1546 | else |
@@ -1531,7 +1564,9 @@ AC_ARG_WITH(ldns, | |||
1531 | [AC_LANG_SOURCE([[ | 1564 | [AC_LANG_SOURCE([[ |
1532 | #include <stdio.h> | 1565 | #include <stdio.h> |
1533 | #include <stdlib.h> | 1566 | #include <stdlib.h> |
1534 | #include <stdint.h> | 1567 | #ifdef HAVE_STDINT_H |
1568 | # include <stdint.h> | ||
1569 | #endif | ||
1535 | #include <ldns/ldns.h> | 1570 | #include <ldns/ldns.h> |
1536 | int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } | 1571 | int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); } |
1537 | ]]) | 1572 | ]]) |
@@ -1698,6 +1733,18 @@ if test "x$use_pie" != "xno"; then | |||
1698 | fi | 1733 | fi |
1699 | fi | 1734 | fi |
1700 | 1735 | ||
1736 | AC_MSG_CHECKING([whether -fPIC is accepted]) | ||
1737 | SAVED_CFLAGS="$CFLAGS" | ||
1738 | CFLAGS="$CFLAGS -fPIC" | ||
1739 | AC_COMPILE_IFELSE( | ||
1740 | [AC_LANG_PROGRAM( [[ #include <stdlib.h> ]], [[ exit(0); ]] )], | ||
1741 | [AC_MSG_RESULT([yes]) | ||
1742 | PICFLAG="-fPIC"; ], | ||
1743 | [AC_MSG_RESULT([no]) | ||
1744 | PICFLAG=""; ]) | ||
1745 | CFLAGS="$SAVED_CFLAGS" | ||
1746 | AC_SUBST([PICFLAG]) | ||
1747 | |||
1701 | dnl Checks for library functions. Please keep in alphabetical order | 1748 | dnl Checks for library functions. Please keep in alphabetical order |
1702 | AC_CHECK_FUNCS([ \ | 1749 | AC_CHECK_FUNCS([ \ |
1703 | Blowfish_initstate \ | 1750 | Blowfish_initstate \ |
@@ -1730,6 +1777,7 @@ AC_CHECK_FUNCS([ \ | |||
1730 | fchown \ | 1777 | fchown \ |
1731 | fchownat \ | 1778 | fchownat \ |
1732 | flock \ | 1779 | flock \ |
1780 | fnmatch \ | ||
1733 | freeaddrinfo \ | 1781 | freeaddrinfo \ |
1734 | freezero \ | 1782 | freezero \ |
1735 | fstatfs \ | 1783 | fstatfs \ |
@@ -1757,6 +1805,7 @@ AC_CHECK_FUNCS([ \ | |||
1757 | inet_ntop \ | 1805 | inet_ntop \ |
1758 | innetgr \ | 1806 | innetgr \ |
1759 | llabs \ | 1807 | llabs \ |
1808 | localtime_r \ | ||
1760 | login_getcapbool \ | 1809 | login_getcapbool \ |
1761 | md5_crypt \ | 1810 | md5_crypt \ |
1762 | memmem \ | 1811 | memmem \ |
@@ -1774,6 +1823,7 @@ AC_CHECK_FUNCS([ \ | |||
1774 | raise \ | 1823 | raise \ |
1775 | readpassphrase \ | 1824 | readpassphrase \ |
1776 | reallocarray \ | 1825 | reallocarray \ |
1826 | realpath \ | ||
1777 | recvmsg \ | 1827 | recvmsg \ |
1778 | recallocarray \ | 1828 | recallocarray \ |
1779 | rresvport_af \ | 1829 | rresvport_af \ |
@@ -1831,7 +1881,7 @@ AC_CHECK_FUNCS([ \ | |||
1831 | warn \ | 1881 | warn \ |
1832 | ]) | 1882 | ]) |
1833 | 1883 | ||
1834 | AC_CHECK_DECLS([bzero]) | 1884 | AC_CHECK_DECLS([bzero, memmem]) |
1835 | 1885 | ||
1836 | dnl Wide character support. | 1886 | dnl Wide character support. |
1837 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) | 1887 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
@@ -1871,16 +1921,29 @@ AC_ARG_ENABLE([pkcs11], | |||
1871 | ] | 1921 | ] |
1872 | ) | 1922 | ) |
1873 | 1923 | ||
1874 | # PKCS11 depends on OpenSSL. | 1924 | disable_sk= |
1875 | if test "x$openssl" = "xyes" && test "x$disable_pkcs11" = "x"; then | 1925 | AC_ARG_ENABLE([security-key], |
1876 | # PKCS#11 support requires dlopen() and co | 1926 | [ --disable-security-key disable U2F/FIDO support code [no]], |
1877 | AC_SEARCH_LIBS([dlopen], [dl], | 1927 | [ |
1878 | AC_CHECK_DECL([RTLD_NOW], | 1928 | if test "x$enableval" = "xno" ; then |
1879 | AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]), | 1929 | disable_sk=1 |
1880 | [], [#include <dlfcn.h>] | 1930 | fi |
1881 | ) | 1931 | ] |
1882 | ) | 1932 | ) |
1883 | fi | 1933 | enable_sk_internal= |
1934 | AC_ARG_WITH([security-key-builtin], | ||
1935 | [ --with-security-key-builtin include builtin U2F/FIDO support], | ||
1936 | [ | ||
1937 | if test "x$withval" != "xno" ; then | ||
1938 | enable_sk_internal=yes | ||
1939 | fi | ||
1940 | ] | ||
1941 | ) | ||
1942 | test "x$disable_sk" != "x" && enable_sk_internal="" | ||
1943 | |||
1944 | AC_SEARCH_LIBS([dlopen], [dl]) | ||
1945 | AC_CHECK_FUNCS([dlopen]) | ||
1946 | AC_CHECK_DECL([RTLD_NOW], [], [], [#include <dlfcn.h>]) | ||
1884 | 1947 | ||
1885 | # IRIX has a const char return value for gai_strerror() | 1948 | # IRIX has a const char return value for gai_strerror() |
1886 | AC_CHECK_FUNCS([gai_strerror], [ | 1949 | AC_CHECK_FUNCS([gai_strerror], [ |
@@ -2860,15 +2923,6 @@ if test "x$openssl" = "xyes" ; then | |||
2860 | # Check for SHA256, SHA384 and SHA512 support in OpenSSL | 2923 | # Check for SHA256, SHA384 and SHA512 support in OpenSSL |
2861 | AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512]) | 2924 | AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512]) |
2862 | 2925 | ||
2863 | # Search for RIPE-MD support in OpenSSL | ||
2864 | AC_CHECK_FUNCS([EVP_ripemd160], , | ||
2865 | [unsupported_algorithms="$unsupported_algorithms \ | ||
2866 | hmac-ripemd160 \ | ||
2867 | hmac-ripemd160@openssh.com \ | ||
2868 | hmac-ripemd160-etm@openssh.com" | ||
2869 | ] | ||
2870 | ) | ||
2871 | |||
2872 | # Check complete ECC support in OpenSSL | 2926 | # Check complete ECC support in OpenSSL |
2873 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) | 2927 | AC_MSG_CHECKING([whether OpenSSL has NID_X9_62_prime256v1]) |
2874 | AC_LINK_IFELSE( | 2928 | AC_LINK_IFELSE( |
@@ -2950,6 +3004,9 @@ if test "x$openssl" = "xyes" ; then | |||
2950 | test x$enable_nistp521 = x1; then | 3004 | test x$enable_nistp521 = x1; then |
2951 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) | 3005 | AC_DEFINE(OPENSSL_HAS_ECC, [1], [OpenSSL has ECC]) |
2952 | AC_CHECK_FUNCS([EC_KEY_METHOD_new]) | 3006 | AC_CHECK_FUNCS([EC_KEY_METHOD_new]) |
3007 | openssl_ecc=yes | ||
3008 | else | ||
3009 | openssl_ecc=no | ||
2953 | fi | 3010 | fi |
2954 | if test x$enable_nistp256 = x1; then | 3011 | if test x$enable_nistp256 = x1; then |
2955 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], | 3012 | AC_DEFINE([OPENSSL_HAS_NISTP256], [1], |
@@ -2990,6 +3047,74 @@ else | |||
2990 | AC_CHECK_FUNCS([crypt]) | 3047 | AC_CHECK_FUNCS([crypt]) |
2991 | fi | 3048 | fi |
2992 | 3049 | ||
3050 | # PKCS11/U2F depend on OpenSSL and dlopen(). | ||
3051 | enable_pkcs11=yes | ||
3052 | enable_sk=yes | ||
3053 | if test "x$openssl" != "xyes" ; then | ||
3054 | enable_pkcs11="disabled; missing libcrypto" | ||
3055 | enable_sk="disabled; missing libcrypto" | ||
3056 | fi | ||
3057 | if test "x$openssl_ecc" != "xyes" ; then | ||
3058 | enable_sk="disabled; OpenSSL has no ECC support" | ||
3059 | fi | ||
3060 | if test "x$ac_cv_func_dlopen" != "xyes" ; then | ||
3061 | enable_pkcs11="disabled; missing dlopen(3)" | ||
3062 | enable_sk="disabled; missing dlopen(3)" | ||
3063 | fi | ||
3064 | if test "x$ac_cv_have_decl_RTLD_NOW" != "xyes" ; then | ||
3065 | enable_pkcs11="disabled; missing RTLD_NOW" | ||
3066 | enable_sk="disabled; missing RTLD_NOW" | ||
3067 | fi | ||
3068 | if test ! -z "$disable_pkcs11" ; then | ||
3069 | enable_pkcs11="disabled by user" | ||
3070 | fi | ||
3071 | if test ! -z "$disable_sk" ; then | ||
3072 | enable_sk="disabled by user" | ||
3073 | fi | ||
3074 | |||
3075 | AC_MSG_CHECKING([whether to enable PKCS11]) | ||
3076 | if test "x$enable_pkcs11" = "xyes" ; then | ||
3077 | AC_DEFINE([ENABLE_PKCS11], [], [Enable for PKCS#11 support]) | ||
3078 | fi | ||
3079 | AC_MSG_RESULT([$enable_pkcs11]) | ||
3080 | |||
3081 | AC_MSG_CHECKING([whether to enable U2F]) | ||
3082 | if test "x$enable_sk" = "xyes" ; then | ||
3083 | AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support]) | ||
3084 | fi | ||
3085 | AC_MSG_RESULT([$enable_sk]) | ||
3086 | |||
3087 | # Now check for built-in security key support. | ||
3088 | if test "x$enable_sk" = "xyes" -a "x$enable_sk_internal" = "xyes" ; then | ||
3089 | AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) | ||
3090 | use_pkgconfig_for_libfido2= | ||
3091 | if test "x$PKGCONFIG" != "xno"; then | ||
3092 | AC_MSG_CHECKING([if $PKGCONFIG knows about libfido2]) | ||
3093 | if "$PKGCONFIG" libfido2; then | ||
3094 | AC_MSG_RESULT([yes]) | ||
3095 | use_pkgconfig_for_libfido2=yes | ||
3096 | else | ||
3097 | AC_MSG_RESULT([no]) | ||
3098 | fi | ||
3099 | fi | ||
3100 | if test "x$use_pkgconfig_for_libfido2" = "xyes"; then | ||
3101 | LIBFIDO2=`$PKGCONFIG --libs libfido2` | ||
3102 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libfido2`" | ||
3103 | else | ||
3104 | LIBFIDO2="-lfido2 -lcbor" | ||
3105 | fi | ||
3106 | OTHERLIBS=`echo $LIBFIDO2 | sed 's/-lfido2//'` | ||
3107 | AC_CHECK_LIB([fido2], [fido_init], | ||
3108 | [ | ||
3109 | AC_SUBST([LIBFIDO2]) | ||
3110 | AC_DEFINE([ENABLE_SK_INTERNAL], [], | ||
3111 | [Enable for built-in U2F/FIDO support]) | ||
3112 | enable_sk="built-in" | ||
3113 | ], [ ], | ||
3114 | [ $OTHERLIBS ] | ||
3115 | ) | ||
3116 | fi | ||
3117 | |||
2993 | AC_CHECK_FUNCS([ \ | 3118 | AC_CHECK_FUNCS([ \ |
2994 | arc4random \ | 3119 | arc4random \ |
2995 | arc4random_buf \ | 3120 | arc4random_buf \ |
@@ -3535,6 +3660,17 @@ fprint_ll(FILE *f, long long n) | |||
3535 | ) | 3660 | ) |
3536 | fi | 3661 | fi |
3537 | 3662 | ||
3663 | AC_CHECK_DECLS([UINT32_MAX], , , [[ | ||
3664 | #ifdef HAVE_SYS_LIMITS_H | ||
3665 | # include <sys/limits.h> | ||
3666 | #endif | ||
3667 | #ifdef HAVE_LIMITS_H | ||
3668 | # include <limits.h> | ||
3669 | #endif | ||
3670 | #ifdef HAVE_STDINT_H | ||
3671 | # include <stdint.h> | ||
3672 | #endif | ||
3673 | ]]) | ||
3538 | 3674 | ||
3539 | # More checks for data types | 3675 | # More checks for data types |
3540 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ | 3676 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
@@ -3715,7 +3851,9 @@ fi | |||
3715 | 3851 | ||
3716 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ | 3852 | AC_CHECK_TYPES([intmax_t, uintmax_t], , , [ |
3717 | #include <sys/types.h> | 3853 | #include <sys/types.h> |
3718 | #include <stdint.h> | 3854 | #ifdef HAVE_STDINT_H |
3855 | # include <stdint.h> | ||
3856 | #endif | ||
3719 | ]) | 3857 | ]) |
3720 | 3858 | ||
3721 | TYPE_SOCKLEN_T | 3859 | TYPE_SOCKLEN_T |
@@ -3734,7 +3872,8 @@ AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [ | |||
3734 | #endif | 3872 | #endif |
3735 | ]) | 3873 | ]) |
3736 | 3874 | ||
3737 | AC_CHECK_MEMBERS([struct statfs.f_flags], [], [], [[ | 3875 | AC_CHECK_MEMBERS([struct statfs.f_files, struct statfs.f_flags], [], [], [[ |
3876 | #include <sys/param.h> | ||
3738 | #include <sys/types.h> | 3877 | #include <sys/types.h> |
3739 | #ifdef HAVE_SYS_BITYPES_H | 3878 | #ifdef HAVE_SYS_BITYPES_H |
3740 | #include <sys/bitypes.h> | 3879 | #include <sys/bitypes.h> |
@@ -3748,6 +3887,9 @@ AC_CHECK_MEMBERS([struct statfs.f_flags], [], [], [[ | |||
3748 | #ifdef HAVE_SYS_VFS_H | 3887 | #ifdef HAVE_SYS_VFS_H |
3749 | #include <sys/vfs.h> | 3888 | #include <sys/vfs.h> |
3750 | #endif | 3889 | #endif |
3890 | #ifdef HAVE_SYS_MOUNT_H | ||
3891 | #include <sys/mount.h> | ||
3892 | #endif | ||
3751 | ]]) | 3893 | ]]) |
3752 | 3894 | ||
3753 | 3895 | ||
@@ -3893,6 +4035,8 @@ if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then | |||
3893 | [define if you have struct addrinfo data type]) | 4035 | [define if you have struct addrinfo data type]) |
3894 | fi | 4036 | fi |
3895 | 4037 | ||
4038 | AC_HEADER_TIME | ||
4039 | |||
3896 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ | 4040 | AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ |
3897 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], | 4041 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], |
3898 | [[ struct timeval tv; tv.tv_sec = 1;]])], | 4042 | [[ struct timeval tv; tv.tv_sec = 1;]])], |
@@ -3905,7 +4049,28 @@ if test "x$ac_cv_have_struct_timeval" = "xyes" ; then | |||
3905 | have_struct_timeval=1 | 4049 | have_struct_timeval=1 |
3906 | fi | 4050 | fi |
3907 | 4051 | ||
3908 | AC_CHECK_TYPES([struct timespec]) | 4052 | AC_CACHE_CHECK([for struct timespec], ac_cv_have_struct_timespec, [ |
4053 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||
4054 | #ifdef TIME_WITH_SYS_TIME | ||
4055 | # include <sys/time.h> | ||
4056 | # include <time.h> | ||
4057 | #else | ||
4058 | # ifdef HAVE_SYS_TIME_H | ||
4059 | # include <sys/time.h> | ||
4060 | # else | ||
4061 | # include <time.h> | ||
4062 | # endif | ||
4063 | #endif | ||
4064 | ]], | ||
4065 | [[ struct timespec ts; ts.tv_sec = 1;]])], | ||
4066 | [ ac_cv_have_struct_timespec="yes" ], | ||
4067 | [ ac_cv_have_struct_timespec="no" | ||
4068 | ]) | ||
4069 | ]) | ||
4070 | if test "x$ac_cv_have_struct_timespec" = "xyes" ; then | ||
4071 | AC_DEFINE([HAVE_STRUCT_TIMESPEC], [1], [define if you have struct timespec]) | ||
4072 | have_struct_timespec=1 | ||
4073 | fi | ||
3909 | 4074 | ||
3910 | # We need int64_t or else certain parts of the compile will fail. | 4075 | # We need int64_t or else certain parts of the compile will fail. |
3911 | if test "x$ac_cv_have_int64_t" = "xno" && \ | 4076 | if test "x$ac_cv_have_int64_t" = "xno" && \ |
@@ -5171,6 +5336,12 @@ AC_SUBST([DEPEND], [$(cat $srcdir/.depend)]) | |||
5171 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" | 5336 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" |
5172 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" | 5337 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" |
5173 | 5338 | ||
5339 | # Make a copy of CFLAGS/LDFLAGS without PIE options. | ||
5340 | LDFLAGS_NOPIE=`echo "$LDFLAGS" | sed 's/ -pie//'` | ||
5341 | CFLAGS_NOPIE=`echo "$CFLAGS" | sed 's/ -fPIE//'` | ||
5342 | AC_SUBST([LDFLAGS_NOPIE]) | ||
5343 | AC_SUBST([CFLAGS_NOPIE]) | ||
5344 | |||
5174 | AC_EXEEXT | 5345 | AC_EXEEXT |
5175 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ | 5346 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
5176 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ | 5347 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |
@@ -5229,6 +5400,8 @@ echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" | |||
5229 | echo " BSD Auth support: $BSD_AUTH_MSG" | 5400 | echo " BSD Auth support: $BSD_AUTH_MSG" |
5230 | echo " Random number source: $RAND_MSG" | 5401 | echo " Random number source: $RAND_MSG" |
5231 | echo " Privsep sandbox style: $SANDBOX_STYLE" | 5402 | echo " Privsep sandbox style: $SANDBOX_STYLE" |
5403 | echo " PKCS#11 support: $enable_pkcs11" | ||
5404 | echo " U2F/FIDO support: $enable_sk" | ||
5232 | 5405 | ||
5233 | echo "" | 5406 | echo "" |
5234 | 5407 | ||