diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Makefile.am | 4 | ||||
-rw-r--r-- | src/main/main.cpp | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/main/Makefile.am b/src/main/Makefile.am index 04d717294..79eb8c74e 100644 --- a/src/main/Makefile.am +++ b/src/main/Makefile.am @@ -15,4 +15,8 @@ cvc4_LDADD = \ ../parser/libcvc4parser.la \ ../libcvc4.la +if STATIC_BINARY +cvc4_LINK = $(CXXLINK) -all-static +else cvc4_LINK = $(CXXLINK) +endif diff --git a/src/main/main.cpp b/src/main/main.cpp index e54bbb5f6..6ebe895a5 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -68,16 +68,16 @@ int main(int argc, char *argv[]) { SmtEngine smt(&exprMgr, &options); // If no file supplied we read from standard input - bool inputFromStdin = firstArgIndex >= argc; + bool inputFromStdin = firstArgIndex >= argc || !strcmp("-", argv[firstArgIndex]); // Auto-detect input language by filename extension if(!inputFromStdin && options.lang == Parser::LANG_AUTO) { - if(!strcmp(".smt", argv[firstArgIndex] + strlen(argv[firstArgIndex]) - 4)) { + const char* filename = argv[firstArgIndex]; + unsigned len = strlen(filename); + if(len >= 4 && !strcmp(".smt", filename + len - 4)) { options.lang = Parser::LANG_SMTLIB; - } else if(!strcmp(".cvc", argv[firstArgIndex] - + strlen(argv[firstArgIndex]) - 4) - || !strcmp(".cvc4", argv[firstArgIndex] + strlen(argv[firstArgIndex]) - - 5)) { + } else if(( len >= 4 && !strcmp(".cvc", filename + len - 4) ) + || ( len >= 5 && !strcmp(".cvc4", filename + len - 5) )) { options.lang = Parser::LANG_CVC4; } } |