[cairo] [PATCH] Fix Windows build with cmd.exe as shell

Simon Richter Simon.Richter at hogyros.de
Thu Apr 23 12:33:00 PDT 2015


On 23.04.2015 02:11, Bryce Harrington wrote:

>> cmd.exe has unsubtly different behaviour from POSIX sh in a lot of places.
>> This determines whether the current default shell for make is cmd.exe, and
>> avoids "mkdir -p", "rm" and quotes around the argument to echo in this
>> case.

> What exactly is the breakage that this fixes?  IOW, why has the current
> code worked up 'til now on windows?

It works if you have a POSIX compatible shell in your path, e.g. if you
are using msys or cygwin.

I'm trying to minimize dependencies to make it easier to build on a
freshly installed Windows system, so I can easily set up autobuilders.

http://ci.kicad-pcb.org/job/pixman-win32/lastSuccessfulBuild/console is
the log from the last build, using this patch. The system only has Java
(for Jenkins) and git (to check out cairo) installed, and builds a
standalone GNU make.

>> +mkdir_p = if not exist $(subst /,\,$1) md $(subst /,\,$1)
>> +echo = $(if $1,echo $1,echo.)
>> +rm = del $(subst /,\,$1)

> If you use := instead of = for these command definitions, would it
> eliminate the need for the calls in the rest of the patch?

No, the call is needed because I need to process the arguments (md and
del do not handle forward slashes and echo needs a dot to print a
newline instead of "@ECHO is off".

> Also, the makefile style seems to be to use uppercase letters when
> using variables rather than system commands, so you should be specifying
> MKDIR_P, ECHO, and RM.

Yes, however these are not commands per se, but rather "functions"
within make.

   Simon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.cairographics.org/archives/cairo/attachments/20150423/4acbd246/attachment.sig>


More information about the cairo mailing list