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