使用make设置openssl会导致”请再次运行相同的make命令”。

huangapple go评论86阅读模式
英文:

Using make to setup openssl results in "Please run the same make command again"

问题

我正在为Android进行NDK构建,但我需要进行HTTPS请求,所以我正在使用OpenSSL。我希望项目的设置是自动的,但每次我在make中运行设置时,都会收到"请再次运行相同的make命令"的错误,但在控制台中运行命令时没有问题。

androidVersion:=28
ndkRoot = $(shell pwd)/../android/ndk/25.2.9519653#https://developer.android.com/ndk/downloads/
opensslDir = ./openssl# 从https://github.com/openssl/openssl/releases/latest下载...

openssl:
	export ANDROID_NDK_ROOT=$(ndkRoot) ; \
	PATH=$$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$$PATH ; \
	cd $(opensslDir); \
	./Configure android-arm -D__ANDROID_API__=$(androidVersion); \
	$(MAKE) ; \
	$(MAKE) ; \
	$(MAKE)

输出:

> make -B
export ANDROID_NDK_ROOT=/home/me/a/../android/ndk/25.2.9519653 ; \
PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$PATH ; \
cd ./openssl; \
./Configure android-arm -D__ANDROID_API__=28; \
make ; \
make ; \
make ; \

为目标android-arm配置OpenSSL版本3.1.2
使用特定于操作系统的种子配置
已创建configdata.pm
运行configdata.pm
已创建Makefile.in
已创建Makefile

********************************************
***                                      ***
***   OpenSSL已成功配置                 ***
***                                      ***
***   如果在构建时遇到问题,请打开一个    ***
***   GitHub问题<https://github.com/openssl/openssl/issues>并包括以下命令的输出: ***
***                                      ***
***       perl configdata.pm --dump      ***
***                                      ***
***   (如果您是OpenSSL新手,您可能希望首先查阅INSTALL.md文件中的“故障排除”部分) ***
***                                      ***
********************************************
make[1]: 进入目录'/home/me/a/openssl'
检测到更改:Configure config build.info crypto/build.info ssl/build.info apps/build.info util/build.info tools/build.info fuzz/build.info providers/build.info doc/build.info test/build.info engines/build.info crypto/objects/build.info crypto/buffer/build.info crypto/bio/build.info crypto/stack/build.info crypto/lhash/build.info crypto/rand/build.info crypto/evp/build.info crypto/asn1/build.info crypto/pem/build.info crypto/x509/build.info crypto/conf/build.info crypto/txt_db/build.info crypto/pkcs7/build.info crypto/pkcs12/build.info crypto/ui/build.info crypto/kdf/build.info crypto/store/build.info crypto/property/build.info crypto/md4/build.info crypto/md5/build.info crypto/sha/build.info crypto/mdc2/build.info crypto/hmac/build.info crypto/ripemd/build.info crypto/whrlpool/build.info crypto/poly1305/build.info crypto/siphash/build.info crypto/sm3/build.info crypto/des/build.info crypto/aes/build.info crypto/rc2/build.info crypto/rc4/build.info crypto/idea/build.info crypto/aria/build.info crypto/bf/build.info crypto/cast/build.info crypto/camellia/build.info crypto/seed/build.info crypto/sm4/build.info crypto/chacha/build.info crypto/modes/build.info crypto/bn/build.info crypto/ec/build.info crypto/rsa/build.info crypto/dsa/build.info crypto/dh/build.info crypto/sm2/build.info crypto/dso/build.info crypto/engine/build.info crypto/err/build.info crypto/comp/build.info crypto/http/build.info crypto/ocsp/build.info crypto/cms/build.info crypto/ts/build.info crypto/srp/build.info crypto/cmac/build.info crypto/ct/build.info crypto/async/build.info crypto/ess/build.info crypto/crmf/build.info crypto/cmp/build.info crypto/encode_decode/build.info crypto/ffc/build.info apps/lib/build.info providers/common/build.info providers/implementations/build.info doc/man1/build.info providers/common/der/build.info providers/implementations/digests/build.info providers/implementations/ciphers/build.info providers/implementations/rands/build.info providers/implementations/macs/build.info providers/implementations/kdfs/build.info providers/implementations/exchange/build.info providers/implementations/keymgmt/build.info providers/implementations/signature/build.info providers/implementations/asymciphers/build.info providers/implementations/encode_decode/build.info providers/implementations/storemgmt/build.info providers/implementations/kem/build.info providers/implementations/rands/seeding/build.info Configurations/00-base-templates.conf Configurations/10-main.conf Configurations/15-android.conf
/usr/bin/perl configdata.pm -r
为目标android-arm配置OpenSSL版本3.1.2
使用特定于操作系统的种子配置
已创建configdata.pm
运行configdata.pm
已创建Makefile.in
已创建Makefile

********************************************
***                                      ***
***   OpenSSL已成功配置                 ***
***                                      ***
***   如果在构建时遇到问题,请打开一个    ***
***   GitHub问题<https://github.com/openssl/openssl/issues>并包括以下命令的输出: ***
***                                      ***
***       perl configdata.pm --dump      ***
***                                      ***
***   (如果您是OpenSSL新手,您可能希望首先查阅INSTALL.md文件中的“故障排除”部分) ***
***                                      ***
********************************************
********************************************
***                                      ***
***   请再次运行相同的make命令            ***
***                                      ***
********************************************
make[1]: 离开目录'/home/me/a/openssl'
make[1]: 进入目录'/home/me/a/openssl'
检测到更改:Configure config build.info crypto/build.info ssl/build.info apps/build.info util/build.info tools.build.info fuzz.build.info providers.build.info doc.build.info test.build.info engines.build.info crypto.objects.build.info crypto.buffer.build.info crypto.bio.build.info crypto.stack.build.info crypto.lhash.build.info crypto.rand.build.info crypto.evp.build.info crypto.asn1.build.info crypto.pem.build.info crypto.x509.build.info crypto.conf.build.info crypto.txt_db.build.info crypto.pkcs7.build.info crypto.pkcs12.build.info crypto.ui.build.info crypto.kdf.build.info crypto.store.build.info crypto.property.build.info crypto.md4.build.info crypto.md5.build.info crypto.sha.build.info crypto.mdc2.build.info crypto.hmac.build.info crypto.ripemd.build.info crypto.whrlpool.build.info crypto.poly1305.build.info crypto.siphash.build.info crypto.sm3.build.info crypto.des.build.info crypto.aes.build.info crypto.rc2.build.info crypto.rc4.build.info crypto.idea.build.info crypto.aria.build.info crypto.bf.build.info crypto.cast.build.info crypto.camellia.build.info crypto

<details>
<summary>英文:</summary>

Im making an ndk build for android, but I need to do https requests so im using openssl. I wanted the setup of the project to be automatic but I keep getting &quot;Please run the same make command again&quot; error every time I run the setup within make but its fine running the commands in the console.



```make
androidVersion:=28
ndkRoot = $(shell pwd)/../android/ndk/25.2.9519653#https://developer.android.com/ndk/downloads/
opensslDir = ./openssl# Download from https://github.com/openssl/openssl/releases/latest ...

openssl:
	export ANDROID_NDK_ROOT=$(ndkRoot) ; \
	PATH=$$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$$PATH ; \
	cd $(opensslDir); \
	./Configure android-arm -D__ANDROID_API__=$(androidVersion); \
	$(MAKE) ; \
	$(MAKE) ; \
	$(MAKE)

output:

&gt; make -B
export ANDROID_NDK_ROOT=/home/me/a/../android/ndk/25.2.9519653 ; \
PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$PATH ; \
cd ./openssl; \
./Configure android-arm -D__ANDROID_API__=28; \
make ; \
make ; \
make ; \
Configuring OpenSSL version 3.1.2 for target android-arm
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub &lt;https://github.com/openssl/openssl/issues&gt;  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   &#39;Troubleshooting&#39; section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
make[1]: Entering directory &#39;/home/me/a/openssl&#39;
Detected changed: Configure config build.info crypto/build.info ssl/build.info apps/build.info util/build.info tools/build.info fuzz/build.info providers/build.info doc/build.info test/build.info engines/build.info crypto/objects/build.info crypto/buffer/build.info crypto/bio/build.info crypto/stack/build.info crypto/lhash/build.info crypto/rand/build.info crypto/evp/build.info crypto/asn1/build.info crypto/pem/build.info crypto/x509/build.info crypto/conf/build.info crypto/txt_db/build.info crypto/pkcs7/build.info crypto/pkcs12/build.info crypto/ui/build.info crypto/kdf/build.info crypto/store/build.info crypto/property/build.info crypto/md4/build.info crypto/md5/build.info crypto/sha/build.info crypto/mdc2/build.info crypto/hmac/build.info crypto/ripemd/build.info crypto/whrlpool/build.info crypto/poly1305/build.info crypto/siphash/build.info crypto/sm3/build.info crypto/des/build.info crypto/aes/build.info crypto/rc2/build.info crypto/rc4/build.info crypto/idea/build.info crypto/aria/build.info crypto/bf/build.info crypto/cast/build.info crypto/camellia/build.info crypto/seed/build.info crypto/sm4/build.info crypto/chacha/build.info crypto/modes/build.info crypto/bn/build.info crypto/ec/build.info crypto/rsa/build.info crypto/dsa/build.info crypto/dh/build.info crypto/sm2/build.info crypto/dso/build.info crypto/engine/build.info crypto/err/build.info crypto/comp/build.info crypto/http/build.info crypto/ocsp/build.info crypto/cms/build.info crypto/ts/build.info crypto/srp/build.info crypto/cmac/build.info crypto/ct/build.info crypto/async/build.info crypto/ess/build.info crypto/crmf/build.info crypto/cmp/build.info crypto/encode_decode/build.info crypto/ffc/build.info apps/lib/build.info providers/common/build.info providers/implementations/build.info doc/man1/build.info providers/common/der/build.info providers/implementations/digests/build.info providers/implementations/ciphers/build.info providers/implementations/rands/build.info providers/implementations/macs/build.info providers/implementations/kdfs/build.info providers/implementations/exchange/build.info providers/implementations/keymgmt/build.info providers/implementations/signature/build.info providers/implementations/asymciphers/build.info providers/implementations/encode_decode/build.info providers/implementations/storemgmt/build.info providers/implementations/kem/build.info providers/implementations/rands/seeding/build.info Configurations/00-base-templates.conf Configurations/10-main.conf Configurations/15-android.conf
/usr/bin/perl configdata.pm -r
Configuring OpenSSL version 3.1.2 for target android-arm
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub &lt;https://github.com/openssl/openssl/issues&gt;  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   &#39;Troubleshooting&#39; section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
**************************************************
***                                            ***
***   Please run the same make command again   ***
***                                            ***
**************************************************
make[1]: Leaving directory &#39;/home/me/a/openssl&#39;
make[1]: Entering directory &#39;/home/me/a/openssl&#39;
Detected changed: Configure config build.info crypto/build.info ssl/build.info apps/build.info util/build.info tools/build.info fuzz/build.info providers/build.info doc/build.info test/build.info engines/build.info crypto/objects/build.info crypto/buffer/build.info crypto/bio/build.info crypto/stack/build.info crypto/lhash/build.info crypto/rand/build.info crypto/evp/build.info crypto/asn1/build.info crypto/pem/build.info crypto/x509/build.info crypto/conf/build.info crypto/txt_db/build.info crypto/pkcs7/build.info crypto/pkcs12/build.info crypto/ui/build.info crypto/kdf/build.info crypto/store/build.info crypto/property/build.info crypto/md4/build.info crypto/md5/build.info crypto/sha/build.info crypto/mdc2/build.info crypto/hmac/build.info crypto/ripemd/build.info crypto/whrlpool/build.info crypto/poly1305/build.info crypto/siphash/build.info crypto/sm3/build.info crypto/des/build.info crypto/aes/build.info crypto/rc2/build.info crypto/rc4/build.info crypto/idea/build.info crypto/aria/build.info crypto/bf/build.info crypto/cast/build.info crypto/camellia/build.info crypto/seed/build.info crypto/sm4/build.info crypto/chacha/build.info crypto/modes/build.info crypto/bn/build.info crypto/ec/build.info crypto/rsa/build.info crypto/dsa/build.info crypto/dh/build.info crypto/sm2/build.info crypto/dso/build.info crypto/engine/build.info crypto/err/build.info crypto/comp/build.info crypto/http/build.info crypto/ocsp/build.info crypto/cms/build.info crypto/ts/build.info crypto/srp/build.info crypto/cmac/build.info crypto/ct/build.info crypto/async/build.info crypto/ess/build.info crypto/crmf/build.info crypto/cmp/build.info crypto/encode_decode/build.info crypto/ffc/build.info apps/lib/build.info providers/common/build.info providers/implementations/build.info doc/man1/build.info providers/common/der/build.info providers/implementations/digests/build.info providers/implementations/ciphers/build.info providers/implementations/rands/build.info providers/implementations/macs/build.info providers/implementations/kdfs/build.info providers/implementations/exchange/build.info providers/implementations/keymgmt/build.info providers/implementations/signature/build.info providers/implementations/asymciphers/build.info providers/implementations/encode_decode/build.info providers/implementations/storemgmt/build.info providers/implementations/kem/build.info providers/implementations/rands/seeding/build.info Configurations/00-base-templates.conf Configurations/10-main.conf Configurations/15-android.conf
/usr/bin/perl configdata.pm -r
Configuring OpenSSL version 3.1.2 for target android-arm
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub &lt;https://github.com/openssl/openssl/issues&gt;  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   &#39;Troubleshooting&#39; section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
**************************************************
***                                            ***
***   Please run the same make command again   ***
***                                            ***
**************************************************
make[1]: Leaving directory &#39;/home/me/a/openssl&#39;
make[1]: Entering directory &#39;/home/me/a/openssl&#39;
Detected changed: Configure config build.info crypto/build.info ssl/build.info apps/build.info util/build.info tools/build.info fuzz/build.info providers/build.info doc/build.info test/build.info engines/build.info crypto/objects/build.info crypto/buffer/build.info crypto/bio/build.info crypto/stack/build.info crypto/lhash/build.info crypto/rand/build.info crypto/evp/build.info crypto/asn1/build.info crypto/pem/build.info crypto/x509/build.info crypto/conf/build.info crypto/txt_db/build.info crypto/pkcs7/build.info crypto/pkcs12/build.info crypto/ui/build.info crypto/kdf/build.info crypto/store/build.info crypto/property/build.info crypto/md4/build.info crypto/md5/build.info crypto/sha/build.info crypto/mdc2/build.info crypto/hmac/build.info crypto/ripemd/build.info crypto/whrlpool/build.info crypto/poly1305/build.info crypto/siphash/build.info crypto/sm3/build.info crypto/des/build.info crypto/aes/build.info crypto/rc2/build.info crypto/rc4/build.info crypto/idea/build.info crypto/aria/build.info crypto/bf/build.info crypto/cast/build.info crypto/camellia/build.info crypto/seed/build.info crypto/sm4/build.info crypto/chacha/build.info crypto/modes/build.info crypto/bn/build.info crypto/ec/build.info crypto/rsa/build.info crypto/dsa/build.info crypto/dh/build.info crypto/sm2/build.info crypto/dso/build.info crypto/engine/build.info crypto/err/build.info crypto/comp/build.info crypto/http/build.info crypto/ocsp/build.info crypto/cms/build.info crypto/ts/build.info crypto/srp/build.info crypto/cmac/build.info crypto/ct/build.info crypto/async/build.info crypto/ess/build.info crypto/crmf/build.info crypto/cmp/build.info crypto/encode_decode/build.info crypto/ffc/build.info apps/lib/build.info providers/common/build.info providers/implementations/build.info doc/man1/build.info providers/common/der/build.info providers/implementations/digests/build.info providers/implementations/ciphers/build.info providers/implementations/rands/build.info providers/implementations/macs/build.info providers/implementations/kdfs/build.info providers/implementations/exchange/build.info providers/implementations/keymgmt/build.info providers/implementations/signature/build.info providers/implementations/asymciphers/build.info providers/implementations/encode_decode/build.info providers/implementations/storemgmt/build.info providers/implementations/kem/build.info providers/implementations/rands/seeding/build.info Configurations/00-base-templates.conf Configurations/10-main.conf Configurations/15-android.conf
/usr/bin/perl configdata.pm -r
Configuring OpenSSL version 3.1.2 for target android-arm
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub &lt;https://github.com/openssl/openssl/issues&gt;  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   &#39;Troubleshooting&#39; section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
**************************************************
***                                            ***
***   Please run the same make command again   ***
***                                            ***
**************************************************
make[1]: Leaving directory &#39;/home/me/a/openssl&#39;

答案1

得分: 1

问题是在make命令行上使用了-B选项。通过使用这个选项,您要求make每次运行时都重新构建makefile中的所有内容。还要注意,像这样的选项会传递给子make(因为否则您将不会重新构建整个项目),这意味着您的规则调用的make实例也会获得-B选项,它们也会一直重新构建所有内容。

由于一切都一直在重新构建,因此在这些makefile中的“检测到更改”检查认为它们始终在发生更改(事实上是这样的),因此它总是报告这个消息。

您没有清楚地说明为什么要使用-B,但如果,例如,您有一个名为openssl的子目录,那么目标:

openssl:

没有先决条件将始终得到满足,因为openssl存在于当前目录中,没有先决条件会导致它被视为过时。您可以在您的makefile中将目标重命名为在目录中不存在的东西,或者使用.PHONY(等其他方法)来强制make每次都重新构建特定的目标。

英文:

The problem is using -B on the make command line. By giving this option, you are asking make to always rebuild everything in the makefile every time it runs. Recall also that options like that are passed down to sub-makes (they have to be since else you would not be rebuilding the entire project) and so that means the make instances your rules invoke also get -B and they also rebuild everything all the time.

Because everything is always rebuilt, the "Detected changed" check in these makefiles thinks they are always being changed (which they are) and so it always reports this message.

You don't make clear why you wanted to use -B but if, for example, you have a subdirectory named openssl then the target:

openssl:

with no prerequisites will always be satisfied, because openssl exists in the current directory and there's no prerequisite to cause it to be considered out of date. You can rename the target in your makefile to be something that doesn't exist in the directory, or use .PHONY (among other methods) to force make to rebuild that specific target every time.

huangapple
  • 本文由 发表于 2023年7月28日 05:43:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76783573.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定