Merge branch 'mingw' of https://github.com/elieux/aria2 into elieux-mingw

pull/454/head
Tatsuhiro Tsujikawa 2015-07-19 16:30:39 +09:00
commit f6f3bd3c3a
2 changed files with 31 additions and 11 deletions

View File

@ -29,9 +29,10 @@ case "$host" in
*mingw*) *mingw*)
win_build=yes win_build=yes
LIBS="$LIBS -lws2_32 -lwsock32 -lgdi32 -lwinmm -liphlpapi -lpsapi" LIBS="$LIBS -lws2_32 -lwsock32 -lgdi32 -lwinmm -liphlpapi -lpsapi"
# C++ headers defines __USE_MINGW_ANSI_STDIO to 1 unconditionally. # Define _POSIX_C_SOURCE to 1. This makes {asc,local}time_r available
# We have to use it as well nonetheless. # from <time.h> even without (un)helpful interference from <pthread.h>,
CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS" # and also defines __USE_MINGW_ANSI_STDIO.
CPPFLAGS="-D_POSIX_C_SOURCE=1 $CPPFLAGS"
# Build with ASLR (dynamicbase) and NX compatiblity (nxcompat) # Build with ASLR (dynamicbase) and NX compatiblity (nxcompat)
# Enable pie once upstream/binutils gets fixed to produce correct binaries with it. # Enable pie once upstream/binutils gets fixed to produce correct binaries with it.
LDFLAGS="$LDFLAGS -Wl,--dynamicbase -Wl,--nxcompat" LDFLAGS="$LDFLAGS -Wl,--dynamicbase -Wl,--nxcompat"
@ -851,10 +852,32 @@ AM_CONDITIONAL([HAVE_SOME_FALLOCATE],
[test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \ [test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \
|| test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"]) || test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"])
AC_MSG_CHECKING([for asctime_r])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <time.h>
]], [[
struct tm r; char *c;
asctime_r(&r, c);
]])],
[AM_CONDITIONAL([HAVE_ASCTIME_R], true)
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_ASCTIME_R], [1], [Define to 1 if you have the `asctime_r' function or macro.])],
[AC_MSG_RESULT([no])
AM_CONDITIONAL([HAVE_ASCTIME_R], false)])
AC_MSG_CHECKING([for localtime_r])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <time.h>
]], [[
time_t t; struct tm r;
localtime_r(&t, &r);
]])],
[AM_CONDITIONAL([HAVE_LOCALTIME_R], true)
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_LOCALTIME_R], [1], [Define to 1 if you have the `localtime_r' function or macro.])],
[AC_MSG_RESULT([no])
AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
AC_CHECK_FUNCS([asctime_r],
[AM_CONDITIONAL([HAVE_ASCTIME_R], true)],
[AM_CONDITIONAL([HAVE_ASCTIME_R], false)])
AC_CHECK_FUNCS([basename], AC_CHECK_FUNCS([basename],
[AM_CONDITIONAL([HAVE_BASENAME], true)], [AM_CONDITIONAL([HAVE_BASENAME], true)],
[AM_CONDITIONAL([HAVE_BASENAME], false)]) [AM_CONDITIONAL([HAVE_BASENAME], false)])
@ -867,9 +890,6 @@ AC_CHECK_FUNCS([getaddrinfo],
AC_CHECK_FUNCS([gettimeofday], AC_CHECK_FUNCS([gettimeofday],
[AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)], [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)],
[AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)]) [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)])
AC_CHECK_FUNCS([localtime_r],
[AM_CONDITIONAL([HAVE_LOCALTIME_R], true)],
[AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
AC_CHECK_FUNCS([strptime], AC_CHECK_FUNCS([strptime],
[AM_CONDITIONAL([HAVE_STRPTIME], true)], [AM_CONDITIONAL([HAVE_STRPTIME], true)],
[AM_CONDITIONAL([HAVE_STRPTIME], false)]) [AM_CONDITIONAL([HAVE_STRPTIME], false)])

View File

@ -713,9 +713,9 @@ endif # !ENABLE_LIBARIA2
libaria2_la_SOURCES = $(SRCS) libaria2_la_SOURCES = $(SRCS)
libaria2_la_LIBADD = @WSLAY_LIBS@ libaria2_la_LIBADD = @WSLAY_LIBS@ @LTLIBINTL@
LDADD = libaria2.la @LIBINTL@ @ALLOCA@ #-lprofiler LDADD = libaria2.la @ALLOCA@ #-lprofiler
#aria2c_LDFLAGS = -pg #aria2c_LDFLAGS = -pg
AM_CPPFLAGS = -Wall\ AM_CPPFLAGS = -Wall\
-I$(top_srcdir)/lib -I$(top_srcdir)/intl\ -I$(top_srcdir)/lib -I$(top_srcdir)/intl\