系统未建立
分类: LINUX
2017-03-09 17:41:13
今天跟更换1台服务器编译lxc时,出现了
checking host distribution... checking for /etc/redhat-release... configure: error: cannot check for file existence when cross compiling
make[3]: *** [config] Error 1
参考http://www.cnblogs.com/zhangsf/archive/2013/08/21/3272960.html
增加了编译选项ac_cv_file__etc_redhat_release=yes,出了其它的
checking for /etc/oracle-release... configure: error: cannot check for file existence when cross compiling
make[3]: *** [config] Error 1
checking for /etc/sparclinux-release... configure: error: cannot check for file existence when cross compiling
make[3]: *** [config] Error 1
检查configure文件发现有很多检查,增加那么多编译选项不麻烦死了。
if test -r "/etc/redhat-release"; then
if test -r "/etc/oracle-release"; then
if test -r "/etc/sparclinux-release"; then
if test -r "/etc/centos-release"; then
if test -r "/etc/fedora-release"; then
if test -r "/etc/SuSE-release"; then
if test -r "/etc/gentoo-release"; then
if test -r "/etc/debian_version"; then
if test -r "/etc/arch-release"; then
if test -r "/etc/slackware-version"; then
if test -r "/etc/plamo-version"; then
if test -r "/etc/frugalware-release"; then
if test -r "/etc/mandrakelinux-release"; then
if test -r "/etc/mandriva-release"; then
if test -r "/etc/pardus-release"; then
if test -r "/etc/altlinux-release"; then
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
仔细察看configure文件,发现了原因:
进行以上检测是有条件的,if test "z$with_distro" = "z"; then
而$with_distro取值来自,
if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
with_distro=`lsb_release -is`
fi
在服务器上执行lsb_release -is,提示bash: lsb_release: command not found...,
而原先的机器,提示,RedHatEnterpriseServer,跟编译lxc的 log呼应。
checking host distribution... redhatenterpriseserver
原因就在这里。
增加赋值with_distro="noNeed",搞定。
或增加--with-distro=xx编译选项。