From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25441 invoked by alias); 20 Mar 2012 09:58:58 -0000 Received: (qmail 25424 invoked by uid 22791); 20 Mar 2012 09:58:56 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_BG X-Spam-Check-By: sourceware.org Received: from mout0.freenet.de (HELO mout0.freenet.de) (195.4.92.90) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Mar 2012 09:58:29 +0000 Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout0.freenet.de with esmtpa (ID ralf.corsepius@freenet.de) (port 25) (Exim 4.76 #1) id 1S9vpi-0007Dl-On; Tue, 20 Mar 2012 10:58:26 +0100 Received: from localhost ([::1]:40283 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID ralf.corsepius@freenet.de) (Exim 4.76 #1) id 1S9vpi-0003i9-Ko; Tue, 20 Mar 2012 10:58:26 +0100 Received: from [195.4.92.20] (port=56859 helo=10.mx.freenet.de) by mjail2.freenet.de with esmtpa (ID ralf.corsepius@freenet.de) (Exim 4.76 #1) id 1S9vnl-0002WC-7M; Tue, 20 Mar 2012 10:56:25 +0100 Received: from hsi-kbw-149-172-203-247.hsi13.kabel-badenwuerttemberg.de ([149.172.203.247]:39141 helo=[192.168.1.104]) by 10.mx.freenet.de with esmtpsa (ID ralf.corsepius@freenet.de) (TLSv1:CAMELLIA256-SHA:256) (port 587) (Exim 4.76 #1) id 1S9vnk-0001RF-MW; Tue, 20 Mar 2012 10:56:24 +0100 Message-ID: <4F685446.5030204@rtems.org> Date: Tue, 20 Mar 2012 09:58:00 -0000 From: Ralf Corsepius User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Tristan Gingold CC: GCC Patches , fortran@gcc.gnu.org Subject: Re: [Patch] libgfortran: do not assume libm References: <3B352F61-8E1D-4708-A9B4-C2191C0F9F18@adacore.com> In-Reply-To: <3B352F61-8E1D-4708-A9B4-C2191C0F9F18@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg01333.txt.bz2 On 03/20/2012 10:01 AM, Tristan Gingold wrote: > Hi, > > I am starting to build fortran for VMS. > > The first serious issue was with libgfortran/configure. It checks for several math functions, but directly in libm using AC_CHECK_LIB. > But there is on such things as libm on VMS systems (thus requiring to define MATH_LIBRARY as ""). Therefore all these tests fail, > resulting in a failure during libgfortran build. > > I think the best way to test for the math function is to use AC_CHECK_DECLS as hinted by the autoconf manual > (cf the AC_CHECK_DECLS example in http://www.gnu.org/software/autoconf/manual/autoconf.html > AC_CHECK_DECLS([j0], [], [], [[#include]]) > AC_CHECK_DECLS([[basename(char *)], [dirname(char *)]]) > > ) > but I am not an autoconf expert. > > I think that this change makes the AIX specific check for __clog obsolete, but I haven't removed it. > > With this change I was able to cross build libgfortran for VMS (ia64 and alpha). > I have also bootstrapped gcc for x86_64-darwin, without fortran regressions. > > Ok for trunk ? IMO, no. What you are doing here is to replace checks, which check for presence of a symbol in a library (e.g. cos in libm.*) by checks for presence of a symbol's declaration inside of a header. This is something entirely different (This also reflects in AC_CHECK_DECL by default providing HAVE_DECL_XXX defines). Also note that it's not uncommon to have declarations inside of headers, which are not present inside of a library. Ralf