aria2/configure.ac
Tatsuhiro Tsujikawa 46e8c332cd 2007-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make a2netcompat.h include a2io.h to fix compilation error:
	* src/a2netcompat.h
	* src/SocketCore.cc: Removed include of a2io.h
	* src/Util.cc: Removed include of a2io.h
	
	Gather time related functions to a2time.h:
	* src/a2time.h: New file.
	* src/DefaultPeerStorage.cc
	* src/SimpleLogger.cc
	* src/Util.{h, cc}
	* src/SimpleRandomizer.h
	* src/TimeA2.{h,cc}
	* src/DownloadCommand.cc
	* src/main.cc

	Removed #ifdef __MINGW32__ since gai_strerror is included in
	a2netcompat.h:
	* src/NameResolver.cc
	
	Fixed compilation error without openssl:
	* src/SocketCore.{h,cc}: Moved include of openssl/err.h to 
SocketCore.h

	Added default block to suppress compiler warnings:
	* src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator())
	
2007-07-26  Ross Smith II  <aria2spam at smithii dot com>

	MinGW build enhancements. The following files are added:
	* src/gai_strerror.{c,h}
	* src/gettimeofday.{c,h}

	Changes to support the above new files:
	* configure.ac
	* src/Makefile.am
	* src/a2netcompat.h
	* src/TimeA2.cc
	* src/DefaultPeerStorage.cc
	* src/NameResolver.cc: removed mingw_strerror() function.
	* src/SocketCore.cc: removed mingw_strerror() function.

	Miscellaneous MinGW build fixes. 
	* src/a2io.h: Use _lseeki64() instead of lseek()
	* src/common.h
	* src/DefaultFileAllocator.cc
	* src/GlowFileAllocator.cc
	* src/main.cc: Moved #include "prefs.h" to quiet compile error.
	* src/NameResolver.cc
	(callback): Changed int32_t to int.
	(resolve): Changed int32_t to int.
	* src/Platform.cc
	* src/Platform.h
	* test/MultiDiskWriterTest.cc
	* test/PeerMessageUtilTest.cc
	* src/localtime_r.c: Add DeleteCriticalSection() and at exit().

	Other enhancements and fixes.
	* src/HttpRequestCommand.cc
	(executeInternal) Use non-blocking socket for HTTPS (MinGW 
only).
	* src/SocketCore.cc: 
	(error): New function to abstract errno/WSAGetLastError().
	(errorMsg): New function to abstract errno/WSAGetLastError().
	(initiateSecureConnection): Added more detailed error reporting.
	* src/SocketCore.h: Added private variable blocking, to allow
	proper handling of OpenSSL psuedo-errors.
	* src/message.h
	(EX_SSL_INIT_FAILURE)
	(EX_SSL_IO_ERROR)
	(EX_SSL_PROTOCOL_ERROR)
	(EX_SSL_UNKNOWN_ERROR)
	(EX_SSL_CONNECT_ERROR)
	(EX_SOCKET_BLOCKING)
	(EX_SOCKET_NONBLOCKING)
	(EX_SOCKET_UNKNOWN_ERROR)
	* src/Util.cc
	(setGlobalSignalHandler): Renamed signal to sig as signal is a
	reserved name.
	(httpGMT): Fixed typo.
2007-07-31 16:45:16 +00:00

