From patchwork Wed Dec 16 14:22:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1417198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TDO+H5OT; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cwy5Z5DZqz9sRf for ; Thu, 17 Dec 2020 01:22:58 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D93693835095; Wed, 16 Dec 2020 14:22:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by sourceware.org (Postfix) with ESMTPS id 998BD386F022 for ; Wed, 16 Dec 2020 14:22:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 998BD386F022 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qt1-x82b.google.com with SMTP id z20so17260955qtq.3 for ; Wed, 16 Dec 2020 06:22:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=QVt7Hy0OiX9ymr7WbjxhhaWqtlQp/BvMHBGd9ADfhyE=; b=TDO+H5OTiPiLQaXZnS0WxdpjzVetqVqkJP/I/knUVGKeIXhFF4VZ3314BBR/TDL9rw SyO3yR/WG38swtTRhwlP5miZJBYTkgh1JIwhsTKTLYvF3p4ptPPXwvXmh1HQm9yxmglb +bXGkXneW/SVvoIRD+q7MoztLYL3OAIfe/iolkoBQ9CXfwKSxqBa8GRECx2SJIs0JdV6 srpKgVKdinn9da4C6Ic/5Ig5y9nYTAlgm5HzJPBsGm6GmNZNsfA6YAxcz59qpqHmAJzI G/JBiyfXJqW0PN4GN/FxE9AF5PJBH27lQitM7RsmMP2GPt2Vfr7gQ8Wv7IlR85QmE/0k bUNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=QVt7Hy0OiX9ymr7WbjxhhaWqtlQp/BvMHBGd9ADfhyE=; b=ovtd0PCeKfgl0f5t4zzeLojqDDxr/Ez0oqKTAjtgNcBSIUwSAiob1t7Cb1y+ZKnXpS Y9ebK9sp42OH+IDFOC3l46ij43FHABpOSfdfeV9K5TA2F4ODem+0lH7Cl7kKAcp9dM6P p8gE/Vgexg7CRgIufdHJore1gyGlxmyVfq4HlSKWvX917g7obEMnMxI/gvadLT0EoDb9 jCPnqqTglZBC4GMUk5MppFlcZbzNoo1sa4wI44EGDe5O5Y4Fa7p8QJW/Vo04tSe5LlWj 04VTySXZNPC9d7h7HKClv52tG7kb0dQSfBIncAgOMpBLvhN5/v6Yw9m1oRL7IauHyAUS S/SQ== X-Gm-Message-State: AOAM531oeVeHOor+75QepKyFzQzPn4X4w07pacBkfCd5yQhSmqHIF8vU yOnr0Wh4Pc7Q92X8PxOy5do= X-Google-Smtp-Source: ABdhPJzkBwFl9xEMEHSL+z0HCAjXozVETXrH1aagXHxD3d/U8AVrACsfOuVgk9xCwQPY0Y5vZ00F2Q== X-Received: by 2002:ac8:4445:: with SMTP id m5mr43391334qtn.179.1608128570893; Wed, 16 Dec 2020 06:22:50 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:58ca:9b62:2bcb:bb64? ([2620:10d:c091:480::1:a32c]) by smtp.googlemail.com with ESMTPSA id a5sm1064430qtn.57.2020.12.16.06.22.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Dec 2020 06:22:50 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: libcody: fix --enable-checking=... [PR 98311] Message-ID: <95f51965-abd5-20f7-f118-981f7f834f49@acm.org> Date: Wed, 16 Dec 2020 09:22:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Thanks Jakub for pointing at libcpp. The -enable-checking configure code in libcody didn't play well with us. This just uses libcpp's configurey for that piece. libcody/ * configure.ac: Use libcpp's enable-checking code. * configure: Rebuilt. pushing to trunk diff --git i/libcody/configure w/libcody/configure index 4cc03dcaa3a..76ff932d61b 100755 --- i/libcody/configure +++ w/libcody/configure @@ -1285,7 +1285,11 @@ Optional Features: --enable-maintainer-mode enable maintainer mode. Add rules to rebuild configurey bits - --enable-checking enable run-time checking + --enable-checking[=LIST] + enable expensive run-time checks. With LIST, enable + only specific categories of checks. Categories are: + yes,no,all,none,release. Flags are: misc,valgrind or + other strings --enable-exceptions enable exceptions & rtti Optional Packages: @@ -2708,30 +2712,45 @@ _ACEOF # Check whether --enable-checking was given. if test "${enable_checking+set}" = set; then : - enableval=$enable_checking; + enableval=$enable_checking; ac_checking_flags="${enableval}" else - enable_checking="yes" + +# Determine the default checks. +if test x$is_release = x ; then + ac_checking_flags=yes +else + ac_checking_flags=release +fi fi -case $enable_checking in #( - yes|all|yes,*) : - nms_checking=yes ;; #( - no|none|release) : - nms_checking= ;; #( - *) : - as_fn_error $? "unknown check \"$enable_checking\"" "$LINENO" 5 ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking checking" >&5 -$as_echo_n "checking checking... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${nms_checking:-no}" >&5 -$as_echo "${nms_checking:-no}" >&6; } -if test "$nms_checking" = yes ; then +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in release $ac_checking_flags +do + case $check in + # these set all the flags to specific states + 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 + *) ;; + esac +done +IFS="$ac_save_IFS" -cat >>confdefs.h <<_ACEOF -#define NMS_CHECKING 0${nms_checking:+1} -_ACEOF +if test x$ac_checking != x ; then + +$as_echo "#define NMS_CHECKING 1" >>confdefs.h + +else + $as_echo "#define NMS_CHECKING 0" >>confdefs.h fi + + # Check whether --enable-exceptions was given. if test "${enable_exceptions+set}" = set; then : enableval=$enable_exceptions; diff --git i/libcody/configure.ac w/libcody/configure.ac index 31f041e6679..c3db5534f1f 100644 --- i/libcody/configure.ac +++ w/libcody/configure.ac @@ -24,7 +24,47 @@ NMS_LINK_OPT([-Wl,--no-undefined]) NMS_CONFIG_FILES([gdbinit dox.cfg]) NMS_BUGURL -NMS_ENABLE_CHECKING +dnl NMS_ENABLE_CHECKING +dnl cloned from ../libcpp/configure.ac +AC_ARG_ENABLE(checking, +[AS_HELP_STRING([[--enable-checking[=LIST]]], + [enable expensive run-time checks. With LIST, + enable only specific categories of checks. + Categories are: yes,no,all,none,release. + Flags are: misc,valgrind or other strings])], +[ac_checking_flags="${enableval}"],[ +# Determine the default checks. +if test x$is_release = x ; then + ac_checking_flags=yes +else + ac_checking_flags=release +fi]) +IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," +for check in release $ac_checking_flags +do + case $check in + # these set all the flags to specific states + 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 + *) ;; + esac +done +IFS="$ac_save_IFS" + +if test x$ac_checking != x ; then + AC_DEFINE(NMS_CHECKING, 1, +[Define to 1 if you want more run-time sanity checks.]) +else + AC_DEFINE(NMS_CHECKING, 0) +fi + + NMS_ENABLE_EXCEPTIONS AC_CONFIG_HEADERS([config.h])