- 論壇徽章:
- 1
|
SCO UNIX 環(huán)境下的 cscope 使用非常方便,可以用它來來快速定位函數(shù)的定義,查找函數(shù)的原型。
但是AIX 環(huán)境下沒有,好在cscope 被 SCO 給開源了,SCO 也終于做了回好事,到這里下載源碼
http://iamphet.nm.ru/cscope/cscope.src.tar.bz2
然后,將包上傳到AIX 環(huán)境下,建一目錄,將包cscope.src.tar.bz2展開,AIX 下有展開程序,然
后按照說明順序執(zhí)行
./configure
make
make install
但是,在執(zhí)行make 的時候,系統(tǒng)提示如下錯誤信息:
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.
初步懷疑是函數(shù)定義的問題,進入 src 目錄,打開scanner.c 文件,定位到 322 行,發(fā)現(xiàn)有函數(shù)
mycalloc ,執(zhí)行 grep mycalloc *.h 命令,發(fā)現(xiàn)在 alloc.h 中有 該函數(shù)定義,打開 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 中,重新執(zhí)行 make ,問題解決,
執(zhí)行make install , 系統(tǒng)要往 /usr/local/bin 及其他目錄下安裝,需要有root 用戶權(quán)限,在好友
丁丁的幫助下,安裝成功!抽時間看了看說明文檔,發(fā)現(xiàn)其實可以指定安裝目錄的,及在執(zhí)行
configure 的時候加 prefix 參數(shù)即可,命令如下:
./configure --prefix=安裝目錄
[ 本帖最后由 lijunling 于 2009-7-23 10:50 編輯 ] |
|