# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.64)
AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
AC_CONFIG_SRCDIR(ucnid.h)
AC_CONFIG_MACRO_DIR(../config)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
+AC_CHECK_TOOL(AR, ar)
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
# Dependency checking.
ZW_CREATE_DEPDIR
AC_LANG_PUSH([C++])
-AC_COMPILE_IFELSE([[int i;]], [],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [],
[AC_MSG_ERROR([C++ compiler missing or inoperational])])
AC_LANG_POP([C++])
ZW_PROG_COMPILER_DEPENDENCIES([CXX])
do
case $check in
# these set all the flags to specific states
- yes|all) ac_checking=1 ; ac_valgrind_checking= ;;
- no|none|release) ac_checking= ; ac_valgrind_checking= ;;
+ yes|all) ac_checking=1 ; ac_assert_checking=1 ; ac_valgrind_checking= ;;
+ no|none) ac_checking= ; ac_assert_checking= ; ac_valgrind_checking= ;;
+ release) ac_checking= ; ac_assert_checking=1 ; ac_valgrind_checking= ;;
# these enable particular checks
+ assert) ac_assert_checking=1 ;;
misc) ac_checking=1 ;;
valgrind) ac_valgrind_checking=1 ;;
# accept
AC_DEFINE(CHECKING_P, 0)
fi
+if test x$ac_assert_checking != x ; then
+ AC_DEFINE(ENABLE_ASSERT_CHECKING, 1,
+[Define if you want assertions enabled. This is a cheap check.])
+fi
+
if test x$ac_valgrind_checking != x ; then
AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
[Define if you want to workaround valgrind (a memory checker) warnings about
[PICFLAG=-fPIC], [PICFLAG=])
AC_SUBST(PICFLAG)
+# Enable Intel CET on Intel CET enabled host if jit is enabled.
+GCC_CET_HOST_FLAGS(CET_HOST_FLAGS)
+case x$enable_languages in
+*jit*)
+ ;;
+*)
+ CET_HOST_FLAGS=
+ ;;
+esac
+AC_SUBST(CET_HOST_FLAGS)
+
+AC_ARG_ENABLE(valgrind-annotations,
+[AS_HELP_STRING([--enable-valgrind-annotations],
+ [enable valgrind runtime interaction])], [],
+[enable_valgrind_annotations=no])
+if test x$enable_valgrind_annotations != xno \
+ || test x$ac_valgrind_checking != x; then
+ if (test $have_valgrind_h = no \
+ && test $gcc_cv_header_memcheck_h = no \
+ && test $gcc_cv_header_valgrind_memcheck_h = no); then
+ AC_MSG_ERROR([*** Can't find valgrind/memcheck.h, memcheck.h or valgrind.h])
+ fi
+ AC_DEFINE(ENABLE_VALGRIND_ANNOTATIONS, 1,
+[Define to get calls to the valgrind runtime enabled.])
+fi
+
# Output.
AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])