freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] FreeType 2.4.7 no longer compiles on Mac OS X, 2.4.6 does


From: mpsuzuki
Subject: Re: [ft-devel] FreeType 2.4.7 no longer compiles on Mac OS X, 2.4.6 does
Date: Sun, 30 Oct 2011 22:36:33 +0900

Hi all,

Here is my draft to GNU-libtoolize graph.a target in
freetype2-demos package. Also it improves "make clean"
to remove graph.a itself. Please test and give me comment.

It seems that "glibtool --mode=link $(CC) -static libxxx.a ..."
ignores the list of normal object files, I had to pass
the list of libtool object files. Thus, I changed the
suffixes of graph.a objects from $(SO) to $(O). I expect
that $(O) is same with $(SO) in non-GNU-libtool environment
(freetype2/builds/*/*.mk set so), so no harmful impact.

I added "--mode=compile $(CC) -static" to compile libtool
object files, so there won't be extra time to compile the
shared objects that are useless for graph.a.

The next step of this improvement would be more abstraction
for non-GNU-libtool environment and cross building ("ar -r"
is too strict!). It requires the improvement of freetype2
makefiles, so it should be different changeset.

Regards,
mpsuzuki

diff --git a/Makefile b/Makefile
index 34aca88..b0b63dc 100644
--- a/Makefile
+++ b/Makefile
@@ -219,7 +219,9 @@ else
   else
 
     clean_demo:
-           -$(DELETE) $(subst /,$(SEP),$(OBJ_DIR_2)/*.$(SO))
+           -$(DELETE) $(subst /,$(SEP),$(OBJ_DIR_2)/*.$(SO) 
$(OBJ_DIR_2)/*.$(O))
+           -$(DELETE) $(subst /,$(SEP),$(OBJ_DIR_2)/*.$(SA) 
$(OBJ_DIR_2)/*.$(A))
+           -$(DELETE) $(subst /,$(SEP),$(OBJ_DIR_2)/.libs/*)
            -$(DELETE) $(subst /,$(SEP),$(SRC_DIR)/*.bak graph/*.bak)
            -$(DELETE) $(subst /,$(SEP),$(SRC_DIR)/*~ graph/*~)
 
diff --git a/graph/beos/rules.mk b/graph/beos/rules.mk
index 70beaae..80b9b39 100644
--- a/graph/beos/rules.mk
+++ b/graph/beos/rules.mk
@@ -13,18 +13,25 @@ ifeq ($(PLATFORM),beos)
 
   # add the BeOS driver object file to the graphics library `graph.a'
   #
-  GRAPH_OBJS += $(OBJ_DIR_2)/grbeos.$(SO)
+  GRAPH_OBJS += $(OBJ_DIR_2)/grbeos.$(O)
 
   DEVICES         += BEOS
   DEVICE_INCLUDES += $(GR_BEOS)
 
   # the rule used to compile the graphics driver
   #
-  $(OBJ_DIR_2)/grbeos.$(SO): $(GR_BEOS)/grbeos.cpp $(GR_BEOS)/grbeos.h
+  $(OBJ_DIR_2)/grbeos.$(O): $(GR_BEOS)/grbeos.cpp $(GR_BEOS)/grbeos.h
+  ifneq ($(LIBTOOL),)
+         $(LIBTOOL) --mode=compile $(CC) -static $(CFLAGS) 
$(GRAPH_INCLUDES:%=$I%) \
+                $I$(subst /,$(COMPILER_SEP),$(GR_BEOS)) \
+                $(X11_INCLUDE:%=$I%) \
+                $T$(subst /,$(COMPILER_SEP),$@ $<)
+  else
          $(CC) $(CFLAGS) $(GRAPH_INCLUDES:%=$I%) \
                 $I$(subst /,$(COMPILER_SEP),$(GR_BEOS)) \
                 $(X11_INCLUDE:%=$I%) \
                 $T$(subst /,$(COMPILER_SEP),$@ $<)
+  endif
 
   # Now update GRAPH_LINK according to the compiler used on BeOS
   GRAPH_LINK += -lbe -lstdc++.r4
diff --git a/graph/rules.mk b/graph/rules.mk
index 3389423..0fc70c1 100644
--- a/graph/rules.mk
+++ b/graph/rules.mk
@@ -27,22 +27,26 @@ GRAPH_H := $(GRAPH)/graph.h    \
            $(GRAPH)/gblblit.h
 
 
-GRAPH_OBJS := $(OBJ_DIR_2)/grblit.$(SO)    \
-              $(OBJ_DIR_2)/grobjs.$(SO)    \
-              $(OBJ_DIR_2)/grfont.$(SO)    \
-              $(OBJ_DIR_2)/grfill.$(SO)    \
-              $(OBJ_DIR_2)/grswizzle.$(SO) \
-              $(OBJ_DIR_2)/grdevice.$(SO)  \
-              $(OBJ_DIR_2)/grinit.$(SO)    \
-              $(OBJ_DIR_2)/gblender.$(SO)  \
-              $(OBJ_DIR_2)/gblblit.$(SO)
+GRAPH_OBJS := $(OBJ_DIR_2)/grblit.$(O)    \
+              $(OBJ_DIR_2)/grobjs.$(O)    \
+              $(OBJ_DIR_2)/grfont.$(O)    \
+              $(OBJ_DIR_2)/grfill.$(O)    \
+              $(OBJ_DIR_2)/grswizzle.$(O) \
+              $(OBJ_DIR_2)/grdevice.$(O)  \
+              $(OBJ_DIR_2)/grinit.$(O)    \
+              $(OBJ_DIR_2)/gblender.$(O)  \
+              $(OBJ_DIR_2)/gblblit.$(O)
 
 
 
 # Default value for COMPILE_GRAPH_LIB;
 # this value can be modified by the system-specific graphics drivers.
 #
-COMPILE_GRAPH_LIB = ar -r $(subst /,$(COMPILER_SEP),$@ $(GRAPH_OBJS))
+ifneq ($(LIBTOOL),)
+  COMPILE_GRAPH_LIB = $(LIBTOOL) --mode=link $(CCraw) -static -o $(subst 
/,$(COMPILER_SEP),$@ $(GRAPH_OBJS))
+else
+  COMPILE_GRAPH_LIB = ar -r $(subst /,$(COMPILER_SEP),$@ $(GRAPH_OBJS))
+endif
 
 
 # Add the rules used to detect and compile graphics driver depending
@@ -66,16 +70,25 @@ $(GRAPH_LIB): $(GRAPH_OBJS)
 
 # pattern rule for normal sources
 #
-$(OBJ_DIR_2)/%.$(SO): $(GRAPH)/%.c $(GRAPH_H)
+$(OBJ_DIR_2)/%.$(O): $(GRAPH)/%.c $(GRAPH_H)
+ifneq ($(LIBTOOL),)
+       $(LIBTOOL) --mode=compile $(CC) -static $(CFLAGS) 
$(GRAPH_INCLUDES:%=$I%) $T$@ $<
+else
        $(CC) $(CFLAGS) $(GRAPH_INCLUDES:%=$I%) $T$@ $<
+endif
 
 
 # a special rule is used for 'grinit.o' as it needs the definition
 # of some macros like "-DDEVICE_X11" or "-DDEVICE_OS2_PM"
 #
-$(OBJ_DIR_2)/grinit.$(SO): $(GRAPH)/grinit.c $(GRAPH_H)
+$(OBJ_DIR_2)/grinit.$(O): $(GRAPH)/grinit.c $(GRAPH_H)
+ifneq ($(LIBTOOL),)
+       $(LIBTOOL) --mode=compile $(CC) -static $(CFLAGS) 
$(GRAPH_INCLUDES:%=$I%) \
+              $(DEVICES:%=$DDEVICE_%) $T$(subst /,$(COMPILER_SEP),$@ $<)
+else
        $(CC) $(CFLAGS) $(GRAPH_INCLUDES:%=$I%) \
               $(DEVICES:%=$DDEVICE_%) $T$(subst /,$(COMPILER_SEP),$@ $<)
+endif
 
 
 # EOF
diff --git a/graph/x11/rules.mk b/graph/x11/rules.mk
index e39c9b6..bcd5be3 100644
--- a/graph/x11/rules.mk
+++ b/graph/x11/rules.mk
@@ -89,7 +89,7 @@ ifneq ($(X11_PATH),)
 
   # Add the X11 driver object file to the graphics library.
   #
-  GRAPH_OBJS += $(OBJ_DIR_2)/grx11.$(SO)
+  GRAPH_OBJS += $(OBJ_DIR_2)/grx11.$(O)
 
   GR_X11 := $(GRAPH)/x11
 
@@ -97,11 +97,18 @@ ifneq ($(X11_PATH),)
 
   # the rule used to compile the X11 driver
   #
-  $(OBJ_DIR_2)/grx11.$(SO): $(GR_X11)/grx11.c $(GR_X11)/grx11.h
+  $(OBJ_DIR_2)/grx11.$(O): $(GR_X11)/grx11.c $(GR_X11)/grx11.h
+  ifneq ($(LIBTOOL),)
+         $(LIBTOOL) --mode=compile $(CC) -static $(CFLAGS) 
$(GRAPH_INCLUDES:%=$I%) \
+                $I$(subst /,$(COMPILER_SEP),$(GR_X11)) \
+                $(X11_INCLUDE:%=$I%) \
+                $T$(subst /,$(COMPILER_SEP),$@ $<)
+  else
          $(CC) $(CFLAGS) $(GRAPH_INCLUDES:%=$I%) \
                 $I$(subst /,$(COMPILER_SEP),$(GR_X11)) \
                 $(X11_INCLUDE:%=$I%) \
                 $T$(subst /,$(COMPILER_SEP),$@ $<)
+  endif
 endif
 
 # EOF


On Thu, 27 Oct 2011 21:47:11 +0900
suzuki toshiya <address@hidden> wrote:

>Thank you for comment.
>
>I experience this issue for a few years,
>but nobody complains about it (I remember)
>so I thought it was because of my messy
>developer environment. I must fix it.
>
>I think "graph.a" should be replaced by
>a libtool target to make GNU libtool
>prepare the symbol table appropriately.
>
>Regards,
>mpsuzuki
>
>Christian Demmer wrote (2011/10/27 21:21):
>> Hello,
>> 
>> I can confirm the problem compiling ft2demos on OSX 10.6.8.
>> 
>> suzuki toshiya wrote:
>>> ranlib obj/graph.a
>> 
>> This fix works. Calling make again finshes building ft2demos.
>> 
>> Also I observed that calling make clean does not remove obj/graph.a.
>> 
>> Thanks for the hint.
>> 
>> Greetings chris
>
>
>_______________________________________________
>Freetype-devel mailing list
>address@hidden
>https://lists.nongnu.org/mailman/listinfo/freetype-devel



reply via email to

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