AC_CONFIG_FILES([$1.tmp:$1.in],
CVC4_COPY_IF_CHANGED([$1.tmp],[$1]))
])# CVC4_CONFIG_FILE_ONLY_IF_CHANGED
+
+# CVC4_CXX_OPTION(OPTION, VAR)
+# ----------------------------
+# Run $(CXX) $(CPPFLAGS) $(CXXFLAGS) OPTION and see if the compiler
+# likes it. If so, add OPTION to shellvar VAR.
+AC_DEFUN([CVC4_CXX_OPTION], [
+AC_MSG_CHECKING([whether $CXX supports $1])
+cvc4_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $1"
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([int main() { return 0; }],
+ [AC_MSG_RESULT([yes]); $2='$1'],
+ [AC_MSG_RESULT([no])])
+AC_LANG_POP([C++])
+CXXFLAGS="$cvc4_save_CXXFLAGS"
+])# CVC4_CXX_OPTION
# Check for ANTLR runantlr script (defined in config/antlr.m4)
AC_PROG_ANTLR
+CVC4_CXX_OPTION([-Wno-conversion-null], [WNO_CONVERSION_NULL])
+AC_SUBST([WNO_CONVERSION_NULL])
+
# Doxygen configuration
AC_ARG_ENABLE([internals-documentation],
[AS_HELP_STRING([--enable-internals-documentation],
AM_CPPFLAGS = \
-D__BUILDING_CVC4PARSERLIB \
-I@srcdir@/../../include -I@srcdir@/../.. -I@builddir@/../.. $(ANTLR_INCLUDES)
-AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) -Wno-unused-function -Wno-unused-variable -Wno-conversion-null
+AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN) -Wno-unused-function -Wno-unused-variable $(WNO_CONVERSION_NULL)
# Compile generated C files using C++ compiler
CC=$(CXX)
diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
# .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
.PHONY: Debug_tags.tmp Trace_tags.tmp
+# The "sed" invocation below is particularly obnoxious, but it works around
+# inconsistencies in REs on different platforms, using only a basic regular
+# expression (no |, no \<, ...).
Debug_tags.tmp Trace_tags.tmp:
$(AM_V_GEN)\
- grep '[^a-zA-Z0-9_]$(@:_tags.tmp=) *( *\".*\" *)' \
+ grep '\<$(@:_tags.tmp=) *( *\".*\" *)' \
`find @srcdir@/../ -name "*.cpp" -or -name "*.h" -or -name "*.cc" -or -name "*.g"` | \
- sed 's/.*[^a-zA-Z0-9_]$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/g' | sort | uniq >"$@"
+ sed 's/^$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/;s/.*[^a-zA-Z0-9_]$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/' | sort | uniq >"$@"
if CVC4_CLN_IMP
libutil_la_SOURCES += \