Chinaunix首页 | 论坛 | 博客
  • 博客访问: 97697
  • 博文数量: 12
  • 博客积分: 477
  • 博客等级: 下士
  • 技术积分: 139
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-31 15:38
文章分类

全部博文(12)

文章存档

2014年(1)

2011年(2)

2010年(9)

分类: LINUX

2010-11-09 13:43:30

今天要在RH9下使用GIT了,开始决定自己通过源码安装
安装步骤首先是make

[root@microsoft git]# make
GIT_VERSION = 1.7.3.1
    * new build flags or prefix
    CC fast-import.o
In file included from /usr/include/openssl/ssl.h:179,
                 from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory
In file included from /usr/include/openssl/ssl.h:179,
                 from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/openssl/kssl.h:132: parse error before "krb5_enctype"
/usr/include/openssl/kssl.h:134: parse error before "FAR"
/usr/include/openssl/kssl.h:135: parse error before '}' token
/usr/include/openssl/kssl.h:147: parse error before "kssl_ctx_setstring"
/usr/include/openssl/kssl.h:147: parse error before '*' token
/usr/include/openssl/kssl.h:148: parse error before '*' token
/usr/include/openssl/kssl.h:149: parse error before '*' token
/usr/include/openssl/kssl.h:149: parse error before '*' token
/usr/include/openssl/kssl.h:150: parse error before '*' token
/usr/include/openssl/kssl.h:151: parse error before "kssl_ctx_setprinc"
/usr/include/openssl/kssl.h:151: parse error before '*' token
/usr/include/openssl/kssl.h:153: parse error before "kssl_cget_tkt"
/usr/include/openssl/kssl.h:153: parse error before '*' token
/usr/include/openssl/kssl.h:155: parse error before "kssl_sget_tkt"
/usr/include/openssl/kssl.h:155: parse error before '*' token
/usr/include/openssl/kssl.h:157: parse error before "kssl_ctx_setkey"
/usr/include/openssl/kssl.h:157: parse error before '*' token
/usr/include/openssl/kssl.h:159: parse error before "context"
/usr/include/openssl/kssl.h:160: parse error before "kssl_build_principal_2"
/usr/include/openssl/kssl.h:160: parse error before "context"
/usr/include/openssl/kssl.h:163: parse error before "kssl_validate_times"
/usr/include/openssl/kssl.h:163: parse error before "atime"
/usr/include/openssl/kssl.h:165: parse error before "kssl_check_authent"
/usr/include/openssl/kssl.h:165: parse error before '*' token
/usr/include/openssl/kssl.h:167: parse error before "enctype"
In file included from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/openssl/ssl.h:909: parse error before "KSSL_CTX"
/usr/include/openssl/ssl.h:931: parse error before '}' token
make: *** [fast-import.o] Error 1
我开始检查gcc的版本
[root@microsoft git]# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
==================================================================================
后来发现是这个原因导致的:
解决Red Hat Linux 9 发生"krb5.h: No such file or directory" 错误的方法
有在Red Hat Linux 9.0 上面build 一些要用到openssl 的程式的人,蛮容易遇到类似这样的错误:


gcc -DLINUX -I.. -I../include -I/usr/include -O2 -g -pipe -march=athlon -Wall -c mod_tls.c
In file included from /usr/include/openssl/ssl.h:179,
                 
from mod_tls.c:40:
/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory


这是因为Red Hat Linux 9.0 的krb5-devel 套件把kerberos 的include file 放到了/usr/kerberos/include 里面,而不是一般位置的/usr/include 这个目录。而openssl 支援kerberos,因此在compile 使用到openssl 的程式就很容易发生找不到kerberos 的include file 的错误。

而解决的办法相当简单,首先当然要确定krb5-devel 以及krb5-libs 等套件确实有安装在系统上,而不是根本没安装;接下来,建立以下的symbolic links:
ln -s /usr/kerberos/include/com_err.h /usr/include/
ln -s /usr/kerberos/include/profile.h /usr/include/
ln -s /usr/kerberos/include/krb5.h /usr/include/

===================================================================================
[root@microsoft git]# ln -s /usr/kerberos/include/krb5.h /usr/include/
[root@microsoft git]# make
    CC fast-import.o
In file included from /usr/include/openssl/kssl.h:72,
                 from /usr/include/openssl/ssl.h:179,
                 from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/krb5.h:138:25: profile.h: No such file or directory
In file included from /usr/include/openssl/kssl.h:72,
                 from /usr/include/openssl/ssl.h:179,
                 from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/krb5.h:2064: parse error before "profile_t"
/usr/include/krb5.h:2722:21: com_err.h: No such file or directory
/usr/include/krb5.h:2981:21: com_err.h: No such file or directory
/usr/include/krb5.h:3033:21: com_err.h: No such file or directory
/usr/include/krb5.h:3110:21: com_err.h: No such file or directory
make: *** [fast-import.o] Error 1
[root@microsoft git]# ln -s /usr/kerberos/include/com_err.h /usr/include/
[root@microsoft git]# make
    CC fast-import.o
In file included from /usr/include/openssl/kssl.h:72,
                 from /usr/include/openssl/ssl.h:179,
                 from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/krb5.h:138:25: profile.h: No such file or directory
In file included from /usr/include/openssl/kssl.h:72,
                 from /usr/include/openssl/ssl.h:179,
                 from git-compat-util.h:140,
                 from builtin.h:4,
                 from fast-import.c:147:
/usr/include/krb5.h:2064: parse error before "profile_t"
make: *** [fast-import.o] Error 1
[root@microsoft git]# ln -s /usr/kerberos/include/profile.h /usr/include/
[root@microsoft git]# make

该错误解决,编译继续进行
    CC remote-curl.o
remote-curl.c: In function `post_rpc':
remote-curl.c:395: `CURLOPT_ENCODING' undeclared (first use in this function)
remote-curl.c:395: (Each undeclared identifier is reported only once
remote-curl.c:395: for each function it appears in.)
make: *** [remote-curl.o] Error 1

最终,我将remote-curl.c的395行直接注释,错误没有了.
[root@microsoft git]# make prefix=/usr install install-doc install-html install-info
make[1]: Entering directory `/home/code/git/Documentation'
    GEN doc.dep
make[2]: Entering directory `/home/code/git'
make[2]: `GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory `/home/code/git'
make[1]: Leaving directory `/home/code/git/Documentation'
make[1]: Entering directory `/home/code/git/Documentation'
make[2]: Entering directory `/home/code/git'
make[2]: `GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory `/home/code/git'
    ASCIIDOC git-add.xml
/bin/sh: line 1: asciidoc: command not found
make[1]: *** [git-add.xml] Error 127
make[1]: Leaving directory `/home/code/git/Documentation'
make: *** [install-doc] Error 2
[root@microsoft git_use]# rpm -ivh
warning: asciidoc-5.1.1-1.rh9.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:asciidoc               ########################################### [100%]
[root@microsoft git]# make prefix=/usr install install-doc install-html install-info
make -C Documentation install
make[1]: Entering directory `/home/code/git/Documentation'
make[2]: Entering directory `/home/code/git'
make[2]: `GIT-VERSION-FILE' is up to date.
make[2]: Leaving directory `/home/code/git'
    ASCIIDOC git-add.xml
asciidoc: unexpected exit status: option -a not recognized
option -a not recognized
make[1]: *** [git-add.xml] Error 1
make[1]: Leaving directory `/home/code/git/Documentation'
make: *** [install-doc] Error 2

[root@microsoft git_use]# rpm -ivh
warning: yum-2.0.8-0.1.rh9.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:yum                    ########################################### [100%]



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