On 8/6/2018 4:58 PM, Bram Moolenaar wrote:
Problem
-------
The if-tests in the makefile src/po/Make_ming.mak do not do what is
intended.  Furthermore, they do not allow for the possibility that the
value of the make variable SHELL might include a path specification.


Issues
------
1.  The if-tests that reference the SHELL make variable do not do what is
     intended.

     There are four if-tests in the file Make-ming.mak of the form:

         ifeq (sh.exe, $(SHELL))

     As coded, this condition will be true if and only if the value of
     SHELL is "sh.exe".  However, in all four cases, the if-else blocks are
     incorrectly ordered.  For example, in the current makefile:

         ifeq (sh.exe, $(SHELL))
         VIMRUNTIME = ..\..\runtime
         else
         VIMRUNTIME = ../../runtime
         endif

     should instead be:

         ifeq (sh.exe, $(SHELL))
         VIMRUNTIME = ../../runtime
         else
         VIMRUNTIME = ..\..\runtime
         endif

     Perhaps when these if-tests were added in commit 8889a5c305,
     "ifneq" was intended.  However, see the next point.

2.  The if-tests do not allow for the possibility that the value of SHELL
     might include a path specification.

     Using the version of mingw/msys I've downloaded from Source Forge, my
     version of make defines SHELL to be "C:\MinGW\msys\1.0\bin\sh.exe".
     The above if-tests will report that this value is not equal to
     "sh.exe" even though we would like it to report a unix shell is being
     provided.  A way to address this would be to use the gnu make function
     "notdir", which leads us to rewriting the above as:

         ifeq (sh.exe, $(notdir $(SHELL)))
         VIMRUNTIME = ../../runtime
         else
         VIMRUNTIME = ..\..\runtime
         endif

     The other three if-tests should be modified in the same way.

     I'll point out that SHELL can also be specified on the make command
     line and so its value could include a path.


Proposed patch
--------------
I've attached a patch that addresses the if-test issues I've raised.
It appears src/Make_cyg_ming.mak also does this:

        ifneq (sh.exe, $(SHELL))
        DEL = rm
        MKDIR = mkdir -p
        DIRSLASH = /
        else
        DEL = del
        MKDIR = mkdir
        DIRSLASH = \\
        endif

And src/GvimExt/Make_ming.mak

        ifneq (sh.exe, $(SHELL))
        DEL = rm
        else
        DEL = del
        endif

Is this really wrong?

In my opinion, yes.  Also, src/xxd/Make_ming.mak

-mike

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui