merge the formfield patch from ooo-build
[ooovba.git] / icu / makefile.mk
blob7503a4c18dbcd469684d3b582c7d6fda7389ca15
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.40 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
31 PRJ=.
33 PRJNAME=icu
34 TARGET=so_icu
36 # --- Settings -----------------------------------------------------
38 .INCLUDE : settings.mk
40 # --- Files --------------------------------------------------------
42 .INCLUDE : icuversion.mk
44 .IF "$(ICU_MICRO)"!="0"
45 TARFILE_NAME=icu-$(ICU_MAJOR).$(ICU_MINOR).$(ICU_MICRO)
46 .ELSE
47 TARFILE_NAME=icu-$(ICU_MAJOR).$(ICU_MINOR)
48 .ENDIF
49 TARFILE_ROOTDIR=icu
51 PATCH_FILES=${TARFILE_NAME}.patch
53 # ADDITIONAL_FILES=
55 .IF "$(GUI)"=="UNX"
56 .IF "$(COMNAME)"=="sunpro5"
57 #.IF "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
58 #CC:=$(COMPATH)$/bin$/cc
59 #CXX:=$(COMPATH)$/bin$/CC
60 #.ENDIF # "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
61 .ENDIF # "$(COMNAME)"=="sunpro5"
63 .IF "$(SYSBASE)"!=""
64 icu_CFLAGS+=-I$(SYSBASE)$/usr$/include
65 .IF "$(COMNAME)"=="sunpro5"
66 icu_CFLAGS+=$(C_RESTRICTIONFLAGS)
67 .ENDIF # "$(COMNAME)"=="sunpro5"
68 # add SYSBASE libraries and make certain that they are found *after* the
69 # icu build internal libraries - in case that icu is available in SYSBASE
70 # as well
71 icu_LDFLAGS+= -L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)$/usr$/lib
72 .ENDIF # "$(SYSBASE)"!=""
74 .IF "$(OS)"=="MACOSX"
75 .IF "$(EXTRA_CFLAGS)"!=""
76 CPP:=gcc -E $(EXTRA_CFLAGS)
77 CXX:=g++ $(EXTRA_CFLAGS)
78 CC:=gcc $(EXTRA_CFLAGS)
79 .EXPORT : CPP
80 .ENDIF # "$(EXTRA_CFLAGS)"!=""
81 .ENDIF # "$(OS)"=="MACOSX"
83 # Disable executable stack
84 .IF "$(OS)$(COM)"=="LINUXGCC"
85 icu_LDFLAGS+=-Wl,-z,noexecstack
86 .ENDIF
88 icu_CFLAGS+=-O $(ARCH_FLAGS) $(EXTRA_CDEFS)
89 icu_LDFLAGS+=$(EXTRA_LINKFLAGS)
90 icu_CXXFLAGS+=-O $(ARCH_FLAGS) $(EXTRA_CDEFS)
92 BUILD_ACTION_SEP=;
93 # remove conversion and transliteration data to reduce binary size.
94 CONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk $(BUILD_ACTION_SEP)
96 # until someone introduces SOLARIS 64-bit builds
97 .IF "$(OS)"=="SOLARIS"
98 DISABLE_64BIT=--enable-64bit-libs=no
99 .ENDIF # "$(OS)"=="SOLARIS"
101 .IF "$(HAVE_LD_HASH_STYLE)" == "TRUE"
102 LDFLAGSADD += -Wl,--hash-style=both
103 .ENDIF
105 .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
106 LDFLAGSADD += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
107 .ENDIF
109 CONFIGURE_DIR=source
111 CONFIGURE_ACTION+=sh -c 'CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure --enable-layout --enable-static --enable-shared=yes $(DISABLE_64BIT)'
113 #CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
114 CONFIGURE_FLAGS=
116 # Use of
117 # CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure'
118 # CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
119 # doesn't work as it would result in
120 # sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ...
121 # note the position of the single quotes.
123 BUILD_DIR=$(CONFIGURE_DIR)
124 BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE)
125 OUT2LIB= \
126 $(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
127 $(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
128 $(BUILD_DIR)$/lib$/libicudata$(DLLPOST) \
129 $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
130 $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
131 $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST) \
132 $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
133 $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
134 $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST) \
135 $(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
136 $(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
137 $(BUILD_DIR)$/lib$/libicule$(DLLPOST) \
138 $(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
139 $(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
140 $(BUILD_DIR)$/lib$/libicutu$(DLLPOST)
142 OUT2BIN= \
143 $(BUILD_DIR)$/bin$/genccode \
144 $(BUILD_DIR)$/bin$/genbrk \
145 $(BUILD_DIR)$/bin$/gencmn
147 .ENDIF
149 .IF "$(GUI)"=="WNT"
150 CONFIGURE_DIR=source
151 .IF "$(COM)"=="GCC"
152 CONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ;
153 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
154 icu_LDFLAGS+=-shared-libgcc
155 .ENDIF
156 .IF "$(USE_MINGW)"=="cygwin"
157 icu_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api
158 .ENDIF
159 icu_LDFLAGS+=-L$(COMPATH)$/lib
160 icu_LIBS=-lmingwthrd
161 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
162 icu_LIBS+=-lstdc++_s
163 .ENDIF
164 CONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" ./configure --build=i586-pc-mingw32 --enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no'
166 #CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
167 CONFIGURE_FLAGS=
169 # Use of
170 # CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure'
171 # CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
172 # doesn't work as it would result in
173 # sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ...
174 # note the position of the single quotes.
176 BUILD_DIR=$(CONFIGURE_DIR)
177 BUILD_ACTION=$(GNUMAKE)
178 OUT2LIB=
180 OUT2BIN= \
181 $(BUILD_DIR)$/lib$/icudt$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
182 $(BUILD_DIR)$/lib$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
183 $(BUILD_DIR)$/lib$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
184 $(BUILD_DIR)$/lib$/icule$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
185 $(BUILD_DIR)$/lib$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
186 $(BUILD_DIR)$/bin$/genccode.exe \
187 $(BUILD_DIR)$/bin$/genbrk.exe \
188 $(BUILD_DIR)$/bin$/gencmn.exe
190 .ELSE
191 .IF "$(USE_SHELL)"=="4nt"
192 BUILD_ACTION_SEP=^
193 .ELSE
194 BUILD_ACTION_SEP=;
195 .ENDIF # "$(USE_SHELL)"=="4nt"
196 BUILD_DIR=source
197 .IF "full_debug" == ""
199 # Activating the debug mechanism produces incompatible libraries, you'd have
200 # at least to relink all modules that are directly using ICU. Note that library
201 # names get a 'd' appended and you'd have to edit the solenv/inc/libs.mk
202 # ICU*LIB macros as well. Normally you don't want all this.
204 # Instead, use the normal already existing Release build and edit the
205 # corresponding *.vcproj file of the section you're interested in. Make sure
206 # that
207 # - for the VCCLCompilerTool section the following line exists:
208 # DebugInformationFormat="3"
209 # - and for the VCLinkerTool the line
210 # GenerateDebugInformation="TRUE"
211 # Then delete the corresponding Release output directory, and delete the target
212 # flag files
213 # $(OUTPATH)/misc/build/so_built_so_icu
214 # $(OUTPATH)/misc/build/so_predeliver_so_icu
215 # and run dmake again, after which you may copy the resulting libraries to your
216 # OOo/SO installation.
217 ICU_BUILD_VERSION=Debug
218 ICU_BUILD_LIBPOST=d
219 .ELSE
220 ICU_BUILD_VERSION=Release
221 ICU_BUILD_LIBPOST=
222 .ENDIF
224 CONFIGURE_ACTION+= $(PERL) ..$/..$/..$/..$/..$/createmak.pl ..$/..$/..$/..$/..$/createmak.cfg .
226 .IF "$(CCNUMVER)"<="001400000000"
227 BUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHsc" && cd ..$/..
228 .ELSE
229 BUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHa -Zc:wchar_t-" && cd ..$/..
230 .ENDIF
232 OUT2LIB= \
233 $(BUILD_DIR)$/..$/lib$/icudata.lib \
234 $(BUILD_DIR)$/..$/lib$/icuin$(ICU_BUILD_LIBPOST).lib \
235 $(BUILD_DIR)$/..$/lib$/icuuc$(ICU_BUILD_LIBPOST).lib \
236 $(BUILD_DIR)$/..$/lib$/icule$(ICU_BUILD_LIBPOST).lib \
237 $(BUILD_DIR)$/..$/lib$/icutu$(ICU_BUILD_LIBPOST).lib
239 OUT2BIN= \
240 $(BUILD_DIR)$/..$/bin$/icudt$(ICU_MAJOR)$(ICU_MINOR).dll \
241 $(BUILD_DIR)$/..$/bin$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
242 $(BUILD_DIR)$/..$/bin$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
243 $(BUILD_DIR)$/..$/bin$/icule$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
244 $(BUILD_DIR)$/..$/bin$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
245 $(BUILD_DIR)$/..$/bin$/genccode.exe \
246 $(BUILD_DIR)$/..$/bin$/genbrk.exe \
247 $(BUILD_DIR)$/..$/bin$/gencmn.exe
249 .ENDIF
250 .ENDIF # "$(GUI)"=="WNT"
252 # --- Targets ------------------------------------------------------
254 .INCLUDE : set_ext.mk
255 .INCLUDE : target.mk
256 .INCLUDE : tg_ext.mk
258 .IF "$(BINARY_PATCH_FILES)"!=""
260 $(PACKAGE_DIR)$/so_add_binary : $(PACKAGE_DIR)$/$(ADD_FILES_FLAG_FILE)
261 cd $(PACKAGE_DIR) && gunzip -c $(BACK_PATH)$(BINARY_PATCH_FILES) | tar $(TAR_EXCLUDE_SWITCH) -xvf -
262 $(TOUCH) $(PACKAGE_DIR)$/so_add_binary
264 $(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_add_binary
266 .ENDIF
268 # Since you never know what will be in a patch (for example, it may already
269 # patch at configure level) or in the case of a binary patch, we remove the
270 # entire package directory if a patch is newer.
271 # Changes in this makefile could also make a complete build necessary if
272 # configure is affected.
273 $(PACKAGE_DIR)$/$(UNTAR_FLAG_FILE) : makefile.mk