diff -uwrN aria2-0.11.2.orig/configure.ac aria2-0.11.2/configure.ac --- aria2-0.11.2.orig/configure.ac 2007-08-09 09:09:19.000000000 -0700 +++ aria2-0.11.2/configure.ac 2007-08-10 11:42:11.497124500 -0700 @@ -141,7 +141,7 @@ AC_FUNC_SELECT_ARGTYPES AC_FUNC_STAT AC_FUNC_VPRINTF -AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify daemon ftruncate getcwd getpagesize inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo random rmdir select setlocale setmode sigaction sleep socket srandom stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul timegm usleep]) +AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify daemon ftruncate getcwd getpagesize inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo random rmdir select setlocale setmode sigaction sleep socket srandom stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul unsetenv usleep]) AC_CHECK_FUNCS([basename], [AM_CONDITIONAL([HAVE_BASENAME], true)], @@ -164,11 +164,16 @@ AC_CHECK_FUNCS([strptime], [AM_CONDITIONAL([HAVE_STRPTIME], true)], [AM_CONDITIONAL([HAVE_STRPTIME], false)]) +AC_CHECK_FUNCS([timegm], + [AM_CONDITIONAL([HAVE_TIMEGM], true)], + [AM_CONDITIONAL([HAVE_TIMEGM], false)]) case "$target" in *mingw*) - dnl true if _WIN32_WINNT >= 0x0501 + dnl defined in ws2tcpip.h, but only if _WIN32_WINNT >= 0x0501 AM_CONDITIONAL([HAVE_GETADDRINFO], true) + dnl defined in ws2tcpip.h, but missing in C:\mingw\lib\libws2_32.a + AM_CONDITIONAL([HAVE_GAI_STRERROR], false) ;; esac @@ -180,3 +185,19 @@ intl/Makefile doc/Makefile]) AC_OUTPUT + +echo " " +echo "Build: $build" +echo "Target: $target" +echo "Install prefix: $prefix" +echo "CFLAGS: $CFLAGS" +echo "CPPFLAGS: $CPPFLAGS" +echo "LDFLAGS: $LDFLAGS" +echo "LIBS: $LIBS" +echo "GnuTLS: $have_libgnutls" +echo "OpenSSL: $have_openssl" +echo "LibXML2: $have_libxml2" +echo "LibAres: $have_libares" +echo "LibCares: $have_libcares" +echo "Bittorrent: $enable_bittorrent" +echo "Metalink: $enable_metalink" diff -uwrN aria2-0.11.2.orig/src/DownloadCommand.cc aria2-0.11.2/src/DownloadCommand.cc --- aria2-0.11.2.orig/src/DownloadCommand.cc 2007-08-08 07:40:11.000000000 -0700 +++ aria2-0.11.2/src/DownloadCommand.cc 2007-08-10 11:42:11.512744400 -0700 @@ -71,11 +71,7 @@ // TODO we need to specify the sum of all segmentMan's download speed here. if(maxDownloadSpeedLimit > 0 && maxDownloadSpeedLimit < _requestGroup->getSegmentMan()->calculateDownloadSpeed()) { -#ifdef HAVE_USLEEP - usleep(1); -#else - _sleep(1); -#endif // HAVE_USLEEP + Util::usleep(1); e->commands.push_back(this); return false; } diff -uwrN aria2-0.11.2.orig/src/Platform.cc aria2-0.11.2/src/Platform.cc --- aria2-0.11.2.orig/src/Platform.cc 2007-07-31 09:45:16.000000000 -0700 +++ aria2-0.11.2/src/Platform.cc 2007-08-10 11:42:11.512744400 -0700 @@ -38,8 +38,16 @@ #ifdef HAVE_WINSOCK2_H +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x501 +#endif // _WIN32_WINNT +#include +#undef ERROR +#ifdef HAVE_WS2TCPIP_H +# include +#endif // HAVE_WS2TCPIP_H + #include "common.h" -#include "a2netcompat.h" #include "DlAbortEx.h" #include "Platform.h" diff -uwrN aria2-0.11.2.orig/src/Util.cc aria2-0.11.2/src/Util.cc --- aria2-0.11.2.orig/src/Util.cc 2007-08-08 07:40:11.000000000 -0700 +++ aria2-0.11.2/src/Util.cc 2007-08-10 11:42:11.512744400 -0700 @@ -38,6 +38,7 @@ #include "message.h" #include "SimpleRandomizer.h" #include "a2netcompat.h" +#include "a2time.h" #include #include #include @@ -45,6 +46,13 @@ #include #include +#ifndef HAVE_SLEEP +# ifdef HAVE_WINSOCK_H +# define WIN32_LEAN_AND_MEAN +# include +# endif // HAVE_WINSOCK_H +#endif // HAVE_SLEEP + template string uint2str(T value, bool comma) { string str; @@ -625,23 +633,8 @@ struct tm tm; memset(&tm, 0, sizeof(tm)); strptime(httpStdTime.c_str(), "%a, %Y-%m-%d %H:%M:%S GMT", &tm); -#ifdef HAVE_TIMEGM time_t thetime = timegm(&tm); return thetime; -#else - char *tz; - tz = getenv("TZ"); - putenv("TZ="); - tzset(); - time_t thetime = mktime(&tm); - if (tz) { - char s[256]; - snprintf(s, sizeof(s), "TZ=%s", tz); - putenv(s); - } - tzset(); - return thetime; -#endif // HAVE_TIMEGM } void Util::toStream(ostream& os, const FileEntries& fileEntries) @@ -657,3 +650,50 @@ os << "---+---------------------------------------------------------------------------" << "\n"; } } + +void Util::sleep(long seconds) { +#ifdef HAVE_SLEEP + sleep(seconds); +#elif defined(HAVE_USLEEP) + usleep(seconds * 1000000); +#elif defined(HAVE_WINSOCK2_H) + ::Sleep(seconds * 1000); +#else + #error no sleep function is available (nanosleep?) +#endif +} + +void Util::usleep(long microseconds) { +#ifdef HAVE_USLEEP + usleep(microseconds); +#elif defined(HAVE_WINSOCK2_H) + + LARGE_INTEGER current, freq, end; + + static enum {GET_FREQUENCY, GET_MICROSECONDS, SKIP_MICROSECONDS} state = GET_FREQUENCY; + + if (state == GET_FREQUENCY) { + if (QueryPerformanceFrequency(&freq)) + state = GET_MICROSECONDS; + else + state = SKIP_MICROSECONDS; + } + + long msec = microseconds / 1000; + microseconds %= 1000; + + if (state == GET_MICROSECONDS && microseconds) { + QueryPerformanceCounter(&end); + + end.QuadPart += (freq.QuadPart * microseconds) / 1000000; + + while (QueryPerformanceCounter(¤t) && (current.QuadPart <= end.QuadPart)) + /* noop */ ; + } + + if (msec) + Sleep(msec); +#else + #error no usleep function is available (nanosleep?) +#endif +} diff -uwrN aria2-0.11.2.orig/src/Util.h aria2-0.11.2/src/Util.h --- aria2-0.11.2.orig/src/Util.h 2007-08-08 07:40:11.000000000 -0700 +++ aria2-0.11.2/src/Util.h 2007-08-10 11:42:11.512744400 -0700 @@ -131,6 +131,10 @@ static time_t httpGMT(const string& httpTimeFormat); static void toStream(ostream& os, const FileEntries& entries); + + static void sleep(long seconds); + + static void usleep(long microseconds); }; #endif // _D_UTIL_H_ diff -uwrN aria2-0.11.2.orig/src/a2netcompat.h aria2-0.11.2/src/a2netcompat.h --- aria2-0.11.2.orig/src/a2netcompat.h 2007-08-08 08:26:19.000000000 -0700 +++ aria2-0.11.2/src/a2netcompat.h 2007-08-10 11:42:11.528364300 -0700 @@ -36,6 +36,28 @@ #include "a2io.h" +#ifndef __CYGWIN__ +# ifdef HAVE_WINSOCK2_H +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x501 +# endif // _WIN32_WINNT +# include +# undef ERROR +# endif // HAVE_WINSOCK2_H +# ifdef HAVE_WS2TCPIP_H +# include +# endif // HAVE_WS2TCPIP_H +#endif // !__CYGWIN__ + +#ifdef __MINGW32__ +# define SOCKOPT_T const char +# define HAVE_GETADDRINFO +# undef HAVE_GAI_STRERROR +# undef gai_strerror +#else +# define SOCKOPT_T socklen_t +#endif // __MINGW32__ + #ifdef HAVE_NETDB_H # include #endif // HAVE_NETDB_H @@ -60,33 +82,13 @@ # include "inet_aton.h" #endif // HAVE_INET_ATON -#ifdef HAVE_WINSOCK2_H -#ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x501 -#endif // _WIN32_WINNT -# include -# undef ERROR -#endif // HAVE_WINSOCK2_H - -#ifdef HAVE_WS2TCPIP_H -# include -#endif // HAVE_WS2TCPIP_H - -#ifdef __MINGW32__ -# define SOCKOPT_T const char -# undef HAVE_GETADDRINFO -# undef HAVE_GAI_STRERROR -# undef gai_strerror -#else -# define SOCKOPT_T socklen_t -#endif // __MINGW32__ +#ifndef HAVE_GETADDRINFO +# include "getaddrinfo.h" +# define HAVE_GAI_STRERROR +#endif // HAVE_GETADDRINFO #ifndef HAVE_GAI_STRERROR # include "gai_strerror.h" #endif // HAVE_GAI_STRERROR -#ifndef HAVE_GETADDRINFO -# include "getaddrinfo.h" -#endif // HAVE_GETADDRINFO - #endif // _D_A2NETCOMPAT_H_ diff -uwrN aria2-0.11.2.orig/src/a2time.h aria2-0.11.2/src/a2time.h --- aria2-0.11.2.orig/src/a2time.h 2007-07-31 09:45:16.000000000 -0700 +++ aria2-0.11.2/src/a2time.h 2007-08-10 11:42:11.528364300 -0700 @@ -49,4 +49,8 @@ # include "strptime.h" #endif // HAVE_STRPTIME +#ifndef HAVE_TIMEGM +# include "timegm.h" +#endif // HAVE_TIMEGM + #endif // _D_A2TIME_H_ diff -uwrN aria2-0.11.2.orig/src/gai_strerror.c aria2-0.11.2/src/gai_strerror.c --- aria2-0.11.2.orig/src/gai_strerror.c 2007-07-31 09:45:16.000000000 -0700 +++ aria2-0.11.2/src/gai_strerror.c 2007-08-10 11:42:11.528364300 -0700 @@ -26,16 +26,12 @@ * SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "gai_strerror.h" #ifdef ENABLE_NLS #include #endif -#include "gai_strerror.h" - #ifdef ENABLE_NLS #define _(string) gettext(string) #ifdef gettext_noop diff -uwrN aria2-0.11.2.orig/src/gai_strerror.h aria2-0.11.2/src/gai_strerror.h --- aria2-0.11.2.orig/src/gai_strerror.h 2007-07-31 09:45:16.000000000 -0700 +++ aria2-0.11.2/src/gai_strerror.h 2007-08-10 11:42:11.528364300 -0700 @@ -26,8 +26,8 @@ * SUCH DAMAGE. */ -#ifndef _D_GETADDRINFO_H -#define _D_GETADDRINFO_H +#ifndef _D_GAI_STRERROR_H +#define _D_GAI_STRERROR_H #ifdef __cplusplus extern "C" { @@ -131,7 +131,7 @@ * Fake struct and function names. * might declares all or some of them. */ -#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETNAMEINFO) || defined(HAVE_GAI_STRERROR) +#if defined(HAVE_GAI_STRERROR) #define gai_strerror my_gai_strerror #endif @@ -164,4 +164,4 @@ }; #endif /* __cplusplus */ -#endif /* not _D_GETADDRINFO_H */ +#endif /* not _D_GAI_STRERROR_H */ diff -uwrN aria2-0.11.2.orig/src/getaddrinfo.h aria2-0.11.2/src/getaddrinfo.h --- aria2-0.11.2.orig/src/getaddrinfo.h 2007-07-23 06:04:48.000000000 -0700 +++ aria2-0.11.2/src/getaddrinfo.h 2007-08-10 11:42:11.528364300 -0700 @@ -211,6 +211,8 @@ #define PF_UNSPEC PF_INET #endif +#ifndef __MINGW32__ + /* * struct addrinfo. */ @@ -225,6 +227,8 @@ struct addrinfo *ai_next; }; +#endif // __MINGW32__ + /* * Functions. */ diff -uwrN aria2-0.11.2.orig/src/gettimeofday.h aria2-0.11.2/src/gettimeofday.h --- aria2-0.11.2.orig/src/gettimeofday.h 2007-07-31 09:45:16.000000000 -0700 +++ aria2-0.11.2/src/gettimeofday.h 2007-08-10 11:42:11.543984200 -0700 @@ -36,6 +36,10 @@ #ifndef _D_GETTIMEOFDAY_H #define _D_GETTIMEOFDAY_H 1 +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + #include #ifdef __cplusplus diff -uwrN aria2-0.11.2.orig/src/localtime_r.c aria2-0.11.2/src/localtime_r.c --- aria2-0.11.2.orig/src/localtime_r.c 2007-07-31 09:45:16.000000000 -0700 +++ aria2-0.11.2/src/localtime_r.c 2007-08-10 11:42:11.543984200 -0700 @@ -35,6 +35,7 @@ #include #include + #ifdef __MINGW32__ #define WIN32_LEAN_AND_MEAN #include @@ -51,12 +52,9 @@ DeleteCriticalSection(&localtime_r_cs); } -#endif // __MINGW32__ - struct tm * localtime_r(const time_t *clock, struct tm *result) { static struct tm *local_tm; -#ifdef __MINGW32__ static int initialized = 0; if (!initialized) { @@ -69,7 +67,7 @@ local_tm = localtime(clock); memcpy(result, local_tm, sizeof(struct tm)); LeaveCriticalSection(&localtime_r_cs); -#endif // __MINGW32__ return result; }; +#endif // __MINGW32__ diff -uwrN aria2-0.11.2.orig/src/strptime.c aria2-0.11.2/src/strptime.c --- aria2-0.11.2.orig/src/strptime.c 2007-07-23 06:04:48.000000000 -0700 +++ aria2-0.11.2/src/strptime.c 2007-08-10 11:42:11.543984200 -0700 @@ -30,6 +30,18 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + +#ifndef HAVE_LOCALTIME_R +# include "localtime_r.h" +#endif // HAVE_LOCALTIME_R + +#ifndef HAVE_TIMEGM +# include "timegm.h" +#endif // HAVE_TIMEGM + #include #include #include @@ -37,6 +49,14 @@ #include #include +#ifdef HAVE_ALLOCA_H +# include +#endif // HAVE_ALLOCA_H + +#ifdef HAVE_MALLOC_H +# include +#endif // HAVE_MALLOC_H + #include "strptime.h" static const char *abb_weekdays[] = { @@ -198,8 +218,8 @@ /* strptime: roken */ //extern "C" -char * -strptime (const char *buf, const char *format, struct tm *timeptr) +static char * +_strptime (const char *buf, const char *format, struct tm *timeptr, int *gmt) { char c; @@ -414,7 +434,29 @@ buf = s; break; case 'Z' : - /* Unsupported. Just ignore. */ + /* source: cygwin-1.5.24-2-src/cygwin-1.5.24-2/winsup/cygwin/libc/strptime.cc */ + { + const char *cp; + char *zonestr; + + for (cp = buf; *cp && isupper((unsigned char)*cp); ++cp) {/*empty*/} + if (cp - buf) { + zonestr = (char *) alloca(cp - buf + 1); + strncpy(zonestr, buf, cp - buf); + zonestr[cp - buf] = '\0'; + tzset(); + if (0 == strcmp(zonestr, "GMT")) { + *gmt = 1; + } else if (0 == strcmp(zonestr, tzname[0])) { + timeptr->tm_isdst = 0; + } else if (0 == strcmp(zonestr, tzname[1])) { + timeptr->tm_isdst = 1; + } else { + return 0; + } + buf += cp - buf; + } + } break; case '\0' : --format; @@ -441,3 +483,19 @@ } return (char *)buf; } + +char * +strptime (const char *buf, const char *format, struct tm *timeptr) +{ + char *ret; + int gmt; + + gmt = 0; + ret = _strptime(buf, format, timeptr, &gmt); + if (ret && gmt) { + time_t t = timegm(timeptr); + localtime_r(&t, timeptr); + } + + return (ret); +} diff -uwrN aria2-0.11.2.orig/src/strptime.h aria2-0.11.2/src/strptime.h --- aria2-0.11.2.orig/src/strptime.h 2007-07-23 06:04:48.000000000 -0700 +++ aria2-0.11.2/src/strptime.h 2007-08-10 11:42:11.543984200 -0700 @@ -36,12 +36,12 @@ #ifndef _D_STRPTIME_H #define _D_STRPTIME_H +#include + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include - char * strptime (const char *buf, const char *format, struct tm *timeptr); #ifdef __cplusplus diff -uwrN aria2-0.11.2.orig/src/timegm.c aria2-0.11.2/src/timegm.c --- aria2-0.11.2.orig/src/timegm.c 1969-12-31 16:00:00.000000000 -0800 +++ aria2-0.11.2/src/timegm.c 2007-08-10 11:42:11.559604100 -0700 @@ -0,0 +1,71 @@ +/* timegm.c - libc replacement function + * Copyright (C) 2004 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ + +/* + timegm() is a GNU function that might not be available everywhere. + It's basically the inverse of gmtime() - you give it a struct tm, + and get back a time_t. It differs from mktime() in that it handles + the case where the struct tm is UTC and the local environment isn't. + + Some BSDs don't handle the putenv("foo") case properly, so we use + unsetenv if the platform has it to remove environment variables. +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + +#include +#include +#include + +time_t +timegm(struct tm *tm) +{ + time_t answer; + char *zone; + + zone=getenv("TZ"); + putenv("TZ=UTC"); + tzset(); + answer=mktime(tm); + if(zone) + { + char *old_zone; + + old_zone=malloc(3+strlen(zone)+1); + if(old_zone) + { + strcpy(old_zone,"TZ="); + strcat(old_zone,zone); + putenv(old_zone); + } + } + else +#ifdef HAVE_UNSETENV + unsetenv("TZ"); +#else + putenv("TZ="); +#endif + + tzset(); + return answer; +} diff -uwrN aria2-0.11.2.orig/src/timegm.h aria2-0.11.2/src/timegm.h --- aria2-0.11.2.orig/src/timegm.h 1969-12-31 16:00:00.000000000 -0800 +++ aria2-0.11.2/src/timegm.h 2007-08-10 11:42:11.590843900 -0700 @@ -0,0 +1,57 @@ +/* + * aria2 - The high speed download utility + * + * Copyright (C) 2006 Tatsuhiro Tsujikawa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * In addition, as a special exception, the copyright holders give + * permission to link the code of portions of this program with the + * OpenSSL library under certain conditions as described in each + * individual source file, and distribute linked combinations + * including the two. + * You must obey the GNU General Public License in all respects + * for all of the code used other than OpenSSL. If you modify + * file(s) with this exception, you may extend this exception to your + * version of the file(s), but you are not obligated to do so. If you + * do not wish to do so, delete this exception statement from your + * version. If you delete this exception statement from all source + * files in the program, then also delete it here. + */ +/* copyright --> */ +#ifndef _D_TIMEGM_H_ +#define _D_TIMEGM_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +#ifndef HAVE_TIMEGM + +time_t timegm(struct tm *tm); + +#endif // HAVE_TIMEGM + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif // _D_TIMEGM_H_ diff -uwrN aria2-0.11.2.orig/test/TimeSeedCriteriaTest.cc aria2-0.11.2/test/TimeSeedCriteriaTest.cc --- aria2-0.11.2.orig/test/TimeSeedCriteriaTest.cc 2007-07-23 07:09:46.000000000 -0700 +++ aria2-0.11.2/test/TimeSeedCriteriaTest.cc 2007-08-10 11:42:11.590843900 -0700 @@ -1,4 +1,5 @@ #include "TimeSeedCriteria.h" +#include "Util.h" #include #include @@ -18,11 +19,7 @@ void TimeSeedCriteriaTest::testEvaluate() { TimeSeedCriteria cri(1); -#ifdef HAVE_SLEEP - sleep(1); -#else - _sleep(1); -#endif + Util::sleep(1); CPPUNIT_ASSERT(cri.evaluate()); cri.reset(); cri.setDuration(10); --- aria2-0.11.2.orig/ChangeLog 2007-08-09 09:09:19.000000000 -0700 +++ aria2-0.11.2/ChangeLog 2007-08-10 12:15:12.458436800 -0700 @@ -1,3 +1,32 @@ +2007-08-10 Ross Smith II + + Move sleep functions to Util class: + * src/Util.cc + (sleep): New function. + (usleep): New function. + * src/DownloadCommand.cc: sleep -> Util::sleep + * test/TimeSeedCriteriaTest.cc: sleep -> Util::sleep + + MinGW build enhancements. The following files are added: + * src/timegm.{c,h} + + Changes to support the above new files: + * configure.ac + * src/Makefile.am + * src/a2time.h + * src/Util.cc: + * src/strptime.c: Added support for %Z option. + + Miscellenous build fixes/enhancements. + * configure.ac: Added summary report. + * src/Platform.h: Tweaked #include's. + * src/a2netcompat.h: Tweaked #include's. + * src/strptime.h: Tweaked #include's. + * src/gai_strerror.c: Tweaked #include's. + * src/gai_strerror.h: _D_GETADDRINFO_H -> _D_GAI_STRERROR_H + * src/getaddrinfo.h: Moved #ifndef __MINGW32__ + * src/gettimeofday.h: Added HAVE_CONFIG_H + 2007-08-09 Tatsuhiro Tsujikawa Increased the initial connection size in BitTorrent download to 40. --- aria2-0.11.2/src/Makefile.am.bak Wed Aug 8 07:40:11 2007 +++ aria2-0.11.2/src/Makefile.am Fri Aug 10 12:40:34 2007 @@ -260,6 +260,10 @@ SRCS += strptime.c strptime.h endif # !HAVE_STRPTIME +if !HAVE_TIMEGM +SRCS += timegm.c timegm.h +endif # !HAVE_TIMEGM + noinst_LIBRARIES = libaria2c.a libaria2c_a_SOURCES = $(SRCS) aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\