bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strftime LGPL depends on GPL modules


From: Paul Eggert
Subject: Re: strftime LGPL depends on GPL modules
Date: Sun, 03 Jul 2005 22:16:15 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Patrice Dumas <address@hidden> writes:

> strftime which may be LGPL depends on tzset which dependes on
> gettimeofday and both are GPL.

Thanks for reporting that.  That dependency exists only for support of
Solaris 2.5.1 and Solaris 2.6.  I suppose we could create a
strftime-lgpl module but since it's only ancient hosts we're talking
about I decided instead to break the dependency, and to assume that
people who still need to support those old systems can also use the
tzset module directly.  I installed this patch, both in gnulib and in
coreutils (the latter with the obvious change to prereq.m4 to require
the tzset module).

2005-07-03  Paul Eggert  <address@hidden>

        Remove the dependency of the strftime module on the tzset module.
        * lib/strftime.c (my_strftime)
        [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
        Copy the input structure, to work around some of the bug with
        Solaris 2.5.1 and Solaris 2.6.  If you still care about these old
        Solaris releases, you should also use the tzset module, but we won't
        require it as a dependency any more since we don't want LGPLed code
        to depend on GPLed code.
        * m4/strftime.m4 (gl_FUNC_STRFTIME): Don't require
        gl_FUNC_TZSET_CLOBBER.
        * modules/strftime (Depends-on): Remove dependency on tzset.

Index: lib/strftime.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/strftime.c,v
retrieving revision 1.83
diff -p -u -r1.83 strftime.c
--- lib/strftime.c      14 May 2005 06:03:58 -0000      1.83
+++ lib/strftime.c      4 Jul 2005 04:38:59 -0000
@@ -373,13 +373,6 @@ static CHAR_T const month_name[][10] =
 # define ns 0
 #endif
 
-#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST
-/* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned
-   by localtime.  On such systems, we must use the tzset and localtime
-   wrappers to work around the bug.  */
-"you must run the autoconf test for a working tzset function"
-#endif
-
 
 /* Write information from TP into S according to the format
    string FORMAT, writing no more that MAXSIZE characters
@@ -439,6 +432,15 @@ my_strftime (CHAR_T *s, size_t maxsize, 
   const char *format_end = NULL;
 #endif
 
+#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST
+  /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned
+     by localtime.  On such systems, we must either use the tzset and
+     localtime wrappers to work around the bug (which sets
+     HAVE_RUN_TZSET_TEST) or make a copy of the structure.  */
+  struct tm copy = *tp;
+  tp = &copy;
+#endif
+
   zone = NULL;
 #if HAVE_TM_ZONE
   /* The POSIX test suite assumes that setting
Index: m4/strftime.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/strftime.m4,v
retrieving revision 1.33
diff -p -u -r1.33 strftime.m4
--- m4/strftime.m4      21 Mar 2005 22:06:27 -0000      1.33
+++ m4/strftime.m4      4 Jul 2005 04:38:59 -0000
@@ -1,4 +1,4 @@
-#serial 24
+#serial 25
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 # Free Software Foundation, Inc.
@@ -29,7 +29,6 @@ AC_DEFUN([gl_FUNC_STRFTIME],
  AC_REQUIRE([AC_HEADER_TIME])
  AC_REQUIRE([AC_TYPE_MBSTATE_T])
  AC_REQUIRE([gl_TM_GMTOFF])
- AC_REQUIRE([gl_FUNC_TZSET_CLOBBER])
 
  AC_CHECK_FUNCS_ONCE(mblen mbrlen mempcpy tzset)
  AC_CHECK_HEADERS_ONCE(sys/time.h wchar.h)
Index: modules/strftime
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/strftime,v
retrieving revision 1.13
diff -p -u -r1.13 strftime
--- modules/strftime    6 May 2005 17:22:45 -0000       1.13
+++ modules/strftime    4 Jul 2005 04:38:59 -0000
@@ -10,7 +10,6 @@ m4/strftime.m4
 
 Depends-on:
 time_r
-tzset
 stdbool
 
 configure.ac:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]