在没有zlib-devel的情况下编译共享主机上的git [英] Compile git on shared host without zlib-devel

查看:153
本文介绍了在没有zlib-devel的情况下编译共享主机上的git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在共享的RHEL5主机上编译和安装git,但没有安装zlib-devel库。我已经从RPM中提取了这些库,但无法弄清楚如何让make识别它们。我收到以下消息:


cache.h:17:18:错误:zlib.h:没有这样的文件或目录


尝试了以下操作:

  CFLAGS =' -  I $ HOME / root / usr / include -L $ HOME / root / usr / lib64'make 

但这似乎不起作用。我也尝试设置

  C_INCLUDE_PATH ='$ HOME / root / usr / include 

再一次,没有运气。有任何想法吗?不用说,zlib.h位于$ HOME / root / usr / include中。

解决方案

这可以在我自己的Linux机器上使用 CPPFLAGS 来指定您的附加包含目录。 $ b

/ p>

  CPPFLAGS = -  I $ HOME / root / usr / include./configure 

另外,如果您尝试创建64位版本,则不会指定使用64位库链接到某个位置以使其发生。相反,您可以在 CFLAGS 中传递 -m64 编译器标志,如下所示:

  CFLAGS = -  m64CPPFLAGS = -  I $ HOME / root / usr / include./configure 

如果您必须指定其他非标准库目录,请使用 LDFLAGS


I'm trying to compile and install git on a shared RHEL5 host, but have no zlib-devel libraries installed. I've extracted the libraries from the RPM, but can't work out how to get make to recognise them. I get the following message:

cache.h:17:18: error: zlib.h: No such file or directory

Have tried the following:

CFLAGS='-I$HOME/root/usr/include -L$HOME/root/usr/lib64' make

but this doesn't seem to work. I've also tried setting

C_INCLUDE_PATH='$HOME/root/usr/include

Again, no luck. Any ideas? Needless to say, zlib.h is in $HOME/root/usr/include.

解决方案

Updated as I tried this on my own Linux machine

You can use CPPFLAGS to specify your additional include directories.

CPPFLAGS="-I $HOME/root/usr/include" ./configure 

Also, if you are trying to make a 64-bit version, you do not specify linking to a location with 64-bit libraries to make it happen. Instead, you pass the -m64 compiler flag in your CFLAGS, like this:

CFLAGS="-m64" CPPFLAGS="-I $HOME/root/usr/include" ./configure

And if you have to specify additional non-standard library directories, use LDFLAGS.

这篇关于在没有zlib-devel的情况下编译共享主机上的git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