From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29717 invoked by alias); 4 Jan 2003 21:06: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 29690 invoked by uid 71); 4 Jan 2003 21:06:01 -0000 Date: Sat, 04 Jan 2003 21:06:00 -0000 Message-ID: <20030104210601.29689.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: 2003-01/txt/msg00295.txt.bz2 List-Id: The following reply was made to PR other/9031; it has been noted by GNATS. From: "John David Anglin" To: aoliva@redhat.com (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, 4 Jan 2003 15:58:55 -0500 (EST) > > Ok, but I wouldn't mind if you waited for Nathan's patch to go in > > before adjusting yours. If you agree, consider the updated patch > > pre-approved, but please post it, for the record. > > In fact, consider now sinclude()ing libtool.m4 and using its > AC_PROG_LD macro. I have installed the following revised version of the patch on the main. The code now checks to see if LD is set. There are some minor variable name changes and other revisions due to the fact that the code is now processed by autoconf. Tested on hppa64-hp-hpux11.11 and hppa2.0w-hp-hpux11.11. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2003-01-04 John David Anglin * configure.in (LD): Improve test for gcc. Try to set LD to the ld used by gcc if LD is not defined and we are not doing a Canadian Cross. * configure: Rebuilt. Index: configure.in =================================================================== RCS file: /cvsroot/gcc/gcc/configure.in,v retrieving revision 1.202 diff -u -3 -p -r1.202 configure.in --- configure.in 28 Dec 2002 17:57:14 -0000 1.202 +++ configure.in 29 Dec 2002 19:01:47 -0000 @@ -1456,12 +1456,14 @@ else YACC="\$(USUAL_YACC)" # If CC is still not set, try to get gcc. + cc_prog_is_gcc= if test -z "${CC}" ; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc; then CC="gcc" + cc_prog_is_gcc=yes echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} @@ -1477,11 +1479,20 @@ else IFS="$save_ifs" CC=${CC-cc} else + # Determine if we are using gcc. + cat > conftest.c </dev/null 2>&1; then + cc_prog_is_gcc=yes + fi + rm -f conftest.c 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) + if test "$cc_prog_is_gcc" = yes; then echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} @@ -1491,7 +1502,25 @@ else CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* - ;; + fi + fi + fi + + # We must set the default linker to the linker used by gcc for the correct + # operation of libtool. If LD is not defined and we are using gcc, try to + # set the LD default to the ld used by gcc. + if test -z "$LD"; then + if test "$cc_prog_is_gcc" = yes; 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 fi