automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Charles Wilson
Subject: Re: [Mingw-users] Re: Solving the "relink exe's" libtool problem [take 2]
Date: Sun, 12 Jan 2003 12:12:45 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0

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


@@ -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=

reply via email to

[Prev in Thread] Current Thread [Next in Thread]