Bug 98311 - libcody configure checking problem
Summary: libcody configure checking problem
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Nathan Sidwell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-16 07:59 UTC by David Binderman
Modified: 2020-12-16 14:23 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-12-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2020-12-16 07:59:59 UTC
Yesterday's build was fine, today's not.

I get

configure:2624: result: ok
configure:2653: checking bugurl
configure:2670: result: github.com/urnathan/libcody
configure:2690: error: unknown check "df,extra,fold,rtl,yes"

Down in libcody/configure is

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

Git blame says:

362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2715) case $enable_checking in #(
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2716)   yes|all|yes,*) :
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2717)     nms_checking=yes ;; #(
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2718)   no|none|release) :
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2719)     nms_checking= ;; #(
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2720)   *) :
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2721)     as_fn_error $? "unknown check \"$enable_checking\"" "$LINENO" 5 ;;
362303298ac4 (Nathan Sidwell 2020-12-14 08:10:27 -0800 2722) esac
Comment 1 David Binderman 2020-12-16 08:28:36 UTC
I am also seeing some evidence that top of trunk won't build,
due to problems with the new modules source code.

Is is worth documenting here or should I raise a new bug report ?
Comment 2 Jakub Jelinek 2020-12-16 09:23:28 UTC
I think it would be desirable to follow what libcpp does with enable_checking:

# Enable expensive internal checks
is_release=
if test -f $srcdir/../gcc/DEV-PHASE \
   && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then
  is_release=yes
fi

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"

The NMS_CHECKING seems to mostly looking like either the ac_checking or ac_assert_checking, pick the one that suits better.  But it is desirable to go through the list one by one and enable/disable it as it goes, and to have the default based on DEV-PHASE.
Comment 3 Nathan Sidwell 2020-12-16 14:23:23 UTC
Fixed 4be6c4e2a4d