From: Serhei Makarov Date: Fri, 12 Jun 2026 21:29:58 +0000 (-0400) Subject: configure.ac: rev3 for stackprof with --enable-stackprof option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8477607fde390d9cde880157f8303cd0b5fafc4f;p=thirdparty%2Felfutils.git configure.ac: rev3 for stackprof with --enable-stackprof option --- diff --git a/configure.ac b/configure.ac index da61d5f9..d0fba617 100644 --- a/configure.ac +++ b/configure.ac @@ -900,7 +900,7 @@ fi AC_CHECK_PROG(HAVE_ZSTD, zstd, yes, no) AM_CONDITIONAL([HAVE_ZSTD],[test "x$HAVE_ZSTD" = "xyes"]) -# For tests that need to use C++20 +# For tests and programs that need to use C++20 AX_CXX_COMPILE_STDCXX(20, noext, optional) AS_IF([test "x$HAVE_CXX20" = "x1"], [HAVE_CXX20=yes], [HAVE_CXX20=no]) AM_CONDITIONAL([HAVE_CXX20],[test "x$HAVE_CXX20" = "xyes"]) @@ -913,6 +913,8 @@ AS_IF([test "x$HAVE_CXX11" = "x1"], [HAVE_CXX11=yes], [HAVE_CXX11=no]) AM_CONDITIONAL([HAVE_CXX11],[test "x$HAVE_CXX11" = "xyes"]) # For eu-stackprof +AC_ARG_ENABLE([stackprof],[AS_HELP_STRING([--enable-stackprof], [Build eu-stackprof])], + [], [enable_stackprof=auto]) # optional: AC_CHECK_HEADERS([perfmon/pfmlib_perf_event.h]) AM_CONDITIONAL([HAVE_LIBPFM], [test "x${ac_cv_header_perfmon_pfmlib_perf_event_h}" = "xyes" ]) @@ -930,11 +932,17 @@ AS_IF([test "x$HAVE_CXX20" = "xyes"], [ AC_LANG_POP CXXFLAGS="$old_CXXFLAGS" ]) -AS_IF([test "x${ac_cv_header_linux_perf_event_h}x${ac_cv_have_cxx20_format_h}x${HAVE_CXX20}" = "xyesxyesxyes" ],[enable_stackprof=yes],[enable_stackprof=no]) -AM_CONDITIONAL(ENABLE_STACKPROF, test "x$enable_stackprof" = "xyes") -if test "x${ac_cv_header_linux_perf_event_h}x$enable_stackprof" = "xyesxno"; then - AC_MSG_WARN([Unable to build eu-stackprof, missing C++20 with format.h]) +if test "x$enable_stackprof" = "xno"; then + true +elif test "x${ac_cv_header_linux_perf_event_h}x${ac_cv_have_cxx20_format_h}x${HAVE_CXX20}" = "xyesxyesxyes"; then + enable_stackprof=yes +elif test "x$enable_stackprof" = "xyes"; then + AC_MSG_ERROR([Unable to build eu-stackprof, missing linux or C++20 with ]) +else + enable_stackprof=no fi +AM_CONDITIONAL([ENABLE_STACKPROF],[test "x$enable_stackprof" = "xyes"]) +AS_IF([test "x$enable_stackprof" = "xyes"],[AC_DEFINE([ENABLE_STACKPROF], [1], [Build eu-stackprof])]) AC_CHECK_HEADERS([execinfo.h])