configure: Set SLEEP=no now to disable warning sleeps

Allow setting SLEEP=no to disable sleep on warnings like

    ../configure SLEEP=no --prefix=/foo/bar ...

This is implemented with GP_SLEEP and gp_sleep similar to
m4sh's AS_ECHO and $as_echo.
This commit is contained in:
Hans Ulrich Niedermann
2020-02-18 20:58:47 +01:00
parent 06238d4641
commit 3a6f430406
4 changed files with 40 additions and 7 deletions

View File

@@ -22,9 +22,8 @@ rel_builddir="_build-${buildid}"
mkdir "${rel_builddir}"
cd "${rel_builddir}"
SLEEP="$(which true)"
if ../configure SLEEP="$SLEEP" --prefix="$abs_prefixdir" "$@"
if ../configure SLEEP=no --prefix="$abs_prefixdir" "$@"
then
echo "Configure successful."
else

View File

@@ -153,7 +153,7 @@ AC_MSG_WARN([
# * or even better, just build the standard set of camlibs. #
#=====================================================================#
])
${SLEEP} 5
GP_SLEEP([5])
])
dnl
dnl
@@ -235,7 +235,7 @@ AS_VAR_IF([gp_sh_with_camlibs], [canon], [dnl
# Autoselecting the 'ptp2' driver in addition to the 'canon' #
# driver to prevent unnecessary support requests. #
#==============================================================#
${SLEEP} 5
GP_SLEEP([5])
])])dnl
dnl set -x
@@ -295,7 +295,7 @@ do
# 'standard' instead. #
#=============================================================#
])
${SLEEP} 5
GP_SLEEP([5])
gp_camlib="standard"
;;
esac
@@ -425,7 +425,7 @@ AS_IF([test "x$gp_camlib_set_skipping" = "x"], [dnl
# you insist on building these camlibs. #
#=========================================================#
])
${SLEEP} 5
GP_SLEEP([5])
])
GP_SET_SPACE_VAR([camlib-set], [gp_camlib_set])

View File

@@ -65,7 +65,13 @@ dnl ####################################################################
m4_pattern_forbid([GP_PROG_SLEEP])dnl
AC_DEFUN_ONCE([GP_PROG_SLEEP],[dnl
AC_ARG_VAR([SLEEP], [sleep delay command])dnl
AC_PATH_PROG([SLEEP], [sleep])dnl
AC_MSG_CHECKING([whether to sleep])
AS_VAR_IF([SLEEP], [no], [dnl
AC_MSG_RESULT([no])
], [dnl
AC_MSG_RESULT([yes])
AC_PATH_PROG([SLEEP], [sleep])dnl
])dnl
])dnl
dnl
dnl

28
gphoto-m4/gp-sleep.m4 Normal file
View File

@@ -0,0 +1,28 @@
dnl ####################################################################
dnl GP_SLEEP(delay_in_whole_seconds)
dnl If the SLEEP variable is set to "no" or empty or is unset,
dnl do not sleep.
dnl If the SLEEP variable is set to something else, run that something
dnl else with the given delay value.
dnl ####################################################################
AC_DEFUN_ONCE([_GP_SLEEP_INIT], [dnl
AC_REQUIRE([GP_PROG_SLEEP])dnl
AS_IF([test "x$SLEEP" != "x" && test "x$SLEEP" != "xno"], [dnl
gp_sleep=[$]SLEEP
], [dnl
gp_sleep=:
])
])dnl
dnl
dnl
AC_DEFUN([GP_SLEEP], [dnl
AC_REQUIRE([_GP_SLEEP_INIT])dnl
$gp_sleep $1
])dnl
dnl
dnl
dnl ####################################################################
dnl
dnl Local Variables:
dnl mode: autoconf
dnl End: