+ -
当前位置:首页 → 问答吧 → gcc无法编译 cannot find -lgcc_s

gcc无法编译 cannot find -lgcc_s

时间:2011-08-03

来源:互联网

gnu make(3.82版) 5.7.2章(递归调用make)中有这样一句话
The value of the make variable SHELL is not exported. Instead, the value of the SHELL variable from the invoking environment is passed to the sub-make. You can force make to export its value for SHELL by using the export directive
这段话说除非显式export,SHELL是从调用它的环境中传递过来的。
而在5.3.2 Choosing the Shell中又有这样一句话
The program used as the shell is taken from the variable SHELL. If this variable is not set in your makefile, the program /bin/sh is used as the shell.
Unlike most variables, the variable SHELL is never set from the environment.
这段话说SHELL不会被make从环境中设置,如果makefile中设置了SHELL变量,它就取这个变量的值,否则取/bin/sh
这两段话有矛盾之处(可能是我理解有误)
另外我写了个makefile测试了一下,在主makefile中export SHELL=bash,主SHELL的行为改变为bash的了,但是子makefile中SHELL的值仍是/bin/sh (the program /bin/sh is used as the shell),其行为显示为dash的(ubuntu中的sh链接到了dash),使用-e选项也是这样。
这是什么原因?

作者: shmily623   发布时间: 2011-08-03