xref: /aoo41x/main/graphite/makefile.mk (revision de2c434c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24# TODO: enable warnings again when external module compiles without warnings on all platforms
25EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
26
27PRJ=.
28
29PRJNAME=graphite
30TARGET=so_graphite
31
32# --- Settings -----------------------------------------------------
33
34.INCLUDE :	settings.mk
35
36.IF "$(SYSTEM_GRAPHITE)" == "YES"
37
38all:
39        @echo "An already available installation of silgraphite should exist on your system."
40        @echo "Therefore the version provided here does not need to be built in addition."
41
42.ELIF "$(ENABLE_GRAPHITE)" != "TRUE"
43
44all:
45        @echo "Support for silgraphite has been disabled.  Nothing to do."
46
47.ELSE
48
49# --- Files --------------------------------------------------------
50
51TARFILE_NAME=silgraphite-2.3.1
52TARFILE_MD5=d35724900f6a4105550293686688bbb3
53PATCH_FILES=graphite-2.3.1.patch graphite-2.3.1_debug.patch graphite-2.3.1_stlportemu.patch
54
55# convert line-endings to avoid problems when patching
56CONVERTFILES=\
57	engine/makefile.vc8 \
58	engine/test/RegressionTest/RtTextSrc.h
59
60#.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
61#CONFIGURE_DIR=win32
62#.ELSE
63#CONFIGURE_DIR=engine
64#.ENDIF
65
66CONFIGURE_DIR=engine
67
68.IF "$(COM)"=="MSC"
69.IF "$(COMEX)"=="10"
70VCNUM=7
71.ELSE
72VCNUM=8
73.ENDIF
74.IF "$(USE_SYSTEM_STL)"!="YES"
75# make use of stlport headerfiles
76EXT_USE_STLPORT=TRUE
77.ENDIF
78BUILD_ACTION=nmake VERBOSE=1
79.IF "x$(debug)"!="x"
80BUILD_FLAGS= "CFG=DEBUG"
81CFLAGSWITHPATH= $(CFLAGS:s!-Fd.!-Fd../../../../../!)
82.ELSE
83# Speed Optimization is really needed for Graphite
84CFLAGSWITHPATH= $(CFLAGS) /O2
85.ENDIF
86### convert CFLAGS as cl.exe cannot handle OOO"s generic ones directly
87### TODO: use "guw.exe" instead?
88ALLCFLAGS= $(CFLAGSWITHPATH) $(CFLAGSCXX) $(CFLAGSEXCEPTIONS) $(CDEFS)
89JUSTASLASH= /
90CFLAGS2MSC= $(ALLCFLAGS:s/-Z/$(JUSTASLASH)Z/)
91CFLAGS4MSC= $(CFLAGS2MSC:s/ -/ $(JUSTASLASH)/)
92BUILD_FLAGS+= "CFLAGS4MSC=$(CFLAGS4MSC)" /F makefile.vc$(VCNUM) lib_dll
93.ENDIF
94
95.IF "$(COM)"=="GCC" || "$(OS)"=="FREEBSD"
96
97# Does linux want --disable-shared?
98.IF "x$(debug)"!="x"
99GR_CONFIGURE_FLAGS= --enable-debug=yes --disable-final --enable-static --disable-shared
100.ELSE
101GR_CONFIGURE_FLAGS= --enable-final=yes --enable-static --disable-shared
102.ENDIF
103EXTRA_GR_CXX_FLAGS=-fPIC
104
105.IF "$(USE_SYSTEM_STL)"!="YES"
106# #i112124# STLPort seems to require libstdc++
107EXTRA_GR_LD_FLAGS=$(LIBSTLPORT) -lm -lstdc++
108GR_LIB_PATH=LD_LIBRARY_PATH=$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)
109.ELSE
110GR_LIB_PATH=
111.ENDIF
112
113.IF "$(OS)"=="WNT"
114PATCH_FILES+=graphite-2.3.1.patch.mingw
115EXTRA_GR_CXX_FLAGS=-mthreads -nostdinc
116.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
117EXTRA_GR_CXX_FLAGS+=-shared-libgcc
118.ENDIF
119EXTRA_GR_LD_FLAGS+=-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2
120.ENDIF
121
122# don't use SOLARLIB for LDFLAGS because it pulls in system graphite so build will fail
123#
124CONFIGURE_ACTION=bash -c 'CXXFLAGS="$(INCLUDE) $(CFLAGSCXX) $(CFLAGSCOBJ) $(CDEFS) $(CDEFSOBJ) $(SOLARINC) $(LFS_CFLAGS) $(EXTRA_GR_CXX_FLAGS)" $(GR_LIB_PATH) LDFLAGS="-L$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT) $(EXTRA_GR_LD_FLAGS)" ./configure $(GR_CONFIGURE_FLAGS)'
125.ENDIF
126
127BUILD_DIR=$(CONFIGURE_DIR)
128
129.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
130#OUT2LIB=win32$/bin.msvc$/*.lib
131.IF "x$(debug)"!="x"
132OUT2LIB=engine$/debug$/*.lib
133.ELSE
134OUT2LIB=engine$/release$/*.lib
135.ENDIF
136.ELSE
137OUT2LIB=engine$/src$/.libs$/libgraphite*.a
138.ENDIF
139
140.IF "$(COM)"=="GCC" || "$(OS)"=="FREEBSD"
141BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
142.ENDIF
143
144.IF "$(OS)"=="MACOSX"
145OUT2LIB+=src$/.libs$/libgraphite.*.dylib
146.ELSE
147.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
148#OUT2LIB+=engine$/src$/.libs$/libgraphite*.dll
149.IF "x$(debug)"!="x"
150OUT2BIN= \
151#    engine$/debug$/*.dll \
152    engine$/debug$/*.pdb
153.ELSE
154OUT2BIN=
155#    engine$/release$/*.dll
156#    engine$/release$/*.pdb
157.ENDIF
158.ELSE
159#OUT2LIB+=engine$/src$/.libs$/libgraphite.so.*.*.*
160.ENDIF
161.ENDIF
162
163
164OUTDIR2INC= \
165	engine$/include$/graphite
166
167.IF "$(OS)"=="WNT"
168OUT2INC=wrappers$/win32$/WinFont.h
169.ENDIF
170
171# --- Targets ------------------------------------------------------
172
173
174.INCLUDE :	set_ext.mk
175.INCLUDE :	target.mk
176.INCLUDE :	tg_ext.mk
177
178.ENDIF
179