progdir="$(abs_builddir)$(bindir)"; file=cvc4; \
eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
-endif
-ifeq ($(BUILDING_STATIC),1)
-# if we're building static libs, just install them directly
+else
+# if we're building static libs only, just install the driver binary directly
$(install_sh) \
$(CURRENT_BUILD)/src/main/cvc4 \
"$(abs_builddir)$(bindir)"
thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; file=cvc4; \
eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
-endif
-ifeq ($(BUILDING_STATIC),1)
-# if we're building static libs, just install them directly
+else
+# if we're building static libs only, just install the driver binary directly
$(install_sh) $(CURRENT_BUILD)/src/main/cvc4 "`pwd`$(bindir)"
endif
# set up builds/bin and builds/lib
if test "$enable_static" = yes; then BUILDING_STATIC=1; fi
AC_SUBST(BUILDING_SHARED)
AC_SUBST(BUILDING_STATIC)
+AM_CONDITIONAL([STATIC_BINARY], [test "$enable_shared" != yes -a "$enable_static" = yes])
AC_SUBST(CVC4_LIBRARY_VERSION)
AC_SUBST(CVC4_PARSER_LIBRARY_VERSION)
../parser/libcvc4parser.la \
../libcvc4.la
+if STATIC_BINARY
+cvc4_LINK = $(CXXLINK) -all-static
+else
cvc4_LINK = $(CXXLINK)
+endif
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;
}
}