2016-03-13 68 views
1

我想在Mac上構建rtmpdump和librtmp,但是我不能爲我的生活找出它爲什麼不工作。我用我自己建的OpenSSL:如何使Mac OS X上的librtmp編譯

$ openssl version 
OpenSSL 1.1.0-pre3 (alpha) 15 Feb 2016 

我已正確設置標誌(我認爲),但仍當我嘗試編譯我得到這個:

$ make INC=-I/usr/local/include 
gcc -Wall -I/usr/local/include -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL -O2 -fPIC -c -o rtmp.o rtmp.c 
In file included from rtmp.c:152: 
./handshake.h:120:12: error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st') 
    HMAC_CTX ctx; 
     ^
/usr/local/include/openssl/ossl_typ.h:145:16: note: forward declaration of 'struct hmac_ctx_st' 
typedef struct hmac_ctx_st HMAC_CTX; 
      ^
In file included from rtmp.c:152: 
./handshake.h:125:3: warning: implicit declaration of function 'HMAC_CTX_init' is invalid in C99 [-Wimplicit-function-declaration] 
    HMAC_setup(ctx, secretKey, 128); 
^
./handshake.h:72:35: note: expanded from macro 'HMAC_setup' 
#define HMAC_setup(ctx, key, len)  HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, key, len, EVP_sha256(), 0) 
             ^
./handshake.h:127:3: warning: implicit declaration of function 'HMAC_CTX_cleanup' is invalid in C99 [-Wimplicit-function-declaration] 
    HMAC_finish(ctx, digest, digestLen); 
^
./handshake.h:74:67: note: expanded from macro 'HMAC_finish' 
#define HMAC_finish(ctx, dig, dlen)  HMAC_Final(&ctx, dig, &dlen); HMAC_CTX_cleanup(&ctx) 
                    ^
./handshake.h:269:12: error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st') 
    HMAC_CTX ctx; 
     ^
/usr/local/include/openssl/ossl_typ.h:145:16: note: forward declaration of 'struct hmac_ctx_st' 
typedef struct hmac_ctx_st HMAC_CTX; 
      ^
rtmp.c:192:13: warning: comparison of constant 18446744073709551597 with expression of type 'uint32_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] 
    if (nSize > SIZE_MAX - RTMP_MAX_HEADER_SIZE) 
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
3 warnings and 2 errors generated. 
make[1]: *** [rtmp.o] Error 1 
make: *** [librtmp/librtmp.a] Error 2 

它看起來像它可能是與我正在使用的OpenSSL版本存在兼容性問題。有誰知道如何解決這類問題,或者對可能負責的OpenSSL所做的任何更改?

回答

1

OpenSSL的1.1.0-PRE3(阿爾法)2016年2月15日...

有誰知道如何解決這種問題,或OpenSSL的任何變化,可能是負責?

從廣義上講,OpenSSL 1.1.x中似乎有兩個高層次的變化導致了大​​部分問題。首先是構建系統的變化。其次是對私人API的更加堅定的態度。我認爲你看到了第二個私人API的神器。

一般來說,1.1.0-pre3和1.1.0-pre4有一些問題,並且大多無法實現成功make test。問題包括32位OS X PowerMac,64位OS X PowerMac,32位OS X, 64位OS X 32位ARM 64位ARM, OpenBSD 5.7, NetBSD 7.0 ,Cygwin,CentOS 5,CentOS 7和i686。這麼多以至於我已經提交了大約25個錯誤,以準備即將到來的Beta-1,預計將於2016年3月14日星期一抵達。

您目前可能應該避免1.1.0-pre-N,因爲它非常不穩定。你應該可以在x86_64 Linux下運行,但現在還有其他的東西是垃圾照片。你應該能夠在Beta-2周圍再次拿起它。

從2016年3月11日星期五開始提交之後,您可能會有更好的運氣。主要是提交0d4d5ab和4c1cf7e。你可以得到最新的:

git clone git://git.openssl.org/openssl.git 

或者,使用1.0.2穩定版本。