rakshasa / libtorrent

libTorrent BitTorrent library
http://rtorrent.net/downloads/
GNU General Public License v2.0
885 stars 209 forks source link

Compile fails with missing openssl - configure should have caught that. #150

Closed hannesweisbach closed 7 years ago

hannesweisbach commented 7 years ago

$ make /Library/Developer/CommandLineTools/usr/bin/make all-recursive Making all in src Making all in torrent Making all in data /bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../src/torrent/data -I../../.. -I../../../../src/torrent/data -I../../../../src/torrent/data/.. -I../../../../src/torrent/data/../.. -I../../../.. -I/usr/include -I/usr/include -D_THREAD_SAFE -g -O2 -g -DDEBUG -Wall -std=c++11 -fvisibility=hidden -MT block.lo -MD -MP -MF .deps/block.Tpo -c -o block.lo ../../../../src/torrent/data/block.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../../src/torrent/data -I../../.. -I../../../../src/torrent/data -I../../../../src/torrent/data/.. -I../../../../src/torrent/data/../.. -I../../../.. -I/usr/include -I/usr/include -D_THREAD_SAFE -g -O2 -g -DDEBUG -Wall -std=c++11 -fvisibility=hidden -MT block.lo -MD -MP -MF .deps/block.Tpo -c ../../../../src/torrent/data/block.cc -fno-common -DPIC -o .libs/block.o In file included from ../../../../src/torrent/data/block.cc:44: In file included from ../../../../src/torrent/data/../../protocol/peer_connection_base.h:46: In file included from ../../../../src/torrent/data/../../protocol/encryption_info.h:40: ../../../../src/torrent/data/../../utils/rc4.h:48:10: fatal error: 'openssl/rc4.h' file not found

include <openssl/rc4.h>

     ^

1 error generated. make[4]: [block.lo] Error 1 make[3]: [all-recursive] Error 1 make[2]: [all-recursive] Error 1 make[1]: [all-recursive] Error 1 make: *** [all] Error 2

scottgigawatt commented 7 years ago

I'm seeing the same issue on macOS Sierra Version 10.12.5 (16F73).

rakshasa commented 7 years ago

Does it happen when you compile the feature-bind branch?

scottgigawatt commented 7 years ago

@rakshasa yes, for me, I see this on the feature-bind branch. I see the following:

edward@cthulhu libtorrent $ git status && git checkout feature-bind && git pull && sudo make
On branch feature-bind
Your branch is up-to-date with 'origin/feature-bind'.
nothing to commit, working tree clean
Already on 'feature-bind'
Your branch is up-to-date with 'origin/feature-bind'.
Already up-to-date.
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
Making all in torrent
Making all in data
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../..  -I. -I./.. -I./../.. -I../../.. -I/usr/include -I/usr/include  -D_THREAD_SAFE   -g -O2 -g -DDEBUG -Wall -std=c++11 -fvisibility=hidden  -MT block.lo -MD -MP -MF .deps/block.Tpo -c -o block.lo block.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -I/usr/include -I/usr/include -D_THREAD_SAFE -g -O2 -g -DDEBUG -Wall -std=c++11 -fvisibility=hidden -MT block.lo -MD -MP -MF .deps/block.Tpo -c block.cc  -fno-common -DPIC -o .libs/block.o
In file included from block.cc:44:
In file included from ./../../protocol/peer_connection_base.h:46:
In file included from ./../../protocol/encryption_info.h:40:
./../../utils/rc4.h:48:10: fatal error: 'openssl/rc4.h' file not found
#include <openssl/rc4.h>
         ^
1 error generated.
make[4]: *** [block.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
rakshasa commented 7 years ago

Do it all from autogen.sh.

scottgigawatt commented 7 years ago

Attached is the full ./autogen.sh, ./configure, and make output.

libtorrent-autogen-configure-make-output.txt

scottgigawatt commented 7 years ago

@rakshasa, is there any update on what is causing this issue?

jfurrow commented 7 years ago

I'm seeing the same thing (both on master and feature-bind branches)

rakshasa commented 7 years ago

You need to verify that you got the 'rc4.h' header installed.

scottgigawatt commented 7 years ago

@rakshasa I have rc4.h installed in /usr/local/include and I am still seeing the error. Does the following header file look correct:

/*
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef HEADER_RC4_H
# define HEADER_RC4_H

# include <openssl/opensslconf.h>

# ifndef OPENSSL_NO_RC4
# include <stddef.h>
#ifdef  __cplusplus
extern "C" {
#endif

typedef struct rc4_key_st {
    RC4_INT x, y;
    RC4_INT data[256];
} RC4_KEY;

const char *RC4_options(void);
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
         unsigned char *outdata);

# ifdef  __cplusplus
}
# endif
# endif

#endif
rakshasa commented 7 years ago

Just to verify, what version of openssl do you have installed? And is it the original, or libressl, or such?

scottgigawatt commented 7 years ago
edward@cthulhu ~ $ openssl version
OpenSSL 0.9.8zh 14 Jan 2016
jfurrow commented 7 years ago

I have the same version as @eallenjr: OpenSSL 0.9.8zh 14 Jan 2016. If it helps, I installed OpenSSL via Homebrew on MacOS 10.12.5.

Thanks for the help!

rakshasa commented 7 years ago

So it seems like Homebrew for some reason decides to put the OpenSSL headers in the include root path.

Not going to do anything about this on this side unless any of you provide an easy-to-merge patch to the autoconf scripts.

scottgigawatt commented 7 years ago

FWIW, I did the following to get this to compile on master:

cd /usr/local/include
cp -rf ../../Cellar/openssl/1.0.2l/include/openssl .

I used the following to figure out where homebrew had the headers installed, since for some reason only rc4.h was in the include root path:

find /usr/local -type f -iname "*rc4.h*" -exec ls -lh {} \;

Afterwards, you can just remove the openssl directory in /usr/local/include.

jfurrow commented 7 years ago

Thanks @rakshasa and @eallenjr