This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin 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]

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


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=

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