问题描述
我试图在共享的RHEL5主机上编译和安装git,但没有安装zlib-devel库。我已经从RPM中提取了这些库,但无法弄清楚如何让make识别它们。我收到以下消息:
尝试了以下操作:
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:
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!