1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 #*************************************************************************
32 # --- Settings -----------------------------------------------------
34 .INCLUDE
: settings.mk
36 # --- Files --------------------------------------------------------
38 TARFILE_NAME
=icu4c-49_1_1-src
39 TARFILE_MD5
=7c53f83e0327343f4060c0eb83842daf
42 #icu4c.7601.Indic-ccmp.patch
43 #http://bugs.icu-project.org/trac/ticket/7601 ccmp feature for Indic Languages
45 #icu4c.8198.revert.icu5431.patch
46 #http://bugs.icu-project.org/trac/ticket/8198 rendering with 0D30 and 0D31
49 icu4c
.9948.mlym-crash.patch \
52 icu4c
.8198.revert.icu5431.patch \
53 icu4c
.7601.Indic-ccmp.patch \
56 icu4c-warnings.patch \
57 icu4c
.9313.cygwin.patch \
59 icu4c-solarisgcc.patch \
61 icu4c-buffer-overflow.patch \
62 icu4c
.9737.CVE-2013-0900_changesets_32865_32908.patch \
63 icu4c-CVE-2013-0900_umutex.patch \
65 .IF
"$(OS)"=="ANDROID"
68 icu_CFLAGS
+=-fvisibility
=hidden
69 icu_CXXFLAGS
+=-fvisibility
=hidden
75 .IF
"$(HAVE_GCC_BUILTIN_ATOMIC)"=="TRUE"
76 EXTRA_CDEFS
+=-DU_HAVE_GCC_ATOMICS
=1
78 EXTRA_CDEFS
+=-DU_HAVE_GCC_ATOMICS
=0
81 # Save space when using a bundled ICU by leaving out unneeded parts of the ICU data. Generated by
82 # the interactive web tool at http://apps.icu-project.org/datacustom/ICUData49.html by dropping
83 # the "Charset Mapping Tables". Probably we could carefully cherry-pick other items in the data to
84 # be dropped, too. A bit tedious using that web tool, though.
86 # If you do that, upload a new subset data zip file with just the MD5 part of the name changed
87 # appropriately. Let's not bother trying to list what stuff has been removed in the file name.
88 # Describe it in the comment above instead.
89 #CONFIGURE_ACTION=unzip $(TARFILE_LOCATION)/$(ICU_DATA_SUBSET_ZIP) && mv icudt49l.dat data/in &&
95 icu_CFLAGS
+=-I
$(SYSBASE
)$/usr
$/include
96 .IF
"$(COMNAME)"=="sunpro5"
97 icu_CFLAGS
+=$(C_RESTRICTIONFLAGS
)
98 .ENDIF
# "$(COMNAME)"=="sunpro5"
99 # add SYSBASE libraries and make certain that they are found *after* the
100 # icu build internal libraries - in case that icu is available in SYSBASE
102 icu_LDFLAGS
+= -L..
/lib
-L..
/..
/lib
-L..
/stubdata
-L..
/..
/stubdata
-L
$(SYSBASE
)$/usr
$/lib
103 .ENDIF
# "$(SYSBASE)"!=""
105 .IF
"$(OS)"=="MACOSX"
106 .IF
"$(EXTRA_CFLAGS)"!=""
107 CPP
:=gcc
-E
$(EXTRA_CFLAGS
)
108 CXX
:=g
++ $(EXTRA_CFLAGS
)
109 CC
:=gcc
$(EXTRA_CFLAGS
)
111 .ENDIF
# "$(EXTRA_CFLAGS)"!=""
112 .ENDIF
# "$(OS)"=="MACOSX"
115 icu_CFLAGS
+=-g
$(ARCH_FLAGS
)
116 icu_CXXFLAGS
+=-g
$(ARCH_FLAGS
)
117 .ELIF
"$(COM)"=="GCC"
118 icu_CFLAGS
+=-O2
-fno-strict-aliasing
$(ARCH_FLAGS
)
119 icu_CXXFLAGS
+=-O2
-fno-strict-aliasing
$(ARCH_FLAGS
)
121 icu_CFLAGS
+=-O
$(ARCH_FLAGS
)
122 icu_CXXFLAGS
+=-O
$(ARCH_FLAGS
)
124 icu_LDFLAGS
+=$(EXTRA_LINKFLAGS
)
126 # until someone introduces SOLARIS 64-bit builds
127 .IF
"$(OS)"=="SOLARIS"
128 DISABLE_64BIT
=--enable-64bit-libs
=no
129 .ENDIF
# "$(OS)"=="SOLARIS"
132 DISABLE_64BIT
=--enable-64bit-libs
=no
133 LDFLAGSADD
+=$(LINKFLAGS
) $(LINKFLAGSRUNPATH_OOO
)
134 .ENDIF
# "$(OS)"=="AIX"
136 .IF
"$(HAVE_LD_HASH_STYLE)" == "TRUE"
137 LDFLAGSADD
+= -Wl
,--hash-style
=$(WITH_LINKER_HASH_STYLE
)
142 icu_CFLAGS
+=-DUCONFIG_NO_FILE_IO
143 icu_CXXFLAGS
+=-DUCONFIG_NO_FILE_IO
146 .IF
"$(OS)"=="ANDROID"
147 # Problems with uint64_t on Android unless disabling strictness
148 DISABLE_STRICT
=--disable-strict
149 icu_CFLAGS
+=-fno-omit-frame-pointer
150 icu_CXXFLAGS
+=-fno-omit-frame-pointer
153 .IF
"$(OS)"=="IOS" ||
"$(OS)"=="ANDROID"
154 # Problems on Android unless disabling dynamic loading
155 DISABLE_DYLOAD
=--disable-dyload
158 .IF
"$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
159 LDFLAGSADD
+= -Wl
,-Bsymbolic-functions
-Wl
,--dynamic-list-cpp-new
-Wl
,--dynamic-list-cpp-typeinfo
164 .IF
"$(DISABLE_DYNLOADING)" == "TRUE"
165 STATIC_OR_SHARED
=--enable-static
--disable-shared
167 STATIC_OR_SHARED
=--disable-static
--enable-shared
170 .IF
"$(CROSS_COMPILING)"=="YES"
171 # We require that the cross-build-toolset target from the top Makefile(.in) has bee built
172 BUILD_AND_HOST
=--build
=$(BUILD_PLATFORM
) --host
=$(HOST_PLATFORM
) --with-cross-build
=$(posix_PWD
)/$(INPATH_FOR_BUILD
)/misc
/build
/icu
/source
175 .IF
"$(OS)"=="ANDROID"
176 .IF
"$(DISABLE_DYNLOADING)" != "TRUE"
177 LIBRARY_SUFFIX
= --with-library-suffix
=lo
179 # Just so that some executables that nobody will run anyway get built...
180 icu_LDFLAGS
+=-lgnustl_shared
-lm
183 CONFIGURE_ACTION
+=sh
-c
'CPPFLAGS="$(EXTRA_CDEFS)" CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" \
184 ./configure --enable-layout --disable-samples $(STATIC_OR_SHARED) $(BUILD_AND_HOST) $(DISABLE_64BIT) $(DISABLE_STRICT) $(DISABLE_DYLOAD) $(LIBRARY_SUFFIX)'
186 .IF
"$(OS)" == "MACOSX"
187 CONFIGURE_ACTION
+= \
188 --prefix=/@.__________________________________________________
$(EXTRPATH
)
194 # CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure'
195 # CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
196 # doesn't work as it would result in
197 # sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ...
198 # note the position of the single quotes.
200 BUILD_DIR
=$(CONFIGURE_DIR
)
201 BUILD_ACTION
=$(AUGMENT_LIBRARY_PATH
) $(GNUMAKE
) -j
$(EXTMAXPROCESS
)
202 .IF
"$(DISABLE_DYNLOADING)" == "TRUE"
204 $(BUILD_DIR
)$/lib
$/libicudata.a \
205 $(BUILD_DIR
)$/lib
$/libicuuc.a \
206 $(BUILD_DIR
)$/lib
$/libicui18n.a \
207 $(BUILD_DIR
)$/lib
$/libicule.a \
208 $(BUILD_DIR
)$/lib
$/libicutu.a
209 .ELIF
"$(OS)"=="ANDROID" # The no longer normal, non-DISABLE_DYNLOADING case for Android
210 BUILD_ACTION
+= && cat uconfig.h.prepend common
/unicode
/uconfig.h
>common
/unicode
/uconfig.h.new
&& mv common
/unicode
/uconfig.h.new common
/unicode
/uconfig.h
212 $(BUILD_DIR
)$/lib
$/libicudatalo.so \
213 $(BUILD_DIR
)$/lib
$/libicuuclo.so \
214 $(BUILD_DIR
)$/lib
$/libicui18nlo.so \
215 $(BUILD_DIR
)$/lib
$/libiculelo.so \
216 $(BUILD_DIR
)$/lib
$/libicutulo.so
219 $(BUILD_DIR
)$/lib
$/libicudata
$(DLLPOST
).
$(ICU_MAJOR
).
$(ICU_MINOR
).
$(ICU_MICRO
) \
220 $(BUILD_DIR
)$/lib
$/libicudata
$(DLLPOST
).
$(ICU_MAJOR
) \
221 $(BUILD_DIR
)$/lib
$/libicudata
$(DLLPOST
) \
222 $(BUILD_DIR
)$/lib
$/libicuuc
$(DLLPOST
).
$(ICU_MAJOR
).
$(ICU_MINOR
).
$(ICU_MICRO
) \
223 $(BUILD_DIR
)$/lib
$/libicuuc
$(DLLPOST
).
$(ICU_MAJOR
) \
224 $(BUILD_DIR
)$/lib
$/libicuuc
$(DLLPOST
) \
225 $(BUILD_DIR
)$/lib
$/libicui18n
$(DLLPOST
).
$(ICU_MAJOR
).
$(ICU_MINOR
).
$(ICU_MICRO
) \
226 $(BUILD_DIR
)$/lib
$/libicui18n
$(DLLPOST
).
$(ICU_MAJOR
) \
227 $(BUILD_DIR
)$/lib
$/libicui18n
$(DLLPOST
) \
228 $(BUILD_DIR
)$/lib
$/libicule
$(DLLPOST
).
$(ICU_MAJOR
).
$(ICU_MINOR
).
$(ICU_MICRO
) \
229 $(BUILD_DIR
)$/lib
$/libicule
$(DLLPOST
).
$(ICU_MAJOR
) \
230 $(BUILD_DIR
)$/lib
$/libicule
$(DLLPOST
) \
231 $(BUILD_DIR
)$/lib
$/libicutu
$(DLLPOST
).
$(ICU_MAJOR
).
$(ICU_MINOR
).
$(ICU_MICRO
) \
232 $(BUILD_DIR
)$/lib
$/libicutu
$(DLLPOST
).
$(ICU_MAJOR
) \
233 $(BUILD_DIR
)$/lib
$/libicutu
$(DLLPOST
)
236 $(BUILD_DIR
)$/bin
$/genccode \
237 $(BUILD_DIR
)$/bin
$/genbrk \
238 $(BUILD_DIR
)$/bin
$/gencmn
246 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
247 icu_LDFLAGS
+=-shared-libgcc
249 icu_LDFLAGS
+=-L
$(COMPATH
)$/lib
251 .IF
"$(MINGW_SHARED_GXXLIB)"=="YES"
252 icu_LIBS
+=$(MINGW_SHARED_LIBSTDCPP
)
254 icu_LDFLAGS
+=-Wl
,--enable-runtime-pseudo-reloc-v2
256 .IF
"$(CROSS_COMPILING)"=="YES"
257 # We require that the cross-build-toolset target from the top Makefile(.in) has bee built
258 BUILD_AND_HOST
=--build
=$(BUILD_PLATFORM
) --host
=$(HOST_PLATFORM
) --with-cross-build
=$(posix_PWD
)/$(INPATH_FOR_BUILD
)/misc
/build
/icu
/source
260 BUILD_AND_HOST
=--build
=i586-pc-mingw32
--enable-64bit-libs
=no
263 CONFIGURE_ACTION
+=sh
-c
'CPPFLAGS="$(EXTRA_CDEFS)" CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" \
264 ./configure $(BUILD_AND_HOST) --enable-layout --disable-static --enable-shared --disable-samples'
269 # CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure'
270 # CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
271 # doesn't work as it would result in
272 # sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ...
273 # note the position of the single quotes.
275 BUILD_DIR
=$(CONFIGURE_DIR
)
276 BUILD_ACTION
=$(GNUMAKE
) -j
$(EXTMAXPROCESS
)
280 $(BUILD_DIR
)$/lib
$/icudt
$(ICU_MAJOR
)$(ICU_MINOR
)$(DLLPOST
) \
281 $(BUILD_DIR
)$/lib
$/icuuc
$(ICU_MAJOR
)$(ICU_MINOR
)$(DLLPOST
) \
282 $(BUILD_DIR
)$/lib
$/icuin
$(ICU_MAJOR
)$(ICU_MINOR
)$(DLLPOST
) \
283 $(BUILD_DIR
)$/lib
$/icule
$(ICU_MAJOR
)$(ICU_MINOR
)$(DLLPOST
) \
284 $(BUILD_DIR
)$/lib
$/icutu
$(ICU_MAJOR
)$(ICU_MINOR
)$(DLLPOST
) \
285 $(BUILD_DIR
)$/bin
$/genccode.exe \
286 $(BUILD_DIR
)$/bin
$/genbrk.exe \
287 $(BUILD_DIR
)$/bin
$/gencmn.exe
291 CONFIGURE_ACTION
+=bash .
/runConfigureICU Cygwin
/MSVC
292 BUILD_ACTION
=$(GNUMAKE
) -j
$(EXTMAXPROCESS
)
295 $(BUILD_DIR
)$/lib
$/icudt.lib \
296 $(BUILD_DIR
)$/lib
$/icuin
$(ICU_BUILD_LIBPOST
).lib \
297 $(BUILD_DIR
)$/lib
$/icuuc
$(ICU_BUILD_LIBPOST
).lib \
298 $(BUILD_DIR
)$/lib
$/icule
$(ICU_BUILD_LIBPOST
).lib \
299 $(BUILD_DIR
)$/lib
$/icutu
$(ICU_BUILD_LIBPOST
).lib
302 $(BUILD_DIR
)$/lib
$/icudt
$(ICU_MAJOR
).dll \
303 $(BUILD_DIR
)$/lib
$/icuin
$(ICU_MAJOR
)$(ICU_BUILD_LIBPOST
).dll \
304 $(BUILD_DIR
)$/lib
$/icuuc
$(ICU_MAJOR
)$(ICU_BUILD_LIBPOST
).dll \
305 $(BUILD_DIR
)$/lib
$/icule
$(ICU_MAJOR
)$(ICU_BUILD_LIBPOST
).dll \
306 $(BUILD_DIR
)$/lib
$/icutu
$(ICU_MAJOR
)$(ICU_BUILD_LIBPOST
).dll \
307 $(BUILD_DIR
)$/bin
$/genccode.exe \
308 $(BUILD_DIR
)$/bin
$/genbrk.exe \
309 $(BUILD_DIR
)$/bin
$/gencmn.exe
312 .ENDIF
# "$(GUI)"=="WNT"
314 #make sure that when we deliver the headers of a new icu that the timestamps
315 #are newer than the last icu to ensure dependencies are correctly rebuilt
316 INSTALL_ACTION
=find .
-name
"*.h" -print0 | xargs
-0 touch
318 # --- Targets ------------------------------------------------------
320 .INCLUDE
: set_ext.mk
324 .IF
"$(BINARY_PATCH_FILES)"!=""
326 $(PACKAGE_DIR
)$/so_add_binary
: $(PACKAGE_DIR
)$/$(ADD_FILES_FLAG_FILE
)
327 cd
$(PACKAGE_DIR
) && gunzip
-c
$(BACK_PATH
)$(BINARY_PATCH_FILES
) |
tar -xvf
-
328 $(TOUCH
) $(PACKAGE_DIR
)$/so_add_binary
330 $(PACKAGE_DIR
)$/$(CONFIGURE_FLAG_FILE
) : $(PACKAGE_DIR
)$/so_add_binary
334 .IF
"$(GUI)$(COM)"=="WNTGCC"
337 $(LB
)$/icuin
$(ICU_BUILD_LIBPOST
).lib \
338 $(LB
)$/icuuc
$(ICU_BUILD_LIBPOST
).lib \
339 $(LB
)$/icule
$(ICU_BUILD_LIBPOST
).lib \
340 $(LB
)$/icutu
$(ICU_BUILD_LIBPOST
).lib
342 $(LB
)$/icudata.lib
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
345 $(LB
)$/icuin
$(ICU_BUILD_LIBPOST
).lib
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
348 $(LB
)$/icuuc
$(ICU_BUILD_LIBPOST
).lib
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
351 $(LB
)$/icule
$(ICU_BUILD_LIBPOST
).lib
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)
354 $(LB
)$/icutu
$(ICU_BUILD_LIBPOST
).lib
: $(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)