Chinaunix首页 | 论坛 | 博客
  • 博客访问: 768084
  • 博文数量: 247
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 501
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-12 21:53
个人简介

系统未建立

文章分类

全部博文(247)

文章存档

2021年(1)

2020年(3)

2019年(5)

2018年(3)

2017年(44)

2016年(75)

2015年(52)

2014年(63)

2013年(1)

我的朋友

分类: 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编译选项。

阅读(4886) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~