xref: /aoo42x/main/graphite/makefile.mk (revision 7871dc3e)
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
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# make use of stlport headerfiles
75EXT_USE_STLPORT=TRUE
76BUILD_ACTION=nmake VERBOSE=1
77.IF "x$(debug)"!="x"
78BUILD_FLAGS= "CFG=DEBUG"
79CFLAGSWITHPATH= $(CFLAGS:s!-Fd.!-Fd../../../../../!)
80.ELSE
81# Speed Optimization is really needed for Graphite
82CFLAGSWITHPATH= $(CFLAGS) /O2
83.ENDIF
84### convert CFLAGS as cl.exe cannot handle OOO"s generic ones directly
85### TODO: use "guw.exe" instead?
86ALLCFLAGS= $(CFLAGSWITHPATH) $(CFLAGSCXX) $(CFLAGSEXCEPTIONS) $(CDEFS)
87JUSTASLASH= /
88CFLAGS2MSC= $(ALLCFLAGS:s/-Z/$(JUSTASLASH)Z/)
89CFLAGS4MSC= $(CFLAGS2MSC:s/ -/ $(JUSTASLASH)/)
90BUILD_FLAGS+= "CFLAGS4MSC=$(CFLAGS4MSC)" /F makefile.vc$(VCNUM) lib_dll
91.ENDIF
92
93.IF "$(COM)"=="GCC"
94
95# Does linux want --disable-shared?
96.IF "x$(debug)"!="x"
97GR_CONFIGURE_FLAGS= --enable-debug=yes --disable-final --enable-static --disable-shared
98.ELSE
99GR_CONFIGURE_FLAGS= --enable-final=yes --enable-static --disable-shared
100.ENDIF
101EXTRA_GR_CXX_FLAGS=-fPIC
102
103.IF "$(USE_SYSTEM_STL)"!="YES"
104# #i112124# STLPort seems to require libstdc++
105EXTRA_GR_LD_FLAGS=$(LIBSTLPORT) -lm -lstdc++
106GR_LIB_PATH=LD_LIBRARY_PATH=$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)
107.ELSE
108GR_LIB_PATH=
109.ENDIF
110
111.IF "$(OS)"=="WNT"
112PATCH_FILES+=graphite-2.3.1.patch.mingw
113EXTRA_GR_CXX_FLAGS=-mthreads -nostdinc
114.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
115EXTRA_GR_CXX_FLAGS+=-shared-libgcc
116.ENDIF
117EXTRA_GR_LD_FLAGS+=-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2
118.ENDIF
119
120# don't use SOLARLIB for LDFLAGS because it pulls in system graphite so build will fail
121#
122CONFIGURE_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)'
123.ENDIF
124
125BUILD_DIR=$(CONFIGURE_DIR)
126
127.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
128#OUT2LIB=win32$/bin.msvc$/*.lib
129.IF "x$(debug)"!="x"
130OUT2LIB=engine$/debug$/*.lib
131.ELSE
132OUT2LIB=engine$/release$/*.lib
133.ENDIF
134.ELSE
135OUT2LIB=engine$/src$/.libs$/libgraphite*.a
136.ENDIF
137
138.IF "$(COM)"=="GCC"
139BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
140.ENDIF
141
142.IF "$(OS)"=="MACOSX"
143OUT2LIB+=src$/.libs$/libgraphite.*.dylib
144.ELSE
145.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
146#OUT2LIB+=engine$/src$/.libs$/libgraphite*.dll
147.IF "x$(debug)"!="x"
148OUT2BIN= \
149#    engine$/debug$/*.dll \
150    engine$/debug$/*.pdb
151.ELSE
152OUT2BIN=
153#    engine$/release$/*.dll
154#    engine$/release$/*.pdb
155.ENDIF
156.ELSE
157#OUT2LIB+=engine$/src$/.libs$/libgraphite.so.*.*.*
158.ENDIF
159.ENDIF
160
161
162OUTDIR2INC= \
163	engine$/include$/graphite
164
165.IF "$(OS)"=="WNT"
166OUT2INC=wrappers$/win32$/WinFont.h
167.ENDIF
168
169# --- Targets ------------------------------------------------------
170
171
172.INCLUDE :	set_ext.mk
173.INCLUDE :	target.mk
174.INCLUDE :	tg_ext.mk
175
176.ENDIF