merged tag ooo/DEV300_m102
[LibreOffice.git] / graphite / makefile.mk
blobf4434909bfe404ab5d53689ba1932910f024d876
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 # TODO: enable warnings again when external module compiles without warnings on all platforms
29 EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
31 PRJ=.
33 PRJNAME=graphite
34 TARGET=so_graphite
36 # --- Settings -----------------------------------------------------
38 .INCLUDE : settings.mk
40 .IF "$(SYSTEM_GRAPHITE)" == "YES"
41 all:
42 @echo "An already available installation of silgraphite should exist on your system."
43 @echo "Therefore the version provided here does not need to be built in addition."
44 .ENDIF
46 # --- Files --------------------------------------------------------
47 .IF "$(ENABLE_GRAPHITE)"=="TRUE"
48 TARFILE_NAME=silgraphite-2.3.1
49 TARFILE_MD5=d35724900f6a4105550293686688bbb3
50 PATCH_FILES=graphite-2.3.1.patch graphite-2.3.1_debug.patch
52 # convert line-endings to avoid problems when patching
53 CONVERTFILES=\
54 engine/makefile.vc8 \
55 engine/test/RegressionTest/RtTextSrc.h
57 #.IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
58 #CONFIGURE_DIR=win32
59 #.ELSE
60 #CONFIGURE_DIR=engine
61 #.ENDIF
63 CONFIGURE_DIR=engine
65 .IF "$(COM)"=="MSC"
66 .IF "$(COMEX)"=="10"
67 VCNUM=7
68 .ELSE
69 VCNUM=8
70 .ENDIF
71 # make use of stlport headerfiles
72 EXT_USE_STLPORT=TRUE
73 BUILD_ACTION=nmake VERBOSE=1
74 .IF "$(debug)"=="true"
75 BUILD_FLAGS= "CFG=DEBUG"
76 CFLAGSWITHPATH= $(CFLAGS:s!-Fd.!-Fd../../../../../!)
77 .ELSE
78 # Speed Optimization is really needed for Graphite
79 CFLAGSWITHPATH= $(CFLAGS) /O2
80 .ENDIF
81 ### convert CFLAGS as cl.exe cannot handle OOO"s generic ones directly
82 ### TODO: use "guw.exe" instead?
83 ALLCFLAGS= $(CFLAGSWITHPATH) $(CFLAGSCXX) $(CFLAGSEXCEPTIONS) $(CDEFS)
84 JUSTASLASH= /
85 CFLAGS2MSC= $(ALLCFLAGS:s/-Z/$(JUSTASLASH)Z/)
86 CFLAGS4MSC= $(CFLAGS2MSC:s/ -/ $(JUSTASLASH)/)
87 BUILD_FLAGS+= "CFLAGS4MSC=$(CFLAGS4MSC)" /F makefile.vc$(VCNUM) lib_dll
88 .ENDIF
90 .IF "$(COM)"=="GCC"
92 # Does linux want --disable-shared?
93 .IF "$(debug)"=="true"
94 GR_CONFIGURE_FLAGS= --enable-debug=yes --disable-final --enable-static --disable-shared
95 .ELSE
96 GR_CONFIGURE_FLAGS= --enable-final=yes --enable-static --disable-shared
97 .ENDIF
98 EXTRA_GR_CXX_FLAGS=-fPIC
100 .IF "$(USE_SYSTEM_STL)"!="YES"
101 # #i112124# STLPort seems to require libstdc++
102 EXTRA_GR_LD_FLAGS=$(LIBSTLPORT) -lm -lstdc++
103 GR_LIB_PATH=LD_LIBRARY_PATH=$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)
104 .ELSE
105 GR_LIB_PATH=
106 .ENDIF
108 .IF "$(OS)"=="WNT"
109 PATCH_FILES+=graphite-2.3.1.patch.mingw
110 EXTRA_GR_CXX_FLAGS=-mthreads -nostdinc
111 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
112 EXTRA_GR_CXX_FLAGS+=-shared-libgcc
113 .ENDIF
114 EXTRA_GR_LD_FLAGS+=-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2
115 .ENDIF
117 # don't use SOLARLIB for LDFLAGS because it pulls in system graphite so build will fail
119 CONFIGURE_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)'
120 .ENDIF
122 BUILD_DIR=$(CONFIGURE_DIR)
124 .IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
125 #OUT2LIB=win32$/bin.msvc$/*.lib
126 .IF "$(debug)"=="true"
127 OUT2LIB=engine$/debug$/*.lib
128 .ELSE
129 OUT2LIB=engine$/release$/*.lib
130 .ENDIF
131 .ELSE
132 OUT2LIB=engine$/src$/.libs$/libgraphite*.a
133 .ENDIF
135 .IF "$(COM)"=="GCC"
136 BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
137 .ENDIF
139 .IF "$(OS)"=="MACOSX"
140 OUT2LIB+=src$/.libs$/libgraphite.*.dylib
141 .ELSE
142 .IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
143 #OUT2LIB+=engine$/src$/.libs$/libgraphite*.dll
144 .IF "$(debug)"=="true"
145 OUT2BIN= \
146 # engine$/debug$/*.dll \
147 engine$/debug$/*.pdb
148 .ELSE
149 OUT2BIN=
150 # engine$/release$/*.dll
151 # engine$/release$/*.pdb
152 .ENDIF
153 .ELSE
154 #OUT2LIB+=engine$/src$/.libs$/libgraphite.so.*.*.*
155 .ENDIF
156 .ENDIF
159 OUTDIR2INC= \
160 engine$/include$/graphite
162 .IF "$(OS)"=="WNT"
163 OUT2INC=wrappers$/win32$/WinFont.h
164 .ENDIF
165 .ELSE
166 dddd:
167 @echo Nothing to do
168 .ENDIF
169 # --- Targets ------------------------------------------------------
172 .INCLUDE : set_ext.mk
173 .INCLUDE : target.mk
174 .INCLUDE : tg_ext.mk