delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/12/12:16:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3E21A20D.1050906@ece.gatech.edu>
Date: Sun, 12 Jan 2003 12:12:45 -0500
From: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Earnie Boyd <earnie_boyd AT yahoo DOT com>
CC: Alexandre Duret-Lutz <duret_g AT lrde DOT epita DOT fr>, automake-patches AT gnu DOT org,
libtool-patches AT gnu DOT org, cygwin AT cygwin DOT com,
mingw-users AT lists DOT sourceforge DOT net
Subject: Re: [Mingw-users] Re: Solving the "relink exe's" libtool problem
[take 2]
References: <3E19C657 DOT 1040904 AT ece DOT gatech DOT edu> <2003-01-09-17-11-09+16471+duret_g AT lrde DOT epita DOT fr> <3E1DE146 DOT 8030901 AT ece DOT gatech DOT edu> <2003-01-09-23-01-51+2104+duret_g AT lrde DOT epita DOT fr> <3E20BF9A DOT 4080400 AT ece DOT gatech DOT edu> <3E217676 DOT 7050702 AT yahoo DOT com>

--------------030203050106060706090801
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Earnie Boyd wrote:
> Charles Wilson wrote:
> 
>>
>> There are two places in ltmain.sh where the shell wrapper is directly 
>> sourced.  This doesn't work very well, because when both "foo" and 
>> "foo.exe" exist, ". ./foo" ends up sourcing "foo.exe" -- which is bad.
>>
> 
> This can be resolved by ``. ./foo.'' instead for the cygwin/mingw hosts.

I knew that would work for cygwin, but wasn't sure it would work for 
mingw.  In that case, this portion of the earlier patch:

@@ -5066,8 +5261,12 @@

  	  # If there is no directory component, then add one.
  	  case $file in
-	  */* | *\\*) . $wrapper ;;
-	  *) . ./$wrapper ;;
+	  */* | *\\*) cp ${wrapper} ${wrapper}-lt.sh
+	    . ${wrapper}-lt.sh
+	    $rm -f ${wrapper}-lt.sh ;;
+	  *) cp ./${wrapper} ./${wrapper}-lt.sh
+	    . ./${wrapper}-lt.sh
+	    $rm -f ${wrapper}-lt.sh ;;
  	  esac

  	  # Check the variables that should have been set.
@@ -5097,8 +5296,12 @@
  	  relink_command=
  	  # If there is no directory component, then add one.
  	  case $file in
-	  */* | *\\*) . $file ;;
-	  *) . ./$file ;;
+	  */* | *\\*) cp ${wrapper} ${wrapper}-lt.sh
+	    . ${wrapper}-lt.sh
+	    $rm -f ${wrapper}-lt.sh ;;
+	  *) cp ./${wrapper} ./${wrapper}-lt.sh
+	    . ./${wrapper}-lt.sh
+	    $rm -f ${wrapper}-lt.sh ;;
  	  esac

  	  outputname=

could be replaced with the attached version, instead (note: attached 
file is NOT a complete patch, and hasn't been tested extensively.)  The 
newer version has the benefit that it avoids the race introduced by the 
above.  I'm not sure it is advisable to change the definition of 
$wrapper itself for cygwin/mingw host, though, so I introduced a new 
variable wrapperdot.

--
Chuck



--------------030203050106060706090801
Content-Type: text/plain;
 name="libtool-relinkexe3partial.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="libtool-relinkexe3partial.patch"

@@ -5064,10 +5259,17 @@
 	  notinst_deplibs=
 	  relink_command=
 
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $host in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}.
+	  *) wrapperdot=${wrapper}
+	  esac
 	  # If there is no directory component, then add one.
 	  case $file in
-	  */* | *\\*) . $wrapper ;;
-	  *) . ./$wrapper ;;
+	  */* | *\\*) . ${wrapperdot}
+	  *) . ./${wrapperdot}
 	  esac
 
 	  # Check the variables that should have been set.
@@ -5095,10 +5297,17 @@
 	  done
 
 	  relink_command=
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $host in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}.
+	  *) wrapperdot=${wrapper}
+	  esac
 	  # If there is no directory component, then add one.
 	  case $file in
-	  */* | *\\*) . $file ;;
-	  *) . ./$file ;;
+	  */* | *\\*) . ${wrapperdot}
+	  *) . ./${wrapperdot}
 	  esac
 
 	  outputname=


--------------030203050106060706090801
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--------------030203050106060706090801--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019