2016-03-04 121 views
1

目前,我使用下面的命令從OpenSSL軟件包編譯的OpenSSL 1.0.2f:如何在Beaglebone Black上編譯openssl 1.0.2f?

$ tar xzf openssl-1.0.2e.tar.gz 
$ cd openssl-1.0.2e 
$export PREFIX={PREFIX} 
$./Configure -DOPENSSL_NO_HEARTBEATS --openssldir=$PREFIX shared os/compiler:${TARGET} 
$ make 

這是Beaglebone黑

$uname -a 
$Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux 

架構我也嘗試從列表中設定的目標:

  • linux-armv7l || linux-aarch64 || linux-alpha + bwx-ccc ||的Linux-α+ BWX-GCC || linux-alpha-ccc || linux-alpha-gcc || linux-aout || linux-armv4 || linux-elf || linux-generic32 || linux-generic64 || linux-ia32-icc || linux-ia64 || linux-ia64-icc || linux-mips32 || linux-mips64 || linux-ppc || linux-ppc64 || linux-ppc64le || linux-sparcv8 || linux-sparcv9 || linux-x32 || linux-x86_64 || linux-x86_64-clang || linux-x86_64-icc || linux32-s390x || linux64-mips64 || linux64-s390x || LINUX64-SPARCV9

但時許OpenSSL的,它返回:

make[1]: {TARGET}: Command not found 

我也嘗試設置:

os/compiler:gcc 

gcc版本:

$ gcc --version 
gcc (Debian 4.9.2-10) 4.9.2 

但時許OpenSSL的它返回:

/bin/sh: 1: ./pod2mantest: Permission denied 
installing man1/CA.pl.1 
sh: 1: --section=1: not found 
Makefile:634: recipe for target 'install_docs' failed 
make: *** [install_docs] Error 127 

你能告訴我這裏有什麼問題嗎?

+0

你試圖使用'。 'make'之前的/ config'? –

+0

@LeśnyRumcajs:'。/ config'不適用於OP,因爲OP正試圖爲beagle-bone進行交叉編譯。相反,OP應該使用帶有附加選項的'./configure'。 – WedaPashi

回答

1

如何在Beaglebone Black上編譯openssl 1.0.2f?

我相信你想要linux-armv4的目標。

$ ./Configure LIST | grep -i arm 
android-armeabi 
linux-arm64ilp32 
linux-armv4 

另請參閱OpenSSL wiki上的Compilation and Installation


它最容易遵循Leśny的建議並運行./configconfig試圖猜測目標。如果猜測是錯誤的,那麼使用./Configure有三重:

$ wget https://www.openssl.org/source/openssl-1.0.2g.tar.gz 
... 
$ tar xzf openssl-1.0.2g.tar.gz 
... 
$ cd openssl-1.0.2g 

然後(注意linux-armv4):

$ ./config shared no-ssl2 no-ssl3 no-comp -DOPENSSL_NO_HEARTBEATS      
Operating system: armv7l-whatever-linux2 
Configuring for linux-armv4 
    no-comp   [option] OPENSSL_NO_COMP (skip dir) 
    no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir) 
    no-gmp   [default] OPENSSL_NO_GMP (skip dir) 
    no-jpake  [experimental] OPENSSL_NO_JPAKE (skip dir) 
    no-krb5   [krb5-flavor not specified] OPENSSL_NO_KRB5 
    no-libunbound [experimental] OPENSSL_NO_LIBUNBOUND (skip dir) 
    no-md2   [default] OPENSSL_NO_MD2 (skip dir) 
    no-rc5   [default] OPENSSL_NO_RC5 (skip dir) 
    no-rfc3779  [default] OPENSSL_NO_RFC3779 (skip dir) 
    no-sctp   [default] OPENSSL_NO_SCTP (skip dir) 
    no-ssl-trace [default] OPENSSL_NO_SSL_TRACE (skip dir) 
    no-ssl2   [option] OPENSSL_NO_SSL2 (skip dir) 
    no-ssl3   [option] OPENSSL_NO_SSL3 (skip dir) 
    no-store  [experimental] OPENSSL_NO_STORE (skip dir) 
    no-unit-test [default] OPENSSL_NO_UNIT_TEST (skip dir) 
    no-weak-ssl-ciphers [default] OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir) 
    no-zlib   [default] 
    no-zlib-dynamic [default] 
    ... 

您可能需要退回到這樣的事情:

$./Configure linux-armv4 shared no-ssl2 no-ssl3 no-comp -DOPENSSL_NO_HEARTBEATS 
... 
$ make depend 
... 
$ make clean 
... 
$ make 

爲了完整起見,我使用的是Debian console image從2015年12月,從BeagleBone黑的工作(我需要小,2GB的覆蓋區域,以便存儲爲可用於其他事情):

$ uname -a 
Linux beaglebone 4.1.15-ti-rt-r40 #1 SMP PREEMPT RT Thu Jan 7 23:32:08 UTC 2016 armv7l GNU/Linux 
+0

非常感謝@jww,它適合我:)。 – neo

相關問題