Mercurial > dropbear
comparison configure.ac @ 1849:d34f50b7b9fd
Add configure --enable-werror argument
This should be used instead of putting -Werror in CFLAGS
before configure, as -Werror interferes with conftests.
Update github actions to use that.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 19 Oct 2021 12:16:20 +0800 |
parents | df7bfd2f7d45 |
children | 2b3a8026a6ce |
comparison
equal
deleted
inserted
replaced
1848:84b664071c7d | 1849:d34f50b7b9fd |
---|---|
14 hgrev=`hg id -i -R "$srcdir"` | 14 hgrev=`hg id -i -R "$srcdir"` |
15 AC_MSG_NOTICE([Source directory Mercurial base revision $hgrev]) | 15 AC_MSG_NOTICE([Source directory Mercurial base revision $hgrev]) |
16 fi | 16 fi |
17 | 17 |
18 ORIGCFLAGS="$CFLAGS" | 18 ORIGCFLAGS="$CFLAGS" |
19 LATE_CFLAGS="" | |
19 # Checks for programs. | 20 # Checks for programs. |
20 AC_PROG_CC | 21 AC_PROG_CC |
21 | 22 |
22 if test -z "$LD" ; then | 23 if test -z "$LD" ; then |
23 LD=$CC | 24 LD=$CC |
125 DB_TRYADDCFLAGS([-mfunction-return=thunk]) | 126 DB_TRYADDCFLAGS([-mfunction-return=thunk]) |
126 DB_TRYADDCFLAGS([-mindirect-branch=thunk]) | 127 DB_TRYADDCFLAGS([-mindirect-branch=thunk]) |
127 | 128 |
128 fi | 129 fi |
129 | 130 |
131 AC_ARG_ENABLE(werror, | |
132 [ --enable-werror Set -Werror when building], | |
133 [ | |
134 if test "x$enableval" = "xyes"; then | |
135 # -Werror shouldn't be set when configure runs tests. | |
136 # We add it to the Makefile's CFLAGS | |
137 LATE_CFLAGS+="$LATE_CFLAGS -Werror" | |
138 AC_MSG_NOTICE(Enabling -Werror) | |
139 fi | |
140 ], []) | |
141 | |
130 # large file support is useful for scp | 142 # large file support is useful for scp |
131 AC_SYS_LARGEFILE | 143 AC_SYS_LARGEFILE |
132 | 144 |
133 # Host specific options | 145 # Host specific options |
134 # this isn't a definitive list of hosts, they are just added as required | 146 # this isn't a definitive list of hosts, they are just added as required |
859 if test $BUNDLED_LIBTOM = 1 ; then | 871 if test $BUNDLED_LIBTOM = 1 ; then |
860 (cd $srcdir; find libtomcrypt -type d) | xargs mkdir -pv | 872 (cd $srcdir; find libtomcrypt -type d) | xargs mkdir -pv |
861 LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile" | 873 LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile" |
862 fi | 874 fi |
863 | 875 |
876 # flags that should be set in Makefile but not for configure tests | |
877 CFLAGS="$CFLAGS $LATE_CFLAGS" | |
878 | |
864 AC_CONFIG_HEADERS([config.h]) | 879 AC_CONFIG_HEADERS([config.h]) |
865 AC_CONFIG_FILES(Makefile $LIBTOM_FILES test/Makefile) | 880 AC_CONFIG_FILES(Makefile $LIBTOM_FILES test/Makefile) |
866 AC_OUTPUT | 881 AC_OUTPUT |
867 | 882 |
868 AC_MSG_NOTICE() | 883 AC_MSG_NOTICE() |