From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 69A911F619 for ; Mon, 24 Feb 2020 20:20:13 +0000 (UTC) Received: from localhost ([::1]:41760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6KD6-000134-8f for normalperson@yhbt.net; Mon, 24 Feb 2020 15:20:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44260) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6KD1-00012l-GL for bug-gnulib@gnu.org; Mon, 24 Feb 2020 15:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6KD0-00014y-35 for bug-gnulib@gnu.org; Mon, 24 Feb 2020 15:20:07 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::9]:16917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6KCz-00012L-JQ for bug-gnulib@gnu.org; Mon, 24 Feb 2020 15:20:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1582575603; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=aLeR52SogKejxCPO41nx7E8dyi0Nc2IekTpubqBktoo=; b=NTN0srTo3FtudpNUb3TrW2V/Mq7rsPq5qGZZSj8yIJQuItz32QQ+s4+PfNkOkbVafK B+mQbS2COEl/NigmFTT0UEIhFk8CamWDr0hYRoLICuV3uxoToJe1cudCdRVI20mmh6Rn J/gQnlelD3VMR6T5ySw+FJ5uUVkuw0g1ZlSl0o3+MCkFIBEQxQnSPQ5HmLu7MJ0EqZmq 7wDfIC2O2BAFQJu4KefAk4NkOgkcRQbkJNBZ0F8TLJ80663aOVvFHRIoy0MSG4XdB+mH EhScIM8JPyx+gcdO3i2PeQhAFStfM5uzxUuT5/yfBjHYaS2qNhCTvaBmf1RT1JV+yF1Z QXYQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.1.12 DYNA|AUTH) with ESMTPSA id g00701w1OKK0n6o (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Mon, 24 Feb 2020 21:20:00 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: [PATCH 1/2] m4/getloadavg.m4: restrict AIX specific test on AIX Date: Mon, 24 Feb 2020 21:20:00 +0100 Message-ID: <1806524.tgAbVnCh1V@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-171-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20200224125649.19109-1-sno@netbsd.org> References: <20200224125649.19109-1-sno@netbsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::9 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Rehsack Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Jens Rehsack wrote: > When cross compiling for a system without getloadavg, do not try add > additional linker paths unless it's absolutely necessary. > > Signed-off-by: Jens Rehsack > --- > m4/getloadavg.m4 | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 > index 3bd2a142e..696c5de90 100644 > --- a/m4/getloadavg.m4 > +++ b/m4/getloadavg.m4 > @@ -42,6 +42,8 @@ AC_CHECK_FUNC([getloadavg], [], > fi > > if test $gl_func_getloadavg_done = no; then > + AS_CASE([$host_os], > + [aix*], [ > # There is a commonly available library for RS/6000 AIX. > # Since it is not a standard part of AIX, it might be installed locally. > gl_getloadavg_LIBS=$LIBS In gnulib, we often try to be system-agnostic in the *.m4 files. For example, if on a different system someone builds a libgetloadavg.{a,so}, this autoconf test snippet would recognize it. This is a feature, not a misfeature. Also, in gnulib, we don't use the AS_IF, AS_CASE, etc. macros, because it's simpler to write the shell code directly. 2020-02-24 Bruno Haible getloadavg: Don't use /usr/local when cross-compiling on AIX. Reported by Jens Rehsack in . * m4/getloadavg.m4 (gl_GETLOADAVG): Don't look in /usr/local/lib when cross-compiling. diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index 3bd2a14..8e96965 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -7,7 +7,7 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 8 +#serial 9 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. # New applications should use gl_GETLOADAVG instead. @@ -45,7 +45,9 @@ AC_CHECK_FUNC([getloadavg], [], # There is a commonly available library for RS/6000 AIX. # Since it is not a standard part of AIX, it might be installed locally. gl_getloadavg_LIBS=$LIBS - LIBS="-L/usr/local/lib $LIBS" + if test $cross_compiling != yes; then + LIBS="-L/usr/local/lib $LIBS" + fi AC_CHECK_LIB([getloadavg], [getloadavg], [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes], [LIBS=$gl_getloadavg_LIBS])