This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Re: other/9031


> Thank you very much for your problem report.
> It has the internal identification `other/9031'.
> The individual assigned to look at your
> report is: unassigned. 
> 
> >Category:       other
> >Responsible:    unassigned
> >Synopsis:       Cygnus configure versus libtool AC_PROG_LD macro
> >Arrival-Date:   Fri Dec 20 12:36:00 PST 2002

The enclosed patch fixes the problem reported in other/9031.  The technique
for determining LD is derived from that used by the libtool AC_PROG_LD macro.

Tested on hppa64-hp-hpux11.11 and hppa2.0w-hp-hpux11.11.  Ok for main?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2002-12-26  John David Anglin  <dave.anglin@nrc.ca>

	* configure (LD): 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.50
diff -u -3 -p -r1.50 configure
--- configure	16 Dec 2002 18:18:42 -0000	1.50
+++ configure	21 Dec 2002 21:08:30 -0000
@@ -1059,6 +1059,29 @@ else
     fi
   fi
 
+  # If we are using gcc, try to set the LD default to the ld used by gcc.
+  case "${CC}" in
+  *gcc)
+    case $host 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]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      gcc_prog_ld=`echo $gcc_prog_ld| sed 's%\\\\%/%g'`
+      while echo $gcc_prog_ld| grep "$re_direlt" > /dev/null 2>&1; do
+	gcc_prog_ld=`echo $gcc_prog_ld| sed "s%$re_direlt%/%"`
+      done
+      LD="$gcc_prog_ld" ;;
+    esac
+    ;;
+  esac
+
   CXX=${CXX-"c++"}
   CFLAGS=${CFLAGS-"-g"}
   CXXFLAGS=${CXXFLAGS-"-g -O2"}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]