summaryrefslogtreecommitdiff
path: root/gphoto-m4
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2020-02-18 20:58:47 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2020-02-19 05:08:08 +0100
commitb56a50827ffdc43dd3b6a32898f8f184eeea7234 (patch)
tree329c3798d73978087339e92e011336af67c8dcac /gphoto-m4
parent2b294a074c9212a347ef0cd914c8286f1e578469 (diff)
downloadlibgphoto2-b56a50827ffdc43dd3b6a32898f8f184eeea7234.tar.gz
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.
Diffstat (limited to 'gphoto-m4')
-rw-r--r--gphoto-m4/gp-camlibs.m48
-rw-r--r--gphoto-m4/gp-progs.m48
-rw-r--r--gphoto-m4/gp-sleep.m428
3 files changed, 39 insertions, 5 deletions
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: