diff options
author | T. Wouters <thomas@python.org> | 2017-05-23 05:25:17 (GMT) |
---|---|---|
committer | Ćukasz Langa <lukasz@langa.pl> | 2017-05-23 05:25:17 (GMT) |
commit | 07a40a16238995e2b6b9ab1d5fc3a30bcd63d955 (patch) | |
tree | 77091578c7937982b5a0a8267edbb6065640a518 /configure | |
parent | e8412e684ed741df246e8430f4911b31b0d8be1f (diff) | |
download | cpython-07a40a16238995e2b6b9ab1d5fc3a30bcd63d955.zip cpython-07a40a16238995e2b6b9ab1d5fc3a30bcd63d955.tar.gz cpython-07a40a16238995e2b6b9ab1d5fc3a30bcd63d955.tar.bz2 |
[3.6] Add --with-assertions configure flag to enable C assertions(GH-1731) (#1739)
Defaults to 'no', but as before assertions are implied by --with-pydebug..
(cherry picked from commit ddbfa2c35b298a56f0b813656745bca9cb7334f1)
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -818,6 +818,7 @@ with_suffix enable_shared enable_profiling with_pydebug +with_assertions enable_optimizations with_lto with_hash_algorithm @@ -1513,6 +1514,7 @@ Optional Packages: compiler --with-suffix=.exe set executable suffix --with-pydebug build with Py_DEBUG defined + --with-assertions build with C assertions enabled --with-lto Enable Link Time Optimization in PGO builds. Disabled by default. --with-hash-algorithm=[fnv|siphash24] @@ -6515,6 +6517,33 @@ $as_echo "no" >&6; } fi +# Check for --with-assertions. Py_DEBUG implies assertions, but also changes +# the ABI. This allows enabling assertions without changing the ABI. +assertions='false' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-assertions" >&5 +$as_echo_n "checking for --with-assertions... " >&6; } + +# Check whether --with-assertions was given. +if test "${with_assertions+set}" = set; then : + withval=$with_assertions; +if test "$withval" != no +then + assertions='true' +fi +fi + +if test "$assertions" = 'true'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +elif test "$Py_DEBUG" = 'true'; then + assertions='true' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: implied by --with-pydebug" >&5 +$as_echo "implied by --with-pydebug" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + # Enable optimization flags @@ -7424,7 +7453,7 @@ case "$CC" in ;; esac -if test "$Py_DEBUG" = 'true'; then +if test "$assertions" = 'true'; then : else OPT="-DNDEBUG $OPT" |