Compile git on shared host without zlib-devel

送分小仙女□ 提交于 2019-12-12 01:33:55

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4105839/compile-git-on-shared-host-without-zlib-devel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!