1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

configure: use LIBVIRT_ARG_ENABLE macro

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-12-13 13:34:42 +01:00
parent 08c2d1480b
commit ca01aeb57f
2 changed files with 43 additions and 59 deletions

View File

@ -469,10 +469,7 @@ STATIC_BINARIES=
AC_SUBST([STATIC_BINARIES]) AC_SUBST([STATIC_BINARIES])
dnl --enable-debug=(yes|no) dnl --enable-debug=(yes|no)
AC_ARG_ENABLE([debug], LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes])
[AS_HELP_STRING([--enable-debug=@<:@no|yes@:>@],
[enable debugging output @<:@default=yes@:>@])],
[],[enable_debug=yes])
AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes") AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes")
if test x"$enable_debug" = x"yes"; then if test x"$enable_debug" = x"yes"; then
AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled]) AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled])
@ -1806,18 +1803,18 @@ fi
AC_MSG_RESULT([$with_test_suite]) AC_MSG_RESULT([$with_test_suite])
AM_CONDITIONAL([WITH_TESTS], [test "$with_test_suite" = "yes"]) AM_CONDITIONAL([WITH_TESTS], [test "$with_test_suite" = "yes"])
AC_ARG_ENABLE([expensive-tests], LIBVIRT_ARG_ENABLE([EXPENSIVE_TESTS],
[AS_HELP_STRING([--enable-expensive-tests], [set the default for enabling expensive tests ]
[set the default for enabling expensive tests (gnulib and long timeouts) ] [(gnulib and long timeouts), use VIR_TEST_EXPENSIVE to ]
[@<:@default=check@:>@; use VIR_TEST_EXPENSIVE to override during make])], [override during make],
[case $enableval in [check])
case "$enable_expensive_tests" in
0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;; 0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;;
1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;; 1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;;
check) ;; check) ;;
*) AC_MSG_ERROR([bad value ${enableval} for enable-expensive-tests option]) *) AC_MSG_ERROR([bad value ${enable_expensive_tests} for enable-expensive-tests option]) ;;
;; esac
esac], [enableval=check]) if test "$enable_expensive_tests" = check; then
if test "$enableval" = check; then
if test -d $srcdir/.git ; then if test -d $srcdir/.git ; then
VIR_TEST_EXPENSIVE_DEFAULT=0 VIR_TEST_EXPENSIVE_DEFAULT=0
else else
@ -1827,17 +1824,13 @@ fi
AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT]) AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT])
AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1]) AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1])
AC_ARG_ENABLE([test-coverage], LIBVIRT_ARG_ENABLE([TEST_COVERAGE], [turn on code coverage instrumentation], [no])
[AS_HELP_STRING([--enable-test-coverage], case "$enable_test_coverage" in
[turn on code coverage instrumentation @<:@default=no@:>@])],
[case "${enableval}" in
yes|no) ;; yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-coverage option]) ;; *) AC_MSG_ERROR([bad value ${enable_test_coverga} for test-coverage option]) ;;
esac], esac
[enableval=no])
enable_coverage=$enableval
if test "${enable_coverage}" = yes; then if test "$enable_test_coverage" = yes; then
save_WARN_CFLAGS=$WARN_CFLAGS save_WARN_CFLAGS=$WARN_CFLAGS
WARN_CFLAGS= WARN_CFLAGS=
gl_WARN_ADD([-fprofile-arcs]) gl_WARN_ADD([-fprofile-arcs])
@ -1848,17 +1841,13 @@ if test "${enable_coverage}" = yes; then
WARN_CFLAGS=$save_WARN_CFLAGS WARN_CFLAGS=$save_WARN_CFLAGS
fi fi
AC_ARG_ENABLE([test-oom], LIBVIRT_ARG_ENABLE([TEST_OOM], [memory allocation failure checking], [no])
[AS_HELP_STRING([--enable-test-oom], case "$enable_test_oom" in
[memory allocation failure checking @<:@default=no@:>@])],
[case "${enableval}" in
yes|no) ;; yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-oom option]) ;; *) AC_MSG_ERROR([bad value ${enable_test_oom} for test-oom option]) ;;
esac], esac
[enableval=no])
enable_oom=$enableval
if test "${enable_oom}" = yes; then if test "$enable_test_oom" = yes; then
have_trace=yes have_trace=yes
AC_CHECK_HEADER([execinfo.h],[],[have_trace=no]) AC_CHECK_HEADER([execinfo.h],[],[have_trace=no])
AC_CHECK_FUNC([backtrace],[],[have_trace=no]) AC_CHECK_FUNC([backtrace],[],[have_trace=no])
@ -1868,22 +1857,17 @@ if test "${enable_oom}" = yes; then
AC_DEFINE([TEST_OOM], 1, [Whether malloc OOM checking is enabled]) AC_DEFINE([TEST_OOM], 1, [Whether malloc OOM checking is enabled])
fi fi
LIBVIRT_ARG_ENABLE([TEST_LOCKING], [thread locking tests using CIL], [no])
AC_ARG_ENABLE([test-locking], case "$enable_test_locking" in
[AS_HELP_STRING([--enable-test-locking],
[thread locking tests using CIL @<:@default=no@:>@])],
[case "${enableval}" in
yes|no) ;; yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-locking option]) ;; *) AC_MSG_ERROR([bad value ${enable_test_locking} for test-locking option]) ;;
esac], esac
[enableval=no])
enable_locking=$enableval
if test "$enable_locking" = "yes"; then if test "$enable_test_locking" = "yes"; then
LOCK_CHECKING_CFLAGS="-save-temps" LOCK_CHECKING_CFLAGS="-save-temps"
AC_SUBST([LOCK_CHECKING_CFLAGS]) AC_SUBST([LOCK_CHECKING_CFLAGS])
fi fi
AM_CONDITIONAL([WITH_CIL],[test "$enable_locking" = "yes"]) AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"])
dnl Enable building libvirtd? dnl Enable building libvirtd?
AM_CONDITIONAL([WITH_LIBVIRTD],[test "x$with_libvirtd" = "xyes"]) AM_CONDITIONAL([WITH_LIBVIRTD],[test "x$with_libvirtd" = "xyes"])
@ -2514,7 +2498,7 @@ AC_MSG_NOTICE([])
AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([Miscellaneous])
AC_MSG_NOTICE([]) AC_MSG_NOTICE([])
AC_MSG_NOTICE([ Debug: $enable_debug]) AC_MSG_NOTICE([ Debug: $enable_debug])
AC_MSG_NOTICE([ Use -Werror: $set_werror]) AC_MSG_NOTICE([ Use -Werror: $enable_werror])
AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS]) AC_MSG_NOTICE([ Warning Flags: $WARN_CFLAGS])
AC_MSG_NOTICE([ DTrace: $with_dtrace]) AC_MSG_NOTICE([ DTrace: $with_dtrace])
AC_MSG_NOTICE([ numad: $with_numad]) AC_MSG_NOTICE([ numad: $with_numad])

View File

@ -7,15 +7,15 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
dnl More compiler warnings dnl More compiler warnings
dnl ****************************** dnl ******************************
AC_ARG_ENABLE([werror], LIBVIRT_ARG_ENABLE([WERROR], [Use -Werror (if supported)], [check])
AS_HELP_STRING([--enable-werror], [Use -Werror (if supported)]), if test "$enable_werror" = "check"; then
[set_werror="$enableval"], if test -d $srcdir/.git; then
[if test -d $srcdir/.git; then
is_git_version=true is_git_version=true
set_werror=yes enable_werror=yes
else else
set_werror=no enable_werror=no
fi]) fi
fi
# List of warnings that are not relevant / wanted # List of warnings that are not relevant / wanted
@ -208,7 +208,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
wantwarn="$wantwarn -Wno-suggest-attribute=pure" wantwarn="$wantwarn -Wno-suggest-attribute=pure"
wantwarn="$wantwarn -Wno-suggest-attribute=const" wantwarn="$wantwarn -Wno-suggest-attribute=const"
if test "$set_werror" = "yes" if test "$enable_werror" = "yes"
then then
wantwarn="$wantwarn -Werror" wantwarn="$wantwarn -Werror"
fi fi