From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5126 invoked by alias); 20 Sep 2010 13:59:03 -0000 Received: (qmail 5108 invoked by uid 22791); 20 Sep 2010 13:59:01 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,NO_DNS_FOR_FROM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Sep 2010 13:58:57 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 20 Sep 2010 06:58:56 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga002.fm.intel.com with ESMTP; 20 Sep 2010 06:58:56 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 5C1E6207F1; Mon, 20 Sep 2010 06:58:56 -0700 (PDT) Date: Tue, 21 Sep 2010 18:24:00 -0000 From: "H.J. Lu" To: GDB Subject: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran Message-ID: <20100920135856.GA27953@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00346.txt.bz2 This isn't a proper fix since it depends on we load lib/ada.exp before any Fortran tests. I think ada.exp is the wrong place to provide GDB functions. It should be placed in something like gdb-support.exp and ada.exp/fortran.exp can just load it. H.J. --- 2010-09-20 H.J. Lu PR testsuite/12040 * lib/ada.exp (gdb_find_gfortran): New. (gdb_default_target_compile): Use it. diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index 055d4d3..1e686bc 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -41,6 +41,25 @@ proc gdb_find_gnatmake {} { return $GM } +proc gdb_find_gfortran {} { + global tool_root_dir + + if ![is_remote host] { + set file [lookfor_file $tool_root_dir gfortran] + if { $file == "" } { + set file [lookfor_file $tool_root_dir gcc/gfortran] + } + if { $file != "" } { + set CC "$file -B[file dirname $file]/" + } else { + set CC [transform gfortran] + } + } else { + set CC [transform gfortran] + } + return $CC +} + # FIXME:brobecker/2004-03-31: # The following function is a copy of the function of the same name provided # by dejagnu, except that it has been modified to add support for building @@ -112,7 +131,7 @@ proc gdb_default_target_compile {source destfile type options} { if [board_info $dest exists f77compiler] { set compiler [target_info f77compiler] } else { - set compiler [find_g77] + set compiler [gdb_find_gfortran] } }