2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed compile error on OpenBSD4.7(i386). In openssl.m4, we first
	search libcrypto and then libssl because libssl depends on
	libcrypto on OpenBSD.
	* src/Netrc.cc
	* src/Netrc.h
	* src/Triplet.h
	* src/openssl.m4
pull/1/head
Tatsuhiro Tsujikawa 2010-10-03 09:19:33 +00:00
parent 584af68e19
commit 32d4ffa8ee
6 changed files with 70 additions and 57 deletions

View File

@ -1,3 +1,13 @@
2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error on OpenBSD4.7(i386). In openssl.m4, we first
search libcrypto and then libssl because libssl depends on
libcrypto on OpenBSD.
* src/Netrc.cc
* src/Netrc.h
* src/Triplet.h
* src/openssl.m4
2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Execute 5 DHT tasks concurrently in each task queue.

75
configure vendored
View File

@ -6833,7 +6833,44 @@ if test "x$have_openssl" != "xyes"; then
LIBS="-L$openssl_prefix_lib $LIBS"
CPPFLAGS="-I$openssl_prefix_include $CPPFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
# First check libcrypto, because libssl may depend on it
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypto" >&5
$as_echo_n "checking for main in -lcrypto... " >&6; }
if test "${ac_cv_lib_crypto_main+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_crypto_main=yes
else
ac_cv_lib_crypto_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_main" >&5
$as_echo "$ac_cv_lib_crypto_main" >&6; }
if test "x$ac_cv_lib_crypto_main" = x""yes; then :
have_openssl=yes; LIBS="-lcrypto $LIBS"
fi
if test "x$have_openssl" = "xyes"; then
have_openssl=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then :
$as_echo_n "(cached) " >&6
@ -6873,42 +6910,6 @@ if test "x$ac_cv_lib_ssl_SSL_library_init" = x""yes; then :
have_openssl=yes LIBS="-lssl $LIBS"
fi
if test "x$have_openssl" = "xyes"; then
have_openssl=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypto" >&5
$as_echo_n "checking for main in -lcrypto... " >&6; }
if test "${ac_cv_lib_crypto_main+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_crypto_main=yes
else
ac_cv_lib_crypto_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_main" >&5
$as_echo "$ac_cv_lib_crypto_main" >&6; }
if test "x$ac_cv_lib_crypto_main" = x""yes; then :
have_openssl=yes; LIBS="-lcrypto $LIBS"
fi
if test "x$have_openssl" = "xyes"; then
OPENSSL_LIBS="-L$openssl_prefix_lib -lssl -lcrypto"
OPENSSL_CFLAGS="-I$openssl_prefix_include"

View File

@ -36,10 +36,11 @@ if test "x$have_openssl" != "xyes"; then
LIBS="-L$openssl_prefix_lib $LIBS"
CPPFLAGS="-I$openssl_prefix_include $CPPFLAGS"
AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes LIBS="-lssl $LIBS"])
# First check libcrypto, because libssl may depend on it
AC_CHECK_LIB([crypto], [main], [have_openssl=yes; LIBS="-lcrypto $LIBS"])
if test "x$have_openssl" = "xyes"; then
have_openssl=no
AC_CHECK_LIB([crypto], [main], [have_openssl=yes; LIBS="-lcrypto $LIBS"])
AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes LIBS="-lssl $LIBS"])
if test "x$have_openssl" = "xyes"; then
OPENSSL_LIBS="-L$openssl_prefix_lib -lssl -lcrypto"
OPENSSL_CFLAGS="-I$openssl_prefix_include"

View File

@ -44,17 +44,17 @@
namespace aria2 {
const std::string Netrc::MACHINE("machine");
const std::string Netrc::A2_MACHINE("machine");
const std::string Netrc::DEFAULT("default");
const std::string Netrc::A2_DEFAULT("default");
const std::string Netrc::LOGIN("login");
const std::string Netrc::A2_LOGIN("login");
const std::string Netrc::PASSWORD("password");
const std::string Netrc::A2_PASSWORD("password");
const std::string Netrc::ACCOUNT("account");
const std::string Netrc::A2_ACCOUNT("account");
const std::string Netrc::MACDEF("macdef");
const std::string Netrc::A2_MACDEF("macdef");
void Netrc::skipMacdef(std::ifstream& f) const
{
@ -97,11 +97,11 @@ void Netrc::parse(const std::string& path)
eoi = tokens.end(); iter != eoi; ++iter) {
const std::string& token = *iter;
if(state == GET_TOKEN) {
if(token == Netrc::MACHINE) {
if(token == Netrc::A2_MACHINE) {
storeAuthenticator(authenticator);
authenticator.reset(new Authenticator());
state = SET_MACHINE;
} else if(token == Netrc::DEFAULT) {
} else if(token == Netrc::A2_DEFAULT) {
storeAuthenticator(authenticator);
authenticator.reset(new DefaultAuthenticator());
} else {
@ -110,13 +110,13 @@ void Netrc::parse(const std::string& path)
(StringFormat("Netrc:parse error. %s encounterd where 'machine'"
" or 'default' expected.", token.c_str()).str());
}
if(token == Netrc::LOGIN) {
if(token == Netrc::A2_LOGIN) {
state = SET_LOGIN;
} else if(token == Netrc::PASSWORD) {
} else if(token == Netrc::A2_PASSWORD) {
state = SET_PASSWORD;
} else if(token == Netrc::ACCOUNT) {
} else if(token == Netrc::A2_ACCOUNT) {
state = SET_ACCOUNT;
} else if(token == Netrc::MACDEF) {
} else if(token == Netrc::A2_MACDEF) {
state = SET_MACDEF;
}
}

View File

@ -160,17 +160,17 @@ public:
authenticators_.push_back(authenticator);
}
static const std::string MACHINE;
static const std::string A2_MACHINE;
static const std::string DEFAULT;
static const std::string A2_DEFAULT;
static const std::string LOGIN;
static const std::string A2_LOGIN;
static const std::string PASSWORD;
static const std::string A2_PASSWORD;
static const std::string ACCOUNT;
static const std::string A2_ACCOUNT;
static const std::string MACDEF;
static const std::string A2_MACDEF;
};
} // namespace aria2

View File

@ -35,6 +35,7 @@
#ifndef D_TRIPLET_H
#define D_TRIPLET_H
#include <cstdlib>
#include <utility>
namespace aria2 {