freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] [Bug] make refdoc does not show version number (Cygwin)


From: Werner LEMBERG
Subject: Re: [ft-devel] [Bug] make refdoc does not show version number (Cygwin)
Date: Sun, 01 Apr 2018 07:47:40 +0200 (CEST)

[In the future, please send such e-mails to a FreeType list!]

> I looked into this problem, went through a few Makefiles, and
> finally could point out the origin of this bug to the cat command in
> builds/toplevel.mk
> <http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/builds/toplevel.mk#n175>
> (175). So here's how it goes:
> 
> The Windows equivalent of 'cat' which is 'type' does not support
> paths with forward slash in them.  Because of this the type command
> on line 175 returns an error, which means the variable 'work' does
> not get the file contents.
> 
> I fixed this by adding a condition to check if $(CAT) is 'type',
> then use back slash.  Otherwise use forward slash by default.
> 
> I think a conditional separator variable can be used but I'm not
> sure how GNU Make would react to backslash as a separator.
> 
> I am attaching the changed file (toplevel.mk) and the new output
> after the changes.  Please have a look at it.

Thanks a lot.  Does the attached patch work for you?


    Werner
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index f51ad16b9..7ce0ed8db 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -172,7 +172,8 @@ include $(TOP_DIR)/builds/modules.mk
 # get FreeType version string, using a
 # poor man's `sed' emulation with make's built-in string functions
 #
-work := $(strip $(shell $(CAT) $(TOP_DIR)/include/freetype/freetype.h))
+work := $(strip $(shell $(CAT) \
+                  $(subst /,$(SEP),$(TOP_DIR)/include/freetype/freetype.h)))
 work := $(subst |,x,$(work))
 work := $(subst $(space),|,$(work))
 work := $(subst \#define|FREETYPE_MAJOR|,$(space),$(work))

reply via email to

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