- 论坛徽章:
- 1
|
SCO UNIX 环境下的 cscope 使用非常方便,可以用它来来快速定位函数的定义,查找函数的原型。
但是AIX 环境下没有,好在cscope 被 SCO 给开源了,SCO 也终于做了回好事,到这里下载源码
http://iamphet.nm.ru/cscope/cscope.src.tar.bz2
然后,将包上传到AIX 环境下,建一目录,将包cscope.src.tar.bz2展开,AIX 下有展开程序,然
后按照说明顺序执行
./configure
make
make install
但是,在执行make 的时候,系统提示如下错误信息:
source='scanner.c' object='scanner.o' libtool=no DEPDIR=.deps depmode=
ix /bin/sh ../depcomp cc -qlanglvl=ansi -DHAVE_CONFIG_H -I. -I. -I.. -g -
scanner.c
"invlib.h", line 100.9: 1506-398 (W) Bit-field type specified for fileindex is
on-portable. The type should be signed int, unsigned int or int.
"scanner.c", line 322.45: 1506-068 (S) Operation between types "int*" and "int"
is not allowed.
"scanner.c", line 323.45: 1506-068 (S) Operation between types "int*" and "int"
is not allowed.
"scanner.c", line 769.29: 1506-068 (S) Operation between types "int*" and "int"
is not allowed.
"scanner.c", line 770.29: 1506-068 (S) Operation between types "int*" and "int"
is not allowed.
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
初步怀疑是函数定义的问题,进入 src 目录,打开scanner.c 文件,定位到 322 行,发现有函数
mycalloc ,执行 grep mycalloc *.h 命令,发现在 alloc.h 中有 该函数定义,打开 alloc.h 文
件,在该文件最下面有如下几行
#ifndef CSCOPE_ALLOC_H
#define CSCOPE_ALLOC_H
#include <string.h>
/* memory allocation support */
void *mycalloc(size_t nelem, size_t size);
void *mymalloc(size_t size);
void *myrealloc(void *p, size_t size);
void *my_strdup(char *s);
#endif /* CSCOPE_ALLOC_H */
将 void 所在 4行复制到 scanner.c 中,重新执行 make ,问题解决,
执行make install , 系统要往 /usr/local/bin 及其他目录下安装,需要有root 用户权限,在好友
丁丁的帮助下,安装成功!抽时间看了看说明文档,发现其实可以指定安装目录的,及在执行
configure 的时候加 prefix 参数即可,命令如下:
./configure --prefix=安装目录
[ 本帖最后由 lijunling 于 2009-7-23 10:50 编辑 ] |
|