[Mingw-users] Re: Solving the "relink exe's" libtool problem [take 2]

Charles Wilson cwilson@ece.gatech.edu
Mon Jan 13 03:30:00 GMT 2003


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


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libtool-relinkexe3partial.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20030113/bf9eeb7a/attachment.ksh>


More information about the Cygwin mailing list