summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 17:00:00 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 17:00:00 +0000
commit41b6caf4a956cd9d6032aafa87cc75ac7c94b6a5 (patch)
treed1aaa3d34d22db913ff202aa6bf6eadd21602319
parent1e8167a643bcbdf2433ae531442b456ca6fdb6ee (diff)
Test for timegm in configure.
Author: doogie Date: 2002-11-22 07:15:23 GMT Test for timegm in configure.
-rw-r--r--apt-pkg/contrib/strutl.cc10
-rw-r--r--buildlib/config.h.in3
-rw-r--r--buildlib/environment.mak.in1
-rw-r--r--configure.in4
-rw-r--r--debian/changelog1
5 files changed, 17 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index f8fbf3212..b37cdd1bd 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// 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.
@@ -33,6 +33,8 @@
#include <errno.h>
#include <stdarg.h>
+#include "config.h"
+
using namespace std;
/*}}}*/
@@ -712,7 +714,11 @@ static int MonthConv(char *Month)
Contributed by Roger Beeman <beeman@cisco.com>, with the help of
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)
{
time_t tl, tb;
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 961dc4261..8a65a229a 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -16,6 +16,9 @@
/* The number of bytes in a unsigned 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 */
/* Define if we have sys/vfs.h */
#undef HAVE_VFS_H
diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
index bf676e643..87f4336e2 100644
--- a/buildlib/environment.mak.in
+++ b/buildlib/environment.mak.in
@@ -55,6 +55,7 @@ DB2LIB = @DB2LIB@
# Shim Headerfile control
HAVE_C9X = @HAVE_C9X@
HAVE_STATVFS = @HAVE_STATVFS@
+HAVE_TIMEGM = @HAVE_TIMEGM@
NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
# Shared library things
diff --git a/configure.in b/configure.in
index 67c5f046a..a0ade1c28 100644
--- a/configure.in
+++ b/configure.in
@@ -92,6 +92,10 @@ if test x"$HAVE_STATVFS" != x"yes"; then
])
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 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
diff --git a/debian/changelog b/debian/changelog
index eecbc6128..570ad38ed 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -70,6 +70,7 @@ apt (0.5.5) unstable; urgency=low
* Change verbose logging output of apt-ftparchive to go to stderr,
instead of stdout. Also, errors that occur no longer go to stdout,
but stderr. Closes: #161592
+ * Test for timegm in configure. Closes: #165516.
-- Jason Gunthorpe <jgg@debian.org> Sun, 15 Sep 2002 17:16:59 -0600