Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Message-ID: <3E21A20D.1050906@ece.gatech.edu> Date: Sun, 12 Jan 2003 12:12:45 -0500 From: Charles Wilson 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 CC: Alexandre Duret-Lutz , automake-patches@gnu.org, libtool-patches@gnu.org, cygwin@cygwin.com, mingw-users@lists.sourceforge.net Subject: Re: [Mingw-users] Re: Solving the "relink exe's" libtool problem [take 2] References: <3E19C657.1040904@ece.gatech.edu> <2003-01-09-17-11-09+16471+duret_g@lrde.epita.fr> <3E1DE146.8030901@ece.gatech.edu> <2003-01-09-23-01-51+2104+duret_g@lrde.epita.fr> <3E20BF9A.4080400@ece.gatech.edu> <3E217676.7050702@yahoo.com> Content-Type: multipart/mixed; boundary="------------030203050106060706090801" --------------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--