* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
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__ */