$NetBSD$

Defang bash 4.0 syntax in configure and check for sizeof(time_t).

upstream bugs
 - (bash) https://github.com/gluster/glusterfs/issues/3940
 - (sizeof(time_t)) https://github.com/gluster/glusterfs/issues/3942

--- configure.orig   2023-01-08 22:27:37.625063111 +0100
+++ configure    2023-01-08 22:26:52.017860403 +0100
@@ -778,6 +778,7 @@
 MATH_LIB
 YFLAGS
 YACC
+SIZEOF_TIME_T
 SIZEOF_LONG_LONG
 SIZEOF_LONG
 SIZEOF_INT
@@ -13640,6 +13641,43 @@
 
 
 
+# size of time_t
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if ${ac_cv_sizeof_time_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_time_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_time_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
+SIZEOF_TIME_T=$ac_cv_sizeof_time_t
+
+
 # YACC needs a check
 for ac_prog in 'bison -y' byacc
 do
@@ -20213,10 +20251,10 @@
 echo "Building with LTO    : $LTO_BUILD"
 echo
 
-# dnl Note: ${X^^} capitalization assumes bash >= 4.x
 if test "x$SANITIZER" != "xnone"; then
+        UC_SANITIZER=$(echo ${SANITIZER} | tr 'a-z' 'A-Z')
         echo "Note: since glusterfs processes are daemon processes, use"
-        echo "'export ${SANITIZER^^}_OPTIONS=log_path=/path/to/xxx.log' to collect"
+        echo "'export ${UC_SANITIZER}_OPTIONS=log_path=/path/to/xxx.log' to collect"
         echo "sanitizer output. Further details and more options can be"
         echo "found at https://github.com/google/sanitizers."
 fi
