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