From b56a50827ffdc43dd3b6a32898f8f184eeea7234 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Tue, 18 Feb 2020 20:58:47 +0100 Subject: 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. --- .travis-script.sh | 3 +-- gphoto-m4/gp-camlibs.m4 | 8 ++++---- gphoto-m4/gp-progs.m4 | 8 +++++++- gphoto-m4/gp-sleep.m4 | 28 ++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 gphoto-m4/gp-sleep.m4 diff --git a/.travis-script.sh b/.travis-script.sh index 6c9297faa..e6ebe7514 100644 --- a/.travis-script.sh +++ b/.travis-script.sh @@ -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 diff --git a/gphoto-m4/gp-camlibs.m4 b/gphoto-m4/gp-camlibs.m4 index 2706677f5..cf081e896 100644 --- a/gphoto-m4/gp-camlibs.m4 +++ b/gphoto-m4/gp-camlibs.m4 @@ -157,7 +157,7 @@ AC_MSG_WARN([ # * or even better, just build the standard set of camlibs. # #=====================================================================# ]) -${SLEEP} 5 +GP_SLEEP([5]) ]) dnl dnl @@ -240,7 +240,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 @@ -300,7 +300,7 @@ do # 'standard' instead. # #=============================================================# ]) - ${SLEEP} 5 + GP_SLEEP([5]) gp_camlib="standard" ;; esac @@ -430,7 +430,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]) diff --git a/gphoto-m4/gp-progs.m4 b/gphoto-m4/gp-progs.m4 index 90f239097..beae29b3e 100644 --- a/gphoto-m4/gp-progs.m4 +++ b/gphoto-m4/gp-progs.m4 @@ -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 diff --git a/gphoto-m4/gp-sleep.m4 b/gphoto-m4/gp-sleep.m4 new file mode 100644 index 000000000..2c4014892 --- /dev/null +++ b/gphoto-m4/gp-sleep.m4 @@ -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: -- cgit v1.2.1