From: SourceForge.net <no...@so...> - 2003-10-12 01:41:10
|
Bugs item #821605, was opened at 2003-10-11 04:05 Message generated for change (Comment added) made by donstauffer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=821605&group_id=2435 Category: non-mingw Group: component package Status: Closed Resolution: Wont Fix Priority: 5 Submitted By: Don Stauffer (donstauffer) Assigned to: Nobody/Anonymous (nobody) Summary: Make sets shell inconsistantly if makefile sets it to script Initial Comment: This only seems to happen at a Windows 2000 command prompt, not in MSYS. Trying to do the same manipulation to the characters making up any command shelled from make by setting SHELL := testSh in makefile, where testSh is a shell script. This works fine as long as testSh exists before make is run. Creating the script within the makefile usually works, but not always. You can run make repeatedly and get different results for some runs, especially if there is very little time between them. Slightly fewer than half the runs will use /bin/sh instead of testSh. The following short makefile reproduces the problem: define P # endef dummy := ${shell sh echo -e '$P!/bin/sh\necho Hi!\nsh - c "$$2"'>testSh} SHELL := testSh .PHONY : example example : @echo @echo SHELL=${SHELL} @rm -f testSh On my faster machine, I can get this to alternate randomly between using testSh and using /bin/sh simply by running make repeatedly using the up-arrow command history function and hitting enter. On my slower machine I have to use a Windows 2000 command prompt for loop: for %a in (1 2 3 4 5 6 7 8 9) do make The output looks like this: D:\Data\DEVELO~1\src\make\t\t>make SHELL=testSh D:\Data\DEVELO~1\src\make\t\t>make SHELL=testSh D:\Data\DEVELO~1\src\make\t\t>make SHELL=D:/Programs/OS/MinGW/MSYS/1.0/bin/sh.exe D:\Data\DEVELO~1\src\make\t\t>make SHELL=D:/Programs/OS/MinGW/MSYS/1.0/bin/sh.exe D:\Data\DEVELO~1\src\make\t\t>make SHELL=testSh D:\Data\DEVELO~1\src\make\t\t>make SHELL=D:/Programs/OS/MinGW/MSYS/1.0/bin/sh.exe D:\Data\DEVELO~1\src\make\t\t>make SHELL=testSh D:\Data\DEVELO~1\src\make\t\t>make SHELL=D:/Programs/OS/MinGW/MSYS/1.0/bin/sh.exe D:\Data\DEVELO~1\src\make\t\t>make SHELL=testSh Incidentally, if I run this for loop repeatedly the output will vary. That is, it's not always iterations 3,4,6 and 8 which use /bin/sh instead of testSh. I would appreciate any insight into why this happens and workaround ideas. ---------------------------------------------------------------------- >Comment By: Don Stauffer (donstauffer) Date: 2003-10-12 01:41 Message: Logged In: YES user_id=861460 The source told me what to do. The workaround is to make sure the script is in a directory other than the current directory, and not in the PATH. Seems like early on make is searching in the current directory and on the path for shell and makefiles, and sometimes it remembers the shell script wasn't there. Not sure why that would vary from run to run, but I guessed putting it in a directory the hash table hadn't seen yet would keep it from assuming the script file didn't exists, and it worked. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-10-11 15:38 Message: Logged In: YES user_id=15438 Again, seek help at mak...@gn.... You'll get better results for a workaround. ---------------------------------------------------------------------- Comment By: Don Stauffer (donstauffer) Date: 2003-10-11 15:24 Message: Logged In: YES user_id=861460 I'm actually more interested in a workaround than a fix -- hopefully one which doesn't require the user of the makefile to do anything differently to run it. The result is the same with SHELL set in advance, and with mingw32-make. I searched all archives thoroughly before posting and found very little on the subject of setting SHELL in makefiles. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-10-11 11:03 Message: Logged In: YES user_id=15438 You may want to try researching the mak...@gn... list. If you set SHELL to testSH before executing what happens? If you use mingw32-make what happens? This isn't a bug I'm particularly interested in fixing, so you'll have to work with the source to figure it out and offer a fix go the gnu maintainers. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=821605&group_id=2435 |