我目前正在尝试在本地 openSUSE Leap 15.2 发行版中安装 Splint(没有 sudo 权限)。
我尝试按照说明进行操作这里:
在我的主目录中:
git clone https://github.com/splintchecker/splint
splint
之后我进入了目录。下一条指令是运行configure
。但不存在这样的文件。遵循建议这里,我跑了:
autoreconf -i
进而:
./configure
make
至此,构建似乎成功了。所以我尝试跑步splint
并收到一条command-not-found
消息。
答案这里似乎建议运行make install
,所以我接下来尝试了,但没有成功。
我还应该采取其他一些步骤吗?我是不是哪里搞砸了?
编辑:
这是 的输出make
。输出太长,所以我把它截断了。
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /home/styx/splint/config-aŭ/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make all-recursive
make[1]: Entering directory '/home/styx/splint'
Making all in src
make[2]: Entering directory '/home/styx/splint/src'
bison -v -t -d --debug --no-lines -p lsl signature.y
signature.tab.h generated
cat bison.head signature.tab.h bison.reset >signature_gen.h
bison -v -t -d --debug --no-lines cgrammar.y
cgrammar.y: warning: 159 shift/reduce conflicts [-Wconflicts-sr]
cgrammar.y: warning: 123 reduce/reduce conflicts [-Wconflicts-rr]
* Note: Expect 159 shift/reduce conflicts and 123 reduce/reduce conflicts. (see cgrammar.y for explanation)
cgrammar.tab.h generated
cat bison.head cgrammar.tab.h bison.reset | /usr/bin/sed 's/YYSTYPE/cgrammar_YYSTYPE/g' | /usr/bin/sed 's/lsllex/cgrammar_lsllex/g' >cgrammar_tokens.h
bison -v -t -d --debug --no-lines -p yl llgrammar.y
llgrammar.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
* Note: Expect 2 shift/reduce conflicts
llgrammar.tab.h generated
cat bison.head llgrammar.tab.h bison.reset >llgrammar_gen.h
bison -v -t -d --debug --no-lines -p mt mtgrammar.y
mtgrammar.y: warning: 11 shift/reduce conflicts [-Wconflicts-sr]
* Note: Expect 11 shift/reduce conflicts.
mtgrammar.tab.h generated
cat bison.head mtgrammar.tab.h bison.reset >mtgrammar_tokens.h
flex -L -o cscanner.lex.c cscanner.l
cat flex.head cscanner.lex.c flex.reset | /usr/bin/sed 's/YYSTYPE/cgrammar_YYSTYPE/g' | /usr/bin/sed 's/lsllex/cgrammar_lsllex/g' >cscanner.c
cat bison.head cgrammar.tab.c bison.reset | /usr/bin/sed 's/YYSTYPE/cgrammar_YYSTYPE/g' | /usr/bin/sed 's/lsllex/cgrammar_lsllex/g' >cgrammar.c
cat bison.head mtgrammar.tab.c bison.reset >mtgrammar.c
cat bison.head llgrammar.tab.c bison.reset >llgrammar.c
cat bison.head signature.tab.c bison.reset >signature.c
/usr/bin/grep "FLG_" flags.def >flag_codes.gen
make all-am
make[3]: Entering directory '/home/styx/splint/src'
gcc -DHAVE_CONFIG_H -I. -I.. -I./Headers -I. -g -O2 -MT cscanner.o -MD -MP -MF .deps/cscanner.Tpo -c -o cscanner.o cscanner.c
mv -f .deps/cscanner.Tpo .deps/cscanner.Po
...
...
...
gcc -DHAVE_CONFIG_H -I. -I.. -I./Headers -I. -g -O2 -MT lsymbol.o -MD -MP -MF .deps/lsymbol.Tpo -c -o lsymbol.o lsymbol.c
mv -f .deps/lsymbol.Tpo .deps/lsymbol.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I./Headers -I. -g -O2 -MT mapping.o -MD -MP -MF .deps/mapping.Tpo -c -o mapping.o mapping.c
mv -f .deps/mapping.Tpo .deps/mapping.Po
gcc -g -O2 -o splint cscanner.o cgrammar.o mtgrammar.o llgrammar.o signature.o cppmain.o cpplib.o cppexp.o cpphash.o cpperror.o context.o uentry.o cprim.o macrocache.o qual.o qtype.o stateClause.o stateClauseList.o ctype.o cvar.o clabstract.o idDecl.o clause.o globalsClause.o modifiesClause.o warnClause.o functionClause.o functionClauseList.o metaStateConstraint.o metaStateConstraintList.o metaStateExpression.o metaStateSpecifier.o functionConstraint.o pointers.o cscannerHelp.o structNames.o transferChecks.o varKinds.o nameChecks.o exprData.o cstring.o fileloc.o message.o inputStream.o fileTable.o cstringTable.o valueTable.o stateValue.o llerror.o messageLog.o flagMarker.o aliasTable.o ynm.o sRefTable.o genericTable.o ekind.o usymtab.o multiVal.o lltok.o sRef.o lcllib.o randomNumbers.o fileLib.o globals.o flags.o general.o osd.o reader.o mtreader.o clauseStack.o filelocStack.o cstringList.o cstringSList.o sRefSetList.o ctypeList.o enumNameList.o enumNameSList.o exprNodeList.o exprNodeSList.o uentryList.o fileIdList.o filelocList.o qualList.o sRefList.o flagMarkerList.o idDeclList.o flagSpec.o globSet.o intSet.o typeIdSet.o guardSet.o usymIdSet.o sRefSet.o mtscanner.o stateInfo.o stateCombinationTable.o metaStateTable.o metaStateInfo.o annotationTable.o annotationInfo.o mttok.o mtDeclarationNode.o mtDeclarationPieces.o mtDeclarationPiece.o mtContextNode.o mtValuesNode.o mtDefaultsNode.o mtAnnotationsNode.o mtMergeNode.o mtAnnotationList.o mtAnnotationDecl.o mtTransferClauseList.o mtTransferClause.o mtTransferAction.o mtLoseReferenceList.o mtLoseReference.o mtDefaultsDeclList.o mtDefaultsDecl.o mtMergeItem.o mtMergeClause.o mtMergeClauseList.o exprNode.o exprChecks.o llmain.o help.o rcfiles.o constraintList.o constraintResolve.o constraintGeneration.o constraintTerm.o constraintExprData.o constraintExpr.o constraint.o loopHeuristics.o lsymbolSet.o sigNodeSet.o lslOpSet.o sortSet.o initDeclNodeList.o sortList.o declaratorInvNodeList.o interfaceNodeList.o sortSetList.o declaratorNodeList.o letDeclNodeList.o stDeclNodeList.o storeRefNodeList.o lslOpList.o lsymbolList.o termNodeList.o ltokenList.o traitRefNodeList.o pairNodeList.o typeNameNodeList.o fcnNodeList.o paramNodeList.o programNodeList.o varDeclarationNodeList.o varNodeList.o quantifierNodeList.o replaceNodeList.o importNodeList.o tokentable.o scan.o scanline.o lslparse.o lh.o checking.o lclctypes.o imports.o lslinit.o syntable.o usymtab_interface.o abstract.o ltoken.o lclscanline.o lclsyntable.o lcltokentable.o sort.o symtable.o lclinit.o shift.o lclscan.o lsymbol.o mapping.o -lfl
make[3]: Leaving directory '/home/styx/splint/src'
make[2]: Leaving directory '/home/styx/splint/src'
Making all in lib
make[2]: Entering directory '/home/styx/splint/lib'
../src/splint -nof -nolib +impconj standard.h -dump standard
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no warnings
../src/splint -nof -nolib +impconj -DSTRICT standard.h -dump standardstrict
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no warnings
../src/splint -nof -nolib +impconj standard.h posix.h -dump posix
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no warnings
../src/splint -nof -nolib +impconj -DSTRICT standard.h posix.h -dump posixstrict
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no warnings
../src/splint -supcounts -nof -incondefs -nolib +impconj standard.h posix.h unix.h stdio.h stdlib.h -dump unix
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no warnings
../src/splint -supcounts -nof -incondefs -nolib +impconj -DSTRICT standard.h posix.h unix.h stdio.h stdlib.h -dump unixstrict
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no warnings
make[2]: Leaving directory '/home/styx/splint/lib'
Making all in imports
make[2]: Entering directory '/home/styx/splint/imports'
LARCH_PATH="../lib:../lib" ../src/splint stdlib.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint assert.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint ctype.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint errno.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint limits.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint locale.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint math.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint setjmp.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint signal.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint stdarg.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint stdio.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint string.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint strings.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
LARCH_PATH="../lib:../lib" ../src/splint time.lcl
Splint 3.1.2 --- 05 Mar 2022
Finished checking --- no code processed
make[2]: Leaving directory '/home/styx/splint/imports'
Making all in doc
make[2]: Entering directory '/home/styx/splint/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/styx/splint/doc'
Making all in test
make[2]: Entering directory '/home/styx/splint/test'
Use make check to run the test suite
make[2]: Leaving directory '/home/styx/splint/test'
make[2]: Entering directory '/home/styx/splint'
make[2]: Leaving directory '/home/styx/splint'
make[1]: Leaving directory '/home/styx/splint'
这是以下的输出make install
:
Making install in src
make[1]: Entering directory '/home/styx/splint/src'
make install-am
make[2]: Entering directory '/home/styx/splint/src'
make[3]: Entering directory '/home/styx/splint/src'
/usr/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c splint '/usr/local/bin'
/usr/bin/install: cannot create regular file '/usr/local/bin/splint': Permission denied
make[3]: *** [Makefile:628: install-binPROGRAMS] Error 1
make[3]: Leaving directory '/home/styx/splint/src'
make[2]: *** [Makefile:976: install-am] Error 2
make[2]: Leaving directory '/home/styx/splint/src'
make[1]: *** [Makefile:970: install] Error 2
make[1]: Leaving directory '/home/styx/splint/src'
make: *** [Makefile:374: install-recursive] Error 1
答案1
如果我在评论中包含的内容有效,那么您需要将以下内容添加到您的 shell 初始化文件中。
如果bash
。
echo export PATH=/path/to/directory_of_splint:$PATH >> ~/.bashrc
如果zsh
:
echo export PATH=/path/to/directory_of_splint:$PATH >> ~/.zshrc
然后,使用以下任一方式获取该文件:
. ~/.bashrc
. ~/.zshrc
之后,您只需运行该命令,splint
因为二进制文件将通过PATH
.它以前不起作用并且您必须在目录中并使用./splint
or 的原因/path/to/directory/splint
是因为它不是,这就是您收到错误的原因。
如果您执行我上面提到的操作,则可以在登录时使用 shell 初始化文件来使用该命令,并且您可以从任何位置运行该命令,而无需位于其目录中或指定二进制文件的完整路径。
答案2
您可以splint
通过以下方式安装zypper
:
zypper addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.2/standard/openSUSE:Leap:15.2.repo
zypper refresh
zypper install splint