1
1

configure: provide --enable-werror

Этот коммит содержится в:
Daniel Stenberg 2019-03-15 15:02:40 +01:00
родитель 157fd15148
Коммит 1a60c0111c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
2 изменённых файлов: 40 добавлений и 3 удалений

Просмотреть файл

@ -472,3 +472,40 @@ m4_case([$1],
"
fi
])
dnl LIBSSH2_CHECK_OPTION_WERROR
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-werror or --disable-werror, and set
dnl shell variable want_werror as appropriate.
AC_DEFUN([LIBSSH2_CHECK_OPTION_WERROR], [
AC_BEFORE([$0],[LIBSSH2_CHECK_COMPILER])dnl
AC_MSG_CHECKING([whether to enable compiler warnings as errors])
OPT_COMPILER_WERROR="default"
AC_ARG_ENABLE(werror,
AC_HELP_STRING([--enable-werror],[Enable compiler warnings as errors])
AC_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]),
OPT_COMPILER_WERROR=$enableval)
case "$OPT_COMPILER_WERROR" in
no)
dnl --disable-werror option used
want_werror="no"
;;
default)
dnl configure option not specified
want_werror="no"
;;
*)
dnl --enable-werror option used
want_werror="yes"
;;
esac
AC_MSG_RESULT([$want_werror])
if test X"$want_werror" = Xyes; then
CFLAGS="$CFLAGS -Werror"
fi
])

Просмотреть файл

@ -83,9 +83,6 @@ AC_C_BIGENDIAN
dnl check for how to do large files
AC_SYS_LARGEFILE
# Configure parameters
# Crypto backends
found_crypto=none
@ -370,6 +367,9 @@ if test $missing_required_deps = 1; then
AC_MSG_ERROR([Required dependencies are missing!])
fi
# Configure parameters
LIBSSH2_CHECK_OPTION_WERROR
AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile