我正在尝试理解 make 问题,但不确定发生了什么。我不确定我遇到的是 make 问题还是 git 问题。
如果我执行:
$ git clone git://git.openssl.org/openssl.git openssl-git
然后我得到了 OpenSSL 的源文件:
$ cd openssl-git
$ ls
ACKNOWLEDGMENTS INSTALL.VMS README demos os2
CHANGES INSTALL.W32 README.ASN1 doc perl
CHANGES.SSLeay INSTALL.W64 README.ECC e_os.h shlib
Configure INSTALL.WCE README.ENGINE e_os2.h ssl
...
这些文件看起来完全就像我下载 OpenSSL tarball 并解压它时得到的文件。
这些文件不可用吗?我不允许对它们执行 make
吗?
我问这样一个简单问题的原因是:我打开Configure
,修改其中一个配置行,然后执行清理、配置和制作。随后 make 失败。当我询问时,我被告知我没有正确使用 git。
这里有人告诉我 make 没问题,但我错误地使用了 git(来自 OpenSSL 测试邮件列表):openssl-dev, link error [heartbeat_test] Error 2 .
有人告诉我,我错误地使用了 git(来自 Stack Overflow):Why does deleting a conflicted file break a project? .
注意:我在两个 SO 问题中都遇到了同样的问题,只是这个问题使用了一个新的克隆。
# Standard checkout
git clone git://git.openssl.org/openssl.git openssl-git
cd openssl-git
# This is a false start. A config is needed to create a Makefile
export KERNEL_BITS=64
./config
# Clean up developer checked-in cruft
make clean && make dclean
# Open Configure, find debug-darwin64-x86_64-cc, change -g2 to -g3
./Configure debug-darwin64-x86_64-cc no-ssl2 enable-ec_nistp_64_gcc_128
make depend
make
...
duplicate symbol _main in:
heartbeat_test.o
testutil.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [link_app.] Error 1
make[1]: *** [heartbeat_test] Error 2
make: *** [build_tests] Error 1
我还可以使用相同的方法将 ./Configure debug-darwin64-x86_64-cc no-ssl2 enable-ec_nistp_64_gcc_128
更改为 ./config no-ssl2 enable-ec_nistp_64_gcc_128
结果。 export KERNEL_BITS=64
确保我获得 64 位 Darwin 配置 (darwin64-x86_64-cc
)。
最佳答案
您应该能够使用该克隆来执行 make
。
但请注意 INSTALL
建议使用./config
,而不是直接使用Configure
。
您可以修改 Configure
,但您应该在之后执行 ./config
,而不是 ./Configure
(除非您想为您的操作配置 OpenSSL)系统手动)。
关于openssl - 我可以使用 git 克隆后出现的文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25469996/