Commit ef4a915e286bc7be45e2390e0b21b00ed7f79211

Suzuki, Toshiya (鈴木俊哉) 2008-09-30T16:21:07

* Fix make rules for multi build on Mac OS X

diff --git a/ChangeLog b/ChangeLog
index 09486ad..a8d0f40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2008-09-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
+	* src/base/rules.mk: Add conditional source to BASE_SRC, for
+	`make multi' on Mac OS X. If the macro $(ftmac_c) is defined,
+	$(BASE_DIR)/$(ftmac_c) is added to BASE_SRC. In normal build,
+	the lack of ftmac.c in BASE_SRC is not serious because ftbase.c
+	includes ftmac.c.
+	* builds/unix/unix-def.in: Add a macro definition of $(ftmac_c).
+	* builds/unix/configure.raw: Add procedure to set up appropriate
+	value of $(ftmac_c) with the consideration of the availability
+	of Carbon framework.
+
+2008-09-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
 	* src/base/Jamfile: Add target for multi build by jam on Mac OS X.
 	* src/base/ftobjs.c (FT_New_Face): Fix the condition to include
 	this function for MPW building. It is synchronized the condition
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 5f48d82..d5b053a 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -263,6 +263,8 @@ esac
 
 # Whether to use Mac OS resource-based fonts.
 
+ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
+
 # don't quote AS_HELP_STRING!
 AC_ARG_WITH([old-mac-fonts],
   AS_HELP_STRING([--with-old-mac-fonts],
@@ -293,6 +295,7 @@ if test x$with_old_mac_fonts = xyes; then
 
       ])],
     [AC_MSG_RESULT([ok])
+     ftmac_c='ftmac.c'
      AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible])
      orig_CFLAGS="$CFLAGS"
      CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
@@ -626,6 +629,7 @@ case "$CFLAGS" in
 esac
 
 
+AC_SUBST([ftmac_c])
 AC_SUBST([LIBZ])
 AC_SUBST([CFLAGS])
 AC_SUBST([LDFLAGS])
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index b90ed0c..3a499e7 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -65,6 +65,10 @@ version_info := @version_info@
 #
 LIB_DIR := $(OBJ_DIR)
 
+# The BASE_SRC macro lists all source files that should be included in
+# src/base/ftbase.c. When configure sets up CFLAGS to build ftmac.c,
+# ftmac.c should be added to BASE_SRC.
+ftmac_c := @ftmac_c@
 
 # The SYSTEM_ZLIB macro is defined if the user wishes to link dynamically
 # with its system wide zlib. If SYSTEM_ZLIB is 'yes', the zlib part of the
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 4a152ab..5a89b45 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -47,6 +47,10 @@ BASE_SRC := $(BASE_DIR)/ftcalc.c   \
             $(BASE_DIR)/ftutil.c   \
             $(BASE_DIR)/ftadvanc.c
 
+ifneq ($(ftmac_c),)
+  BASE_SRC += $(BASE_DIR)/$(ftmac_c)
+endif
+
 # Base layer `extensions' sources
 #
 # An extension is added to the library file as a separate object.  It is