Просмотр исходного кода

Test for timegm in configure.
Author: doogie
Date: 2002-11-22 07:15:23 GMT
Test for timegm in configure.

Arch Librarian лет назад: 22
Родитель
Сommit
41b6caf4a9
5 измененных файлов с 17 добавлено и 2 удалено
  1. 8 2
      apt-pkg/contrib/strutl.cc
  2. 3 0
      buildlib/config.h.in
  3. 1 0
      buildlib/environment.mak.in
  4. 4 0
      configure.in
  5. 1 0
      debian/changelog

+ 8 - 2
apt-pkg/contrib/strutl.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: strutl.cc,v 1.45 2002/04/26 05:52:27 jgg Exp $
+// $Id: strutl.cc,v 1.46 2002/11/22 07:15:23 doogie Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    String Util - Some useful string functions.
    String Util - Some useful string functions.
@@ -33,6 +33,8 @@
 #include <errno.h>
 #include <errno.h>
 #include <stdarg.h>
 #include <stdarg.h>
 
 
+#include "config.h"
+
 using namespace std;
 using namespace std;
 									/*}}}*/
 									/*}}}*/
 
 
@@ -712,7 +714,11 @@ static int MonthConv(char *Month)
    
    
    Contributed by Roger Beeman <beeman@cisco.com>, with the help of
    Contributed by Roger Beeman <beeman@cisco.com>, with the help of
    Mark Baushke <mdb@cisco.com> and the rest of the Gurus at CISCO. */
    Mark Baushke <mdb@cisco.com> and the rest of the Gurus at CISCO. */
-#ifndef __USE_MISC        // glib sets this
+
+/* Turned it into an autoconf check, because GNU is not the only thing which
+   can provide timegm. -- 2002-09-22, Joel Baker */
+
+#ifndef HAVE_TIMEGM // Now with autoconf!
 static time_t timegm(struct tm *t)
 static time_t timegm(struct tm *t)
 {
 {
    time_t tl, tb;
    time_t tl, tb;

+ 3 - 0
buildlib/config.h.in

@@ -16,6 +16,9 @@
 /* The number of bytes in a unsigned short.  */
 /* The number of bytes in a unsigned short.  */
 #undef SIZEOF_SHORT
 #undef SIZEOF_SHORT
 
 
+/* Define if we have the timegm() function */
+#undef HAVE_TIMEGM
+
 /* These two are used by the statvfs shim for glibc2.0 and bsd */
 /* These two are used by the statvfs shim for glibc2.0 and bsd */
 /* Define if we have sys/vfs.h */
 /* Define if we have sys/vfs.h */
 #undef HAVE_VFS_H
 #undef HAVE_VFS_H

+ 1 - 0
buildlib/environment.mak.in

@@ -55,6 +55,7 @@ DB2LIB = @DB2LIB@
 # Shim Headerfile control
 # Shim Headerfile control
 HAVE_C9X = @HAVE_C9X@
 HAVE_C9X = @HAVE_C9X@
 HAVE_STATVFS = @HAVE_STATVFS@
 HAVE_STATVFS = @HAVE_STATVFS@
+HAVE_TIMEGM = @HAVE_TIMEGM@
 NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
 NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
 
 
 # Shared library things
 # Shared library things

+ 4 - 0
configure.in

@@ -92,6 +92,10 @@ if test x"$HAVE_STATVFS" != x"yes"; then
    ])
    ])
 fi
 fi
 
 
+dnl We should use the real timegm function if we have it.
+AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM))
+AC_SUBST(HAVE_TIMEGM)
+
 dnl Check the sizes etc. of the architecture
 dnl Check the sizes etc. of the architecture
 dnl This is stupid, it should just use the AC macros like it does below
 dnl This is stupid, it should just use the AC macros like it does below
 dnl Cross compilers can either get a real C library or preload the cache
 dnl Cross compilers can either get a real C library or preload the cache

+ 1 - 0
debian/changelog

@@ -70,6 +70,7 @@ apt (0.5.5) unstable; urgency=low
   * Change verbose logging output of apt-ftparchive to go to stderr,
   * Change verbose logging output of apt-ftparchive to go to stderr,
     instead of stdout.  Also, errors that occur no longer go to stdout,
     instead of stdout.  Also, errors that occur no longer go to stdout,
     but stderr.  Closes: #161592
     but stderr.  Closes: #161592
+  * Test for timegm in configure.  Closes: #165516.
 
 
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600
  -- Jason Gunthorpe <jgg@debian.org>  Sun, 15 Sep 2002 17:16:59 -0600