Commit ff0e9e6c0df9d89d6a0eff51603f10ab0b6e1665

David Turner 2006-01-27T09:15:53

* builds/freetype.mk, Jamfile: define the macro FT2_BUILD_LIBRARY when compiling the library. * include/freetype/config/ftheader.h: remove inclusions of internal headers, except if the macro FT2_BUILD_LIBRARY is defined.

diff --git a/ChangeLog b/ChangeLog
index da8d491..4fd5017 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-27  David Turner  <david@freetype.org>
+
+    * builds/freetype.mk, Jamfile: define the macro FT2_BUILD_LIBRARY
+    when compiling the library.
+    
+    * include/freetype/config/ftheader.h: remove inclusions of
+    internal headers, except if the macro FT2_BUILD_LIBRARY is defined.
+    
+
 2006-01-23  Chia-I Wu  <b90201047@ntu.edu.tw>
 
 	* include/freetype/freetype.h (FT_Select_Size): Rename the second
diff --git a/Jamfile b/Jamfile
index 9075abe..81103b0 100644
--- a/Jamfile
+++ b/Jamfile
@@ -127,6 +127,10 @@ if $(DEBUG_HINTER)
 #
 HDRS += $(FT2_INCLUDE) ;
 
+# We need to #define FT2_BUILD_LIBRARY so that our sources find the
+# internal headers
+#
+DEFINES += FT2_BUILD_LIBRARY ;
 
 # Uncomment the following line if you want to build individual source files
 # for each FreeType 2 module.  This is only useful during development, and
diff --git a/builds/freetype.mk b/builds/freetype.mk
index d923ad5..6f7abd4 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -133,7 +133,11 @@ INCLUDE_FLAGS = $(INCLUDES:%=$I%)
 # $(INCLUDE_FLAGS) should come before $(CFLAGS) to avoid problems with
 # old FreeType versions.
 #
-FT_CFLAGS  = $(CPPFLAGS) $(INCLUDE_FLAGS) $(CFLAGS)
+# note what we also define the macro FT2_BUILD_LIBRARY when building
+# FreeType. this is required to let our sources include the internal
+# headers (something forbidden by clients)
+#
+FT_CFLAGS  = $(CPPFLAGS) $(INCLUDE_FLAGS) $(CFLAGS) $DFT2_BUILD_LIBRARY
 FT_CC      = $(CC) $(FT_CFLAGS)
 FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
 
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index 102c59b..2b08b53 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -626,11 +626,13 @@
 
 #define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>
 
-  /* now include internal headers definitions from <freetype/internal/...> */
-
-#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>
-#include FT_INTERNAL_INTERNAL_H
-
+/* now include internal headers definitions from <freetype/internal/...>
+ * only when we're building the library !!
+ */
+#ifdef FT2_BUILD_LIBRARY
+#  define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>
+#  include FT_INTERNAL_INTERNAL_H
+#endif /* FT2_BUILD_LIBRARY */
 
 #endif /* __FT2_BUILD_H__ */