From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 3B07C3858D35 for ; Sat, 26 Feb 2022 04:53:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B07C3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id AE61834300A; Sat, 26 Feb 2022 04:53:34 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH] libgloss: use m4_foreach_w to simplify the logic a bit Date: Fri, 25 Feb 2022 23:53:35 -0500 Message-Id: <20220226045335.1278-1-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Feb 2022 04:53:39 -0000 It's functionally the same, but the configure.ac code is simpler and less boiler plate duplicated. --- libgloss/configure | 34 +++++++++++++++++----------------- libgloss/configure.ac | 12 +++++++----- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/libgloss/configure b/libgloss/configure index 5b5146f3ed1d..b50c9065a900 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -629,10 +629,10 @@ CPPFLAGS LDFLAGS CFLAGS CC -CONFIG_LIBNOSYS_FALSE -CONFIG_LIBNOSYS_TRUE CONFIG_WINCE_FALSE CONFIG_WINCE_TRUE +CONFIG_LIBNOSYS_FALSE +CONFIG_LIBNOSYS_TRUE CONFIG_IQ2000_FALSE CONFIG_IQ2000_TRUE CONFIG_BFIN_FALSE @@ -2958,7 +2958,7 @@ subdirs="$subdirs aarch64" ;; esac - if test x$config_bfin = xtrue; then + if test x$config_bfin = xtrue; then CONFIG_BFIN_TRUE= CONFIG_BFIN_FALSE='#' else @@ -2966,7 +2966,7 @@ else CONFIG_BFIN_FALSE= fi - if test x$config_iq2000 = xtrue; then + if test x$config_iq2000 = xtrue; then CONFIG_IQ2000_TRUE= CONFIG_IQ2000_FALSE='#' else @@ -2974,7 +2974,15 @@ else CONFIG_IQ2000_FALSE= fi - if test x$config_wince = xtrue; then + if test x$config_libnosys = xtrue; then + CONFIG_LIBNOSYS_TRUE= + CONFIG_LIBNOSYS_FALSE='#' +else + CONFIG_LIBNOSYS_TRUE='#' + CONFIG_LIBNOSYS_FALSE= +fi + + if test x$config_wince = xtrue; then CONFIG_WINCE_TRUE= CONFIG_WINCE_FALSE='#' else @@ -2984,14 +2992,6 @@ fi - if test x$config_libnosys = xtrue; then - CONFIG_LIBNOSYS_TRUE= - CONFIG_LIBNOSYS_FALSE='#' -else - CONFIG_LIBNOSYS_TRUE='#' - CONFIG_LIBNOSYS_FALSE= -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5195,14 +5195,14 @@ if test -z "${CONFIG_IQ2000_TRUE}" && test -z "${CONFIG_IQ2000_FALSE}"; then as_fn_error $? "conditional \"CONFIG_IQ2000\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${CONFIG_WINCE_TRUE}" && test -z "${CONFIG_WINCE_FALSE}"; then - as_fn_error $? "conditional \"CONFIG_WINCE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${CONFIG_LIBNOSYS_TRUE}" && test -z "${CONFIG_LIBNOSYS_FALSE}"; then as_fn_error $? "conditional \"CONFIG_LIBNOSYS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CONFIG_WINCE_TRUE}" && test -z "${CONFIG_WINCE_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_WINCE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 43e7916631e0..6ed848dd563a 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -237,9 +237,13 @@ case "${target}" in ;; esac -AM_CONDITIONAL(CONFIG_BFIN, test x$config_bfin = xtrue) -AM_CONDITIONAL(CONFIG_IQ2000, test x$config_iq2000 = xtrue) -AM_CONDITIONAL(CONFIG_WINCE, test x$config_wince = xtrue) +dnl These subdirs have converted to non-recursive make. Hopefully someday all +dnl the ports above will too! +m4_foreach_w([SUBDIR], [ + bfin iq2000 libnosys wince +], [dnl + AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue) +]) dnl For now, don't bother configuring testsuite dnl @@ -247,8 +251,6 @@ dnl if test "${config_testsuite}" = "true"; dnl then AC_CONFIG_SUBDIRS([testsuite]) dnl fi -AM_CONDITIONAL(CONFIG_LIBNOSYS, test x$config_libnosys = xtrue) - AC_PROG_CC AM_PROG_AS AM_PROG_AR -- 2.34.1