183 lines
5.9 KiB
Plaintext

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ(2.59)
AC_INIT(aria2c, 0.11.1+1, t-tujikawa@users.sourceforge.net)
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE()
AM_PATH_CPPUNIT(1.10.2)
AC_CONFIG_SRCDIR([src/Socket.h])
AC_CONFIG_HEADERS([config.h])
case "$target" in
*mingw*|*cygwin*)
WINSOCK_LIBS="-lws2_32"
AC_SUBST(WINSOCK_LIBS)
;;
esac
# Set localedir
localedir=${datadir}/locale
AC_SUBST(localedir)
# Checks for arguments.
AC_ARG_WITH([gnutls], [ --with-gnutls use gnutls library if installed. Default: yes], [with_gnutls=$withval], [with_gnutls=yes])
AC_ARG_WITH([openssl], [ --with-openssl use openssl library if installed. Default: yes], [with_openssl=$withval], [with_openssl=yes])
AC_ARG_WITH([libxml2], [ --with-libxml2 use libxml2 library if installed. Default: yes], [with_libxml2=$withval], [with_libxml2=yes])
AC_ARG_WITH([libares], [ --with-libares use ares library if installed. Default: yes], [with_libares=$withval], [with_libares=yes])
AC_ARG_WITH([libcares], [ --with-libcares use c-ares library if installed. Default: yes], [with_libcares=$withval], [with_libcares=yes])
AC_ARG_ENABLE([bittorrent], [ --enable-bittorrent enable BitTorrent support. Default: yes], [enable_bittorrent=$enableval], [enable_bittorrent=yes])
AC_ARG_ENABLE([metalink], [ --enable-metalink enable Metalink support. Default: yes], [enable_metalink=$enableval], [enable_metalink=yes])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_YACC
# Checks for libraries.
if test "x$with_libxml2" = "xyes"; then
AM_PATH_XML2([2.6.24], [have_libxml2=yes])
if test "x$have_libxml2" = "xyes"; then
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have libxml2.])
fi
fi
if test "x$with_gnutls" = "xyes"; then
AM_PATH_LIBGNUTLS([1.2.9], [have_libgnutls=yes])
if test "x$have_libgnutls" = "xyes"; then
AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
fi
fi
if test "x$have_libgnutls" = "xyes"; then
AM_PATH_LIBGCRYPT([1.2.2], [have_libgcrypt=yes])
if test "x$have_libgcrypt" = "xyes"; then
AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
fi
fi
if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
AM_PATH_OPENSSL
fi
if test "x$with_libcares" = "xyes"; then
AM_PATH_LIBCARES
fi
if test "x$have_libcares" = "x"; then
if test "x$with_libares" = "xyes"; then
AM_PATH_LIBARES
fi
fi
# Define variables based on the result of the checks for libraries.
if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
fi
if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
AC_DEFINE([ENABLE_MESSAGE_DIGEST], [1], [Define to 1 if message digest support is enabled.])
AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], true)
enable_message_digest=yes
else
AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], false)
fi
if test "x$enable_bittorrent" = "xyes" && test "x$enable_message_digest" = "xyes"; then
AC_DEFINE([ENABLE_BITTORRENT], [1], [Define to 1 if BitTorrent support is enabled.])
AM_CONDITIONAL([ENABLE_BITTORRENT], true)
else
AM_CONDITIONAL([ENABLE_BITTORRENT], false)
fi
if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes"; then
AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
AM_CONDITIONAL([ENABLE_METALINK], true)
else
AM_CONDITIONAL([ENABLE_METALINK], false)
fi
if test "x$have_libcares" = "xyes" || test "x$have_libares" = "xyes"; then
AC_DEFINE([ENABLE_ASYNC_DNS], [1], [Define to 1 if asynchronous DNS support is enabled.])
AM_CONDITIONAL([ENABLE_ASYNC_DNS], true)
else
AM_CONDITIONAL([ENABLE_ASYNC_DNS], false)
fi
# Checks for header files.
AC_FUNC_ALLOCA
#AC_HEADER_STDC
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h argz.h arpa/inet.h fcntl.h inttypes.h io.h langinfo.h libgen.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
# Checks for library functions.
AM_GNU_GETTEXT
AM_GNU_GETTEXT_VERSION(0.12.1)
AC_FUNC_ERROR_AT_LINE
case "$target" in
*mingw*)
;;
*)
AC_FUNC_MALLOC
AC_FUNC_REALLOC
;;
esac
AC_FUNC_MEMCMP
AC_FUNC_MMAP
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([basename],
[AM_CONDITIONAL([HAVE_BASENAME], true)],
[AM_CONDITIONAL([HAVE_BASENAME], false)])
AC_CHECK_FUNCS([gai_strerror],
[AM_CONDITIONAL([HAVE_GAI_STRERROR], true)],
[AM_CONDITIONAL([HAVE_GAI_STRERROR], false)])
AC_CHECK_FUNCS([getaddrinfo],
[AM_CONDITIONAL([HAVE_GETADDRINFO], true)],
[AM_CONDITIONAL([HAVE_GETADDRINFO], false)])
AC_CHECK_FUNCS([gettimeofday],
[AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)],
[AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)])
AC_CHECK_FUNCS([inet_aton],
[AM_CONDITIONAL([HAVE_INET_ATON], true)],
[AM_CONDITIONAL([HAVE_INET_ATON], false)])
AC_CHECK_FUNCS([localtime_r],
[AM_CONDITIONAL([HAVE_LOCALTIME_R], true)],
[AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
AC_CHECK_FUNCS([strptime],
[AM_CONDITIONAL([HAVE_STRPTIME], true)],
[AM_CONDITIONAL([HAVE_STRPTIME], false)])
case "$target" in
*mingw*)
dnl true if _WIN32_WINNT >= 0x0501
AM_CONDITIONAL([HAVE_GETADDRINFO], true)
;;
esac
AC_CONFIG_FILES([Makefile
src/Makefile
test/Makefile
po/Makefile.in
m4/Makefile
intl/Makefile
doc/Makefile])
AC_OUTPUT