免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2645 | 回复: 1
打印 上一主题 下一主题

[新手入门] AIX 环境下编译 cscope 通过! [复制链接]

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-08-11 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-23 10:47 |只看该作者 |倒序浏览
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 编辑 ]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2009-07-23 14:32 |只看该作者
Congratulations
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP