Commit dbb93157d595e0e1107383cdf9cc2e1a4f353ce4

Werner Lemberg 2014-11-27T07:20:48

Use better way to disable creation of .pyc files for `make refdoc'. Python 2.6 was released in 2008... * builds/freetype.mk (refdoc): Use python's `-B' option. * builds/detect.mk (std_setup, dos_setup): Mention required python version for `refdoc' target.

diff --git a/ChangeLog b/ChangeLog
index 0ab5e47..9f9f012 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2014-11-27  Werner Lemberg  <wl@gnu.org>
 
+	Use better way to disable creation of .pyc files for `make refdoc'.
+
+	Python 2.6 was released in 2008...
+
+	* builds/freetype.mk (refdoc): Use python's `-B' option.
+
+	* builds/detect.mk (std_setup, dos_setup): Mention required python
+	version for `refdoc' target.
+
+2014-11-27  Werner Lemberg  <wl@gnu.org>
+
 	* src/tools/docmaker/sources.py (re_bold, re_italic): Use
 	non-grouping parentheses.
 	* src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word):
diff --git a/builds/detect.mk b/builds/detect.mk
index ce407ba..ff4045d 100644
--- a/builds/detect.mk
+++ b/builds/detect.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2003, 2006, 2008, 2013 by
+# Copyright 1996-2003, 2006, 2008, 2013, 2014 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -124,7 +124,7 @@ std_setup:
 	@echo "\`$(CONFIG_MK)' from this directory then read the INSTALL file for help."
 	@echo ""
 	@echo "Otherwise, simply type \`$(MAKE)' again to build the library,"
-	@echo "or \`$(MAKE) refdoc' to build the API reference (the latter needs python)."
+	@echo "or \`$(MAKE) refdoc' to build the API reference (this needs python >= 2.6)."
 	@echo ""
 	@$(COPY) $(CONFIG_RULES) $(CONFIG_MK)
 
@@ -146,7 +146,7 @@ dos_setup:
 	@echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help.
 	@type builds$(SEP)newline
 	@echo Otherwise, simply type 'make' again to build the library.
-	@echo or 'make refdoc' to build the API reference (the latter needs python).
+	@echo or 'make refdoc' to build the API reference (this needs python >= 2.6).
 	@type builds$(SEP)newline
 	@$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK)) > nul
 
diff --git a/builds/freetype.mk b/builds/freetype.mk
index 3f1519e..8b2e2ea 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -297,19 +297,16 @@ ifneq ($(findstring refdoc,$(MAKECMDGOALS)),)
   version := $(major).$(minor).$(patch)
 endif
 
-# We write-protect the docmaker directory to suppress generation
-# of .pyc files.
+# Option `-B' disables generation of .pyc files (available since python 2.6)
 #
 refdoc:
-	-chmod -w $(SRC_DIR)/tools/docmaker
-	python $(SRC_DIR)/tools/docmaker/docmaker.py \
-               --prefix=ft2                          \
-               --title=FreeType-$(version)           \
-               --output=$(DOC_DIR)                   \
-               $(PUBLIC_DIR)/*.h                     \
-               $(PUBLIC_DIR)/config/*.h              \
-               $(PUBLIC_DIR)/cache/*.h
-	-chmod +w $(SRC_DIR)/tools/docmaker
+	python -B $(SRC_DIR)/tools/docmaker/docmaker.py \
+                  --prefix=ft2                          \
+                  --title=FreeType-$(version)           \
+                  --output=$(DOC_DIR)                   \
+                  $(PUBLIC_DIR)/*.h                     \
+                  $(PUBLIC_DIR)/config/*.h              \
+                  $(PUBLIC_DIR)/cache/*.h
 
 
 .PHONY: clean_project_std distclean_project_std