(argmatch_invalid): Remove double quotes from the
[gnulib.git] / m4 / mktime.m4
index 5314c63..10e02db 100644 (file)
@@ -1,13 +1,13 @@
-#serial 1000
+#serial 1001
 
 dnl Just like mktime.m4 from automake-1.3b, but with an additional test.
+dnl Renamed to have jm_ prefix and to use jm_ prefix on cache variable names.
 
-undefine([AM_FUNC_MKTIME])
-AC_DEFUN(AM_FUNC_MKTIME,
+AC_DEFUN(jm_AM_FUNC_MKTIME,
 [AC_REQUIRE([AC_HEADER_TIME])dnl
  AC_CHECK_HEADERS(sys/time.h unistd.h)
  AC_CHECK_FUNCS(alarm)
- AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
+ AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
   [AC_TRY_RUN(
 changequote(<<, >>)dnl
 <</* Test program from Paul Eggert (eggert@twinsun.com)
@@ -50,7 +50,12 @@ spring_forward_gap ()
 {
   /* glibc (up to about 1998-10-07) failed this test) */
   struct tm tm;
-  putenv ("TZ=America/Vancouver");
+
+  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+     instead of "TZ=America/Vancouver" in order to detect the bug even
+     on systems that don't support the Olson extension, or don't have the
+     full zoneinfo tables installed.  */
+  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
   tm.tm_year = 98;
   tm.tm_mon = 3;
   tm.tm_mday = 5;
@@ -127,6 +132,7 @@ main ()
   time_t t, delta;
   int i, j;
 
+  spring_forward_gap ();
   for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
     continue;
   time_t_max--;
@@ -146,16 +152,15 @@ main ()
       bigtime_test (j - 1);
     }
   irix_6_4_bug ();
-  spring_forward_gap ();
   exit (0);
 }
              >>,
 changequote([, ])dnl
-            am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
+            jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
             dnl When crosscompiling, assume mktime is missing or broken.
-            am_cv_func_working_mktime=no)
+            jm_am_cv_func_working_mktime=no)
   ])
-  if test $am_cv_func_working_mktime = no; then
+  if test $jm_am_cv_func_working_mktime = no; then
     LIBOBJS="$LIBOBJS mktime.o"
   fi
 ])