From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20664 invoked by alias); 28 Dec 2002 06:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20646 invoked by uid 71); 28 Dec 2002 06:26:01 -0000 Date: Fri, 27 Dec 2002 22:26:00 -0000 Message-ID: <20021228062601.20644.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: John David Anglin Subject: Re: PATCH: Re: other/9031 Reply-To: John David Anglin X-SW-Source: 2002-12/txt/msg01335.txt.bz2 List-Id: The following reply was made to PR other/9031; it has been noted by GNATS. From: John David Anglin To: Alexandre Oliva Cc: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, dave.anglin@nrc.ca, gcc-patches@gcc.gnu.org, binutils@sources.redhat.com, neroden@twcny.rr.com Subject: Re: PATCH: Re: other/9031 Date: Sat, 28 Dec 2002 01:22:25 -0500 Here is a revised patch. I have improved the gcc detection, removed the extra double quotes from the commands used to print the ld used by gcc, and the path canonicalization. The mingw CR removal is still in as I have no way to determine whether this isn't still needed. I have tested the patch with builds on hppa64-hp-hpux11.11 and hppa2.0w-hp-hpux11.00. The patch will be obsolete if Nanthanael's autoconfiscation patch is installed, although I see his patch still includes the code that I am attempting to improve. Dave 2002-12-28 John David Anglin * configure (LD): Improve test for gcc and try to set LD to the ld used by gcc when using gcc and not doing a Canadian Cross. Index: configure =================================================================== RCS file: /cvsroot/gcc/gcc/configure,v retrieving revision 1.51 diff -u -3 -p -r1.51 configure --- configure 22 Dec 2002 06:46:41 -0000 1.51 +++ configure 27 Dec 2002 18:51:43 -0000 @@ -1020,6 +1020,7 @@ else YACC='\$(USUAL_YACC)' # If CC is still not set, try to get gcc. + cc_prog= if [ -z "${CC}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do @@ -1028,6 +1029,7 @@ else CC="gcc" echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then + cc_prog=gcc CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else @@ -1044,8 +1046,16 @@ else if test -z "${CFLAGS}"; then # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC # is set to a version of gcc. - case "${CC}" in - *gcc) + cat > conftest.c </dev/null 2>&1; then + cc_prog=gcc + fi + rm -f conftest.c + if [ "$cc_prog" = gcc ]; then echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} @@ -1055,9 +1065,23 @@ else CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* - ;; - esac + fi fi + fi + + # If we are using gcc, try to set the LD default to the ld used by gcc. + if [ "$cc_prog" = gcc ]; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + LD="$gcc_prog_ld" ;; + esac fi CXX=${CXX-"c++"}