From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62782C433E0 for ; Fri, 22 May 2020 13:07:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F354206B6 for ; Fri, 22 May 2020 13:07:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F354206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jc7O1-0002qi-5M; Fri, 22 May 2020 13:06:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jc7Nz-0002qd-Q6 for xen-devel@lists.xenproject.org; Fri, 22 May 2020 13:06:51 +0000 X-Inumbo-ID: 194ada16-9c2d-11ea-9887-bc764e2007e4 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 194ada16-9c2d-11ea-9887-bc764e2007e4; Fri, 22 May 2020 13:06:50 +0000 (UTC) Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: qZk4mYrVsw+c4Gdzpq6OaABIxRPgsXvG+P+jAtdV+8GmocgIrcBu6PXoETdAGjv6yKRWX3R5kL QI3sz9mOtBxwg3YwonKtFdFT1qRKJMfsYlBb9uEStjSVhOaq4cuMI+up5Vxs2Dp1FhEFgdH8p/ r+HM+kcaBAOp2+8zxUjtsCCfOg1Bl6qaMlHnzN7R8e4JpuhT2jAAOKqNtRigqdaiNk521BKtHW 8gJ0/CVbtCCE4uRl2CIkr+32hMkqipmchih8csZ7ByJsC+nCbUXqWYUh0ynIjenZRKkkOFe6cu CXg= X-SBRS: 2.7 X-MesageID: 18205861 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,421,1583211600"; d="scan'208";a="18205861" From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <24263.52837.360685.406105@mariner.uk.xensource.com> Date: Fri, 22 May 2020 14:06:45 +0100 To: Wei Liu Subject: Re: [PATCH] m4: use test instead of [] In-Reply-To: <20200522112457.6640-1-wl@xen.org> References: <20200522112457.6640-1-wl@xen.org> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Xen Development List , Ian Jackson , Roger Pau Monne , Bertrand Marquis Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Wei Liu writes ("[PATCH] m4: use test instead of []"): > It is reported that [] was removed by autoconf, which caused the > following error: > > ./configure: line 4681: -z: command not found > > Switch to test. That's what is used throughout our configure scripts. The reason for [ ] being removed is that configure.ac et al are processed by m4 with quote characters set to [ ]. > APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag" > done > -if [ ! -z $EXTRA_PREFIX ]; then > +if test ! -z $EXTRA_PREFIX ; then > CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include" If $EXTRA_PREFIX contains nothing (or just whitespace) this expands to test ! -z which only works by accident. It is parsed ax if not (string_is_nonempty("-z")) Variable expansions in test expressions should generally be in " ". Ian.