From c7bcb063701a2ddd17b29e7363ebb83926561979 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 10 Jan 2025 11:43:32 +0800 Subject: [PATCH] new --with-summary option 1. --with-summary option default is NO 2. prefer `source' than `.' --- auto/configure | 4 +++- auto/options | 16 ++++++++++------ auto/summary | 1 - test.sh | 8 ++++++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/auto/configure b/auto/configure index a82fc54..731c8d7 100755 --- a/auto/configure +++ b/auto/configure @@ -89,6 +89,8 @@ if [ -f "$NM_AUTO_H" ]; then END fi -. ${NORE_ROOT}/auto/summary +if [ "$NM_SUMMARY" = "YES" ]; then + source ${NORE_ROOT}/auto/summary +fi # eof diff --git a/auto/options b/auto/options index e30d651..2696d05 100644 --- a/auto/options +++ b/auto/options @@ -25,14 +25,15 @@ NM_SRC=. NM_NEW=NO -NM_ERROR=YES -NM_WARN=YES -NM_VERBOSE=NO -NM_BUILD=NO -NM_SYMBOL=YES NM_ARCH=NO -NM_STD=YES +NM_BUILD=NO +NM_ERROR=YES NM_OPTIMIZE=NO +NM_STD=YES +NM_SYMBOL=YES +NM_SUMMARY=NO +NM_VERBOSE=NO +NM_WARN=YES NM_PLATFORM= NM_CPU_CACHE_LINE= @@ -98,6 +99,7 @@ do --with-arch=*) NM_ARCH="$value" ;; --with-std=*) NM_STD="$value" ;; --with-optimize=*) NM_OPTIMIZE="$value" ;; + --with-summary=*) NM_SUMMARY="$value" ;; --has-*) if `legal_opt "$option"`; then @@ -140,6 +142,7 @@ options: --with-arch=[NO|YES|*] arch option --with-std=[YES|NO|*] language standard option --with-optimize=[NO|YES|*] optimize level option + --with-summary=[NO|YES] summarize configuration --has-* has [*] to do END @@ -181,6 +184,7 @@ NM_SYMBOL="`yes_no_opt YES $NM_SYMBOL`" NM_ARCH="`yes_no_opt NO $NM_ARCH`" NM_STD="`yes_no_opt YES $NM_STD`" NM_OPTIMIZE="`yes_no_opt NO $NM_OPTIMIZE`" +NM_SUMMARY="$(yes_no_opt NO $NM_SUMMARY)" NM_BIN_PATH="${NM_BIN_PATH:-bin}" NM_LIB_PATH="${NM_LIB_PATH:-lib}" diff --git a/auto/summary b/auto/summary index f802e81..cae9d5d 100644 --- a/auto/summary +++ b/auto/summary @@ -16,7 +16,6 @@ yes_no_any_out () { esac } - echo "Configuration summary" cat << END diff --git a/test.sh b/test.sh index fb0149a..7816773 100755 --- a/test.sh +++ b/test.sh @@ -291,6 +291,12 @@ test_nore_override_option () { test_make clean test } +test_nore_summary_option () { + test_what "CC=$CC ./configure --with-summary=yes" + test_configure --with-summary=yes + test_make clean test +} + test_nore_auto_check () { local a="auto" sed -e 's/^#//g' "${_ROOT_DIR_}/auto/check" > "${a}" @@ -311,8 +317,10 @@ test_nore_optimize_option test_nore_std_option test_nore_prefix_option test_nore_override_option +test_nore_summary_option test_nore_auto_check + # clean CI directory [ -d "${_CI_DIR_}" ] && rm -r "${_CI_DIR_}"