Mercurial > dropbear
comparison configure.ac @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 4afde04f0607 55120acb9994 |
children | 63fa53d3b6c7 |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
7 | 7 |
8 AC_PREREQ(2.59) | 8 AC_PREREQ(2.59) |
9 AC_INIT | 9 AC_INIT |
10 AC_CONFIG_SRCDIR(buffer.c) | 10 AC_CONFIG_SRCDIR(buffer.c) |
11 | 11 |
12 OLDCFLAGS="$CFLAGS" | |
13 # Checks for programs. | 12 # Checks for programs. |
14 AC_PROG_CC | 13 AC_PROG_CC |
15 AC_PROG_MAKE_SET | |
16 | 14 |
17 if test -z "$LD" ; then | 15 if test -z "$LD" ; then |
18 LD=$CC | 16 LD=$CC |
19 fi | 17 fi |
20 AC_SUBST(LD) | 18 AC_SUBST(LD) |
19 | |
20 AC_DEFUN(DB_TRYADDCFLAGS, | |
21 [{ | |
22 OLDFLAGS="$CFLAGS" | |
23 TESTFLAGS="$1" | |
24 CFLAGS="$CFLAGS $TESTFLAGS" | |
25 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | |
26 [AC_MSG_NOTICE([Setting $TESTFLAGS])], | |
27 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDFLAGS" ] | |
28 ) | |
29 }]) | |
21 | 30 |
22 # set compile flags prior to other tests | 31 # set compile flags prior to other tests |
23 if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then | 32 if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then |
24 AC_MSG_NOTICE(No \$CFLAGS set... using "-Os -W -Wall" for GCC) | 33 AC_MSG_NOTICE(No \$CFLAGS set... using "-Os -W -Wall" for GCC) |
25 CFLAGS="-Os -W -Wall -Wno-pointer-sign" | 34 CFLAGS="-Os -W -Wall" |
26 fi | 35 fi |
27 | 36 |
28 AC_MSG_CHECKING([if compiler '$CC' supports -fno-strict-overflow]) | 37 AC_MSG_NOTICE([Checking if compiler '$CC' supports -Wno-pointer-sign]) |
29 OLDCFLAGS="$CFLAGS" | 38 DB_TRYADDCFLAGS([-Wno-pointer-sign]) |
30 CFLAGS="$CFLAGS -fno-strict-overflow" | 39 |
31 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | 40 AC_MSG_NOTICE([Checking if compiler '$CC' supports -fno-strict-overflow]) |
32 [AC_MSG_RESULT(yes)], | 41 DB_TRYADDCFLAGS([-fno-strict-overflow]) |
33 [AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS" ] | |
34 ) | |
35 | 42 |
36 STATIC=0 | 43 STATIC=0 |
37 AC_ARG_ENABLE(static, | 44 AC_ARG_ENABLE(static, |
38 [ --enable-static Build static binaries], | 45 [ --enable-static Build static binaries], |
39 [ | 46 [ |
57 if test "$hardenbuild" -eq 1; then | 64 if test "$hardenbuild" -eq 1; then |
58 AC_MSG_NOTICE(Checking for available hardened build flags:) | 65 AC_MSG_NOTICE(Checking for available hardened build flags:) |
59 # relocation flags don't make sense for static builds | 66 # relocation flags don't make sense for static builds |
60 if test "$STATIC" -ne 1; then | 67 if test "$STATIC" -ne 1; then |
61 # pie | 68 # pie |
62 OLDCFLAGS="$CFLAGS" | 69 DB_TRYADDCFLAGS([-fPIE]) |
63 TESTFLAGS="-fPIE" | 70 |
64 CFLAGS="$CFLAGS $TESTFLAGS" | |
65 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | |
66 [AC_MSG_NOTICE([Setting $TESTFLAGS])], | |
67 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ] | |
68 ) | |
69 OLDLDFLAGS="$LDFLAGS" | 71 OLDLDFLAGS="$LDFLAGS" |
70 TESTFLAGS="-Wl,-pie" | 72 TESTFLAGS="-Wl,-pie" |
71 LDFLAGS="$LDFLAGS $TESTFLAGS" | 73 LDFLAGS="$LDFLAGS $TESTFLAGS" |
72 AC_LINK_IFELSE([AC_LANG_PROGRAM([])], | 74 AC_LINK_IFELSE([AC_LANG_PROGRAM([])], |
73 [AC_MSG_NOTICE([Setting $TESTFLAGS])], | 75 [AC_MSG_NOTICE([Setting $TESTFLAGS])], |
105 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ] | 107 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ] |
106 ) | 108 ) |
107 ] | 109 ] |
108 ) | 110 ) |
109 # FORTIFY_SOURCE | 111 # FORTIFY_SOURCE |
110 OLDCFLAGS="$CFLAGS" | 112 DB_TRYADDCFLAGS([-D_FORTIFY_SOURCE=2]) |
111 TESTFLAGS="-D_FORTIFY_SOURCE=2" | 113 |
112 CFLAGS="$CFLAGS $TESTFLAGS" | 114 # Spectre v2 mitigations |
113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | 115 DB_TRYADDCFLAGS([-mfunction-return=thunk]) |
114 [AC_MSG_NOTICE([Setting $TESTFLAGS])], | 116 DB_TRYADDCFLAGS([-mindirect-branch=thunk]) |
115 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ] | 117 |
116 ) | |
117 fi | 118 fi |
118 | 119 |
119 # large file support is useful for scp | 120 # large file support is useful for scp |
120 AC_SYS_LARGEFILE | 121 AC_SYS_LARGEFILE |
121 | 122 |
267 [ | 268 [ |
268 if test "x$enableval" = "xno"; then | 269 if test "x$enableval" = "xno"; then |
269 AC_MSG_NOTICE(Not using openpty) | 270 AC_MSG_NOTICE(Not using openpty) |
270 else | 271 else |
271 AC_MSG_NOTICE(Using openpty if available) | 272 AC_MSG_NOTICE(Using openpty if available) |
272 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,1,[Have openpty() function])]) | 273 AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes]) |
273 fi | 274 fi |
274 ], | 275 ], |
275 [ | 276 [ |
276 AC_MSG_NOTICE(Using openpty if available) | 277 AC_MSG_NOTICE(Using openpty if available) |
277 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)]) | 278 AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes]) |
278 ] | 279 ] |
279 ) | 280 ) |
280 | 281 |
282 if test "x$dropbear_cv_func_have_openpty" = "xyes"; then | |
283 AC_DEFINE(HAVE_OPENPTY,,Have openpty() function) | |
284 no_ptc_check=yes | |
285 no_ptmx_check=yes | |
286 fi | |
281 | 287 |
282 AC_ARG_ENABLE(syslog, | 288 AC_ARG_ENABLE(syslog, |
283 [ --disable-syslog Don't include syslog support], | 289 [ --disable-syslog Don't include syslog support], |
284 [ | 290 [ |
285 if test "x$enableval" = "xno"; then | 291 if test "x$enableval" = "xno"; then |
807 fi | 813 fi |
808 fi | 814 fi |
809 | 815 |
810 AC_EXEEXT | 816 AC_EXEEXT |
811 | 817 |
812 # XXX there must be a nicer way to do this | |
813 if test $BUNDLED_LIBTOM = 1 ; then | 818 if test $BUNDLED_LIBTOM = 1 ; then |
814 AS_MKDIR_P(libtomcrypt/src/ciphers/aes) | 819 (cd $srcdir; find libtomcrypt -type d) | xargs mkdir -pv |
815 AS_MKDIR_P(libtomcrypt/src/ciphers/safer) | |
816 AS_MKDIR_P(libtomcrypt/src/ciphers/twofish) | |
817 AS_MKDIR_P(libtomcrypt/src/encauth/ccm) | |
818 AS_MKDIR_P(libtomcrypt/src/encauth/eax) | |
819 AS_MKDIR_P(libtomcrypt/src/encauth/gcm) | |
820 AS_MKDIR_P(libtomcrypt/src/encauth/ocb) | |
821 AS_MKDIR_P(libtomcrypt/src/hashes) | |
822 AS_MKDIR_P(libtomcrypt/src/hashes/chc) | |
823 AS_MKDIR_P(libtomcrypt/src/hashes/helper) | |
824 AS_MKDIR_P(libtomcrypt/src/hashes/sha2) | |
825 AS_MKDIR_P(libtomcrypt/src/hashes/whirl) | |
826 AS_MKDIR_P(libtomcrypt/src/mac/hmac) | |
827 AS_MKDIR_P(libtomcrypt/src/mac/omac) | |
828 AS_MKDIR_P(libtomcrypt/src/mac/pelican) | |
829 AS_MKDIR_P(libtomcrypt/src/mac/pmac) | |
830 AS_MKDIR_P(libtomcrypt/src/mac/f9) | |
831 AS_MKDIR_P(libtomcrypt/src/mac/xcbc) | |
832 AS_MKDIR_P(libtomcrypt/src/math/fp) | |
833 AS_MKDIR_P(libtomcrypt/src/misc/base64) | |
834 AS_MKDIR_P(libtomcrypt/src/misc/crypt) | |
835 AS_MKDIR_P(libtomcrypt/src/misc/mpi) | |
836 AS_MKDIR_P(libtomcrypt/src/misc/pkcs5) | |
837 AS_MKDIR_P(libtomcrypt/src/modes/cbc) | |
838 AS_MKDIR_P(libtomcrypt/src/modes/cfb) | |
839 AS_MKDIR_P(libtomcrypt/src/modes/ctr) | |
840 AS_MKDIR_P(libtomcrypt/src/modes/ecb) | |
841 AS_MKDIR_P(libtomcrypt/src/modes/ofb) | |
842 AS_MKDIR_P(libtomcrypt/src/modes/f8) | |
843 AS_MKDIR_P(libtomcrypt/src/modes/lrw) | |
844 AS_MKDIR_P(libtomcrypt/src/modes/xts) | |
845 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit) | |
846 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/boolean) | |
847 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice) | |
848 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/ia5) | |
849 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/integer) | |
850 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/object_identifier) | |
851 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/octet) | |
852 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/printable_string) | |
853 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/sequence) | |
854 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/set) | |
855 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/short_integer) | |
856 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utctime) | |
857 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utf8) | |
858 AS_MKDIR_P(libtomcrypt/src/pk/dh) | |
859 AS_MKDIR_P(libtomcrypt/src/pk/dsa) | |
860 AS_MKDIR_P(libtomcrypt/src/pk/ecc) | |
861 AS_MKDIR_P(libtomcrypt/src/pk/katja) | |
862 AS_MKDIR_P(libtomcrypt/src/pk/pkcs1) | |
863 AS_MKDIR_P(libtomcrypt/src/pk/rsa) | |
864 AS_MKDIR_P(libtomcrypt/src/prngs) | |
865 LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile" | 820 LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile" |
866 fi | 821 fi |
822 | |
867 AC_CONFIG_HEADER(config.h) | 823 AC_CONFIG_HEADER(config.h) |
868 AC_CONFIG_FILES(Makefile $LIBTOM_FILES) | 824 AC_CONFIG_FILES(Makefile $LIBTOM_FILES) |
869 AC_OUTPUT | 825 AC_OUTPUT |
870 | 826 |
871 AC_MSG_NOTICE() | 827 AC_MSG_NOTICE() |